@jacshuo/onyx 2.1.0 → 2.2.0

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 CHANGED
@@ -1,10 +1,10 @@
1
- 'use strict';Object.defineProperty(exports,'__esModule',{value:true});var clsx=require('clsx'),tailwindMerge=require('tailwind-merge'),classVarianceAuthority=require('class-variance-authority'),jsxRuntime=require('react/jsx-runtime'),Kr=require('react'),lucideReact=require('lucide-react'),reactDom=require('react-dom'),client=require('react-dom/client');function _interopDefault(e){return e&&e.__esModule?e:{default:e}}var Kr__default=/*#__PURE__*/_interopDefault(Kr);function i(...e){return tailwindMerge.twMerge(clsx.clsx(e))}var lr=classVarianceAuthority.cva("inline-flex cursor-pointer items-center justify-center gap-1.5 rounded font-medium transition-colors disabled:pointer-events-none disabled:opacity-50 [&_svg]:shrink-0",{variants:{intent:{primary:"bg-primary-500 text-white hover:bg-primary-600 active:bg-primary-700",secondary:"bg-secondary-500 text-white hover:bg-secondary-600 active:bg-secondary-700",danger:"bg-danger-500 text-white hover:bg-danger-600 active:bg-danger-700",warning:"bg-warning-500 text-white hover:bg-warning-600 active:bg-warning-700",ghost:"bg-transparent text-primary-700 hover:bg-primary-100 active:bg-primary-200 dark:text-primary-300 dark:hover:bg-primary-800",outline:"border border-primary-300 bg-transparent text-primary-700 hover:bg-primary-50 dark:border-primary-600 dark:text-primary-300 dark:hover:bg-primary-800"},size:{sm:"h-7 px-3 text-xs [&_svg]:h-3.5 [&_svg]:w-3.5",md:"h-9 px-4 text-sm [&_svg]:h-4 [&_svg]:w-4",lg:"h-11 px-6 text-base [&_svg]:h-5 [&_svg]:w-5"}},defaultVariants:{intent:"primary",size:"md"}}),mn=classVarianceAuthority.cva("inline-flex items-center gap-1 rounded border font-semibold [&_svg]:shrink-0",{variants:{intent:{success:"border-success-200 bg-success-100 text-success-800 dark:border-success-800 dark:bg-success-900/30 dark:text-success-400",warning:"border-warning-200 bg-warning-100 text-warning-800 dark:border-warning-800 dark:bg-warning-900/30 dark:text-warning-400",error:"border-danger-200 bg-danger-100 text-danger-800 dark:border-danger-800 dark:bg-danger-900/30 dark:text-danger-400",info:"border-primary-200 bg-primary-100 text-primary-800 dark:border-primary-800 dark:bg-primary-900/30 dark:text-primary-400",primary:"border-secondary-200 bg-secondary-100 text-secondary-700 dark:border-secondary-700 dark:bg-secondary-800 dark:text-secondary-300"},size:{sm:"px-1.5 py-0 text-[0.625rem] [&_svg]:h-2.5 [&_svg]:w-2.5",md:"px-2.5 py-0.5 text-xs [&_svg]:h-3 [&_svg]:w-3",lg:"px-3 py-1 text-sm [&_svg]:h-3.5 [&_svg]:w-3.5"}},defaultVariants:{intent:"primary",size:"md"}}),pn=classVarianceAuthority.cva("absolute flex items-center justify-center rounded-full font-bold leading-none ring-2 ring-white select-none pointer-events-none z-10 dark:ring-primary-900",{variants:{intent:{danger:"bg-danger-500 text-white",success:"bg-success-500 text-white",warning:"bg-warning-500 text-white",info:"bg-primary-500 text-white",primary:"bg-secondary-500 text-white"},size:{sm:"text-[0.5rem]",md:"text-[0.625rem]",lg:"text-xs"},dot:{true:"",false:""},placement:{"top-right":"top-0 right-0 translate-x-1/2 -translate-y-1/2","top-left":"top-0 left-0 -translate-x-1/2 -translate-y-1/2","bottom-right":"bottom-0 right-0 translate-x-1/2 translate-y-1/2","bottom-left":"bottom-0 left-0 -translate-x-1/2 translate-y-1/2"}},compoundVariants:[{dot:true,size:"sm",class:"h-1.5 w-1.5 min-w-0 ring-1"},{dot:true,size:"md",class:"h-2 w-2 min-w-0"},{dot:true,size:"lg",class:"h-2.5 w-2.5 min-w-0"},{dot:false,size:"sm",class:"h-4 min-w-4 px-1"},{dot:false,size:"md",class:"h-5 min-w-5 px-1.5"},{dot:false,size:"lg",class:"h-6 min-w-6 px-2"}],defaultVariants:{intent:"danger",size:"md",dot:false,placement:"top-right"}}),cr=classVarianceAuthority.cva("w-full rounded-md border bg-white text-secondary-900 transition-colors placeholder:text-secondary-400 focus:outline-none focus:ring-2 dark:bg-secondary-900 dark:text-secondary-100 dark:placeholder:text-secondary-600",{variants:{state:{default:"border-secondary-300 focus:border-primary-500 focus:ring-primary-500/20 dark:border-secondary-600",error:"border-danger-400 focus:border-danger-500 focus:ring-danger-500/20"},size:{sm:"h-7 px-2 text-xs",md:"h-9 px-3 py-2 text-sm",lg:"h-11 px-4 py-2.5 text-base"}},defaultVariants:{state:"default",size:"md"}}),un=classVarianceAuthority.cva("inline-flex items-center gap-1 font-medium [&_svg]:shrink-0",{variants:{size:{sm:"text-xs [&_svg]:h-3 [&_svg]:w-3",md:"text-sm [&_svg]:h-3.5 [&_svg]:w-3.5",lg:"text-base [&_svg]:h-4 [&_svg]:w-4"},intent:{default:"text-primary-700 dark:text-primary-300",muted:"text-primary-400 dark:text-primary-500",required:"text-primary-700 dark:text-primary-300 after:ml-0.5 after:text-danger-500 after:content-['*']"}},defaultVariants:{size:"md",intent:"default"}}),fn=classVarianceAuthority.cva("relative inline-flex shrink-0 items-center justify-center rounded border-2 transition-all duration-200 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-offset-2",{variants:{intent:{primary:"border-primary-300 dark:border-primary-600 focus-visible:ring-primary-500/40",secondary:"border-secondary-300 dark:border-secondary-600 focus-visible:ring-secondary-500/40",danger:"border-danger-300 dark:border-danger-600 focus-visible:ring-danger-500/40",warning:"border-warning-300 dark:border-warning-600 focus-visible:ring-warning-500/40",success:"border-success-300 dark:border-success-600 focus-visible:ring-success-500/40"},size:{sm:"h-4 w-4 rounded-[3px]",md:"h-5 w-5 rounded",lg:"h-6 w-6 rounded-[5px]"},checked:{on:"",off:"bg-white dark:bg-primary-900"}},compoundVariants:[{intent:"primary",checked:"on",class:"border-primary-500 bg-primary-500 dark:border-primary-500 dark:bg-primary-500"},{intent:"secondary",checked:"on",class:"border-secondary-500 bg-secondary-500 dark:border-secondary-500 dark:bg-secondary-500"},{intent:"danger",checked:"on",class:"border-danger-500 bg-danger-500 dark:border-danger-500 dark:bg-danger-500"},{intent:"warning",checked:"on",class:"border-warning-500 bg-warning-500 dark:border-warning-500 dark:bg-warning-500"},{intent:"success",checked:"on",class:"border-success-500 bg-success-500 dark:border-success-500 dark:bg-success-500"}],defaultVariants:{intent:"primary",size:"md",checked:"off"}}),gn=classVarianceAuthority.cva("relative inline-flex shrink-0 items-center justify-center rounded-full border-2 transition-all duration-200 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-offset-2",{variants:{intent:{primary:"border-primary-300 dark:border-primary-600 focus-visible:ring-primary-500/40",secondary:"border-secondary-300 dark:border-secondary-600 focus-visible:ring-secondary-500/40",danger:"border-danger-300 dark:border-danger-600 focus-visible:ring-danger-500/40",warning:"border-warning-300 dark:border-warning-600 focus-visible:ring-warning-500/40",success:"border-success-300 dark:border-success-600 focus-visible:ring-success-500/40"},size:{sm:"h-4 w-4",md:"h-5 w-5",lg:"h-6 w-6"},checked:{on:"",off:"bg-white dark:bg-primary-900"}},compoundVariants:[{intent:"primary",checked:"on",class:"border-primary-500 bg-primary-500 dark:border-primary-500 dark:bg-primary-500"},{intent:"secondary",checked:"on",class:"border-secondary-500 bg-secondary-500 dark:border-secondary-500 dark:bg-secondary-500"},{intent:"danger",checked:"on",class:"border-danger-500 bg-danger-500 dark:border-danger-500 dark:bg-danger-500"},{intent:"warning",checked:"on",class:"border-warning-500 bg-warning-500 dark:border-warning-500 dark:bg-warning-500"},{intent:"success",checked:"on",class:"border-success-500 bg-success-500 dark:border-success-500 dark:bg-success-500"}],defaultVariants:{intent:"primary",size:"md",checked:"off"}}),bn=classVarianceAuthority.cva("",{variants:{intent:{primary:"",secondary:"",danger:"",warning:"",success:""},size:{sm:"",md:"",lg:""},checked:{on:"",off:"bg-primary-300 dark:bg-primary-800"}},compoundVariants:[{intent:"primary",checked:"on",class:"bg-primary-500 dark:bg-primary-500"},{intent:"secondary",checked:"on",class:"bg-secondary-500 dark:bg-secondary-500"},{intent:"danger",checked:"on",class:"bg-danger-500 dark:bg-danger-500"},{intent:"warning",checked:"on",class:"bg-warning-500 dark:bg-warning-500"},{intent:"success",checked:"on",class:"bg-success-500 dark:bg-success-500"}],defaultVariants:{intent:"primary",size:"md",checked:"off"}}),Vr=classVarianceAuthority.cva("bg-primary-200 text-primary-700 dark:bg-primary-700 dark:text-primary-200",{variants:{size:{xs:"h-6 w-6 text-[10px]",sm:"h-8 w-8 text-xs",md:"h-10 w-10 text-sm",lg:"h-12 w-12 text-base",xl:"h-16 w-16 text-lg"},shape:{circular:"rounded-full",rounded:"rounded-lg",square:"rounded-none"}},defaultVariants:{size:"md",shape:"circular"}}),Ir=classVarianceAuthority.cva("relative flex w-full touch-none select-none items-center",{variants:{intent:{primary:"[&_.slider-fill]:bg-primary-500 [&_.slider-thumb]:border-primary-500",secondary:"[&_.slider-fill]:bg-secondary-500 [&_.slider-thumb]:border-secondary-500",success:"[&_.slider-fill]:bg-success-500 [&_.slider-thumb]:border-success-500",danger:"[&_.slider-fill]:bg-danger-500 [&_.slider-thumb]:border-danger-500",warning:"[&_.slider-fill]:bg-warning-500 [&_.slider-thumb]:border-warning-500"},size:{sm:"h-4",md:"h-5",lg:"h-6"}},defaultVariants:{intent:"primary",size:"md"}}),hn=classVarianceAuthority.cva("inline-flex items-center gap-1 rounded-full font-medium select-none transition-colors [&_svg]:shrink-0",{variants:{intent:{primary:"bg-primary-100 text-primary-700 dark:bg-primary-800 dark:text-primary-200",secondary:"bg-secondary-100 text-secondary-700 dark:bg-secondary-800 dark:text-secondary-200",success:"bg-success-100 text-success-700 dark:bg-success-900/40 dark:text-success-300",danger:"bg-danger-100 text-danger-700 dark:bg-danger-900/40 dark:text-danger-300",warning:"bg-warning-100 text-warning-700 dark:bg-warning-900/40 dark:text-warning-300",info:"bg-blue-100 text-blue-700 dark:bg-blue-900/40 dark:text-blue-300"},size:{sm:"h-5 px-2 text-[0.6875rem] gap-0.5",md:"h-6 px-2.5 text-xs gap-1",lg:"h-7 px-3 text-sm gap-1"},variant:{solid:"",outline:"bg-transparent border",soft:""}},compoundVariants:[{intent:"primary",variant:"outline",class:"border-primary-300 text-primary-700 dark:border-primary-600 dark:text-primary-300"},{intent:"secondary",variant:"outline",class:"border-secondary-300 text-secondary-700 dark:border-secondary-600 dark:text-secondary-300"},{intent:"success",variant:"outline",class:"border-success-400 text-success-700 dark:border-success-600 dark:text-success-300"},{intent:"danger",variant:"outline",class:"border-danger-400 text-danger-700 dark:border-danger-600 dark:text-danger-300"},{intent:"warning",variant:"outline",class:"border-warning-400 text-warning-700 dark:border-warning-600 dark:text-warning-300"},{intent:"info",variant:"outline",class:"border-blue-400 text-blue-700 dark:border-blue-600 dark:text-blue-300"}],defaultVariants:{intent:"primary",size:"md",variant:"solid"}});classVarianceAuthority.cva("relative w-full cursor-pointer rounded-md border bg-white text-sm transition-colors dark:bg-primary-900",{variants:{intent:{default:"border-primary-300 text-primary-900 hover:border-primary-400 focus-within:border-primary-500 focus-within:ring-2 focus-within:ring-primary-500/20 dark:border-primary-600 dark:text-primary-100 dark:hover:border-primary-500 dark:focus-within:border-primary-400",danger:"border-danger-500 text-primary-900 focus-within:ring-2 focus-within:ring-danger-500/20 dark:border-danger-500 dark:text-primary-100"},size:{sm:"h-7 px-2 text-xs",md:"h-9 px-3 text-sm",lg:"h-11 px-4 text-base"}},defaultVariants:{intent:"default",size:"md"}});function dr({intent:e,size:t,className:r,...n}){return jsxRuntime.jsx("button",{className:i(lr({intent:e,size:t}),r),...n})}function Fo(e,t){for(let r of e){if(r.value===t)return r;if(r.children){let n=Fo(r.children,t);if(n)return n}}}function _o(e){let t=[];for(let r of e)r.children?.length||t.push(r),r.children&&t.push(..._o(r.children));return t}var kn=40,kc=200,Bo=150,Qs=120;function vn(e,t,r,n){if(!n)return {};if(r){let s=(t-1-e)*kn;return {animation:`dropdown-item-out ${Bo}ms ease-in both ${s}ms`}}let o=e*kn;return {animation:`dropdown-item-in ${kc}ms ease-out both ${o}ms`}}function Js(e,t,r){if(!r)return {};if(t){let n=Math.max(e-1,0)*kn+Bo;return {animation:`dropdown-container-out ${Qs}ms ease-in both ${n}ms`}}return {animation:"var(--animate-dropdown-container-in)"}}function ei({options:e,onSelect:t,animated:r=true,closing:n=false,depth:o=0}){let[s,a]=Kr.useState(null),l=Kr.useRef(void 0),d=c=>{l.current&&clearTimeout(l.current),a(c);},m=()=>{l.current=setTimeout(()=>a(null),150);};return Kr.useEffect(()=>()=>{l.current&&clearTimeout(l.current);},[]),jsxRuntime.jsx("div",{className:i("absolute z-50 min-w-44 rounded-md border py-1 shadow-lg overflow-hidden","border-primary-200 dark:border-primary-700 dark:bg-primary-800 bg-white",o===0?"mt-1 w-full":"top-0 ml-0.5"),style:{...o>0?{left:"100%"}:{},...Js(e.length,n,r)},role:"listbox",children:e.map((c,f)=>{let p=!!c.children?.length,u=s===c.value;return jsxRuntime.jsxs("div",{className:"relative",style:vn(f,e.length,n,r),onMouseEnter:()=>d(c.value),onMouseLeave:m,children:[jsxRuntime.jsxs("div",{role:"option","aria-selected":false,"aria-disabled":c.disabled,className:i("flex w-full cursor-pointer items-center gap-2 px-3 py-1.5 text-left text-sm transition-colors","text-primary-700 hover:bg-primary-100 dark:text-primary-300 dark:hover:bg-primary-700/50",c.disabled&&"pointer-events-none opacity-50"),onClick:()=>{c.disabled||p||t(c.value,c);},children:[c.icon&&jsxRuntime.jsx("span",{className:"flex h-4 w-4 shrink-0 items-center justify-center",children:c.icon}),jsxRuntime.jsx("span",{className:"flex-1 truncate",children:c.label??c.value}),p&&jsxRuntime.jsx(lucideReact.ChevronRight,{className:"text-primary-400 h-3.5 w-3.5 shrink-0"})]}),p&&u&&jsxRuntime.jsx(ei,{options:c.children,onSelect:t,animated:r,depth:o+1})]},c.value)})})}function wc({options:e,filter:t,multiple:r,selected:n,canAdd:o,animated:s=true,closing:a=false,onSelect:l,onToggle:d,onAdd:m}){let c=Kr.useMemo(()=>_o(e),[e]),f=t.toLowerCase(),p=t?c.filter(g=>(g.label??g.value).toLowerCase().includes(f)||g.value.toLowerCase().includes(f)):c,u=p.length===0&&!o||o?1:0,h=p.length+u;return jsxRuntime.jsxs("div",{className:i("absolute z-50 mt-1 w-full max-h-60 min-w-44 overflow-y-auto rounded-md border py-1 shadow-lg","border-primary-200 dark:border-primary-700 dark:bg-primary-800 bg-white"),role:"listbox","aria-multiselectable":r||void 0,style:Js(h,a,s),children:[p.map((g,x)=>{let w=r&&n.includes(g.value);return jsxRuntime.jsxs("div",{role:"option","aria-selected":r?w:false,"aria-disabled":g.disabled,className:i("flex w-full cursor-pointer items-center gap-2 px-3 py-1.5 text-left text-sm transition-colors","text-primary-700 hover:bg-primary-100 dark:text-primary-300 dark:hover:bg-primary-700/50",g.disabled&&"pointer-events-none opacity-50"),style:vn(x,h,a,s),onClick:()=>{g.disabled||(r?d(g.value):l(g.value,g));},children:[r&&jsxRuntime.jsx("span",{className:i("flex h-4 w-4 shrink-0 items-center justify-center rounded border transition-colors",w?"border-primary-600 bg-primary-600 text-white dark:border-primary-500 dark:bg-primary-500":"border-secondary-300 bg-white dark:border-secondary-600 dark:bg-secondary-800"),children:w&&jsxRuntime.jsx(lucideReact.Check,{className:"h-3 w-3"})}),g.icon&&jsxRuntime.jsx("span",{className:"flex h-4 w-4 shrink-0 items-center justify-center",children:g.icon}),jsxRuntime.jsx("span",{className:"truncate",children:g.label??g.value})]},g.value)}),p.length===0&&!o&&jsxRuntime.jsx("div",{className:"text-primary-400 px-3 py-2 text-center text-sm",style:vn(0,1,a,s),children:"No matches"}),o&&jsxRuntime.jsxs("div",{className:i("flex w-full cursor-pointer items-center gap-2 px-3 py-1.5 text-left text-sm transition-colors","text-primary-600 hover:bg-primary-50 dark:text-primary-400 dark:hover:bg-primary-900/30"),style:vn(p.length,h,a,s),onClick:m,children:[jsxRuntime.jsx("span",{className:"flex h-4 w-4 shrink-0 items-center justify-center text-lg leading-none",children:"+"}),jsxRuntime.jsxs("span",{className:"truncate",children:["Add \u201C",t.trim(),"\u201D"]})]})]})}function zo(e){let{options:t,placeholder:r="Select\u2026",editable:n=false,onAddItem:o,disabled:s=false,align:a="left",className:l,size:d="md",animated:m=true,name:c,intent:f="default",clearable:p=false,id:u,"aria-describedby":h,"aria-invalid":g}=e,x=e.multiple===true,[w,y]=Kr.useState(x?void 0:e.defaultValue),[M,v]=Kr.useState(x?e.defaultSelected??[]:[]),N=x?e.selected??M:[],[L,R]=Kr.useState(false),[D,A]=Kr.useState(false),[V,k]=Kr.useState(""),O=Kr.useRef(null),C=Kr.useRef(null),X=Kr.useRef(void 0),T=Kr.useCallback(()=>{if(!m||!L){R(false),k("");return}A(true);let Q=(Math.max(t.length,1)-1)*kn+Bo+Qs+20;X.current=setTimeout(()=>{R(false),A(false),k("");},Q);},[m,L,t.length]);Kr.useEffect(()=>()=>{X.current&&clearTimeout(X.current);},[]);let re=x?void 0:e.value??w,_=Kr.useMemo(()=>re?Fo(t,re):void 0,[t,re]);Kr.useEffect(()=>{if(!L)return;let B=Q=>{O.current&&!O.current.contains(Q.target)&&T();};return document.addEventListener("mousedown",B),()=>document.removeEventListener("mousedown",B)},[L,T]),Kr.useEffect(()=>{if(!L)return;let B=Q=>{Q.key==="Escape"&&T();};return document.addEventListener("keydown",B),()=>document.removeEventListener("keydown",B)},[L,T]);let de=Kr.useCallback((B,Q)=>{x||(e.value===void 0&&y(B),e.onChange?.(B,Q)),X.current&&clearTimeout(X.current),R(false),A(false),k("");},[x,e]),J=Kr.useCallback(B=>{if(!x)return;let Q=e.selected??M,ve=Q.includes(B)?Q.filter(P=>P!==B):[...Q,B];e.selected===void 0&&v(ve),e.onSelectionChange?.(ve),e.onChange?.(ve);},[x,M,e]),pe=V.toLowerCase(),fe=Kr.useMemo(()=>!n||!V.trim()?false:!_o(t).some(Q=>Q.value.toLowerCase()===pe||(Q.label??Q.value).toLowerCase()===pe),[n,pe,t]),$=Kr.useCallback(()=>{let B=V.trim();B&&(o?.(B),k(""));},[V,o]),U=Kr.useCallback(B=>{B.stopPropagation(),x?(v([]),e.onSelectionChange?.([]),e.onChange?.([])):(y(void 0),e.onChange?.("",void 0));},[x,e]),me=Kr.useCallback(B=>{B.key==="Enter"&&fe&&(B.preventDefault(),$());},[fe,$]),j=Kr.useCallback(()=>{s||(L?T():(X.current&&clearTimeout(X.current),A(false),R(true),k(""),n&&requestAnimationFrame(()=>C.current?.focus())));},[s,L,T,n]),b;if(x){let B=N.length;B===0?b="":B<=2?b=N.map(Q=>Fo(t,Q)).map(Q=>Q?Q.label??Q.value:"").filter(Boolean).join(", "):b=`${B} selected`;}else b=_?_.label??_.value:"";let I=x||n,W=f==="danger"||g===true,K=p&&(x?N.length>0:!!b);return jsxRuntime.jsxs("div",{ref:O,className:i("relative inline-block min-w-44",l),children:[c&&!x&&jsxRuntime.jsx("input",{type:"hidden",name:c,value:re??""}),c&&x&&N.map(B=>jsxRuntime.jsx("input",{type:"hidden",name:`${c}[]`,value:B},B)),jsxRuntime.jsxs("div",{id:u,className:i(cr({state:W?"error":"default",size:d}),"flex cursor-pointer items-center gap-1",s&&"pointer-events-none opacity-50"),onClick:j,role:"combobox","aria-expanded":L,"aria-haspopup":"listbox","aria-invalid":W||void 0,"aria-describedby":h,children:[n?jsxRuntime.jsx("input",{ref:C,className:"min-w-0 flex-1 bg-transparent outline-none placeholder:text-secondary-400 dark:placeholder:text-secondary-600",value:L?V:b,placeholder:r,disabled:s,onChange:B=>{k(B.target.value),L||R(true);},onKeyDown:me,onClick:B=>{B.stopPropagation(),L||R(true);}}):jsxRuntime.jsx("span",{className:i("flex-1 truncate",!b&&"text-secondary-400 dark:text-secondary-600"),children:b||r}),_?.icon&&!n&&!x&&jsxRuntime.jsx("span",{className:"flex h-4 w-4 shrink-0 items-center justify-center",children:_.icon}),x&&N.length>0&&jsxRuntime.jsx("span",{className:"rounded-full bg-primary-100 px-1.5 text-xs font-semibold text-primary-700 dark:bg-primary-900 dark:text-primary-300",children:N.length}),K&&jsxRuntime.jsx("button",{type:"button","aria-label":"Clear selection",className:"flex h-4 w-4 shrink-0 items-center justify-center rounded-full text-secondary-400 transition-colors hover:bg-secondary-200 hover:text-secondary-600 dark:hover:bg-secondary-700 dark:hover:text-secondary-300",onClick:U,children:jsxRuntime.jsx(lucideReact.X,{className:"h-3 w-3"})}),jsxRuntime.jsx(lucideReact.ChevronDown,{className:i("text-primary-400 h-4 w-4 shrink-0 transition-transform",L&&"rotate-180")})]}),L&&jsxRuntime.jsx("div",{className:i(a==="right"?"right-0":"left-0","absolute w-full"),children:I?jsxRuntime.jsx(wc,{options:t,filter:V,multiple:x,selected:N,canAdd:fe,animated:m,closing:D,onSelect:de,onToggle:J,onAdd:$}):jsxRuntime.jsx(ei,{options:t,onSelect:de,animated:m,closing:D})})]})}function Rc(e,t){return e.key??(typeof e.label=="string"?e.label:String(t))}var wn=40,Mc=200,jo=150,ri=120;function Xo(e,t,r,n){if(!n)return {};if(r){let s=(t-1-e)*wn;return {animation:`dropdown-item-out ${jo}ms ease-in both ${s}ms`}}let o=e*wn;return {animation:`dropdown-item-in ${Mc}ms ease-out both ${o}ms`}}function Pc(e,t,r){if(!r)return {};if(t){let n=Math.max(e-1,0)*wn+jo;return {animation:`dropdown-container-out ${ri}ms ease-in both ${n}ms`}}return {animation:"var(--animate-dropdown-container-in)"}}function pr({label:e,items:t,intent:r,size:n,align:o="left",className:s,disabled:a,editable:l=false,onAddItem:d,multiple:m=false,selected:c=[],onSelectionChange:f,animated:p=true,chevron:u=true,...h}){let[g,x]=Kr.useState(false),[w,y]=Kr.useState(false),[M,v]=Kr.useState(""),N=Kr.useRef(null),L=Kr.useRef(null),R=Kr.useRef(void 0);Kr.useEffect(()=>()=>{R.current&&clearTimeout(R.current);},[]);let D=Kr.useCallback(()=>{if(!p||!g){x(false),v("");return}y(true);let pe=(Math.max(t.length,1)-1)*wn+jo+ri+20;R.current=setTimeout(()=>{x(false),y(false),v("");},pe);},[p,g,t.length]),A=Kr.useCallback(()=>{a||(g?D():(R.current&&clearTimeout(R.current),y(false),x(true),v(""),l&&requestAnimationFrame(()=>L.current?.focus())));},[a,g,D,l]);Kr.useEffect(()=>{if(!g)return;let J=pe=>{N.current&&!N.current.contains(pe.target)&&D();};return document.addEventListener("mousedown",J),()=>document.removeEventListener("mousedown",J)},[g,D]),Kr.useEffect(()=>{if(!g)return;let J=pe=>{pe.key==="Escape"&&D();};return document.addEventListener("keydown",J),()=>document.removeEventListener("keydown",J)},[g,D]);let V=M.toLowerCase(),k=Kr.useMemo(()=>M?t.filter(J=>(typeof J.label=="string"?J.label:J.key??"").toLowerCase().includes(V)):t,[t,V]),O=Kr.useMemo(()=>!l||!M.trim()?false:!t.some(J=>(typeof J.label=="string"?J.label:J.key??"").toLowerCase()===V),[l,V,t]),C=Kr.useCallback(()=>{let J=M.trim();J&&(d?.(J),v(""));},[M,d]),X=Kr.useCallback(J=>{J.key==="Enter"&&O&&(J.preventDefault(),C());},[O,C]),T=Kr.useCallback(J=>{let pe=c.includes(J)?c.filter(fe=>fe!==J):[...c,J];f?.(pe);},[c,f]),re=m&&c.length>0?jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[e," ",jsxRuntime.jsx("span",{className:"ml-1 rounded-full bg-white/20 px-1.5 text-xs font-semibold",children:c.length})]}):e,_=k.length===0&&!O||O?1:0,de=k.length+_;return jsxRuntime.jsxs("div",{ref:N,className:"relative inline-block",children:[jsxRuntime.jsxs("button",{type:"button",onClick:A,disabled:a,className:i(lr({intent:r,size:n}),"inline-flex items-center gap-1",s),"aria-haspopup":m?"listbox":"true","aria-expanded":g?"true":"false",...h,children:[re,u&&jsxRuntime.jsx(lucideReact.ChevronDown,{className:i("h-3.5 w-3.5 transition-transform",g&&"rotate-180")})]}),g&&jsxRuntime.jsxs("div",{className:i("absolute z-50 mt-1 min-w-44 rounded-md border py-1 shadow-lg","border-primary-200 dark:border-primary-700 dark:bg-primary-800 bg-white",o==="right"?"right-0":"left-0"),style:Pc(de,w,p),role:m?"listbox":"menu","aria-multiselectable":m||void 0,children:[l&&jsxRuntime.jsx("div",{className:"border-primary-200 dark:border-primary-700 border-b px-2 pb-1.5 pt-1",children:jsxRuntime.jsx("input",{ref:L,type:"text",value:M,onChange:J=>v(J.target.value),onKeyDown:X,placeholder:"Type to filter or add\u2026",className:"w-full bg-transparent text-sm text-secondary-900 placeholder:text-secondary-400 focus:outline-none dark:text-secondary-100 dark:placeholder:text-secondary-600"})}),jsxRuntime.jsxs("div",{className:"max-h-60 overflow-y-auto",children:[k.map((J,pe)=>{let fe=Rc(J,pe),$=m&&c.includes(fe);return jsxRuntime.jsxs(Kr__default.default.Fragment,{children:[J.divider&&jsxRuntime.jsx("div",{className:"border-primary-200 dark:border-primary-700 my-1 border-t"}),jsxRuntime.jsxs("button",{type:"button",role:m?"option":"menuitem","aria-selected":m?$:void 0,disabled:J.disabled,className:i("flex w-full cursor-pointer items-center gap-2 px-3 py-1.5 text-left text-sm transition-colors","text-primary-700 hover:bg-primary-100 dark:text-primary-300 dark:hover:bg-primary-700/50",J.disabled&&"pointer-events-none opacity-50"),style:Xo(pe,de,w,p),onClick:()=>{m?T(fe):(J.onClick?.(),R.current&&clearTimeout(R.current),x(false),y(false),v(""));},children:[m&&jsxRuntime.jsx("span",{className:i("flex h-4 w-4 shrink-0 items-center justify-center rounded border transition-colors",$?"border-primary-600 bg-primary-600 text-white dark:border-primary-500 dark:bg-primary-500":"border-secondary-300 bg-white dark:border-secondary-600 dark:bg-secondary-800"),children:$&&jsxRuntime.jsx(lucideReact.Check,{className:"h-3 w-3"})}),jsxRuntime.jsx("span",{className:"flex-1 truncate",children:J.label})]})]},fe)}),k.length===0&&!O&&jsxRuntime.jsx("div",{className:"text-primary-400 px-3 py-2 text-center text-sm",style:Xo(0,1,w,p),children:"No matches"}),O&&jsxRuntime.jsxs("button",{type:"button",className:i("flex w-full cursor-pointer items-center gap-2 px-3 py-1.5 text-left text-sm transition-colors","text-primary-600 hover:bg-primary-50 dark:text-primary-400 dark:hover:bg-primary-900/30"),style:Xo(k.length,de,w,p),onClick:C,children:[jsxRuntime.jsx("span",{className:"flex h-4 w-4 shrink-0 items-center justify-center text-lg leading-none",children:"+"}),jsxRuntime.jsxs("span",{className:"truncate",children:["Add \u201C",M.trim(),"\u201D"]})]})]})]})]})}function Wo({intent:e,size:t,className:r,...n}){return jsxRuntime.jsx("span",{className:i(mn({intent:e,size:t}),r),...n})}function Go({intent:e,size:t,variant:r,icon:n,removable:o,onRemove:s,disabled:a,dot:l,className:d,children:m,...c}){return jsxRuntime.jsxs("span",{className:i(hn({intent:e,size:t,variant:r}),a&&"pointer-events-none opacity-50",d),"aria-disabled":a,...c,children:[l&&jsxRuntime.jsx("span",{className:i("inline-block h-1.5 w-1.5 shrink-0 rounded-full",e==="success"&&"bg-success-500",e==="danger"&&"bg-danger-500",e==="warning"&&"bg-warning-500",(!e||e==="primary")&&"bg-primary-500",e==="secondary"&&"bg-secondary-500",e==="info"&&"bg-blue-500")}),n&&jsxRuntime.jsx("span",{className:"shrink-0 [&_svg]:h-[1em] [&_svg]:w-[1em]",children:n}),m&&jsxRuntime.jsx("span",{children:m}),o&&jsxRuntime.jsx("button",{type:"button","aria-label":"Remove tag",onClick:f=>{f.stopPropagation(),s?.();},disabled:a,className:i("ml-0.5 -mr-0.5 inline-flex items-center justify-center rounded-full p-0.5 transition-colors hover:bg-black/10 dark:hover:bg-white/20 focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-current"),children:jsxRuntime.jsx(lucideReact.X,{className:"h-[0.75em] w-[0.75em]"})})]})}var Vc={danger:"bg-danger-500",success:"bg-success-500",warning:"bg-warning-500",info:"bg-primary-500",primary:"bg-secondary-500"};function Yo({children:e,show:t=true,content:r,dot:n,intent:o="danger",size:s="md",placement:a="top-right",pulse:l=false,className:d}){let m=n??r==null,c=m?null:typeof r=="number"?r>99?"99+":String(r):r;return jsxRuntime.jsxs("div",{className:"relative inline-flex",children:[e,t&&jsxRuntime.jsxs("span",{className:i(pn({intent:o,size:s,dot:m,placement:a}),d),role:typeof r=="number"?"status":void 0,"aria-label":typeof r=="number"?String(r):void 0,children:[l&&jsxRuntime.jsx("span",{className:i("absolute inset-0 rounded-full animate-ping opacity-60",Vc[o??"danger"]),"aria-hidden":"true"}),c]})]})}function Uo({intent:e,size:t,className:r,...n}){return jsxRuntime.jsx("label",{className:i(un({intent:e,size:t}),r),...n})}var Hc={sm:{wrapper:"h-7 text-xs",prefix:"px-2 text-xs [&_svg]:h-3 [&_svg]:w-3",input:"px-2 text-xs",icon:"px-1.5 [&_svg]:h-3 [&_svg]:w-3"},md:{wrapper:"h-9 text-sm",prefix:"px-3 text-sm [&_svg]:h-4 [&_svg]:w-4",input:"px-3 py-2 text-sm",icon:"px-2 [&_svg]:h-4 [&_svg]:w-4"},lg:{wrapper:"h-11 text-base",prefix:"px-4 text-base [&_svg]:h-5 [&_svg]:w-5",input:"px-4 py-2.5 text-base",icon:"px-2.5 [&_svg]:h-5 [&_svg]:w-5"}},Fc={default:"border-secondary-300 focus-within:border-primary-500 focus-within:ring-2 focus-within:ring-primary-500/20 dark:border-secondary-600",error:"border-danger-400 focus-within:border-danger-500 focus-within:ring-2 focus-within:ring-danger-500/20"};function qo({state:e="default",inputSize:t="md",className:r,prefix:n,suffix:o,action:s,...a}){if(!n&&!o&&!s)return jsxRuntime.jsx("input",{className:i(cr({state:e,size:t}),r),...a});let l=Hc[t??"md"],d=Fc[e??"default"];return jsxRuntime.jsxs("div",{className:i("flex w-full items-center overflow-hidden rounded-md border bg-white transition-colors dark:bg-secondary-900",l.wrapper,d,r),children:[n&&jsxRuntime.jsx("span",{className:i("flex shrink-0 items-center gap-1.5 self-stretch border-r border-secondary-300 bg-secondary-50 font-medium text-secondary-600 dark:border-secondary-600 dark:bg-secondary-800 dark:text-secondary-300",l.prefix),children:n}),jsxRuntime.jsx("input",{className:i("min-w-0 flex-1 bg-transparent text-secondary-900 placeholder:text-secondary-400 focus:outline-none dark:text-secondary-100 dark:placeholder:text-secondary-600",l.input,n&&"pl-2"),...a}),o&&jsxRuntime.jsx("span",{className:i("pointer-events-none flex shrink-0 items-center text-secondary-400 dark:text-secondary-500",l.icon),children:o}),s&&jsxRuntime.jsx("button",{type:"button",onClick:s.onClick,"aria-label":s["aria-label"]??"Action",className:i("flex shrink-0 items-center text-secondary-500 transition-colors hover:text-primary-600 dark:text-secondary-400 dark:hover:text-primary-400",l.icon),children:s.icon})]})}var Oc={sm:"px-2 py-1.5 text-xs min-h-[60px]",md:"px-3 py-2 text-sm min-h-[80px]",lg:"px-4 py-2.5 text-base min-h-[100px]"},Kc={default:"border-secondary-400 focus:border-primary-500 focus:ring-2 focus:ring-primary-500/20 dark:border-secondary-600",error:"border-danger-400 focus:border-danger-500 focus:ring-2 focus:ring-danger-500/20"};function Xc(e){if(!e)return 0;let t="\u2E80-\u2EFF\u3000-\u303F\u3040-\u309F\u30A0-\u30FF\u3400-\u4DBF\u4E00-\u9FFF\uAC00-\uD7AF\uF900-\uFAFF\uFE30-\uFE4F\uFF00-\uFFEF",r=new RegExp(`[${t}]`),n=0,o="",s=()=>{let a=o.trim();a&&(n+=a.split(/\s+/).length),o="";};for(let a of e)r.test(a)?(s(),n+=1):o+=a;return s(),n}function Zo({state:e="default",size:t="md",showWordCount:r=false,maxWords:n,className:o,value:s,defaultValue:a,onChange:l,disabled:d,...m}){let[c,f]=Kr.useState(()=>a??""),p=s!==void 0?String(s):c,u=Kr.useCallback(x=>{s===void 0&&f(x.target.value),l?.(x);},[s,l]),h=Kr.useMemo(()=>Xc(p),[p]),g=n!=null&&h>n;return jsxRuntime.jsxs("div",{className:i("inline-flex w-full flex-col",o),children:[jsxRuntime.jsx("textarea",{value:p,onChange:u,disabled:d,className:i("w-full resize-y rounded-md border bg-white text-secondary-900 transition-colors placeholder:text-secondary-400 focus:outline-none dark:bg-secondary-900 dark:text-secondary-100 dark:placeholder:text-secondary-600",Oc[t],Kc[g?"error":e],d&&"pointer-events-none opacity-50"),...m}),(r||n!=null)&&jsxRuntime.jsx("span",{className:i("mt-1 self-end text-xs",g?"text-danger-500 dark:text-danger-400":"text-secondary-400 dark:text-secondary-500"),children:n!=null?`${h} / ${n} words`:`${h} words`})]})}var Uc={sm:{trackFixed:"h-5 w-9",trackH:"h-5 min-w-9",thumb:"h-3.5 w-3.5",thumbTop:"top-[3px]",thumbOff:"left-[2px]",thumbOn:"left-[calc(100%-16px)]",pad:"pl-[6px] pr-[18px]",contentLeft:"left-[6px]",contentRight:"right-[6px]",icon:"text-[10px] [&_svg]:h-3 [&_svg]:w-3"},md:{trackFixed:"h-6 w-11",trackH:"h-6 min-w-11",thumb:"h-4.5 w-4.5",thumbTop:"top-[3px]",thumbOff:"left-[2px]",thumbOn:"left-[calc(100%-20px)]",pad:"pl-[7px] pr-[23px]",contentLeft:"left-[7px]",contentRight:"right-[7px]",icon:"text-xs [&_svg]:h-3.5 [&_svg]:w-3.5"},lg:{trackFixed:"h-7 w-14",trackH:"h-7 min-w-14",thumb:"h-5.5 w-5.5",thumbTop:"top-[3px]",thumbOff:"left-[3px]",thumbOn:"left-[calc(100%-25px)]",pad:"pl-[8px] pr-[28px]",contentLeft:"left-[8px]",contentRight:"right-[8px]",icon:"text-sm [&_svg]:h-4 [&_svg]:w-4"}},qc={primary:"text-primary-100",secondary:"text-secondary-100",danger:"text-danger-100",warning:"text-warning-100",success:"text-success-100"};function Qo({checked:e,defaultChecked:t=false,onCheckedChange:r,checkedContent:n,uncheckedContent:o,intent:s,size:a,label:l,id:d,className:m,disabled:c,...f}){let p=Kr.useId(),u=d??p,h=a??"md",g=s??"primary",x=Uc[h],w=n!=null||o!=null,[y,M]=Kr.useState(t),v=e??y,N=Kr.useCallback(L=>{let R=L.target.checked;e===void 0&&M(R),r?.(R);},[e,r]);return jsxRuntime.jsxs("label",{htmlFor:u,className:i("inline-flex cursor-pointer items-center gap-2",c&&"pointer-events-none opacity-50",m),children:[jsxRuntime.jsx("input",{...f,id:u,type:"checkbox",role:"switch",className:"sr-only",checked:v,disabled:c,onChange:N,"aria-checked":v}),jsxRuntime.jsxs("span",{className:i("relative inline-flex shrink-0 items-center rounded-full transition-colors duration-200",w?x.trackH:x.trackFixed,bn({intent:s,size:a,checked:v?"on":"off"})),children:[w?jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsxs("span",{className:i("pointer-events-none invisible inline-grid",x.icon),children:[jsxRuntime.jsx("span",{className:i("[grid-area:1/1] whitespace-nowrap",x.pad),children:n}),jsxRuntime.jsx("span",{className:i("[grid-area:1/1] whitespace-nowrap",x.pad),children:o})]}),jsxRuntime.jsx("span",{className:i("absolute top-1/2 -translate-y-1/2 whitespace-nowrap font-medium leading-none transition-opacity duration-200",x.contentLeft,x.icon,qc[g],v?"opacity-100":"opacity-0"),children:n}),jsxRuntime.jsx("span",{className:i("absolute top-1/2 -translate-y-1/2 whitespace-nowrap font-medium leading-none transition-opacity duration-200",x.contentRight,x.icon,"text-primary-400 dark:text-primary-500",v?"opacity-0":"opacity-100"),children:o})]}):null,jsxRuntime.jsx("span",{className:i("pointer-events-none absolute rounded-full bg-white shadow-sm transition-[left] duration-200 ease-in-out",x.thumb,x.thumbTop,v?x.thumbOn:x.thumbOff)})]}),l&&jsxRuntime.jsx("span",{className:"select-none text-sm text-primary-700 dark:text-primary-300",children:l})]})}var td={sm:"h-3 w-3",md:"h-3.5 w-3.5",lg:"h-4 w-4"};function Jo({checked:e,defaultChecked:t=false,indeterminate:r=false,onCheckedChange:n,intent:o,size:s,label:a,id:l,className:d,disabled:m,...c}){let f=Kr.useId(),p=l??f,u=s??"md",[h,g]=Kr.useState(t),x=e??h,w=Kr.useCallback(M=>{let v=M.target.checked;e===void 0&&g(v),n?.(v);},[e,n]),y=x||r;return jsxRuntime.jsxs("label",{htmlFor:p,className:i("inline-flex cursor-pointer items-center gap-2 select-none",m&&"pointer-events-none opacity-50",d),children:[jsxRuntime.jsx("input",{...c,id:p,type:"checkbox",className:"sr-only",checked:x,disabled:m,onChange:w}),jsxRuntime.jsx("span",{className:i(fn({intent:o,size:s,checked:y?"on":"off"})),children:jsxRuntime.jsx("svg",{viewBox:"0 0 16 16",fill:"none",className:i("text-white transition-all duration-200",td[u],y?"scale-100 opacity-100":"scale-0 opacity-0"),children:r?jsxRuntime.jsx("line",{x1:"3",y1:"8",x2:"13",y2:"8",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round"}):jsxRuntime.jsx("path",{d:"M3.5 8.5L6.5 11.5L12.5 4.5",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})}),a&&jsxRuntime.jsx("span",{className:"text-sm text-primary-700 dark:text-primary-300",children:a})]})}var ii=Kr.createContext(null);function ea({name:e,value:t,defaultValue:r,onValueChange:n,intent:o,size:s,disabled:a,orientation:l="vertical",className:d,children:m}){let c=Kr.useId(),f=e??c,[p,u]=Kr.useState(r),h=t??p,g=Kr.useCallback(x=>{t===void 0&&u(x),n?.(x);},[t,n]);return jsxRuntime.jsx(ii.Provider,{value:{name:f,value:h,onChange:g,intent:o,size:s,disabled:a},children:jsxRuntime.jsx("div",{role:"radiogroup",className:i("flex gap-2",l==="vertical"?"flex-col":"flex-row flex-wrap",d),children:m})})}var sd={sm:"h-1.5 w-1.5",md:"h-2 w-2",lg:"h-2.5 w-2.5"};function ta({value:e,intent:t,size:r,label:n,id:o,className:s,disabled:a,...l}){let d=Kr.useId(),m=o??d,c=Kr.useContext(ii),f=t??c?.intent,p=r??c?.size,u=p??"md",h=a??c?.disabled,g=l.name??c?.name,x=c?c.value===e:void 0,w=Kr.useCallback(y=>{y.target.checked&&c?.onChange(e);},[c,e]);return jsxRuntime.jsxs("label",{htmlFor:m,className:i("inline-flex cursor-pointer items-center gap-2 select-none",h&&"pointer-events-none opacity-50",s),children:[jsxRuntime.jsx("input",{...l,id:m,type:"radio",name:g,value:e,className:"sr-only",checked:x,disabled:h,onChange:w}),jsxRuntime.jsx("span",{className:i(gn({intent:f,size:p,checked:x?"on":"off"})),children:jsxRuntime.jsx("span",{className:i("rounded-full bg-white transition-all duration-200",sd[u],x?"scale-100 opacity-100":"scale-0 opacity-0")})}),n&&jsxRuntime.jsx("span",{className:"text-sm text-primary-700 dark:text-primary-300",children:n})]})}function dd(e,t){if(t)return t.slice(0,2).toUpperCase();if(!e)return "?";let r=e.trim().split(/\s+/);return r.length>=2?(r[0][0]+r[r.length-1][0]).toUpperCase():e.slice(0,2).toUpperCase()}var md={online:"ring-2 ring-success-500",offline:"ring-2 ring-secondary-400",busy:"ring-2 ring-danger-500",away:"ring-2 ring-warning-500"};function Tn({src:e,alt:t,initials:r,size:n,shape:o,status:s,className:a,...l}){let[d,m]=Kr.useState(false),c=e&&!d,f=dd(t,r);return jsxRuntime.jsx("span",{role:"img","aria-label":t??f,className:i(Vr({size:n,shape:o}),s&&md[s],"relative inline-flex shrink-0 select-none items-center justify-center overflow-hidden",a),...l,children:c?jsxRuntime.jsx("img",{src:e,alt:t,className:"h-full w-full object-cover",onError:()=>m(true),draggable:false}):jsxRuntime.jsx("span",{className:"font-semibold leading-none tracking-wide",children:f})})}function Rn({children:e,max:t=4,overlap:r="left",className:n}){let o=Kr__default.default.Children.toArray(e),s=o.slice(0,t),a=o.length-t;return jsxRuntime.jsxs("span",{className:i("inline-flex items-center",r==="left"?"-space-x-3":"flex-row-reverse -space-x-3",n),children:[s.map((d,m)=>jsxRuntime.jsx("span",{className:"ring-2 ring-white dark:ring-primary-900 rounded-full",children:d},m)),a>0&&jsxRuntime.jsxs("span",{"aria-label":`${a} more`,className:i(Vr({size:"md",shape:"circular"}),"relative inline-flex shrink-0 select-none items-center justify-center","ring-2 ring-white dark:ring-primary-900","bg-secondary-200 text-secondary-700 dark:bg-secondary-700 dark:text-secondary-200 font-semibold text-xs"),children:["+",a]})]})}function St(e,t,r){return Math.min(Math.max(e,t),r)}function ud(e,t,r){return Math.round((e-t)/r)*r+t}function ra(e,t,r){return (e-t)/(r-t)*100}function ci(e,t,r,n){let o=t+e/100*(r-t);return ud(o,t,n)}function mi(e,t,r,n,o,s){let a=Kr.useRef(false),l=Kr.useCallback(f=>{let p=e.current;if(!p)return 0;let u=p.getBoundingClientRect(),g=(("touches"in f?f.touches[0].clientX:f.clientX)-u.left)/u.width*100;return St(g,0,100)},[e]),d=Kr.useCallback(f=>{if(o)return;f.currentTarget.setPointerCapture(f.pointerId),a.current=true;let p=e.current;if(!p)return;let u=p.getBoundingClientRect(),h=(f.clientX-u.left)/u.width*100;s?.(ci(St(h,0,100),t,r,n));},[o,l,t,r,n,s,e]),m=Kr.useCallback(f=>{if(!a.current||o)return;let p=e.current;if(!p)return;let u=p.getBoundingClientRect(),h=(f.clientX-u.left)/u.width*100;s?.(ci(St(h,0,100),t,r,n));},[o,t,r,n,s,e]),c=Kr.useCallback(()=>{a.current=false;},[]);return {startDrag:d,onPointerMove:m,stopDrag:c}}function Pn({mode:e,value:t,defaultValue:r=0,onChange:n,min:o=0,max:s=100,step:a=1,intent:l,size:d,disabled:m,showValue:c=false,formatValue:f=String,label:p,className:u,...h}){let[g,x]=Kr.useState(r),w=t!==void 0,y=w?t:g,M=Kr.useId(),v=Kr.useRef(null),N=Kr.useCallback(k=>{let O=St(k,o,s);w||x(O),n?.(O);},[w,o,s,n]),{startDrag:L,onPointerMove:R,stopDrag:D}=mi(v,o,s,a,m,N),A=ra(y,o,s),V=k=>{let O=k.key==="ArrowRight"||k.key==="ArrowUp"?a:k.key==="ArrowLeft"||k.key==="ArrowDown"?-a:k.key==="Home"?-(y-o):k.key==="End"?s-y:0;O!==0&&(k.preventDefault(),N(y+O));};return jsxRuntime.jsxs("div",{className:i("slider-root flex flex-col gap-1",u),children:[(p||c)&&jsxRuntime.jsxs("div",{className:"flex items-center justify-between",children:[p&&jsxRuntime.jsx("label",{htmlFor:M,className:"text-sm font-medium text-primary-700 dark:text-primary-300",children:p}),c&&jsxRuntime.jsx("span",{className:"text-sm font-semibold text-primary-600 dark:text-primary-400",children:f(y)})]}),jsxRuntime.jsx("div",{...h,ref:v,className:i(Ir({intent:l,size:d}),m&&"opacity-40 cursor-not-allowed"),onPointerDown:L,onPointerMove:R,onPointerUp:D,onPointerCancel:D,style:{touchAction:"none"},children:jsxRuntime.jsxs("div",{className:"relative h-1.5 w-full grow rounded-full bg-primary-200 dark:bg-primary-700",children:[jsxRuntime.jsx("div",{className:"slider-fill absolute left-0 top-0 h-full rounded-full transition-none",style:{width:`${A}%`}}),jsxRuntime.jsx("div",{id:M,role:"slider",tabIndex:m?-1:0,"aria-valuemin":o,"aria-valuemax":s,"aria-valuenow":y,"aria-disabled":m,onKeyDown:V,className:i("slider-thumb absolute top-1/2 -translate-x-1/2 -translate-y-1/2","h-4 w-4 rounded-full border-2 bg-white shadow-md","transition-transform focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary-500/40 focus-visible:scale-110",!m&&"cursor-grab active:cursor-grabbing active:scale-110"),style:{left:`${A}%`}})]})})]})}function Sn({value:e,defaultValue:t=[20,80],onChange:r,min:n=0,max:o=100,step:s=1,intent:a,size:l,disabled:d,showValue:m=false,formatValue:c=String,label:f,className:p,...u}){let[h,g]=Kr.useState(t),x=e!==void 0,[w,y]=x?e:h,M=Kr.useRef(null),v=Kr.useRef("lo"),N=Kr.useCallback(X=>{x||g(X),r?.(X);},[x,r]),L=Kr.useCallback(X=>{v.current==="lo"?N([St(X,n,y),y]):N([w,St(X,w,o)]);},[w,y,n,o,N]),{startDrag:R,onPointerMove:D,stopDrag:A}=mi(M,n,o,s,d,L),V=ra(w,n,o),k=ra(y,n,o),O=X=>T=>{v.current=X,R(T);},C=X=>T=>{let _=T.key==="ArrowRight"||T.key==="ArrowUp"?s:T.key==="ArrowLeft"||T.key==="ArrowDown"?-s:0;_!==0&&(T.preventDefault(),N(X==="lo"?[St(w+_,n,y),y]:[w,St(y+_,w,o)]));};return jsxRuntime.jsxs("div",{className:i("slider-root flex flex-col gap-1",p),children:[(f||m)&&jsxRuntime.jsxs("div",{className:"flex items-center justify-between",children:[f&&jsxRuntime.jsx("span",{className:"text-sm font-medium text-primary-700 dark:text-primary-300",children:f}),m&&jsxRuntime.jsxs("span",{className:"text-sm font-semibold text-primary-600 dark:text-primary-400",children:[c(w)," \u2013 ",c(y)]})]}),jsxRuntime.jsx("div",{...u,ref:M,className:i(Ir({intent:a,size:l}),d&&"opacity-40 cursor-not-allowed"),onPointerMove:D,onPointerUp:A,onPointerCancel:A,style:{touchAction:"none"},children:jsxRuntime.jsxs("div",{className:"relative h-1.5 w-full rounded-full bg-primary-200 dark:bg-primary-700",children:[jsxRuntime.jsx("div",{className:"slider-fill absolute top-0 h-full rounded-full",style:{left:`${V}%`,width:`${k-V}%`}}),jsxRuntime.jsx("div",{role:"slider",tabIndex:d?-1:0,"aria-valuemin":n,"aria-valuemax":y,"aria-valuenow":w,"aria-label":"Range start","aria-disabled":d,onPointerDown:O("lo"),onKeyDown:C("lo"),className:i("slider-thumb absolute top-1/2 -translate-x-1/2 -translate-y-1/2","h-4 w-4 rounded-full border-2 bg-white shadow-md","transition-transform focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary-500/40 focus-visible:scale-110",!d&&"cursor-grab active:cursor-grabbing active:scale-110"),style:{left:`${V}%`,zIndex:w>y-s?3:2}}),jsxRuntime.jsx("div",{role:"slider",tabIndex:d?-1:0,"aria-valuemin":w,"aria-valuemax":o,"aria-valuenow":y,"aria-label":"Range end","aria-disabled":d,onPointerDown:O("hi"),onKeyDown:C("hi"),className:i("slider-thumb absolute top-1/2 -translate-x-1/2 -translate-y-1/2","h-4 w-4 rounded-full border-2 bg-white shadow-md","transition-transform focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary-500/40 focus-visible:scale-110",!d&&"cursor-grab active:cursor-grabbing active:scale-110"),style:{left:`${k}%`,zIndex:2}})]})})]})}var fd={Button:dr,Dropdown:zo,DropdownButton:pr,Badge:Wo,Tag:Go,Indicator:Yo,Label:Uo,Input:qo,TextBox:Zo,Switch:Qo,Checkbox:Jo,Radio:ta,RadioGroup:ea,Avatar:Tn,AvatarGroup:Rn,Slider:Pn,SliderRange:Sn},na=fd;var _r=classVarianceAuthority.cva("rounded-lg transition-shadow",{variants:{intent:{default:"border border-primary-200 bg-white dark:border-primary-700 dark:bg-primary-900",elevated:"bg-white shadow-md hover:shadow-lg dark:bg-primary-800 dark:shadow-primary-300/25 dark:hover:shadow-primary-200/30",outlined:"border-2 border-primary-300 bg-transparent dark:border-primary-600",ghost:"bg-primary-50 dark:bg-primary-800/50"},size:{sm:"p-3",md:"p-5",lg:"p-7"}},defaultVariants:{intent:"default",size:"md"}}),Ln=classVarianceAuthority.cva("rounded-md",{variants:{intent:{default:"border border-primary-200 bg-white dark:border-primary-700 dark:bg-primary-900",inset:"bg-primary-50 dark:bg-primary-800/50",elevated:"bg-white shadow-lg dark:bg-primary-800 dark:shadow-primary-300/25"},size:{sm:"p-3",md:"p-4",lg:"p-6"}},defaultVariants:{intent:"default",size:"md"}});function oa({intent:e,size:t,className:r,...n}){return jsxRuntime.jsx("div",{className:i(_r({intent:e,size:t}),r),...n})}function gd({className:e,...t}){return jsxRuntime.jsx("div",{className:i("mb-4 space-y-1",e),...t})}function bd({className:e,...t}){return jsxRuntime.jsx("h3",{className:i("text-primary-900 dark:text-primary-100 text-lg font-semibold",e),...t})}function hd({className:e,...t}){return jsxRuntime.jsx("p",{className:i("text-primary-500 dark:text-primary-400 text-sm",e),...t})}function xd({className:e,...t}){return jsxRuntime.jsx("div",{className:i("text-primary-700 dark:text-primary-300 text-sm",e),...t})}function yd({className:e,...t}){return jsxRuntime.jsx("div",{className:i("border-primary-100 dark:border-primary-800 mt-4 flex items-center gap-2 border-t pt-4",e),...t})}function vd({intent:e,media:t,mediaPosition:r="left",stackOnMobile:n=false,className:o,children:s,...a}){let l=jsxRuntime.jsx("div",{className:i("relative shrink-0 overflow-hidden",n?"h-48 w-full rounded-t-lg sm:h-auto sm:w-auto":"",!n&&(r==="left"?"rounded-l-lg":"rounded-r-lg")),style:n?void 0:{width:t.width??"10rem"},children:t.src?jsxRuntime.jsx("img",{src:t.src,alt:t.alt??"",className:"h-full w-full object-cover",draggable:false}):t.icon?jsxRuntime.jsx("div",{className:"bg-primary-100 text-primary-500 dark:bg-primary-800 dark:text-primary-400 flex h-full w-full items-center justify-center",children:t.icon}):null});return jsxRuntime.jsxs("div",{className:i(_r({intent:e}),"flex overflow-hidden p-0",n?"flex-col sm:flex-row":"",!n&&r==="right"&&"flex-row-reverse",!n&&r==="left"&&"flex-row",o),...a,children:[l,jsxRuntime.jsx("div",{className:"flex min-w-0 flex-1 flex-col p-4",children:s})]})}function aa({src:e,alt:t="",aspectRatio:r="16/9",className:n,children:o,...s}){return jsxRuntime.jsxs("div",{className:i("group overflow-hidden rounded-xl border transition-shadow duration-300","border-primary-200 dark:border-primary-700 dark:bg-primary-900 bg-white","dark:hover:shadow-primary-900/60 hover:shadow-lg",n),...s,children:[jsxRuntime.jsxs("div",{className:"relative overflow-hidden",style:{aspectRatio:r},children:[jsxRuntime.jsx("img",{src:e,alt:t,className:"h-full w-full object-cover transition-transform duration-500 ease-out group-hover:scale-110",draggable:false}),jsxRuntime.jsx("div",{className:"pointer-events-none absolute inset-0 opacity-0 transition-opacity duration-300 group-hover:opacity-100","aria-hidden":true,children:jsxRuntime.jsx("div",{className:"animate-light-sweep absolute inset-0"})})]}),o]})}function wd({className:e,...t}){return jsxRuntime.jsx("div",{className:i("space-y-2 p-4",e),...t})}function Nd({className:e,...t}){return jsxRuntime.jsx("h3",{className:i("text-primary-900 dark:text-primary-100 text-base font-semibold",e),...t})}function Cd({className:e,...t}){return jsxRuntime.jsx("p",{className:i("text-primary-500 dark:text-primary-400 text-sm",e),...t})}function Td({className:e,...t}){return jsxRuntime.jsx("div",{className:i("border-primary-100 dark:border-primary-800 flex items-center gap-2 border-t px-4 py-3",e),...t})}function sa({intent:e,size:t,className:r,...n}){return jsxRuntime.jsx("div",{className:i(Ln({intent:e,size:t}),r),...n})}function Rd({className:e,...t}){return jsxRuntime.jsx("div",{className:i("border-primary-200 text-primary-900 dark:border-primary-700 dark:text-primary-100 mb-3 flex items-center gap-1.5 border-b pb-3 text-sm font-semibold [&_svg]:h-4 [&_svg]:w-4 [&_svg]:shrink-0",e),...t})}function Md({className:e,...t}){return jsxRuntime.jsx("div",{className:i("text-primary-700 dark:text-primary-300 text-sm",e),...t})}var Pd={Card:oa,ImageCard:aa,Panel:sa},la=Pd;var En=classVarianceAuthority.cva("w-full text-left text-sm",{variants:{intent:{default:"",striped:"[&_tbody_tr:nth-child(even)]:bg-primary-50 dark:[&_tbody_tr:nth-child(even)]:bg-primary-800/30",bordered:"[&_th]:border [&_td]:border [&_th]:border-primary-200 [&_td]:border-primary-200 dark:[&_th]:border-primary-700 dark:[&_td]:border-primary-700"},density:{compact:"[&_th]:px-2 [&_th]:py-1 [&_td]:px-2 [&_td]:py-1",default:"",relaxed:"[&_th]:px-6 [&_th]:py-5 [&_td]:px-6 [&_td]:py-5"}},defaultVariants:{intent:"default",density:"default"}}),Dn=classVarianceAuthority.cva("text-sm text-primary-700 dark:text-primary-300",{variants:{intent:{default:"space-y-1",bordered:"divide-y divide-primary-200 rounded-lg border border-primary-200 dark:divide-primary-700 dark:border-primary-700 [&>li]:px-4 [&>li]:py-2",hover:"[&>li]:rounded-md [&>li]:px-3 [&>li]:py-2 [&>li]:transition-colors [&>li:hover]:bg-primary-50 dark:[&>li:hover]:bg-primary-800/50"}},defaultVariants:{intent:"default"}}),Vn=classVarianceAuthority.cva("group flex w-full items-center gap-1.5 text-left [&_svg]:shrink-0",{variants:{size:{sm:"py-0.5 text-xs [&_svg]:h-3 [&_svg]:w-3",md:"py-1.5 text-sm [&_svg]:h-3.5 [&_svg]:w-3.5",lg:"py-2 text-base [&_svg]:h-4 [&_svg]:w-4"}},defaultVariants:{size:"md"}}),In=classVarianceAuthority.cva("flex cursor-pointer items-center gap-1 rounded transition-colors [&_svg]:shrink-0",{variants:{size:{sm:"py-0.5 text-xs [&_svg]:h-3.5 [&_svg]:w-3.5",md:"py-1 text-sm [&_svg]:h-4 [&_svg]:w-4",lg:"py-1.5 text-base [&_svg]:h-5 [&_svg]:w-5"}},defaultVariants:{size:"md"}}),An=classVarianceAuthority.cva("relative rounded-xl border bg-white p-5 shadow-sm transition-shadow hover:shadow-md dark:bg-primary-900",{variants:{intent:{primary:"border-primary-200 dark:border-primary-700",success:"border-success-200 dark:border-success-800",danger:"border-danger-200 dark:border-danger-800",warning:"border-warning-200 dark:border-warning-800"},size:{sm:"p-4",md:"p-5",lg:"p-6"}},defaultVariants:{intent:"primary",size:"md"}}),Hn=classVarianceAuthority.cva("relative overflow-hidden rounded-xl border bg-white p-5 shadow-sm transition-all duration-300 hover:shadow-lg dark:bg-primary-900",{variants:{intent:{primary:"border-primary-200 dark:border-primary-700",success:"border-success-200 dark:border-success-800",danger:"border-danger-200 dark:border-danger-800",warning:"border-warning-200 dark:border-warning-800"},size:{sm:"p-4",md:"p-5",lg:"p-6"}},defaultVariants:{intent:"primary",size:"md"}}),Br=classVarianceAuthority.cva("overflow-x-auto rounded-lg font-mono [background:var(--color-syntax-bg)] [&_pre]:m-0 [&_pre]:p-4 [&_code]:bg-transparent",{variants:{size:{sm:"text-xs",md:"text-sm",lg:"text-base"}},defaultVariants:{size:"md"}});function Or({intent:e,density:t,className:r,...n}){return jsxRuntime.jsx("div",{className:"w-full overflow-auto",children:jsxRuntime.jsx("table",{className:i(En({intent:e,density:t}),r),...n})})}function da({className:e,...t}){return jsxRuntime.jsx("thead",{className:i("bg-primary-50 text-primary-600 dark:bg-primary-800/50 dark:text-primary-400",e),...t})}function ma({className:e,...t}){return jsxRuntime.jsx("tbody",{className:i("[&_tr:last-child]:border-0",e),...t})}function $r({className:e,...t}){return jsxRuntime.jsx("tr",{className:i("border-primary-200 hover:bg-primary-50/50 dark:border-primary-700 dark:hover:bg-primary-800/30 border-b transition-colors",e),...t})}function qt({className:e,...t}){return jsxRuntime.jsx("th",{className:i("px-4 py-3 text-left text-xs font-semibold tracking-wider uppercase",e),...t})}function Zt({className:e,...t}){return jsxRuntime.jsx("td",{className:i("text-primary-700 dark:text-primary-300 px-4 py-3",e),...t})}function pa({icon:e,text:t="No data",className:r}){return jsxRuntime.jsxs("div",{className:i("flex flex-col items-center justify-center gap-3 py-16 text-primary-400 dark:text-primary-500",r),children:[e??jsxRuntime.jsx(lucideReact.Inbox,{className:"h-12 w-12 stroke-[1.2]"}),jsxRuntime.jsx("span",{className:"text-sm",children:t})]})}var fi={sm:"hidden sm:table-cell",md:"hidden md:table-cell",lg:"hidden lg:table-cell"};function zd({columns:e,data:t,sort:r,onSortChange:n,defaultSort:o=null,rowKey:s,rowActions:a,intent:l,density:d,className:m,empty:c}){let[f,p]=Kr.useState(o),u=r??f,h=Kr.useCallback(x=>{let w=u?.column===x?u.direction==="asc"?{column:x,direction:"desc"}:null:{column:x,direction:"asc"};n?n(w):p(w);},[u,n]),g=Kr.useMemo(()=>{if(!u)return t;let x=e.find(M=>M.key===u.column);if(!x)return t;let w=x.compareFn??((M,v)=>{let N=x.cell(M),L=x.cell(v);return N==null&&L==null?0:N==null?-1:L==null?1:typeof N=="number"&&typeof L=="number"?N-L:String(N).localeCompare(String(L))}),y=[...t].sort(w);return u.direction==="desc"?y.reverse():y},[t,u,e]);return jsxRuntime.jsxs(Or,{intent:l,density:d,className:m,children:[jsxRuntime.jsx(da,{children:jsxRuntime.jsxs($r,{children:[e.map(x=>{let w=x.sortable!==false,y=u?.column===x.key;return jsxRuntime.jsx(qt,{className:i(w&&"cursor-pointer select-none",x.headerClassName,x.hideBelow&&fi[x.hideBelow]),onClick:w?()=>h(x.key):void 0,"aria-sort":y?u.direction==="asc"?"ascending":"descending":void 0,children:jsxRuntime.jsxs("span",{className:"inline-flex items-center gap-1",children:[x.header,w&&jsxRuntime.jsx(gi,{active:y,direction:y?u.direction:null})]})},x.key)}),a&&jsxRuntime.jsx(qt,{className:"w-20 text-right",children:"Actions"})]})}),jsxRuntime.jsx(ma,{children:g.length===0?jsxRuntime.jsx("tr",{children:jsxRuntime.jsx("td",{colSpan:e.length+(a?1:0),children:jsxRuntime.jsx(pa,{...c})})}):g.map((x,w)=>jsxRuntime.jsxs($r,{children:[e.map(y=>jsxRuntime.jsx(Zt,{className:i(y.cellClassName,y.hideBelow&&fi[y.hideBelow]),children:y.cell(x)},y.key)),a&&jsxRuntime.jsx(Zt,{className:"text-right",children:jsxRuntime.jsx("span",{className:"inline-flex items-center gap-1",children:a(x)})})]},s?s(x,w):w))})]})}function $d({value:e,onCommit:t,onCancel:r}){let[n,o]=Kr.useState(e),s=Kr.useRef(null);Kr.useEffect(()=>{s.current?.focus(),s.current?.select();},[]);let a=()=>t(n);return jsxRuntime.jsxs("span",{className:"flex items-center gap-1",children:[jsxRuntime.jsx("input",{ref:s,type:"text",value:n,onChange:l=>o(l.target.value),onKeyDown:l=>{l.key==="Enter"&&a(),l.key==="Escape"&&r();},"aria-label":"Edit cell",className:"min-w-0 flex-1 rounded border border-primary-400 bg-white px-1.5 py-0.5 text-sm outline-none focus:ring-1 focus:ring-primary-400 dark:border-primary-600 dark:bg-secondary-800"}),jsxRuntime.jsx("button",{type:"button",onClick:a,className:"text-success-600 hover:text-success-700 dark:text-success-400","aria-label":"Confirm",children:jsxRuntime.jsx(lucideReact.Check,{className:"h-3.5 w-3.5"})}),jsxRuntime.jsx("button",{type:"button",onClick:r,className:"text-danger-500 hover:text-danger-600 dark:text-danger-400","aria-label":"Cancel",children:jsxRuntime.jsx(lucideReact.X,{className:"h-3.5 w-3.5"})})]})}function Od({columns:e,data:t,rowKey:r,sort:n,onSortChange:o,defaultSort:s=null,selectionMode:a="none",selected:l,onSelectionChange:d,editable:m=false,onCellEdit:c,toolbar:f=false,onAdd:p,onDelete:u,rowActions:h,intent:g,density:x,className:w,empty:y}){let[M,v]=Kr.useState(s),N=n??M,L=Kr.useCallback($=>{let U=N?.column===$?N.direction==="asc"?{column:$,direction:"desc"}:null:{column:$,direction:"asc"};o?o(U):v(U);},[N,o]),R=Kr.useMemo(()=>{if(!N)return t;let $=e.find(j=>j.key===N.column);if(!$)return t;let U=$.compareFn??((j,b)=>{let I=$.cell(j),W=$.cell(b);return I==null&&W==null?0:I==null?-1:W==null?1:typeof I=="number"&&typeof W=="number"?I-W:String(I).localeCompare(String(W))}),me=[...t].sort(U);return N.direction==="desc"?me.reverse():me},[t,N,e]),[D,A]=Kr.useState([]),V=l??D,k=d??A,O=Kr.useMemo(()=>R.map(($,U)=>r($,U)),[R,r]),C=a==="multiple"&&O.length>0&&O.every($=>V.includes($)),X=a==="multiple"&&V.length>0&&!C,T=Kr.useCallback($=>{a==="single"?k(V.includes($)?[]:[$]):a==="multiple"&&k(V.includes($)?V.filter(U=>U!==$):[...V,$]);},[a,V,k]),re=Kr.useCallback(()=>{k(C?[]:O);},[C,O,k]),[_,de]=Kr.useState(null),J=Kr.useCallback(($,U,me)=>{m&&me!==false&&de({rowKey:$,colKey:U});},[m]),pe=Kr.useCallback(($,U,me)=>{c?.($,U,me),de(null);},[c]);return jsxRuntime.jsxs("div",{className:"space-y-2",children:[f&&jsxRuntime.jsxs("div",{className:"flex items-center gap-2",children:[p&&jsxRuntime.jsxs("button",{type:"button",onClick:p,className:"inline-flex items-center gap-1.5 rounded-md border border-secondary-300 bg-white px-3 py-1.5 text-sm font-medium text-secondary-700 transition-colors hover:bg-secondary-50 dark:border-secondary-600 dark:bg-secondary-800 dark:text-secondary-300 dark:hover:bg-secondary-700",children:[jsxRuntime.jsx(lucideReact.Plus,{className:"h-3.5 w-3.5"})," Add"]}),u&&jsxRuntime.jsxs("button",{type:"button",onClick:()=>u(V),disabled:V.length===0,className:"inline-flex items-center gap-1.5 rounded-md border border-secondary-300 bg-white px-3 py-1.5 text-sm font-medium text-danger-600 transition-colors hover:bg-danger-50 disabled:opacity-40 disabled:pointer-events-none dark:border-secondary-600 dark:bg-secondary-800 dark:text-danger-400 dark:hover:bg-danger-900/20",children:[jsxRuntime.jsx(lucideReact.Trash2,{className:"h-3.5 w-3.5"})," Delete",V.length>0&&` (${V.length})`]}),m&&V.length===1&&jsxRuntime.jsxs("button",{type:"button",onClick:()=>{let $=e.find(U=>U.editable!==false);$&&de({rowKey:V[0],colKey:$.key});},className:"inline-flex items-center gap-1.5 rounded-md border border-secondary-300 bg-white px-3 py-1.5 text-sm font-medium text-secondary-700 transition-colors hover:bg-secondary-50 dark:border-secondary-600 dark:bg-secondary-800 dark:text-secondary-300 dark:hover:bg-secondary-700",children:[jsxRuntime.jsx(lucideReact.Pencil,{className:"h-3.5 w-3.5"})," Edit"]}),V.length>0&&jsxRuntime.jsxs("span",{className:"ml-auto text-sm text-secondary-500 dark:text-secondary-400",children:[V.length," row",V.length>1?"s":""," selected"]})]}),jsxRuntime.jsxs(Or,{intent:g,density:x,className:w,children:[jsxRuntime.jsx(da,{children:jsxRuntime.jsxs($r,{children:[a==="multiple"&&jsxRuntime.jsx(qt,{className:"w-10",children:jsxRuntime.jsx("input",{type:"checkbox",checked:C,ref:$=>{$&&($.indeterminate=X);},onChange:re,className:"h-4 w-4 cursor-pointer rounded border-secondary-300 accent-primary-600","aria-label":"Select all"})}),a==="single"&&jsxRuntime.jsx(qt,{className:"w-10"}),e.map($=>{let U=$.sortable!==false,me=N?.column===$.key;return jsxRuntime.jsx(qt,{className:i(U&&"cursor-pointer select-none",$.headerClassName),onClick:U?()=>L($.key):void 0,"aria-sort":me?N.direction==="asc"?"ascending":"descending":void 0,children:jsxRuntime.jsxs("span",{className:"inline-flex items-center gap-1",children:[$.header,U&&jsxRuntime.jsx(gi,{active:me,direction:me?N.direction:null})]})},$.key)}),h&&jsxRuntime.jsx(qt,{className:"w-20 text-right",children:"Actions"})]})}),jsxRuntime.jsx(ma,{children:R.length===0?jsxRuntime.jsx("tr",{children:jsxRuntime.jsx("td",{colSpan:e.length+(a!=="none"?1:0)+(h?1:0),children:jsxRuntime.jsx(pa,{...y})})}):R.map(($,U)=>{let me=r($,U),j=V.includes(me);return jsxRuntime.jsxs($r,{className:i(j&&"bg-primary-50/60 dark:bg-primary-900/20"),onClick:()=>{a!=="none"&&T(me);},children:[a==="multiple"&&jsxRuntime.jsx(Zt,{className:"w-10",children:jsxRuntime.jsx("input",{type:"checkbox",checked:j,onChange:()=>T(me),onClick:b=>b.stopPropagation(),className:"h-4 w-4 cursor-pointer rounded border-secondary-300 accent-primary-600","aria-label":"Select row"})}),a==="single"&&jsxRuntime.jsx(Zt,{className:"w-10",children:jsxRuntime.jsx("input",{type:"radio",checked:j,onChange:()=>T(me),onClick:b=>b.stopPropagation(),className:"h-4 w-4 cursor-pointer accent-primary-600","aria-label":"Select row"})}),e.map(b=>{let I=_?.rowKey===me&&_?.colKey===b.key,W=b.editValue?.($)??(()=>{let K=b.cell($);return typeof K=="string"||typeof K=="number"?String(K):""})();return jsxRuntime.jsx(Zt,{className:i(b.cellClassName,m&&b.editable!==false&&"cursor-text"),onDoubleClick:K=>{K.stopPropagation(),J(me,b.key,b.editable);},children:I?jsxRuntime.jsx($d,{value:W,onCommit:K=>pe(me,b.key,K),onCancel:()=>de(null)}):b.cell($)},b.key)}),h&&jsxRuntime.jsx(Zt,{className:"text-right",onClick:b=>b.stopPropagation(),children:jsxRuntime.jsx("span",{className:"inline-flex items-center gap-1",children:h($)})})]},me)})})]})]})}function gi({active:e,direction:t}){let r="h-3.5 w-3.5 shrink-0";return !e||!t?jsxRuntime.jsx(lucideReact.ArrowUpDown,{className:i(r,"opacity-30")}):t==="asc"?jsxRuntime.jsx(lucideReact.ArrowUp,{className:i(r,"opacity-70")}):jsxRuntime.jsx(lucideReact.ArrowDown,{className:i(r,"opacity-70")})}var bi=Kr.createContext({size:"md"});function ua({intent:e,size:t="md",className:r,...n}){return jsxRuntime.jsx(bi.Provider,{value:{size:t},children:jsxRuntime.jsx("ul",{className:i(Dn({intent:e}),r),...n})})}function jd({actions:e,className:t,children:r,...n}){let{size:o}=Kr.useContext(bi);return jsxRuntime.jsxs("li",{className:i(Vn({size:o}),t),...n,children:[jsxRuntime.jsx("span",{className:"flex min-w-0 flex-1 items-center gap-1.5",children:r}),e&&jsxRuntime.jsx("span",{className:"ml-auto flex shrink-0 items-center gap-1 opacity-0 transition-opacity group-hover:opacity-100 [@media(hover:none)]:opacity-100 [@media(hover:none)]:[&>button]:min-h-(--row-action-touch-min) [@media(hover:none)]:[&>button]:min-w-(--row-action-touch-min) [@media(hover:none)]:[&>button]:flex [@media(hover:none)]:[&>button]:items-center [@media(hover:none)]:[&>button]:justify-center",children:e})]})}var yi=Kr.createContext({showLines:true,expandedKeys:null,onToggleKey:()=>{},size:"md"});function fa({showLines:e=true,showRoot:t=true,expandedKeys:r,defaultExpandedKeys:n="all",onExpandedKeysChange:o,size:s="md",className:a,children:l,...d}){let [m,c]=Kr.useState(()=>n),p=Kr.useCallback(h=>{if(r){let g=new Set(r);g.has(h)?g.delete(h):g.add(h),o?.(g);}else c(g=>{if(g==="all")return new Set(["__ALL_MINUS__",h]);let x=new Set(g);return x.has(h)?x.delete(h):x.add(h),x});},[r,o]),u=r??(m==="all"?null:m);return jsxRuntime.jsx(yi.Provider,{value:{showLines:e,expandedKeys:u,onToggleKey:p,size:s},children:t?jsxRuntime.jsx("ul",{className:i("text-sm",a),role:"tree",...d,children:l}):jsxRuntime.jsx("ul",{className:i("text-sm",a),role:"tree",...d,children:jsxRuntime.jsx(Zd,{children:l})})})}function Zd({children:e}){let t=vi(e);return jsxRuntime.jsx(jsxRuntime.Fragment,{children:t.map(r=>Kr__default.default.isValidElement(r)&&r.props.children?r.props.children:null)})}function vi(e){let t=[];return Kr__default.default.Children.forEach(e,r=>{Kr__default.default.isValidElement(r)&&r.type===Kr__default.default.Fragment?t.push(...vi(r.props.children)):t.push(r);}),t}function Qd({nodeKey:e,label:t,icon:r,actions:n,defaultExpanded:o=false,expanded:s,onToggle:a,children:l,className:d}){let{showLines:m,expandedKeys:c,onToggleKey:f,size:p}=Kr.useContext(yi),[u,h]=Kr.useState(o),g=Kr__default.default.Children.count(l)>0,x=e??(typeof t=="string"?t:""),w;s!=null?w=s:c!=null&&x?c.has("__ALL_MINUS__")?w=!c.has(x):w=c.has(x):w=u;let y=()=>{let M=!w;a?a(M):c!=null&&x?f(x):h(M);};return jsxRuntime.jsxs("li",{className:i("select-none",d),role:"treeitem","aria-expanded":g?w:void 0,children:[jsxRuntime.jsxs("div",{className:i("group hover:bg-primary-50 dark:hover:bg-primary-800/50 rounded-md px-1",In({size:p}),g?"cursor-pointer":"cursor-default"),onClick:g?y:void 0,children:[g?jsxRuntime.jsx(lucideReact.ChevronRight,{className:i("text-primary-400 h-4 w-4 shrink-0 transition-transform duration-200",w&&"rotate-90")}):jsxRuntime.jsx("span",{className:"w-4 shrink-0"}),r&&jsxRuntime.jsx("span",{className:"shrink-0",children:r}),jsxRuntime.jsx("span",{className:"text-primary-700 dark:text-primary-300 min-w-0 flex-1 truncate",children:t}),n&&jsxRuntime.jsx("span",{className:"ml-auto flex shrink-0 items-center gap-1 opacity-0 transition-opacity group-hover:opacity-100 [@media(hover:none)]:opacity-100 [@media(hover:none)]:[&>button]:min-h-(--row-action-touch-min) [@media(hover:none)]:[&>button]:min-w-(--row-action-touch-min) [@media(hover:none)]:[&>button]:flex [@media(hover:none)]:[&>button]:items-center [@media(hover:none)]:[&>button]:justify-center",onClick:M=>M.stopPropagation(),children:n})]}),g&&jsxRuntime.jsx("div",{className:i("grid transition-[grid-template-rows] duration-200 ease-out",w?"grid-rows-[1fr]":"grid-rows-[0fr]"),children:jsxRuntime.jsx("div",{className:"overflow-hidden",children:jsxRuntime.jsx("ul",{className:i("ml-4 pl-2",m&&"border-primary-200 dark:border-primary-700 border-l"),role:"group",children:l})})})]})}function rm({avatar:e,sender:t}){return e?typeof e=="string"?/^(?:https?|data|blob):/.test(e)?jsxRuntime.jsx("img",{src:e,alt:t,className:"h-8 w-8 shrink-0 rounded-full object-cover",draggable:false}):jsxRuntime.jsx("div",{className:"bg-primary-200 text-primary-600 dark:bg-primary-700 dark:text-primary-300 flex h-8 w-8 shrink-0 items-center justify-center rounded-full text-lg select-none",children:e}):jsxRuntime.jsx("div",{className:"flex h-8 w-8 shrink-0 items-center justify-center rounded-full",children:e}):jsxRuntime.jsx("div",{className:"bg-primary-200 text-primary-600 dark:bg-primary-700 dark:text-primary-300 flex h-8 w-8 shrink-0 items-center justify-center rounded-full text-sm font-semibold select-none",children:t.charAt(0).toUpperCase()})}function nm({msg:e,alignRight:t}){return jsxRuntime.jsxs("div",{className:i("flex gap-2.5",t?"flex-row-reverse":"flex-row"),children:[jsxRuntime.jsx(rm,{avatar:e.avatar,sender:e.sender}),jsxRuntime.jsxs("div",{className:i("flex max-w-[75%] flex-col gap-0.5",t?"items-end":"items-start"),children:[jsxRuntime.jsx("span",{className:"text-primary-500 dark:text-primary-400 text-xs",children:e.sender}),jsxRuntime.jsx("div",{className:i("rounded-xl px-3 py-2 text-sm leading-relaxed",t?"rounded-tr-sm bg-primary-500 text-white dark:bg-primary-600":"bg-primary-100 text-primary-800 dark:bg-primary-800 dark:text-primary-200 rounded-tl-sm"),children:e.content}),e.time&&jsxRuntime.jsx("span",{className:"text-primary-400 dark:text-primary-500 text-[10px]",children:e.time})]})]})}function ba({messages:e,mode:t="split",autoScroll:r=true,className:n,...o}){let s=Kr.useRef(null);return Kr.useEffect(()=>{r&&s.current?.scrollIntoView({behavior:"smooth"});},[e,r]),jsxRuntime.jsxs("div",{className:i("flex flex-col gap-4 overflow-y-auto rounded-lg border p-4","border-primary-200 dark:border-primary-700 dark:bg-primary-900 bg-white",n),...o,children:[e.map(a=>{let l=t==="split"&&!!a.self;return jsxRuntime.jsx(nm,{msg:a,alignRight:l},a.id)}),jsxRuntime.jsx("div",{ref:s})]})}var sm={name:"onyx-css-vars",type:"dark",settings:[{settings:{foreground:"var(--color-syntax-plain)",background:"var(--color-syntax-bg)"}},{scope:["comment","punctuation.definition.comment"],settings:{foreground:"var(--color-syntax-comment)",fontStyle:"italic"}},{scope:["keyword","keyword.control","keyword.operator.new","keyword.operator.expression","storage.type","storage.modifier"],settings:{foreground:"var(--color-syntax-keyword)"}},{scope:["string","string.quoted","string.template"],settings:{foreground:"var(--color-syntax-string)"}},{scope:["entity.name.function","support.function","meta.function-call"],settings:{foreground:"var(--color-syntax-function)"}},{scope:["variable","variable.other","variable.parameter","meta.definition.variable"],settings:{foreground:"var(--color-syntax-variable)"}},{scope:["constant.numeric","constant.language"],settings:{foreground:"var(--color-syntax-number)"}},{scope:["keyword.operator","keyword.operator.assignment","keyword.operator.comparison","keyword.operator.arithmetic"],settings:{foreground:"var(--color-syntax-operator)"}},{scope:["entity.name.tag","punctuation.definition.tag","support.class.component"],settings:{foreground:"var(--color-syntax-tag)"}},{scope:["entity.other.attribute-name","meta.tag.attributes"],settings:{foreground:"var(--color-syntax-attr)"}},{scope:["punctuation","meta.brace","punctuation.definition.block","punctuation.separator","punctuation.terminator"],settings:{foreground:"var(--color-syntax-punctuation)"}},{scope:["entity.name.type","support.type","support.class","entity.other.inherited-class"],settings:{foreground:"var(--color-syntax-type)"}}]},im={typescript:()=>import('@shikijs/langs/typescript'),javascript:()=>import('@shikijs/langs/javascript'),tsx:()=>import('@shikijs/langs/tsx'),jsx:()=>import('@shikijs/langs/jsx'),html:()=>import('@shikijs/langs/html'),css:()=>import('@shikijs/langs/css'),json:()=>import('@shikijs/langs/json'),markdown:()=>import('@shikijs/langs/markdown'),python:()=>import('@shikijs/langs/python'),rust:()=>import('@shikijs/langs/rust'),go:()=>import('@shikijs/langs/go'),java:()=>import('@shikijs/langs/java'),c:()=>import('@shikijs/langs/c'),cpp:()=>import('@shikijs/langs/cpp'),csharp:()=>import('@shikijs/langs/csharp'),vue:()=>import('@shikijs/langs/vue'),xml:()=>import('@shikijs/langs/xml'),yaml:()=>import('@shikijs/langs/yaml'),sql:()=>import('@shikijs/langs/sql'),bash:()=>import('@shikijs/langs/bash'),shell:()=>import('@shikijs/langs/shell')},ya=null,ki=new Set;function lm(){return ya||(ya=Promise.all([import('shiki/core'),import('shiki/engine/javascript')]).then(([{createHighlighterCore:e},{createJavaScriptRegexEngine:t}])=>e({themes:[sm],langs:[],engine:t()}))),ya}async function cm(e,t,r){let n=await lm();if(t&&!ki.has(t)){let s=im[t];if(s)try{let a=await s();await n.loadLanguage(a.default??a),ki.add(t);}catch{t="text";}else t="text";}let o=n.codeToHtml(e,{lang:t||"text",theme:"onyx-css-vars"});if(o=o.replace(/(<pre [^>]*style=")/,"$1line-height:1.7;tab-size:2;font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;"),r){let s=0;o=o.replace(/<span class="line">/g,()=>(s++,`<span class="line"><span class="line-number" data-line="${s}"></span>`));}return o}function va({code:e,language:t="text",lineNumbers:r=false,editable:n=false,onCodeChange:o,size:s,className:a,...l}){let[d,m]=Kr.useState(""),c=Kr.useRef(null),f=Kr.useRef(null),p=Kr.useRef(null);Kr.useEffect(()=>{let v=false;return cm(e,t,n?false:r).then(N=>{v||m(N);}),()=>{v=true;}},[e,t,r,n]);let u=Kr.useCallback(()=>{let v=f.current,N=p.current?.querySelector("pre"),L=c.current?.querySelector("[data-gutter]");v&&N&&(N.scrollTop=v.scrollTop,N.scrollLeft=v.scrollLeft),v&&L&&(L.scrollTop=v.scrollTop);},[]),h=Kr.useCallback(v=>{o?.(v.target.value);},[o]),g=Kr.useCallback(v=>{if(v.key==="Tab"){v.preventDefault();let N=v.currentTarget,L=N.selectionStart,R=N.selectionEnd,D=N.value.substring(0,L)+" "+N.value.substring(R);o?.(D),requestAnimationFrame(()=>{N.selectionStart=N.selectionEnd=L+2;});}},[o]),x=r&&"[&_.line-number]:inline-block [&_.line-number]:w-8 [&_.line-number]:mr-4 [&_.line-number]:text-right [&_.line-number]:text-secondary-400 [&_.line-number]:select-none [&_.line-number]:before:content-[attr(data-line)]",w="ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace",y=1.7,M=e.split(`
2
- `).length;return n?jsxRuntime.jsxs("div",{ref:c,className:i(Br({size:s}),"flex border border-primary-200 dark:border-primary-700",a),style:{background:"var(--color-syntax-bg)"},...l,children:[r&&jsxRuntime.jsx("div",{"data-gutter":true,"aria-hidden":true,className:"shrink-0 select-none overflow-hidden py-4 pl-3 pr-1 text-right text-secondary-400",style:{fontFamily:w,lineHeight:y,width:"3rem"},children:Array.from({length:M},(v,N)=>jsxRuntime.jsx("div",{children:N+1},N))}),jsxRuntime.jsxs("div",{className:"relative min-w-0 flex-1",children:[jsxRuntime.jsx("textarea",{ref:f,value:e,onChange:h,onScroll:u,onKeyDown:g,spellCheck:false,autoCapitalize:"off",autoComplete:"off",autoCorrect:"off",className:"relative z-2 m-0 block h-full w-full resize-none overflow-auto whitespace-pre border-none bg-transparent p-4 text-transparent caret-primary-600 outline-none dark:caret-primary-400",style:{fontFamily:w,lineHeight:y,tabSize:2,minHeight:"6rem"}}),jsxRuntime.jsx("div",{ref:p,"aria-hidden":true,className:"pointer-events-none absolute inset-0 z-1 overflow-hidden [&_pre]:m-0 [&_pre]:h-full [&_pre]:overflow-hidden [&_pre]:p-4 [&_code]:bg-transparent",dangerouslySetInnerHTML:d?{__html:d}:void 0})]})]}):jsxRuntime.jsx("div",{ref:c,className:i(Br({size:s}),"border border-primary-200 dark:border-primary-700",x,a),style:{background:"var(--color-syntax-bg)"},...l,children:jsxRuntime.jsx("div",{ref:p,className:"[&_pre]:m-0 [&_pre]:p-4",dangerouslySetInnerHTML:d?{__html:d}:void 0,children:d?void 0:jsxRuntime.jsx("pre",{className:"m-0 p-4",style:{background:"var(--color-syntax-bg)"},children:jsxRuntime.jsx("code",{children:e})})})})}var um={up:lucideReact.TrendingUp,down:lucideReact.TrendingDown,neutral:lucideReact.Minus},fm={up:"text-success-600 dark:text-success-400",down:"text-danger-600 dark:text-danger-400",neutral:"text-secondary-500 dark:text-secondary-400"};function ka({title:e,value:t,prefix:r,suffix:n,icon:o,trend:s,trendValue:a,description:l,intent:d,size:m,className:c}){let f=s?um[s]:null,p=s?fm[s]:"";return jsxRuntime.jsx("div",{className:i(An({intent:d,size:m}),c),children:jsxRuntime.jsxs("div",{className:"flex items-start justify-between gap-3",children:[jsxRuntime.jsxs("div",{className:"min-w-0 flex-1",children:[jsxRuntime.jsx("p",{className:"truncate text-xs font-medium tracking-wider uppercase text-secondary-500 dark:text-secondary-400",children:e}),jsxRuntime.jsxs("p",{className:"mt-1 flex items-baseline gap-1 text-2xl font-bold text-primary-900 dark:text-primary-50",children:[r&&jsxRuntime.jsx("span",{className:"text-base font-semibold text-secondary-500 dark:text-secondary-400",children:r}),jsxRuntime.jsx("span",{children:t}),n&&jsxRuntime.jsx("span",{className:"text-base font-semibold text-secondary-500 dark:text-secondary-400",children:n})]}),(s||l)&&jsxRuntime.jsxs("div",{className:"mt-2 flex items-center gap-2",children:[s&&f&&jsxRuntime.jsxs("span",{className:i("flex items-center gap-0.5 text-xs font-semibold",p),children:[jsxRuntime.jsx(f,{className:"h-3.5 w-3.5"}),a]}),l&&jsxRuntime.jsx("span",{className:"text-xs text-secondary-500 dark:text-secondary-400",children:l})]})]}),o&&jsxRuntime.jsx("div",{className:i("flex h-10 w-10 shrink-0 items-center justify-center rounded-xl [&_svg]:h-5 [&_svg]:w-5",d==="success"&&"bg-success-100 text-success-600 dark:bg-success-900/30 dark:text-success-400",d==="danger"&&"bg-danger-100 text-danger-600 dark:bg-danger-900/30 dark:text-danger-400",d==="warning"&&"bg-warning-100 text-warning-600 dark:bg-warning-900/30 dark:text-warning-400",(!d||d==="primary")&&"bg-primary-100 text-primary-600 dark:bg-primary-800 dark:text-primary-400"),children:o})]})})}function vm(e){return 1-Math.pow(1-e,4)}function km(e,t,r,n,o){let[s,a]=Kr.useState(()=>o?o(t):t.toFixed(n)),l=Kr.useRef(null),d=Kr.useRef(null);return Kr.useEffect(()=>{l.current!==null&&cancelAnimationFrame(l.current),d.current=null;let m=c=>{d.current===null&&(d.current=c);let f=c-d.current,p=Math.min(f/r,1),u=vm(p),h=t+(e-t)*u;a(o?o(h):h.toFixed(n)),p<1&&(l.current=requestAnimationFrame(m));};return l.current=requestAnimationFrame(m),()=>{l.current!==null&&cancelAnimationFrame(l.current);}},[e,t,r,n,o]),s}var wm={up:lucideReact.TrendingUp,down:lucideReact.TrendingDown,neutral:lucideReact.Minus},Nm={up:"text-success-600 dark:text-success-400",down:"text-danger-600 dark:text-danger-400",neutral:"text-secondary-500 dark:text-secondary-400"},Ci={primary:"bg-primary-100 text-primary-600 dark:bg-primary-800/60 dark:text-primary-300",success:"bg-success-100 text-success-600 dark:bg-success-900/30 dark:text-success-400",danger:"bg-danger-100 text-danger-600 dark:bg-danger-900/30 dark:text-danger-400",warning:"bg-warning-100 text-warning-600 dark:bg-warning-900/30 dark:text-warning-400"};function wa({title:e,value:t,decimals:r=0,prefix:n,suffix:o,icon:s,trend:a,trendValue:l,description:d,animateDuration:m=1200,formatter:c,from:f=0,intent:p,size:u,className:h}){let g=km(t,f,m,r,c),x=a?wm[a]:null,w=a?Nm[a]:"";return jsxRuntime.jsxs("div",{className:i(Hn({intent:p,size:u}),h),children:[jsxRuntime.jsx("div",{className:i("pointer-events-none absolute inset-x-0 top-0 h-0.5 rounded-t-xl",p==="success"&&"bg-gradient-to-r from-success-400 to-success-600",p==="danger"&&"bg-gradient-to-r from-danger-400 to-danger-600",p==="warning"&&"bg-gradient-to-r from-warning-400 to-warning-600",(!p||p==="primary")&&"bg-gradient-to-r from-primary-400 to-primary-600")}),jsxRuntime.jsxs("div",{className:"flex items-start justify-between gap-4",children:[jsxRuntime.jsxs("div",{className:"min-w-0 flex-1",children:[jsxRuntime.jsx("p",{className:"text-xs font-semibold tracking-widest uppercase text-secondary-500 dark:text-secondary-400",children:e}),jsxRuntime.jsxs("p",{className:"mt-2 flex items-baseline gap-1",children:[n&&jsxRuntime.jsx("span",{className:"text-lg font-semibold text-secondary-400 dark:text-secondary-500",children:n}),jsxRuntime.jsx("span",{className:"font-mono text-3xl font-bold tabular-nums text-primary-900 dark:text-primary-50",children:g}),o&&jsxRuntime.jsx("span",{className:"text-lg font-semibold text-secondary-400 dark:text-secondary-500",children:o})]})]}),s&&jsxRuntime.jsx("div",{className:i("flex h-12 w-12 shrink-0 items-center justify-center rounded-2xl [&_svg]:h-6 [&_svg]:w-6",Ci[p??"primary"]??Ci.primary),children:s})]}),(a||d)&&jsxRuntime.jsxs("div",{className:"mt-3 flex items-center gap-2 border-t border-primary-100 pt-3 dark:border-primary-700/50",children:[a&&x&&jsxRuntime.jsxs("span",{className:i("flex items-center gap-0.5 text-xs font-bold",w),children:[jsxRuntime.jsx(x,{className:"h-3.5 w-3.5"}),l]}),d&&jsxRuntime.jsx("span",{className:"text-xs text-secondary-500 dark:text-secondary-400",children:d})]})]})}var Cm={Table:Or,List:ua,Tree:fa,Chat:ba,CodeBlock:va,Stat:ka,MetricCard:wa},Na=Cm;var er="flex w-full items-center gap-2 rounded-md px-3 py-1.5 text-sm transition-colors cursor-pointer",Ri="bg-primary-200 dark:bg-primary-700/50 text-primary-900 dark:text-primary-100 font-medium",hr="text-primary-600 dark:text-primary-400 hover:bg-primary-100 dark:hover:bg-primary-800/50 hover:text-primary-900 dark:hover:text-primary-200",xr="flex items-center justify-center rounded-md p-2 transition-colors cursor-pointer text-primary-600 dark:text-primary-400 hover:bg-primary-100 dark:hover:bg-primary-800/50 hover:text-primary-900 dark:hover:text-primary-200";function Dm({to:e,className:t,style:r,children:n}){let o=typeof t=="function"?t({isActive:false}):t;return jsxRuntime.jsx("a",{href:e,className:o,style:r,children:n})}var Ca=["expanded","icons","mini"];function Vm(e){let t=Ca.indexOf(e);return Ca[(t+1)%Ca.length]}function Mi(e){let t=new Set;for(let r of e)if(r.children&&r.children.length>0){t.add(r.key??r.label);for(let n of Mi(r.children))t.add(n);}return t}function Pi({item:e,basePath:t,depth:r,onItemClick:n,LinkComponent:o,showLines:s,expandedKeys:a,onToggle:l}){let d=e.key??e.label,m=e.children&&e.children.length>0,[c,f]=Kr.useState(e.defaultOpen??true),p=a?a.has(d):c,u=Kr.useCallback(()=>{a?l(d):f(g=>!g);},[a,l,d]),h=r>0?`${r*1.25}rem`:void 0;if(m)return jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("button",{type:"button",onClick:u,className:i(er,hr,"justify-between"),style:{paddingLeft:h},children:[jsxRuntime.jsxs("span",{className:"flex items-center gap-2",children:[e.icon,e.label]}),jsxRuntime.jsx(lucideReact.ChevronRight,{className:i("h-3.5 w-3.5 transition-transform",p&&"rotate-90")})]}),p&&jsxRuntime.jsx("div",{className:i("flex flex-col gap-0.5 pt-0.5",s?"ml-2.5 border-l border-primary-200 dark:border-primary-700":"ml-2"),children:e.children.map(g=>jsxRuntime.jsx(Pi,{item:g,basePath:t,depth:r+1,onItemClick:n,LinkComponent:o,showLines:s,expandedKeys:a,onToggle:l},g.key??g.path??g.label))})]});if(e.path!=null){let g=t+e.path;return n?jsxRuntime.jsxs("button",{type:"button",onClick:()=>n(e,g),className:i(er,hr),style:{paddingLeft:h},children:[e.icon,e.label]}):jsxRuntime.jsxs(o,{to:g,className:({isActive:x})=>i(er,x?Ri:hr),style:{paddingLeft:h},children:[e.icon,e.label]})}return jsxRuntime.jsxs("span",{className:i(er,hr,"cursor-default"),style:{paddingLeft:h},children:[e.icon,e.label]})}function Im({item:e,basePath:t,onItemClick:r,LinkComponent:n}){let[o,s]=Kr.useState(false),a=Kr.useRef(null),l=Kr.useRef(void 0),[d,m]=Kr.useState({top:0,left:0}),c=()=>{clearTimeout(l.current),s(true);},f=()=>{l.current=setTimeout(()=>s(false),200);};Kr.useLayoutEffect(()=>{if(o&&a.current){let u=a.current.getBoundingClientRect();m({top:u.top,left:u.right+4});}},[o]);let p=e.icon||jsxRuntime.jsx("span",{className:"text-xs font-bold leading-none",children:e.label.charAt(0).toUpperCase()});return jsxRuntime.jsxs("div",{onMouseEnter:c,onMouseLeave:f,children:[jsxRuntime.jsx("button",{ref:a,type:"button",className:i(xr,"w-full"),title:e.label,onClick:()=>s(u=>!u),children:p}),o&&reactDom.createPortal(jsxRuntime.jsxs("div",{className:"fixed z-50 min-w-44 rounded-md border border-primary-200 bg-white p-1 shadow-lg dark:border-primary-700 dark:bg-primary-900",style:{top:d.top,left:d.left},onMouseEnter:c,onMouseLeave:f,children:[jsxRuntime.jsx("div",{className:"px-2.5 py-1.5 text-xs font-semibold uppercase text-primary-500 dark:text-primary-400",children:e.label}),jsxRuntime.jsx("div",{className:"flex flex-col gap-0.5",children:e.children?.map(u=>{let h=u.key??u.path??u.label;if(u.path!=null){let g=t+u.path;return r?jsxRuntime.jsxs("button",{type:"button",onClick:()=>{r(u,g),s(false);},className:i(er,hr),children:[u.icon,u.label]},h):jsxRuntime.jsxs(n,{to:g,className:({isActive:x})=>i(er,x?Ri:hr),children:[u.icon,u.label]},h)}return jsxRuntime.jsxs("span",{className:i(er,"cursor-default text-primary-400"),children:[u.icon,u.label]},h)})})]}),document.body)]})}function Am({item:e,basePath:t,onItemClick:r,LinkComponent:n}){let o=e.icon||jsxRuntime.jsx("span",{className:"text-xs font-bold leading-none",children:e.label.charAt(0).toUpperCase()});if(e.path!=null){let s=t+e.path;return r?jsxRuntime.jsx("button",{type:"button",onClick:()=>r(e,s),className:i(xr,"w-full"),title:e.label,children:o}):jsxRuntime.jsx(n,{to:s,className:({isActive:a})=>i(xr,"w-full",a&&"bg-primary-200 dark:bg-primary-700/50 text-primary-900 dark:text-primary-100"),children:jsxRuntime.jsx("span",{title:e.label,children:o})})}return jsxRuntime.jsx("span",{className:i(xr,"w-full cursor-default"),title:e.label,children:o})}function Ra({items:e,title:t,basePath:r="/",onItemClick:n,LinkComponent:o=Dm,collapsible:s,collapseMode:a,defaultCollapseMode:l="expanded",onCollapseModeChange:d,showLines:m=true,expandedKeys:c,defaultExpandedKeys:f="all",onExpandedKeysChange:p,className:u,responsive:h=true,mobileBreakpoint:g=768,mobileTopOffset:x=48,...w}){let[y,M]=Kr.useState(l),v=a??y,N=Kr__default.default.useMemo(()=>Mi(e),[e]),[L,R]=Kr.useState(()=>f==="all"?new Set(N):new Set(f)),D=c??null,A=D??L,V=Kr.useCallback(j=>{let b=new Set(A);b.has(j)?b.delete(j):b.add(j),R(b),p?.(b);},[A,p]),k=Kr.useCallback(()=>{let j=Vm(v);M(j),d?.(j);},[v,d]),[O,C]=Kr.useState(()=>h&&typeof window<"u"&&window.innerWidth<g),[X,T]=Kr.useState(false);Kr.useEffect(()=>{if(!h||typeof window>"u"||!window.matchMedia)return;let j=window.matchMedia(`(max-width: ${g-1}px)`),b=I=>{C(I.matches),I.matches||T(false);};return j.addEventListener("change",b),()=>j.removeEventListener("change",b)},[h,g]);let re=Kr.useCallback(j=>{j.target.closest("a")&&T(false);},[]),_=Kr.useRef(null),de=Kr.useRef({startX:0,startY:0,dragging:false}),pe=Kr.useCallback(j=>{let b=j.touches[0];de.current={startX:b.clientX,startY:b.clientY,dragging:true};},[]),fe=Kr.useCallback(j=>{if(!de.current.dragging||!_.current)return;let b=j.touches[0],I=b.clientX-de.current.startX,W=b.clientY-de.current.startY;I>=0||Math.abs(W)>Math.abs(I)||(_.current.style.transform=`translateX(${Math.max(I,-224)}px)`,_.current.style.transition="none");},[]),$=Kr.useCallback(j=>{if(!de.current.dragging||!_.current)return;de.current.dragging=false;let b=j.changedTouches[0],I=b.clientX-de.current.startX,W=b.clientY-de.current.startY;_.current.style.transition="",_.current.style.transform="",I<-60&&Math.abs(I)>Math.abs(W)&&T(false);},[]),U=Kr.useMemo(()=>!O||!n?n:(j,b)=>{T(false),n(j,b);},[O,n]),me=jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[s&&!O&&jsxRuntime.jsx("div",{className:i("flex shrink-0 mb-1",v==="expanded"?"justify-end":"justify-center"),children:jsxRuntime.jsx("button",{type:"button",onClick:k,className:xr,"aria-label":v==="mini"?"Expand sidebar":"Collapse sidebar",title:v==="mini"?"Expand sidebar":"Collapse sidebar",children:v==="mini"?jsxRuntime.jsx(lucideReact.Menu,{className:"h-5 w-5"}):jsxRuntime.jsx(lucideReact.ChevronsLeft,{className:"h-4 w-4"})})}),(O||v==="expanded")&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[t&&jsxRuntime.jsx("h2",{className:"text-primary-500 dark:text-primary-400 mb-3 text-sm font-semibold uppercase",children:t}),e.map(j=>jsxRuntime.jsx(Pi,{item:j,basePath:r,depth:0,onItemClick:U,LinkComponent:o,showLines:m,expandedKeys:D,onToggle:V},j.key??j.path??j.label))]}),!O&&v==="icons"&&e.map(j=>{let b=j.key??j.path??j.label;return j.children&&j.children.length>0?jsxRuntime.jsx(Im,{item:j,basePath:r,onItemClick:U,LinkComponent:o},b):jsxRuntime.jsx(Am,{item:j,basePath:r,onItemClick:U,LinkComponent:o},b)})]});return h&&O?jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[X&&reactDom.createPortal(jsxRuntime.jsx("div",{className:"fixed inset-0 z-40 bg-black/50",style:{top:x},onClick:()=>T(false)}),document.body),reactDom.createPortal(jsxRuntime.jsxs("aside",{ref:_,className:i("fixed bottom-0 left-0 z-50 flex flex-col w-56 border-r border-primary-200 dark:border-primary-700 bg-white dark:bg-primary-900 shadow-xl transition-transform duration-200",X?"translate-x-0":"-translate-x-full"),style:{top:x},onClick:re,onTouchStart:pe,onTouchMove:fe,onTouchEnd:$,children:[jsxRuntime.jsxs("div",{className:"flex shrink-0 items-center justify-between border-b border-primary-200 px-3 py-2 dark:border-primary-700",children:[jsxRuntime.jsx("span",{className:"text-xs font-semibold uppercase tracking-wide text-primary-500 dark:text-primary-400",children:"Navigation"}),jsxRuntime.jsx("button",{type:"button",onClick:j=>{j.stopPropagation(),T(false);},className:i(xr,"h-7 w-7 p-1"),"aria-label":"Close navigation",children:jsxRuntime.jsx(lucideReact.X,{className:"h-4 w-4"})})]}),jsxRuntime.jsx("div",{className:"flex-1 overflow-y-auto overscroll-y-contain p-3",children:jsxRuntime.jsx("nav",{className:"flex flex-col gap-0.5",children:me})})]}),document.body),!X&&reactDom.createPortal(jsxRuntime.jsx("button",{type:"button",className:"fixed left-0 z-50 flex h-14 w-5 items-center justify-center rounded-r-xl bg-primary-800/80 text-white shadow-md backdrop-blur-sm transition-colors hover:bg-primary-700/90 dark:bg-primary-200/80 dark:text-primary-900 dark:hover:bg-primary-300/90",style:{top:`calc(50% + ${x/2}px)`,transform:"translateY(-50%)"},onClick:()=>T(true),"aria-label":"Open navigation",children:jsxRuntime.jsx(lucideReact.ChevronRight,{className:"h-3.5 w-3.5"})}),document.body)]}):jsxRuntime.jsx("nav",{className:i("flex flex-col gap-0.5",v==="mini"&&"items-center",u),...w,children:me})}function _m({href:e,className:t,onClick:r,children:n}){return jsxRuntime.jsx("a",{href:e,className:t,onClick:r,children:n})}function Ma({brand:e,onBrandClick:t,navItems:r=[],actions:n=[],linkComponent:o=_m,height:s="h-12",mobileMenu:a=false,navMenuIcon:l,actionsMenuIcon:d,className:m,children:c}){let f=a&&r.length>0,p=a&&n.length>0,u="md:hidden rounded-md px-1.5 py-1.5 text-primary-500 dark:text-primary-400 hover:text-primary-700 dark:hover:text-primary-200 [&_svg]:h-5 [&_svg]:w-5",h=y=>y?"text-primary-900 font-medium dark:text-primary-100":"text-primary-500 hover:text-primary-700 dark:text-primary-400 dark:hover:text-primary-200 transition-colors",g="rounded-md p-1.5 text-primary-500 hover:bg-primary-100 hover:text-primary-700 dark:text-primary-400 dark:hover:bg-primary-800 dark:hover:text-primary-200 transition-colors [&_svg]:h-5 [&_svg]:w-5",x=r.map((y,M)=>({key:typeof y.label=="string"?y.label:String(M),label:y.active?jsxRuntime.jsx("span",{className:"font-semibold text-primary-900 dark:text-primary-100",children:y.label}):y.label,onClick:()=>{y.onClick?y.onClick({preventDefault:()=>{},stopPropagation:()=>{}}):y.href&&(window.location.href=y.href);}})),w=n.map((y,M)=>({key:y.key??String(M),label:jsxRuntime.jsxs("span",{className:"flex items-center gap-2 [&_svg]:h-4 [&_svg]:w-4 [&_svg]:shrink-0",children:[y.icon,jsxRuntime.jsx("span",{children:y.ariaLabel})]}),onClick:()=>{y.onClick?y.onClick({preventDefault:()=>{},stopPropagation:()=>{}}):y.href&&(y.external?window.open(y.href,"_blank","noopener,noreferrer"):window.location.href=y.href);}}));return jsxRuntime.jsxs("header",{className:i("flex shrink-0 items-center justify-between border-b px-5","border-primary-200 bg-white dark:border-primary-700 dark:bg-primary-900",s,m),children:[jsxRuntime.jsxs("div",{className:"flex items-center gap-2 md:gap-6",children:[e&&jsxRuntime.jsx("div",{className:i("text-lg font-bold text-primary-800 dark:text-primary-100",t&&"cursor-pointer"),onClick:t,role:t?"button":void 0,tabIndex:t?0:void 0,onKeyDown:t?y=>{(y.key==="Enter"||y.key===" ")&&(y.preventDefault(),t(y));}:void 0,children:e}),f&&jsxRuntime.jsx(pr,{intent:"ghost",size:"sm",className:u,label:l??jsxRuntime.jsx(lucideReact.PanelLeft,{className:"h-5 w-5"}),items:x,align:"left",chevron:false,"aria-label":"Open navigation"}),r.length>0&&jsxRuntime.jsx("nav",{className:i("flex items-center gap-4 text-sm",a?"hidden md:flex":"flex"),children:r.map((y,M)=>{let v=typeof y.label=="string"?y.label:M,N=h(y.active);return y.href?jsxRuntime.jsx(o,{href:y.href,className:N,onClick:y.onClick,children:y.label},v):jsxRuntime.jsx("button",{type:"button",className:i(N,"cursor-pointer"),onClick:y.onClick,children:y.label},v)})})]}),c&&jsxRuntime.jsx("div",{className:"flex items-center",children:c}),jsxRuntime.jsxs("div",{className:"flex items-center gap-1",children:[n.length>0&&jsxRuntime.jsx("div",{className:i("flex items-center gap-1",a?"hidden md:flex":"flex"),children:n.map((y,M)=>y.href?jsxRuntime.jsx("a",{href:y.href,target:y.external?"_blank":void 0,rel:y.external?"noopener noreferrer":void 0,className:g,"aria-label":y.ariaLabel,onClick:y.onClick,children:y.icon},y.key??M):jsxRuntime.jsx("button",{type:"button",className:g,"aria-label":y.ariaLabel,onClick:y.onClick,children:y.icon},y.key??M))}),p&&jsxRuntime.jsx(pr,{intent:"ghost",size:"sm",className:u,label:d??jsxRuntime.jsx(lucideReact.MoreHorizontal,{className:"h-5 w-5"}),items:w,align:"right",chevron:false,"aria-label":"Open menu"})]})]})}var $n=classVarianceAuthority.cva("inline-flex items-center gap-1 underline-offset-2 transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary-500/20 [&_svg]:shrink-0",{variants:{intent:{default:"text-primary-600 hover:text-primary-800 active:text-primary-900 dark:text-primary-400 dark:hover:text-primary-200 dark:active:text-primary-100",secondary:"text-secondary-500 hover:text-secondary-700 active:text-secondary-800 dark:text-secondary-400 dark:hover:text-secondary-200 dark:active:text-secondary-100",muted:"text-primary-400 hover:text-primary-600 dark:text-primary-500 dark:hover:text-primary-300"},size:{sm:"text-xs [&_svg]:h-3 [&_svg]:w-3",md:"text-sm [&_svg]:h-3.5 [&_svg]:w-3.5",lg:"text-base [&_svg]:h-4 [&_svg]:w-4"},underline:{always:"underline",hover:"hover:underline",none:"no-underline"}},defaultVariants:{intent:"default",size:"md",underline:"none"}});function zm(e,t){return !!(t==="_blank"||e&&/^https?:\/\//.test(e))}var $m=e=>jsxRuntime.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":true,...e,children:[jsxRuntime.jsx("path",{d:"M15 3h6v6"}),jsxRuntime.jsx("path",{d:"M10 14 21 3"}),jsxRuntime.jsx("path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6"})]});function Pa({intent:e,size:t,underline:r,external:n,className:o,children:s,href:a,target:l,rel:d,...m}){let c=n??zm(a,l);return jsxRuntime.jsxs("a",{href:a,target:c&&!l?"_blank":l,rel:c&&!d?"noopener noreferrer":d,className:i($n({intent:e,size:t,underline:r}),o),...m,children:[s,c&&jsxRuntime.jsx($m,{})]})}function Xn({items:e,separator:t=jsxRuntime.jsx(lucideReact.ChevronRight,{className:"h-3.5 w-3.5","aria-hidden":"true"}),homeIcon:r=false,LinkComponent:n="a",className:o}){return jsxRuntime.jsx("nav",{"aria-label":"Breadcrumb",className:i("flex",o),children:jsxRuntime.jsx("ol",{className:"flex flex-wrap items-center gap-1 text-sm",children:e.map((s,a)=>{let l=a===e.length-1,d=r===true?jsxRuntime.jsx(lucideReact.Home,{className:"h-3.5 w-3.5"}):r!==false&&r!==void 0?r:null,m=a===0&&d?d:s.icon;return jsxRuntime.jsxs("li",{className:"flex items-center gap-1",children:[a>0&&jsxRuntime.jsx("span",{className:"text-secondary-400 dark:text-secondary-500",children:t}),l?jsxRuntime.jsxs("span",{"aria-current":"page",className:i("flex items-center gap-1 font-medium text-primary-800 dark:text-primary-100",m&&"gap-1.5"),children:[m,s.label]}):s.href?jsxRuntime.jsxs(n,{href:s.href,className:i("flex items-center gap-1 text-secondary-500 transition-colors","hover:text-primary-700 dark:text-secondary-400 dark:hover:text-primary-200","rounded focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary-500/30",m&&"gap-1.5"),children:[m,s.label]}):jsxRuntime.jsxs("span",{className:"flex items-center gap-1 text-secondary-500 dark:text-secondary-400",children:[m,s.label]})]},a)})})})}function jn(e,t){let r=[];for(let n=e;n<=t;n++)r.push(n);return r}function Um(e,t,r){let n=r*2+5;if(t<=n)return jn(1,t);let o=Math.max(e-r,1),s=Math.min(e+r,t),a=o>2,l=s<t-1;return !a&&l?[...jn(1,3+r*2),"\u2026",t]:a&&!l?[1,"\u2026",...jn(t-(3+r*2)+1,t)]:[1,"\u2026",...jn(o,s),"\u2026",t]}var Ei={sm:"h-7 min-w-7 px-1.5 text-xs",md:"h-9 min-w-9 px-2 text-sm",lg:"h-11 min-w-11 px-2.5 text-base"},Wr={sm:"h-3.5 w-3.5",md:"h-4 w-4",lg:"h-5 w-5"};function Gr({onClick:e,disabled:t,active:r,size:n,"aria-label":o,children:s}){return jsxRuntime.jsx("button",{type:"button",onClick:e,disabled:t,"aria-label":o,"aria-current":r?"page":void 0,className:i("inline-flex items-center justify-center rounded font-medium transition-colors","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary-500/30",Ei[n],r?"bg-primary-600 text-white dark:bg-primary-500":"border border-primary-200 bg-white text-primary-700 hover:bg-primary-50 dark:border-primary-700 dark:bg-primary-900 dark:text-primary-300 dark:hover:bg-primary-800",t&&"pointer-events-none opacity-40"),children:s})}function Wn({totalPages:e,currentPage:t,onPageChange:r,siblingCount:n=2,showFirstLast:o=true,showPageCount:s=false,size:a="md",className:l}){if(e<=1)return null;let d=Um(t,e,n);return jsxRuntime.jsxs("nav",{"aria-label":"Pagination",className:i("flex items-center gap-1",l),children:[o&&jsxRuntime.jsx(Gr,{size:a,onClick:()=>r(1),disabled:t===1,"aria-label":"First page",children:jsxRuntime.jsx(lucideReact.ChevronsLeft,{className:Wr[a]})}),jsxRuntime.jsx(Gr,{size:a,onClick:()=>r(t-1),disabled:t===1,"aria-label":"Previous page",children:jsxRuntime.jsx(lucideReact.ChevronLeft,{className:Wr[a]})}),d.map((m,c)=>m==="\u2026"?jsxRuntime.jsx("span",{className:i("inline-flex items-center justify-center text-secondary-400",Ei[a]),"aria-hidden":"true",children:jsxRuntime.jsx(lucideReact.MoreHorizontal,{className:Wr[a]})},`ellipsis-${c}`):jsxRuntime.jsx(Gr,{size:a,active:m===t,onClick:()=>r(m),"aria-label":`Page ${m}`,children:m},m)),jsxRuntime.jsx(Gr,{size:a,onClick:()=>r(t+1),disabled:t===e,"aria-label":"Next page",children:jsxRuntime.jsx(lucideReact.ChevronRight,{className:Wr[a]})}),o&&jsxRuntime.jsx(Gr,{size:a,onClick:()=>r(e),disabled:t===e,"aria-label":"Last page",children:jsxRuntime.jsx(lucideReact.ChevronsRight,{className:Wr[a]})}),s&&jsxRuntime.jsxs("span",{className:"ml-2 text-sm text-secondary-500 dark:text-secondary-400",children:["Page ",t," of ",e]})]})}function Di({item:e,mode:t}){return e.separator?jsxRuntime.jsx("div",{className:"mx-1 h-10 w-px self-center bg-primary-200 dark:bg-primary-700","aria-hidden":true}):jsxRuntime.jsxs("button",{type:"button",title:e.title??e.label,disabled:e.disabled,onClick:e.onClick,"aria-pressed":e.active,className:i("relative flex shrink-0 items-center justify-center gap-1.5 rounded-lg px-2.5 py-1.5 text-xs font-medium transition-all duration-150 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary-400","disabled:cursor-not-allowed disabled:opacity-40",e.active?"bg-primary-100 text-primary-700 shadow-inner dark:bg-primary-800 dark:text-primary-200":"text-primary-700 hover:bg-primary-50 active:bg-primary-100 dark:text-primary-300 dark:hover:bg-primary-800",t==="full"?"min-w-[3.5rem] flex-col gap-0.5 py-2":"","[&_svg]:shrink-0",t==="full"?"[&_svg]:h-5 [&_svg]:w-5":"[&_svg]:h-4 [&_svg]:w-4"),children:[e.icon&&jsxRuntime.jsx("span",{children:e.icon}),t!=="icons"&&jsxRuntime.jsx("span",{className:i(t==="full"?"text-[0.6rem] leading-tight":""),children:e.label})]})}function Jm({group:e,mode:t,disabled:r=false}){return jsxRuntime.jsxs("div",{className:i("flex shrink-0 flex-col items-stretch",r&&"opacity-50"),children:[jsxRuntime.jsx("div",{className:"flex items-center gap-0.5 px-1",children:e.items.map(n=>jsxRuntime.jsx(Di,{item:r?{...n,disabled:true}:n,mode:t},n.key))}),t==="full"&&jsxRuntime.jsx("div",{className:"mt-1 border-t border-primary-100 px-2 pt-0.5 text-center dark:border-primary-800",children:jsxRuntime.jsx("span",{className:"text-[0.55rem] text-secondary-400 dark:text-secondary-500",children:e.label})})]})}function La({tabs:e,defaultTab:t,activeTab:r,onTabChange:n,mode:o,onModeChange:s,sticky:a=false,className:l}){let d=e.filter(v=>!v.hidden),[m,c]=Kr.useState(t??d[0]?.key??""),[f,p]=Kr.useState(o??"full"),[u,h]=Kr.useState(true),g=r??m,x=o??f,w=v=>{if(!d.find(L=>L.key===v)?.disabled){if(v===g&&x!=="icons"){h(L=>!L);return}c(v),n?.(v),h(true);}},M=d.find(v=>v.key===g)??d[0];return jsxRuntime.jsxs("div",{className:i("select-none border-b border-primary-200 bg-white dark:border-primary-700 dark:bg-primary-900",a&&"sticky top-0 z-30",l),children:[jsxRuntime.jsxs("div",{className:"flex items-center border-b border-primary-100 dark:border-primary-800",children:[jsxRuntime.jsx("div",{className:"flex flex-1 items-end overflow-x-auto",children:d.map(v=>jsxRuntime.jsxs("button",{type:"button",disabled:v.disabled,onClick:()=>w(v.key),className:i("flex shrink-0 items-center gap-1.5 border-b-2 px-4 py-2 text-sm font-medium transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary-400 [&_svg]:h-4 [&_svg]:w-4",v.disabled?"cursor-not-allowed border-transparent text-secondary-300 opacity-50 dark:text-secondary-600":v.key===g&&u?"border-primary-500 text-primary-700 dark:border-primary-400 dark:text-primary-200":"border-transparent text-secondary-500 hover:border-primary-300 hover:text-primary-600 dark:text-secondary-400 dark:hover:text-primary-300"),children:[v.icon,v.label]},v.key))}),jsxRuntime.jsx("button",{type:"button",title:u?"Collapse ribbon":"Expand ribbon",onClick:()=>h(v=>!v),className:"ml-auto mr-2 rounded-md p-1.5 text-secondary-400 transition-colors hover:bg-primary-50 hover:text-primary-600 dark:hover:bg-primary-800 dark:hover:text-primary-300",children:u?jsxRuntime.jsx(lucideReact.ChevronUp,{className:"h-4 w-4"}):jsxRuntime.jsx(lucideReact.ChevronDown,{className:"h-4 w-4"})})]}),u&&M&&x!=="icons"&&jsxRuntime.jsx("div",{className:"flex items-stretch gap-1 overflow-x-auto px-2 py-1.5",children:M.groups.map((v,N)=>jsxRuntime.jsxs(Kr__default.default.Fragment,{children:[N>0&&jsxRuntime.jsx("div",{className:"mx-1 h-auto w-px self-stretch bg-primary-100 dark:bg-primary-800"}),jsxRuntime.jsx(Jm,{group:v,mode:x,disabled:v.disabled||M.disabled})]},v.key))}),x==="icons"&&u&&M&&jsxRuntime.jsx("div",{className:"flex items-center gap-0.5 overflow-x-auto px-2 py-1",children:M.groups.flatMap(v=>v.items.map(N=>jsxRuntime.jsx(Di,{item:v.disabled||M.disabled?{...N,disabled:true}:N,mode:"icons"},N.key)))})]})}var ep={SideNav:Ra,Header:Ma,NavLink:Pa,Breadcrumb:Xn,Pagination:Wn,RibbonBar:La},Ea=ep;var Gn=classVarianceAuthority.cva("flex w-full items-center justify-between font-medium transition-all [&_svg]:shrink-0",{variants:{size:{sm:"py-2 text-xs [&_svg]:h-3.5 [&_svg]:w-3.5",md:"py-3 text-sm [&_svg]:h-4 [&_svg]:w-4",lg:"py-4 text-base [&_svg]:h-5 [&_svg]:w-5"}},defaultVariants:{size:"md"}}),Yn=classVarianceAuthority.cva("",{variants:{size:{sm:"pb-2 text-xs",md:"pb-3 text-sm",lg:"pb-4 text-base"}},defaultVariants:{size:"md"}}),Un=classVarianceAuthority.cva("divide-y",{variants:{intent:{default:"divide-primary-300 dark:divide-primary-700",bordered:"divide-primary-300 rounded-lg border border-primary-300 bg-white px-3 shadow-sm dark:divide-primary-700 dark:border-primary-700 dark:bg-primary-800/50",ghost:"divide-transparent"}},defaultVariants:{intent:"default"}}),qn=classVarianceAuthority.cva("flex",{variants:{intent:{line:"border-b border-primary-200 dark:border-primary-700",pills:"gap-1 rounded-lg bg-primary-100 p-1 dark:bg-primary-800",underline:"gap-4"}},defaultVariants:{intent:"line"}}),Zn=classVarianceAuthority.cva("inline-flex cursor-pointer items-center justify-center gap-1.5 whitespace-nowrap px-3 py-1.5 text-sm font-medium transition-all focus-visible:outline-none disabled:pointer-events-none disabled:opacity-50 [&_svg]:h-4 [&_svg]:w-4 [&_svg]:shrink-0",{variants:{intent:{line:"text-primary-500 hover:text-primary-700 data-[active=true]:text-primary-900 dark:text-primary-400 dark:hover:text-primary-200 dark:data-[active=true]:text-primary-100",pills:"rounded-md text-primary-600 hover:text-primary-900 data-[active=true]:bg-white data-[active=true]:text-primary-900 data-[active=true]:shadow-sm dark:text-primary-400 dark:hover:text-primary-100 dark:data-[active=true]:bg-primary-700 dark:data-[active=true]:text-primary-100",underline:"text-primary-500 hover:text-primary-700 data-[active=true]:text-primary-900 dark:text-primary-400 dark:data-[active=true]:text-primary-100"}},defaultVariants:{intent:"line"}});var Qn=Kr.createContext(null),Da=Kr.createContext(null);function Va({type:e="single",defaultValue:t=[],value:r,onValueChange:n,intent:o,size:s,className:a,children:l,...d}){let[m,c]=Kr.useState(t),f=r??m,p=Kr.useCallback(u=>{let h=g=>g.includes(u)?g.filter(x=>x!==u):e==="single"?[u]:[...g,u];n?n(h(f)):c(h);},[e,f,n]);return jsxRuntime.jsx(Qn.Provider,{value:{expandedItems:f,toggleItem:p,size:s},children:jsxRuntime.jsx("div",{className:i(Un({intent:o}),a),...d,children:l})})}function op({value:e,className:t,children:r,...n}){let s=Kr.useContext(Qn)?.expandedItems.includes(e)??false;return jsxRuntime.jsx(Da.Provider,{value:{value:e,isExpanded:s},children:jsxRuntime.jsx("div",{className:i("",t),...n,children:r})})}function ap({className:e,children:t,...r}){let n=Kr.useContext(Qn),o=Kr.useContext(Da);return jsxRuntime.jsxs("button",{className:i("text-primary-800 hover:text-primary-600 dark:text-primary-100 dark:hover:text-primary-300 cursor-pointer gap-2 font-medium transition-colors",Gn({size:n?.size}),e),onClick:()=>o&&n?.toggleItem(o.value),"aria-expanded":o?.isExpanded?"true":"false",...r,children:[jsxRuntime.jsx("span",{className:"flex items-center gap-1.5 [&_svg]:shrink-0",children:t}),jsxRuntime.jsx(lucideReact.ChevronDown,{className:i("shrink-0 transition-transform duration-200",o?.isExpanded&&"rotate-180")})]})}function sp({className:e,children:t,...r}){let n=Kr.useContext(Qn),o=Kr.useContext(Da);return jsxRuntime.jsx("div",{className:i("grid transition-[grid-template-rows] duration-200 ease-out",o?.isExpanded?"grid-rows-[1fr]":"grid-rows-[0fr]"),children:jsxRuntime.jsx("div",{className:"overflow-hidden",children:jsxRuntime.jsx("div",{className:i("text-primary-500 dark:text-primary-400",Yn({size:n?.size}),e),...r,children:t})})})}var Zr=Kr.createContext(null),_i=Kr.createContext(false);function Ia({defaultValue:e="",value:t,onValueChange:r,intent:n,children:o,className:s}){let[a,l]=Kr.useState(e),d=t??a,m=Kr.useRef(new Map),c=Kr.useCallback(p=>{r?r(p):l(p);},[r]),f=Kr.useCallback((p,u)=>{u?m.current.set(p,u):m.current.delete(p);},[]);return jsxRuntime.jsx(Zr.Provider,{value:{activeValue:d,setActiveValue:c,intent:n,registerTrigger:f},children:jsxRuntime.jsx("div",{className:s,children:o})})}function dp({className:e,scrollable:t,...r}){let n=Kr.useContext(Zr),o=Kr.useRef(null),[s,a]=Kr.useState(null),l=Kr.useCallback(()=>{if(!n||!o.current)return;let f=o.current.querySelectorAll('[role="tab"][data-active="true"]')[0];if(!f){a(null);return}let p=o.current.getBoundingClientRect(),u=f.getBoundingClientRect();a({left:u.left-p.left,width:u.width});},[n]);Kr.useLayoutEffect(l,[n?.activeValue,l]),Kr.useEffect(()=>{let c=new ResizeObserver(l);return o.current&&c.observe(o.current),()=>c.disconnect()},[l]);let d=n?.intent??"line",m=s&&(d==="line"||d==="underline");return jsxRuntime.jsxs("div",{ref:o,className:i(qn({intent:n?.intent}),"relative",t&&"overflow-x-auto",e),role:"tablist",...r,children:[r.children,m&&jsxRuntime.jsx("span",{className:"absolute bottom-0 h-0.5 rounded-full bg-primary-600 dark:bg-primary-400 transition-all duration-300 ease-in-out",style:{left:s.left,width:s.width},"aria-hidden":true})]})}function mp({value:e,className:t,children:r,...n}){let o=Kr.useContext(Zr),s=o?.activeValue===e,a=Kr.useCallback(l=>o?.registerTrigger(e,l),[o,e]);return jsxRuntime.jsx("button",{ref:a,className:i(Zn({intent:o?.intent}),t),role:"tab","data-active":s,"aria-selected":s,onClick:()=>o?.setActiveValue(e),...n,children:r})}function pp({className:e,children:t,...r}){let n=Kr.useContext(Zr);if(!n)return null;let o=Kr__default.default.Children.toArray(t).filter(a=>Kr__default.default.isValidElement(a)),s=Math.max(0,o.findIndex(a=>a.props.value===n.activeValue));return jsxRuntime.jsx("div",{className:i("overflow-hidden",e),...r,children:jsxRuntime.jsx(_i.Provider,{value:true,children:jsxRuntime.jsx("div",{className:"flex transition-transform duration-300 ease-in-out",style:{transform:`translateX(-${s*100}%)`},children:o.map((a,l)=>jsxRuntime.jsx("div",{className:"w-full shrink-0","aria-hidden":l!==s,children:a},a.props.value??l))})})})}function up({value:e,className:t,children:r,...n}){let o=Kr.useContext(Zr);return Kr.useContext(_i)?jsxRuntime.jsx("div",{className:i("pt-4",t),role:"tabpanel",...n,children:r}):o?.activeValue!==e?null:jsxRuntime.jsx("div",{className:i("pt-4",t),role:"tabpanel",...n,children:r})}var gp={Accordion:Va,Tabs:Ia},Aa=gp;var Qr=classVarianceAuthority.cva("rounded-lg bg-white p-6 shadow-xl dark:bg-primary-900",{variants:{size:{sm:"w-full max-w-sm",md:"w-full max-w-lg",lg:"w-full max-w-2xl",xl:"w-full max-w-4xl",full:"h-[calc(100vh-4rem)] w-[calc(100vw-4rem)]"}},defaultVariants:{size:"md"}}),eo=classVarianceAuthority.cva("absolute z-50 rounded px-2 py-1 text-xs shadow-md animate-fade-in",{variants:{intent:{default:"bg-primary-900 text-white dark:bg-primary-100 dark:text-primary-900",light:"border border-primary-200 bg-white text-primary-700 dark:border-primary-600 dark:bg-primary-800 dark:text-primary-200"}},defaultVariants:{intent:"default"}});var Vt=[];function vp(e){Vt.push(e);}function kp(e){let t=Vt.indexOf(e);t!==-1&&Vt.splice(t,1);}function Fa(e){return Vt.length>0&&Vt[Vt.length-1]===e}function wp(e){let t=Vt.indexOf(e);return t!==-1?t:Vt.length}var _a=Kr.createContext(null);function Jr({open:e,onOpenChange:t,modal:r=true,closeOnOutsideClick:n=false,children:o}){let s=Kr.useId();return Kr.useEffect(()=>{if(e)return vp(s),()=>kp(s)},[e,s]),Kr.useEffect(()=>{if(!e||!r)return;let a=l=>{l.key==="Escape"&&Fa(s)&&t(false);};return document.addEventListener("keydown",a),()=>document.removeEventListener("keydown",a)},[e,r,t,s]),Kr.useEffect(()=>{if(!e||!r)return;let a=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=a;}},[e,r]),e?jsxRuntime.jsx(_a.Provider,{value:{id:s,onOpenChange:t,modal:r,closeOnOutsideClick:n},children:reactDom.createPortal(o,document.body)}):null}function Ba({size:e,position:t="center",className:r,children:n,...o}){let s=Kr.useContext(_a);if(!s)return null;let l=200+wp(s.id)*10,d=()=>{s.closeOnOutsideClick&&Fa(s.id)&&s.onOpenChange(false);},m=t==="bottom";return s.modal?jsxRuntime.jsx("div",{className:i("animate-fade-in fixed inset-0 bg-black/50",m?"flex items-end justify-center":"flex items-center justify-center p-4"),style:{zIndex:l},onClick:d,children:jsxRuntime.jsx("div",{className:i(Qr({size:e}),m?"animate-slide-in-bottom w-full rounded-b-none rounded-t-(--dialog-sheet-radius) max-h-[85vh] overflow-y-auto":"animate-scale-in",r),role:"dialog","aria-modal":"true",onClick:c=>c.stopPropagation(),...o,children:n})}):jsxRuntime.jsx("div",{className:i("fixed inset-0 flex items-center justify-center p-4",s.closeOnOutsideClick?"pointer-events-auto":"pointer-events-none"),style:{zIndex:l},onClick:s.closeOnOutsideClick&&Fa(s.id)?()=>s.onOpenChange(false):void 0,children:jsxRuntime.jsx("div",{className:i(Qr({size:e}),"animate-scale-in pointer-events-auto shadow-2xl",r),role:"dialog",onClick:s.closeOnOutsideClick?c=>c.stopPropagation():void 0,...o,children:n})})}function za({className:e,...t}){return jsxRuntime.jsx("div",{className:i("mb-4 space-y-1",e),...t})}function $a({className:e,...t}){return jsxRuntime.jsx("h2",{className:i("text-primary-900 dark:text-primary-100 flex items-center gap-1.5 text-lg font-semibold [&_svg]:h-5 [&_svg]:w-5 [&_svg]:shrink-0",e),...t})}function Oa({className:e,...t}){return jsxRuntime.jsx("p",{className:i("text-primary-500 dark:text-primary-400 text-sm",e),...t})}function Ka({className:e,...t}){return jsxRuntime.jsx("div",{className:i("mt-6 flex justify-end gap-2",e),...t})}function Np({className:e,...t}){let r=Kr.useContext(_a);return jsxRuntime.jsx("button",{className:i("text-primary-400 hover:text-primary-600 dark:hover:text-primary-200 absolute top-4 right-4 rounded-md p-1 transition-colors",e),onClick:()=>r?.onOpenChange(false),"aria-label":"Close",...t,children:jsxRuntime.jsx(lucideReact.X,{className:"h-4 w-4"})})}var Cp={top:"bottom-full left-1/2 -translate-x-1/2 mb-2",bottom:"top-full left-1/2 -translate-x-1/2 mt-2",left:"right-full top-1/2 -translate-y-1/2 mr-2",right:"left-full top-1/2 -translate-y-1/2 ml-2"};function Xa({content:e,position:t="top",intent:r,delay:n=200,maxWidth:o,children:s,className:a}){let[l,d]=Kr.useState(false),[m,c]=Kr.useState();return jsxRuntime.jsxs("span",{className:"relative inline-flex",onMouseEnter:()=>{let u=setTimeout(()=>d(true),n);c(u);},onMouseLeave:()=>{clearTimeout(m),d(false);},children:[s,l&&jsxRuntime.jsx("span",{className:i(eo({intent:r}),Cp[t],"pointer-events-none",o?"whitespace-normal":"whitespace-nowrap",a),style:o!==void 0?{maxWidth:o}:void 0,role:"tooltip",children:e})]})}var Lp={right:"drawer-enter-right",left:"drawer-enter-left",top:"drawer-enter-top",bottom:"drawer-enter-bottom"},Ep={right:e=>({width:e}),left:e=>({width:e}),top:e=>({height:e}),bottom:e=>({height:e})},Dp={right:"right-0 top-0 bottom-0",left:"left-0 top-0 bottom-0",top:"top-0 left-0 right-0",bottom:"bottom-0 left-0 right-0"};function to({open:e,onOpenChange:t,side:r="right",size:n=r==="top"||r==="bottom"?"50vh":"24rem",backdrop:o=true,closeOnBackdropClick:s=true,children:a,className:l}){let d=Kr.useRef(null);return Kr.useEffect(()=>{if(!e)return;let m=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=m;}},[e]),Kr.useEffect(()=>{if(!e)return;function m(c){c.key==="Escape"&&t(false);}return document.addEventListener("keydown",m),()=>document.removeEventListener("keydown",m)},[e,t]),Kr.useEffect(()=>{if(!e)return;let m=d.current;if(!m)return;let c=m.querySelectorAll('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])');c[0]?.focus();function f(p){p.key!=="Tab"||c.length===0||(p.shiftKey?document.activeElement===c[0]&&(p.preventDefault(),c[c.length-1].focus()):document.activeElement===c[c.length-1]&&(p.preventDefault(),c[0].focus()));}return document.addEventListener("keydown",f),()=>document.removeEventListener("keydown",f)},[e]),e?reactDom.createPortal(jsxRuntime.jsxs("div",{className:"fixed inset-0 z-50",role:"presentation",children:[o&&jsxRuntime.jsx("div",{className:"drawer-backdrop absolute inset-0 bg-black/40 backdrop-blur-[2px]",onClick:()=>s&&t(false),"aria-hidden":"true"}),jsxRuntime.jsx("div",{ref:d,role:"dialog","aria-modal":"true",className:i("drawer-panel absolute flex flex-col","bg-white shadow-2xl dark:bg-primary-900",Dp[r],Lp[r],l),style:Ep[r](n),children:a})]}),document.body):null}function Oi({children:e,className:t}){return jsxRuntime.jsx("div",{className:i("flex shrink-0 items-center justify-between border-b border-primary-100 px-5 py-4 dark:border-primary-800",t),children:e})}function Ki({children:e,className:t}){return jsxRuntime.jsx("div",{className:i("flex-1 overflow-y-auto px-5 py-4",t),children:e})}function Xi({children:e,className:t}){return jsxRuntime.jsx("div",{className:i("flex shrink-0 items-center justify-end gap-3 border-t border-primary-100 px-5 py-4 dark:border-primary-800",t),children:e})}function ji({onClose:e,className:t}){return jsxRuntime.jsx("button",{type:"button",onClick:e,"aria-label":"Close drawer",className:i("rounded-md p-1.5 text-secondary-400 transition-colors","hover:bg-primary-100 hover:text-primary-700 dark:hover:bg-primary-800 dark:hover:text-primary-200","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary-500/30",t),children:jsxRuntime.jsx(lucideReact.X,{className:"h-4 w-4"})})}function Wi({item:e,depth:t=0,onClose:r}){let[n,o]=Kr.useState(false),s=Kr.useRef(null),a=Kr.useRef(null),l=e.children&&e.children.length>0,d=Kr.useRef(null),m=()=>{d.current=setTimeout(()=>o(false),150);},c=()=>{d.current&&clearTimeout(d.current);};return e.separator?jsxRuntime.jsx("li",{role:"separator",className:"my-1 h-px bg-primary-100 dark:bg-primary-700","aria-hidden":true}):jsxRuntime.jsxs("li",{ref:s,role:"menuitem","aria-disabled":e.disabled,"aria-haspopup":l,"aria-expanded":l?n:void 0,className:i("relative flex cursor-pointer select-none items-center gap-2 rounded-md px-3 py-1.5 text-sm outline-none transition-colors",e.disabled?"cursor-not-allowed opacity-40":e.danger?"text-danger-600 hover:bg-danger-50 focus-visible:bg-danger-50 dark:text-danger-400 dark:hover:bg-danger-900/30":"text-primary-700 hover:bg-primary-50 focus-visible:bg-primary-50 dark:text-primary-200 dark:hover:bg-primary-800"),tabIndex:e.disabled?-1:0,onMouseEnter:()=>{c(),l&&o(true);},onMouseLeave:()=>{l&&m();},onClick:f=>{e.disabled||l||(e.onClick?.(f),r());},onKeyDown:f=>{e.disabled||((f.key==="Enter"||f.key===" ")&&(f.preventDefault(),l?o(p=>!p):(e.onClick?.(f),r())),f.key==="Escape"&&r());},children:[e.icon?jsxRuntime.jsx("span",{className:"flex h-4 w-4 shrink-0 items-center justify-center [&_svg]:h-4 [&_svg]:w-4",children:e.icon}):jsxRuntime.jsx("span",{className:"h-4 w-4 shrink-0"}),jsxRuntime.jsx("span",{className:"flex-1",children:e.label}),e.shortcut&&!l&&jsxRuntime.jsx("kbd",{className:"ml-auto rounded bg-primary-100 px-1.5 py-0.5 font-mono text-[0.6rem] text-secondary-500 dark:bg-primary-700 dark:text-secondary-400",children:e.shortcut}),l&&jsxRuntime.jsx(lucideReact.ChevronRight,{className:"ml-auto h-3.5 w-3.5 text-secondary-400"}),l&&n&&jsxRuntime.jsx("ul",{ref:a,role:"menu",onMouseEnter:c,onMouseLeave:m,className:i("absolute top-0 z-50 min-w-[11rem] animate-[fade-in_120ms_ease-out,scale-in_120ms_ease-out] rounded-xl border border-primary-200 bg-white p-1.5 shadow-xl dark:border-primary-700 dark:bg-primary-900",t%2===0?"left-full ml-1":"right-full mr-1"),children:e.children.map(f=>jsxRuntime.jsx(Wi,{item:f,depth:t+1,onClose:r},f.key))})]})}function Ap({items:e,position:t,onClose:r}){let n=Kr.useRef(null),[o,s]=Kr.useState(t);return Kr.useEffect(()=>{let a=n.current;if(!a)return;let l=a.getBoundingClientRect(),d=window.innerWidth,m=window.innerHeight,{x:c,y:f}=t;c+l.width>d-8&&(c=Math.max(8,d-l.width-8)),f+l.height>m-8&&(f=Math.max(8,m-l.height-8)),s({x:c,y:f});},[t]),Kr.useEffect(()=>{let a=l=>{n.current&&!n.current.contains(l.target)&&r();};return document.addEventListener("mousedown",a,true),document.addEventListener("touchstart",a,true),document.addEventListener("scroll",r,{passive:true,capture:true}),()=>{document.removeEventListener("mousedown",a,true),document.removeEventListener("touchstart",a,true),document.removeEventListener("scroll",r,true);}},[r]),Kr.useEffect(()=>{let a=l=>{l.key==="Escape"&&r(),l.key==="Tab"&&l.preventDefault();};return document.addEventListener("keydown",a),()=>document.removeEventListener("keydown",a)},[r]),jsxRuntime.jsx("ul",{ref:n,role:"menu",style:{position:"fixed",left:o.x,top:o.y},className:"z-[9999] min-w-[12rem] animate-[fade-in_120ms_ease-out,scale-in_120ms_ease-out] rounded-xl border border-primary-200 bg-white p-1.5 shadow-2xl dark:border-primary-700 dark:bg-primary-900",children:e.map(a=>jsxRuntime.jsx(Wi,{item:a,onClose:r},a.key))})}function Ga({items:e,children:t,disabled:r,onOpenChange:n,className:o}){let[s,a]=Kr.useState(false),[l,d]=Kr.useState({x:0,y:0}),m=Kr.useRef(null),c=Kr.useCallback((g,x)=>{r||(d({x:g,y:x}),a(true),n?.(true));},[r,n]),f=Kr.useCallback(()=>{a(false),n?.(false);},[n]),p=Kr.useCallback(g=>{g.preventDefault(),g.stopPropagation(),c(g.clientX,g.clientY);},[c]),u=Kr.useCallback(g=>{let x=g.touches[0];m.current=setTimeout(()=>{document.addEventListener("contextmenu",w=>w.preventDefault(),{capture:true,once:true}),c(x.clientX,x.clientY);},500);},[c]),h=Kr.useCallback(()=>{m.current&&clearTimeout(m.current);},[]);return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("div",{className:i("contents",o),style:{WebkitTouchCallout:"none",userSelect:"none"},onContextMenu:p,onTouchStart:u,onTouchEnd:h,onTouchMove:h,onTouchCancel:h,children:t}),s&&jsxRuntime.jsx(Ap,{items:e,position:l,onClose:f})]})}var Fp={Dialog:Jr,Tooltip:Xa,Drawer:to,ContextMenu:Ga},Ya=Fp;var no=classVarianceAuthority.cva("relative w-full overflow-hidden rounded-full bg-primary-200 dark:bg-primary-700",{variants:{size:{xs:"h-1",sm:"h-2",md:"h-3",lg:"h-4"},intent:{primary:"[&_.progress-fill]:bg-primary-500",success:"[&_.progress-fill]:bg-success-500",warning:"[&_.progress-fill]:bg-warning-500",danger:"[&_.progress-fill]:bg-danger-500"},edge:{none:"rounded-full",top:"fixed top-0 left-0 right-0 z-50 rounded-none",bottom:"fixed bottom-0 left-0 right-0 z-50 rounded-none"}},defaultVariants:{size:"md",intent:"primary",edge:"none"}}),vr=classVarianceAuthority.cva("text-primary-500 dark:text-primary-400",{variants:{size:{sm:"text-xs",md:"text-sm",lg:"text-base"}},defaultVariants:{size:"md"}}),nn=classVarianceAuthority.cva("pointer-events-auto flex items-start gap-3 rounded-lg border p-4 shadow-lg transition-all",{variants:{intent:{success:"border-success-200 bg-success-50 text-success-800 dark:border-success-800 dark:bg-success-900/80 dark:text-success-200",warning:"border-warning-200 bg-warning-50 text-warning-800 dark:border-warning-800 dark:bg-warning-900/80 dark:text-warning-200",error:"border-danger-200 bg-danger-50 text-danger-800 dark:border-danger-800 dark:bg-danger-900/80 dark:text-danger-200",info:"border-primary-200 bg-primary-50 text-primary-800 dark:border-primary-800 dark:bg-primary-900/80 dark:text-primary-200"}},defaultVariants:{intent:"info"}}),on=classVarianceAuthority.cva("skeleton-base bg-secondary-200 dark:bg-secondary-700",{variants:{variant:{text:"skeleton-text w-full rounded-sm",circular:"rounded-full",rectangular:"rounded-none",rounded:"rounded-md"},animation:{pulse:"animate-pulse",wave:"skeleton-wave",none:""}},defaultVariants:{variant:"text",animation:"pulse"}}),oo=classVarianceAuthority.cva("border",{variants:{variant:{default:"bg-primary-800 text-primary-50 border-primary-700 dark:bg-primary-100 dark:text-primary-900 dark:border-primary-200",success:"bg-success-500 text-white border-success-600 dark:bg-success-600 dark:border-success-700",danger:"bg-danger-500 text-white border-danger-600 dark:bg-danger-600 dark:border-danger-700",warning:"bg-warning-500 text-warning-900 border-warning-600 dark:bg-warning-600 dark:text-white dark:border-warning-700",info:"bg-primary-500 text-white border-primary-600 dark:bg-primary-600 dark:border-primary-700"}},defaultVariants:{variant:"default"}});function Qa({intent:e,className:t,children:r,...n}){return jsxRuntime.jsx("div",{className:i(nn({intent:e}),t),role:"alert",...n,children:r})}function Gp({className:e,...t}){return jsxRuntime.jsx("h5",{className:i("flex items-center gap-1.5 font-semibold [&_svg]:h-4 [&_svg]:w-4 [&_svg]:shrink-0",e),...t})}function Yp({className:e,...t}){return jsxRuntime.jsx("span",{className:i("mt-0.5 shrink-0 [&_svg]:h-5 [&_svg]:w-5",e),...t})}function Up({className:e,...t}){return jsxRuntime.jsx("div",{className:i("flex-1 min-w-0 space-y-1",e),...t})}function qp({className:e,...t}){return jsxRuntime.jsx("p",{className:i("text-sm opacity-90",e),...t})}var Zp=0,rr=[],ao=new Map,Ua=new Set;function Qp(){return rr}function qa(){Ua.forEach(e=>e());}function Ja(e){let t=ao.get(e);t&&(clearTimeout(t),ao.delete(e)),rr=rr.map(r=>r.id===e?{...r,exiting:true}:r),qa(),setTimeout(()=>{rr=rr.filter(r=>r.id!==e),qa();},200);}function Jp(e){let t=`alert-${++Zp}`;rr=[...rr,{...e,id:t}],qa();let r=e.duration??5e3;if(r>0){let n=setTimeout(()=>{ao.delete(t),Ja(t);},r);ao.set(t,n);}return t}var Za=16;function eu(e){Za=e;}var tu={"top-right":"right-4 items-end","top-left":"left-4 items-start","bottom-right":"bottom-4 right-4 items-end","bottom-left":"bottom-4 left-4 items-start","top-center":"left-1/2 -translate-x-1/2 items-center","bottom-center":"bottom-4 left-1/2 -translate-x-1/2 items-center"},ru={"top-right":"animate-slide-in-right","top-left":"animate-slide-in-left","bottom-right":"animate-slide-in-right","bottom-left":"animate-slide-in-left","top-center":"animate-slide-in-top","bottom-center":"animate-slide-in-bottom"},nu={success:lucideReact.CircleCheck,warning:lucideReact.TriangleAlert,error:lucideReact.CircleX,info:lucideReact.Info};function ou({alert:e,onClose:t}){let r=e.intent??"info",n=nu[r],o=e.position??"top-right";return jsxRuntime.jsxs("div",{className:i(nn({intent:r}),ru[o],e.exiting&&"opacity-0 transition-opacity duration-200","w-80 max-w-[calc(100vw-2rem)]"),role:"alert",children:[jsxRuntime.jsx(n,{className:"mt-0.5 h-5 w-5 shrink-0"}),jsxRuntime.jsxs("div",{className:"flex-1",children:[e.title&&jsxRuntime.jsx("p",{className:"font-semibold",children:e.title}),jsxRuntime.jsx("p",{className:i(e.title&&"text-sm opacity-90"),children:e.message})]}),jsxRuntime.jsx("button",{onClick:t,"aria-label":"Close notification",className:"shrink-0 cursor-pointer opacity-50 transition-opacity hover:opacity-100",children:jsxRuntime.jsx(lucideReact.X,{className:"h-4 w-4"})})]})}var au=e=>e.startsWith("top");function su(){let e=Kr.useSyncExternalStore(n=>(Ua.add(n),()=>Ua.delete(n)),Qp),t=Kr.useRef(Za);if(Kr.useEffect(()=>{t.current=Za;},[]),e.length===0)return null;let r=e.reduce((n,o)=>{let s=o.position??"top-right";return (n[s]??(n[s]=[])).push(o),n},{});return reactDom.createPortal(jsxRuntime.jsx(jsxRuntime.Fragment,{children:Object.entries(r).map(([n,o])=>jsxRuntime.jsx("div",{style:au(n)?{top:`${t.current}px`}:void 0,className:i("pointer-events-none fixed z-100 flex flex-col gap-2",tu[n]),children:o.map(s=>jsxRuntime.jsx(ou,{alert:s,onClose:()=>Ja(s.id)},s.id))},n))}),document.body)}var Yi=false;function iu(){if(Yi)return;Yi=true;let e=document.createElement("div");e.id="alert-toast-root",document.body.appendChild(e),client.createRoot(e).render(jsxRuntime.jsx(su,{}));}function lu(){return Kr.useEffect(()=>{iu();},[]),{addAlert:Jp,removeAlert:Ja}}function ts({value:e=0,size:t,intent:r,edge:n,showLabel:o=false,indeterminate:s=false,animated:a=false,duration:l=500,className:d,...m}){let c=Math.max(0,Math.min(100,e)),[f,p]=Kr.useState(0),u=Kr.useRef(0);Kr.useEffect(()=>{if(!s)return u.current=requestAnimationFrame(()=>{p(c);}),()=>{u.current&&cancelAnimationFrame(u.current);}},[c,s]);let h=o&&!s&&t!=="xs"&&t!=="sm",g=jsxRuntime.jsx("div",{role:"progressbar","aria-valuenow":s?void 0:c,"aria-valuemin":0,"aria-valuemax":100,className:i(no({size:t,intent:r,edge:n}),d),...m,children:s?jsxRuntime.jsx("div",{className:"progress-fill absolute top-0 h-full rounded-full animate-progress-indeterminate"}):jsxRuntime.jsx("div",{className:i("progress-fill h-full rounded-full transition-[width] ease-out",a&&"animate-progress-shine"),style:{width:`${f}%`,transitionDuration:`${l}ms`},children:h&&jsxRuntime.jsxs("span",{className:"flex h-full items-center justify-end pr-2 text-[10px] font-semibold text-white",children:[Math.round(c),"%"]})})});return n==="top"||n==="bottom"?reactDom.createPortal(g,document.body):g}function so({size:e}){let t=e==="sm"?20:e==="lg"?40:28;return jsxRuntime.jsx("svg",{className:"animate-spin-rotate",width:t,height:t,viewBox:"0 0 50 50",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:jsxRuntime.jsx("circle",{className:"animate-spin-dash stroke-current",cx:"25",cy:"25",r:"20",fill:"none",strokeWidth:"4",strokeLinecap:"round",strokeDasharray:"90 150",strokeDashoffset:"0"})})}function ns({spinning:e=true,tip:t,size:r,className:n,children:o,...s}){return o?jsxRuntime.jsxs("div",{className:i("relative w-fit",n),...s,children:[jsxRuntime.jsx("div",{className:i("transition-all duration-200",e&&"pointer-events-none select-none blur-[1px]"),children:o}),e&&jsxRuntime.jsxs("div",{className:"absolute inset-0 z-10 flex flex-col items-center justify-center gap-2 rounded-[inherit] bg-primary-50/60 dark:bg-primary-900/60",children:[jsxRuntime.jsx(so,{size:r}),t&&jsxRuntime.jsx("span",{className:i(vr({size:r}),"select-none"),children:t})]})]}):e?jsxRuntime.jsxs("div",{className:i("inline-flex flex-col items-center gap-2",n),...s,children:[jsxRuntime.jsx(so,{size:r}),t&&jsxRuntime.jsx("span",{className:i(vr({size:r}),"select-none"),children:t})]}):null}var hu=0,sn=[],rs=new Set;function xu(){return sn}function el(){rs.forEach(e=>e());}function yu(e,t){let r=++hu;return sn=[...sn,{id:r,target:e,tip:t}],el(),()=>vu(r)}function vu(e){sn=sn.filter(t=>t.id!==e),el();}function ku(){return yu}var Qi=false;function wu(){if(Qi||typeof document>"u")return;Qi=true;let e=document.createElement("div");e.id="jac-spin-portal",document.body.appendChild(e),import('react-dom/client').then(({createRoot:t})=>{t(e).render(jsxRuntime.jsx(Ru,{}));});}var io=new Map;function Nu(e){let t=io.get(e);if(t){t.count++;return}let r=getComputedStyle(e),n=e.style.position;r.position==="static"&&(e.style.position="relative"),io.set(e,{count:1,original:n});}function Cu(e){let t=io.get(e);t&&(t.count--,t.count<=0&&(e.style.position=t.original,io.delete(e)));}function Tu({entry:e}){return Kr.useEffect(()=>{let t=e.target;if(!Ji(t))return Nu(t),()=>Cu(t)},[e.target]),Ji(e.target)?reactDom.createPortal(jsxRuntime.jsxs("div",{className:"fixed inset-0 z-50 flex flex-col items-center justify-center gap-3 bg-primary-900/40 dark:bg-primary-900/60",children:[jsxRuntime.jsx(so,{size:"lg"}),e.tip&&jsxRuntime.jsx("span",{className:"select-none text-sm text-primary-100",children:e.tip})]}),document.body):reactDom.createPortal(jsxRuntime.jsxs("div",{className:"absolute inset-0 z-10 flex flex-col items-center justify-center gap-2 rounded-[inherit] bg-primary-50/60 dark:bg-primary-900/60",children:[jsxRuntime.jsx(so,{size:"md"}),e.tip&&jsxRuntime.jsx("span",{className:i(vr({size:"md"}),"select-none"),children:e.tip})]}),e.target)}function Ru(){let e=Kr.useSyncExternalStore(t=>(rs.add(t),()=>rs.delete(t)),()=>xu());return e.length===0?null:jsxRuntime.jsx(jsxRuntime.Fragment,{children:e.map(t=>jsxRuntime.jsx(Tu,{entry:t},t.id))})}function Ji(e){return e===document.documentElement||e===document.body}typeof document<"u"&&wu();function tl(e){if(e!==void 0)return typeof e=="number"?`${e}px`:e}function lo({variant:e="text",animation:t="pulse",width:r,height:n,lines:o,className:s,style:a,...l}){let d=tl(r),m=tl(n);return e==="text"&&o!==void 0&&o>1?jsxRuntime.jsx("span",{className:i("flex flex-col gap-2",s),"aria-hidden":"true",role:"presentation",style:a,...l,children:Array.from({length:o},(c,f)=>jsxRuntime.jsx("span",{className:on({variant:"text",animation:t}),style:{width:f===o-1?"60%":d??"100%",height:m}},f))}):jsxRuntime.jsx("span",{className:i(on({variant:e,animation:t}),s),"aria-hidden":"true",role:"presentation",style:{width:d,height:m,...a},...l})}var Eu=0,rl=320;function nl(e,t){let[r,n]=Kr.useState([]),o=Kr.useRef(new Map),s=Kr.useCallback(c=>{let f=o.current.get(c);f!==void 0&&(clearTimeout(f),o.current.delete(c));},[]),a=Kr.useCallback(c=>{s(c),n(f=>f.map(p=>p.id===c?{...p,_exiting:true}:p)),setTimeout(()=>n(f=>f.filter(p=>p.id!==c)),rl);},[s]),l=Kr.useCallback(c=>a(c),[a]),d=Kr.useCallback(()=>{o.current.forEach(clearTimeout),o.current.clear(),n(c=>c.map(f=>({...f,_exiting:true}))),setTimeout(()=>n([]),rl);},[]),m=Kr.useCallback(c=>{let f=`toast-${++Eu}`,p=c.position??e,u=c.duration!==void 0?c.duration:t;if(n(h=>[...h,{...c,id:f,position:p,duration:u,_exiting:false}]),u>0){let h=setTimeout(()=>{o.current.delete(f),a(f);},u);o.current.set(f,h);}return f},[e,t,a]);return Kr.useEffect(()=>{let c=o.current;return ()=>{c.forEach(clearTimeout),c.clear();}},[]),{items:r,toast:m,dismiss:l,dismissAll:d}}var cn=Kr.createContext(null),zu={"top-right":"top-4 right-4 items-end","top-left":"top-4 left-4 items-start","top-center":"top-4 left-1/2 -translate-x-1/2 items-center","bottom-right":"bottom-4 right-4 items-end","bottom-left":"bottom-4 left-4 items-start","bottom-center":"bottom-4 left-1/2 -translate-x-1/2 items-center"},$u={"top-right":"animate-slide-in-right","top-left":"animate-slide-in-left","top-center":"animate-slide-in-top","bottom-right":"animate-slide-in-right","bottom-left":"animate-slide-in-left","bottom-center":"animate-slide-in-bottom"},Ou={"top-right":"toast-exit-right","top-left":"toast-exit-left","top-center":"toast-exit-up","bottom-right":"toast-exit-right","bottom-left":"toast-exit-left","bottom-center":"toast-exit-down"},Ku={default:lucideReact.Bell,success:lucideReact.CheckCircle2,danger:lucideReact.XCircle,warning:lucideReact.AlertTriangle,info:lucideReact.Info};function Xu({item:e,onDismiss:t}){let r=e.variant??"default",n=e.position??"top-right",o=e.dismissible!==false,s=Ku[r],a=()=>{e.onDismiss?.(e.id),t(e.id);};return jsxRuntime.jsx("div",{className:i("toast-wrapper",e._exiting&&`toast-wrapper-exiting ${Ou[n]}`),children:jsxRuntime.jsxs("div",{role:"status","aria-live":"polite","aria-atomic":"true",className:i(oo({variant:r}),"toast-item pointer-events-auto",!e._exiting&&$u[n]),children:[jsxRuntime.jsx(s,{className:"mt-0.5 h-5 w-5 shrink-0","aria-hidden":"true"}),jsxRuntime.jsxs("div",{className:"flex min-w-0 flex-1 flex-col gap-0.5",children:[e.title&&jsxRuntime.jsx("p",{className:"text-sm font-semibold leading-snug",children:e.title}),e.description&&jsxRuntime.jsx("p",{className:i("text-sm leading-snug",e.title&&"opacity-80"),children:e.description}),e.action&&jsxRuntime.jsx("button",{type:"button",onClick:e.action.onClick,className:"toast-action-btn mt-1 self-start text-xs font-semibold underline underline-offset-2 transition-opacity hover:opacity-80",children:e.action.label})]}),o&&jsxRuntime.jsx("button",{type:"button",onClick:a,"aria-label":"Dismiss notification",className:"shrink-0 cursor-pointer opacity-60 transition-opacity hover:opacity-100",children:jsxRuntime.jsx(lucideReact.X,{className:"h-4 w-4"})})]})})}function co({children:e,defaultPosition:t="top-right",defaultDuration:r=4e3}){let{items:n,toast:o,dismiss:s,dismissAll:a}=nl(t,r),l=n.reduce((d,m)=>{let c=m.position??t;return (d[c]??(d[c]=[])).push(m),d},{});return jsxRuntime.jsxs(cn.Provider,{value:{toast:o,dismiss:s,dismissAll:a},children:[e,typeof document<"u"&&reactDom.createPortal(jsxRuntime.jsx(jsxRuntime.Fragment,{children:Object.entries(l).map(([d,m])=>jsxRuntime.jsx("div",{className:i("pointer-events-none fixed z-[100] flex flex-col gap-2",zu[d]),children:m.map(c=>jsxRuntime.jsx(Xu,{item:c,onDismiss:s},c.id))},d))}),document.body)]})}function mo(){let e=Kr.useContext(cn);if(!e)throw new Error("useToast must be used within a <ToastProvider>");return e}var Gu={Alert:Qa,ProgressBar:ts,Spin:ns,Skeleton:lo,ToastProvider:co,useToast:mo},ss=Gu;var il="#1c1914",ll="#130f0b",c0="#2e261e",ls="#504638",kr="#6b5d4d",uo=`url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.7' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E")`,d0=[{key:"like",icon:jsxRuntime.jsx(lucideReact.Heart,{className:"h-5 w-5"}),activeIcon:jsxRuntime.jsx(lucideReact.Heart,{className:"h-5 w-5",fill:"currentColor"}),label:"Like",toggle:true},{key:"dislike",icon:jsxRuntime.jsx(lucideReact.ThumbsDown,{className:"h-5 w-5"}),label:"Dislike"},{key:"bookmark",icon:jsxRuntime.jsx(lucideReact.Bookmark,{className:"h-5 w-5"}),activeIcon:jsxRuntime.jsx(lucideReact.Bookmark,{className:"h-5 w-5",fill:"currentColor"}),label:"Bookmark",toggle:true},{key:"share",icon:jsxRuntime.jsx(lucideReact.Share2,{className:"h-5 w-5"}),label:"Share"},{key:"download",icon:jsxRuntime.jsx(lucideReact.Download,{className:"h-5 w-5"}),label:"Download"}];function cs({photos:e,layout:t="strip",actions:r=d0,onAction:n,className:o,showGrain:s=true,sheetTitle:a,sheetLabel:l}){let[d,m]=Kr.useState(null),[c,f]=Kr.useState(new Set),p=Kr.useCallback(x=>m(x),[]),u=Kr.useCallback(()=>m(null),[]),h=Kr.useCallback((x,w)=>{if(r.find(M=>M.key===x)?.toggle){let M=`${w}-${x}`;f(v=>{let N=new Set(v);return N.has(M)?N.delete(M):N.add(M),N});}n?.(x,e[w],w);},[r,n,e]);return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(t==="strip"?m0:t==="sheet"?p0:u0,{photos:e,onPhotoClick:p,showGrain:s,className:o,sheetTitle:a,sheetLabel:l}),d!==null&&reactDom.createPortal(jsxRuntime.jsx(f0,{photos:e,currentIndex:d,onIndexChange:m,onClose:u,actions:r,activeActions:c,onAction:h,showGrain:s}),document.body)]})}function sl({count:e=30}){return jsxRuntime.jsx("div",{className:"flex shrink-0 items-center justify-between px-3",style:{height:22,background:il},children:Array.from({length:e}).map((t,r)=>jsxRuntime.jsx("div",{className:"rounded-xs",style:{width:12,height:8,background:c0}},r))})}function m0({photos:e,onPhotoClick:t,showGrain:r,className:n}){let o=Kr.useRef(null);return jsxRuntime.jsxs("div",{className:i("select-none rounded-lg overflow-hidden",n),style:{background:ll},children:[jsxRuntime.jsx(sl,{count:Math.max(30,e.length*6)}),jsxRuntime.jsx("div",{ref:o,className:"flex gap-1 overflow-x-auto scroll-smooth px-1 py-1",style:{background:il,scrollSnapType:"x mandatory"},children:e.map((s,a)=>jsxRuntime.jsxs("div",{className:"group relative shrink-0 cursor-pointer",style:{scrollSnapAlign:"center"},onClick:()=>t(a),children:[jsxRuntime.jsxs("div",{className:"overflow-hidden rounded-xs border",style:{borderColor:ls,width:280,height:187},children:[jsxRuntime.jsx("img",{src:s.src,alt:s.alt??s.title??"",className:"h-full w-full object-cover transition-transform duration-700 ease-out group-hover:scale-110",draggable:false}),jsxRuntime.jsx("div",{className:"pointer-events-none absolute inset-0 mix-blend-multiply opacity-0 transition-opacity duration-300 group-hover:opacity-100",style:{background:"rgba(255, 175, 60, 0.06)"}}),r&&jsxRuntime.jsx("div",{className:"pointer-events-none absolute inset-0 opacity-0 transition-opacity duration-300 group-hover:opacity-[0.06]",style:{backgroundImage:uo,animation:"film-grain-shift 0.6s steps(5) infinite"}}),jsxRuntime.jsx("div",{className:"pointer-events-none absolute inset-0 opacity-30 transition-opacity duration-300 group-hover:opacity-50",style:{background:"radial-gradient(ellipse at center, transparent 50%, rgba(0,0,0,0.5) 100%)"}})]}),jsxRuntime.jsxs("div",{className:"mt-0.5 text-center font-mono text-[9px] tracking-widest",style:{color:kr},children:[String(a+1).padStart(2,"0"),a%2===0?"":"A"]})]},a))}),jsxRuntime.jsx(sl,{count:Math.max(30,e.length*6)})]})}function p0({photos:e,onPhotoClick:t,showGrain:r,className:n,sheetTitle:o,sheetLabel:s}){return jsxRuntime.jsxs("div",{className:i("rounded-lg p-5",n),style:{background:ll},children:[jsxRuntime.jsxs("div",{className:"mb-4 flex items-center justify-between",children:[jsxRuntime.jsx("span",{className:"font-mono text-[10px] uppercase tracking-[0.25em]",style:{color:kr},children:o??`JAC\xB7Film 35mm \xB7 ${e.length} exposures`}),jsxRuntime.jsx("span",{className:"font-mono text-[10px] uppercase tracking-[0.25em]",style:{color:kr},children:s??"Contact Sheet"})]}),jsxRuntime.jsx("div",{className:"grid grid-cols-3 gap-2 sm:grid-cols-4 md:grid-cols-5 lg:grid-cols-6",children:e.map((a,l)=>jsxRuntime.jsxs("div",{className:"group cursor-pointer",style:{animation:`reveal-up 0.4s ease-out ${l*50}ms both`},onClick:()=>t(l),children:[jsxRuntime.jsx("div",{className:"mb-0.5 font-mono text-[9px] tracking-wider",style:{color:kr},children:String(l+1).padStart(2,"0")}),jsxRuntime.jsxs("div",{className:"relative overflow-hidden rounded-[1px] border transition-all duration-300 group-hover:border-amber-600/50 group-hover:shadow-[0_0_20px_rgba(217,171,89,0.15)]",style:{borderColor:ls,aspectRatio:"3/2"},children:[jsxRuntime.jsx("img",{src:a.src,alt:a.alt??"",className:"h-full w-full object-cover transition-transform duration-500 group-hover:scale-105",draggable:false}),r&&jsxRuntime.jsx("div",{className:"pointer-events-none absolute inset-0 opacity-[0.04]",style:{backgroundImage:uo}}),jsxRuntime.jsx("div",{className:"pointer-events-none absolute inset-x-0 bottom-0 translate-y-full bg-linear-to-t from-black/70 to-transparent p-2 pt-6 transition-transform duration-300 group-hover:translate-y-0",children:jsxRuntime.jsx("span",{className:"text-xs font-medium text-white/90",children:a.title})})]})]},l))})]})}function u0({photos:e,onPhotoClick:t,showGrain:r,className:n}){let[o,s]=Kr.useState(false),[a,l]=Kr.useState(null),d=Math.min(e.length,8),m=e.slice(0,d),c=p=>{let u=Math.sin(p*137.508+1)*1e4,h=(u%12-6).toFixed(1),g=(u/7%8-4).toFixed(1),x=(u/13%6-3).toFixed(1);return `rotate(${h}deg) translate(${g}px, ${x}px)`},f=(p,u)=>{let h=(u-1)/2,g=((p-h)*7).toFixed(1),x=((p-h)*110).toFixed(0),w=(-Math.abs(p-h)*10+(a===p?-18:0)).toFixed(0);return `translateX(${x}px) translateY(${w}px) rotate(${g}deg)`};return jsxRuntime.jsxs("div",{className:i("flex flex-col items-center gap-4",n),children:[jsxRuntime.jsx("div",{className:"relative flex h-85 w-full items-center justify-center",onMouseEnter:()=>s(true),onMouseLeave:()=>{s(false),l(null);},children:m.map((p,u)=>jsxRuntime.jsx("div",{className:"absolute cursor-pointer rounded-lg shadow-xl transition-all duration-500",style:{transitionTimingFunction:"cubic-bezier(0.34, 1.56, 0.64, 1)",transitionDelay:o?`${u*35}ms`:`${(d-u)*25}ms`,transform:o?f(u,m.length):c(u),zIndex:o?u+1:m.length-u,width:220,height:147},onClick:()=>t(u),onMouseEnter:()=>o&&l(u),onMouseLeave:()=>l(null),children:jsxRuntime.jsxs("div",{className:"relative h-full w-full overflow-hidden rounded-lg border transition-shadow duration-300",style:{borderColor:o&&a===u?"rgba(217,171,89,0.5)":ls,boxShadow:o&&a===u?"0 25px 50px rgba(0,0,0,0.5), 0 0 30px rgba(217,171,89,0.1)":"0 10px 30px rgba(0,0,0,0.4)"},children:[jsxRuntime.jsx("img",{src:p.src,alt:p.alt??"",className:"h-full w-full object-cover",draggable:false}),r&&jsxRuntime.jsx("div",{className:"pointer-events-none absolute inset-0 opacity-[0.04]",style:{backgroundImage:uo}}),jsxRuntime.jsx("div",{className:"pointer-events-none absolute inset-0",style:{background:"radial-gradient(ellipse at center, transparent 40%, rgba(0,0,0,0.35) 100%)"}}),o&&a===u&&jsxRuntime.jsx("div",{className:"absolute inset-x-0 bottom-0 bg-linear-to-t from-black/80 to-transparent p-3 pt-8",style:{animation:"reveal-up 0.25s ease-out"},children:jsxRuntime.jsx("span",{className:"text-sm font-medium text-white/90",children:p.title})})]})},u))}),e.length>d&&jsxRuntime.jsxs("span",{className:"font-mono text-xs",style:{color:kr},children:["+ ",e.length-d," more"]}),jsxRuntime.jsx("span",{className:"font-mono text-[10px] uppercase tracking-[0.3em] transition-opacity duration-300",style:{color:kr,opacity:o?0:.7},children:"Hover to explore"})]})}function f0({photos:e,currentIndex:t,onIndexChange:r,onClose:n,actions:o,activeActions:s,onAction:a,showGrain:l}){let d=e[t],[m,c]=Kr.useState(1),[f,p]=Kr.useState({x:0,y:0}),[u,h]=Kr.useState(false),[g,x]=Kr.useState(false),w=Kr.useRef(false),y=Kr.useRef({x:0,y:0}),M=Kr.useRef(null);Kr.useLayoutEffect(()=>{requestAnimationFrame(()=>x(true));},[]),Kr.useEffect(()=>{let k=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=k;}},[]),Kr.useEffect(()=>{let k=O=>{switch(O.key){case "Escape":n();break;case "ArrowLeft":v(-1);break;case "ArrowRight":v(1);break;case "i":case "I":h(C=>!C);break}};return document.addEventListener("keydown",k),()=>document.removeEventListener("keydown",k)}),Kr.useEffect(()=>{let k=M.current;if(!k)return;let O=C=>{C.preventDefault();let X=C.deltaY<0?1.12:.89;c(T=>{let re=Math.min(8,Math.max(1,T*X));return re<=1&&p({x:0,y:0}),re});};return k.addEventListener("wheel",O,{passive:false}),()=>k.removeEventListener("wheel",O)},[]);let v=Kr.useCallback(k=>{let O=t+k;O>=0&&O<e.length&&(r(O),c(1),p({x:0,y:0}));},[t,e.length,r]),N=Kr.useCallback(k=>{m<=1||(w.current=true,y.current={x:k.clientX,y:k.clientY},k.target.setPointerCapture(k.pointerId));},[m]),L=Kr.useCallback(k=>{if(!w.current)return;let O=k.clientX-y.current.x,C=k.clientY-y.current.y;y.current={x:k.clientX,y:k.clientY},p(X=>({x:X.x+O/m,y:X.y+C/m}));},[m]),R=Kr.useCallback(()=>{w.current=false;},[]),D=Kr.useCallback(()=>{m>1?(c(1),p({x:0,y:0})):c(2.5);},[m]),A=k=>s.has(`${t}-${k}`),V=d.metadata;return jsxRuntime.jsxs("div",{className:"fixed inset-0 z-200 flex flex-col",style:{animation:"lightbox-backdrop-in 0.35s ease-out"},children:[jsxRuntime.jsx("div",{className:"absolute inset-0 bg-black/95",onClick:n}),l&&jsxRuntime.jsx("div",{className:"pointer-events-none absolute inset-0 opacity-[0.025]",style:{backgroundImage:uo,animation:"film-grain-shift 0.6s steps(5) infinite"}}),jsxRuntime.jsxs("div",{className:"relative z-10 flex h-12 shrink-0 items-center justify-between px-4",children:[jsxRuntime.jsxs("span",{className:"font-mono text-sm text-white/50",children:[t+1," / ",e.length]}),jsxRuntime.jsxs("div",{className:"flex items-center gap-1",children:[jsxRuntime.jsxs("span",{className:"mr-2 font-mono text-xs text-white/40",children:[m.toFixed(1),"x"]}),jsxRuntime.jsx("button",{className:"rounded-full p-2 text-white/60 transition-colors hover:bg-white/10 hover:text-white",onClick:()=>c(k=>Math.min(8,k*1.3)),title:"Zoom in",children:jsxRuntime.jsx(lucideReact.ZoomIn,{className:"h-4 w-4"})}),jsxRuntime.jsx("button",{className:"rounded-full p-2 text-white/60 transition-colors hover:bg-white/10 hover:text-white",onClick:()=>{c(k=>{let O=Math.max(1,k*.7);return O<=1&&p({x:0,y:0}),O});},title:"Zoom out",children:jsxRuntime.jsx(lucideReact.ZoomOut,{className:"h-4 w-4"})}),jsxRuntime.jsx("button",{className:"rounded-full p-2 text-white/60 transition-colors hover:bg-white/10 hover:text-white",onClick:n,title:"Close",children:jsxRuntime.jsx(lucideReact.X,{className:"h-5 w-5"})})]})]}),jsxRuntime.jsxs("div",{ref:M,className:"relative flex flex-1 items-center justify-center overflow-hidden",style:{cursor:m>1?"grab":"default"},onPointerDown:N,onPointerMove:L,onPointerUp:R,onDoubleClick:D,children:[jsxRuntime.jsx("img",{src:d.src,alt:d.alt??d.title??"",className:"max-h-full max-w-full select-none object-contain",style:{animation:"lightbox-photo-in 0.35s cubic-bezier(0.16, 1, 0.3, 1)",transform:`scale(${m}) translate(${f.x}px, ${f.y}px)`,transition:w.current?"none":"transform 0.15s ease-out"},draggable:false},t),t>0&&jsxRuntime.jsx("button",{className:"absolute left-3 top-1/2 -translate-y-1/2 rounded-full bg-black/40 p-2.5 text-white/70 backdrop-blur-sm transition-all hover:bg-black/60 hover:text-white",onClick:k=>{k.stopPropagation(),v(-1);},children:jsxRuntime.jsx(lucideReact.ChevronLeft,{className:"h-6 w-6"})}),t<e.length-1&&jsxRuntime.jsx("button",{className:"absolute right-3 top-1/2 -translate-y-1/2 rounded-full bg-black/40 p-2.5 text-white/70 backdrop-blur-sm transition-all hover:bg-black/60 hover:text-white",onClick:k=>{k.stopPropagation(),v(1);},children:jsxRuntime.jsx(lucideReact.ChevronRight,{className:"h-6 w-6"})})]}),jsxRuntime.jsx("div",{className:i("absolute inset-x-0 bottom-0 z-20 transition-all duration-400",u?"translate-y-0 opacity-100":"pointer-events-none translate-y-full opacity-0"),children:jsxRuntime.jsxs("div",{className:"bg-linear-to-t from-black/90 via-black/75 to-transparent px-6 pb-24 pt-16",children:[d.title&&jsxRuntime.jsx("h3",{className:"mb-3 text-xl font-semibold text-white",children:d.title}),d.description&&jsxRuntime.jsx("p",{className:"mb-4 max-w-xl border-l-2 border-amber-500/40 pl-4 text-sm leading-relaxed text-white/60 italic",style:{animation:"reveal-up 0.4s ease-out 0.1s both"},children:d.description}),V&&jsxRuntime.jsxs("div",{className:"flex flex-wrap gap-x-6 gap-y-2 text-sm text-white/70",children:[V.camera&&jsxRuntime.jsxs("span",{className:"flex items-center gap-1.5",children:[jsxRuntime.jsx(lucideReact.Camera,{className:"h-3.5 w-3.5 text-amber-400/80"})," ",V.camera,V.lens&&jsxRuntime.jsx("span",{className:"text-white/40",children:"\xB7"}),V.lens&&V.lens]}),(V.aperture||V.shutter||V.iso)&&jsxRuntime.jsxs("span",{className:"flex items-center gap-1.5",children:[jsxRuntime.jsx(lucideReact.Aperture,{className:"h-3.5 w-3.5 text-amber-400/80"}),[V.aperture,V.shutter,V.iso&&`ISO ${V.iso}`].filter(Boolean).join(" \xB7 ")]}),V.date&&jsxRuntime.jsxs("span",{className:"flex items-center gap-1.5",children:[jsxRuntime.jsx(lucideReact.Calendar,{className:"h-3.5 w-3.5 text-amber-400/80"})," ",V.date]}),V.location&&jsxRuntime.jsxs("span",{className:"flex items-center gap-1.5",children:[jsxRuntime.jsx(lucideReact.MapPin,{className:"h-3.5 w-3.5 text-amber-400/80"})," ",V.location]})]})]})}),jsxRuntime.jsx("div",{className:"relative z-20 flex h-16 shrink-0 items-center justify-center gap-1",children:jsxRuntime.jsxs("div",{className:"flex items-center gap-0.5 rounded-full bg-white/6 px-2 py-1.5 backdrop-blur-xl",children:[o.map(k=>{let O=k.toggle&&A(k.key);return jsxRuntime.jsx("button",{className:i("rounded-full p-2.5 transition-all duration-200",O?"text-amber-400 hover:text-amber-300":"text-white/60 hover:bg-white/10 hover:text-white"),onClick:()=>a(k.key,t),title:k.label,children:O&&k.activeIcon?k.activeIcon:k.icon},k.key)}),jsxRuntime.jsx("div",{className:"mx-1 h-5 w-px bg-white/10"}),jsxRuntime.jsx("button",{className:i("rounded-full p-2.5 transition-all duration-200",u?"text-amber-400 hover:text-amber-300":"text-white/60 hover:bg-white/10 hover:text-white"),onClick:()=>h(k=>!k),title:"Photo info (I)",children:jsxRuntime.jsx(lucideReact.Info,{className:"h-5 w-5"})})]})})]})}var ds="data:image/svg+xml,"+encodeURIComponent(`<svg xmlns="http://www.w3.org/2000/svg" width="200" height="200" viewBox="0 0 200 200">
1
+ 'use strict';Object.defineProperty(exports,'__esModule',{value:true});var clsx=require('clsx'),tailwindMerge=require('tailwind-merge'),classVarianceAuthority=require('class-variance-authority'),jsxRuntime=require('react/jsx-runtime'),qr=require('react'),lucideReact=require('lucide-react'),reactDom=require('react-dom'),client=require('react-dom/client');function _interopDefault(e){return e&&e.__esModule?e:{default:e}}var qr__default=/*#__PURE__*/_interopDefault(qr);function s(...e){return tailwindMerge.twMerge(clsx.clsx(e))}var ur=classVarianceAuthority.cva("inline-flex cursor-pointer items-center justify-center gap-1.5 rounded font-medium transition-colors disabled:pointer-events-none disabled:opacity-50 [&_svg]:shrink-0",{variants:{intent:{primary:"bg-primary-500 text-white hover:bg-primary-600 active:bg-primary-700",secondary:"bg-secondary-500 text-white hover:bg-secondary-600 active:bg-secondary-700",danger:"bg-danger-500 text-white hover:bg-danger-600 active:bg-danger-700",warning:"bg-warning-500 text-white hover:bg-warning-600 active:bg-warning-700",ghost:"bg-transparent text-primary-700 hover:bg-primary-100 active:bg-primary-200 dark:text-primary-300 dark:hover:bg-primary-800",outline:"border border-primary-300 bg-transparent text-primary-700 hover:bg-primary-50 dark:border-primary-600 dark:text-primary-300 dark:hover:bg-primary-800"},size:{sm:"h-7 px-3 text-xs [&_svg]:h-3.5 [&_svg]:w-3.5",md:"h-9 px-4 text-sm [&_svg]:h-4 [&_svg]:w-4",lg:"h-11 px-6 text-base [&_svg]:h-5 [&_svg]:w-5"}},defaultVariants:{intent:"primary",size:"md"}}),Nn=classVarianceAuthority.cva("inline-flex items-center gap-1 rounded border font-semibold [&_svg]:shrink-0",{variants:{intent:{success:"border-success-200 bg-success-100 text-success-800 dark:border-success-800 dark:bg-success-900/30 dark:text-success-400",warning:"border-warning-200 bg-warning-100 text-warning-800 dark:border-warning-800 dark:bg-warning-900/30 dark:text-warning-400",error:"border-danger-200 bg-danger-100 text-danger-800 dark:border-danger-800 dark:bg-danger-900/30 dark:text-danger-400",info:"border-primary-200 bg-primary-100 text-primary-800 dark:border-primary-800 dark:bg-primary-900/30 dark:text-primary-400",primary:"border-secondary-200 bg-secondary-100 text-secondary-700 dark:border-secondary-700 dark:bg-secondary-800 dark:text-secondary-300"},size:{sm:"px-1.5 py-0 text-[0.625rem] [&_svg]:h-2.5 [&_svg]:w-2.5",md:"px-2.5 py-0.5 text-xs [&_svg]:h-3 [&_svg]:w-3",lg:"px-3 py-1 text-sm [&_svg]:h-3.5 [&_svg]:w-3.5"}},defaultVariants:{intent:"primary",size:"md"}}),Cn=classVarianceAuthority.cva("absolute flex items-center justify-center rounded-full font-bold leading-none ring-2 ring-white select-none pointer-events-none z-10 dark:ring-primary-900",{variants:{intent:{danger:"bg-danger-500 text-white",success:"bg-success-500 text-white",warning:"bg-warning-500 text-white",info:"bg-primary-500 text-white",primary:"bg-secondary-500 text-white"},size:{sm:"text-[0.5rem]",md:"text-[0.625rem]",lg:"text-xs"},dot:{true:"",false:""},placement:{"top-right":"top-0 right-0 translate-x-1/2 -translate-y-1/2","top-left":"top-0 left-0 -translate-x-1/2 -translate-y-1/2","bottom-right":"bottom-0 right-0 translate-x-1/2 translate-y-1/2","bottom-left":"bottom-0 left-0 -translate-x-1/2 translate-y-1/2"}},compoundVariants:[{dot:true,size:"sm",class:"h-1.5 w-1.5 min-w-0 ring-1"},{dot:true,size:"md",class:"h-2 w-2 min-w-0"},{dot:true,size:"lg",class:"h-2.5 w-2.5 min-w-0"},{dot:false,size:"sm",class:"h-4 min-w-4 px-1"},{dot:false,size:"md",class:"h-5 min-w-5 px-1.5"},{dot:false,size:"lg",class:"h-6 min-w-6 px-2"}],defaultVariants:{intent:"danger",size:"md",dot:false,placement:"top-right"}}),fr=classVarianceAuthority.cva("w-full rounded-md border bg-white text-secondary-900 transition-colors placeholder:text-secondary-400 focus:outline-none focus:ring-2 dark:bg-secondary-900 dark:text-secondary-100 dark:placeholder:text-secondary-600",{variants:{state:{default:"border-secondary-300 focus:border-primary-500 focus:ring-primary-500/20 dark:border-secondary-600",error:"border-danger-400 focus:border-danger-500 focus:ring-danger-500/20"},size:{sm:"h-7 px-2 text-xs",md:"h-9 px-3 py-2 text-sm",lg:"h-11 px-4 py-2.5 text-base"}},defaultVariants:{state:"default",size:"md"}}),Tn=classVarianceAuthority.cva("inline-flex items-center gap-1 font-medium [&_svg]:shrink-0",{variants:{size:{sm:"text-xs [&_svg]:h-3 [&_svg]:w-3",md:"text-sm [&_svg]:h-3.5 [&_svg]:w-3.5",lg:"text-base [&_svg]:h-4 [&_svg]:w-4"},intent:{default:"text-primary-700 dark:text-primary-300",muted:"text-primary-400 dark:text-primary-500",required:"text-primary-700 dark:text-primary-300 after:ml-0.5 after:text-danger-500 after:content-['*']"}},defaultVariants:{size:"md",intent:"default"}}),Mn=classVarianceAuthority.cva("relative inline-flex shrink-0 items-center justify-center rounded border-2 transition-all duration-200 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-offset-2",{variants:{intent:{primary:"border-primary-300 dark:border-primary-600 focus-visible:ring-primary-500/40",secondary:"border-secondary-300 dark:border-secondary-600 focus-visible:ring-secondary-500/40",danger:"border-danger-300 dark:border-danger-600 focus-visible:ring-danger-500/40",warning:"border-warning-300 dark:border-warning-600 focus-visible:ring-warning-500/40",success:"border-success-300 dark:border-success-600 focus-visible:ring-success-500/40"},size:{sm:"h-4 w-4 rounded-[3px]",md:"h-5 w-5 rounded",lg:"h-6 w-6 rounded-[5px]"},checked:{on:"",off:"bg-white dark:bg-primary-900"}},compoundVariants:[{intent:"primary",checked:"on",class:"border-primary-500 bg-primary-500 dark:border-primary-500 dark:bg-primary-500"},{intent:"secondary",checked:"on",class:"border-secondary-500 bg-secondary-500 dark:border-secondary-500 dark:bg-secondary-500"},{intent:"danger",checked:"on",class:"border-danger-500 bg-danger-500 dark:border-danger-500 dark:bg-danger-500"},{intent:"warning",checked:"on",class:"border-warning-500 bg-warning-500 dark:border-warning-500 dark:bg-warning-500"},{intent:"success",checked:"on",class:"border-success-500 bg-success-500 dark:border-success-500 dark:bg-success-500"}],defaultVariants:{intent:"primary",size:"md",checked:"off"}}),Rn=classVarianceAuthority.cva("relative inline-flex shrink-0 items-center justify-center rounded-full border-2 transition-all duration-200 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-offset-2",{variants:{intent:{primary:"border-primary-300 dark:border-primary-600 focus-visible:ring-primary-500/40",secondary:"border-secondary-300 dark:border-secondary-600 focus-visible:ring-secondary-500/40",danger:"border-danger-300 dark:border-danger-600 focus-visible:ring-danger-500/40",warning:"border-warning-300 dark:border-warning-600 focus-visible:ring-warning-500/40",success:"border-success-300 dark:border-success-600 focus-visible:ring-success-500/40"},size:{sm:"h-4 w-4",md:"h-5 w-5",lg:"h-6 w-6"},checked:{on:"",off:"bg-white dark:bg-primary-900"}},compoundVariants:[{intent:"primary",checked:"on",class:"border-primary-500 bg-primary-500 dark:border-primary-500 dark:bg-primary-500"},{intent:"secondary",checked:"on",class:"border-secondary-500 bg-secondary-500 dark:border-secondary-500 dark:bg-secondary-500"},{intent:"danger",checked:"on",class:"border-danger-500 bg-danger-500 dark:border-danger-500 dark:bg-danger-500"},{intent:"warning",checked:"on",class:"border-warning-500 bg-warning-500 dark:border-warning-500 dark:bg-warning-500"},{intent:"success",checked:"on",class:"border-success-500 bg-success-500 dark:border-success-500 dark:bg-success-500"}],defaultVariants:{intent:"primary",size:"md",checked:"off"}}),Sn=classVarianceAuthority.cva("",{variants:{intent:{primary:"",secondary:"",danger:"",warning:"",success:""},size:{sm:"",md:"",lg:""},checked:{on:"",off:"bg-primary-300 dark:bg-primary-800"}},compoundVariants:[{intent:"primary",checked:"on",class:"bg-primary-500 dark:bg-primary-500"},{intent:"secondary",checked:"on",class:"bg-secondary-500 dark:bg-secondary-500"},{intent:"danger",checked:"on",class:"bg-danger-500 dark:bg-danger-500"},{intent:"warning",checked:"on",class:"bg-warning-500 dark:bg-warning-500"},{intent:"success",checked:"on",class:"bg-success-500 dark:bg-success-500"}],defaultVariants:{intent:"primary",size:"md",checked:"off"}}),Br=classVarianceAuthority.cva("bg-primary-200 text-primary-700 dark:bg-primary-700 dark:text-primary-200",{variants:{size:{xs:"h-6 w-6 text-[10px]",sm:"h-8 w-8 text-xs",md:"h-10 w-10 text-sm",lg:"h-12 w-12 text-base",xl:"h-16 w-16 text-lg"},shape:{circular:"rounded-full",rounded:"rounded-lg",square:"rounded-none"}},defaultVariants:{size:"md",shape:"circular"}}),Or=classVarianceAuthority.cva("relative flex w-full touch-none select-none items-center",{variants:{intent:{primary:"[&_.slider-fill]:bg-primary-500 [&_.slider-thumb]:border-primary-500",secondary:"[&_.slider-fill]:bg-secondary-500 [&_.slider-thumb]:border-secondary-500",success:"[&_.slider-fill]:bg-success-500 [&_.slider-thumb]:border-success-500",danger:"[&_.slider-fill]:bg-danger-500 [&_.slider-thumb]:border-danger-500",warning:"[&_.slider-fill]:bg-warning-500 [&_.slider-thumb]:border-warning-500"},size:{sm:"h-4",md:"h-5",lg:"h-6"}},defaultVariants:{intent:"primary",size:"md"}}),Pn=classVarianceAuthority.cva("inline-flex items-center gap-1 rounded-full font-medium select-none transition-colors [&_svg]:shrink-0",{variants:{intent:{primary:"bg-primary-100 text-primary-700 dark:bg-primary-800 dark:text-primary-200",secondary:"bg-secondary-100 text-secondary-700 dark:bg-secondary-800 dark:text-secondary-200",success:"bg-success-100 text-success-700 dark:bg-success-900/40 dark:text-success-300",danger:"bg-danger-100 text-danger-700 dark:bg-danger-900/40 dark:text-danger-300",warning:"bg-warning-100 text-warning-700 dark:bg-warning-900/40 dark:text-warning-300",info:"bg-blue-100 text-blue-700 dark:bg-blue-900/40 dark:text-blue-300"},size:{sm:"h-5 px-2 text-[0.6875rem] gap-0.5",md:"h-6 px-2.5 text-xs gap-1",lg:"h-7 px-3 text-sm gap-1"},variant:{solid:"",outline:"bg-transparent border",soft:""}},compoundVariants:[{intent:"primary",variant:"outline",class:"border-primary-300 text-primary-700 dark:border-primary-600 dark:text-primary-300"},{intent:"secondary",variant:"outline",class:"border-secondary-300 text-secondary-700 dark:border-secondary-600 dark:text-secondary-300"},{intent:"success",variant:"outline",class:"border-success-400 text-success-700 dark:border-success-600 dark:text-success-300"},{intent:"danger",variant:"outline",class:"border-danger-400 text-danger-700 dark:border-danger-600 dark:text-danger-300"},{intent:"warning",variant:"outline",class:"border-warning-400 text-warning-700 dark:border-warning-600 dark:text-warning-300"},{intent:"info",variant:"outline",class:"border-blue-400 text-blue-700 dark:border-blue-600 dark:text-blue-300"}],defaultVariants:{intent:"primary",size:"md",variant:"solid"}});classVarianceAuthority.cva("relative w-full cursor-pointer rounded-md border bg-white text-sm transition-colors dark:bg-primary-900",{variants:{intent:{default:"border-primary-300 text-primary-900 hover:border-primary-400 focus-within:border-primary-500 focus-within:ring-2 focus-within:ring-primary-500/20 dark:border-primary-600 dark:text-primary-100 dark:hover:border-primary-500 dark:focus-within:border-primary-400",danger:"border-danger-500 text-primary-900 focus-within:ring-2 focus-within:ring-danger-500/20 dark:border-danger-500 dark:text-primary-100"},size:{sm:"h-7 px-2 text-xs",md:"h-9 px-3 text-sm",lg:"h-11 px-4 text-base"}},defaultVariants:{intent:"default",size:"md"}});function gr({intent:e,size:t,className:r,...n}){return jsxRuntime.jsx("button",{className:s(ur({intent:e,size:t}),r),...n})}function Ua(e,t){for(let r of e){if(r.value===t)return r;if(r.children){let n=Ua(r.children,t);if(n)return n}}}function qa(e){let t=[];for(let r of e)r.children?.length||t.push(r),r.children&&t.push(...qa(r.children));return t}var Vn=40,Qc=200,Qa=150,ps=120;function En(e,t,r,n){if(!n)return {};if(r){let i=(t-1-e)*Vn;return {animation:`dropdown-item-out ${Qa}ms ease-in both ${i}ms`}}let a=e*Vn;return {animation:`dropdown-item-in ${Qc}ms ease-out both ${a}ms`}}function us(e,t,r){if(!r)return {};if(t){let n=Math.max(e-1,0)*Vn+Qa;return {animation:`dropdown-container-out ${ps}ms ease-in both ${n}ms`}}return {animation:"var(--animate-dropdown-container-in)"}}function fs({options:e,onSelect:t,animated:r=true,closing:n=false,depth:a=0}){let[i,o]=qr.useState(null),l=qr.useRef(void 0),c=d=>{l.current&&clearTimeout(l.current),o(d);},m=()=>{l.current=setTimeout(()=>o(null),150);};return qr.useEffect(()=>()=>{l.current&&clearTimeout(l.current);},[]),jsxRuntime.jsx("div",{className:s("absolute z-50 min-w-44 rounded-md border py-1 shadow-lg overflow-hidden","border-primary-200 dark:border-primary-700 dark:bg-primary-800 bg-white",a===0?"mt-1 w-full":"top-0 ml-0.5"),style:{...a>0?{left:"100%"}:{},...us(e.length,n,r)},role:"listbox",children:e.map((d,f)=>{let p=!!d.children?.length,u=i===d.value;return jsxRuntime.jsxs("div",{className:"relative",style:En(f,e.length,n,r),onMouseEnter:()=>c(d.value),onMouseLeave:m,children:[jsxRuntime.jsxs("div",{role:"option","aria-selected":false,"aria-disabled":d.disabled,className:s("flex w-full cursor-pointer items-center gap-2 px-3 py-1.5 text-left text-sm transition-colors","text-primary-700 hover:bg-primary-100 dark:text-primary-300 dark:hover:bg-primary-700/50",d.disabled&&"pointer-events-none opacity-50"),onClick:()=>{d.disabled||p||t(d.value,d);},children:[d.icon&&jsxRuntime.jsx("span",{className:"flex h-4 w-4 shrink-0 items-center justify-center",children:d.icon}),jsxRuntime.jsx("span",{className:"flex-1 truncate",children:d.label??d.value}),p&&jsxRuntime.jsx(lucideReact.ChevronRight,{className:"text-primary-400 h-3.5 w-3.5 shrink-0"})]}),p&&u&&jsxRuntime.jsx(fs,{options:d.children,onSelect:t,animated:r,depth:a+1})]},d.value)})})}function Zc({options:e,filter:t,multiple:r,selected:n,canAdd:a,animated:i=true,closing:o=false,onSelect:l,onToggle:c,onAdd:m}){let d=qr.useMemo(()=>qa(e),[e]),f=t.toLowerCase(),p=t?d.filter(g=>(g.label??g.value).toLowerCase().includes(f)||g.value.toLowerCase().includes(f)):d,u=p.length===0&&!a||a?1:0,h=p.length+u;return jsxRuntime.jsxs("div",{className:s("absolute z-50 mt-1 w-full max-h-60 min-w-44 overflow-y-auto rounded-md border py-1 shadow-lg","border-primary-200 dark:border-primary-700 dark:bg-primary-800 bg-white"),role:"listbox","aria-multiselectable":r||void 0,style:us(h,o,i),children:[p.map((g,b)=>{let N=r&&n.includes(g.value);return jsxRuntime.jsxs("div",{role:"option","aria-selected":r?N:false,"aria-disabled":g.disabled,className:s("flex w-full cursor-pointer items-center gap-2 px-3 py-1.5 text-left text-sm transition-colors","text-primary-700 hover:bg-primary-100 dark:text-primary-300 dark:hover:bg-primary-700/50",g.disabled&&"pointer-events-none opacity-50"),style:En(b,h,o,i),onClick:()=>{g.disabled||(r?c(g.value):l(g.value,g));},children:[r&&jsxRuntime.jsx("span",{className:s("flex h-4 w-4 shrink-0 items-center justify-center rounded border transition-colors",N?"border-primary-600 bg-primary-600 text-white dark:border-primary-500 dark:bg-primary-500":"border-secondary-300 bg-white dark:border-secondary-600 dark:bg-secondary-800"),children:N&&jsxRuntime.jsx(lucideReact.Check,{className:"h-3 w-3"})}),g.icon&&jsxRuntime.jsx("span",{className:"flex h-4 w-4 shrink-0 items-center justify-center",children:g.icon}),jsxRuntime.jsx("span",{className:"truncate",children:g.label??g.value})]},g.value)}),p.length===0&&!a&&jsxRuntime.jsx("div",{className:"text-primary-400 px-3 py-2 text-center text-sm",style:En(0,1,o,i),children:"No matches"}),a&&jsxRuntime.jsxs("div",{className:s("flex w-full cursor-pointer items-center gap-2 px-3 py-1.5 text-left text-sm transition-colors","text-primary-600 hover:bg-primary-50 dark:text-primary-400 dark:hover:bg-primary-900/30"),style:En(p.length,h,o,i),onClick:m,children:[jsxRuntime.jsx("span",{className:"flex h-4 w-4 shrink-0 items-center justify-center text-lg leading-none",children:"+"}),jsxRuntime.jsxs("span",{className:"truncate",children:["Add \u201C",t.trim(),"\u201D"]})]})]})}function Za(e){let{options:t,placeholder:r="Select\u2026",editable:n=false,onAddItem:a,disabled:i=false,align:o="left",className:l,size:c="md",animated:m=true,name:d,intent:f="default",clearable:p=false,id:u,"aria-describedby":h,"aria-invalid":g}=e,b=e.multiple===true,[N,x]=qr.useState(b?void 0:e.defaultValue),[T,w]=qr.useState(b?e.defaultSelected??[]:[]),C=b?e.selected??T:[],[S,R]=qr.useState(false),[V,I]=qr.useState(false),[E,v]=qr.useState(""),U=qr.useRef(null),k=qr.useRef(null),q=qr.useRef(void 0),M=qr.useCallback(()=>{if(!m||!S){R(false),v("");return}I(true);let ee=(Math.max(t.length,1)-1)*Vn+Qa+ps+20;q.current=setTimeout(()=>{R(false),I(false),v("");},ee);},[m,S,t.length]);qr.useEffect(()=>()=>{q.current&&clearTimeout(q.current);},[]);let W=b?void 0:e.value??N,$=qr.useMemo(()=>W?Ua(t,W):void 0,[t,W]);qr.useEffect(()=>{if(!S)return;let _=ee=>{U.current&&!U.current.contains(ee.target)&&M();};return document.addEventListener("mousedown",_),()=>document.removeEventListener("mousedown",_)},[S,M]),qr.useEffect(()=>{if(!S)return;let _=ee=>{ee.key==="Escape"&&M();};return document.addEventListener("keydown",_),()=>document.removeEventListener("keydown",_)},[S,M]);let ue=qr.useCallback((_,ee)=>{b||(e.value===void 0&&x(_),e.onChange?.(_,ee)),q.current&&clearTimeout(q.current),R(false),I(false),v("");},[b,e]),J=qr.useCallback(_=>{if(!b)return;let ee=e.selected??T,xe=ee.includes(_)?ee.filter(P=>P!==_):[...ee,_];e.selected===void 0&&w(xe),e.onSelectionChange?.(xe),e.onChange?.(xe);},[b,T,e]),de=E.toLowerCase(),re=qr.useMemo(()=>!n||!E.trim()?false:!qa(t).some(ee=>ee.value.toLowerCase()===de||(ee.label??ee.value).toLowerCase()===de),[n,de,t]),B=qr.useCallback(()=>{let _=E.trim();_&&(a?.(_),v(""));},[E,a]),j=qr.useCallback(_=>{_.stopPropagation(),b?(w([]),e.onSelectionChange?.([]),e.onChange?.([])):(x(void 0),e.onChange?.("",void 0));},[b,e]),pe=qr.useCallback(_=>{_.key==="Enter"&&re&&(_.preventDefault(),B());},[re,B]),ye=qr.useCallback(()=>{i||(S?M():(q.current&&clearTimeout(q.current),I(false),R(true),v(""),n&&requestAnimationFrame(()=>k.current?.focus())));},[i,S,M,n]),y;if(b){let _=C.length;_===0?y="":_<=2?y=C.map(ee=>Ua(t,ee)).map(ee=>ee?ee.label??ee.value:"").filter(Boolean).join(", "):y=`${_} selected`;}else y=$?$.label??$.value:"";let L=b||n,G=f==="danger"||g===true,O=p&&(b?C.length>0:!!y);return jsxRuntime.jsxs("div",{ref:U,className:s("relative inline-block min-w-44",l),children:[d&&!b&&jsxRuntime.jsx("input",{type:"hidden",name:d,value:W??""}),d&&b&&C.map(_=>jsxRuntime.jsx("input",{type:"hidden",name:`${d}[]`,value:_},_)),u&&!n&&jsxRuntime.jsx("input",{type:"text",id:u,className:"sr-only",readOnly:true,tabIndex:-1,value:y??"",onChange:()=>{}}),jsxRuntime.jsxs("div",{className:s(fr({state:G?"error":"default",size:c}),"flex cursor-pointer items-center gap-1",i&&"pointer-events-none opacity-50"),onClick:ye,role:"combobox","aria-expanded":S,"aria-haspopup":"listbox","aria-invalid":G||void 0,"aria-describedby":h,children:[n?jsxRuntime.jsx("input",{ref:k,id:u,className:"min-w-0 flex-1 bg-transparent outline-none placeholder:text-secondary-400 dark:placeholder:text-secondary-600",value:S?E:y,placeholder:r,disabled:i,onChange:_=>{v(_.target.value),S||R(true);},onKeyDown:pe,onClick:_=>{_.stopPropagation(),S||R(true);}}):jsxRuntime.jsx("span",{className:s("flex-1 truncate",!y&&"text-secondary-400 dark:text-secondary-600"),children:y||r}),$?.icon&&!n&&!b&&jsxRuntime.jsx("span",{className:"flex h-4 w-4 shrink-0 items-center justify-center",children:$.icon}),b&&C.length>0&&jsxRuntime.jsx("span",{className:"rounded-full bg-primary-100 px-1.5 text-xs font-semibold text-primary-700 dark:bg-primary-900 dark:text-primary-300",children:C.length}),O&&jsxRuntime.jsx("button",{type:"button","aria-label":"Clear selection",className:"flex h-4 w-4 shrink-0 items-center justify-center rounded-full text-secondary-400 transition-colors hover:bg-secondary-200 hover:text-secondary-600 dark:hover:bg-secondary-700 dark:hover:text-secondary-300",onClick:j,children:jsxRuntime.jsx(lucideReact.X,{className:"h-3 w-3"})}),jsxRuntime.jsx(lucideReact.ChevronDown,{className:s("text-primary-400 h-4 w-4 shrink-0 transition-transform",S&&"rotate-180")})]}),S&&jsxRuntime.jsx("div",{className:s(o==="right"?"right-0":"left-0","absolute w-full"),children:L?jsxRuntime.jsx(Zc,{options:t,filter:E,multiple:b,selected:C,canAdd:re,animated:m,closing:V,onSelect:ue,onToggle:J,onAdd:B}):jsxRuntime.jsx(fs,{options:t,onSelect:ue,animated:m,closing:V})})]})}function rd(e,t){return e.key??(typeof e.label=="string"?e.label:String(t))}var In=40,nd=200,no=150,bs=120;function ro(e,t,r,n){if(!n)return {};if(r){let i=(t-1-e)*In;return {animation:`dropdown-item-out ${no}ms ease-in both ${i}ms`}}let a=e*In;return {animation:`dropdown-item-in ${nd}ms ease-out both ${a}ms`}}function ad(e,t,r){if(!r)return {};if(t){let n=Math.max(e-1,0)*In+no;return {animation:`dropdown-container-out ${bs}ms ease-in both ${n}ms`}}return {animation:"var(--animate-dropdown-container-in)"}}function hr({label:e,items:t,intent:r,size:n,align:a="left",className:i,disabled:o,editable:l=false,onAddItem:c,multiple:m=false,selected:d=[],onSelectionChange:f,animated:p=true,chevron:u=true,...h}){let[g,b]=qr.useState(false),[N,x]=qr.useState(false),[T,w]=qr.useState(""),C=qr.useRef(null),S=qr.useRef(null),R=qr.useRef(void 0);qr.useEffect(()=>()=>{R.current&&clearTimeout(R.current);},[]);let V=qr.useCallback(()=>{if(!p||!g){b(false),w("");return}x(true);let de=(Math.max(t.length,1)-1)*In+no+bs+20;R.current=setTimeout(()=>{b(false),x(false),w("");},de);},[p,g,t.length]),I=qr.useCallback(()=>{o||(g?V():(R.current&&clearTimeout(R.current),x(false),b(true),w(""),l&&requestAnimationFrame(()=>S.current?.focus())));},[o,g,V,l]);qr.useEffect(()=>{if(!g)return;let J=de=>{C.current&&!C.current.contains(de.target)&&V();};return document.addEventListener("mousedown",J),()=>document.removeEventListener("mousedown",J)},[g,V]),qr.useEffect(()=>{if(!g)return;let J=de=>{de.key==="Escape"&&V();};return document.addEventListener("keydown",J),()=>document.removeEventListener("keydown",J)},[g,V]);let E=T.toLowerCase(),v=qr.useMemo(()=>T?t.filter(J=>(typeof J.label=="string"?J.label:J.key??"").toLowerCase().includes(E)):t,[t,E]),U=qr.useMemo(()=>!l||!T.trim()?false:!t.some(J=>(typeof J.label=="string"?J.label:J.key??"").toLowerCase()===E),[l,E,t]),k=qr.useCallback(()=>{let J=T.trim();J&&(c?.(J),w(""));},[T,c]),q=qr.useCallback(J=>{J.key==="Enter"&&U&&(J.preventDefault(),k());},[U,k]),M=qr.useCallback(J=>{let de=d.includes(J)?d.filter(re=>re!==J):[...d,J];f?.(de);},[d,f]),W=m&&d.length>0?jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[e," ",jsxRuntime.jsx("span",{className:"ml-1 rounded-full bg-white/20 px-1.5 text-xs font-semibold",children:d.length})]}):e,$=v.length===0&&!U||U?1:0,ue=v.length+$;return jsxRuntime.jsxs("div",{ref:C,className:"relative inline-block",children:[jsxRuntime.jsxs("button",{type:"button",onClick:I,disabled:o,className:s(ur({intent:r,size:n}),"inline-flex items-center gap-1",i),"aria-haspopup":m?"listbox":"true","aria-expanded":g?"true":"false",...h,children:[W,u&&jsxRuntime.jsx(lucideReact.ChevronDown,{className:s("h-3.5 w-3.5 transition-transform",g&&"rotate-180")})]}),g&&jsxRuntime.jsxs("div",{className:s("absolute z-50 mt-1 min-w-44 rounded-md border py-1 shadow-lg","border-primary-200 dark:border-primary-700 dark:bg-primary-800 bg-white",a==="right"?"right-0":"left-0"),style:ad(ue,N,p),role:m?"listbox":"menu","aria-multiselectable":m||void 0,children:[l&&jsxRuntime.jsx("div",{className:"border-primary-200 dark:border-primary-700 border-b px-2 pb-1.5 pt-1",children:jsxRuntime.jsx("input",{ref:S,type:"text",value:T,onChange:J=>w(J.target.value),onKeyDown:q,placeholder:"Type to filter or add\u2026",className:"w-full bg-transparent text-sm text-secondary-900 placeholder:text-secondary-400 focus:outline-none dark:text-secondary-100 dark:placeholder:text-secondary-600"})}),jsxRuntime.jsxs("div",{className:"max-h-60 overflow-y-auto",children:[v.map((J,de)=>{let re=rd(J,de),B=m&&d.includes(re);return jsxRuntime.jsxs(qr__default.default.Fragment,{children:[J.divider&&jsxRuntime.jsx("div",{className:"border-primary-200 dark:border-primary-700 my-1 border-t"}),jsxRuntime.jsxs("button",{type:"button",role:m?"option":"menuitem","aria-selected":m?B:void 0,disabled:J.disabled,className:s("flex w-full cursor-pointer items-center gap-2 px-3 py-1.5 text-left text-sm transition-colors","text-primary-700 hover:bg-primary-100 dark:text-primary-300 dark:hover:bg-primary-700/50",J.disabled&&"pointer-events-none opacity-50"),style:ro(de,ue,N,p),onClick:()=>{m?M(re):(J.onClick?.(),R.current&&clearTimeout(R.current),b(false),x(false),w(""));},children:[m&&jsxRuntime.jsx("span",{className:s("flex h-4 w-4 shrink-0 items-center justify-center rounded border transition-colors",B?"border-primary-600 bg-primary-600 text-white dark:border-primary-500 dark:bg-primary-500":"border-secondary-300 bg-white dark:border-secondary-600 dark:bg-secondary-800"),children:B&&jsxRuntime.jsx(lucideReact.Check,{className:"h-3 w-3"})}),jsxRuntime.jsx("span",{className:"flex-1 truncate",children:J.label})]})]},re)}),v.length===0&&!U&&jsxRuntime.jsx("div",{className:"text-primary-400 px-3 py-2 text-center text-sm",style:ro(0,1,N,p),children:"No matches"}),U&&jsxRuntime.jsxs("button",{type:"button",className:s("flex w-full cursor-pointer items-center gap-2 px-3 py-1.5 text-left text-sm transition-colors","text-primary-600 hover:bg-primary-50 dark:text-primary-400 dark:hover:bg-primary-900/30"),style:ro(v.length,ue,N,p),onClick:k,children:[jsxRuntime.jsx("span",{className:"flex h-4 w-4 shrink-0 items-center justify-center text-lg leading-none",children:"+"}),jsxRuntime.jsxs("span",{className:"truncate",children:["Add \u201C",T.trim(),"\u201D"]})]})]})]})]})}function ao({intent:e,size:t,className:r,...n}){return jsxRuntime.jsx("span",{className:s(Nn({intent:e,size:t}),r),...n})}function oo({intent:e,size:t,variant:r,icon:n,removable:a,onRemove:i,disabled:o,dot:l,className:c,children:m,...d}){return jsxRuntime.jsxs("span",{className:s(Pn({intent:e,size:t,variant:r}),o&&"pointer-events-none opacity-50",c),"aria-disabled":o,...d,children:[l&&jsxRuntime.jsx("span",{className:s("inline-block h-1.5 w-1.5 shrink-0 rounded-full",e==="success"&&"bg-success-500",e==="danger"&&"bg-danger-500",e==="warning"&&"bg-warning-500",(!e||e==="primary")&&"bg-primary-500",e==="secondary"&&"bg-secondary-500",e==="info"&&"bg-blue-500")}),n&&jsxRuntime.jsx("span",{className:"shrink-0 [&_svg]:h-[1em] [&_svg]:w-[1em]",children:n}),m&&jsxRuntime.jsx("span",{children:m}),a&&jsxRuntime.jsx("button",{type:"button","aria-label":"Remove tag",onClick:f=>{f.stopPropagation(),i?.();},disabled:o,className:s("ml-0.5 -mr-0.5 inline-flex items-center justify-center rounded-full p-0.5 transition-colors hover:bg-black/10 dark:hover:bg-white/20 focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-current"),children:jsxRuntime.jsx(lucideReact.X,{className:"h-[0.75em] w-[0.75em]"})})]})}var cd={danger:"bg-danger-500",success:"bg-success-500",warning:"bg-warning-500",info:"bg-primary-500",primary:"bg-secondary-500"};function io({children:e,show:t=true,content:r,dot:n,intent:a="danger",size:i="md",placement:o="top-right",pulse:l=false,className:c}){let m=n??r==null,d=m?null:typeof r=="number"?r>99?"99+":String(r):r;return jsxRuntime.jsxs("div",{className:"relative inline-flex",children:[e,t&&jsxRuntime.jsxs("span",{className:s(Cn({intent:a,size:i,dot:m,placement:o}),c),role:typeof r=="number"?"status":void 0,"aria-label":typeof r=="number"?String(r):void 0,children:[l&&jsxRuntime.jsx("span",{className:s("absolute inset-0 rounded-full animate-ping opacity-60",cd[a??"danger"]),"aria-hidden":"true"}),d]})]})}function so({intent:e,size:t,className:r,...n}){return jsxRuntime.jsx("label",{className:s(Tn({intent:e,size:t}),r),...n})}var pd={sm:{wrapper:"h-7 text-xs",prefix:"px-2 text-xs [&_svg]:h-3 [&_svg]:w-3",input:"px-2 text-xs",icon:"px-1.5 [&_svg]:h-3 [&_svg]:w-3"},md:{wrapper:"h-9 text-sm",prefix:"px-3 text-sm [&_svg]:h-4 [&_svg]:w-4",input:"px-3 py-2 text-sm",icon:"px-2 [&_svg]:h-4 [&_svg]:w-4"},lg:{wrapper:"h-11 text-base",prefix:"px-4 text-base [&_svg]:h-5 [&_svg]:w-5",input:"px-4 py-2.5 text-base",icon:"px-2.5 [&_svg]:h-5 [&_svg]:w-5"}},ud={default:"border-secondary-300 focus-within:border-primary-500 focus-within:ring-2 focus-within:ring-primary-500/20 dark:border-secondary-600",error:"border-danger-400 focus-within:border-danger-500 focus-within:ring-2 focus-within:ring-danger-500/20"};function lo({state:e="default",inputSize:t="md",className:r,prefix:n,suffix:a,action:i,...o}){if(!n&&!a&&!i)return jsxRuntime.jsx("input",{className:s(fr({state:e,size:t}),r),...o});let l=pd[t??"md"],c=ud[e??"default"];return jsxRuntime.jsxs("div",{className:s("flex w-full items-center overflow-hidden rounded-md border bg-white transition-colors dark:bg-secondary-900",l.wrapper,c,r),children:[n&&jsxRuntime.jsx("span",{className:s("flex shrink-0 items-center gap-1.5 self-stretch border-r border-secondary-300 bg-secondary-50 font-medium text-secondary-600 dark:border-secondary-600 dark:bg-secondary-800 dark:text-secondary-300",l.prefix),children:n}),jsxRuntime.jsx("input",{className:s("min-w-0 flex-1 bg-transparent text-secondary-900 placeholder:text-secondary-400 focus:outline-none dark:text-secondary-100 dark:placeholder:text-secondary-600",l.input,n&&"pl-2"),...o}),a&&jsxRuntime.jsx("span",{className:s("flex shrink-0 items-center text-secondary-400 dark:text-secondary-500",l.icon),children:a}),i&&jsxRuntime.jsx("button",{type:"button",onClick:i.onClick,"aria-label":i["aria-label"]??"Action",className:s("flex shrink-0 items-center text-secondary-500 transition-colors hover:text-primary-600 dark:text-secondary-400 dark:hover:text-primary-400",l.icon),children:i.icon})]})}var yd={sm:"px-2 py-1.5 text-xs min-h-[60px]",md:"px-3 py-2 text-sm min-h-[80px]",lg:"px-4 py-2.5 text-base min-h-[100px]"},xd={default:"border-secondary-400 focus:border-primary-500 focus:ring-2 focus:ring-primary-500/20 dark:border-secondary-600",error:"border-danger-400 focus:border-danger-500 focus:ring-2 focus:ring-danger-500/20"};function vd(e){if(!e)return 0;let t="\u2E80-\u2EFF\u3000-\u303F\u3040-\u309F\u30A0-\u30FF\u3400-\u4DBF\u4E00-\u9FFF\uAC00-\uD7AF\uF900-\uFAFF\uFE30-\uFE4F\uFF00-\uFFEF",r=new RegExp(`[${t}]`),n=0,a="",i=()=>{let o=a.trim();o&&(n+=o.split(/\s+/).length),a="";};for(let o of e)r.test(o)?(i(),n+=1):a+=o;return i(),n}function co({state:e="default",size:t="md",showWordCount:r=false,maxWords:n,className:a,value:i,defaultValue:o,onChange:l,disabled:c,...m}){let[d,f]=qr.useState(()=>o??""),p=i!==void 0?String(i):d,u=qr.useCallback(b=>{i===void 0&&f(b.target.value),l?.(b);},[i,l]),h=qr.useMemo(()=>vd(p),[p]),g=n!=null&&h>n;return jsxRuntime.jsxs("div",{className:s("inline-flex w-full flex-col",a),children:[jsxRuntime.jsx("textarea",{value:p,onChange:u,disabled:c,className:s("w-full resize-y rounded-md border bg-white text-secondary-900 transition-colors placeholder:text-secondary-400 focus:outline-none dark:bg-secondary-900 dark:text-secondary-100 dark:placeholder:text-secondary-600",yd[t],xd[g?"error":e],c&&"pointer-events-none opacity-50"),...m}),(r||n!=null)&&jsxRuntime.jsx("span",{className:s("mt-1 self-end text-xs",g?"text-danger-500 dark:text-danger-400":"text-secondary-400 dark:text-secondary-500"),children:n!=null?`${h} / ${n} words`:`${h} words`})]})}var Td={sm:{trackFixed:"h-5 w-9",trackH:"h-5 min-w-9",thumb:"h-3.5 w-3.5",thumbTop:"top-[3px]",thumbOff:"left-[2px]",thumbOn:"left-[calc(100%-16px)]",pad:"pl-[6px] pr-[18px]",contentLeft:"left-[6px]",contentRight:"right-[6px]",icon:"text-[10px] [&_svg]:h-3 [&_svg]:w-3"},md:{trackFixed:"h-6 w-11",trackH:"h-6 min-w-11",thumb:"h-4.5 w-4.5",thumbTop:"top-[3px]",thumbOff:"left-[2px]",thumbOn:"left-[calc(100%-20px)]",pad:"pl-[7px] pr-[23px]",contentLeft:"left-[7px]",contentRight:"right-[7px]",icon:"text-xs [&_svg]:h-3.5 [&_svg]:w-3.5"},lg:{trackFixed:"h-7 w-14",trackH:"h-7 min-w-14",thumb:"h-5.5 w-5.5",thumbTop:"top-[3px]",thumbOff:"left-[3px]",thumbOn:"left-[calc(100%-25px)]",pad:"pl-[8px] pr-[28px]",contentLeft:"left-[8px]",contentRight:"right-[8px]",icon:"text-sm [&_svg]:h-4 [&_svg]:w-4"}},Md={primary:"text-primary-100",secondary:"text-secondary-100",danger:"text-danger-100",warning:"text-warning-100",success:"text-success-100"};function mo({checked:e,defaultChecked:t=false,onCheckedChange:r,checkedContent:n,uncheckedContent:a,intent:i,size:o,label:l,id:c,className:m,disabled:d,...f}){let p=qr.useId(),u=c??p,h=o??"md",g=i??"primary",b=Td[h],N=n!=null||a!=null,[x,T]=qr.useState(t),w=e??x,C=qr.useCallback(S=>{let R=S.target.checked;e===void 0&&T(R),r?.(R);},[e,r]);return jsxRuntime.jsxs("label",{htmlFor:u,className:s("inline-flex cursor-pointer items-center gap-2",d&&"pointer-events-none opacity-50",m),children:[jsxRuntime.jsx("input",{...f,id:u,type:"checkbox",role:"switch",className:"sr-only",checked:w,disabled:d,onChange:C,"aria-checked":w}),jsxRuntime.jsxs("span",{className:s("relative inline-flex shrink-0 items-center rounded-full transition-colors duration-200",N?b.trackH:b.trackFixed,Sn({intent:i,size:o,checked:w?"on":"off"})),children:[N?jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsxs("span",{className:s("pointer-events-none invisible inline-grid",b.icon),children:[jsxRuntime.jsx("span",{className:s("[grid-area:1/1] whitespace-nowrap",b.pad),children:n}),jsxRuntime.jsx("span",{className:s("[grid-area:1/1] whitespace-nowrap",b.pad),children:a})]}),jsxRuntime.jsx("span",{className:s("absolute top-1/2 -translate-y-1/2 whitespace-nowrap font-medium leading-none transition-opacity duration-200",b.contentLeft,b.icon,Md[g],w?"opacity-100":"opacity-0"),children:n}),jsxRuntime.jsx("span",{className:s("absolute top-1/2 -translate-y-1/2 whitespace-nowrap font-medium leading-none transition-opacity duration-200",b.contentRight,b.icon,"text-primary-400 dark:text-primary-500",w?"opacity-0":"opacity-100"),children:a})]}):null,jsxRuntime.jsx("span",{className:s("pointer-events-none absolute rounded-full bg-white shadow-sm transition-[left] duration-200 ease-in-out",b.thumb,b.thumbTop,w?b.thumbOn:b.thumbOff)})]}),l&&jsxRuntime.jsx("span",{className:"select-none text-sm text-primary-700 dark:text-primary-300",children:l})]})}var Ld={sm:"h-3 w-3",md:"h-3.5 w-3.5",lg:"h-4 w-4"};function po({checked:e,defaultChecked:t=false,indeterminate:r=false,onCheckedChange:n,intent:a,size:i,label:o,id:l,className:c,disabled:m,...d}){let f=qr.useId(),p=l??f,u=i??"md",[h,g]=qr.useState(t),b=e??h,N=qr.useCallback(T=>{let w=T.target.checked;e===void 0&&g(w),n?.(w);},[e,n]),x=b||r;return jsxRuntime.jsxs("label",{htmlFor:p,className:s("inline-flex cursor-pointer items-center gap-2 select-none",m&&"pointer-events-none opacity-50",c),children:[jsxRuntime.jsx("input",{...d,id:p,type:"checkbox",className:"sr-only",checked:b,disabled:m,onChange:N}),jsxRuntime.jsx("span",{className:s(Mn({intent:a,size:i,checked:x?"on":"off"})),children:jsxRuntime.jsx("svg",{viewBox:"0 0 16 16",fill:"none",className:s("text-white transition-all duration-200",Ld[u],x?"scale-100 opacity-100":"scale-0 opacity-0"),children:r?jsxRuntime.jsx("line",{x1:"3",y1:"8",x2:"13",y2:"8",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round"}):jsxRuntime.jsx("path",{d:"M3.5 8.5L6.5 11.5L12.5 4.5",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})}),o&&jsxRuntime.jsx("span",{className:"text-sm text-primary-700 dark:text-primary-300",children:o})]})}var ws=qr.createContext(null);function uo({name:e,value:t,defaultValue:r,onValueChange:n,intent:a,size:i,disabled:o,orientation:l="vertical",className:c,children:m}){let d=qr.useId(),f=e??d,[p,u]=qr.useState(r),h=t??p,g=qr.useCallback(b=>{t===void 0&&u(b),n?.(b);},[t,n]);return jsxRuntime.jsx(ws.Provider,{value:{name:f,value:h,onChange:g,intent:a,size:i,disabled:o},children:jsxRuntime.jsx("div",{role:"radiogroup",className:s("flex gap-2",l==="vertical"?"flex-col":"flex-row flex-wrap",c),children:m})})}var Hd={sm:"h-1.5 w-1.5",md:"h-2 w-2",lg:"h-2.5 w-2.5"};function fo({value:e,intent:t,size:r,label:n,id:a,className:i,disabled:o,...l}){let c=qr.useId(),m=a??c,d=qr.useContext(ws),f=t??d?.intent,p=r??d?.size,u=p??"md",h=o??d?.disabled,g=l.name??d?.name,b=d?d.value===e:void 0,N=qr.useCallback(x=>{x.target.checked&&d?.onChange(e);},[d,e]);return jsxRuntime.jsxs("label",{htmlFor:m,className:s("inline-flex cursor-pointer items-center gap-2 select-none",h&&"pointer-events-none opacity-50",i),children:[jsxRuntime.jsx("input",{...l,id:m,type:"radio",name:g,value:e,className:"sr-only",checked:b,disabled:h,onChange:N}),jsxRuntime.jsx("span",{className:s(Rn({intent:f,size:p,checked:b?"on":"off"})),children:jsxRuntime.jsx("span",{className:s("rounded-full bg-white transition-all duration-200",Hd[u],b?"scale-100 opacity-100":"scale-0 opacity-0")})}),n&&jsxRuntime.jsx("span",{className:"text-sm text-primary-700 dark:text-primary-300",children:n})]})}function Bd(e,t){if(t)return t.slice(0,2).toUpperCase();if(!e)return "?";let r=e.trim().split(/\s+/);return r.length>=2?(r[0][0]+r[r.length-1][0]).toUpperCase():e.slice(0,2).toUpperCase()}var Od={online:"ring-2 ring-success-500",offline:"ring-2 ring-secondary-400",busy:"ring-2 ring-danger-500",away:"ring-2 ring-warning-500"};function Fn({src:e,alt:t,initials:r,size:n,shape:a,status:i,className:o,...l}){let[c,m]=qr.useState(false),d=e&&!c,f=Bd(t,r);return jsxRuntime.jsx("span",{role:"img","aria-label":t??f,className:s(Br({size:n,shape:a}),i&&Od[i],"relative inline-flex shrink-0 select-none items-center justify-center overflow-hidden",o),...l,children:d?jsxRuntime.jsx("img",{src:e,alt:t,className:"h-full w-full object-cover",onError:()=>m(true),draggable:false}):jsxRuntime.jsx("span",{className:"font-semibold leading-none tracking-wide",children:f})})}function _n({children:e,max:t=4,overlap:r="left",className:n}){let a=qr__default.default.Children.toArray(e),i=a.slice(0,t),o=a.length-t;return jsxRuntime.jsxs("span",{className:s("inline-flex items-center",r==="left"?"-space-x-3":"flex-row-reverse -space-x-3",n),children:[i.map((c,m)=>jsxRuntime.jsx("span",{className:"ring-2 ring-white dark:ring-primary-900 rounded-full",children:c},m)),o>0&&jsxRuntime.jsxs("span",{"aria-label":`${o} more`,className:s(Br({size:"md",shape:"circular"}),"relative inline-flex shrink-0 select-none items-center justify-center","ring-2 ring-white dark:ring-primary-900","bg-secondary-200 text-secondary-700 dark:bg-secondary-700 dark:text-secondary-200 font-semibold text-xs"),children:["+",o]})]})}function Vt(e,t,r){return Math.min(Math.max(e,t),r)}function Yd(e,t,r){return Math.round((e-t)/r)*r+t}function go(e,t,r){return (e-t)/(r-t)*100}function Ns(e,t,r,n){let a=t+e/100*(r-t);return Yd(a,t,n)}function Ts(e,t,r,n,a,i){let o=qr.useRef(false),l=qr.useCallback(f=>{let p=e.current;if(!p)return 0;let u=p.getBoundingClientRect(),g=(("touches"in f?f.touches[0].clientX:f.clientX)-u.left)/u.width*100;return Vt(g,0,100)},[e]),c=qr.useCallback(f=>{if(a)return;f.currentTarget.setPointerCapture(f.pointerId),o.current=true;let p=e.current;if(!p)return;let u=p.getBoundingClientRect(),h=(f.clientX-u.left)/u.width*100;i?.(Ns(Vt(h,0,100),t,r,n));},[a,l,t,r,n,i,e]),m=qr.useCallback(f=>{if(!o.current||a)return;let p=e.current;if(!p)return;let u=p.getBoundingClientRect(),h=(f.clientX-u.left)/u.width*100;i?.(Ns(Vt(h,0,100),t,r,n));},[a,t,r,n,i,e]),d=qr.useCallback(()=>{o.current=false;},[]);return {startDrag:c,onPointerMove:m,stopDrag:d}}function Bn({mode:e,value:t,defaultValue:r=0,onChange:n,min:a=0,max:i=100,step:o=1,intent:l,size:c,disabled:m,showValue:d=false,formatValue:f=String,label:p,className:u,id:h,...g}){let[b,N]=qr.useState(r),x=t!==void 0,T=x?t:b,w=qr.useId(),C=h??w,S=qr.useRef(null),R=qr.useCallback(k=>{let q=Vt(k,a,i);x||N(q),n?.(q);},[x,a,i,n]),{startDrag:V,onPointerMove:I,stopDrag:E}=Ts(S,a,i,o,m,R),v=go(T,a,i),U=k=>{let q=k.key==="ArrowRight"||k.key==="ArrowUp"?o:k.key==="ArrowLeft"||k.key==="ArrowDown"?-o:k.key==="Home"?-(T-a):k.key==="End"?i-T:0;q!==0&&(k.preventDefault(),R(T+q));};return jsxRuntime.jsxs("div",{className:s("slider-root flex flex-col gap-1",u),children:[jsxRuntime.jsx("input",{type:"range",id:C,className:"sr-only",tabIndex:-1,min:a,max:i,step:o,value:T,disabled:m,readOnly:true,onChange:()=>{}}),(p||d)&&jsxRuntime.jsxs("div",{className:"flex items-center justify-between",children:[p&&jsxRuntime.jsx("label",{htmlFor:C,className:"text-sm font-medium text-primary-700 dark:text-primary-300",children:p}),d&&jsxRuntime.jsx("span",{className:"text-sm font-semibold text-primary-600 dark:text-primary-400",children:f(T)})]}),jsxRuntime.jsx("div",{...g,ref:S,className:s(Or({intent:l,size:c}),m&&"opacity-40 cursor-not-allowed"),onPointerDown:V,onPointerMove:I,onPointerUp:E,onPointerCancel:E,style:{touchAction:"none"},children:jsxRuntime.jsxs("div",{className:"relative h-1.5 w-full grow rounded-full bg-primary-200 dark:bg-primary-700",children:[jsxRuntime.jsx("div",{className:"slider-fill absolute left-0 top-0 h-full rounded-full transition-none",style:{width:`${v}%`}}),jsxRuntime.jsx("div",{role:"slider",tabIndex:m?-1:0,"aria-valuemin":a,"aria-valuemax":i,"aria-valuenow":T,"aria-disabled":m,onKeyDown:U,className:s("slider-thumb absolute top-1/2 -translate-x-1/2 -translate-y-1/2","h-4 w-4 rounded-full border-2 bg-white shadow-md","transition-transform focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary-500/40 focus-visible:scale-110",!m&&"cursor-grab active:cursor-grabbing active:scale-110"),style:{left:`${v}%`}})]})})]})}function On({value:e,defaultValue:t=[20,80],onChange:r,min:n=0,max:a=100,step:i=1,intent:o,size:l,disabled:c,showValue:m=false,formatValue:d=String,label:f,className:p,id:u,...h}){let[g,b]=qr.useState(t),N=e!==void 0,[x,T]=N?e:g,w=qr.useRef(null),C=qr.useRef("lo"),S=qr.useCallback(M=>{N||b(M),r?.(M);},[N,r]),R=qr.useCallback(M=>{C.current==="lo"?S([Vt(M,n,T),T]):S([x,Vt(M,x,a)]);},[x,T,n,a,S]),{startDrag:V,onPointerMove:I,stopDrag:E}=Ts(w,n,a,i,c,R),v=go(x,n,a),U=go(T,n,a),k=M=>W=>{C.current=M,V(W);},q=M=>W=>{let ue=W.key==="ArrowRight"||W.key==="ArrowUp"?i:W.key==="ArrowLeft"||W.key==="ArrowDown"?-i:0;ue!==0&&(W.preventDefault(),S(M==="lo"?[Vt(x+ue,n,T),T]:[x,Vt(T+ue,x,a)]));};return jsxRuntime.jsxs("div",{className:s("slider-root flex flex-col gap-1",p),children:[u&&jsxRuntime.jsx("input",{type:"range",id:u,className:"sr-only",tabIndex:-1,min:n,max:a,step:i,value:x,disabled:c,readOnly:true,onChange:()=>{}}),(f||m)&&jsxRuntime.jsxs("div",{className:"flex items-center justify-between",children:[f&&jsxRuntime.jsx("span",{className:"text-sm font-medium text-primary-700 dark:text-primary-300",children:f}),m&&jsxRuntime.jsxs("span",{className:"text-sm font-semibold text-primary-600 dark:text-primary-400",children:[d(x)," \u2013 ",d(T)]})]}),jsxRuntime.jsx("div",{...h,ref:w,className:s(Or({intent:o,size:l}),c&&"opacity-40 cursor-not-allowed"),onPointerMove:I,onPointerUp:E,onPointerCancel:E,style:{touchAction:"none"},children:jsxRuntime.jsxs("div",{className:"relative h-1.5 w-full rounded-full bg-primary-200 dark:bg-primary-700",children:[jsxRuntime.jsx("div",{className:"slider-fill absolute top-0 h-full rounded-full",style:{left:`${v}%`,width:`${U-v}%`}}),jsxRuntime.jsx("div",{role:"slider",tabIndex:c?-1:0,"aria-valuemin":n,"aria-valuemax":T,"aria-valuenow":x,"aria-label":"Range start","aria-disabled":c,onPointerDown:k("lo"),onKeyDown:q("lo"),className:s("slider-thumb absolute top-1/2 -translate-x-1/2 -translate-y-1/2","h-4 w-4 rounded-full border-2 bg-white shadow-md","transition-transform focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary-500/40 focus-visible:scale-110",!c&&"cursor-grab active:cursor-grabbing active:scale-110"),style:{left:`${v}%`,zIndex:x>T-i?3:2}}),jsxRuntime.jsx("div",{role:"slider",tabIndex:c?-1:0,"aria-valuemin":x,"aria-valuemax":a,"aria-valuenow":T,"aria-label":"Range end","aria-disabled":c,onPointerDown:k("hi"),onKeyDown:q("hi"),className:s("slider-thumb absolute top-1/2 -translate-x-1/2 -translate-y-1/2","h-4 w-4 rounded-full border-2 bg-white shadow-md","transition-transform focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary-500/40 focus-visible:scale-110",!c&&"cursor-grab active:cursor-grabbing active:scale-110"),style:{left:`${U}%`,zIndex:2}})]})})]})}var Kd={Button:gr,Dropdown:Za,DropdownButton:hr,Badge:ao,Tag:oo,Indicator:io,Label:so,Input:lo,TextBox:co,Switch:mo,Checkbox:po,Radio:fo,RadioGroup:uo,Avatar:Fn,AvatarGroup:_n,Slider:Bn,SliderRange:On},bo=Kd;var Xr=classVarianceAuthority.cva("rounded-lg transition-shadow",{variants:{intent:{default:"border border-primary-200 bg-white dark:border-primary-700 dark:bg-primary-900",elevated:"bg-white shadow-md hover:shadow-lg dark:bg-primary-800 dark:shadow-primary-300/25 dark:hover:shadow-primary-200/30",outlined:"border-2 border-primary-300 bg-transparent dark:border-primary-600",ghost:"bg-primary-50 dark:bg-primary-800/50"},size:{sm:"p-3",md:"p-5",lg:"p-7"}},defaultVariants:{intent:"default",size:"md"}}),$n=classVarianceAuthority.cva("rounded-md",{variants:{intent:{default:"border border-primary-200 bg-white dark:border-primary-700 dark:bg-primary-900",inset:"bg-primary-50 dark:bg-primary-800/50",elevated:"bg-white shadow-lg dark:bg-primary-800 dark:shadow-primary-300/25"},size:{sm:"p-3",md:"p-4",lg:"p-6"}},defaultVariants:{intent:"default",size:"md"}});function ho({intent:e,size:t,className:r,...n}){return jsxRuntime.jsx("div",{className:s(Xr({intent:e,size:t}),r),...n})}function Xd({className:e,...t}){return jsxRuntime.jsx("div",{className:s("mb-4 space-y-1",e),...t})}function Wd({className:e,...t}){return jsxRuntime.jsx("h3",{className:s("text-primary-900 dark:text-primary-100 text-lg font-semibold",e),...t})}function jd({className:e,...t}){return jsxRuntime.jsx("p",{className:s("text-primary-500 dark:text-primary-400 text-sm",e),...t})}function Gd({className:e,...t}){return jsxRuntime.jsx("div",{className:s("text-primary-700 dark:text-primary-300 text-sm",e),...t})}function Ud({className:e,...t}){return jsxRuntime.jsx("div",{className:s("border-primary-100 dark:border-primary-800 mt-4 flex items-center gap-2 border-t pt-4",e),...t})}function qd({intent:e,media:t,mediaPosition:r="left",stackOnMobile:n=false,className:a,children:i,...o}){let l=jsxRuntime.jsx("div",{className:s("relative shrink-0 overflow-hidden",n?"h-48 w-full rounded-t-lg sm:h-auto sm:w-auto":"",!n&&(r==="left"?"rounded-l-lg":"rounded-r-lg")),style:n?void 0:{width:t.width??"10rem"},children:t.src?jsxRuntime.jsx("img",{src:t.src,alt:t.alt??"",className:"h-full w-full object-cover",draggable:false}):t.icon?jsxRuntime.jsx("div",{className:"bg-primary-100 text-primary-500 dark:bg-primary-800 dark:text-primary-400 flex h-full w-full items-center justify-center",children:t.icon}):null});return jsxRuntime.jsxs("div",{className:s(Xr({intent:e}),"flex overflow-hidden p-0",n?"flex-col sm:flex-row":"",!n&&r==="right"&&"flex-row-reverse",!n&&r==="left"&&"flex-row",a),...o,children:[l,jsxRuntime.jsx("div",{className:"flex min-w-0 flex-1 flex-col p-4",children:i})]})}function yo({src:e,alt:t="",aspectRatio:r="16/9",className:n,children:a,...i}){return jsxRuntime.jsxs("div",{className:s("group overflow-hidden rounded-xl border transition-shadow duration-300","border-primary-200 dark:border-primary-700 dark:bg-primary-900 bg-white","dark:hover:shadow-primary-900/60 hover:shadow-lg",n),...i,children:[jsxRuntime.jsxs("div",{className:"relative overflow-hidden",style:{aspectRatio:r},children:[jsxRuntime.jsx("img",{src:e,alt:t,className:"h-full w-full object-cover transition-transform duration-500 ease-out group-hover:scale-110",draggable:false}),jsxRuntime.jsx("div",{className:"pointer-events-none absolute inset-0 opacity-0 transition-opacity duration-300 group-hover:opacity-100","aria-hidden":true,children:jsxRuntime.jsx("div",{className:"animate-light-sweep absolute inset-0"})})]}),a]})}function Zd({className:e,...t}){return jsxRuntime.jsx("div",{className:s("space-y-2 p-4",e),...t})}function Jd({className:e,...t}){return jsxRuntime.jsx("h3",{className:s("text-primary-900 dark:text-primary-100 text-base font-semibold",e),...t})}function em({className:e,...t}){return jsxRuntime.jsx("p",{className:s("text-primary-500 dark:text-primary-400 text-sm",e),...t})}function tm({className:e,...t}){return jsxRuntime.jsx("div",{className:s("border-primary-100 dark:border-primary-800 flex items-center gap-2 border-t px-4 py-3",e),...t})}function xo({intent:e,size:t,className:r,...n}){return jsxRuntime.jsx("div",{className:s($n({intent:e,size:t}),r),...n})}function rm({className:e,...t}){return jsxRuntime.jsx("div",{className:s("border-primary-200 text-primary-900 dark:border-primary-700 dark:text-primary-100 mb-3 flex items-center gap-1.5 border-b pb-3 text-sm font-semibold [&_svg]:h-4 [&_svg]:w-4 [&_svg]:shrink-0",e),...t})}function nm({className:e,...t}){return jsxRuntime.jsx("div",{className:s("text-primary-700 dark:text-primary-300 text-sm",e),...t})}var am={Card:ho,ImageCard:yo,Panel:xo},wo=am;var Yn=classVarianceAuthority.cva("w-full text-left text-sm",{variants:{intent:{default:"",striped:"[&_tbody_tr:nth-child(even)]:bg-primary-50 dark:[&_tbody_tr:nth-child(even)]:bg-primary-800/30",bordered:"[&_th]:border [&_td]:border [&_th]:border-primary-200 [&_td]:border-primary-200 dark:[&_th]:border-primary-700 dark:[&_td]:border-primary-700"},density:{compact:"[&_th]:px-2 [&_th]:py-1 [&_td]:px-2 [&_td]:py-1",default:"",relaxed:"[&_th]:px-6 [&_th]:py-5 [&_td]:px-6 [&_td]:py-5"}},defaultVariants:{intent:"default",density:"default"}}),Kn=classVarianceAuthority.cva("text-sm text-primary-700 dark:text-primary-300",{variants:{intent:{default:"space-y-1",bordered:"divide-y divide-primary-200 rounded-lg border border-primary-200 dark:divide-primary-700 dark:border-primary-700 [&>li]:px-4 [&>li]:py-2",hover:"[&>li]:rounded-md [&>li]:px-3 [&>li]:py-2 [&>li]:transition-colors [&>li:hover]:bg-primary-50 dark:[&>li:hover]:bg-primary-800/50"}},defaultVariants:{intent:"default"}}),Xn=classVarianceAuthority.cva("group flex w-full items-center gap-1.5 text-left [&_svg]:shrink-0",{variants:{size:{sm:"py-0.5 text-xs [&_svg]:h-3 [&_svg]:w-3",md:"py-1.5 text-sm [&_svg]:h-3.5 [&_svg]:w-3.5",lg:"py-2 text-base [&_svg]:h-4 [&_svg]:w-4"}},defaultVariants:{size:"md"}}),Wn=classVarianceAuthority.cva("flex cursor-pointer items-center gap-1 rounded transition-colors [&_svg]:shrink-0",{variants:{size:{sm:"py-0.5 text-xs [&_svg]:h-3.5 [&_svg]:w-3.5",md:"py-1 text-sm [&_svg]:h-4 [&_svg]:w-4",lg:"py-1.5 text-base [&_svg]:h-5 [&_svg]:w-5"}},defaultVariants:{size:"md"}}),jn=classVarianceAuthority.cva("relative rounded-xl border bg-white p-5 shadow-sm transition-shadow hover:shadow-md dark:bg-primary-900",{variants:{intent:{primary:"border-primary-200 dark:border-primary-700",success:"border-success-200 dark:border-success-800",danger:"border-danger-200 dark:border-danger-800",warning:"border-warning-200 dark:border-warning-800"},size:{sm:"p-4",md:"p-5",lg:"p-6"}},defaultVariants:{intent:"primary",size:"md"}}),Gn=classVarianceAuthority.cva("relative overflow-hidden rounded-xl border bg-white p-5 shadow-sm transition-all duration-300 hover:shadow-lg dark:bg-primary-900",{variants:{intent:{primary:"border-primary-200 dark:border-primary-700",success:"border-success-200 dark:border-success-800",danger:"border-danger-200 dark:border-danger-800",warning:"border-warning-200 dark:border-warning-800"},size:{sm:"p-4",md:"p-5",lg:"p-6"}},defaultVariants:{intent:"primary",size:"md"}}),Wr=classVarianceAuthority.cva("overflow-x-auto rounded-lg font-mono [background:var(--color-syntax-bg)] [&_pre]:m-0 [&_pre]:p-4 [&_code]:bg-transparent",{variants:{size:{sm:"text-xs",md:"text-sm",lg:"text-base"}},defaultVariants:{size:"md"}});function Ur({intent:e,density:t,className:r,...n}){return jsxRuntime.jsx("div",{className:"w-full overflow-auto",children:jsxRuntime.jsx("table",{className:s(Yn({intent:e,density:t}),r),...n})})}function No({className:e,...t}){return jsxRuntime.jsx("thead",{className:s("bg-primary-50 text-primary-600 dark:bg-primary-800/50 dark:text-primary-400",e),...t})}function Co({className:e,...t}){return jsxRuntime.jsx("tbody",{className:s("[&_tr:last-child]:border-0",e),...t})}function Gr({className:e,...t}){return jsxRuntime.jsx("tr",{className:s("border-primary-200 hover:bg-primary-50/50 dark:border-primary-700 dark:hover:bg-primary-800/30 border-b transition-colors",e),...t})}function rr({className:e,...t}){return jsxRuntime.jsx("th",{className:s("px-4 py-3 text-left text-xs font-semibold tracking-wider uppercase",e),...t})}function nr({className:e,...t}){return jsxRuntime.jsx("td",{className:s("text-primary-700 dark:text-primary-300 px-4 py-3",e),...t})}function To({icon:e,text:t="No data",className:r}){return jsxRuntime.jsxs("div",{className:s("flex flex-col items-center justify-center gap-3 py-16 text-primary-400 dark:text-primary-500",r),children:[e??jsxRuntime.jsx(lucideReact.Inbox,{className:"h-12 w-12 stroke-[1.2]"}),jsxRuntime.jsx("span",{className:"text-sm",children:t})]})}var Ss={sm:"hidden sm:table-cell",md:"hidden md:table-cell",lg:"hidden lg:table-cell"};function bm({columns:e,data:t,sort:r,onSortChange:n,defaultSort:a=null,rowKey:i,rowActions:o,intent:l,density:c,className:m,empty:d}){let[f,p]=qr.useState(a),u=r??f,h=qr.useCallback(b=>{let N=u?.column===b?u.direction==="asc"?{column:b,direction:"desc"}:null:{column:b,direction:"asc"};n?n(N):p(N);},[u,n]),g=qr.useMemo(()=>{if(!u)return t;let b=e.find(T=>T.key===u.column);if(!b)return t;let N=b.compareFn??((T,w)=>{let C=b.cell(T),S=b.cell(w);return C==null&&S==null?0:C==null?-1:S==null?1:typeof C=="number"&&typeof S=="number"?C-S:String(C).localeCompare(String(S))}),x=[...t].sort(N);return u.direction==="desc"?x.reverse():x},[t,u,e]);return jsxRuntime.jsxs(Ur,{intent:l,density:c,className:m,children:[jsxRuntime.jsx(No,{children:jsxRuntime.jsxs(Gr,{children:[e.map(b=>{let N=b.sortable!==false,x=u?.column===b.key;return jsxRuntime.jsx(rr,{className:s(N&&"cursor-pointer select-none",b.headerClassName,b.hideBelow&&Ss[b.hideBelow]),onClick:N?()=>h(b.key):void 0,"aria-sort":x?u.direction==="asc"?"ascending":"descending":void 0,children:jsxRuntime.jsxs("span",{className:"inline-flex items-center gap-1",children:[b.header,N&&jsxRuntime.jsx(Ps,{active:x,direction:x?u.direction:null})]})},b.key)}),o&&jsxRuntime.jsx(rr,{className:"w-20 text-right",children:"Actions"})]})}),jsxRuntime.jsx(Co,{children:g.length===0?jsxRuntime.jsx("tr",{children:jsxRuntime.jsx("td",{colSpan:e.length+(o?1:0),children:jsxRuntime.jsx(To,{...d})})}):g.map((b,N)=>jsxRuntime.jsxs(Gr,{children:[e.map(x=>jsxRuntime.jsx(nr,{className:s(x.cellClassName,x.hideBelow&&Ss[x.hideBelow]),children:x.cell(b)},x.key)),o&&jsxRuntime.jsx(nr,{className:"text-right",children:jsxRuntime.jsx("span",{className:"inline-flex items-center gap-1",children:o(b)})})]},i?i(b,N):N))})]})}function hm({value:e,onCommit:t,onCancel:r}){let[n,a]=qr.useState(e),i=qr.useRef(null);qr.useEffect(()=>{i.current?.focus(),i.current?.select();},[]);let o=()=>t(n);return jsxRuntime.jsxs("span",{className:"flex items-center gap-1",children:[jsxRuntime.jsx("input",{ref:i,type:"text",value:n,onChange:l=>a(l.target.value),onKeyDown:l=>{l.key==="Enter"&&o(),l.key==="Escape"&&r();},"aria-label":"Edit cell",className:"min-w-0 flex-1 rounded border border-primary-400 bg-white px-1.5 py-0.5 text-sm outline-none focus:ring-1 focus:ring-primary-400 dark:border-primary-600 dark:bg-secondary-800"}),jsxRuntime.jsx("button",{type:"button",onClick:o,className:"text-success-600 hover:text-success-700 dark:text-success-400","aria-label":"Confirm",children:jsxRuntime.jsx(lucideReact.Check,{className:"h-3.5 w-3.5"})}),jsxRuntime.jsx("button",{type:"button",onClick:r,className:"text-danger-500 hover:text-danger-600 dark:text-danger-400","aria-label":"Cancel",children:jsxRuntime.jsx(lucideReact.X,{className:"h-3.5 w-3.5"})})]})}function ym({columns:e,data:t,rowKey:r,sort:n,onSortChange:a,defaultSort:i=null,selectionMode:o="none",selected:l,onSelectionChange:c,editable:m=false,onCellEdit:d,toolbar:f=false,onAdd:p,onDelete:u,rowActions:h,intent:g,density:b,className:N,empty:x}){let[T,w]=qr.useState(i),C=n??T,S=qr.useCallback(B=>{let j=C?.column===B?C.direction==="asc"?{column:B,direction:"desc"}:null:{column:B,direction:"asc"};a?a(j):w(j);},[C,a]),R=qr.useMemo(()=>{if(!C)return t;let B=e.find(ye=>ye.key===C.column);if(!B)return t;let j=B.compareFn??((ye,y)=>{let L=B.cell(ye),G=B.cell(y);return L==null&&G==null?0:L==null?-1:G==null?1:typeof L=="number"&&typeof G=="number"?L-G:String(L).localeCompare(String(G))}),pe=[...t].sort(j);return C.direction==="desc"?pe.reverse():pe},[t,C,e]),[V,I]=qr.useState([]),E=l??V,v=c??I,U=qr.useMemo(()=>R.map((B,j)=>r(B,j)),[R,r]),k=o==="multiple"&&U.length>0&&U.every(B=>E.includes(B)),q=o==="multiple"&&E.length>0&&!k,M=qr.useCallback(B=>{o==="single"?v(E.includes(B)?[]:[B]):o==="multiple"&&v(E.includes(B)?E.filter(j=>j!==B):[...E,B]);},[o,E,v]),W=qr.useCallback(()=>{v(k?[]:U);},[k,U,v]),[$,ue]=qr.useState(null),J=qr.useCallback((B,j,pe)=>{m&&pe!==false&&ue({rowKey:B,colKey:j});},[m]),de=qr.useCallback((B,j,pe)=>{d?.(B,j,pe),ue(null);},[d]);return jsxRuntime.jsxs("div",{className:"space-y-2",children:[f&&jsxRuntime.jsxs("div",{className:"flex items-center gap-2",children:[p&&jsxRuntime.jsxs("button",{type:"button",onClick:p,className:"inline-flex items-center gap-1.5 rounded-md border border-secondary-300 bg-white px-3 py-1.5 text-sm font-medium text-secondary-700 transition-colors hover:bg-secondary-50 dark:border-secondary-600 dark:bg-secondary-800 dark:text-secondary-300 dark:hover:bg-secondary-700",children:[jsxRuntime.jsx(lucideReact.Plus,{className:"h-3.5 w-3.5"})," Add"]}),u&&jsxRuntime.jsxs("button",{type:"button",onClick:()=>u(E),disabled:E.length===0,className:"inline-flex items-center gap-1.5 rounded-md border border-secondary-300 bg-white px-3 py-1.5 text-sm font-medium text-danger-600 transition-colors hover:bg-danger-50 disabled:opacity-40 disabled:pointer-events-none dark:border-secondary-600 dark:bg-secondary-800 dark:text-danger-400 dark:hover:bg-danger-900/20",children:[jsxRuntime.jsx(lucideReact.Trash2,{className:"h-3.5 w-3.5"})," Delete",E.length>0&&` (${E.length})`]}),m&&E.length===1&&jsxRuntime.jsxs("button",{type:"button",onClick:()=>{let B=e.find(j=>j.editable!==false);B&&ue({rowKey:E[0],colKey:B.key});},className:"inline-flex items-center gap-1.5 rounded-md border border-secondary-300 bg-white px-3 py-1.5 text-sm font-medium text-secondary-700 transition-colors hover:bg-secondary-50 dark:border-secondary-600 dark:bg-secondary-800 dark:text-secondary-300 dark:hover:bg-secondary-700",children:[jsxRuntime.jsx(lucideReact.Pencil,{className:"h-3.5 w-3.5"})," Edit"]}),E.length>0&&jsxRuntime.jsxs("span",{className:"ml-auto text-sm text-secondary-500 dark:text-secondary-400",children:[E.length," row",E.length>1?"s":""," selected"]})]}),jsxRuntime.jsxs(Ur,{intent:g,density:b,className:N,children:[jsxRuntime.jsx(No,{children:jsxRuntime.jsxs(Gr,{children:[o==="multiple"&&jsxRuntime.jsx(rr,{className:"w-10",children:jsxRuntime.jsx("input",{type:"checkbox",checked:k,ref:B=>{B&&(B.indeterminate=q);},onChange:W,className:"h-4 w-4 cursor-pointer rounded border-secondary-300 accent-primary-600","aria-label":"Select all"})}),o==="single"&&jsxRuntime.jsx(rr,{className:"w-10"}),e.map(B=>{let j=B.sortable!==false,pe=C?.column===B.key;return jsxRuntime.jsx(rr,{className:s(j&&"cursor-pointer select-none",B.headerClassName),onClick:j?()=>S(B.key):void 0,"aria-sort":pe?C.direction==="asc"?"ascending":"descending":void 0,children:jsxRuntime.jsxs("span",{className:"inline-flex items-center gap-1",children:[B.header,j&&jsxRuntime.jsx(Ps,{active:pe,direction:pe?C.direction:null})]})},B.key)}),h&&jsxRuntime.jsx(rr,{className:"w-20 text-right",children:"Actions"})]})}),jsxRuntime.jsx(Co,{children:R.length===0?jsxRuntime.jsx("tr",{children:jsxRuntime.jsx("td",{colSpan:e.length+(o!=="none"?1:0)+(h?1:0),children:jsxRuntime.jsx(To,{...x})})}):R.map((B,j)=>{let pe=r(B,j),ye=E.includes(pe);return jsxRuntime.jsxs(Gr,{className:s(ye&&"bg-primary-50/60 dark:bg-primary-900/20"),onClick:()=>{o!=="none"&&M(pe);},children:[o==="multiple"&&jsxRuntime.jsx(nr,{className:"w-10",children:jsxRuntime.jsx("input",{type:"checkbox",checked:ye,onChange:()=>M(pe),onClick:y=>y.stopPropagation(),className:"h-4 w-4 cursor-pointer rounded border-secondary-300 accent-primary-600","aria-label":"Select row"})}),o==="single"&&jsxRuntime.jsx(nr,{className:"w-10",children:jsxRuntime.jsx("input",{type:"radio",checked:ye,onChange:()=>M(pe),onClick:y=>y.stopPropagation(),className:"h-4 w-4 cursor-pointer accent-primary-600","aria-label":"Select row"})}),e.map(y=>{let L=$?.rowKey===pe&&$?.colKey===y.key,G=y.editValue?.(B)??(()=>{let O=y.cell(B);return typeof O=="string"||typeof O=="number"?String(O):""})();return jsxRuntime.jsx(nr,{className:s(y.cellClassName,m&&y.editable!==false&&"cursor-text"),onDoubleClick:O=>{O.stopPropagation(),J(pe,y.key,y.editable);},children:L?jsxRuntime.jsx(hm,{value:G,onCommit:O=>de(pe,y.key,O),onCancel:()=>ue(null)}):y.cell(B)},y.key)}),h&&jsxRuntime.jsx(nr,{className:"text-right",onClick:y=>y.stopPropagation(),children:jsxRuntime.jsx("span",{className:"inline-flex items-center gap-1",children:h(B)})})]},pe)})})]})]})}function Ps({active:e,direction:t}){let r="h-3.5 w-3.5 shrink-0";return !e||!t?jsxRuntime.jsx(lucideReact.ArrowUpDown,{className:s(r,"opacity-30")}):t==="asc"?jsxRuntime.jsx(lucideReact.ArrowUp,{className:s(r,"opacity-70")}):jsxRuntime.jsx(lucideReact.ArrowDown,{className:s(r,"opacity-70")})}var Ds=qr.createContext({size:"md"});function Mo({intent:e,size:t="md",className:r,...n}){return jsxRuntime.jsx(Ds.Provider,{value:{size:t},children:jsxRuntime.jsx("ul",{className:s(Kn({intent:e}),r),...n})})}function wm({actions:e,className:t,children:r,...n}){let{size:a}=qr.useContext(Ds);return jsxRuntime.jsxs("li",{className:s(Xn({size:a}),t),...n,children:[jsxRuntime.jsx("span",{className:"flex min-w-0 flex-1 items-center gap-1.5",children:r}),e&&jsxRuntime.jsx("span",{className:"ml-auto flex shrink-0 items-center gap-1 opacity-0 transition-opacity group-hover:opacity-100 [@media(hover:none)]:opacity-100 [@media(hover:none)]:[&>button]:min-h-(--row-action-touch-min) [@media(hover:none)]:[&>button]:min-w-(--row-action-touch-min) [@media(hover:none)]:[&>button]:flex [@media(hover:none)]:[&>button]:items-center [@media(hover:none)]:[&>button]:justify-center",children:e})]})}var Vs=qr.createContext({showLines:true,expandedKeys:null,onToggleKey:()=>{},size:"md"});function Ro({showLines:e=true,showRoot:t=true,expandedKeys:r,defaultExpandedKeys:n="all",onExpandedKeysChange:a,size:i="md",className:o,children:l,...c}){let [m,d]=qr.useState(()=>n),p=qr.useCallback(h=>{if(r){let g=new Set(r);g.has(h)?g.delete(h):g.add(h),a?.(g);}else d(g=>{if(g==="all")return new Set(["__ALL_MINUS__",h]);let b=new Set(g);return b.has(h)?b.delete(h):b.add(h),b});},[r,a]),u=r??(m==="all"?null:m);return jsxRuntime.jsx(Vs.Provider,{value:{showLines:e,expandedKeys:u,onToggleKey:p,size:i},children:t?jsxRuntime.jsx("ul",{className:s("text-sm",o),role:"tree",...c,children:l}):jsxRuntime.jsx("ul",{className:s("text-sm",o),role:"tree",...c,children:jsxRuntime.jsx(Rm,{children:l})})})}function Rm({children:e}){let t=Is(e);return jsxRuntime.jsx(jsxRuntime.Fragment,{children:t.map(r=>qr__default.default.isValidElement(r)&&r.props.children?r.props.children:null)})}function Is(e){let t=[];return qr__default.default.Children.forEach(e,r=>{qr__default.default.isValidElement(r)&&r.type===qr__default.default.Fragment?t.push(...Is(r.props.children)):t.push(r);}),t}function Sm({nodeKey:e,label:t,icon:r,actions:n,defaultExpanded:a=false,expanded:i,onToggle:o,children:l,className:c}){let{showLines:m,expandedKeys:d,onToggleKey:f,size:p}=qr.useContext(Vs),[u,h]=qr.useState(a),g=qr__default.default.Children.count(l)>0,b=e??(typeof t=="string"?t:""),N;i!=null?N=i:d!=null&&b?d.has("__ALL_MINUS__")?N=!d.has(b):N=d.has(b):N=u;let x=()=>{let T=!N;o?o(T):d!=null&&b?f(b):h(T);};return jsxRuntime.jsxs("li",{className:s("select-none",c),role:"treeitem","aria-expanded":g?N:void 0,children:[jsxRuntime.jsxs("div",{className:s("group hover:bg-primary-50 dark:hover:bg-primary-800/50 rounded-md px-1",Wn({size:p}),g?"cursor-pointer":"cursor-default"),onClick:g?x:void 0,children:[g?jsxRuntime.jsx(lucideReact.ChevronRight,{className:s("text-primary-400 h-4 w-4 shrink-0 transition-transform duration-200",N&&"rotate-90")}):jsxRuntime.jsx("span",{className:"w-4 shrink-0"}),r&&jsxRuntime.jsx("span",{className:"shrink-0",children:r}),jsxRuntime.jsx("span",{className:"text-primary-700 dark:text-primary-300 min-w-0 flex-1 truncate",children:t}),n&&jsxRuntime.jsx("span",{className:"ml-auto flex shrink-0 items-center gap-1 opacity-0 transition-opacity group-hover:opacity-100 [@media(hover:none)]:opacity-100 [@media(hover:none)]:[&>button]:min-h-(--row-action-touch-min) [@media(hover:none)]:[&>button]:min-w-(--row-action-touch-min) [@media(hover:none)]:[&>button]:flex [@media(hover:none)]:[&>button]:items-center [@media(hover:none)]:[&>button]:justify-center",onClick:T=>T.stopPropagation(),children:n})]}),g&&jsxRuntime.jsx("div",{className:s("grid transition-[grid-template-rows] duration-200 ease-out",N?"grid-rows-[1fr]":"grid-rows-[0fr]"),children:jsxRuntime.jsx("div",{className:"overflow-hidden",children:jsxRuntime.jsx("ul",{className:s("ml-4 pl-2",m&&"border-primary-200 dark:border-primary-700 border-l"),role:"group",children:l})})})]})}function Em({avatar:e,sender:t}){return e?typeof e=="string"?/^(?:https?|data|blob):/.test(e)?jsxRuntime.jsx("img",{src:e,alt:t,className:"h-8 w-8 shrink-0 rounded-full object-cover",draggable:false}):jsxRuntime.jsx("div",{className:"bg-primary-200 text-primary-600 dark:bg-primary-700 dark:text-primary-300 flex h-8 w-8 shrink-0 items-center justify-center rounded-full text-lg select-none",children:e}):jsxRuntime.jsx("div",{className:"flex h-8 w-8 shrink-0 items-center justify-center rounded-full",children:e}):jsxRuntime.jsx("div",{className:"bg-primary-200 text-primary-600 dark:bg-primary-700 dark:text-primary-300 flex h-8 w-8 shrink-0 items-center justify-center rounded-full text-sm font-semibold select-none",children:t.charAt(0).toUpperCase()})}function Vm({msg:e,alignRight:t}){return jsxRuntime.jsxs("div",{className:s("flex gap-2.5",t?"flex-row-reverse":"flex-row"),children:[jsxRuntime.jsx(Em,{avatar:e.avatar,sender:e.sender}),jsxRuntime.jsxs("div",{className:s("flex max-w-[75%] flex-col gap-0.5",t?"items-end":"items-start"),children:[jsxRuntime.jsx("span",{className:"text-primary-500 dark:text-primary-400 text-xs",children:e.sender}),jsxRuntime.jsx("div",{className:s("rounded-xl px-3 py-2 text-sm leading-relaxed",t?"rounded-tr-sm bg-primary-500 text-white dark:bg-primary-600":"bg-primary-100 text-primary-800 dark:bg-primary-800 dark:text-primary-200 rounded-tl-sm"),children:e.content}),e.time&&jsxRuntime.jsx("span",{className:"text-primary-400 dark:text-primary-500 text-[10px]",children:e.time})]})]})}function Po({messages:e,mode:t="split",autoScroll:r=true,className:n,...a}){let i=qr.useRef(null);return qr.useEffect(()=>{r&&i.current?.scrollIntoView({behavior:"smooth"});},[e,r]),jsxRuntime.jsxs("div",{className:s("flex flex-col gap-4 overflow-y-auto rounded-lg border p-4","border-primary-200 dark:border-primary-700 dark:bg-primary-900 bg-white",n),...a,children:[e.map(o=>{let l=t==="split"&&!!o.self;return jsxRuntime.jsx(Vm,{msg:o,alignRight:l},o.id)}),jsxRuntime.jsx("div",{ref:i})]})}var Hm={name:"onyx-css-vars",type:"dark",settings:[{settings:{foreground:"var(--color-syntax-plain)",background:"var(--color-syntax-bg)"}},{scope:["comment","punctuation.definition.comment"],settings:{foreground:"var(--color-syntax-comment)",fontStyle:"italic"}},{scope:["keyword","keyword.control","keyword.operator.new","keyword.operator.expression","storage.type","storage.modifier"],settings:{foreground:"var(--color-syntax-keyword)"}},{scope:["string","string.quoted","string.template"],settings:{foreground:"var(--color-syntax-string)"}},{scope:["entity.name.function","support.function","meta.function-call"],settings:{foreground:"var(--color-syntax-function)"}},{scope:["variable","variable.other","variable.parameter","meta.definition.variable"],settings:{foreground:"var(--color-syntax-variable)"}},{scope:["constant.numeric","constant.language"],settings:{foreground:"var(--color-syntax-number)"}},{scope:["keyword.operator","keyword.operator.assignment","keyword.operator.comparison","keyword.operator.arithmetic"],settings:{foreground:"var(--color-syntax-operator)"}},{scope:["entity.name.tag","punctuation.definition.tag","support.class.component"],settings:{foreground:"var(--color-syntax-tag)"}},{scope:["entity.other.attribute-name","meta.tag.attributes"],settings:{foreground:"var(--color-syntax-attr)"}},{scope:["punctuation","meta.brace","punctuation.definition.block","punctuation.separator","punctuation.terminator"],settings:{foreground:"var(--color-syntax-punctuation)"}},{scope:["entity.name.type","support.type","support.class","entity.other.inherited-class"],settings:{foreground:"var(--color-syntax-type)"}}]},Fm={typescript:()=>import('@shikijs/langs/typescript'),javascript:()=>import('@shikijs/langs/javascript'),tsx:()=>import('@shikijs/langs/tsx'),jsx:()=>import('@shikijs/langs/jsx'),html:()=>import('@shikijs/langs/html'),css:()=>import('@shikijs/langs/css'),json:()=>import('@shikijs/langs/json'),markdown:()=>import('@shikijs/langs/markdown'),python:()=>import('@shikijs/langs/python'),rust:()=>import('@shikijs/langs/rust'),go:()=>import('@shikijs/langs/go'),java:()=>import('@shikijs/langs/java'),c:()=>import('@shikijs/langs/c'),cpp:()=>import('@shikijs/langs/cpp'),csharp:()=>import('@shikijs/langs/csharp'),vue:()=>import('@shikijs/langs/vue'),xml:()=>import('@shikijs/langs/xml'),yaml:()=>import('@shikijs/langs/yaml'),sql:()=>import('@shikijs/langs/sql'),bash:()=>import('@shikijs/langs/bash'),shell:()=>import('@shikijs/langs/shell')},Eo=null,As=new Set;function _m(){return Eo||(Eo=Promise.all([import('shiki/core'),import('shiki/engine/javascript')]).then(([{createHighlighterCore:e},{createJavaScriptRegexEngine:t}])=>e({themes:[Hm],langs:[],engine:t()}))),Eo}async function zm(e,t,r){let n=await _m();if(t&&!As.has(t)){let i=Fm[t];if(i)try{let o=await i();await n.loadLanguage(o.default??o),As.add(t);}catch{t="text";}else t="text";}let a=n.codeToHtml(e,{lang:t||"text",theme:"onyx-css-vars"});if(a=a.replace(/(<pre [^>]*style=")/,"$1line-height:1.7;tab-size:2;font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;"),r){let i=0;a=a.replace(/<span class="line">/g,()=>(i++,`<span class="line"><span class="line-number" data-line="${i}"></span>`));}return a}function Vo({code:e,language:t="text",lineNumbers:r=false,editable:n=false,onCodeChange:a,size:i,className:o,...l}){let[c,m]=qr.useState(""),d=qr.useRef(null),f=qr.useRef(null),p=qr.useRef(null);qr.useEffect(()=>{let w=false;return zm(e,t,n?false:r).then(C=>{w||m(C);}),()=>{w=true;}},[e,t,r,n]);let u=qr.useCallback(()=>{let w=f.current,C=p.current?.querySelector("pre"),S=d.current?.querySelector("[data-gutter]");w&&C&&(C.scrollTop=w.scrollTop,C.scrollLeft=w.scrollLeft),w&&S&&(S.scrollTop=w.scrollTop);},[]),h=qr.useCallback(w=>{a?.(w.target.value);},[a]),g=qr.useCallback(w=>{if(w.key==="Tab"){w.preventDefault();let C=w.currentTarget,S=C.selectionStart,R=C.selectionEnd,V=C.value.substring(0,S)+" "+C.value.substring(R);a?.(V),requestAnimationFrame(()=>{C.selectionStart=C.selectionEnd=S+2;});}},[a]),b=r&&"[&_.line-number]:inline-block [&_.line-number]:w-8 [&_.line-number]:mr-4 [&_.line-number]:text-right [&_.line-number]:text-secondary-400 [&_.line-number]:select-none [&_.line-number]:before:content-[attr(data-line)]",N="ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace",x=1.7,T=e.split(`
2
+ `).length;return n?jsxRuntime.jsxs("div",{ref:d,className:s(Wr({size:i}),"flex border border-primary-200 dark:border-primary-700",o),style:{background:"var(--color-syntax-bg)"},...l,children:[r&&jsxRuntime.jsx("div",{"data-gutter":true,"aria-hidden":true,className:"shrink-0 select-none overflow-hidden py-4 pl-3 pr-1 text-right text-secondary-400",style:{fontFamily:N,lineHeight:x,width:"3rem"},children:Array.from({length:T},(w,C)=>jsxRuntime.jsx("div",{children:C+1},C))}),jsxRuntime.jsxs("div",{className:"relative min-w-0 flex-1",children:[jsxRuntime.jsx("textarea",{ref:f,value:e,onChange:h,onScroll:u,onKeyDown:g,spellCheck:false,autoCapitalize:"off",autoComplete:"off",autoCorrect:"off",className:"relative z-2 m-0 block h-full w-full resize-none overflow-auto whitespace-pre border-none bg-transparent p-4 text-transparent caret-primary-600 outline-none dark:caret-primary-400",style:{fontFamily:N,lineHeight:x,tabSize:2,minHeight:"6rem"}}),jsxRuntime.jsx("div",{ref:p,"aria-hidden":true,className:"pointer-events-none absolute inset-0 z-1 overflow-hidden [&_pre]:m-0 [&_pre]:h-full [&_pre]:overflow-hidden [&_pre]:p-4 [&_code]:bg-transparent",dangerouslySetInnerHTML:c?{__html:c}:void 0})]})]}):jsxRuntime.jsx("div",{ref:d,className:s(Wr({size:i}),"border border-primary-200 dark:border-primary-700",b,o),style:{background:"var(--color-syntax-bg)"},...l,children:jsxRuntime.jsx("div",{ref:p,className:"[&_pre]:m-0 [&_pre]:p-4",dangerouslySetInnerHTML:c?{__html:c}:void 0,children:c?void 0:jsxRuntime.jsx("pre",{className:"m-0 p-4",style:{background:"var(--color-syntax-bg)"},children:jsxRuntime.jsx("code",{children:e})})})})}var Ym={up:lucideReact.TrendingUp,down:lucideReact.TrendingDown,neutral:lucideReact.Minus},Km={up:"text-success-600 dark:text-success-400",down:"text-danger-600 dark:text-danger-400",neutral:"text-secondary-500 dark:text-secondary-400"};function Io({title:e,value:t,prefix:r,suffix:n,icon:a,trend:i,trendValue:o,description:l,intent:c,size:m,className:d}){let f=i?Ym[i]:null,p=i?Km[i]:"";return jsxRuntime.jsx("div",{className:s(jn({intent:c,size:m}),d),children:jsxRuntime.jsxs("div",{className:"flex items-start justify-between gap-3",children:[jsxRuntime.jsxs("div",{className:"min-w-0 flex-1",children:[jsxRuntime.jsx("p",{className:"truncate text-xs font-medium tracking-wider uppercase text-secondary-500 dark:text-secondary-400",children:e}),jsxRuntime.jsxs("p",{className:"mt-1 flex items-baseline gap-1 text-2xl font-bold text-primary-900 dark:text-primary-50",children:[r&&jsxRuntime.jsx("span",{className:"text-base font-semibold text-secondary-500 dark:text-secondary-400",children:r}),jsxRuntime.jsx("span",{children:t}),n&&jsxRuntime.jsx("span",{className:"text-base font-semibold text-secondary-500 dark:text-secondary-400",children:n})]}),(i||l)&&jsxRuntime.jsxs("div",{className:"mt-2 flex items-center gap-2",children:[i&&f&&jsxRuntime.jsxs("span",{className:s("flex items-center gap-0.5 text-xs font-semibold",p),children:[jsxRuntime.jsx(f,{className:"h-3.5 w-3.5"}),o]}),l&&jsxRuntime.jsx("span",{className:"text-xs text-secondary-500 dark:text-secondary-400",children:l})]})]}),a&&jsxRuntime.jsx("div",{className:s("flex h-10 w-10 shrink-0 items-center justify-center rounded-xl [&_svg]:h-5 [&_svg]:w-5",c==="success"&&"bg-success-100 text-success-600 dark:bg-success-900/30 dark:text-success-400",c==="danger"&&"bg-danger-100 text-danger-600 dark:bg-danger-900/30 dark:text-danger-400",c==="warning"&&"bg-warning-100 text-warning-600 dark:bg-warning-900/30 dark:text-warning-400",(!c||c==="primary")&&"bg-primary-100 text-primary-600 dark:bg-primary-800 dark:text-primary-400"),children:a})]})})}function qm(e){return 1-Math.pow(1-e,4)}function Qm(e,t,r,n,a){let[i,o]=qr.useState(()=>a?a(t):t.toFixed(n)),l=qr.useRef(null),c=qr.useRef(null);return qr.useEffect(()=>{l.current!==null&&cancelAnimationFrame(l.current),c.current=null;let m=d=>{c.current===null&&(c.current=d);let f=d-c.current,p=Math.min(f/r,1),u=qm(p),h=t+(e-t)*u;o(a?a(h):h.toFixed(n)),p<1&&(l.current=requestAnimationFrame(m));};return l.current=requestAnimationFrame(m),()=>{l.current!==null&&cancelAnimationFrame(l.current);}},[e,t,r,n,a]),i}var Zm={up:lucideReact.TrendingUp,down:lucideReact.TrendingDown,neutral:lucideReact.Minus},Jm={up:"text-success-600 dark:text-success-400",down:"text-danger-600 dark:text-danger-400",neutral:"text-secondary-500 dark:text-secondary-400"},_s={primary:"bg-primary-100 text-primary-600 dark:bg-primary-800/60 dark:text-primary-300",success:"bg-success-100 text-success-600 dark:bg-success-900/30 dark:text-success-400",danger:"bg-danger-100 text-danger-600 dark:bg-danger-900/30 dark:text-danger-400",warning:"bg-warning-100 text-warning-600 dark:bg-warning-900/30 dark:text-warning-400"};function Ao({title:e,value:t,decimals:r=0,prefix:n,suffix:a,icon:i,trend:o,trendValue:l,description:c,animateDuration:m=1200,formatter:d,from:f=0,intent:p,size:u,className:h}){let g=Qm(t,f,m,r,d),b=o?Zm[o]:null,N=o?Jm[o]:"";return jsxRuntime.jsxs("div",{className:s(Gn({intent:p,size:u}),h),children:[jsxRuntime.jsx("div",{className:s("pointer-events-none absolute inset-x-0 top-0 h-0.5 rounded-t-xl",p==="success"&&"bg-gradient-to-r from-success-400 to-success-600",p==="danger"&&"bg-gradient-to-r from-danger-400 to-danger-600",p==="warning"&&"bg-gradient-to-r from-warning-400 to-warning-600",(!p||p==="primary")&&"bg-gradient-to-r from-primary-400 to-primary-600")}),jsxRuntime.jsxs("div",{className:"flex items-start justify-between gap-4",children:[jsxRuntime.jsxs("div",{className:"min-w-0 flex-1",children:[jsxRuntime.jsx("p",{className:"text-xs font-semibold tracking-widest uppercase text-secondary-500 dark:text-secondary-400",children:e}),jsxRuntime.jsxs("p",{className:"mt-2 flex items-baseline gap-1",children:[n&&jsxRuntime.jsx("span",{className:"text-lg font-semibold text-secondary-400 dark:text-secondary-500",children:n}),jsxRuntime.jsx("span",{className:"font-mono text-3xl font-bold tabular-nums text-primary-900 dark:text-primary-50",children:g}),a&&jsxRuntime.jsx("span",{className:"text-lg font-semibold text-secondary-400 dark:text-secondary-500",children:a})]})]}),i&&jsxRuntime.jsx("div",{className:s("flex h-12 w-12 shrink-0 items-center justify-center rounded-2xl [&_svg]:h-6 [&_svg]:w-6",_s[p??"primary"]??_s.primary),children:i})]}),(o||c)&&jsxRuntime.jsxs("div",{className:"mt-3 flex items-center gap-2 border-t border-primary-100 pt-3 dark:border-primary-700/50",children:[o&&b&&jsxRuntime.jsxs("span",{className:s("flex items-center gap-0.5 text-xs font-bold",N),children:[jsxRuntime.jsx(b,{className:"h-3.5 w-3.5"}),l]}),c&&jsxRuntime.jsx("span",{className:"text-xs text-secondary-500 dark:text-secondary-400",children:c})]})]})}var ep={Table:Ur,List:Mo,Tree:Ro,Chat:Po,CodeBlock:Vo,Stat:Io,MetricCard:Ao},Ho=ep;var ar="flex w-full items-center gap-2 rounded-md px-3 py-1.5 text-sm transition-colors cursor-pointer",Bs="bg-primary-200 dark:bg-primary-700/50 text-primary-900 dark:text-primary-100 font-medium",kr="text-primary-600 dark:text-primary-400 hover:bg-primary-100 dark:hover:bg-primary-800/50 hover:text-primary-900 dark:hover:text-primary-200",Nr="flex items-center justify-center rounded-md p-2 transition-colors cursor-pointer text-primary-600 dark:text-primary-400 hover:bg-primary-100 dark:hover:bg-primary-800/50 hover:text-primary-900 dark:hover:text-primary-200";function cp({to:e,className:t,style:r,children:n}){let a=typeof t=="function"?t({isActive:false}):t;return jsxRuntime.jsx("a",{href:e,className:a,style:r,children:n})}var Fo=["expanded","icons","mini"];function dp(e){let t=Fo.indexOf(e);return Fo[(t+1)%Fo.length]}function Os(e){let t=new Set;for(let r of e)if(r.children&&r.children.length>0){t.add(r.key??r.label);for(let n of Os(r.children))t.add(n);}return t}function $s({item:e,basePath:t,depth:r,onItemClick:n,LinkComponent:a,showLines:i,expandedKeys:o,onToggle:l}){let c=e.key??e.label,m=e.children&&e.children.length>0,[d,f]=qr.useState(e.defaultOpen??true),p=o?o.has(c):d,u=qr.useCallback(()=>{o?l(c):f(g=>!g);},[o,l,c]),h=r>0?`${r*1.25}rem`:void 0;if(m)return jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("button",{type:"button",onClick:u,className:s(ar,kr,"justify-between"),style:{paddingLeft:h},children:[jsxRuntime.jsxs("span",{className:"flex items-center gap-2",children:[e.icon,e.label]}),jsxRuntime.jsx(lucideReact.ChevronRight,{className:s("h-3.5 w-3.5 transition-transform",p&&"rotate-90")})]}),p&&jsxRuntime.jsx("div",{className:s("flex flex-col gap-0.5 pt-0.5",i?"ml-2.5 border-l border-primary-200 dark:border-primary-700":"ml-2"),children:e.children.map(g=>jsxRuntime.jsx($s,{item:g,basePath:t,depth:r+1,onItemClick:n,LinkComponent:a,showLines:i,expandedKeys:o,onToggle:l},g.key??g.path??g.label))})]});if(e.path!=null){let g=t+e.path;return n?jsxRuntime.jsxs("button",{type:"button",onClick:()=>n(e,g),className:s(ar,kr),style:{paddingLeft:h},children:[e.icon,e.label]}):jsxRuntime.jsxs(a,{to:g,className:({isActive:b})=>s(ar,b?Bs:kr),style:{paddingLeft:h},children:[e.icon,e.label]})}return jsxRuntime.jsxs("span",{className:s(ar,kr,"cursor-default"),style:{paddingLeft:h},children:[e.icon,e.label]})}function mp({item:e,basePath:t,onItemClick:r,LinkComponent:n}){let[a,i]=qr.useState(false),o=qr.useRef(null),l=qr.useRef(void 0),[c,m]=qr.useState({top:0,left:0}),d=()=>{clearTimeout(l.current),i(true);},f=()=>{l.current=setTimeout(()=>i(false),200);};qr.useLayoutEffect(()=>{if(a&&o.current){let u=o.current.getBoundingClientRect();m({top:u.top,left:u.right+4});}},[a]);let p=e.icon||jsxRuntime.jsx("span",{className:"text-xs font-bold leading-none",children:e.label.charAt(0).toUpperCase()});return jsxRuntime.jsxs("div",{onMouseEnter:d,onMouseLeave:f,children:[jsxRuntime.jsx("button",{ref:o,type:"button",className:s(Nr,"w-full"),title:e.label,onClick:()=>i(u=>!u),children:p}),a&&reactDom.createPortal(jsxRuntime.jsxs("div",{className:"fixed z-50 min-w-44 rounded-md border border-primary-200 bg-white p-1 shadow-lg dark:border-primary-700 dark:bg-primary-900",style:{top:c.top,left:c.left},onMouseEnter:d,onMouseLeave:f,children:[jsxRuntime.jsx("div",{className:"px-2.5 py-1.5 text-xs font-semibold uppercase text-primary-500 dark:text-primary-400",children:e.label}),jsxRuntime.jsx("div",{className:"flex flex-col gap-0.5",children:e.children?.map(u=>{let h=u.key??u.path??u.label;if(u.path!=null){let g=t+u.path;return r?jsxRuntime.jsxs("button",{type:"button",onClick:()=>{r(u,g),i(false);},className:s(ar,kr),children:[u.icon,u.label]},h):jsxRuntime.jsxs(n,{to:g,className:({isActive:b})=>s(ar,b?Bs:kr),children:[u.icon,u.label]},h)}return jsxRuntime.jsxs("span",{className:s(ar,"cursor-default text-primary-400"),children:[u.icon,u.label]},h)})})]}),document.body)]})}function pp({item:e,basePath:t,onItemClick:r,LinkComponent:n}){let a=e.icon||jsxRuntime.jsx("span",{className:"text-xs font-bold leading-none",children:e.label.charAt(0).toUpperCase()});if(e.path!=null){let i=t+e.path;return r?jsxRuntime.jsx("button",{type:"button",onClick:()=>r(e,i),className:s(Nr,"w-full"),title:e.label,children:a}):jsxRuntime.jsx(n,{to:i,className:({isActive:o})=>s(Nr,"w-full",o&&"bg-primary-200 dark:bg-primary-700/50 text-primary-900 dark:text-primary-100"),children:jsxRuntime.jsx("span",{title:e.label,children:a})})}return jsxRuntime.jsx("span",{className:s(Nr,"w-full cursor-default"),title:e.label,children:a})}function zo({items:e,title:t,basePath:r="/",onItemClick:n,LinkComponent:a=cp,collapsible:i,collapseMode:o,defaultCollapseMode:l="expanded",onCollapseModeChange:c,showLines:m=true,expandedKeys:d,defaultExpandedKeys:f="all",onExpandedKeysChange:p,className:u,responsive:h=true,mobileBreakpoint:g=768,mobileTopOffset:b=48,mobileDrawerSlot:N,...x}){let[T,w]=qr.useState(l),C=o??T,S=qr__default.default.useMemo(()=>Os(e),[e]),[R,V]=qr.useState(()=>f==="all"?new Set(S):new Set(f)),I=d??null,E=I??R,v=qr.useCallback(F=>{let K=new Set(E);K.has(F)?K.delete(F):K.add(F),V(K),p?.(K);},[E,p]),U=qr.useCallback(()=>{let F=dp(C);w(F),c?.(F);},[C,c]),[k,q]=qr.useState(()=>h&&typeof window<"u"&&window.innerWidth<g),[M,W]=qr.useState(false),[$,ue]=qr.useState(()=>{if(typeof window>"u")return "left";try{return localStorage.getItem("onyx-sidenav-side")||"left"}catch{return "left"}}),[J,de]=qr.useState(()=>{if(typeof window>"u")return 50;try{return Number(localStorage.getItem("onyx-sidenav-top"))||50}catch{return 50}}),[re,B]=qr.useState(null),j=qr.useRef({dragging:false,startX:0,startY:0,moved:false}),pe=qr.useCallback(F=>{if(F.pointerType==="mouse"&&F.button!==0)return;F.preventDefault(),j.current={dragging:true,startX:F.clientX,startY:F.clientY,moved:false};let K=X=>{if(!j.current.dragging)return;let fe=Math.abs(X.clientX-j.current.startX),we=Math.abs(X.clientY-j.current.startY);if((fe>6||we>6)&&(j.current.moved=true),!j.current.moved)return;let H=X.clientX<window.innerWidth/2?"left":"right",ne=b+28,Y=window.innerHeight-28,Q=Math.max(ne,Math.min(Y,X.clientY));B({side:H,y:Q});},oe=X=>{if(window.removeEventListener("pointermove",K),window.removeEventListener("pointerup",oe),window.removeEventListener("pointercancel",oe),!j.current.dragging)return;if(j.current.dragging=false,!j.current.moved){let Q=ke=>{ke.stopPropagation(),ke.preventDefault(),window.removeEventListener("click",Q,true);};window.addEventListener("click",Q,true),B(null),W(true);return}let fe=X.clientX<window.innerWidth/2?"left":"right",we=b+28,H=window.innerHeight-28,Y=Math.max(we,Math.min(H,X.clientY))/window.innerHeight*100;ue(fe),de(Y),B(null);try{localStorage.setItem("onyx-sidenav-side",fe),localStorage.setItem("onyx-sidenav-top",String(Y));}catch{}};window.addEventListener("pointermove",K),window.addEventListener("pointerup",oe),window.addEventListener("pointercancel",oe);},[b]);qr.useEffect(()=>{if(!h||typeof window>"u"||!window.matchMedia)return;let F=window.matchMedia(`(max-width: ${g-1}px)`),K=oe=>{q(oe.matches),oe.matches||W(false);};return F.addEventListener("change",K),()=>F.removeEventListener("change",K)},[h,g]);let ye=qr.useCallback(F=>{F.target.closest("a")&&W(false);},[]),y=qr.useRef(null),L=qr.useRef({startX:0,startY:0,dragging:false}),G=60,O=qr.useCallback(F=>{let K=F.touches[0];L.current={startX:K.clientX,startY:K.clientY,dragging:true};},[]),_=qr.useCallback(F=>{if(!L.current.dragging||!y.current)return;let K=F.touches[0],oe=K.clientX-L.current.startX,X=K.clientY-L.current.startY;if($==="left"){if(oe>=0||Math.abs(X)>Math.abs(oe))return;y.current.style.transform=`translateX(${Math.max(oe,-224)}px)`;}else {if(oe<=0||Math.abs(X)>Math.abs(oe))return;y.current.style.transform=`translateX(${Math.min(oe,224)}px)`;}y.current.style.transition="none";},[$]),ee=qr.useCallback(F=>{if(!L.current.dragging||!y.current)return;L.current.dragging=false;let K=F.changedTouches[0],oe=K.clientX-L.current.startX,X=K.clientY-L.current.startY;y.current.style.transition="",y.current.style.transform="",Math.abs(oe)>Math.abs(X)&&($==="left"&&oe<-G&&W(false),$==="right"&&oe>G&&W(false));},[$]),xe=qr.useMemo(()=>!k||!n?n:(F,K)=>{W(false),n(F,K);},[k,n]),P=jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[i&&!k&&jsxRuntime.jsx("div",{className:s("flex shrink-0 mb-1",C==="expanded"?"justify-end":"justify-center"),children:jsxRuntime.jsx("button",{type:"button",onClick:U,className:Nr,"aria-label":C==="mini"?"Expand sidebar":"Collapse sidebar",title:C==="mini"?"Expand sidebar":"Collapse sidebar",children:C==="mini"?jsxRuntime.jsx(lucideReact.Menu,{className:"h-5 w-5"}):jsxRuntime.jsx(lucideReact.ChevronsLeft,{className:"h-4 w-4"})})}),(k||C==="expanded")&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[t&&jsxRuntime.jsx("h2",{className:"text-primary-500 dark:text-primary-400 mb-3 text-sm font-semibold uppercase",children:t}),e.map(F=>jsxRuntime.jsx($s,{item:F,basePath:r,depth:0,onItemClick:xe,LinkComponent:a,showLines:m,expandedKeys:I,onToggle:v},F.key??F.path??F.label))]}),!k&&C==="icons"&&e.map(F=>{let K=F.key??F.path??F.label;return F.children&&F.children.length>0?jsxRuntime.jsx(mp,{item:F,basePath:r,onItemClick:xe,LinkComponent:a},K):jsxRuntime.jsx(pp,{item:F,basePath:r,onItemClick:xe,LinkComponent:a},K)})]});if(h&&k){let F=re?re.side:$,K=re?re.y:J/100*(typeof window<"u"?window.innerHeight:600),oe=re?{top:K,transform:"translateY(-50%)",transition:"none",...F==="left"?{left:0}:{right:0}}:{top:`${J}%`,transform:"translateY(-50%)",transition:"top 0.15s ease",...$==="left"?{left:0}:{right:0}},X=$==="left"?{left:0,right:"auto"}:{right:0,left:"auto"},fe=M?"translate-x-0":$==="left"?"-translate-x-full":"translate-x-full",we=$==="left"?"border-r":"border-l";return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[M&&reactDom.createPortal(jsxRuntime.jsx("div",{className:"fixed inset-0 z-40 bg-black/50",style:{top:b},onClick:()=>W(false)}),document.body),reactDom.createPortal(jsxRuntime.jsxs("aside",{ref:y,className:s("fixed bottom-0 z-50 flex flex-col w-56 bg-white dark:bg-primary-900 shadow-xl transition-transform duration-200",we,"border-primary-200 dark:border-primary-700",fe),style:{top:b,...X},onClick:ye,onTouchStart:O,onTouchMove:_,onTouchEnd:ee,children:[jsxRuntime.jsxs("div",{className:"flex shrink-0 items-center justify-between border-b border-primary-200 px-3 py-2 dark:border-primary-700",children:[jsxRuntime.jsx("span",{className:"text-xs font-semibold uppercase tracking-wide text-primary-500 dark:text-primary-400",children:"Navigation"}),jsxRuntime.jsx("button",{type:"button",onClick:H=>{H.stopPropagation(),W(false);},className:s(Nr,"h-7 w-7 p-1"),"aria-label":"Close navigation",children:jsxRuntime.jsx(lucideReact.X,{className:"h-4 w-4"})})]}),N&&jsxRuntime.jsx("div",{className:"shrink-0 border-b border-primary-200 px-3 py-2 dark:border-primary-700",children:N}),jsxRuntime.jsx("div",{className:"flex-1 overflow-y-auto overscroll-y-contain p-3",children:jsxRuntime.jsx("nav",{className:"flex flex-col gap-0.5",children:P})})]}),document.body),!M&&reactDom.createPortal(jsxRuntime.jsx("div",{className:s("fixed z-50 flex items-center",F==="left"?"justify-start":"justify-end",re?"cursor-grabbing":"cursor-grab"),style:{...oe,width:44,height:80,marginTop:-12,touchAction:"none",userSelect:"none"},onPointerDown:pe,onDragStart:H=>H.preventDefault(),role:"button","aria-label":"Open navigation",tabIndex:0,children:jsxRuntime.jsx("div",{className:s("flex h-16 w-6 items-center justify-center","bg-primary-800/80 text-white shadow-md backdrop-blur-sm","hover:bg-primary-700/90 dark:bg-primary-200/80 dark:text-primary-900 dark:hover:bg-primary-300/90",F==="left"?"rounded-r-xl":"rounded-l-xl"),children:F==="left"?jsxRuntime.jsx(lucideReact.ChevronRight,{className:"h-4 w-4"}):jsxRuntime.jsx(lucideReact.ChevronLeft,{className:"h-4 w-4"})})}),document.body)]})}return jsxRuntime.jsx("nav",{className:s("flex flex-col gap-0.5",C==="mini"&&"items-center",u),...x,children:P})}function gp({href:e,className:t,onClick:r,children:n}){return jsxRuntime.jsx("a",{href:e,className:t,onClick:r,children:n})}function Bo({brand:e,onBrandClick:t,navItems:r=[],actions:n=[],linkComponent:a=gp,height:i="h-12",mobileMenu:o=false,navMenuIcon:l,actionsMenuIcon:c,className:m,children:d}){let f=o&&r.length>0,p=o&&n.length>0,u="md:hidden rounded-md px-1.5 py-1.5 text-primary-500 dark:text-primary-400 hover:text-primary-700 dark:hover:text-primary-200 [&_svg]:h-5 [&_svg]:w-5",h=x=>x?"text-primary-900 font-medium dark:text-primary-100":"text-primary-500 hover:text-primary-700 dark:text-primary-400 dark:hover:text-primary-200 transition-colors",g="rounded-md p-1.5 text-primary-500 hover:bg-primary-100 hover:text-primary-700 dark:text-primary-400 dark:hover:bg-primary-800 dark:hover:text-primary-200 transition-colors [&_svg]:h-5 [&_svg]:w-5",b=r.map((x,T)=>({key:typeof x.label=="string"?x.label:String(T),label:x.active?jsxRuntime.jsx("span",{className:"font-semibold text-primary-900 dark:text-primary-100",children:x.label}):x.label,onClick:()=>{x.onClick?x.onClick({preventDefault:()=>{},stopPropagation:()=>{}}):x.href&&(window.location.href=x.href);}})),N=n.map((x,T)=>({key:x.key??String(T),label:jsxRuntime.jsxs("span",{className:"flex items-center gap-2 [&_svg]:h-4 [&_svg]:w-4 [&_svg]:shrink-0",children:[x.icon,jsxRuntime.jsx("span",{children:x.ariaLabel})]}),onClick:()=>{x.onClick?x.onClick({preventDefault:()=>{},stopPropagation:()=>{}}):x.href&&(x.external?window.open(x.href,"_blank","noopener,noreferrer"):window.location.href=x.href);}}));return jsxRuntime.jsxs("header",{className:s("flex shrink-0 items-center justify-between border-b px-5","border-primary-200 bg-white dark:border-primary-700 dark:bg-primary-900",i,m),children:[jsxRuntime.jsxs("div",{className:"flex items-center gap-2 md:gap-6",children:[e&&jsxRuntime.jsx("div",{className:s("text-lg font-bold text-primary-800 dark:text-primary-100",t&&"cursor-pointer"),onClick:t,role:t?"button":void 0,tabIndex:t?0:void 0,onKeyDown:t?x=>{(x.key==="Enter"||x.key===" ")&&(x.preventDefault(),t(x));}:void 0,children:e}),f&&jsxRuntime.jsx(hr,{intent:"ghost",size:"sm",className:u,label:l??jsxRuntime.jsx(lucideReact.PanelLeft,{className:"h-5 w-5"}),items:b,align:"left",chevron:false,"aria-label":"Open navigation"}),r.length>0&&jsxRuntime.jsx("nav",{className:s("flex items-center gap-4 text-sm",o?"hidden md:flex":"flex"),children:r.map((x,T)=>{let w=typeof x.label=="string"?x.label:T,C=h(x.active);return x.href?jsxRuntime.jsx(a,{href:x.href,className:C,onClick:x.onClick,children:x.label},w):jsxRuntime.jsx("button",{type:"button",className:s(C,"cursor-pointer"),onClick:x.onClick,children:x.label},w)})})]}),d&&jsxRuntime.jsx("div",{className:"flex items-center",children:d}),jsxRuntime.jsxs("div",{className:"flex items-center gap-1",children:[n.length>0&&jsxRuntime.jsx("div",{className:s("flex items-center gap-1",o?"hidden md:flex":"flex"),children:n.map((x,T)=>x.href?jsxRuntime.jsx("a",{href:x.href,target:x.external?"_blank":void 0,rel:x.external?"noopener noreferrer":void 0,className:g,"aria-label":x.ariaLabel,onClick:x.onClick,children:x.icon},x.key??T):jsxRuntime.jsx("button",{type:"button",className:g,"aria-label":x.ariaLabel,onClick:x.onClick,children:x.icon},x.key??T))}),p&&jsxRuntime.jsx(hr,{intent:"ghost",size:"sm",className:u,label:c??jsxRuntime.jsx(lucideReact.MoreHorizontal,{className:"h-5 w-5"}),items:N,align:"right",chevron:false,"aria-label":"Open menu"})]})]})}var Zn=classVarianceAuthority.cva("inline-flex items-center gap-1 underline-offset-2 transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary-500/20 [&_svg]:shrink-0",{variants:{intent:{default:"text-primary-600 hover:text-primary-800 active:text-primary-900 dark:text-primary-400 dark:hover:text-primary-200 dark:active:text-primary-100",secondary:"text-secondary-500 hover:text-secondary-700 active:text-secondary-800 dark:text-secondary-400 dark:hover:text-secondary-200 dark:active:text-secondary-100",muted:"text-primary-400 hover:text-primary-600 dark:text-primary-500 dark:hover:text-primary-300"},size:{sm:"text-xs [&_svg]:h-3 [&_svg]:w-3",md:"text-sm [&_svg]:h-3.5 [&_svg]:w-3.5",lg:"text-base [&_svg]:h-4 [&_svg]:w-4"},underline:{always:"underline",hover:"hover:underline",none:"no-underline"}},defaultVariants:{intent:"default",size:"md",underline:"none"}});function hp(e,t){return !!(t==="_blank"||e&&/^https?:\/\//.test(e))}var yp=e=>jsxRuntime.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":true,...e,children:[jsxRuntime.jsx("path",{d:"M15 3h6v6"}),jsxRuntime.jsx("path",{d:"M10 14 21 3"}),jsxRuntime.jsx("path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6"})]});function Oo({intent:e,size:t,underline:r,external:n,className:a,children:i,href:o,target:l,rel:c,...m}){let d=n??hp(o,l);return jsxRuntime.jsxs("a",{href:o,target:d&&!l?"_blank":l,rel:d&&!c?"noopener noreferrer":c,className:s(Zn({intent:e,size:t,underline:r}),a),...m,children:[i,d&&jsxRuntime.jsx(yp,{})]})}function ta({items:e,separator:t=jsxRuntime.jsx(lucideReact.ChevronRight,{className:"h-3.5 w-3.5","aria-hidden":"true"}),homeIcon:r=false,LinkComponent:n="a",className:a}){return jsxRuntime.jsx("nav",{"aria-label":"Breadcrumb",className:s("flex",a),children:jsxRuntime.jsx("ol",{className:"flex flex-wrap items-center gap-1 text-sm",children:e.map((i,o)=>{let l=o===e.length-1,c=r===true?jsxRuntime.jsx(lucideReact.Home,{className:"h-3.5 w-3.5"}):r!==false&&r!==void 0?r:null,m=o===0&&c?c:i.icon;return jsxRuntime.jsxs("li",{className:"flex items-center gap-1",children:[o>0&&jsxRuntime.jsx("span",{className:"text-secondary-400 dark:text-secondary-500",children:t}),l?jsxRuntime.jsxs("span",{"aria-current":"page",className:s("flex items-center gap-1 font-medium text-primary-800 dark:text-primary-100",m&&"gap-1.5"),children:[m,i.label]}):i.href?jsxRuntime.jsxs(n,{href:i.href,className:s("flex items-center gap-1 text-secondary-500 transition-colors","hover:text-primary-700 dark:text-secondary-400 dark:hover:text-primary-200","rounded focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary-500/30",m&&"gap-1.5"),children:[m,i.label]}):jsxRuntime.jsxs("span",{className:"flex items-center gap-1 text-secondary-500 dark:text-secondary-400",children:[m,i.label]})]},o)})})})}function ra(e,t){let r=[];for(let n=e;n<=t;n++)r.push(n);return r}function Mp(e,t,r){let n=r*2+5;if(t<=n)return ra(1,t);let a=Math.max(e-r,1),i=Math.min(e+r,t),o=a>2,l=i<t-1;return !o&&l?[...ra(1,3+r*2),"\u2026",t]:o&&!l?[1,"\u2026",...ra(t-(3+r*2)+1,t)]:[1,"\u2026",...ra(a,i),"\u2026",t]}var Xs={sm:"h-7 min-w-7 px-1.5 text-xs",md:"h-9 min-w-9 px-2 text-sm",lg:"h-11 min-w-11 px-2.5 text-base"},en={sm:"h-3.5 w-3.5",md:"h-4 w-4",lg:"h-5 w-5"};function tn({onClick:e,disabled:t,active:r,size:n,"aria-label":a,children:i}){return jsxRuntime.jsx("button",{type:"button",onClick:e,disabled:t,"aria-label":a,"aria-current":r?"page":void 0,className:s("inline-flex items-center justify-center rounded font-medium transition-colors","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary-500/30",Xs[n],r?"bg-primary-600 text-white dark:bg-primary-500":"border border-primary-200 bg-white text-primary-700 hover:bg-primary-50 dark:border-primary-700 dark:bg-primary-900 dark:text-primary-300 dark:hover:bg-primary-800",t&&"pointer-events-none opacity-40"),children:i})}function na({totalPages:e,currentPage:t,onPageChange:r,siblingCount:n=2,showFirstLast:a=true,showPageCount:i=false,size:o="md",className:l}){if(e<=1)return null;let c=Mp(t,e,n);return jsxRuntime.jsxs("nav",{"aria-label":"Pagination",className:s("flex items-center gap-1",l),children:[a&&jsxRuntime.jsx(tn,{size:o,onClick:()=>r(1),disabled:t===1,"aria-label":"First page",children:jsxRuntime.jsx(lucideReact.ChevronsLeft,{className:en[o]})}),jsxRuntime.jsx(tn,{size:o,onClick:()=>r(t-1),disabled:t===1,"aria-label":"Previous page",children:jsxRuntime.jsx(lucideReact.ChevronLeft,{className:en[o]})}),c.map((m,d)=>m==="\u2026"?jsxRuntime.jsx("span",{className:s("inline-flex items-center justify-center text-secondary-400",Xs[o]),"aria-hidden":"true",children:jsxRuntime.jsx(lucideReact.MoreHorizontal,{className:en[o]})},`ellipsis-${d}`):jsxRuntime.jsx(tn,{size:o,active:m===t,onClick:()=>r(m),"aria-label":`Page ${m}`,children:m},m)),jsxRuntime.jsx(tn,{size:o,onClick:()=>r(t+1),disabled:t===e,"aria-label":"Next page",children:jsxRuntime.jsx(lucideReact.ChevronRight,{className:en[o]})}),a&&jsxRuntime.jsx(tn,{size:o,onClick:()=>r(e),disabled:t===e,"aria-label":"Last page",children:jsxRuntime.jsx(lucideReact.ChevronsRight,{className:en[o]})}),i&&jsxRuntime.jsxs("span",{className:"ml-2 text-sm text-secondary-500 dark:text-secondary-400",children:["Page ",t," of ",e]})]})}function Ws({item:e,mode:t}){return e.separator?jsxRuntime.jsx("div",{className:"mx-1 h-10 w-px self-center bg-primary-200 dark:bg-primary-700","aria-hidden":true}):jsxRuntime.jsxs("button",{type:"button",title:e.title??e.label,disabled:e.disabled,onClick:e.onClick,"aria-pressed":e.active,className:s("relative flex shrink-0 items-center justify-center gap-1.5 rounded-lg px-2.5 py-1.5 text-xs font-medium transition-all duration-150 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary-400","disabled:cursor-not-allowed disabled:opacity-40",e.active?"bg-primary-100 text-primary-700 shadow-inner dark:bg-primary-800 dark:text-primary-200":"text-primary-700 hover:bg-primary-50 active:bg-primary-100 dark:text-primary-300 dark:hover:bg-primary-800",t==="full"?"min-w-[3.5rem] flex-col gap-0.5 py-2":"","[&_svg]:shrink-0",t==="full"?"[&_svg]:h-5 [&_svg]:w-5":"[&_svg]:h-4 [&_svg]:w-4"),children:[e.icon&&jsxRuntime.jsx("span",{children:e.icon}),t!=="icons"&&jsxRuntime.jsx("span",{className:s(t==="full"?"text-[0.6rem] leading-tight":""),children:e.label})]})}function Dp({group:e,mode:t,disabled:r=false}){return jsxRuntime.jsxs("div",{className:s("flex shrink-0 flex-col items-stretch",r&&"opacity-50"),children:[jsxRuntime.jsx("div",{className:"flex items-center gap-0.5 px-1",children:e.items.map(n=>jsxRuntime.jsx(Ws,{item:r?{...n,disabled:true}:n,mode:t},n.key))}),t==="full"&&jsxRuntime.jsx("div",{className:"mt-1 border-t border-primary-100 px-2 pt-0.5 text-center dark:border-primary-800",children:jsxRuntime.jsx("span",{className:"text-[0.55rem] text-secondary-400 dark:text-secondary-500",children:e.label})})]})}function Yo({tabs:e,defaultTab:t,activeTab:r,onTabChange:n,mode:a,onModeChange:i,sticky:o=false,className:l}){let c=e.filter(w=>!w.hidden),[m,d]=qr.useState(t??c[0]?.key??""),[f,p]=qr.useState(a??"full"),[u,h]=qr.useState(true),g=r??m,b=a??f,N=w=>{if(!c.find(S=>S.key===w)?.disabled){if(w===g&&b!=="icons"){h(S=>!S);return}d(w),n?.(w),h(true);}},T=c.find(w=>w.key===g)??c[0];return jsxRuntime.jsxs("div",{className:s("select-none border-b border-primary-200 bg-white dark:border-primary-700 dark:bg-primary-900",o&&"sticky top-0 z-30",l),children:[jsxRuntime.jsxs("div",{className:"flex items-center border-b border-primary-100 dark:border-primary-800",children:[jsxRuntime.jsx("div",{className:"flex flex-1 items-end overflow-x-auto",children:c.map(w=>jsxRuntime.jsxs("button",{type:"button",disabled:w.disabled,onClick:()=>N(w.key),className:s("flex shrink-0 items-center gap-1.5 border-b-2 px-4 py-2 text-sm font-medium transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary-400 [&_svg]:h-4 [&_svg]:w-4",w.disabled?"cursor-not-allowed border-transparent text-secondary-300 opacity-50 dark:text-secondary-600":w.key===g&&u?"border-primary-500 text-primary-700 dark:border-primary-400 dark:text-primary-200":"border-transparent text-secondary-500 hover:border-primary-300 hover:text-primary-600 dark:text-secondary-400 dark:hover:text-primary-300"),children:[w.icon,w.label]},w.key))}),jsxRuntime.jsx("button",{type:"button",title:u?"Collapse ribbon":"Expand ribbon",onClick:()=>h(w=>!w),className:"ml-auto mr-2 rounded-md p-1.5 text-secondary-400 transition-colors hover:bg-primary-50 hover:text-primary-600 dark:hover:bg-primary-800 dark:hover:text-primary-300",children:u?jsxRuntime.jsx(lucideReact.ChevronUp,{className:"h-4 w-4"}):jsxRuntime.jsx(lucideReact.ChevronDown,{className:"h-4 w-4"})})]}),u&&T&&b!=="icons"&&jsxRuntime.jsx("div",{className:"flex items-stretch gap-1 overflow-x-auto px-2 py-1.5",children:T.groups.map((w,C)=>jsxRuntime.jsxs(qr__default.default.Fragment,{children:[C>0&&jsxRuntime.jsx("div",{className:"mx-1 h-auto w-px self-stretch bg-primary-100 dark:bg-primary-800"}),jsxRuntime.jsx(Dp,{group:w,mode:b,disabled:w.disabled||T.disabled})]},w.key))}),b==="icons"&&u&&T&&jsxRuntime.jsx("div",{className:"flex items-center gap-0.5 overflow-x-auto px-2 py-1",children:T.groups.flatMap(w=>w.items.map(C=>jsxRuntime.jsx(Ws,{item:w.disabled||T.disabled?{...C,disabled:true}:C,mode:"icons"},C.key)))})]})}var Lp={SideNav:zo,Header:Bo,NavLink:Oo,Breadcrumb:ta,Pagination:na,RibbonBar:Yo},Ko=Lp;var aa=classVarianceAuthority.cva("flex w-full items-center justify-between font-medium transition-all [&_svg]:shrink-0",{variants:{size:{sm:"py-2 text-xs [&_svg]:h-3.5 [&_svg]:w-3.5",md:"py-3 text-sm [&_svg]:h-4 [&_svg]:w-4",lg:"py-4 text-base [&_svg]:h-5 [&_svg]:w-5"}},defaultVariants:{size:"md"}}),oa=classVarianceAuthority.cva("",{variants:{size:{sm:"pb-2 text-xs",md:"pb-3 text-sm",lg:"pb-4 text-base"}},defaultVariants:{size:"md"}}),ia=classVarianceAuthority.cva("divide-y",{variants:{intent:{default:"divide-primary-300 dark:divide-primary-700",bordered:"divide-primary-300 rounded-lg border border-primary-300 bg-white px-3 shadow-sm dark:divide-primary-700 dark:border-primary-700 dark:bg-primary-800/50",ghost:"divide-transparent"}},defaultVariants:{intent:"default"}}),sa=classVarianceAuthority.cva("flex",{variants:{intent:{line:"border-b border-primary-200 dark:border-primary-700",pills:"gap-1 rounded-lg bg-primary-100 p-1 dark:bg-primary-800",underline:"gap-4"}},defaultVariants:{intent:"line"}}),la=classVarianceAuthority.cva("inline-flex cursor-pointer items-center justify-center gap-1.5 whitespace-nowrap px-3 py-1.5 text-sm font-medium transition-all focus-visible:outline-none disabled:pointer-events-none disabled:opacity-50 [&_svg]:h-4 [&_svg]:w-4 [&_svg]:shrink-0",{variants:{intent:{line:"text-primary-500 hover:text-primary-700 data-[active=true]:text-primary-900 dark:text-primary-400 dark:hover:text-primary-200 dark:data-[active=true]:text-primary-100",pills:"rounded-md text-primary-600 hover:text-primary-900 data-[active=true]:bg-white data-[active=true]:text-primary-900 data-[active=true]:shadow-sm dark:text-primary-400 dark:hover:text-primary-100 dark:data-[active=true]:bg-primary-700 dark:data-[active=true]:text-primary-100",underline:"text-primary-500 hover:text-primary-700 data-[active=true]:text-primary-900 dark:text-primary-400 dark:data-[active=true]:text-primary-100"}},defaultVariants:{intent:"line"}});var ca=qr.createContext(null),Xo=qr.createContext(null);function Wo({type:e="single",defaultValue:t=[],value:r,onValueChange:n,intent:a,size:i,className:o,children:l,...c}){let[m,d]=qr.useState(t),f=r??m,p=qr.useCallback(u=>{let h=g=>g.includes(u)?g.filter(b=>b!==u):e==="single"?[u]:[...g,u];n?n(h(f)):d(h);},[e,f,n]);return jsxRuntime.jsx(ca.Provider,{value:{expandedItems:f,toggleItem:p,size:i},children:jsxRuntime.jsx("div",{className:s(ia({intent:a}),o),...c,children:l})})}function Ap({value:e,className:t,children:r,...n}){let i=qr.useContext(ca)?.expandedItems.includes(e)??false;return jsxRuntime.jsx(Xo.Provider,{value:{value:e,isExpanded:i},children:jsxRuntime.jsx("div",{className:s("",t),...n,children:r})})}function Hp({className:e,children:t,...r}){let n=qr.useContext(ca),a=qr.useContext(Xo);return jsxRuntime.jsxs("button",{className:s("text-primary-800 hover:text-primary-600 dark:text-primary-100 dark:hover:text-primary-300 cursor-pointer gap-2 font-medium transition-colors",aa({size:n?.size}),e),onClick:()=>a&&n?.toggleItem(a.value),"aria-expanded":a?.isExpanded?"true":"false",...r,children:[jsxRuntime.jsx("span",{className:"flex items-center gap-1.5 [&_svg]:shrink-0",children:t}),jsxRuntime.jsx(lucideReact.ChevronDown,{className:s("shrink-0 transition-transform duration-200",a?.isExpanded&&"rotate-180")})]})}function Fp({className:e,children:t,...r}){let n=qr.useContext(ca),a=qr.useContext(Xo);return jsxRuntime.jsx("div",{className:s("grid transition-[grid-template-rows] duration-200 ease-out",a?.isExpanded?"grid-rows-[1fr]":"grid-rows-[0fr]"),children:jsxRuntime.jsx("div",{className:"overflow-hidden",children:jsxRuntime.jsx("div",{className:s("text-primary-500 dark:text-primary-400",oa({size:n?.size}),e),...r,children:t})})})}var on=qr.createContext(null),Zs=qr.createContext(false);function jo({defaultValue:e="",value:t,onValueChange:r,intent:n,children:a,className:i}){let[o,l]=qr.useState(e),c=t??o,m=qr.useRef(new Map),d=qr.useCallback(p=>{r?r(p):l(p);},[r]),f=qr.useCallback((p,u)=>{u?m.current.set(p,u):m.current.delete(p);},[]);return jsxRuntime.jsx(on.Provider,{value:{activeValue:c,setActiveValue:d,intent:n,registerTrigger:f},children:jsxRuntime.jsx("div",{className:i,children:a})})}function Op({className:e,scrollable:t,...r}){let n=qr.useContext(on),a=qr.useRef(null),[i,o]=qr.useState(null),l=qr.useCallback(()=>{if(!n||!a.current)return;let f=a.current.querySelectorAll('[role="tab"][data-active="true"]')[0];if(!f){o(null);return}let p=a.current.getBoundingClientRect(),u=f.getBoundingClientRect();o({left:u.left-p.left,width:u.width});},[n]);qr.useLayoutEffect(l,[n?.activeValue,l]),qr.useEffect(()=>{let d=new ResizeObserver(l);return a.current&&d.observe(a.current),()=>d.disconnect()},[l]);let c=n?.intent??"line",m=i&&(c==="line"||c==="underline");return jsxRuntime.jsxs("div",{ref:a,className:s(sa({intent:n?.intent}),"relative",t&&"overflow-x-auto",e),role:"tablist",...r,children:[r.children,m&&jsxRuntime.jsx("span",{className:"absolute bottom-0 h-0.5 rounded-full bg-primary-600 dark:bg-primary-400 transition-all duration-300 ease-in-out",style:{left:i.left,width:i.width},"aria-hidden":true})]})}function $p({value:e,className:t,children:r,...n}){let a=qr.useContext(on),i=a?.activeValue===e,o=qr.useCallback(l=>a?.registerTrigger(e,l),[a,e]);return jsxRuntime.jsx("button",{ref:o,className:s(la({intent:a?.intent}),t),role:"tab","data-active":i,"aria-selected":i,onClick:()=>a?.setActiveValue(e),...n,children:r})}function Yp({className:e,children:t,...r}){let n=qr.useContext(on);if(!n)return null;let a=qr__default.default.Children.toArray(t).filter(o=>qr__default.default.isValidElement(o)),i=Math.max(0,a.findIndex(o=>o.props.value===n.activeValue));return jsxRuntime.jsx("div",{className:s("overflow-hidden",e),...r,children:jsxRuntime.jsx(Zs.Provider,{value:true,children:jsxRuntime.jsx("div",{className:"flex transition-transform duration-300 ease-in-out",style:{transform:`translateX(-${i*100}%)`},children:a.map((o,l)=>jsxRuntime.jsx("div",{className:"w-full shrink-0","aria-hidden":l!==i,children:o},o.props.value??l))})})})}function Kp({value:e,className:t,children:r,...n}){let a=qr.useContext(on);return qr.useContext(Zs)?jsxRuntime.jsx("div",{className:s("pt-4",t),role:"tabpanel",...n,children:r}):a?.activeValue!==e?null:jsxRuntime.jsx("div",{className:s("pt-4",t),role:"tabpanel",...n,children:r})}var Wp={Accordion:Wo,Tabs:jo},Go=Wp;var sn=classVarianceAuthority.cva("rounded-lg bg-white p-6 shadow-xl dark:bg-primary-900",{variants:{size:{sm:"w-full max-w-sm",md:"w-full max-w-lg",lg:"w-full max-w-2xl",xl:"w-full max-w-4xl",full:"h-[calc(100vh-4rem)] w-[calc(100vw-4rem)]"}},defaultVariants:{size:"md"}}),ma=classVarianceAuthority.cva("absolute z-50 rounded px-2 py-1 text-xs shadow-md animate-fade-in",{variants:{intent:{default:"bg-primary-900 text-white dark:bg-primary-100 dark:text-primary-900",light:"border border-primary-200 bg-white text-primary-700 dark:border-primary-600 dark:bg-primary-800 dark:text-primary-200"}},defaultVariants:{intent:"default"}});var _t=[];function Qp(e){_t.push(e);}function Zp(e){let t=_t.indexOf(e);t!==-1&&_t.splice(t,1);}function qo(e){return _t.length>0&&_t[_t.length-1]===e}function Jp(e){let t=_t.indexOf(e);return t!==-1?t:_t.length}var Qo=qr.createContext(null);function ln({open:e,onOpenChange:t,modal:r=true,closeOnOutsideClick:n=false,children:a}){let i=qr.useId();return qr.useEffect(()=>{if(e)return Qp(i),()=>Zp(i)},[e,i]),qr.useEffect(()=>{if(!e||!r)return;let o=l=>{l.key==="Escape"&&qo(i)&&t(false);};return document.addEventListener("keydown",o),()=>document.removeEventListener("keydown",o)},[e,r,t,i]),qr.useEffect(()=>{if(!e||!r)return;let o=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=o;}},[e,r]),e?jsxRuntime.jsx(Qo.Provider,{value:{id:i,onOpenChange:t,modal:r,closeOnOutsideClick:n},children:reactDom.createPortal(a,document.body)}):null}function Zo({size:e,position:t="center",className:r,children:n,...a}){let i=qr.useContext(Qo);if(!i)return null;let l=200+Jp(i.id)*10,c=()=>{i.closeOnOutsideClick&&qo(i.id)&&i.onOpenChange(false);},m=t==="bottom";return i.modal?jsxRuntime.jsx("div",{className:s("animate-fade-in fixed inset-0 bg-black/50",m?"flex items-end justify-center":"flex items-center justify-center p-4"),style:{zIndex:l},onClick:c,children:jsxRuntime.jsx("div",{className:s(sn({size:e}),m?"animate-slide-in-bottom w-full rounded-b-none rounded-t-(--dialog-sheet-radius) max-h-[85vh] overflow-y-auto":"animate-scale-in",r),role:"dialog","aria-modal":"true",onClick:d=>d.stopPropagation(),...a,children:n})}):jsxRuntime.jsx("div",{className:s("fixed inset-0 flex items-center justify-center p-4",i.closeOnOutsideClick?"pointer-events-auto":"pointer-events-none"),style:{zIndex:l},onClick:i.closeOnOutsideClick&&qo(i.id)?()=>i.onOpenChange(false):void 0,children:jsxRuntime.jsx("div",{className:s(sn({size:e}),"animate-scale-in pointer-events-auto shadow-2xl",r),role:"dialog",onClick:i.closeOnOutsideClick?d=>d.stopPropagation():void 0,...a,children:n})})}function Jo({className:e,...t}){return jsxRuntime.jsx("div",{className:s("mb-4 space-y-1",e),...t})}function ei({className:e,...t}){return jsxRuntime.jsx("h2",{className:s("text-primary-900 dark:text-primary-100 flex items-center gap-1.5 text-lg font-semibold [&_svg]:h-5 [&_svg]:w-5 [&_svg]:shrink-0",e),...t})}function ti({className:e,...t}){return jsxRuntime.jsx("p",{className:s("text-primary-500 dark:text-primary-400 text-sm",e),...t})}function ri({className:e,...t}){return jsxRuntime.jsx("div",{className:s("mt-6 flex justify-end gap-2",e),...t})}function eu({className:e,...t}){let r=qr.useContext(Qo);return jsxRuntime.jsx("button",{className:s("text-primary-400 hover:text-primary-600 dark:hover:text-primary-200 absolute top-4 right-4 rounded-md p-1 transition-colors",e),onClick:()=>r?.onOpenChange(false),"aria-label":"Close",...t,children:jsxRuntime.jsx(lucideReact.X,{className:"h-4 w-4"})})}var tu={top:"bottom-full left-1/2 -translate-x-1/2 mb-2",bottom:"top-full left-1/2 -translate-x-1/2 mt-2",left:"right-full top-1/2 -translate-y-1/2 mr-2",right:"left-full top-1/2 -translate-y-1/2 ml-2"};function ni({content:e,position:t="top",intent:r,delay:n=200,maxWidth:a,children:i,className:o}){let[l,c]=qr.useState(false),[m,d]=qr.useState();return jsxRuntime.jsxs("span",{className:"relative inline-flex",onMouseEnter:()=>{let u=setTimeout(()=>c(true),n);d(u);},onMouseLeave:()=>{clearTimeout(m),c(false);},children:[i,l&&jsxRuntime.jsx("span",{className:s(ma({intent:r}),tu[t],"pointer-events-none",a?"whitespace-normal":"whitespace-nowrap",o),style:a!==void 0?{maxWidth:a}:void 0,role:"tooltip",children:e})]})}var su={right:"drawer-enter-right",left:"drawer-enter-left",top:"drawer-enter-top",bottom:"drawer-enter-bottom"},lu={right:e=>({width:e}),left:e=>({width:e}),top:e=>({height:e}),bottom:e=>({height:e})},cu={right:"right-0 top-0 bottom-0",left:"left-0 top-0 bottom-0",top:"top-0 left-0 right-0",bottom:"bottom-0 left-0 right-0"};function pa({open:e,onOpenChange:t,side:r="right",size:n=r==="top"||r==="bottom"?"50vh":"24rem",backdrop:a=true,closeOnBackdropClick:i=true,children:o,className:l}){let c=qr.useRef(null);return qr.useEffect(()=>{if(!e)return;let m=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=m;}},[e]),qr.useEffect(()=>{if(!e)return;function m(d){d.key==="Escape"&&t(false);}return document.addEventListener("keydown",m),()=>document.removeEventListener("keydown",m)},[e,t]),qr.useEffect(()=>{if(!e)return;let m=c.current;if(!m)return;let d=m.querySelectorAll('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])');d[0]?.focus();function f(p){p.key!=="Tab"||d.length===0||(p.shiftKey?document.activeElement===d[0]&&(p.preventDefault(),d[d.length-1].focus()):document.activeElement===d[d.length-1]&&(p.preventDefault(),d[0].focus()));}return document.addEventListener("keydown",f),()=>document.removeEventListener("keydown",f)},[e]),e?reactDom.createPortal(jsxRuntime.jsxs("div",{className:"fixed inset-0 z-50",role:"presentation",children:[a&&jsxRuntime.jsx("div",{className:"drawer-backdrop absolute inset-0 bg-black/40 backdrop-blur-[2px]",onClick:()=>i&&t(false),"aria-hidden":"true"}),jsxRuntime.jsx("div",{ref:c,role:"dialog","aria-modal":"true",className:s("drawer-panel absolute flex flex-col","bg-white shadow-2xl dark:bg-primary-900",cu[r],su[r],l),style:lu[r](n),children:o})]}),document.body):null}function rl({children:e,className:t}){return jsxRuntime.jsx("div",{className:s("flex shrink-0 items-center justify-between border-b border-primary-100 px-5 py-4 dark:border-primary-800",t),children:e})}function nl({children:e,className:t}){return jsxRuntime.jsx("div",{className:s("flex-1 overflow-y-auto px-5 py-4",t),children:e})}function al({children:e,className:t}){return jsxRuntime.jsx("div",{className:s("flex shrink-0 items-center justify-end gap-3 border-t border-primary-100 px-5 py-4 dark:border-primary-800",t),children:e})}function ol({onClose:e,className:t}){return jsxRuntime.jsx("button",{type:"button",onClick:e,"aria-label":"Close drawer",className:s("rounded-md p-1.5 text-secondary-400 transition-colors","hover:bg-primary-100 hover:text-primary-700 dark:hover:bg-primary-800 dark:hover:text-primary-200","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary-500/30",t),children:jsxRuntime.jsx(lucideReact.X,{className:"h-4 w-4"})})}function il({item:e,depth:t=0,onClose:r}){let[n,a]=qr.useState(false),i=qr.useRef(null),o=qr.useRef(null),l=e.children&&e.children.length>0,c=qr.useRef(null),m=()=>{c.current=setTimeout(()=>a(false),150);},d=()=>{c.current&&clearTimeout(c.current);};return e.separator?jsxRuntime.jsx("li",{role:"separator",className:"my-1 h-px bg-primary-100 dark:bg-primary-700","aria-hidden":true}):jsxRuntime.jsxs("li",{ref:i,role:"menuitem","aria-disabled":e.disabled,"aria-haspopup":l,"aria-expanded":l?n:void 0,className:s("relative flex cursor-pointer select-none items-center gap-2 rounded-md px-3 py-1.5 text-sm outline-none transition-colors",e.disabled?"cursor-not-allowed opacity-40":e.danger?"text-danger-600 hover:bg-danger-50 focus-visible:bg-danger-50 dark:text-danger-400 dark:hover:bg-danger-900/30":"text-primary-700 hover:bg-primary-50 focus-visible:bg-primary-50 dark:text-primary-200 dark:hover:bg-primary-800"),tabIndex:e.disabled?-1:0,onMouseEnter:()=>{d(),l&&a(true);},onMouseLeave:()=>{l&&m();},onClick:f=>{e.disabled||l||(e.onClick?.(f),r());},onKeyDown:f=>{e.disabled||((f.key==="Enter"||f.key===" ")&&(f.preventDefault(),l?a(p=>!p):(e.onClick?.(f),r())),f.key==="Escape"&&r());},children:[e.icon?jsxRuntime.jsx("span",{className:"flex h-4 w-4 shrink-0 items-center justify-center [&_svg]:h-4 [&_svg]:w-4",children:e.icon}):jsxRuntime.jsx("span",{className:"h-4 w-4 shrink-0"}),jsxRuntime.jsx("span",{className:"flex-1",children:e.label}),e.shortcut&&!l&&jsxRuntime.jsx("kbd",{className:"ml-auto rounded bg-primary-100 px-1.5 py-0.5 font-mono text-[0.6rem] text-secondary-500 dark:bg-primary-700 dark:text-secondary-400",children:e.shortcut}),l&&jsxRuntime.jsx(lucideReact.ChevronRight,{className:"ml-auto h-3.5 w-3.5 text-secondary-400"}),l&&n&&jsxRuntime.jsx("ul",{ref:o,role:"menu",onMouseEnter:d,onMouseLeave:m,className:s("absolute top-0 z-50 min-w-[11rem] animate-[fade-in_120ms_ease-out,scale-in_120ms_ease-out] rounded-xl border border-primary-200 bg-white p-1.5 shadow-xl dark:border-primary-700 dark:bg-primary-900",t%2===0?"left-full ml-1":"right-full mr-1"),children:e.children.map(f=>jsxRuntime.jsx(il,{item:f,depth:t+1,onClose:r},f.key))})]})}function pu({items:e,position:t,onClose:r}){let n=qr.useRef(null),[a,i]=qr.useState(t);return qr.useEffect(()=>{let o=n.current;if(!o)return;let l=o.getBoundingClientRect(),c=window.innerWidth,m=window.innerHeight,{x:d,y:f}=t;d+l.width>c-8&&(d=Math.max(8,c-l.width-8)),f+l.height>m-8&&(f=Math.max(8,m-l.height-8)),i({x:d,y:f});},[t]),qr.useEffect(()=>{let o=l=>{n.current&&!n.current.contains(l.target)&&r();};return document.addEventListener("mousedown",o,true),document.addEventListener("touchstart",o,true),document.addEventListener("scroll",r,{passive:true,capture:true}),()=>{document.removeEventListener("mousedown",o,true),document.removeEventListener("touchstart",o,true),document.removeEventListener("scroll",r,true);}},[r]),qr.useEffect(()=>{let o=l=>{l.key==="Escape"&&r(),l.key==="Tab"&&l.preventDefault();};return document.addEventListener("keydown",o),()=>document.removeEventListener("keydown",o)},[r]),jsxRuntime.jsx("ul",{ref:n,role:"menu",style:{position:"fixed",left:a.x,top:a.y},className:"z-[9999] min-w-[12rem] animate-[fade-in_120ms_ease-out,scale-in_120ms_ease-out] rounded-xl border border-primary-200 bg-white p-1.5 shadow-2xl dark:border-primary-700 dark:bg-primary-900",children:e.map(o=>jsxRuntime.jsx(il,{item:o,onClose:r},o.key))})}function ii({items:e,children:t,disabled:r,onOpenChange:n,className:a}){let[i,o]=qr.useState(false),[l,c]=qr.useState({x:0,y:0}),m=qr.useRef(null),d=qr.useCallback((g,b)=>{r||(c({x:g,y:b}),o(true),n?.(true));},[r,n]),f=qr.useCallback(()=>{o(false),n?.(false);},[n]),p=qr.useCallback(g=>{g.preventDefault(),g.stopPropagation(),d(g.clientX,g.clientY);},[d]),u=qr.useCallback(g=>{let b=g.touches[0];m.current=setTimeout(()=>{document.addEventListener("contextmenu",N=>N.preventDefault(),{capture:true,once:true}),d(b.clientX,b.clientY);},500);},[d]),h=qr.useCallback(()=>{m.current&&clearTimeout(m.current);},[]);return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("div",{className:s("contents",a),style:{WebkitTouchCallout:"none",userSelect:"none"},onContextMenu:p,onTouchStart:u,onTouchEnd:h,onTouchMove:h,onTouchCancel:h,children:t}),i&&jsxRuntime.jsx(pu,{items:e,position:l,onClose:f})]})}var fu={Dialog:ln,Tooltip:ni,Drawer:pa,ContextMenu:ii},si=fu;var fa=classVarianceAuthority.cva("relative w-full overflow-hidden rounded-full bg-primary-200 dark:bg-primary-700",{variants:{size:{xs:"h-1",sm:"h-2",md:"h-3",lg:"h-4"},intent:{primary:"[&_.progress-fill]:bg-primary-500",success:"[&_.progress-fill]:bg-success-500",warning:"[&_.progress-fill]:bg-warning-500",danger:"[&_.progress-fill]:bg-danger-500"},edge:{none:"rounded-full",top:"fixed top-0 left-0 right-0 z-50 rounded-none",bottom:"fixed bottom-0 left-0 right-0 z-50 rounded-none"}},defaultVariants:{size:"md",intent:"primary",edge:"none"}}),Tr=classVarianceAuthority.cva("text-primary-500 dark:text-primary-400",{variants:{size:{sm:"text-xs",md:"text-sm",lg:"text-base"}},defaultVariants:{size:"md"}}),pn=classVarianceAuthority.cva("pointer-events-auto flex items-start gap-3 rounded-lg border p-4 shadow-lg transition-all",{variants:{intent:{success:"border-success-200 bg-success-50 text-success-800 dark:border-success-800 dark:bg-success-900/80 dark:text-success-200",warning:"border-warning-200 bg-warning-50 text-warning-800 dark:border-warning-800 dark:bg-warning-900/80 dark:text-warning-200",error:"border-danger-200 bg-danger-50 text-danger-800 dark:border-danger-800 dark:bg-danger-900/80 dark:text-danger-200",info:"border-primary-200 bg-primary-50 text-primary-800 dark:border-primary-800 dark:bg-primary-900/80 dark:text-primary-200"}},defaultVariants:{intent:"info"}}),un=classVarianceAuthority.cva("skeleton-base bg-secondary-200 dark:bg-secondary-700",{variants:{variant:{text:"skeleton-text w-full rounded-sm",circular:"rounded-full",rectangular:"rounded-none",rounded:"rounded-md"},animation:{pulse:"animate-pulse",wave:"skeleton-wave",none:""}},defaultVariants:{variant:"text",animation:"pulse"}}),ga=classVarianceAuthority.cva("border",{variants:{variant:{default:"bg-primary-800 text-primary-50 border-primary-700 dark:bg-primary-100 dark:text-primary-900 dark:border-primary-200",success:"bg-success-500 text-white border-success-600 dark:bg-success-600 dark:border-success-700",danger:"bg-danger-500 text-white border-danger-600 dark:bg-danger-600 dark:border-danger-700",warning:"bg-warning-500 text-warning-900 border-warning-600 dark:bg-warning-600 dark:text-white dark:border-warning-700",info:"bg-primary-500 text-white border-primary-600 dark:bg-primary-600 dark:border-primary-700"}},defaultVariants:{variant:"default"}});function mi({intent:e,className:t,children:r,...n}){return jsxRuntime.jsx("div",{className:s(pn({intent:e}),t),role:"alert",...n,children:r})}function Cu({className:e,...t}){return jsxRuntime.jsx("h5",{className:s("flex items-center gap-1.5 font-semibold [&_svg]:h-4 [&_svg]:w-4 [&_svg]:shrink-0",e),...t})}function Tu({className:e,...t}){return jsxRuntime.jsx("span",{className:s("mt-0.5 shrink-0 [&_svg]:h-5 [&_svg]:w-5",e),...t})}function Mu({className:e,...t}){return jsxRuntime.jsx("div",{className:s("flex-1 min-w-0 space-y-1",e),...t})}function Ru({className:e,...t}){return jsxRuntime.jsx("p",{className:s("text-sm opacity-90",e),...t})}var Su=0,ir=[],ba=new Map,li=new Set;function Pu(){return ir}function ci(){li.forEach(e=>e());}function pi(e){let t=ba.get(e);t&&(clearTimeout(t),ba.delete(e)),ir=ir.map(r=>r.id===e?{...r,exiting:true}:r),ci(),setTimeout(()=>{ir=ir.filter(r=>r.id!==e),ci();},200);}function Du(e){let t=`alert-${++Su}`;ir=[...ir,{...e,id:t}],ci();let r=e.duration??5e3;if(r>0){let n=setTimeout(()=>{ba.delete(t),pi(t);},r);ba.set(t,n);}return t}var di=16;function Lu(e){di=e;}var Eu={"top-right":"right-4 items-end","top-left":"left-4 items-start","bottom-right":"bottom-4 right-4 items-end","bottom-left":"bottom-4 left-4 items-start","top-center":"left-1/2 -translate-x-1/2 items-center","bottom-center":"bottom-4 left-1/2 -translate-x-1/2 items-center"},Vu={"top-right":"animate-slide-in-right","top-left":"animate-slide-in-left","bottom-right":"animate-slide-in-right","bottom-left":"animate-slide-in-left","top-center":"animate-slide-in-top","bottom-center":"animate-slide-in-bottom"},Iu={success:lucideReact.CircleCheck,warning:lucideReact.TriangleAlert,error:lucideReact.CircleX,info:lucideReact.Info};function Au({alert:e,onClose:t}){let r=e.intent??"info",n=Iu[r],a=e.position??"top-right";return jsxRuntime.jsxs("div",{className:s(pn({intent:r}),Vu[a],e.exiting&&"opacity-0 transition-opacity duration-200","w-80 max-w-[calc(100vw-2rem)]"),role:"alert",children:[jsxRuntime.jsx(n,{className:"mt-0.5 h-5 w-5 shrink-0"}),jsxRuntime.jsxs("div",{className:"flex-1",children:[e.title&&jsxRuntime.jsx("p",{className:"font-semibold",children:e.title}),jsxRuntime.jsx("p",{className:s(e.title&&"text-sm opacity-90"),children:e.message})]}),jsxRuntime.jsx("button",{onClick:t,"aria-label":"Close notification",className:"shrink-0 cursor-pointer opacity-50 transition-opacity hover:opacity-100",children:jsxRuntime.jsx(lucideReact.X,{className:"h-4 w-4"})})]})}var Hu=e=>e.startsWith("top");function Fu(){let e=qr.useSyncExternalStore(n=>(li.add(n),()=>li.delete(n)),Pu),t=qr.useRef(di);if(qr.useEffect(()=>{t.current=di;},[]),e.length===0)return null;let r=e.reduce((n,a)=>{let i=a.position??"top-right";return (n[i]??(n[i]=[])).push(a),n},{});return reactDom.createPortal(jsxRuntime.jsx(jsxRuntime.Fragment,{children:Object.entries(r).map(([n,a])=>jsxRuntime.jsx("div",{style:Hu(n)?{top:`${t.current}px`}:void 0,className:s("pointer-events-none fixed z-100 flex flex-col gap-2",Eu[n]),children:a.map(i=>jsxRuntime.jsx(Au,{alert:i,onClose:()=>pi(i.id)},i.id))},n))}),document.body)}var ll=false;function _u(){if(ll)return;ll=true;let e=document.createElement("div");e.id="alert-toast-root",document.body.appendChild(e),client.createRoot(e).render(jsxRuntime.jsx(Fu,{}));}function zu(){return qr.useEffect(()=>{_u();},[]),{addAlert:Du,removeAlert:pi}}function fi({value:e=0,size:t,intent:r,edge:n,showLabel:a=false,indeterminate:i=false,animated:o=false,duration:l=500,className:c,...m}){let d=Math.max(0,Math.min(100,e)),[f,p]=qr.useState(0),u=qr.useRef(0);qr.useEffect(()=>{if(!i)return u.current=requestAnimationFrame(()=>{p(d);}),()=>{u.current&&cancelAnimationFrame(u.current);}},[d,i]);let h=a&&!i&&t!=="xs"&&t!=="sm",g=jsxRuntime.jsx("div",{role:"progressbar","aria-valuenow":i?void 0:d,"aria-valuemin":0,"aria-valuemax":100,className:s(fa({size:t,intent:r,edge:n}),c),...m,children:i?jsxRuntime.jsx("div",{className:"progress-fill absolute top-0 h-full rounded-full animate-progress-indeterminate"}):jsxRuntime.jsx("div",{className:s("progress-fill h-full rounded-full transition-[width] ease-out",o&&"animate-progress-shine"),style:{width:`${f}%`,transitionDuration:`${l}ms`},children:h&&jsxRuntime.jsxs("span",{className:"flex h-full items-center justify-end pr-2 text-[10px] font-semibold text-white",children:[Math.round(d),"%"]})})});return n==="top"||n==="bottom"?reactDom.createPortal(g,document.body):g}function ha({size:e}){let t=e==="sm"?20:e==="lg"?40:28;return jsxRuntime.jsx("svg",{className:"animate-spin-rotate",width:t,height:t,viewBox:"0 0 50 50",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:jsxRuntime.jsx("circle",{className:"animate-spin-dash stroke-current",cx:"25",cy:"25",r:"20",fill:"none",strokeWidth:"4",strokeLinecap:"round",strokeDasharray:"90 150",strokeDashoffset:"0"})})}function bi({spinning:e=true,tip:t,size:r,className:n,children:a,...i}){return a?jsxRuntime.jsxs("div",{className:s("relative w-fit",n),...i,children:[jsxRuntime.jsx("div",{className:s("transition-all duration-200",e&&"pointer-events-none select-none blur-[1px]"),children:a}),e&&jsxRuntime.jsxs("div",{className:"absolute inset-0 z-10 flex flex-col items-center justify-center gap-2 rounded-[inherit] bg-primary-50/60 dark:bg-primary-900/60",children:[jsxRuntime.jsx(ha,{size:r}),t&&jsxRuntime.jsx("span",{className:s(Tr({size:r}),"select-none"),children:t})]})]}):e?jsxRuntime.jsxs("div",{className:s("inline-flex flex-col items-center gap-2",n),...i,children:[jsxRuntime.jsx(ha,{size:r}),t&&jsxRuntime.jsx("span",{className:s(Tr({size:r}),"select-none"),children:t})]}):null}var Gu=0,gn=[],gi=new Set;function Uu(){return gn}function fl(){gi.forEach(e=>e());}function qu(e,t){let r=++Gu;return gn=[...gn,{id:r,target:e,tip:t}],fl(),()=>Qu(r)}function Qu(e){gn=gn.filter(t=>t.id!==e),fl();}function Zu(){return qu}var pl=false;function Ju(){if(pl||typeof document>"u")return;pl=true;let e=document.createElement("div");e.id="jac-spin-portal",document.body.appendChild(e),import('react-dom/client').then(({createRoot:t})=>{t(e).render(jsxRuntime.jsx(n0,{}));});}var ya=new Map;function e0(e){let t=ya.get(e);if(t){t.count++;return}let r=getComputedStyle(e),n=e.style.position;r.position==="static"&&(e.style.position="relative"),ya.set(e,{count:1,original:n});}function t0(e){let t=ya.get(e);t&&(t.count--,t.count<=0&&(e.style.position=t.original,ya.delete(e)));}function r0({entry:e}){return qr.useEffect(()=>{let t=e.target;if(!ul(t))return e0(t),()=>t0(t)},[e.target]),ul(e.target)?reactDom.createPortal(jsxRuntime.jsxs("div",{className:"fixed inset-0 z-50 flex flex-col items-center justify-center gap-3 bg-primary-900/40 dark:bg-primary-900/60",children:[jsxRuntime.jsx(ha,{size:"lg"}),e.tip&&jsxRuntime.jsx("span",{className:"select-none text-sm text-primary-100",children:e.tip})]}),document.body):reactDom.createPortal(jsxRuntime.jsxs("div",{className:"absolute inset-0 z-10 flex flex-col items-center justify-center gap-2 rounded-[inherit] bg-primary-50/60 dark:bg-primary-900/60",children:[jsxRuntime.jsx(ha,{size:"md"}),e.tip&&jsxRuntime.jsx("span",{className:s(Tr({size:"md"}),"select-none"),children:e.tip})]}),e.target)}function n0(){let e=qr.useSyncExternalStore(t=>(gi.add(t),()=>gi.delete(t)),()=>Uu());return e.length===0?null:jsxRuntime.jsx(jsxRuntime.Fragment,{children:e.map(t=>jsxRuntime.jsx(r0,{entry:t},t.id))})}function ul(e){return e===document.documentElement||e===document.body}typeof document<"u"&&Ju();function gl(e){if(e!==void 0)return typeof e=="number"?`${e}px`:e}function xa({variant:e="text",animation:t="pulse",width:r,height:n,lines:a,className:i,style:o,...l}){let c=gl(r),m=gl(n);return e==="text"&&a!==void 0&&a>1?jsxRuntime.jsx("span",{className:s("flex flex-col gap-2",i),"aria-hidden":"true",role:"presentation",style:o,...l,children:Array.from({length:a},(d,f)=>jsxRuntime.jsx("span",{className:un({variant:"text",animation:t}),style:{width:f===a-1?"60%":c??"100%",height:m}},f))}):jsxRuntime.jsx("span",{className:s(un({variant:e,animation:t}),i),"aria-hidden":"true",role:"presentation",style:{width:c,height:m,...o},...l})}var l0=0,bl=320;function hl(e,t){let[r,n]=qr.useState([]),a=qr.useRef(new Map),i=qr.useCallback(d=>{let f=a.current.get(d);f!==void 0&&(clearTimeout(f),a.current.delete(d));},[]),o=qr.useCallback(d=>{i(d),n(f=>f.map(p=>p.id===d?{...p,_exiting:true}:p)),setTimeout(()=>n(f=>f.filter(p=>p.id!==d)),bl);},[i]),l=qr.useCallback(d=>o(d),[o]),c=qr.useCallback(()=>{a.current.forEach(clearTimeout),a.current.clear(),n(d=>d.map(f=>({...f,_exiting:true}))),setTimeout(()=>n([]),bl);},[]),m=qr.useCallback(d=>{let f=`toast-${++l0}`,p=d.position??e,u=d.duration!==void 0?d.duration:t;if(n(h=>[...h,{...d,id:f,position:p,duration:u,_exiting:false}]),u>0){let h=setTimeout(()=>{a.current.delete(f),o(f);},u);a.current.set(f,h);}return f},[e,t,o]);return qr.useEffect(()=>{let d=a.current;return ()=>{d.forEach(clearTimeout),d.clear();}},[]),{items:r,toast:m,dismiss:l,dismissAll:c}}var hn=qr.createContext(null),h0={"top-right":"top-4 right-4 items-end","top-left":"top-4 left-4 items-start","top-center":"top-4 left-1/2 -translate-x-1/2 items-center","bottom-right":"bottom-4 right-4 items-end","bottom-left":"bottom-4 left-4 items-start","bottom-center":"bottom-4 left-1/2 -translate-x-1/2 items-center"},y0={"top-right":"animate-slide-in-right","top-left":"animate-slide-in-left","top-center":"animate-slide-in-top","bottom-right":"animate-slide-in-right","bottom-left":"animate-slide-in-left","bottom-center":"animate-slide-in-bottom"},x0={"top-right":"toast-exit-right","top-left":"toast-exit-left","top-center":"toast-exit-up","bottom-right":"toast-exit-right","bottom-left":"toast-exit-left","bottom-center":"toast-exit-down"},v0={default:lucideReact.Bell,success:lucideReact.CheckCircle2,danger:lucideReact.XCircle,warning:lucideReact.AlertTriangle,info:lucideReact.Info};function w0({item:e,onDismiss:t}){let r=e.variant??"default",n=e.position??"top-right",a=e.dismissible!==false,i=v0[r],o=()=>{e.onDismiss?.(e.id),t(e.id);};return jsxRuntime.jsx("div",{className:s("toast-wrapper",e._exiting&&`toast-wrapper-exiting ${x0[n]}`),children:jsxRuntime.jsxs("div",{role:"status","aria-live":"polite","aria-atomic":"true",className:s(ga({variant:r}),"toast-item pointer-events-auto",!e._exiting&&y0[n]),children:[jsxRuntime.jsx(i,{className:"mt-0.5 h-5 w-5 shrink-0","aria-hidden":"true"}),jsxRuntime.jsxs("div",{className:"flex min-w-0 flex-1 flex-col gap-0.5",children:[e.title&&jsxRuntime.jsx("p",{className:"text-sm font-semibold leading-snug",children:e.title}),e.description&&jsxRuntime.jsx("p",{className:s("text-sm leading-snug",e.title&&"opacity-80"),children:e.description}),e.action&&jsxRuntime.jsx("button",{type:"button",onClick:e.action.onClick,className:"toast-action-btn mt-1 self-start text-xs font-semibold underline underline-offset-2 transition-opacity hover:opacity-80",children:e.action.label})]}),a&&jsxRuntime.jsx("button",{type:"button",onClick:o,"aria-label":"Dismiss notification",className:"shrink-0 cursor-pointer opacity-60 transition-opacity hover:opacity-100",children:jsxRuntime.jsx(lucideReact.X,{className:"h-4 w-4"})})]})})}function va({children:e,defaultPosition:t="top-right",defaultDuration:r=4e3}){let{items:n,toast:a,dismiss:i,dismissAll:o}=hl(t,r),l=n.reduce((c,m)=>{let d=m.position??t;return (c[d]??(c[d]=[])).push(m),c},{});return jsxRuntime.jsxs(hn.Provider,{value:{toast:a,dismiss:i,dismissAll:o},children:[e,typeof document<"u"&&reactDom.createPortal(jsxRuntime.jsx(jsxRuntime.Fragment,{children:Object.entries(l).map(([c,m])=>jsxRuntime.jsx("div",{className:s("pointer-events-none fixed z-[100] flex flex-col gap-2",h0[c]),children:m.map(d=>jsxRuntime.jsx(w0,{item:d,onDismiss:i},d.id))},c))}),document.body)]})}function wa(){let e=qr.useContext(hn);if(!e)throw new Error("useToast must be used within a <ToastProvider>");return e}var C0={Alert:mi,ProgressBar:fi,Spin:bi,Skeleton:xa,ToastProvider:va,useToast:wa},xi=C0;var wl="#1c1914",kl="#130f0b",B0="#2e261e",wi="#504638",Mr="#6b5d4d",Na=`url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.7' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E")`,O0=[{key:"like",icon:jsxRuntime.jsx(lucideReact.Heart,{className:"h-5 w-5"}),activeIcon:jsxRuntime.jsx(lucideReact.Heart,{className:"h-5 w-5",fill:"currentColor"}),label:"Like",toggle:true},{key:"dislike",icon:jsxRuntime.jsx(lucideReact.ThumbsDown,{className:"h-5 w-5"}),label:"Dislike"},{key:"bookmark",icon:jsxRuntime.jsx(lucideReact.Bookmark,{className:"h-5 w-5"}),activeIcon:jsxRuntime.jsx(lucideReact.Bookmark,{className:"h-5 w-5",fill:"currentColor"}),label:"Bookmark",toggle:true},{key:"share",icon:jsxRuntime.jsx(lucideReact.Share2,{className:"h-5 w-5"}),label:"Share"},{key:"download",icon:jsxRuntime.jsx(lucideReact.Download,{className:"h-5 w-5"}),label:"Download"}];function ki({photos:e,layout:t="strip",actions:r=O0,onAction:n,className:a,showGrain:i=true,sheetTitle:o,sheetLabel:l}){let[c,m]=qr.useState(null),[d,f]=qr.useState(new Set),p=qr.useCallback(b=>m(b),[]),u=qr.useCallback(()=>m(null),[]),h=qr.useCallback((b,N)=>{if(r.find(T=>T.key===b)?.toggle){let T=`${N}-${b}`;f(w=>{let C=new Set(w);return C.has(T)?C.delete(T):C.add(T),C});}n?.(b,e[N],N);},[r,n,e]);return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(t==="strip"?$0:t==="sheet"?Y0:K0,{photos:e,onPhotoClick:p,showGrain:i,className:a,sheetTitle:o,sheetLabel:l}),c!==null&&reactDom.createPortal(jsxRuntime.jsx(X0,{photos:e,currentIndex:c,onIndexChange:m,onClose:u,actions:r,activeActions:d,onAction:h,showGrain:i}),document.body)]})}function vl({count:e=30}){return jsxRuntime.jsx("div",{className:"flex shrink-0 items-center justify-between px-3",style:{height:22,background:wl},children:Array.from({length:e}).map((t,r)=>jsxRuntime.jsx("div",{className:"rounded-xs",style:{width:12,height:8,background:B0}},r))})}function $0({photos:e,onPhotoClick:t,showGrain:r,className:n}){let a=qr.useRef(null);return jsxRuntime.jsxs("div",{className:s("select-none rounded-lg overflow-hidden",n),style:{background:kl},children:[jsxRuntime.jsx(vl,{count:Math.max(30,e.length*6)}),jsxRuntime.jsx("div",{ref:a,className:"flex gap-1 overflow-x-auto scroll-smooth px-1 py-1",style:{background:wl,scrollSnapType:"x mandatory"},children:e.map((i,o)=>jsxRuntime.jsxs("div",{className:"group relative shrink-0 cursor-pointer",style:{scrollSnapAlign:"center"},onClick:()=>t(o),children:[jsxRuntime.jsxs("div",{className:"overflow-hidden rounded-xs border",style:{borderColor:wi,width:280,height:187},children:[jsxRuntime.jsx("img",{src:i.src,alt:i.alt??i.title??"",className:"h-full w-full object-cover transition-transform duration-700 ease-out group-hover:scale-110",draggable:false}),jsxRuntime.jsx("div",{className:"pointer-events-none absolute inset-0 mix-blend-multiply opacity-0 transition-opacity duration-300 group-hover:opacity-100",style:{background:"rgba(255, 175, 60, 0.06)"}}),r&&jsxRuntime.jsx("div",{className:"pointer-events-none absolute inset-0 opacity-0 transition-opacity duration-300 group-hover:opacity-[0.06]",style:{backgroundImage:Na,animation:"film-grain-shift 0.6s steps(5) infinite"}}),jsxRuntime.jsx("div",{className:"pointer-events-none absolute inset-0 opacity-30 transition-opacity duration-300 group-hover:opacity-50",style:{background:"radial-gradient(ellipse at center, transparent 50%, rgba(0,0,0,0.5) 100%)"}})]}),jsxRuntime.jsxs("div",{className:"mt-0.5 text-center font-mono text-[9px] tracking-widest",style:{color:Mr},children:[String(o+1).padStart(2,"0"),o%2===0?"":"A"]})]},o))}),jsxRuntime.jsx(vl,{count:Math.max(30,e.length*6)})]})}function Y0({photos:e,onPhotoClick:t,showGrain:r,className:n,sheetTitle:a,sheetLabel:i}){return jsxRuntime.jsxs("div",{className:s("rounded-lg p-5",n),style:{background:kl},children:[jsxRuntime.jsxs("div",{className:"mb-4 flex items-center justify-between",children:[jsxRuntime.jsx("span",{className:"font-mono text-[10px] uppercase tracking-[0.25em]",style:{color:Mr},children:a??`JAC\xB7Film 35mm \xB7 ${e.length} exposures`}),jsxRuntime.jsx("span",{className:"font-mono text-[10px] uppercase tracking-[0.25em]",style:{color:Mr},children:i??"Contact Sheet"})]}),jsxRuntime.jsx("div",{className:"grid grid-cols-3 gap-2 sm:grid-cols-4 md:grid-cols-5 lg:grid-cols-6",children:e.map((o,l)=>jsxRuntime.jsxs("div",{className:"group cursor-pointer",style:{animation:`reveal-up 0.4s ease-out ${l*50}ms both`},onClick:()=>t(l),children:[jsxRuntime.jsx("div",{className:"mb-0.5 font-mono text-[9px] tracking-wider",style:{color:Mr},children:String(l+1).padStart(2,"0")}),jsxRuntime.jsxs("div",{className:"relative overflow-hidden rounded-[1px] border transition-all duration-300 group-hover:border-amber-600/50 group-hover:shadow-[0_0_20px_rgba(217,171,89,0.15)]",style:{borderColor:wi,aspectRatio:"3/2"},children:[jsxRuntime.jsx("img",{src:o.src,alt:o.alt??"",className:"h-full w-full object-cover transition-transform duration-500 group-hover:scale-105",draggable:false}),r&&jsxRuntime.jsx("div",{className:"pointer-events-none absolute inset-0 opacity-[0.04]",style:{backgroundImage:Na}}),jsxRuntime.jsx("div",{className:"pointer-events-none absolute inset-x-0 bottom-0 translate-y-full bg-linear-to-t from-black/70 to-transparent p-2 pt-6 transition-transform duration-300 group-hover:translate-y-0",children:jsxRuntime.jsx("span",{className:"text-xs font-medium text-white/90",children:o.title})})]})]},l))})]})}function K0({photos:e,onPhotoClick:t,showGrain:r,className:n}){let[a,i]=qr.useState(false),[o,l]=qr.useState(null),c=Math.min(e.length,8),m=e.slice(0,c),d=p=>{let u=Math.sin(p*137.508+1)*1e4,h=(u%12-6).toFixed(1),g=(u/7%8-4).toFixed(1),b=(u/13%6-3).toFixed(1);return `rotate(${h}deg) translate(${g}px, ${b}px)`},f=(p,u)=>{let h=(u-1)/2,g=((p-h)*7).toFixed(1),b=((p-h)*110).toFixed(0),N=(-Math.abs(p-h)*10+(o===p?-18:0)).toFixed(0);return `translateX(${b}px) translateY(${N}px) rotate(${g}deg)`};return jsxRuntime.jsxs("div",{className:s("flex flex-col items-center gap-4",n),children:[jsxRuntime.jsx("div",{className:"relative flex h-85 w-full items-center justify-center",onMouseEnter:()=>i(true),onMouseLeave:()=>{i(false),l(null);},children:m.map((p,u)=>jsxRuntime.jsx("div",{className:"absolute cursor-pointer rounded-lg shadow-xl transition-all duration-500",style:{transitionTimingFunction:"cubic-bezier(0.34, 1.56, 0.64, 1)",transitionDelay:a?`${u*35}ms`:`${(c-u)*25}ms`,transform:a?f(u,m.length):d(u),zIndex:a?u+1:m.length-u,width:220,height:147},onClick:()=>t(u),onMouseEnter:()=>a&&l(u),onMouseLeave:()=>l(null),children:jsxRuntime.jsxs("div",{className:"relative h-full w-full overflow-hidden rounded-lg border transition-shadow duration-300",style:{borderColor:a&&o===u?"rgba(217,171,89,0.5)":wi,boxShadow:a&&o===u?"0 25px 50px rgba(0,0,0,0.5), 0 0 30px rgba(217,171,89,0.1)":"0 10px 30px rgba(0,0,0,0.4)"},children:[jsxRuntime.jsx("img",{src:p.src,alt:p.alt??"",className:"h-full w-full object-cover",draggable:false}),r&&jsxRuntime.jsx("div",{className:"pointer-events-none absolute inset-0 opacity-[0.04]",style:{backgroundImage:Na}}),jsxRuntime.jsx("div",{className:"pointer-events-none absolute inset-0",style:{background:"radial-gradient(ellipse at center, transparent 40%, rgba(0,0,0,0.35) 100%)"}}),a&&o===u&&jsxRuntime.jsx("div",{className:"absolute inset-x-0 bottom-0 bg-linear-to-t from-black/80 to-transparent p-3 pt-8",style:{animation:"reveal-up 0.25s ease-out"},children:jsxRuntime.jsx("span",{className:"text-sm font-medium text-white/90",children:p.title})})]})},u))}),e.length>c&&jsxRuntime.jsxs("span",{className:"font-mono text-xs",style:{color:Mr},children:["+ ",e.length-c," more"]}),jsxRuntime.jsx("span",{className:"font-mono text-[10px] uppercase tracking-[0.3em] transition-opacity duration-300",style:{color:Mr,opacity:a?0:.7},children:"Hover to explore"})]})}function X0({photos:e,currentIndex:t,onIndexChange:r,onClose:n,actions:a,activeActions:i,onAction:o,showGrain:l}){let c=e[t],[m,d]=qr.useState(1),[f,p]=qr.useState({x:0,y:0}),[u,h]=qr.useState(false),[g,b]=qr.useState(false),N=qr.useRef(false),x=qr.useRef({x:0,y:0}),T=qr.useRef(null);qr.useLayoutEffect(()=>{requestAnimationFrame(()=>b(true));},[]),qr.useEffect(()=>{let v=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=v;}},[]),qr.useEffect(()=>{let v=U=>{switch(U.key){case "Escape":n();break;case "ArrowLeft":w(-1);break;case "ArrowRight":w(1);break;case "i":case "I":h(k=>!k);break}};return document.addEventListener("keydown",v),()=>document.removeEventListener("keydown",v)}),qr.useEffect(()=>{let v=T.current;if(!v)return;let U=k=>{k.preventDefault();let q=k.deltaY<0?1.12:.89;d(M=>{let W=Math.min(8,Math.max(1,M*q));return W<=1&&p({x:0,y:0}),W});};return v.addEventListener("wheel",U,{passive:false}),()=>v.removeEventListener("wheel",U)},[]);let w=qr.useCallback(v=>{let U=t+v;U>=0&&U<e.length&&(r(U),d(1),p({x:0,y:0}));},[t,e.length,r]),C=qr.useCallback(v=>{m<=1||(N.current=true,x.current={x:v.clientX,y:v.clientY},v.target.setPointerCapture(v.pointerId));},[m]),S=qr.useCallback(v=>{if(!N.current)return;let U=v.clientX-x.current.x,k=v.clientY-x.current.y;x.current={x:v.clientX,y:v.clientY},p(q=>({x:q.x+U/m,y:q.y+k/m}));},[m]),R=qr.useCallback(()=>{N.current=false;},[]),V=qr.useCallback(()=>{m>1?(d(1),p({x:0,y:0})):d(2.5);},[m]),I=v=>i.has(`${t}-${v}`),E=c.metadata;return jsxRuntime.jsxs("div",{className:"fixed inset-0 z-200 flex flex-col",style:{animation:"lightbox-backdrop-in 0.35s ease-out"},children:[jsxRuntime.jsx("div",{className:"absolute inset-0 bg-black/95",onClick:n}),l&&jsxRuntime.jsx("div",{className:"pointer-events-none absolute inset-0 opacity-[0.025]",style:{backgroundImage:Na,animation:"film-grain-shift 0.6s steps(5) infinite"}}),jsxRuntime.jsxs("div",{className:"relative z-10 flex h-12 shrink-0 items-center justify-between px-4",children:[jsxRuntime.jsxs("span",{className:"font-mono text-sm text-white/50",children:[t+1," / ",e.length]}),jsxRuntime.jsxs("div",{className:"flex items-center gap-1",children:[jsxRuntime.jsxs("span",{className:"mr-2 font-mono text-xs text-white/40",children:[m.toFixed(1),"x"]}),jsxRuntime.jsx("button",{className:"rounded-full p-2 text-white/60 transition-colors hover:bg-white/10 hover:text-white",onClick:()=>d(v=>Math.min(8,v*1.3)),title:"Zoom in",children:jsxRuntime.jsx(lucideReact.ZoomIn,{className:"h-4 w-4"})}),jsxRuntime.jsx("button",{className:"rounded-full p-2 text-white/60 transition-colors hover:bg-white/10 hover:text-white",onClick:()=>{d(v=>{let U=Math.max(1,v*.7);return U<=1&&p({x:0,y:0}),U});},title:"Zoom out",children:jsxRuntime.jsx(lucideReact.ZoomOut,{className:"h-4 w-4"})}),jsxRuntime.jsx("button",{className:"rounded-full p-2 text-white/60 transition-colors hover:bg-white/10 hover:text-white",onClick:n,title:"Close",children:jsxRuntime.jsx(lucideReact.X,{className:"h-5 w-5"})})]})]}),jsxRuntime.jsxs("div",{ref:T,className:"relative flex flex-1 items-center justify-center overflow-hidden",style:{cursor:m>1?"grab":"default"},onPointerDown:C,onPointerMove:S,onPointerUp:R,onDoubleClick:V,children:[jsxRuntime.jsx("img",{src:c.src,alt:c.alt??c.title??"",className:"max-h-full max-w-full select-none object-contain",style:{animation:"lightbox-photo-in 0.35s cubic-bezier(0.16, 1, 0.3, 1)",transform:`scale(${m}) translate(${f.x}px, ${f.y}px)`,transition:N.current?"none":"transform 0.15s ease-out"},draggable:false},t),t>0&&jsxRuntime.jsx("button",{className:"absolute left-3 top-1/2 -translate-y-1/2 rounded-full bg-black/40 p-2.5 text-white/70 backdrop-blur-sm transition-all hover:bg-black/60 hover:text-white",onClick:v=>{v.stopPropagation(),w(-1);},children:jsxRuntime.jsx(lucideReact.ChevronLeft,{className:"h-6 w-6"})}),t<e.length-1&&jsxRuntime.jsx("button",{className:"absolute right-3 top-1/2 -translate-y-1/2 rounded-full bg-black/40 p-2.5 text-white/70 backdrop-blur-sm transition-all hover:bg-black/60 hover:text-white",onClick:v=>{v.stopPropagation(),w(1);},children:jsxRuntime.jsx(lucideReact.ChevronRight,{className:"h-6 w-6"})})]}),jsxRuntime.jsx("div",{className:s("absolute inset-x-0 bottom-0 z-20 transition-all duration-400",u?"translate-y-0 opacity-100":"pointer-events-none translate-y-full opacity-0"),children:jsxRuntime.jsxs("div",{className:"bg-linear-to-t from-black/90 via-black/75 to-transparent px-6 pb-24 pt-16",children:[c.title&&jsxRuntime.jsx("h3",{className:"mb-3 text-xl font-semibold text-white",children:c.title}),c.description&&jsxRuntime.jsx("p",{className:"mb-4 max-w-xl border-l-2 border-amber-500/40 pl-4 text-sm leading-relaxed text-white/60 italic",style:{animation:"reveal-up 0.4s ease-out 0.1s both"},children:c.description}),E&&jsxRuntime.jsxs("div",{className:"flex flex-wrap gap-x-6 gap-y-2 text-sm text-white/70",children:[E.camera&&jsxRuntime.jsxs("span",{className:"flex items-center gap-1.5",children:[jsxRuntime.jsx(lucideReact.Camera,{className:"h-3.5 w-3.5 text-amber-400/80"})," ",E.camera,E.lens&&jsxRuntime.jsx("span",{className:"text-white/40",children:"\xB7"}),E.lens&&E.lens]}),(E.aperture||E.shutter||E.iso)&&jsxRuntime.jsxs("span",{className:"flex items-center gap-1.5",children:[jsxRuntime.jsx(lucideReact.Aperture,{className:"h-3.5 w-3.5 text-amber-400/80"}),[E.aperture,E.shutter,E.iso&&`ISO ${E.iso}`].filter(Boolean).join(" \xB7 ")]}),E.date&&jsxRuntime.jsxs("span",{className:"flex items-center gap-1.5",children:[jsxRuntime.jsx(lucideReact.Calendar,{className:"h-3.5 w-3.5 text-amber-400/80"})," ",E.date]}),E.location&&jsxRuntime.jsxs("span",{className:"flex items-center gap-1.5",children:[jsxRuntime.jsx(lucideReact.MapPin,{className:"h-3.5 w-3.5 text-amber-400/80"})," ",E.location]})]})]})}),jsxRuntime.jsx("div",{className:"relative z-20 flex h-16 shrink-0 items-center justify-center gap-1",children:jsxRuntime.jsxs("div",{className:"flex items-center gap-0.5 rounded-full bg-white/6 px-2 py-1.5 backdrop-blur-xl",children:[a.map(v=>{let U=v.toggle&&I(v.key);return jsxRuntime.jsx("button",{className:s("rounded-full p-2.5 transition-all duration-200",U?"text-amber-400 hover:text-amber-300":"text-white/60 hover:bg-white/10 hover:text-white"),onClick:()=>o(v.key,t),title:v.label,children:U&&v.activeIcon?v.activeIcon:v.icon},v.key)}),jsxRuntime.jsx("div",{className:"mx-1 h-5 w-px bg-white/10"}),jsxRuntime.jsx("button",{className:s("rounded-full p-2.5 transition-all duration-200",u?"text-amber-400 hover:text-amber-300":"text-white/60 hover:bg-white/10 hover:text-white"),onClick:()=>h(v=>!v),title:"Photo info (I)",children:jsxRuntime.jsx(lucideReact.Info,{className:"h-5 w-5"})})]})})]})}var Ni="data:image/svg+xml,"+encodeURIComponent(`<svg xmlns="http://www.w3.org/2000/svg" width="200" height="200" viewBox="0 0 200 200">
3
3
  <rect width="200" height="200" fill="#1e1b2e"/>
4
4
  <circle cx="100" cy="100" r="60" fill="none" stroke="#6366f1" stroke-width="1.5" opacity="0.3"/>
5
5
  <circle cx="100" cy="100" r="20" fill="none" stroke="#6366f1" stroke-width="1" opacity="0.4"/>
6
6
  <text x="100" y="108" text-anchor="middle" font-family="monospace" font-size="18" fill="#6366f1" opacity="0.6">\u266A</text>
7
- </svg>`);function dl(e){if(!isFinite(e)||e<0)return "0:00";let t=Math.floor(e/60),r=Math.floor(e%60);return `${t}:${r.toString().padStart(2,"0")}`}function M0(e){return e.startsWith("bottom")?"bottom":e.startsWith("top")?"top":"right"}var P0={"bottom-right":"bottom-4 right-4","bottom-left":"bottom-4 left-4","top-right":"top-4 right-4","top-left":"top-4 left-4"},S0={"bottom-right":"bottom-4 right-0","bottom-left":"bottom-4 left-0","top-right":"top-4 right-0","top-left":"top-4 left-0"},L0={"bottom-right":"bottom-8 right-0 w-1.5 h-16 rounded-l-full","bottom-left":"bottom-8 left-0 w-1.5 h-16 rounded-r-full","top-right":"top-8 right-0 w-1.5 h-16 rounded-l-full","top-left":"top-8 left-0 w-1.5 h-16 rounded-r-full"};function ms({playlist:e,initialTrack:t=0,position:r="bottom-right",entrance:n,theme:o,docked:s=false,visible:a,onVisibleChange:l,onTrackChange:d,onLike:m,autoPlay:c=true,shuffle:f=false,loop:p=false,accent:u="#8b5cf6",className:h}){let [g,x]=Kr.useState(t),[w,y]=Kr.useState(false),[M,v]=Kr.useState(0),[N,L]=Kr.useState(0),[R,D]=Kr.useState(.8),[A,V]=Kr.useState(false),[k,O]=Kr.useState(new Set),[C,X]=Kr.useState(false),[T,re]=Kr.useState(a??!s),[_,de]=Kr.useState(false),[J,pe]=Kr.useState(false),[fe,$]=Kr.useState(f),[U,me]=Kr.useState(p),j=Kr.useRef(false),b=Kr.useRef(null),I=Kr.useRef(null),W=Kr.useRef(void 0),K=Kr.useRef(null),B=Kr.useRef(null),Q=a??T,ve=n??M0(r),P=e[g],ae=s,he=o==="dark"?"dark":o==="light"?"light":"",ge="bg-(--mp-bg)",Me="text-(--mp-text)",ke="text-(--mp-text-muted)",F="text-(--accent)",ee="border-(--mp-border)";Kr.useEffect(()=>{let H=b.current;H&&(H.src=P.src,H.load(),w&&H.play().catch(()=>{}));},[g,P.src]),Kr.useEffect(()=>{if(!c||j.current)return;let H=b.current;if(!H)return;let be=()=>{j.current=true,y(true),H.play().catch(()=>{});};return H.addEventListener("canplaythrough",be,{once:true}),()=>H.removeEventListener("canplaythrough",be)},[c]),Kr.useEffect(()=>{let H=b.current;H&&(w?H.play().catch(()=>{}):H.pause());},[w]),Kr.useEffect(()=>{let H=b.current;H&&(H.muted=A,B.current?B.current.gain.value=A?0:R:H.volume=R);},[R,A]),Kr.useEffect(()=>{let H=b.current;if(!H)return;let be=()=>v(H.currentTime),Fe=()=>L(H.duration),lt=()=>{U?(H.currentTime=0,H.play().catch(()=>{})):q();};return H.addEventListener("timeupdate",be),H.addEventListener("loadedmetadata",Fe),H.addEventListener("ended",lt),()=>{H.removeEventListener("timeupdate",be),H.removeEventListener("loadedmetadata",Fe),H.removeEventListener("ended",lt);}},[g,e.length]);let z=Kr.useCallback(H=>{let be=(H%e.length+e.length)%e.length;x(be),v(0),d?.(be,e[be]),Q||(re(true),l?.(true));},[e,Q,d,l]),q=Kr.useCallback(()=>{if(fe){let H;do H=Math.floor(Math.random()*e.length);while(H===g&&e.length>1);z(H);}else z(g+1);},[z,g,fe,e.length]),xe=Kr.useCallback(()=>{if(fe){let H;do H=Math.floor(Math.random()*e.length);while(H===g&&e.length>1);z(H);}else z(g-1);},[z,g,fe,e.length]),Ae=Kr.useCallback(()=>{let H=k.has(g);O(be=>{let Fe=new Set(be);return H?Fe.delete(g):Fe.add(g),Fe}),m?.(g,P,!H);},[g,k,m,P]),He=Kr.useCallback(H=>{let be=H.currentTarget.getBoundingClientRect(),lt=Math.max(0,Math.min(1,(H.clientX-be.left)/be.width))*N;b.current&&(b.current.currentTime=lt),v(lt);},[N]),G=Kr.useCallback(()=>{de(true);let H=ae?200:400;W.current=setTimeout(()=>{de(false),re(false),l?.(false);},H);},[ae,l]);Kr.useEffect(()=>()=>{W.current&&clearTimeout(W.current);},[]),Kr.useEffect(()=>()=>{K.current?.close();},[]);function ye(){if(K.current||!b.current){K.current?.resume();return}try{let H=window.AudioContext??window.webkitAudioContext;if(!H)return;let be=new H,Fe=be.createGain();Fe.gain.value=A?0:R,be.createMediaElementSource(b.current).connect(Fe).connect(be.destination),K.current=be,B.current=Fe,be.resume();}catch{}}let E=J?"fade-in 0.2s ease-out both":`mp-enter-${ve} 0.45s cubic-bezier(0.16, 1, 0.3, 1) both`,Z=J?"fade-in 0.2s ease-in reverse both":`mp-exit-${ve} 0.4s cubic-bezier(0.7, 0, 0.84, 0) both`,ne=N>0?M/N*100:0;return ae&&!Q&&!_?jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("audio",{ref:b,preload:"metadata",crossOrigin:"anonymous"}),jsxRuntime.jsxs("div",{className:i("fixed z-100 cursor-pointer transition-all duration-300",L0[r]),style:{"--accent":u},onMouseEnter:()=>{pe(true),re(true),l?.(true);},children:[jsxRuntime.jsx("div",{className:i("h-full w-full rounded-full",w?"bg-(--accent)":"bg-(--mp-dock-strip)"),style:w?{animation:"mp-progress-glow 2s ease-in-out infinite",boxShadow:"0 0 12px color-mix(in srgb, var(--accent) 50%, transparent)"}:void 0}),w&&jsxRuntime.jsx("div",{className:"absolute inset-0 rounded-full bg-(--accent)/30",style:{animation:"mp-pulse-ring 2s ease-out infinite"}})]})]}):!Q&&!_?jsxRuntime.jsx("audio",{ref:b,preload:"metadata",crossOrigin:"anonymous"}):jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("audio",{ref:b,preload:"metadata",crossOrigin:"anonymous"}),jsxRuntime.jsx("div",{className:i("fixed z-100",ae?S0[r]:P0[r],he),style:{"--accent":u,..._?{animation:Z}:{animation:E}},onMouseEnter:()=>{ae&&(W.current&&(clearTimeout(W.current),W.current=void 0),_&&de(false),pe(true));},onMouseLeave:()=>{ae&&(pe(false),G());},children:jsxRuntime.jsxs("div",{className:i("w-[320px] overflow-hidden rounded-2xl border shadow-2xl backdrop-blur-xl",ge,ee,ae&&"rounded-none",r.endsWith("right")&&ae&&"rounded-l-2xl",r.endsWith("left")&&ae&&"rounded-r-2xl",h),children:[jsxRuntime.jsxs("div",{className:"relative",children:[jsxRuntime.jsx("div",{className:"absolute inset-0 overflow-hidden",children:jsxRuntime.jsx("img",{src:P.cover||ds,alt:"",className:"h-full w-full scale-110 object-cover opacity-30 blur-2xl",draggable:false})}),jsxRuntime.jsxs("div",{className:"relative flex items-center gap-3.5 p-4 pb-3",children:[jsxRuntime.jsxs("div",{className:"relative h-14 w-14 shrink-0",children:[jsxRuntime.jsxs("div",{className:"h-14 w-14 overflow-hidden rounded-full border-2 border-white/10 shadow-lg",style:w?{animation:"mp-vinyl-spin 4s linear infinite"}:void 0,children:[jsxRuntime.jsx("img",{src:P.cover||ds,alt:P.album??P.title,className:"h-full w-full object-cover",draggable:false}),jsxRuntime.jsx("div",{className:"absolute inset-0 flex items-center justify-center",children:jsxRuntime.jsx("div",{className:"h-3 w-3 rounded-full bg-black/60 ring-1 ring-white/10"})})]}),w&&jsxRuntime.jsx("div",{className:"absolute inset-0 rounded-full bg-(--accent)/20",style:{animation:"mp-pulse-ring 2.5s ease-out infinite"}})]}),jsxRuntime.jsxs("div",{className:"min-w-0 flex-1",children:[jsxRuntime.jsx("div",{className:i("truncate text-sm font-semibold",Me),children:P.title}),P.artist&&jsxRuntime.jsx("div",{className:i("truncate text-xs",ke),children:P.artist}),P.album&&jsxRuntime.jsx("div",{className:i("mt-0.5 truncate text-[10px] tracking-wide",ke,"opacity-60"),children:P.album})]}),jsxRuntime.jsxs("div",{className:"flex shrink-0 items-center gap-0.5",children:[jsxRuntime.jsx("button",{className:i("rounded-full p-1.5 transition-all duration-200",k.has(g)?"text-rose-500 hover:text-rose-400":i(ke,"hover:text-rose-500")),onClick:Ae,title:"Like",children:jsxRuntime.jsx(lucideReact.Heart,{className:"h-4 w-4",fill:k.has(g)?"currentColor":"none"})}),jsxRuntime.jsx("button",{className:i("rounded-full p-1.5 transition-colors",ke,"hover:"+Me.split(" ")[0]),onClick:()=>X(H=>!H),title:"Playlist",children:jsxRuntime.jsx(lucideReact.ListMusic,{className:"h-4 w-4"})}),!ae&&jsxRuntime.jsx("button",{className:i("rounded-full p-1.5 transition-colors",ke,"hover:"+Me.split(" ")[0]),onClick:G,title:"Dismiss",children:jsxRuntime.jsx(lucideReact.X,{className:"h-3.5 w-3.5"})})]})]})]}),jsxRuntime.jsxs("div",{className:"px-4",children:[jsxRuntime.jsxs("div",{ref:I,className:"group relative h-1.5 cursor-pointer rounded-full bg-(--mp-surface)",onClick:He,children:[jsxRuntime.jsx("div",{className:"h-full rounded-full bg-(--accent) transition-[width] duration-150",style:{width:`${ne}%`}}),jsxRuntime.jsx("div",{className:"absolute top-1/2 h-3 w-3 -translate-y-1/2 rounded-full bg-(--accent) opacity-0 shadow-md transition-opacity group-hover:opacity-100",style:{left:`calc(${ne}% - 6px)`}})]}),jsxRuntime.jsxs("div",{className:i("mt-1 flex justify-between text-[10px] font-mono",ke),children:[jsxRuntime.jsx("span",{children:dl(M)}),jsxRuntime.jsx("span",{children:dl(N)})]})]}),jsxRuntime.jsxs("div",{className:"flex items-center justify-center gap-2 px-4 pb-3 pt-1",children:[jsxRuntime.jsx("button",{className:i("rounded-full p-1.5 transition-colors",fe?F:ke,"hover:text-(--mp-text)"),onClick:()=>$(H=>!H),title:fe?"Shuffle On":"Shuffle Off",children:jsxRuntime.jsx(lucideReact.Shuffle,{className:"h-3.5 w-3.5"})}),jsxRuntime.jsx("button",{className:i("rounded-full p-1.5 transition-colors",U?F:ke,"hover:text-(--mp-text)"),onClick:()=>me(H=>!H),title:U?"Loop On":"Loop Off",children:jsxRuntime.jsx(lucideReact.Repeat1,{className:"h-3.5 w-3.5"})}),jsxRuntime.jsx("button",{className:i("rounded-full p-2 transition-colors",ke,"hover:text-(--mp-text)"),onClick:xe,title:"Previous",children:jsxRuntime.jsx(lucideReact.SkipBack,{className:"h-4 w-4",fill:"currentColor"})}),jsxRuntime.jsx("button",{className:i("flex h-10 w-10 items-center justify-center rounded-full transition-all duration-200","bg-(--accent) text-white shadow-lg active:scale-95"),style:{boxShadow:"0 6px 20px color-mix(in srgb, var(--accent) 35%, transparent)"},onClick:()=>{ye(),y(H=>!H);},title:w?"Pause":"Play",children:w?jsxRuntime.jsx(lucideReact.Pause,{className:"h-4.5 w-4.5",fill:"currentColor"}):jsxRuntime.jsx(lucideReact.Play,{className:"h-4.5 w-4.5 translate-x-px",fill:"currentColor"})}),jsxRuntime.jsx("button",{className:i("rounded-full p-2 transition-colors",ke,"hover:text-(--mp-text)"),onClick:q,title:"Next",children:jsxRuntime.jsx(lucideReact.SkipForward,{className:"h-4 w-4",fill:"currentColor"})}),jsxRuntime.jsxs("div",{className:"ml-2 flex items-center gap-1.5",children:[jsxRuntime.jsx("button",{className:i("rounded-full p-1 transition-colors",ke,"hover:text-(--mp-text)"),onClick:()=>{ye();let H=!A;V(H),B.current&&(B.current.gain.value=H?0:R);},title:A?"Unmute":"Mute",children:A||R===0?jsxRuntime.jsx(lucideReact.VolumeX,{className:"h-3.5 w-3.5"}):jsxRuntime.jsx(lucideReact.Volume2,{className:"h-3.5 w-3.5"})}),jsxRuntime.jsx("input",{type:"range",min:0,max:1,step:.01,value:A?0:R,onChange:H=>{ye();let be=Number(H.target.value);D(be),A&&V(false),B.current&&(B.current.gain.value=be);},className:"mp-volume-slider h-1 w-14 cursor-pointer appearance-none rounded-full bg-(--mp-surface) accent-(--accent)"})]})]}),jsxRuntime.jsx("div",{className:i("overflow-hidden transition-all duration-300 ease-in-out",C?"max-h-60":"max-h-0"),children:jsxRuntime.jsx("div",{className:i("border-t px-2 py-2",ee),children:jsxRuntime.jsx("div",{className:"max-h-52 space-y-0.5 overflow-y-auto",children:e.map((H,be)=>{let Fe=be===g;return jsxRuntime.jsxs("button",{className:i("flex w-full items-center gap-2.5 rounded-lg px-2.5 py-2 text-left transition-all duration-200",Fe?"bg-(--accent)/10 dark:bg-(--accent)/15":"hover:bg-(--mp-surface-hover)"),onClick:()=>{z(be),y(true);},children:[jsxRuntime.jsx("div",{className:"flex h-8 w-8 shrink-0 items-center justify-center",children:Fe&&w?jsxRuntime.jsx("div",{className:"flex items-end gap-0.5",children:[1,2,3].map(lt=>jsxRuntime.jsx("div",{className:"w-0.75 rounded-full bg-(--accent)",style:{height:`${8+lt*4}px`,animation:`mp-eq-bar ${.4+lt*.15}s ease-in-out infinite alternate`}},lt))}):Fe?jsxRuntime.jsx(lucideReact.Disc3,{className:i("h-4 w-4",F)}):jsxRuntime.jsx("span",{className:i("text-xs font-mono",ke),children:be+1})}),jsxRuntime.jsx("div",{className:"h-8 w-8 shrink-0 overflow-hidden rounded",children:jsxRuntime.jsx("img",{src:H.cover||ds,alt:"",className:"h-full w-full object-cover",draggable:false})}),jsxRuntime.jsxs("div",{className:"min-w-0 flex-1",children:[jsxRuntime.jsx("div",{className:i("truncate text-xs font-medium",Fe?F:Me),children:H.title}),H.artist&&jsxRuntime.jsx("div",{className:i("truncate text-[10px]",ke),children:H.artist})]}),k.has(be)&&jsxRuntime.jsx(lucideReact.Heart,{className:"h-3 w-3 shrink-0 text-rose-500",fill:"currentColor"})]},be)})})})})]})})]})}function go(e){if(!isFinite(e)||e<0)return "0:00";let t=Math.floor(e/3600),r=Math.floor(e%3600/60),n=Math.floor(e%60);return t>0?`${t}:${r.toString().padStart(2,"0")}:${n.toString().padStart(2,"0")}`:`${r}:${n.toString().padStart(2,"0")}`}var W0={title:(e,t)=>e.title.localeCompare(t.title),type:(e,t)=>(e.type??"").localeCompare(t.type??""),duration:(e,t)=>(e.duration??0)-(t.duration??0)};function us({playlist:e,initialTrack:t=0,autoPlay:r=false,shuffle:n=false,loop:o=false,onTrackChange:s,onPlayChange:a,accent:l="#8b5cf6",className:d}){let[m,c]=Kr.useState(t),[f,p]=Kr.useState(false),[u,h]=Kr.useState(0),[g,x]=Kr.useState(0),[w,y]=Kr.useState(0),[M,v]=Kr.useState(.8),[N,L]=Kr.useState(false),[R,D]=Kr.useState(n),[A,V]=Kr.useState(o),[k,O]=Kr.useState(false),[C,X]=Kr.useState("title"),[T,re]=Kr.useState(true),[_,de]=Kr.useState(false),[J,pe]=Kr.useState(false),[fe,$]=Kr.useState(false),[U,me]=Kr.useState(true),[j,b]=Kr.useState(false),[I,W]=Kr.useState(null),K=Kr.useRef(null),B=Kr.useRef(null),Q=Kr.useRef(void 0),ve=Kr.useRef(false),P=e[m],ce=Kr__default.default.useMemo(()=>{let E=e.map((Z,ne)=>({media:Z,originalIndex:ne}));return E.sort((Z,ne)=>{let H=W0[C](Z.media,ne.media);return T?H:-H}),E},[e,C,T]);Kr.useEffect(()=>{let E=K.current;if(!E)return;b(true),E.src=P.src,P.poster&&(E.poster=P.poster),E.load();let Z=()=>{b(false),f&&E.play().catch(()=>{});};return E.addEventListener("loadeddata",Z,{once:true}),()=>E.removeEventListener("loadeddata",Z)},[m,P.src]),Kr.useEffect(()=>{if(!r||ve.current)return;let E=K.current;if(!E)return;let Z=()=>{ve.current=true,p(true),E.play().catch(()=>{});};return E.addEventListener("canplaythrough",Z,{once:true}),()=>E.removeEventListener("canplaythrough",Z)},[r]),Kr.useEffect(()=>{let E=K.current;E&&(f?E.play().catch(()=>{}):E.pause(),a?.(f));},[f]),Kr.useEffect(()=>{let E=K.current;E&&(E.volume=N?0:M);},[M,N]),Kr.useEffect(()=>{let E=K.current;if(!E)return;let Z=()=>h(E.currentTime),ne=()=>x(E.duration),H=()=>{E.buffered.length>0&&y(E.buffered.end(E.buffered.length-1));},be=()=>{A?(E.currentTime=0,E.play().catch(()=>{})):ge();};return E.addEventListener("timeupdate",Z),E.addEventListener("loadedmetadata",ne),E.addEventListener("progress",H),E.addEventListener("ended",be),()=>{E.removeEventListener("timeupdate",Z),E.removeEventListener("loadedmetadata",ne),E.removeEventListener("progress",H),E.removeEventListener("ended",be);}},[m,e.length,A]);let ae=Kr.useCallback(()=>{me(true),Q.current&&clearTimeout(Q.current),Q.current=setTimeout(()=>{f&&me(false);},3e3);},[f]);Kr.useEffect(()=>{f?ae():(me(true),Q.current&&clearTimeout(Q.current));},[f,ae]),Kr.useEffect(()=>()=>{Q.current&&clearTimeout(Q.current);},[]);let he=Kr.useCallback(E=>{let Z=(E%e.length+e.length)%e.length;c(Z),h(0),p(true),s?.(Z,e[Z]);},[e,s]),ge=Kr.useCallback(()=>{if(R){let E;do E=Math.floor(Math.random()*e.length);while(E===m&&e.length>1);he(E);}else he(m+1);},[he,m,R,e.length]),Me=Kr.useCallback(()=>{if(R){let E;do E=Math.floor(Math.random()*e.length);while(E===m&&e.length>1);he(E);}else he(m-1);},[he,m,R,e.length]),ke=Kr.useCallback(E=>{let Z=E.currentTarget.getBoundingClientRect(),H=Math.max(0,Math.min(1,(E.clientX-Z.left)/Z.width))*g;K.current&&(K.current.currentTime=H),h(H);},[g]),F=Kr.useCallback(E=>{let Z=E.currentTarget.getBoundingClientRect(),ne=Math.max(0,Math.min(1,(E.clientX-Z.left)/Z.width));W(ne*g);},[g]),ee=Kr.useCallback(()=>{B.current&&(document.fullscreenElement?document.exitFullscreen():B.current.requestFullscreen());},[]);Kr.useEffect(()=>{let E=()=>$(!!document.fullscreenElement);return document.addEventListener("fullscreenchange",E),()=>document.removeEventListener("fullscreenchange",E)},[]);let z=Kr.useCallback(()=>{_?(pe(true),setTimeout(()=>{de(false),pe(false);},500)):de(true);},[_]),q=Kr.useCallback(()=>{O(E=>!E);},[]),xe=Kr.useCallback(()=>{let E=["title","type","duration"],Z=E.indexOf(C);T?re(false):(re(true),X(E[(Z+1)%E.length]));},[C,T]);Kr.useEffect(()=>{let E=Z=>{if(!(Z.target instanceof HTMLInputElement||Z.target instanceof HTMLTextAreaElement))switch(Z.key){case " ":case "k":Z.preventDefault(),p(ne=>!ne);break;case "f":Z.preventDefault(),ee();break;case "t":Z.preventDefault(),z();break;case "ArrowLeft":Z.preventDefault(),K.current&&(K.current.currentTime=Math.max(0,u-5));break;case "ArrowRight":Z.preventDefault(),K.current&&(K.current.currentTime=Math.min(g,u+5));break;case "ArrowUp":Z.preventDefault(),v(ne=>Math.min(1,ne+.05));break;case "ArrowDown":Z.preventDefault(),v(ne=>Math.max(0,ne-.05));break;case "Escape":_&&z();break;case "n":Z.preventDefault(),ge();break;case "p":Z.preventDefault(),Me();break;case "l":Z.preventDefault(),q();break}};return window.addEventListener("keydown",E),()=>window.removeEventListener("keydown",E)},[ee,z,q,ge,Me,u,g,_]);let Ae=g>0?u/g*100:0,He=g>0?w/g*100:0,G="text-(--accent)",ye=jsxRuntime.jsxs("div",{ref:B,className:i("group flex overflow-hidden",fe?"h-full w-full":"aspect-video w-full",!fe&&"rounded-xl",!fe&&f&&"shadow-2xl",!fe&&!f&&"animate-[cp-glow-pulse_4s_ease-in-out_infinite] will-change-[box-shadow]",d),style:{"--accent":l,background:"var(--cp-bg)"},tabIndex:0,children:[jsxRuntime.jsxs("div",{className:i("relative flex-1 min-w-0 h-full overflow-hidden",j&&"animate-[cp-track-transition_0.6s_ease-out]"),onMouseMove:ae,onMouseLeave:()=>{f&&me(false);},children:[jsxRuntime.jsx("video",{ref:K,className:"h-full w-full object-contain",poster:P.poster,playsInline:true,preload:"metadata",onClick:()=>p(E=>!E)}),!f&&!j&&jsxRuntime.jsx("div",{className:"absolute inset-0 flex cursor-pointer items-center justify-center",style:{background:"var(--cp-overlay)"},onClick:()=>p(true),children:jsxRuntime.jsx("div",{className:"flex h-20 w-20 items-center justify-center rounded-full backdrop-blur-md transition-transform hover:scale-110 active:scale-95",style:{background:"var(--cp-surface-hover)"},children:jsxRuntime.jsx(lucideReact.Play,{className:"h-10 w-10 translate-x-0.5",fill:"currentColor",style:{color:"var(--cp-text-strong)"}})})}),j&&!U&&jsxRuntime.jsx("div",{className:"absolute left-6 top-6 z-20 animate-[fade-in_0.4s_ease-out]",children:jsxRuntime.jsxs("div",{className:"rounded-lg px-4 py-2 backdrop-blur-md",style:{background:"var(--cp-panel-bg)"},children:[jsxRuntime.jsx("div",{className:"text-sm font-semibold",style:{color:"var(--cp-text-strong)"},children:P.title}),P.subtitle&&jsxRuntime.jsx("div",{className:"text-xs",style:{color:"var(--cp-text-muted)"},children:P.subtitle})]})}),jsxRuntime.jsx("div",{className:i("absolute inset-x-0 top-0 z-10 bg-linear-to-b from-black/70 to-transparent px-5 pb-8 pt-4 transition-opacity duration-500",U?"opacity-100":"pointer-events-none opacity-0"),children:jsxRuntime.jsxs("div",{className:"flex items-center justify-between",children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("h3",{className:"text-sm font-semibold drop-shadow-md",style:{color:"var(--cp-text-strong)"},children:P.title}),P.subtitle&&jsxRuntime.jsx("p",{className:"text-xs",style:{color:"var(--cp-text-muted)"},children:P.subtitle})]}),P.type&&jsxRuntime.jsx("span",{className:"rounded-full bg-(--accent)/70 px-2.5 py-0.5 text-[10px] font-semibold uppercase tracking-wider backdrop-blur-sm",style:{color:"var(--cp-text-strong)"},children:P.type})]})}),jsxRuntime.jsxs("div",{className:i("absolute inset-x-0 bottom-0 z-10 bg-linear-to-t from-black/80 via-black/40 to-transparent px-4 pb-3 pt-10 transition-all duration-500",U?"translate-y-0 opacity-100":"pointer-events-none translate-y-2 opacity-0"),children:[jsxRuntime.jsxs("div",{className:"group/seek relative mb-3 h-1 cursor-pointer rounded-full transition-[height] duration-200 hover:h-1.5",style:{background:"var(--cp-seek-track)"},onClick:ke,onMouseMove:F,onMouseLeave:()=>W(null),children:[jsxRuntime.jsx("div",{className:"absolute inset-y-0 left-0 rounded-full",style:{width:`${He}%`,background:"var(--cp-seek-buffer)"}}),jsxRuntime.jsx("div",{className:"absolute inset-y-0 left-0 rounded-full bg-(--accent) transition-[width] duration-100",style:{width:`${Ae}%`}}),I!==null&&jsxRuntime.jsx("div",{className:"absolute -top-8 -translate-x-1/2 rounded px-2 py-0.5 text-[10px] font-mono",style:{left:`${I/g*100}%`,background:"var(--cp-panel-bg)",color:"var(--cp-text-strong)"},children:go(I)}),jsxRuntime.jsx("div",{className:"absolute top-1/2 h-3.5 w-3.5 -translate-y-1/2 rounded-full border-2 border-(--accent) bg-white opacity-0 shadow-lg transition-opacity group-hover/seek:opacity-100",style:{left:`calc(${Ae}% - 7px)`}})]}),jsxRuntime.jsxs("div",{className:"flex items-center gap-1",children:[jsxRuntime.jsx("button",{className:"cp-btn",onClick:()=>p(E=>!E),title:f?"Pause (k)":"Play (k)",children:f?jsxRuntime.jsx(lucideReact.Pause,{className:"h-5 w-5",fill:"currentColor"}):jsxRuntime.jsx(lucideReact.Play,{className:"h-5 w-5 translate-x-px",fill:"currentColor"})}),jsxRuntime.jsx("button",{className:"cp-btn",onClick:Me,title:"Previous (p)",children:jsxRuntime.jsx(lucideReact.SkipBack,{className:"h-4 w-4",fill:"currentColor"})}),jsxRuntime.jsx("button",{className:"cp-btn",onClick:ge,title:"Next (n)",children:jsxRuntime.jsx(lucideReact.SkipForward,{className:"h-4 w-4",fill:"currentColor"})}),jsxRuntime.jsxs("div",{className:"group/vol ml-1 flex items-center",children:[jsxRuntime.jsx("button",{className:"cp-btn",onClick:()=>L(E=>!E),title:N?"Unmute":"Mute",children:N||M===0?jsxRuntime.jsx(lucideReact.VolumeX,{className:"h-4 w-4"}):jsxRuntime.jsx(lucideReact.Volume2,{className:"h-4 w-4"})}),jsxRuntime.jsx("div",{className:"flex w-0 items-center overflow-hidden transition-all duration-300 group-hover/vol:w-20",children:jsxRuntime.jsx("input",{type:"range",min:0,max:1,step:.01,value:N?0:M,onChange:E=>{v(Number(E.target.value)),N&&L(false);},className:"h-1 w-full cursor-pointer appearance-none rounded-full accent-(--accent)",style:{background:"var(--cp-seek-track)"}})})]}),jsxRuntime.jsxs("span",{className:"ml-2 min-w-0 shrink-0 font-mono text-xs",style:{color:"var(--cp-text-muted)"},children:[go(u)," / ",go(g)]}),jsxRuntime.jsx("div",{className:"flex-1"}),jsxRuntime.jsx("button",{className:i("cp-btn",R&&G),onClick:()=>D(E=>!E),title:"Shuffle",children:jsxRuntime.jsx(lucideReact.Shuffle,{className:"h-4 w-4"})}),jsxRuntime.jsx("button",{className:i("cp-btn",A&&G),onClick:()=>V(E=>!E),title:"Loop",children:jsxRuntime.jsx(lucideReact.Repeat1,{className:"h-4 w-4"})}),jsxRuntime.jsx("button",{className:i("cp-btn",k&&G),onClick:q,title:"Playlist",children:jsxRuntime.jsx(lucideReact.ListVideo,{className:"h-4 w-4"})}),jsxRuntime.jsx("button",{className:i("cp-btn",_&&G),onClick:z,title:"Cinema mode (t)",children:jsxRuntime.jsx(lucideReact.Theater,{className:"h-4 w-4"})}),jsxRuntime.jsx("button",{className:"cp-btn",onClick:ee,title:"Fullscreen (f)",children:fe?jsxRuntime.jsx(lucideReact.Minimize,{className:"h-4 w-4"}):jsxRuntime.jsx(lucideReact.Maximize,{className:"h-4 w-4"})})]})]})]}),jsxRuntime.jsx("div",{className:i("h-full shrink-0 overflow-hidden transition-[width] duration-300 ease-out",k?"w-72":"w-0"),children:jsxRuntime.jsxs("div",{className:"flex h-full w-72 flex-col backdrop-blur-xl",style:{borderLeft:"1px solid var(--cp-border)",background:"var(--cp-panel-bg)"},children:[jsxRuntime.jsxs("div",{className:"flex items-center justify-between px-4 py-3",style:{borderBottom:"1px solid var(--cp-border)"},children:[jsxRuntime.jsx("span",{className:"text-xs font-semibold uppercase tracking-wider",style:{color:"var(--cp-text)"},children:"Playlist"}),jsxRuntime.jsxs("div",{className:"flex items-center gap-1",children:[jsxRuntime.jsxs("button",{className:"flex items-center gap-1 rounded px-2 py-1 text-[10px] font-medium transition-colors",style:{color:"var(--cp-text-muted)"},onClick:xe,title:`Sort: ${C} ${T?"\u2191":"\u2193"}`,children:[jsxRuntime.jsx(lucideReact.ArrowUpDown,{className:"h-3 w-3"}),C,T?" \u2191":" \u2193"]}),jsxRuntime.jsx("button",{className:"cp-btn p-1!",onClick:q,title:"Close",children:jsxRuntime.jsx(lucideReact.X,{className:"h-3.5 w-3.5"})})]})]}),jsxRuntime.jsx("div",{className:"flex-1 overflow-y-auto",children:ce.map(({media:E,originalIndex:Z})=>{let ne=Z===m;return jsxRuntime.jsxs("button",{className:i("flex w-full items-center gap-3 px-4 py-2.5 text-left transition-all duration-200",ne?"bg-(--accent)/20 text-(--accent)":"hover:text-(--cp-text-strong)"),style:ne?void 0:{color:"var(--cp-text)"},onClick:()=>{he(Z);},children:[jsxRuntime.jsxs("div",{className:"relative h-10 w-16 shrink-0 overflow-hidden rounded",style:{background:"var(--cp-surface)"},children:[E.poster?jsxRuntime.jsx("img",{src:E.poster,alt:"",className:"h-full w-full object-cover",draggable:false}):jsxRuntime.jsx("div",{className:"flex h-full w-full items-center justify-center",children:jsxRuntime.jsx(lucideReact.Play,{className:"h-4 w-4",style:{color:"var(--cp-seek-track)"}})}),ne&&f&&jsxRuntime.jsx("div",{className:"absolute inset-0 flex items-center justify-center",style:{background:"var(--cp-overlay)"},children:jsxRuntime.jsx("div",{className:"flex items-end gap-px",children:[1,2,3,4].map(H=>jsxRuntime.jsx("div",{className:"w-0.5 rounded-full bg-(--accent)",style:{height:`${6+H*3}px`,animation:`mp-eq-bar ${.3+H*.12}s ease-in-out infinite alternate`}},H))})})]}),jsxRuntime.jsxs("div",{className:"min-w-0 flex-1",children:[jsxRuntime.jsx("div",{className:"truncate text-xs font-medium",children:E.title}),jsxRuntime.jsxs("div",{className:"flex items-center gap-2",children:[E.type&&jsxRuntime.jsx("span",{className:"text-[10px] uppercase tracking-wide opacity-50",children:E.type}),E.duration!=null&&jsxRuntime.jsx("span",{className:"font-mono text-[10px] opacity-40",children:go(E.duration)})]})]}),ne&&jsxRuntime.jsx(lucideReact.ChevronRight,{className:"h-3.5 w-3.5 shrink-0 text-(--accent)"})]},Z)})})]})}),jsxRuntime.jsx("style",{children:`
7
+ </svg>`);function Cl(e){if(!isFinite(e)||e<0)return "0:00";let t=Math.floor(e/60),r=Math.floor(e%60);return `${t}:${r.toString().padStart(2,"0")}`}function af(e){return e.startsWith("bottom")?"bottom":e.startsWith("top")?"top":"right"}var of={"bottom-right":"bottom-4 right-4","bottom-left":"bottom-4 left-4","top-right":"top-4 right-4","top-left":"top-4 left-4"},sf={"bottom-right":"bottom-4 right-0","bottom-left":"bottom-4 left-0","top-right":"top-4 right-0","top-left":"top-4 left-0"},lf={"bottom-right":"bottom-8 right-0 w-1.5 h-16 rounded-l-full","bottom-left":"bottom-8 left-0 w-1.5 h-16 rounded-r-full","top-right":"top-8 right-0 w-1.5 h-16 rounded-l-full","top-left":"top-8 left-0 w-1.5 h-16 rounded-r-full"};function Ci({playlist:e,initialTrack:t=0,position:r="bottom-right",entrance:n,theme:a,docked:i=false,visible:o,onVisibleChange:l,onTrackChange:c,onLike:m,autoPlay:d=true,shuffle:f=false,loop:p=false,accent:u="#8b5cf6",className:h}){let [g,b]=qr.useState(t),[N,x]=qr.useState(false),[T,w]=qr.useState(0),[C,S]=qr.useState(0),[R,V]=qr.useState(.8),[I,E]=qr.useState(false),[v,U]=qr.useState(new Set),[k,q]=qr.useState(false),[M,W]=qr.useState(o??!i),[$,ue]=qr.useState(false),[J,de]=qr.useState(false),[re,B]=qr.useState(f),[j,pe]=qr.useState(p),ye=qr.useRef(false),y=qr.useRef(null),L=qr.useRef(null),G=qr.useRef(void 0),O=qr.useRef(null),_=qr.useRef(null),ee=o??M,xe=n??af(r),P=e[g],K=i,oe=a==="dark"?"dark":a==="light"?"light":"",X="bg-(--mp-bg)",fe="text-(--mp-text)",we="text-(--mp-text-muted)",H="text-(--accent)",ne="border-(--mp-border)";qr.useEffect(()=>{let z=y.current;z&&(z.src=P.src,z.load(),N&&z.play().catch(()=>{}));},[g,P.src]),qr.useEffect(()=>{if(!d||ye.current)return;let z=y.current;if(!z)return;let ve=()=>{ye.current=true,x(true),z.play().catch(()=>{});};return z.addEventListener("canplaythrough",ve,{once:true}),()=>z.removeEventListener("canplaythrough",ve)},[d]),qr.useEffect(()=>{let z=y.current;z&&(N?z.play().catch(()=>{}):z.pause());},[N]),qr.useEffect(()=>{let z=y.current;z&&(z.muted=I,_.current?_.current.gain.value=I?0:R:z.volume=R);},[R,I]),qr.useEffect(()=>{let z=y.current;if(!z)return;let ve=()=>w(z.currentTime),_e=()=>S(z.duration),mt=()=>{j?(z.currentTime=0,z.play().catch(()=>{})):Q();};return z.addEventListener("timeupdate",ve),z.addEventListener("loadedmetadata",_e),z.addEventListener("ended",mt),()=>{z.removeEventListener("timeupdate",ve),z.removeEventListener("loadedmetadata",_e),z.removeEventListener("ended",mt);}},[g,e.length]);let Y=qr.useCallback(z=>{let ve=(z%e.length+e.length)%e.length;b(ve),w(0),c?.(ve,e[ve]),ee||(W(true),l?.(true));},[e,ee,c,l]),Q=qr.useCallback(()=>{if(re){let z;do z=Math.floor(Math.random()*e.length);while(z===g&&e.length>1);Y(z);}else Y(g+1);},[Y,g,re,e.length]),ke=qr.useCallback(()=>{if(re){let z;do z=Math.floor(Math.random()*e.length);while(z===g&&e.length>1);Y(z);}else Y(g-1);},[Y,g,re,e.length]),He=qr.useCallback(()=>{let z=v.has(g);U(ve=>{let _e=new Set(ve);return z?_e.delete(g):_e.add(g),_e}),m?.(g,P,!z);},[g,v,m,P]),Fe=qr.useCallback(z=>{let ve=z.currentTarget.getBoundingClientRect(),mt=Math.max(0,Math.min(1,(z.clientX-ve.left)/ve.width))*C;y.current&&(y.current.currentTime=mt),w(mt);},[C]),Z=qr.useCallback(()=>{ue(true);let z=K?200:400;G.current=setTimeout(()=>{ue(false),W(false),l?.(false);},z);},[K,l]);qr.useEffect(()=>()=>{G.current&&clearTimeout(G.current);},[]),qr.useEffect(()=>()=>{O.current?.close();},[]);function Ne(){if(O.current||!y.current){O.current?.resume();return}try{let z=window.AudioContext??window.webkitAudioContext;if(!z)return;let ve=new z,_e=ve.createGain();_e.gain.value=I?0:R,ve.createMediaElementSource(y.current).connect(_e).connect(ve.destination),O.current=ve,_.current=_e,ve.resume();}catch{}}let A=J?"fade-in 0.2s ease-out both":`mp-enter-${xe} 0.45s cubic-bezier(0.16, 1, 0.3, 1) both`,ae=J?"fade-in 0.2s ease-in reverse both":`mp-exit-${xe} 0.4s cubic-bezier(0.7, 0, 0.84, 0) both`,se=C>0?T/C*100:0;return K&&!ee&&!$?jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("audio",{ref:y,preload:"metadata",crossOrigin:"anonymous"}),jsxRuntime.jsxs("div",{className:s("fixed z-100 cursor-pointer transition-all duration-300",lf[r]),style:{"--accent":u},onMouseEnter:()=>{de(true),W(true),l?.(true);},children:[jsxRuntime.jsx("div",{className:s("h-full w-full rounded-full",N?"bg-(--accent)":"bg-(--mp-dock-strip)"),style:N?{animation:"mp-progress-glow 2s ease-in-out infinite",boxShadow:"0 0 12px color-mix(in srgb, var(--accent) 50%, transparent)"}:void 0}),N&&jsxRuntime.jsx("div",{className:"absolute inset-0 rounded-full bg-(--accent)/30",style:{animation:"mp-pulse-ring 2s ease-out infinite"}})]})]}):!ee&&!$?jsxRuntime.jsx("audio",{ref:y,preload:"metadata",crossOrigin:"anonymous"}):jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("audio",{ref:y,preload:"metadata",crossOrigin:"anonymous"}),jsxRuntime.jsx("div",{className:s("fixed z-100",K?sf[r]:of[r],oe),style:{"--accent":u,...$?{animation:ae}:{animation:A}},onMouseEnter:()=>{K&&(G.current&&(clearTimeout(G.current),G.current=void 0),$&&ue(false),de(true));},onMouseLeave:()=>{K&&(de(false),Z());},children:jsxRuntime.jsxs("div",{className:s("w-[320px] overflow-hidden rounded-2xl border shadow-2xl backdrop-blur-xl",X,ne,K&&"rounded-none",r.endsWith("right")&&K&&"rounded-l-2xl",r.endsWith("left")&&K&&"rounded-r-2xl",h),children:[jsxRuntime.jsxs("div",{className:"relative",children:[jsxRuntime.jsx("div",{className:"absolute inset-0 overflow-hidden",children:jsxRuntime.jsx("img",{src:P.cover||Ni,alt:"",className:"h-full w-full scale-110 object-cover opacity-30 blur-2xl",draggable:false})}),jsxRuntime.jsxs("div",{className:"relative flex items-center gap-3.5 p-4 pb-3",children:[jsxRuntime.jsxs("div",{className:"relative h-14 w-14 shrink-0",children:[jsxRuntime.jsxs("div",{className:"h-14 w-14 overflow-hidden rounded-full border-2 border-white/10 shadow-lg",style:N?{animation:"mp-vinyl-spin 4s linear infinite"}:void 0,children:[jsxRuntime.jsx("img",{src:P.cover||Ni,alt:P.album??P.title,className:"h-full w-full object-cover",draggable:false}),jsxRuntime.jsx("div",{className:"absolute inset-0 flex items-center justify-center",children:jsxRuntime.jsx("div",{className:"h-3 w-3 rounded-full bg-black/60 ring-1 ring-white/10"})})]}),N&&jsxRuntime.jsx("div",{className:"absolute inset-0 rounded-full bg-(--accent)/20",style:{animation:"mp-pulse-ring 2.5s ease-out infinite"}})]}),jsxRuntime.jsxs("div",{className:"min-w-0 flex-1",children:[jsxRuntime.jsx("div",{className:s("truncate text-sm font-semibold",fe),children:P.title}),P.artist&&jsxRuntime.jsx("div",{className:s("truncate text-xs",we),children:P.artist}),P.album&&jsxRuntime.jsx("div",{className:s("mt-0.5 truncate text-[10px] tracking-wide",we,"opacity-60"),children:P.album})]}),jsxRuntime.jsxs("div",{className:"flex shrink-0 items-center gap-0.5",children:[jsxRuntime.jsx("button",{className:s("rounded-full p-1.5 transition-all duration-200",v.has(g)?"text-rose-500 hover:text-rose-400":s(we,"hover:text-rose-500")),onClick:He,title:"Like",children:jsxRuntime.jsx(lucideReact.Heart,{className:"h-4 w-4",fill:v.has(g)?"currentColor":"none"})}),jsxRuntime.jsx("button",{className:s("rounded-full p-1.5 transition-colors",we,"hover:"+fe.split(" ")[0]),onClick:()=>q(z=>!z),title:"Playlist",children:jsxRuntime.jsx(lucideReact.ListMusic,{className:"h-4 w-4"})}),!K&&jsxRuntime.jsx("button",{className:s("rounded-full p-1.5 transition-colors",we,"hover:"+fe.split(" ")[0]),onClick:Z,title:"Dismiss",children:jsxRuntime.jsx(lucideReact.X,{className:"h-3.5 w-3.5"})})]})]})]}),jsxRuntime.jsxs("div",{className:"px-4",children:[jsxRuntime.jsxs("div",{ref:L,className:"group relative h-1.5 cursor-pointer rounded-full bg-(--mp-surface)",onClick:Fe,children:[jsxRuntime.jsx("div",{className:"h-full rounded-full bg-(--accent) transition-[width] duration-150",style:{width:`${se}%`}}),jsxRuntime.jsx("div",{className:"absolute top-1/2 h-3 w-3 -translate-y-1/2 rounded-full bg-(--accent) opacity-0 shadow-md transition-opacity group-hover:opacity-100",style:{left:`calc(${se}% - 6px)`}})]}),jsxRuntime.jsxs("div",{className:s("mt-1 flex justify-between text-[10px] font-mono",we),children:[jsxRuntime.jsx("span",{children:Cl(T)}),jsxRuntime.jsx("span",{children:Cl(C)})]})]}),jsxRuntime.jsxs("div",{className:"flex items-center justify-center gap-2 px-4 pb-3 pt-1",children:[jsxRuntime.jsx("button",{className:s("rounded-full p-1.5 transition-colors",re?H:we,"hover:text-(--mp-text)"),onClick:()=>B(z=>!z),title:re?"Shuffle On":"Shuffle Off",children:jsxRuntime.jsx(lucideReact.Shuffle,{className:"h-3.5 w-3.5"})}),jsxRuntime.jsx("button",{className:s("rounded-full p-1.5 transition-colors",j?H:we,"hover:text-(--mp-text)"),onClick:()=>pe(z=>!z),title:j?"Loop On":"Loop Off",children:jsxRuntime.jsx(lucideReact.Repeat1,{className:"h-3.5 w-3.5"})}),jsxRuntime.jsx("button",{className:s("rounded-full p-2 transition-colors",we,"hover:text-(--mp-text)"),onClick:ke,title:"Previous",children:jsxRuntime.jsx(lucideReact.SkipBack,{className:"h-4 w-4",fill:"currentColor"})}),jsxRuntime.jsx("button",{className:s("flex h-10 w-10 items-center justify-center rounded-full transition-all duration-200","bg-(--accent) text-white shadow-lg active:scale-95"),style:{boxShadow:"0 6px 20px color-mix(in srgb, var(--accent) 35%, transparent)"},onClick:()=>{Ne(),x(z=>!z);},title:N?"Pause":"Play",children:N?jsxRuntime.jsx(lucideReact.Pause,{className:"h-4.5 w-4.5",fill:"currentColor"}):jsxRuntime.jsx(lucideReact.Play,{className:"h-4.5 w-4.5 translate-x-px",fill:"currentColor"})}),jsxRuntime.jsx("button",{className:s("rounded-full p-2 transition-colors",we,"hover:text-(--mp-text)"),onClick:Q,title:"Next",children:jsxRuntime.jsx(lucideReact.SkipForward,{className:"h-4 w-4",fill:"currentColor"})}),jsxRuntime.jsxs("div",{className:"ml-2 flex items-center gap-1.5",children:[jsxRuntime.jsx("button",{className:s("rounded-full p-1 transition-colors",we,"hover:text-(--mp-text)"),onClick:()=>{Ne();let z=!I;E(z),_.current&&(_.current.gain.value=z?0:R);},title:I?"Unmute":"Mute",children:I||R===0?jsxRuntime.jsx(lucideReact.VolumeX,{className:"h-3.5 w-3.5"}):jsxRuntime.jsx(lucideReact.Volume2,{className:"h-3.5 w-3.5"})}),jsxRuntime.jsx("input",{type:"range",min:0,max:1,step:.01,value:I?0:R,onChange:z=>{Ne();let ve=Number(z.target.value);V(ve),I&&E(false),_.current&&(_.current.gain.value=ve);},className:"mp-volume-slider h-1 w-14 cursor-pointer appearance-none rounded-full bg-(--mp-surface) accent-(--accent)"})]})]}),jsxRuntime.jsx("div",{className:s("overflow-hidden transition-all duration-300 ease-in-out",k?"max-h-60":"max-h-0"),children:jsxRuntime.jsx("div",{className:s("border-t px-2 py-2",ne),children:jsxRuntime.jsx("div",{className:"max-h-52 space-y-0.5 overflow-y-auto",children:e.map((z,ve)=>{let _e=ve===g;return jsxRuntime.jsxs("button",{className:s("flex w-full items-center gap-2.5 rounded-lg px-2.5 py-2 text-left transition-all duration-200",_e?"bg-(--accent)/10 dark:bg-(--accent)/15":"hover:bg-(--mp-surface-hover)"),onClick:()=>{Y(ve),x(true);},children:[jsxRuntime.jsx("div",{className:"flex h-8 w-8 shrink-0 items-center justify-center",children:_e&&N?jsxRuntime.jsx("div",{className:"flex items-end gap-0.5",children:[1,2,3].map(mt=>jsxRuntime.jsx("div",{className:"w-0.75 rounded-full bg-(--accent)",style:{height:`${8+mt*4}px`,animation:`mp-eq-bar ${.4+mt*.15}s ease-in-out infinite alternate`}},mt))}):_e?jsxRuntime.jsx(lucideReact.Disc3,{className:s("h-4 w-4",H)}):jsxRuntime.jsx("span",{className:s("text-xs font-mono",we),children:ve+1})}),jsxRuntime.jsx("div",{className:"h-8 w-8 shrink-0 overflow-hidden rounded",children:jsxRuntime.jsx("img",{src:z.cover||Ni,alt:"",className:"h-full w-full object-cover",draggable:false})}),jsxRuntime.jsxs("div",{className:"min-w-0 flex-1",children:[jsxRuntime.jsx("div",{className:s("truncate text-xs font-medium",_e?H:fe),children:z.title}),z.artist&&jsxRuntime.jsx("div",{className:s("truncate text-[10px]",we),children:z.artist})]}),v.has(ve)&&jsxRuntime.jsx(lucideReact.Heart,{className:"h-3 w-3 shrink-0 text-rose-500",fill:"currentColor"})]},ve)})})})})]})})]})}function Ta(e){if(!isFinite(e)||e<0)return "0:00";let t=Math.floor(e/3600),r=Math.floor(e%3600/60),n=Math.floor(e%60);return t>0?`${t}:${r.toString().padStart(2,"0")}:${n.toString().padStart(2,"0")}`:`${r}:${n.toString().padStart(2,"0")}`}var Cf={title:(e,t)=>e.title.localeCompare(t.title),type:(e,t)=>(e.type??"").localeCompare(t.type??""),duration:(e,t)=>(e.duration??0)-(t.duration??0)};function Mi({playlist:e,initialTrack:t=0,autoPlay:r=false,shuffle:n=false,loop:a=false,onTrackChange:i,onPlayChange:o,accent:l="#8b5cf6",className:c}){let[m,d]=qr.useState(t),[f,p]=qr.useState(false),[u,h]=qr.useState(0),[g,b]=qr.useState(0),[N,x]=qr.useState(0),[T,w]=qr.useState(.8),[C,S]=qr.useState(false),[R,V]=qr.useState(n),[I,E]=qr.useState(a),[v,U]=qr.useState(false),[k,q]=qr.useState("title"),[M,W]=qr.useState(true),[$,ue]=qr.useState(false),[J,de]=qr.useState(false),[re,B]=qr.useState(false),[j,pe]=qr.useState(true),[ye,y]=qr.useState(false),[L,G]=qr.useState(null),O=qr.useRef(null),_=qr.useRef(null),ee=qr.useRef(void 0),xe=qr.useRef(false),P=e[m],F=qr__default.default.useMemo(()=>{let A=e.map((ae,se)=>({media:ae,originalIndex:se}));return A.sort((ae,se)=>{let z=Cf[k](ae.media,se.media);return M?z:-z}),A},[e,k,M]);qr.useEffect(()=>{let A=O.current;if(!A)return;y(true),A.src=P.src,P.poster&&(A.poster=P.poster),A.load();let ae=()=>{y(false),f&&A.play().catch(()=>{});};return A.addEventListener("loadeddata",ae,{once:true}),()=>A.removeEventListener("loadeddata",ae)},[m,P.src]),qr.useEffect(()=>{if(!r||xe.current)return;let A=O.current;if(!A)return;let ae=()=>{xe.current=true,p(true),A.play().catch(()=>{});};return A.addEventListener("canplaythrough",ae,{once:true}),()=>A.removeEventListener("canplaythrough",ae)},[r]),qr.useEffect(()=>{let A=O.current;A&&(f?A.play().catch(()=>{}):A.pause(),o?.(f));},[f]),qr.useEffect(()=>{let A=O.current;A&&(A.volume=C?0:T);},[T,C]),qr.useEffect(()=>{let A=O.current;if(!A)return;let ae=()=>h(A.currentTime),se=()=>b(A.duration),z=()=>{A.buffered.length>0&&x(A.buffered.end(A.buffered.length-1));},ve=()=>{I?(A.currentTime=0,A.play().catch(()=>{})):X();};return A.addEventListener("timeupdate",ae),A.addEventListener("loadedmetadata",se),A.addEventListener("progress",z),A.addEventListener("ended",ve),()=>{A.removeEventListener("timeupdate",ae),A.removeEventListener("loadedmetadata",se),A.removeEventListener("progress",z),A.removeEventListener("ended",ve);}},[m,e.length,I]);let K=qr.useCallback(()=>{pe(true),ee.current&&clearTimeout(ee.current),ee.current=setTimeout(()=>{f&&pe(false);},3e3);},[f]);qr.useEffect(()=>{f?K():(pe(true),ee.current&&clearTimeout(ee.current));},[f,K]),qr.useEffect(()=>()=>{ee.current&&clearTimeout(ee.current);},[]);let oe=qr.useCallback(A=>{let ae=(A%e.length+e.length)%e.length;d(ae),h(0),p(true),i?.(ae,e[ae]);},[e,i]),X=qr.useCallback(()=>{if(R){let A;do A=Math.floor(Math.random()*e.length);while(A===m&&e.length>1);oe(A);}else oe(m+1);},[oe,m,R,e.length]),fe=qr.useCallback(()=>{if(R){let A;do A=Math.floor(Math.random()*e.length);while(A===m&&e.length>1);oe(A);}else oe(m-1);},[oe,m,R,e.length]),we=qr.useCallback(A=>{let ae=A.currentTarget.getBoundingClientRect(),z=Math.max(0,Math.min(1,(A.clientX-ae.left)/ae.width))*g;O.current&&(O.current.currentTime=z),h(z);},[g]),H=qr.useCallback(A=>{let ae=A.currentTarget.getBoundingClientRect(),se=Math.max(0,Math.min(1,(A.clientX-ae.left)/ae.width));G(se*g);},[g]),ne=qr.useCallback(()=>{_.current&&(document.fullscreenElement?document.exitFullscreen():_.current.requestFullscreen());},[]);qr.useEffect(()=>{let A=()=>B(!!document.fullscreenElement);return document.addEventListener("fullscreenchange",A),()=>document.removeEventListener("fullscreenchange",A)},[]);let Y=qr.useCallback(()=>{$?(de(true),setTimeout(()=>{ue(false),de(false);},500)):ue(true);},[$]),Q=qr.useCallback(()=>{U(A=>!A);},[]),ke=qr.useCallback(()=>{let A=["title","type","duration"],ae=A.indexOf(k);M?W(false):(W(true),q(A[(ae+1)%A.length]));},[k,M]);qr.useEffect(()=>{let A=ae=>{if(!(ae.target instanceof HTMLInputElement||ae.target instanceof HTMLTextAreaElement))switch(ae.key){case " ":case "k":ae.preventDefault(),p(se=>!se);break;case "f":ae.preventDefault(),ne();break;case "t":ae.preventDefault(),Y();break;case "ArrowLeft":ae.preventDefault(),O.current&&(O.current.currentTime=Math.max(0,u-5));break;case "ArrowRight":ae.preventDefault(),O.current&&(O.current.currentTime=Math.min(g,u+5));break;case "ArrowUp":ae.preventDefault(),w(se=>Math.min(1,se+.05));break;case "ArrowDown":ae.preventDefault(),w(se=>Math.max(0,se-.05));break;case "Escape":$&&Y();break;case "n":ae.preventDefault(),X();break;case "p":ae.preventDefault(),fe();break;case "l":ae.preventDefault(),Q();break}};return window.addEventListener("keydown",A),()=>window.removeEventListener("keydown",A)},[ne,Y,Q,X,fe,u,g,$]);let He=g>0?u/g*100:0,Fe=g>0?N/g*100:0,Z="text-(--accent)",Ne=jsxRuntime.jsxs("div",{ref:_,className:s("group flex overflow-hidden",re?"h-full w-full":"aspect-video w-full",!re&&"rounded-xl",!re&&f&&"shadow-2xl",!re&&!f&&"animate-[cp-glow-pulse_4s_ease-in-out_infinite] will-change-[box-shadow]",c),style:{"--accent":l,background:"var(--cp-bg)"},tabIndex:0,children:[jsxRuntime.jsxs("div",{className:s("relative flex-1 min-w-0 h-full overflow-hidden",ye&&"animate-[cp-track-transition_0.6s_ease-out]"),onMouseMove:K,onMouseLeave:()=>{f&&pe(false);},children:[jsxRuntime.jsx("video",{ref:O,className:"h-full w-full object-contain",poster:P.poster,playsInline:true,preload:"metadata",onClick:()=>p(A=>!A)}),!f&&!ye&&jsxRuntime.jsx("div",{className:"absolute inset-0 flex cursor-pointer items-center justify-center",style:{background:"var(--cp-overlay)"},onClick:()=>p(true),children:jsxRuntime.jsx("div",{className:"flex h-20 w-20 items-center justify-center rounded-full backdrop-blur-md transition-transform hover:scale-110 active:scale-95",style:{background:"var(--cp-surface-hover)"},children:jsxRuntime.jsx(lucideReact.Play,{className:"h-10 w-10 translate-x-0.5",fill:"currentColor",style:{color:"var(--cp-text-strong)"}})})}),ye&&!j&&jsxRuntime.jsx("div",{className:"absolute left-6 top-6 z-20 animate-[fade-in_0.4s_ease-out]",children:jsxRuntime.jsxs("div",{className:"rounded-lg px-4 py-2 backdrop-blur-md",style:{background:"var(--cp-panel-bg)"},children:[jsxRuntime.jsx("div",{className:"text-sm font-semibold",style:{color:"var(--cp-text-strong)"},children:P.title}),P.subtitle&&jsxRuntime.jsx("div",{className:"text-xs",style:{color:"var(--cp-text-muted)"},children:P.subtitle})]})}),jsxRuntime.jsx("div",{className:s("absolute inset-x-0 top-0 z-10 bg-linear-to-b from-black/70 to-transparent px-5 pb-8 pt-4 transition-opacity duration-500",j?"opacity-100":"pointer-events-none opacity-0"),children:jsxRuntime.jsxs("div",{className:"flex items-center justify-between",children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("h3",{className:"text-sm font-semibold drop-shadow-md",style:{color:"var(--cp-text-strong)"},children:P.title}),P.subtitle&&jsxRuntime.jsx("p",{className:"text-xs",style:{color:"var(--cp-text-muted)"},children:P.subtitle})]}),P.type&&jsxRuntime.jsx("span",{className:"rounded-full bg-(--accent)/70 px-2.5 py-0.5 text-[10px] font-semibold uppercase tracking-wider backdrop-blur-sm",style:{color:"var(--cp-text-strong)"},children:P.type})]})}),jsxRuntime.jsxs("div",{className:s("absolute inset-x-0 bottom-0 z-10 bg-linear-to-t from-black/80 via-black/40 to-transparent px-4 pb-3 pt-10 transition-all duration-500",j?"translate-y-0 opacity-100":"pointer-events-none translate-y-2 opacity-0"),children:[jsxRuntime.jsxs("div",{className:"group/seek relative mb-3 h-1 cursor-pointer rounded-full transition-[height] duration-200 hover:h-1.5",style:{background:"var(--cp-seek-track)"},onClick:we,onMouseMove:H,onMouseLeave:()=>G(null),children:[jsxRuntime.jsx("div",{className:"absolute inset-y-0 left-0 rounded-full",style:{width:`${Fe}%`,background:"var(--cp-seek-buffer)"}}),jsxRuntime.jsx("div",{className:"absolute inset-y-0 left-0 rounded-full bg-(--accent) transition-[width] duration-100",style:{width:`${He}%`}}),L!==null&&jsxRuntime.jsx("div",{className:"absolute -top-8 -translate-x-1/2 rounded px-2 py-0.5 text-[10px] font-mono",style:{left:`${L/g*100}%`,background:"var(--cp-panel-bg)",color:"var(--cp-text-strong)"},children:Ta(L)}),jsxRuntime.jsx("div",{className:"absolute top-1/2 h-3.5 w-3.5 -translate-y-1/2 rounded-full border-2 border-(--accent) bg-white opacity-0 shadow-lg transition-opacity group-hover/seek:opacity-100",style:{left:`calc(${He}% - 7px)`}})]}),jsxRuntime.jsxs("div",{className:"flex items-center gap-1",children:[jsxRuntime.jsx("button",{className:"cp-btn",onClick:()=>p(A=>!A),title:f?"Pause (k)":"Play (k)",children:f?jsxRuntime.jsx(lucideReact.Pause,{className:"h-5 w-5",fill:"currentColor"}):jsxRuntime.jsx(lucideReact.Play,{className:"h-5 w-5 translate-x-px",fill:"currentColor"})}),jsxRuntime.jsx("button",{className:"cp-btn",onClick:fe,title:"Previous (p)",children:jsxRuntime.jsx(lucideReact.SkipBack,{className:"h-4 w-4",fill:"currentColor"})}),jsxRuntime.jsx("button",{className:"cp-btn",onClick:X,title:"Next (n)",children:jsxRuntime.jsx(lucideReact.SkipForward,{className:"h-4 w-4",fill:"currentColor"})}),jsxRuntime.jsxs("div",{className:"group/vol ml-1 flex items-center",children:[jsxRuntime.jsx("button",{className:"cp-btn",onClick:()=>S(A=>!A),title:C?"Unmute":"Mute",children:C||T===0?jsxRuntime.jsx(lucideReact.VolumeX,{className:"h-4 w-4"}):jsxRuntime.jsx(lucideReact.Volume2,{className:"h-4 w-4"})}),jsxRuntime.jsx("div",{className:"flex w-0 items-center overflow-hidden transition-all duration-300 group-hover/vol:w-20",children:jsxRuntime.jsx("input",{type:"range",min:0,max:1,step:.01,value:C?0:T,onChange:A=>{w(Number(A.target.value)),C&&S(false);},className:"h-1 w-full cursor-pointer appearance-none rounded-full accent-(--accent)",style:{background:"var(--cp-seek-track)"}})})]}),jsxRuntime.jsxs("span",{className:"ml-2 min-w-0 shrink-0 font-mono text-xs",style:{color:"var(--cp-text-muted)"},children:[Ta(u)," / ",Ta(g)]}),jsxRuntime.jsx("div",{className:"flex-1"}),jsxRuntime.jsx("button",{className:s("cp-btn",R&&Z),onClick:()=>V(A=>!A),title:"Shuffle",children:jsxRuntime.jsx(lucideReact.Shuffle,{className:"h-4 w-4"})}),jsxRuntime.jsx("button",{className:s("cp-btn",I&&Z),onClick:()=>E(A=>!A),title:"Loop",children:jsxRuntime.jsx(lucideReact.Repeat1,{className:"h-4 w-4"})}),jsxRuntime.jsx("button",{className:s("cp-btn",v&&Z),onClick:Q,title:"Playlist",children:jsxRuntime.jsx(lucideReact.ListVideo,{className:"h-4 w-4"})}),jsxRuntime.jsx("button",{className:s("cp-btn",$&&Z),onClick:Y,title:"Cinema mode (t)",children:jsxRuntime.jsx(lucideReact.Theater,{className:"h-4 w-4"})}),jsxRuntime.jsx("button",{className:"cp-btn",onClick:ne,title:"Fullscreen (f)",children:re?jsxRuntime.jsx(lucideReact.Minimize,{className:"h-4 w-4"}):jsxRuntime.jsx(lucideReact.Maximize,{className:"h-4 w-4"})})]})]})]}),jsxRuntime.jsx("div",{className:s("h-full shrink-0 overflow-hidden transition-[width] duration-300 ease-out",v?"w-72":"w-0"),children:jsxRuntime.jsxs("div",{className:"flex h-full w-72 flex-col backdrop-blur-xl",style:{borderLeft:"1px solid var(--cp-border)",background:"var(--cp-panel-bg)"},children:[jsxRuntime.jsxs("div",{className:"flex items-center justify-between px-4 py-3",style:{borderBottom:"1px solid var(--cp-border)"},children:[jsxRuntime.jsx("span",{className:"text-xs font-semibold uppercase tracking-wider",style:{color:"var(--cp-text)"},children:"Playlist"}),jsxRuntime.jsxs("div",{className:"flex items-center gap-1",children:[jsxRuntime.jsxs("button",{className:"flex items-center gap-1 rounded px-2 py-1 text-[10px] font-medium transition-colors",style:{color:"var(--cp-text-muted)"},onClick:ke,title:`Sort: ${k} ${M?"\u2191":"\u2193"}`,children:[jsxRuntime.jsx(lucideReact.ArrowUpDown,{className:"h-3 w-3"}),k,M?" \u2191":" \u2193"]}),jsxRuntime.jsx("button",{className:"cp-btn p-1!",onClick:Q,title:"Close",children:jsxRuntime.jsx(lucideReact.X,{className:"h-3.5 w-3.5"})})]})]}),jsxRuntime.jsx("div",{className:"flex-1 overflow-y-auto",children:F.map(({media:A,originalIndex:ae})=>{let se=ae===m;return jsxRuntime.jsxs("button",{className:s("flex w-full items-center gap-3 px-4 py-2.5 text-left transition-all duration-200",se?"bg-(--accent)/20 text-(--accent)":"hover:text-(--cp-text-strong)"),style:se?void 0:{color:"var(--cp-text)"},onClick:()=>{oe(ae);},children:[jsxRuntime.jsxs("div",{className:"relative h-10 w-16 shrink-0 overflow-hidden rounded",style:{background:"var(--cp-surface)"},children:[A.poster?jsxRuntime.jsx("img",{src:A.poster,alt:"",className:"h-full w-full object-cover",draggable:false}):jsxRuntime.jsx("div",{className:"flex h-full w-full items-center justify-center",children:jsxRuntime.jsx(lucideReact.Play,{className:"h-4 w-4",style:{color:"var(--cp-seek-track)"}})}),se&&f&&jsxRuntime.jsx("div",{className:"absolute inset-0 flex items-center justify-center",style:{background:"var(--cp-overlay)"},children:jsxRuntime.jsx("div",{className:"flex items-end gap-px",children:[1,2,3,4].map(z=>jsxRuntime.jsx("div",{className:"w-0.5 rounded-full bg-(--accent)",style:{height:`${6+z*3}px`,animation:`mp-eq-bar ${.3+z*.12}s ease-in-out infinite alternate`}},z))})})]}),jsxRuntime.jsxs("div",{className:"min-w-0 flex-1",children:[jsxRuntime.jsx("div",{className:"truncate text-xs font-medium",children:A.title}),jsxRuntime.jsxs("div",{className:"flex items-center gap-2",children:[A.type&&jsxRuntime.jsx("span",{className:"text-[10px] uppercase tracking-wide opacity-50",children:A.type}),A.duration!=null&&jsxRuntime.jsx("span",{className:"font-mono text-[10px] opacity-40",children:Ta(A.duration)})]})]}),se&&jsxRuntime.jsx(lucideReact.ChevronRight,{className:"h-3.5 w-3.5 shrink-0 text-(--accent)"})]},ae)})})]})}),jsxRuntime.jsx("style",{children:`
8
8
  .cp-btn {
9
9
  display: flex;
10
10
  align-items: center;
@@ -20,7 +20,7 @@
20
20
  0%, 100% { box-shadow: 0 0 20px color-mix(in srgb, var(--accent) 25%, transparent), 0 25px 50px -12px rgba(0,0,0,0.25); }
21
21
  50% { box-shadow: 0 0 40px color-mix(in srgb, var(--accent) 55%, transparent), 0 25px 50px -12px rgba(0,0,0,0.25); }
22
22
  }
23
- `})]});return jsxRuntime.jsx("div",{className:i(_&&"fixed inset-0 z-100 flex items-center justify-center p-8",_&&(J?"animate-[cp-cinema-out_0.5s_ease-in_both]":"animate-[cp-cinema-in_0.5s_ease-out_both]")),onClick:_?E=>{E.target===E.currentTarget&&z();}:void 0,children:jsxRuntime.jsx("div",{className:i(_&&"w-full",_&&!fe&&"max-w-5xl"),children:ye})})}function bo(e){let t=e.lastIndexOf(".");return t>0?e.slice(t).toLowerCase():""}function bl(e){return e==null?"\u2014":e<1024?`${e} B`:e<1024*1024?`${(e/1024).toFixed(1)} KB`:e<1024*1024*1024?`${(e/(1024*1024)).toFixed(1)} MB`:`${(e/(1024*1024*1024)).toFixed(2)} GB`}function hs(e){return e?(typeof e=="string"?new Date(e):e).toLocaleDateString(void 0,{year:"numeric",month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"}):"\u2014"}var af={".png":lucideReact.Image,".jpg":lucideReact.Image,".jpeg":lucideReact.Image,".gif":lucideReact.Image,".svg":lucideReact.Image,".webp":lucideReact.Image,".ico":lucideReact.Image,".bmp":lucideReact.Image,".mp3":lucideReact.Music,".wav":lucideReact.Music,".flac":lucideReact.Music,".ogg":lucideReact.Music,".aac":lucideReact.Music,".m4a":lucideReact.Music,".mp4":lucideReact.Video,".mkv":lucideReact.Video,".avi":lucideReact.Video,".mov":lucideReact.Video,".wmv":lucideReact.Video,".webm":lucideReact.Video,".ts":lucideReact.FileCode,".tsx":lucideReact.FileCode,".js":lucideReact.FileCode,".jsx":lucideReact.FileCode,".json":lucideReact.FileCode,".html":lucideReact.FileCode,".css":lucideReact.FileCode,".scss":lucideReact.FileCode,".py":lucideReact.FileCode,".rs":lucideReact.FileCode,".go":lucideReact.FileCode,".java":lucideReact.FileCode,".c":lucideReact.FileCode,".cpp":lucideReact.FileCode,".h":lucideReact.FileCode,".sh":lucideReact.Terminal,".bat":lucideReact.Terminal,".ps1":lucideReact.Terminal,".md":lucideReact.FileText,".txt":lucideReact.FileText,".pdf":lucideReact.FileText,".doc":lucideReact.FileText,".docx":lucideReact.FileText,".rtf":lucideReact.FileText,".csv":lucideReact.FileSpreadsheet,".xls":lucideReact.FileSpreadsheet,".xlsx":lucideReact.FileSpreadsheet,".db":lucideReact.Database,".sqlite":lucideReact.Database,".sql":lucideReact.Database,".zip":lucideReact.FileArchive,".tar":lucideReact.FileArchive,".gz":lucideReact.FileArchive,".rar":lucideReact.FileArchive,".7z":lucideReact.FileArchive};function xs(e){if(e.type==="directory")return lucideReact.Folder;let t=e.extension||bo(e.name);return af[t]||lucideReact.File}function Pr(e,t,r){return Math.max(t,Math.min(r,e))}function hl(e){return e<480?"xs":e<640?"sm":e<1024?"md":"lg"}function xl(e,t){if(e<480)return {size:{width:e-16,height:t-48},pos:{x:8,y:24}};if(e<640){let o=e-24,s=Math.min(t-64,540);return {size:{width:o,height:s},pos:{x:12,y:32}}}if(e<1024){let o=Math.min(640,e-32),s=Math.min(480,t-64);return {size:{width:o,height:s},pos:{x:Math.max(0,Math.round((e-o)/2)),y:Math.max(0,Math.round((t-s)/2))}}}let r=720,n=520;return {size:{width:r,height:n},pos:{x:Math.max(0,Math.round((e-r)/2)),y:Math.max(0,Math.round((t-n)/2))}}}function ys({files:e,title:t="File Explorer",accent:r="#8b5cf6",defaultView:n="list",initialPosition:o,initialSize:s,dockable:a=false,dockSide:l="right",visible:d=true,onFileOpen:m,onSelectionChange:c,onNavigate:f,onDelete:p,onClose:u,onMinimize:h,onPathSubmit:g,defaultInputMode:x="search",actions:w,resizable:y=true,minSize:M={width:400,height:300},className:v}){let[N,L]=Kr.useState(n),[R,D]=Kr.useState(new Set),[A,V]=Kr.useState(null),[k,O]=Kr.useState(false),[C,X]=Kr.useState(false),[T,re]=Kr.useState(""),[_,de]=Kr.useState(x),[J,pe]=Kr.useState(d),[fe,$]=Kr.useState(false),[U,me]=Kr.useState({w:window.innerWidth,h:window.innerHeight}),j=xl(window.innerWidth,window.innerHeight),[b,I]=Kr.useState(o??j.pos),[W,K]=Kr.useState(s??j.size),[B,Q]=Kr.useState(null),ve=Kr.useRef(false),P=Kr.useRef({x:0,y:0}),ce=Kr.useRef(null),ae=Kr.useRef(false),he=Kr.useRef({x:0,y:0,w:0,h:0,px:0,py:0}),ge=Kr.useRef(false),Me=Kr.useRef(k);Kr.useEffect(()=>{Me.current=k;},[k]);let ke=d!==void 0?d:J,F=Kr.useMemo(()=>{let S=e.filter(Ne=>Ne.type==="directory"),se=e.filter(Ne=>Ne.type==="file");return S.sort((Ne,Ce)=>Ne.name.localeCompare(Ce.name)),se.sort((Ne,Ce)=>Ne.name.localeCompare(Ce.name)),[...S,...se]},[e]),ee=Kr.useMemo(()=>{if(_!=="search"||!T.trim())return F;let S=T.toLowerCase();return F.filter(se=>se.name.toLowerCase().includes(S))},[F,T,_]),z=A!=null?ee[A]:null;Kr.useEffect(()=>{let S=hl(window.innerWidth),se=()=>{let Ne=window.innerWidth,Ce=window.innerHeight;if(me({w:Ne,h:Ce}),Me.current)return;let Ee=hl(Ne);if(Ee!==S&&!ge.current&&!s){let rt=xl(Ne,Ce);K(rt.size),I(rt.pos);}S=Ee;};return window.addEventListener("resize",se),()=>window.removeEventListener("resize",se)},[s]);let q=Kr.useCallback((S,se)=>{D(Ne=>{let Ce=new Set(Ne);return se.ctrlKey||se.metaKey?Ce.has(S)?Ce.delete(S):Ce.add(S):(Ce.clear(),Ce.add(S)),Ce}),V(S);},[]);Kr.useEffect(()=>{if(!c)return;let S=Array.from(R).map(se=>ee[se]).filter(Boolean);c(S);},[R]);let xe=Kr.useCallback(S=>{let se=ee[S];se&&(se.type==="directory"?f?.(se.path):m?.(se));},[ee,m,f]),Ae=Kr.useCallback(S=>{k||S.target.closest("button")||(ge.current=true,ve.current=true,P.current={x:S.clientX-b.x,y:S.clientY-b.y},S.preventDefault());},[b,k]),He=Kr.useCallback(S=>{if(k||S.target.closest("button"))return;ge.current=true;let se=S.touches[0];ve.current=true,P.current={x:se.clientX-b.x,y:se.clientY-b.y};},[b,k]);Kr.useEffect(()=>{let S=Ce=>{if(!ve.current)return;let Ee=window.innerWidth-100,rt=window.innerHeight-40;I({x:Pr(Ce.clientX-P.current.x,0,Ee),y:Pr(Ce.clientY-P.current.y,0,rt)});},se=Ce=>{if(!ve.current)return;Ce.preventDefault();let Ee=Ce.touches[0],rt=window.innerWidth-100,Kt=window.innerHeight-40;I({x:Pr(Ee.clientX-P.current.x,0,rt),y:Pr(Ee.clientY-P.current.y,0,Kt)});},Ne=()=>{ve.current=false,ae.current=false,document.body.style.cursor="",document.body.style.userSelect="";};return window.addEventListener("mousemove",S),window.addEventListener("mouseup",Ne),window.addEventListener("touchmove",se,{passive:false}),window.addEventListener("touchend",Ne),()=>{window.removeEventListener("mousemove",S),window.removeEventListener("mouseup",Ne),window.removeEventListener("touchmove",se),window.removeEventListener("touchend",Ne);}},[]);let G=Kr.useCallback((S,se)=>{k||(se.preventDefault(),se.stopPropagation(),ge.current=true,ae.current=S,he.current={x:se.clientX,y:se.clientY,w:W.width,h:W.height,px:b.x,py:b.y},document.body.style.cursor=S==="e"||S==="w"?"ew-resize":S==="n"||S==="s"?"ns-resize":S==="nw"||S==="se"?"nwse-resize":"nesw-resize",document.body.style.userSelect="none");},[k,W,b]),ye=Kr.useCallback((S,se)=>{if(k)return;se.preventDefault(),se.stopPropagation(),ge.current=true;let Ne=se.touches[0];ae.current=S,he.current={x:Ne.clientX,y:Ne.clientY,w:W.width,h:W.height,px:b.x,py:b.y},document.body.style.userSelect="none";},[k,W,b]);Kr.useEffect(()=>{let S=(Ee,rt)=>{let Kt=ae.current;if(!Kt)return;let qs=Ee-he.current.x,Zs=rt-he.current.y,{w:sr,h:ir,px:Io,py:Ao}=he.current;if(Kt.includes("e")&&(sr=Math.max(M.width,sr+qs)),Kt.includes("w")){let Dr=Math.max(M.width,sr-qs);Io=Io+(sr-Dr),sr=Dr;}if(Kt.includes("s")&&(ir=Math.max(M.height,ir+Zs)),Kt.includes("n")){let Dr=Math.max(M.height,ir-Zs);Ao=Ao+(ir-Dr),ir=Dr;}K({width:sr,height:ir}),I({x:Io,y:Ao});},se=Ee=>{ae.current&&S(Ee.clientX,Ee.clientY);},Ne=Ee=>{ae.current&&(Ee.preventDefault(),S(Ee.touches[0].clientX,Ee.touches[0].clientY));},Ce=()=>{ae.current=false,document.body.style.cursor="",document.body.style.userSelect="";};return window.addEventListener("mousemove",se),window.addEventListener("mouseup",Ce),window.addEventListener("touchmove",Ne,{passive:false}),window.addEventListener("touchend",Ce),()=>{window.removeEventListener("mousemove",se),window.removeEventListener("mouseup",Ce),window.removeEventListener("touchmove",Ne),window.removeEventListener("touchend",Ce);}},[M]);let E=Kr.useCallback(()=>{k?(B&&(I(B.pos),K(B.size)),O(false)):(Q({pos:b,size:W}),O(true));},[k,b,W,B]),Z=Kr.useCallback(()=>{C?X(false):(k&&(O(false),B&&(I(B.pos),K(B.size))),X(true),h?.());},[C,k,B,h]);Kr.useEffect(()=>{if(!ke||C)return;let S=se=>{if(!(!ce.current?.contains(document.activeElement)&&document.activeElement!==ce.current)){if(se.key==="Escape"&&(V(null),D(new Set)),se.ctrlKey&&se.key==="a"){se.preventDefault();let Ne=new Set(ee.map((Ce,Ee)=>Ee));D(Ne);}se.key==="Delete"&&R.size>0&&p&&(se.preventDefault(),$(true));}};return window.addEventListener("keydown",S),()=>window.removeEventListener("keydown",S)},[ke,C,ee,R,p]);let ne={"--fe-accent":r};if(C)return jsxRuntime.jsx("div",{className:i("fixed z-100 cursor-pointer transition-all duration-300",l==="right"?"right-0 top-1/2 -translate-y-1/2":"left-0 top-1/2 -translate-y-1/2"),style:ne,onClick:()=>X(false),title:`Restore ${t}`,children:jsxRuntime.jsxs("div",{className:"fe-dock flex items-center gap-1.5 rounded-l-lg px-2 py-3 backdrop-blur-md",style:{writingMode:"vertical-rl",textOrientation:"mixed"},children:[jsxRuntime.jsx(lucideReact.HardDrive,{className:"h-3.5 w-3.5 text-(--fe-accent)"}),jsxRuntime.jsx("span",{className:"text-[10px] font-bold uppercase tracking-widest text-(--fe-text)",children:t})]})});if(!ke)return null;let H=k?U.w:Math.min(W.width,U.w-8),be=k?U.h:Math.min(W.height,U.h-8),Fe=k?0:Pr(b.x,0,Math.max(0,U.w-H)),lt=k?0:Pr(b.y,0,Math.max(0,U.h-40)),Vo=H<500;return jsxRuntime.jsxs("div",{ref:ce,className:i("fe-window fixed z-100 flex flex-col overflow-hidden","rounded-xl border border-(--fe-border)","animate-[fe-window-in_0.35s_cubic-bezier(0.16,1,0.3,1)_both]",k&&"rounded-none",v),style:{...ne,left:Fe,top:lt,width:H,height:be,transition:k?"left 0.3s, top 0.3s, width 0.3s, height 0.3s":void 0},tabIndex:0,children:[jsxRuntime.jsxs("div",{className:"fe-titlebar group/titlebar flex h-10 shrink-0 cursor-grab items-center justify-between px-3 select-none active:cursor-grabbing",onMouseDown:Ae,onTouchStart:He,onDoubleClick:E,children:[jsxRuntime.jsxs("div",{className:"flex items-center gap-2",children:[jsxRuntime.jsx("div",{className:"flex h-5 w-5 items-center justify-center rounded",style:{background:"color-mix(in srgb, var(--fe-accent) 25%, transparent)"},children:jsxRuntime.jsx(lucideReact.HardDrive,{className:"h-3 w-3 text-(--fe-accent)"})}),jsxRuntime.jsx("span",{className:"text-xs font-bold uppercase tracking-widest text-(--fe-text)",children:t}),jsxRuntime.jsx("div",{className:"ml-2 hidden h-px w-20 md:block",style:{background:"linear-gradient(90deg, var(--fe-accent), transparent)",opacity:.3}})]}),jsxRuntime.jsxs("div",{className:"flex items-center gap-0.5",children:[jsxRuntime.jsx("button",{className:"fe-btn mr-1",onClick:()=>L(S=>S==="list"?"grid":"list"),title:N==="list"?"Grid view":"List view",children:N==="list"?jsxRuntime.jsx(lucideReact.LayoutGrid,{className:"h-3.5 w-3.5"}):jsxRuntime.jsx(lucideReact.LayoutList,{className:"h-3.5 w-3.5"})}),a&&jsxRuntime.jsx("button",{className:"fe-btn",onClick:Z,title:"Dock to edge",children:jsxRuntime.jsx(lucideReact.Minus,{className:"h-3.5 w-3.5"})}),jsxRuntime.jsx("button",{className:"fe-btn",onClick:E,title:k?"Restore":"Maximize",children:k?jsxRuntime.jsx(lucideReact.Minimize2,{className:"h-3.5 w-3.5"}):jsxRuntime.jsx(lucideReact.Maximize2,{className:"h-3.5 w-3.5"})}),jsxRuntime.jsx("button",{className:"fe-btn hover:bg-red-500/40! hover:text-red-300!",onClick:()=>{u?.(),pe(false);},title:"Close",children:jsxRuntime.jsx(lucideReact.X,{className:"h-3.5 w-3.5"})})]})]}),jsxRuntime.jsxs("div",{className:"fe-toolbar flex h-9 shrink-0 items-center gap-2 px-3",children:[jsxRuntime.jsx("button",{className:"fe-btn p-1",onClick:()=>f?.(".."),title:"Go up",children:jsxRuntime.jsx(lucideReact.FolderUp,{className:"h-3.5 w-3.5"})}),jsxRuntime.jsx("button",{className:"fe-btn shrink-0 px-1.5 py-0.5 text-[9px] font-bold uppercase tracking-wider",style:_==="navigate"?{color:"var(--fe-accent)",background:"color-mix(in srgb, var(--fe-accent) 15%, transparent)"}:void 0,onClick:()=>de(S=>S==="search"?"navigate":"search"),title:_==="search"?"Switch to path navigation":"Switch to file search",children:_==="search"?jsxRuntime.jsx(lucideReact.Search,{className:"h-3 w-3"}):jsxRuntime.jsx(lucideReact.CornerRightDown,{className:"h-3 w-3"})}),jsxRuntime.jsx("div",{className:"relative flex-1",children:jsxRuntime.jsx("input",{type:"text",value:T,onChange:S=>re(S.target.value),onKeyDown:S=>{S.key==="Enter"&&T.trim()&&_==="navigate"&&(g?g(T.trim()):f?.(T.trim()));},placeholder:_==="search"?"Search files\u2026":"Enter path and press Enter\u2026",className:"h-6 w-full rounded border border-(--fe-input-border) bg-(--fe-input-bg) px-2 text-[11px] text-(--fe-text-strong) placeholder:text-(--fe-text-muted) outline-none transition-colors focus:border-(--fe-accent)/40 focus:bg-(--fe-input-bg)"})}),jsxRuntime.jsxs("span",{className:"shrink-0 font-mono text-[10px] text-(--fe-text-muted)",children:[ee.length," item",ee.length!==1?"s":"",R.size>0&&` \xB7 ${R.size} selected`]})]}),jsxRuntime.jsxs("div",{className:"relative flex flex-1 min-h-0",children:[jsxRuntime.jsx("div",{className:"flex-1 overflow-y-auto overflow-x-hidden p-1.5",onClick:S=>{S.target===S.currentTarget&&(D(new Set),V(null));},children:ee.length===0?jsxRuntime.jsxs("div",{className:"flex h-full flex-col items-center justify-center text-(--fe-text-muted)",children:[jsxRuntime.jsx(lucideReact.Folder,{className:"mb-2 h-10 w-10"}),jsxRuntime.jsx("span",{className:"text-xs",children:"No files found"})]}):N==="list"?jsxRuntime.jsx("div",{className:"space-y-px",children:ee.map((S,se)=>{let Ne=xs(S),Ce=R.has(se),Ee=S.extension||bo(S.name);return jsxRuntime.jsxs("div",{className:i("fe-item group/item flex items-center gap-2.5 rounded-lg px-2.5 py-1.5 text-(--fe-text) transition-all duration-150 cursor-pointer",Ce?"bg-(--fe-accent)/15 text-(--fe-text-strong)":"hover:bg-(--fe-surface-hover) hover:text-(--fe-text-strong)"),style:Ce?{boxShadow:"inset 2px 0 0 var(--fe-accent)"}:void 0,onClick:rt=>q(se,rt),onDoubleClick:()=>xe(se),children:[jsxRuntime.jsx(Ne,{className:i("h-4 w-4 shrink-0",S.type==="directory"?"text-(--fe-accent)":"text-(--fe-text-muted)")}),jsxRuntime.jsx("span",{className:"flex-1 truncate text-xs font-medium",children:S.name}),Ee&&S.type==="file"&&jsxRuntime.jsx("span",{className:"shrink-0 rounded bg-(--fe-badge-bg) px-1.5 py-0.5 font-mono text-[9px] uppercase text-(--fe-text-muted)",children:Ee}),S.size!=null&&jsxRuntime.jsx("span",{className:"shrink-0 font-mono text-[10px] text-(--fe-text-muted)",children:bl(S.size)}),S.modifiedAt&&jsxRuntime.jsx("span",{className:"hidden shrink-0 font-mono text-[10px] text-(--fe-text-muted) lg:inline",children:hs(S.modifiedAt)})]},S.path+se)})}):jsxRuntime.jsx("div",{className:"grid grid-cols-[repeat(auto-fill,minmax(90px,1fr))] gap-1.5 p-1",children:ee.map((S,se)=>{let Ne=xs(S),Ce=R.has(se),Ee=S.extension||bo(S.name);return jsxRuntime.jsxs("div",{className:i("fe-item group/item flex cursor-pointer flex-col items-center gap-1 rounded-lg px-2 py-2.5 text-center transition-all duration-150",Ce?"bg-(--fe-accent)/15 text-(--fe-text-strong) ring-1 ring-(--fe-accent)/30":"text-(--fe-text) hover:bg-(--fe-surface-hover) hover:text-(--fe-text-strong)"),onClick:rt=>q(se,rt),onDoubleClick:()=>xe(se),children:[jsxRuntime.jsx(Ne,{className:i("h-7 w-7",S.type==="directory"?"text-(--fe-accent)":"text-(--fe-text-muted)")}),jsxRuntime.jsx("span",{className:"w-full truncate text-[10px] font-medium leading-tight",children:S.name}),Ee&&S.type==="file"&&jsxRuntime.jsx("span",{className:"font-mono text-[8px] uppercase text-(--fe-text-muted)",children:Ee})]},S.path+se)})})}),jsxRuntime.jsx("div",{className:i("overflow-hidden transition-[width,opacity] duration-300 ease-out",Vo?i("absolute right-0 top-0 bottom-0 z-10",z?"w-44 opacity-100":"w-0 opacity-0 pointer-events-none"):i("shrink-0",z?"w-56":"w-0")),children:z&&jsxRuntime.jsxs("div",{className:i("flex h-full flex-col p-4",Vo?"fe-panel-narrow w-44":"fe-panel w-56 border-l border-(--fe-border)"),children:[Vo&&jsxRuntime.jsx("button",{className:"fe-btn mb-2 self-end",onClick:()=>{V(null),D(new Set);},title:"Close panel",children:jsxRuntime.jsx(lucideReact.X,{className:"h-3.5 w-3.5"})}),jsxRuntime.jsxs("div",{className:"mb-3 flex flex-col items-center",children:[Kr__default.default.createElement(xs(z),{className:i("h-10 w-10 mb-2",z.type==="directory"?"text-(--fe-accent)":"text-(--fe-text-muted)")}),jsxRuntime.jsx("span",{className:"w-full text-center text-xs font-semibold text-(--fe-text-strong) break-all leading-tight",children:z.name})]}),jsxRuntime.jsxs("div",{className:"space-y-2.5 text-[10px]",children:[jsxRuntime.jsx(Sr,{label:"Type",value:z.type==="directory"?"Directory":z.mimeType||z.extension||bo(z.name)||"File"}),z.size!=null&&jsxRuntime.jsx(Sr,{label:"Size",value:bl(z.size)}),jsxRuntime.jsx(Sr,{label:"Path",value:z.path,mono:true}),z.extension&&jsxRuntime.jsx(Sr,{label:"Extension",value:z.extension}),z.modifiedAt&&jsxRuntime.jsx(Sr,{label:"Modified",value:hs(z.modifiedAt)}),z.createdAt&&jsxRuntime.jsx(Sr,{label:"Created",value:hs(z.createdAt)})]}),jsxRuntime.jsxs("div",{className:"mt-auto flex flex-col gap-1.5",children:[z.type==="file"&&m&&jsxRuntime.jsxs("button",{className:"flex items-center justify-center gap-1.5 rounded-lg py-1.5 text-[10px] font-semibold uppercase tracking-wider text-(--fe-text-strong) transition-colors",style:{background:"color-mix(in srgb, var(--fe-accent) 20%, transparent)",border:"1px solid color-mix(in srgb, var(--fe-accent) 30%, transparent)"},onClick:()=>m(z),children:[jsxRuntime.jsx(lucideReact.ArrowUp,{className:"h-3 w-3 rotate-45"}),"Open"]}),w?.map(S=>jsxRuntime.jsxs("button",{className:"fe-action flex items-center justify-center gap-1.5 rounded-lg py-1.5 text-[10px] font-semibold uppercase tracking-wider text-(--fe-text) transition-colors hover:text-(--fe-text-strong)",onClick:()=>S.onClick(z),children:[S.icon&&Kr__default.default.createElement(S.icon,{className:"h-3 w-3"}),S.label]},S.key))]})]})})]}),jsxRuntime.jsxs("div",{className:"fe-statusbar flex h-6 shrink-0 items-center justify-between px-3 text-[9px] font-mono text-(--fe-text-muted)",children:[jsxRuntime.jsxs("span",{children:[ee.length," items"]}),jsxRuntime.jsxs("div",{className:"flex items-center gap-2",children:[R.size>0&&jsxRuntime.jsxs("span",{className:"text-(--fe-accent)/70",children:[R.size," selected"]}),jsxRuntime.jsx("span",{className:"opacity-50",children:"Ctrl+Click multi-select \xB7 Esc clear"})]})]}),y&&!k&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("div",{className:"absolute top-0 left-4 right-4 h-3 cursor-ns-resize",onMouseDown:S=>G("n",S),onTouchStart:S=>ye("n",S)}),jsxRuntime.jsx("div",{className:"absolute bottom-0 left-4 right-4 h-3 cursor-ns-resize",onMouseDown:S=>G("s",S),onTouchStart:S=>ye("s",S)}),jsxRuntime.jsx("div",{className:"absolute top-4 left-0 bottom-4 w-3 cursor-ew-resize",onMouseDown:S=>G("w",S),onTouchStart:S=>ye("w",S)}),jsxRuntime.jsx("div",{className:"absolute top-4 right-0 bottom-4 w-3 cursor-ew-resize",onMouseDown:S=>G("e",S),onTouchStart:S=>ye("e",S)}),jsxRuntime.jsx("div",{className:"absolute top-0 left-0 h-6 w-6 cursor-nwse-resize",onMouseDown:S=>G("nw",S),onTouchStart:S=>ye("nw",S)}),jsxRuntime.jsx("div",{className:"absolute top-0 right-0 h-6 w-6 cursor-nesw-resize",onMouseDown:S=>G("ne",S),onTouchStart:S=>ye("ne",S)}),jsxRuntime.jsx("div",{className:"absolute bottom-0 left-0 h-6 w-6 cursor-nesw-resize",onMouseDown:S=>G("sw",S),onTouchStart:S=>ye("sw",S)}),jsxRuntime.jsx("div",{className:"absolute bottom-0 right-0 h-6 w-6 cursor-nwse-resize",onMouseDown:S=>G("se",S),onTouchStart:S=>ye("se",S)})]}),jsxRuntime.jsx("style",{children:`
23
+ `})]});return jsxRuntime.jsx("div",{className:s($&&"fixed inset-0 z-100 flex items-center justify-center p-8",$&&(J?"animate-[cp-cinema-out_0.5s_ease-in_both]":"animate-[cp-cinema-in_0.5s_ease-out_both]")),onClick:$?A=>{A.target===A.currentTarget&&Y();}:void 0,children:jsxRuntime.jsx("div",{className:s($&&"w-full",$&&!re&&"max-w-5xl"),children:Ne})})}function Ma(e){let t=e.lastIndexOf(".");return t>0?e.slice(t).toLowerCase():""}function Dl(e){return e==null?"\u2014":e<1024?`${e} B`:e<1024*1024?`${(e/1024).toFixed(1)} KB`:e<1024*1024*1024?`${(e/(1024*1024)).toFixed(1)} MB`:`${(e/(1024*1024*1024)).toFixed(2)} GB`}function Di(e){return e?(typeof e=="string"?new Date(e):e).toLocaleDateString(void 0,{year:"numeric",month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"}):"\u2014"}var Ff={".png":lucideReact.Image,".jpg":lucideReact.Image,".jpeg":lucideReact.Image,".gif":lucideReact.Image,".svg":lucideReact.Image,".webp":lucideReact.Image,".ico":lucideReact.Image,".bmp":lucideReact.Image,".mp3":lucideReact.Music,".wav":lucideReact.Music,".flac":lucideReact.Music,".ogg":lucideReact.Music,".aac":lucideReact.Music,".m4a":lucideReact.Music,".mp4":lucideReact.Video,".mkv":lucideReact.Video,".avi":lucideReact.Video,".mov":lucideReact.Video,".wmv":lucideReact.Video,".webm":lucideReact.Video,".ts":lucideReact.FileCode,".tsx":lucideReact.FileCode,".js":lucideReact.FileCode,".jsx":lucideReact.FileCode,".json":lucideReact.FileCode,".html":lucideReact.FileCode,".css":lucideReact.FileCode,".scss":lucideReact.FileCode,".py":lucideReact.FileCode,".rs":lucideReact.FileCode,".go":lucideReact.FileCode,".java":lucideReact.FileCode,".c":lucideReact.FileCode,".cpp":lucideReact.FileCode,".h":lucideReact.FileCode,".sh":lucideReact.Terminal,".bat":lucideReact.Terminal,".ps1":lucideReact.Terminal,".md":lucideReact.FileText,".txt":lucideReact.FileText,".pdf":lucideReact.FileText,".doc":lucideReact.FileText,".docx":lucideReact.FileText,".rtf":lucideReact.FileText,".csv":lucideReact.FileSpreadsheet,".xls":lucideReact.FileSpreadsheet,".xlsx":lucideReact.FileSpreadsheet,".db":lucideReact.Database,".sqlite":lucideReact.Database,".sql":lucideReact.Database,".zip":lucideReact.FileArchive,".tar":lucideReact.FileArchive,".gz":lucideReact.FileArchive,".rar":lucideReact.FileArchive,".7z":lucideReact.FileArchive};function Li(e){if(e.type==="directory")return lucideReact.Folder;let t=e.extension||Ma(e.name);return Ff[t]||lucideReact.File}function Vr(e,t,r){return Math.max(t,Math.min(r,e))}function Ll(e){return e<480?"xs":e<640?"sm":e<1024?"md":"lg"}function El(e,t){if(e<480)return {size:{width:e-16,height:t-48},pos:{x:8,y:24}};if(e<640){let a=e-24,i=Math.min(t-64,540);return {size:{width:a,height:i},pos:{x:12,y:32}}}if(e<1024){let a=Math.min(640,e-32),i=Math.min(480,t-64);return {size:{width:a,height:i},pos:{x:Math.max(0,Math.round((e-a)/2)),y:Math.max(0,Math.round((t-i)/2))}}}let r=720,n=520;return {size:{width:r,height:n},pos:{x:Math.max(0,Math.round((e-r)/2)),y:Math.max(0,Math.round((t-n)/2))}}}function Ei({files:e,title:t="File Explorer",accent:r="#8b5cf6",defaultView:n="list",initialPosition:a,initialSize:i,dockable:o=false,dockSide:l="right",visible:c=true,onFileOpen:m,onSelectionChange:d,onNavigate:f,onDelete:p,onClose:u,onMinimize:h,onPathSubmit:g,defaultInputMode:b="search",actions:N,resizable:x=true,minSize:T={width:400,height:300},className:w}){let[C,S]=qr.useState(n),[R,V]=qr.useState(new Set),[I,E]=qr.useState(null),[v,U]=qr.useState(false),[k,q]=qr.useState(false),[M,W]=qr.useState(""),[$,ue]=qr.useState(b),[J,de]=qr.useState(c),[re,B]=qr.useState(false),[j,pe]=qr.useState({w:window.innerWidth,h:window.innerHeight}),ye=El(window.innerWidth,window.innerHeight),[y,L]=qr.useState(a??ye.pos),[G,O]=qr.useState(i??ye.size),[_,ee]=qr.useState(null),xe=qr.useRef(false),P=qr.useRef({x:0,y:0}),F=qr.useRef(null),K=qr.useRef(false),oe=qr.useRef({x:0,y:0,w:0,h:0,px:0,py:0}),X=qr.useRef(false),fe=qr.useRef(v);qr.useEffect(()=>{fe.current=v;},[v]);let we=c!==void 0?c:J,H=qr.useMemo(()=>{let D=e.filter(Me=>Me.type==="directory"),ce=e.filter(Me=>Me.type==="file");return D.sort((Me,Re)=>Me.name.localeCompare(Re.name)),ce.sort((Me,Re)=>Me.name.localeCompare(Re.name)),[...D,...ce]},[e]),ne=qr.useMemo(()=>{if($!=="search"||!M.trim())return H;let D=M.toLowerCase();return H.filter(ce=>ce.name.toLowerCase().includes(D))},[H,M,$]),Y=I!=null?ne[I]:null;qr.useEffect(()=>{let D=Ll(window.innerWidth),ce=()=>{let Me=window.innerWidth,Re=window.innerHeight;if(pe({w:Me,h:Re}),fe.current)return;let Ee=Ll(Me);if(Ee!==D&&!X.current&&!i){let at=El(Me,Re);O(at.size),L(at.pos);}D=Ee;};return window.addEventListener("resize",ce),()=>window.removeEventListener("resize",ce)},[i]);let Q=qr.useCallback((D,ce)=>{V(Me=>{let Re=new Set(Me);return ce.ctrlKey||ce.metaKey?Re.has(D)?Re.delete(D):Re.add(D):(Re.clear(),Re.add(D)),Re}),E(D);},[]);qr.useEffect(()=>{if(!d)return;let D=Array.from(R).map(ce=>ne[ce]).filter(Boolean);d(D);},[R]);let ke=qr.useCallback(D=>{let ce=ne[D];ce&&(ce.type==="directory"?f?.(ce.path):m?.(ce));},[ne,m,f]),He=qr.useCallback(D=>{v||D.target.closest("button")||(X.current=true,xe.current=true,P.current={x:D.clientX-y.x,y:D.clientY-y.y},D.preventDefault());},[y,v]),Fe=qr.useCallback(D=>{if(v||D.target.closest("button"))return;X.current=true;let ce=D.touches[0];xe.current=true,P.current={x:ce.clientX-y.x,y:ce.clientY-y.y};},[y,v]);qr.useEffect(()=>{let D=Re=>{if(!xe.current)return;let Ee=window.innerWidth-100,at=window.innerHeight-40;L({x:Vr(Re.clientX-P.current.x,0,Ee),y:Vr(Re.clientY-P.current.y,0,at)});},ce=Re=>{if(!xe.current)return;Re.preventDefault();let Ee=Re.touches[0],at=window.innerWidth-100,Ut=window.innerHeight-40;L({x:Vr(Ee.clientX-P.current.x,0,at),y:Vr(Ee.clientY-P.current.y,0,Ut)});},Me=()=>{xe.current=false,K.current=false,document.body.style.cursor="",document.body.style.userSelect="";};return window.addEventListener("mousemove",D),window.addEventListener("mouseup",Me),window.addEventListener("touchmove",ce,{passive:false}),window.addEventListener("touchend",Me),()=>{window.removeEventListener("mousemove",D),window.removeEventListener("mouseup",Me),window.removeEventListener("touchmove",ce),window.removeEventListener("touchend",Me);}},[]);let Z=qr.useCallback((D,ce)=>{v||(ce.preventDefault(),ce.stopPropagation(),X.current=true,K.current=D,oe.current={x:ce.clientX,y:ce.clientY,w:G.width,h:G.height,px:y.x,py:y.y},document.body.style.cursor=D==="e"||D==="w"?"ew-resize":D==="n"||D==="s"?"ns-resize":D==="nw"||D==="se"?"nwse-resize":"nesw-resize",document.body.style.userSelect="none");},[v,G,y]),Ne=qr.useCallback((D,ce)=>{if(v)return;ce.preventDefault(),ce.stopPropagation(),X.current=true;let Me=ce.touches[0];K.current=D,oe.current={x:Me.clientX,y:Me.clientY,w:G.width,h:G.height,px:y.x,py:y.y},document.body.style.userSelect="none";},[v,G,y]);qr.useEffect(()=>{let D=(Ee,at)=>{let Ut=K.current;if(!Ut)return;let ds=Ee-oe.current.x,ms=at-oe.current.y,{w:mr,h:pr,px:Wa,py:ja}=oe.current;if(Ut.includes("e")&&(mr=Math.max(T.width,mr+ds)),Ut.includes("w")){let zr=Math.max(T.width,mr-ds);Wa=Wa+(mr-zr),mr=zr;}if(Ut.includes("s")&&(pr=Math.max(T.height,pr+ms)),Ut.includes("n")){let zr=Math.max(T.height,pr-ms);ja=ja+(pr-zr),pr=zr;}O({width:mr,height:pr}),L({x:Wa,y:ja});},ce=Ee=>{K.current&&D(Ee.clientX,Ee.clientY);},Me=Ee=>{K.current&&(Ee.preventDefault(),D(Ee.touches[0].clientX,Ee.touches[0].clientY));},Re=()=>{K.current=false,document.body.style.cursor="",document.body.style.userSelect="";};return window.addEventListener("mousemove",ce),window.addEventListener("mouseup",Re),window.addEventListener("touchmove",Me,{passive:false}),window.addEventListener("touchend",Re),()=>{window.removeEventListener("mousemove",ce),window.removeEventListener("mouseup",Re),window.removeEventListener("touchmove",Me),window.removeEventListener("touchend",Re);}},[T]);let A=qr.useCallback(()=>{v?(_&&(L(_.pos),O(_.size)),U(false)):(ee({pos:y,size:G}),U(true));},[v,y,G,_]),ae=qr.useCallback(()=>{k?q(false):(v&&(U(false),_&&(L(_.pos),O(_.size))),q(true),h?.());},[k,v,_,h]);qr.useEffect(()=>{if(!we||k)return;let D=ce=>{if(!(!F.current?.contains(document.activeElement)&&document.activeElement!==F.current)){if(ce.key==="Escape"&&(E(null),V(new Set)),ce.ctrlKey&&ce.key==="a"){ce.preventDefault();let Me=new Set(ne.map((Re,Ee)=>Ee));V(Me);}ce.key==="Delete"&&R.size>0&&p&&(ce.preventDefault(),B(true));}};return window.addEventListener("keydown",D),()=>window.removeEventListener("keydown",D)},[we,k,ne,R,p]);let se={"--fe-accent":r};if(k)return jsxRuntime.jsx("div",{className:s("fixed z-100 cursor-pointer transition-all duration-300",l==="right"?"right-0 top-1/2 -translate-y-1/2":"left-0 top-1/2 -translate-y-1/2"),style:se,onClick:()=>q(false),title:`Restore ${t}`,children:jsxRuntime.jsxs("div",{className:"fe-dock flex items-center gap-1.5 rounded-l-lg px-2 py-3 backdrop-blur-md",style:{writingMode:"vertical-rl",textOrientation:"mixed"},children:[jsxRuntime.jsx(lucideReact.HardDrive,{className:"h-3.5 w-3.5 text-(--fe-accent)"}),jsxRuntime.jsx("span",{className:"text-[10px] font-bold uppercase tracking-widest text-(--fe-text)",children:t})]})});if(!we)return null;let z=v?j.w:Math.min(G.width,j.w-8),ve=v?j.h:Math.min(G.height,j.h-8),_e=v?0:Vr(y.x,0,Math.max(0,j.w-z)),mt=v?0:Vr(y.y,0,Math.max(0,j.h-40)),Xa=z<500;return jsxRuntime.jsxs("div",{ref:F,className:s("fe-window fixed z-100 flex flex-col overflow-hidden","rounded-xl border border-(--fe-border)","animate-[fe-window-in_0.35s_cubic-bezier(0.16,1,0.3,1)_both]",v&&"rounded-none",w),style:{...se,left:_e,top:mt,width:z,height:ve,transition:v?"left 0.3s, top 0.3s, width 0.3s, height 0.3s":void 0},tabIndex:0,children:[jsxRuntime.jsxs("div",{className:"fe-titlebar group/titlebar flex h-10 shrink-0 cursor-grab items-center justify-between px-3 select-none active:cursor-grabbing",onMouseDown:He,onTouchStart:Fe,onDoubleClick:A,children:[jsxRuntime.jsxs("div",{className:"flex items-center gap-2",children:[jsxRuntime.jsx("div",{className:"flex h-5 w-5 items-center justify-center rounded",style:{background:"color-mix(in srgb, var(--fe-accent) 25%, transparent)"},children:jsxRuntime.jsx(lucideReact.HardDrive,{className:"h-3 w-3 text-(--fe-accent)"})}),jsxRuntime.jsx("span",{className:"text-xs font-bold uppercase tracking-widest text-(--fe-text)",children:t}),jsxRuntime.jsx("div",{className:"ml-2 hidden h-px w-20 md:block",style:{background:"linear-gradient(90deg, var(--fe-accent), transparent)",opacity:.3}})]}),jsxRuntime.jsxs("div",{className:"flex items-center gap-0.5",children:[jsxRuntime.jsx("button",{className:"fe-btn mr-1",onClick:()=>S(D=>D==="list"?"grid":"list"),title:C==="list"?"Grid view":"List view",children:C==="list"?jsxRuntime.jsx(lucideReact.LayoutGrid,{className:"h-3.5 w-3.5"}):jsxRuntime.jsx(lucideReact.LayoutList,{className:"h-3.5 w-3.5"})}),o&&jsxRuntime.jsx("button",{className:"fe-btn",onClick:ae,title:"Dock to edge",children:jsxRuntime.jsx(lucideReact.Minus,{className:"h-3.5 w-3.5"})}),jsxRuntime.jsx("button",{className:"fe-btn",onClick:A,title:v?"Restore":"Maximize",children:v?jsxRuntime.jsx(lucideReact.Minimize2,{className:"h-3.5 w-3.5"}):jsxRuntime.jsx(lucideReact.Maximize2,{className:"h-3.5 w-3.5"})}),jsxRuntime.jsx("button",{className:"fe-btn hover:bg-red-500/40! hover:text-red-300!",onClick:()=>{u?.(),de(false);},title:"Close",children:jsxRuntime.jsx(lucideReact.X,{className:"h-3.5 w-3.5"})})]})]}),jsxRuntime.jsxs("div",{className:"fe-toolbar flex h-9 shrink-0 items-center gap-2 px-3",children:[jsxRuntime.jsx("button",{className:"fe-btn p-1",onClick:()=>f?.(".."),title:"Go up",children:jsxRuntime.jsx(lucideReact.FolderUp,{className:"h-3.5 w-3.5"})}),jsxRuntime.jsx("button",{className:"fe-btn shrink-0 px-1.5 py-0.5 text-[9px] font-bold uppercase tracking-wider",style:$==="navigate"?{color:"var(--fe-accent)",background:"color-mix(in srgb, var(--fe-accent) 15%, transparent)"}:void 0,onClick:()=>ue(D=>D==="search"?"navigate":"search"),title:$==="search"?"Switch to path navigation":"Switch to file search",children:$==="search"?jsxRuntime.jsx(lucideReact.Search,{className:"h-3 w-3"}):jsxRuntime.jsx(lucideReact.CornerRightDown,{className:"h-3 w-3"})}),jsxRuntime.jsx("div",{className:"relative flex-1",children:jsxRuntime.jsx("input",{type:"text",value:M,onChange:D=>W(D.target.value),onKeyDown:D=>{D.key==="Enter"&&M.trim()&&$==="navigate"&&(g?g(M.trim()):f?.(M.trim()));},placeholder:$==="search"?"Search files\u2026":"Enter path and press Enter\u2026",className:"h-6 w-full rounded border border-(--fe-input-border) bg-(--fe-input-bg) px-2 text-[11px] text-(--fe-text-strong) placeholder:text-(--fe-text-muted) outline-none transition-colors focus:border-(--fe-accent)/40 focus:bg-(--fe-input-bg)"})}),jsxRuntime.jsxs("span",{className:"shrink-0 font-mono text-[10px] text-(--fe-text-muted)",children:[ne.length," item",ne.length!==1?"s":"",R.size>0&&` \xB7 ${R.size} selected`]})]}),jsxRuntime.jsxs("div",{className:"relative flex flex-1 min-h-0",children:[jsxRuntime.jsx("div",{className:"flex-1 overflow-y-auto overflow-x-hidden p-1.5",onClick:D=>{D.target===D.currentTarget&&(V(new Set),E(null));},children:ne.length===0?jsxRuntime.jsxs("div",{className:"flex h-full flex-col items-center justify-center text-(--fe-text-muted)",children:[jsxRuntime.jsx(lucideReact.Folder,{className:"mb-2 h-10 w-10"}),jsxRuntime.jsx("span",{className:"text-xs",children:"No files found"})]}):C==="list"?jsxRuntime.jsx("div",{className:"space-y-px",children:ne.map((D,ce)=>{let Me=Li(D),Re=R.has(ce),Ee=D.extension||Ma(D.name);return jsxRuntime.jsxs("div",{className:s("fe-item group/item flex items-center gap-2.5 rounded-lg px-2.5 py-1.5 text-(--fe-text) transition-all duration-150 cursor-pointer",Re?"bg-(--fe-accent)/15 text-(--fe-text-strong)":"hover:bg-(--fe-surface-hover) hover:text-(--fe-text-strong)"),style:Re?{boxShadow:"inset 2px 0 0 var(--fe-accent)"}:void 0,onClick:at=>Q(ce,at),onDoubleClick:()=>ke(ce),children:[jsxRuntime.jsx(Me,{className:s("h-4 w-4 shrink-0",D.type==="directory"?"text-(--fe-accent)":"text-(--fe-text-muted)")}),jsxRuntime.jsx("span",{className:"flex-1 truncate text-xs font-medium",children:D.name}),Ee&&D.type==="file"&&jsxRuntime.jsx("span",{className:"shrink-0 rounded bg-(--fe-badge-bg) px-1.5 py-0.5 font-mono text-[9px] uppercase text-(--fe-text-muted)",children:Ee}),D.size!=null&&jsxRuntime.jsx("span",{className:"shrink-0 font-mono text-[10px] text-(--fe-text-muted)",children:Dl(D.size)}),D.modifiedAt&&jsxRuntime.jsx("span",{className:"hidden shrink-0 font-mono text-[10px] text-(--fe-text-muted) lg:inline",children:Di(D.modifiedAt)})]},D.path+ce)})}):jsxRuntime.jsx("div",{className:"grid grid-cols-[repeat(auto-fill,minmax(90px,1fr))] gap-1.5 p-1",children:ne.map((D,ce)=>{let Me=Li(D),Re=R.has(ce),Ee=D.extension||Ma(D.name);return jsxRuntime.jsxs("div",{className:s("fe-item group/item flex cursor-pointer flex-col items-center gap-1 rounded-lg px-2 py-2.5 text-center transition-all duration-150",Re?"bg-(--fe-accent)/15 text-(--fe-text-strong) ring-1 ring-(--fe-accent)/30":"text-(--fe-text) hover:bg-(--fe-surface-hover) hover:text-(--fe-text-strong)"),onClick:at=>Q(ce,at),onDoubleClick:()=>ke(ce),children:[jsxRuntime.jsx(Me,{className:s("h-7 w-7",D.type==="directory"?"text-(--fe-accent)":"text-(--fe-text-muted)")}),jsxRuntime.jsx("span",{className:"w-full truncate text-[10px] font-medium leading-tight",children:D.name}),Ee&&D.type==="file"&&jsxRuntime.jsx("span",{className:"font-mono text-[8px] uppercase text-(--fe-text-muted)",children:Ee})]},D.path+ce)})})}),jsxRuntime.jsx("div",{className:s("overflow-hidden transition-[width,opacity] duration-300 ease-out",Xa?s("absolute right-0 top-0 bottom-0 z-10",Y?"w-44 opacity-100":"w-0 opacity-0 pointer-events-none"):s("shrink-0",Y?"w-56":"w-0")),children:Y&&jsxRuntime.jsxs("div",{className:s("flex h-full flex-col p-4",Xa?"fe-panel-narrow w-44":"fe-panel w-56 border-l border-(--fe-border)"),children:[Xa&&jsxRuntime.jsx("button",{className:"fe-btn mb-2 self-end",onClick:()=>{E(null),V(new Set);},title:"Close panel",children:jsxRuntime.jsx(lucideReact.X,{className:"h-3.5 w-3.5"})}),jsxRuntime.jsxs("div",{className:"mb-3 flex flex-col items-center",children:[qr__default.default.createElement(Li(Y),{className:s("h-10 w-10 mb-2",Y.type==="directory"?"text-(--fe-accent)":"text-(--fe-text-muted)")}),jsxRuntime.jsx("span",{className:"w-full text-center text-xs font-semibold text-(--fe-text-strong) break-all leading-tight",children:Y.name})]}),jsxRuntime.jsxs("div",{className:"space-y-2.5 text-[10px]",children:[jsxRuntime.jsx(Ir,{label:"Type",value:Y.type==="directory"?"Directory":Y.mimeType||Y.extension||Ma(Y.name)||"File"}),Y.size!=null&&jsxRuntime.jsx(Ir,{label:"Size",value:Dl(Y.size)}),jsxRuntime.jsx(Ir,{label:"Path",value:Y.path,mono:true}),Y.extension&&jsxRuntime.jsx(Ir,{label:"Extension",value:Y.extension}),Y.modifiedAt&&jsxRuntime.jsx(Ir,{label:"Modified",value:Di(Y.modifiedAt)}),Y.createdAt&&jsxRuntime.jsx(Ir,{label:"Created",value:Di(Y.createdAt)})]}),jsxRuntime.jsxs("div",{className:"mt-auto flex flex-col gap-1.5",children:[Y.type==="file"&&m&&jsxRuntime.jsxs("button",{className:"flex items-center justify-center gap-1.5 rounded-lg py-1.5 text-[10px] font-semibold uppercase tracking-wider text-(--fe-text-strong) transition-colors",style:{background:"color-mix(in srgb, var(--fe-accent) 20%, transparent)",border:"1px solid color-mix(in srgb, var(--fe-accent) 30%, transparent)"},onClick:()=>m(Y),children:[jsxRuntime.jsx(lucideReact.ArrowUp,{className:"h-3 w-3 rotate-45"}),"Open"]}),N?.map(D=>jsxRuntime.jsxs("button",{className:"fe-action flex items-center justify-center gap-1.5 rounded-lg py-1.5 text-[10px] font-semibold uppercase tracking-wider text-(--fe-text) transition-colors hover:text-(--fe-text-strong)",onClick:()=>D.onClick(Y),children:[D.icon&&qr__default.default.createElement(D.icon,{className:"h-3 w-3"}),D.label]},D.key))]})]})})]}),jsxRuntime.jsxs("div",{className:"fe-statusbar flex h-6 shrink-0 items-center justify-between px-3 text-[9px] font-mono text-(--fe-text-muted)",children:[jsxRuntime.jsxs("span",{children:[ne.length," items"]}),jsxRuntime.jsxs("div",{className:"flex items-center gap-2",children:[R.size>0&&jsxRuntime.jsxs("span",{className:"text-(--fe-accent)/70",children:[R.size," selected"]}),jsxRuntime.jsx("span",{className:"opacity-50",children:"Ctrl+Click multi-select \xB7 Esc clear"})]})]}),x&&!v&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("div",{className:"absolute top-0 left-4 right-4 h-3 cursor-ns-resize",onMouseDown:D=>Z("n",D),onTouchStart:D=>Ne("n",D)}),jsxRuntime.jsx("div",{className:"absolute bottom-0 left-4 right-4 h-3 cursor-ns-resize",onMouseDown:D=>Z("s",D),onTouchStart:D=>Ne("s",D)}),jsxRuntime.jsx("div",{className:"absolute top-4 left-0 bottom-4 w-3 cursor-ew-resize",onMouseDown:D=>Z("w",D),onTouchStart:D=>Ne("w",D)}),jsxRuntime.jsx("div",{className:"absolute top-4 right-0 bottom-4 w-3 cursor-ew-resize",onMouseDown:D=>Z("e",D),onTouchStart:D=>Ne("e",D)}),jsxRuntime.jsx("div",{className:"absolute top-0 left-0 h-6 w-6 cursor-nwse-resize",onMouseDown:D=>Z("nw",D),onTouchStart:D=>Ne("nw",D)}),jsxRuntime.jsx("div",{className:"absolute top-0 right-0 h-6 w-6 cursor-nesw-resize",onMouseDown:D=>Z("ne",D),onTouchStart:D=>Ne("ne",D)}),jsxRuntime.jsx("div",{className:"absolute bottom-0 left-0 h-6 w-6 cursor-nesw-resize",onMouseDown:D=>Z("sw",D),onTouchStart:D=>Ne("sw",D)}),jsxRuntime.jsx("div",{className:"absolute bottom-0 right-0 h-6 w-6 cursor-nwse-resize",onMouseDown:D=>Z("se",D),onTouchStart:D=>Ne("se",D)})]}),jsxRuntime.jsx("style",{children:`
24
24
  .fe-window {
25
25
  background: var(--fe-bg);
26
26
  box-shadow: var(--fe-shadow);
@@ -81,4 +81,4 @@
81
81
  from { opacity: 0; transform: translateX(-4px); }
82
82
  to { opacity: 1; transform: translateX(0); }
83
83
  }
84
- `}),jsxRuntime.jsx(Jr,{open:fe,onOpenChange:$,children:jsxRuntime.jsxs(Ba,{size:"sm",children:[jsxRuntime.jsxs(za,{children:[jsxRuntime.jsxs($a,{children:[jsxRuntime.jsx(lucideReact.AlertTriangle,{className:"text-danger-500"}),"Confirm Deletion"]}),jsxRuntime.jsxs(Oa,{children:[R.size===1?`Are you sure you want to delete "${ee[Array.from(R)[0]]?.name}"?`:`Are you sure you want to delete ${R.size} selected items?`," ","This action cannot be undone."]})]}),jsxRuntime.jsxs(Ka,{children:[jsxRuntime.jsx(dr,{intent:"ghost",onClick:()=>$(false),children:"Cancel"}),jsxRuntime.jsxs(dr,{intent:"danger",onClick:()=>{let S=Array.from(R).map(se=>ee[se]).filter(Boolean);p?.(S),D(new Set),V(null),$(false);},children:[jsxRuntime.jsx(lucideReact.Trash2,{className:"h-4 w-4"}),"Delete"]})]})]})})]})}function Sr({label:e,value:t,mono:r}){return jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("div",{className:"mb-0.5 font-semibold uppercase tracking-wider text-(--fe-text-muted)",children:e}),jsxRuntime.jsx("div",{className:i("text-(--fe-text) break-all leading-snug",r&&"font-mono text-[9px]"),children:t})]})}function cf(e,t){let r=t.getBoundingClientRect(),n=Math.max(r.width,r.height)*1.2,o=e.clientX-r.left,s=e.clientY-r.top,a=document.createElement("span");a.className="masonry-ripple",a.style.width=`${n}px`,a.style.height=`${n}px`,a.style.left=`${o}px`,a.style.top=`${s}px`,t.appendChild(a),a.addEventListener("animationend",()=>a.remove());}function Ns({columns:e,columnWidth:t=240,gap:r=16,items:n,onItemClick:o,className:s,style:a,children:l,...d}){let m=Kr.useRef(null),c=Kr.useRef([]),[f,p]=Kr.useState(()=>e??1),[u,h]=Kr.useState([]),[g,x]=Kr.useState(0),w=n?n.map((R,D)=>({key:R.key??D,node:R.content})):Kr__default.default.Children.toArray(l).map((R,D)=>({key:R.key??D,node:R})),y=w.length,M=Kr.useCallback(R=>e??Math.max(1,Math.floor((R+r)/(t+r))),[e,t,r]),v=Kr.useCallback(()=>{let R=m.current;if(!R)return;let D=R.clientWidth,A=M(D);p(A);let V=(D-(A-1)*r)/A,k=new Array(A).fill(0),O=[];for(let X=0;X<y;X++){let T=c.current[X],re=T?T.offsetHeight:0,_=0;for(let de=1;de<A;de++)k[de]<k[_]&&(_=de);O.push({top:k[_],left:_*(V+r),width:V}),k[_]+=re+r;}let C=Math.max(0,...k)-(y?r:0);h(O),x(C);},[y,M,r]);Kr.useEffect(()=>{let R=m.current;if(!R)return;let D=new ResizeObserver(()=>v());return D.observe(R),()=>D.disconnect()},[v]),Kr.useEffect(()=>{let R=requestAnimationFrame(v);return ()=>cancelAnimationFrame(R)},[v]),Kr.useEffect(()=>{let R=new ResizeObserver(()=>v());return c.current.forEach(D=>{D&&R.observe(D);}),()=>R.disconnect()},[y,f,v]);let N=Kr.useCallback((R,D)=>{let A=R.currentTarget;cf(R,A),o?.(n?.[D],D);},[o,n]),L=R=>{if(!n)return false;let D=n[R];return !!(D.title||D.description||D.actions)};return jsxRuntime.jsx("div",{ref:m,className:i("relative",s),style:{...a,height:g},...d,children:w.map((R,D)=>jsxRuntime.jsxs("div",{ref:A=>{c.current[D]=A;},className:"masonry-item",role:"button",tabIndex:0,onClick:A=>N(A,D),onKeyDown:A=>{(A.key==="Enter"||A.key===" ")&&(A.preventDefault(),o?.(n?.[D],D));},style:{position:"absolute",top:u[D]?.top??0,left:u[D]?.left??0,width:u[D]?.width??"100%"},children:[R.node,L(D)&&jsxRuntime.jsxs("div",{className:"masonry-item-overlay",children:[n[D].title&&jsxRuntime.jsx("p",{className:"masonry-item-overlay-title",children:n[D].title}),n[D].description&&jsxRuntime.jsx("p",{className:"masonry-item-overlay-desc",children:n[D].description}),n[D].actions&&jsxRuntime.jsx("div",{className:"masonry-item-overlay-actions",children:n[D].actions})]})]},R.key))})}function ko({text:e="",mode:t="typewriter",speed:r=40,cursor:n=true,cursorChar:o="\u258B",thinking:s=false,streaming:a=false,delay:l=0,onComplete:d,as:m="span",className:c}){let[f,p]=Kr.useState(t==="instant"?e:""),[u,h]=Kr.useState(false),[g,x]=Kr.useState(t==="instant"),[w,y]=Kr.useState(false),M=Kr.useRef(0),v=Kr.useRef(d);v.current=d;let N=Kr.useRef(e);N.current=e,Kr.useEffect(()=>{if(t!=="typewriter")return;if(p(""),x(false),y(false),h(false),!e){x(true);return}let V=Math.max(10,1e3/r),k=0,O,C=()=>{h(true),O=setInterval(()=>{let T=N.current;k++,p(T.slice(0,k)),k>=T.length&&(clearInterval(O),h(false),x(true),v.current?.());},V);},X;return l>0?X=setTimeout(C,l):C(),()=>{clearTimeout(X),clearInterval(O);}},[e,t]),Kr.useEffect(()=>{if(t!=="stream")return;if(e.length===0){M.current=0,p(""),h(false),x(false),y(false);return}if(e.length<=M.current)return;let V=Math.max(10,1e3/r),k=M.current;h(true),x(false),y(false);let O=setInterval(()=>{k++,M.current=k,p(N.current.slice(0,k)),k>=N.current.length&&(clearInterval(O),h(false),v.current?.());},V);return ()=>clearInterval(O)},[e,t]),Kr.useEffect(()=>{t==="instant"&&(p(e),h(false),x(true));},[e,t]);let L=Kr.useRef(a);Kr.useEffect(()=>{let V=L.current;if(L.current=a,V&&!a&&!u&&t==="stream"){y(true);let k=setTimeout(()=>{y(false),x(true);},650);return ()=>clearTimeout(k)}},[a,u,t]);let R=n&&(s||u||w||t==="stream"&&a&&!g||t==="typewriter"&&!g),D=s?"tw-cursor--blink":u?"tw-cursor--solid":w?"tw-cursor--out":"tw-cursor--blink";return jsxRuntime.jsxs(m,{className:i(c),children:[s&&!f&&jsxRuntime.jsx("span",{"aria-hidden":"true",children:"\u200B"}),f,R&&jsxRuntime.jsx("span",{className:i("tw-cursor",D),"aria-hidden":"true",children:o})]})}function wo(e){return e.toLowerCase().replace(/\s+/g," ").trim()}function mf(e,t){if(!t)return true;let r=wo(t);return wo(e.label).includes(r)||(e.description?wo(e.description).includes(r):false)||(e.keywords?e.keywords.some(n=>wo(n).includes(r)):false)}function pf(e){let t=new Map;for(let r of e){let n=r.group??"";t.has(n)||t.set(n,[]),t.get(n).push(r);}return Array.from(t.entries()).map(([r,n])=>({label:r,items:n}))}function Rl(e,t,r,n){let[o,s]=Kr.useState(""),[a,l]=Kr.useState(0);Kr.useEffect(()=>{t&&(s(""),l(0));},[t]);let d=Kr.useMemo(()=>e.filter(p=>!p.disabled&&mf(p,o)),[e,o]),m=Kr.useMemo(()=>pf(d),[d]);Kr.useEffect(()=>{l(p=>Math.min(p,Math.max(0,d.length-1)));},[d.length]);let c=Kr.useCallback(()=>{let p=d[a];p&&(p.onSelect(),r(false));},[d,a,r]),f=Kr.useCallback(p=>{switch(p.key){case "ArrowDown":p.preventDefault(),l(u=>(u+1)%Math.max(1,d.length));break;case "ArrowUp":p.preventDefault(),l(u=>(u-1+Math.max(1,d.length))%Math.max(1,d.length));break;case "Enter":p.preventDefault(),c();break;case "Escape":p.preventDefault(),r(false);break}},[d.length,c,r]);return Kr.useEffect(()=>{if(!n)return;function p(u){(u.metaKey||u.ctrlKey)&&u.key==="k"&&(u.preventDefault(),r(!t));}return window.addEventListener("keydown",p),()=>window.removeEventListener("keydown",p)},[n,t,r]),{query:o,setQuery:s,groups:m,filtered:d,activeIndex:a,setActiveIndex:l,handleKeyDown:f}}function No({open:e,onOpenChange:t,commands:r,placeholder:n="Type a command or search\u2026",hotkey:o=true,maxItems:s=8,className:a}){let l=Kr.useRef(null),d=Kr.useRef(null),{query:m,setQuery:c,groups:f,filtered:p,activeIndex:u,setActiveIndex:h,handleKeyDown:g}=Rl(r,e,t,o);if(Kr.useEffect(()=>{if(e){let w=setTimeout(()=>l.current?.focus(),40);return ()=>clearTimeout(w)}},[e]),Kr.useEffect(()=>{d.current?.querySelector("[data-active='true']")?.scrollIntoView({block:"nearest"});},[u]),!e)return null;let x=0;return reactDom.createPortal(jsxRuntime.jsx("div",{className:"cmd-backdrop fixed inset-0 z-50 flex items-start justify-center pt-[15vh]",onClick:()=>t(false),role:"presentation",children:jsxRuntime.jsxs("div",{className:i("cmd-panel relative flex w-full max-w-lg flex-col overflow-hidden rounded-xl","border border-primary-200 bg-white shadow-2xl","dark:border-primary-700 dark:bg-primary-900",a),onClick:w=>w.stopPropagation(),onKeyDown:g,role:"dialog","aria-label":"Command palette","aria-modal":"true",children:[jsxRuntime.jsxs("div",{className:"flex items-center gap-3 border-b border-primary-100 px-4 dark:border-primary-700",children:[jsxRuntime.jsx(lucideReact.Search,{className:"h-4 w-4 shrink-0 text-secondary-400","aria-hidden":"true"}),jsxRuntime.jsx("input",{ref:l,value:m,onChange:w=>c(w.target.value),placeholder:n,className:"flex-1 bg-transparent py-3.5 text-sm text-primary-900 outline-none placeholder:text-secondary-400 dark:text-primary-50","aria-label":"Search commands","aria-controls":"cmd-results","aria-autocomplete":"list","aria-activedescendant":p[u]?`cmd-item-${p[u].id}`:void 0,spellCheck:false,autoComplete:"off"}),jsxRuntime.jsx("kbd",{className:"hidden shrink-0 rounded border border-primary-200 px-1.5 py-0.5 text-xs text-secondary-400 dark:border-primary-600 sm:block",children:"esc"})]}),jsxRuntime.jsx("div",{id:"cmd-results",ref:d,className:"overflow-y-auto py-2",style:{maxHeight:`${s*2.75}rem`},role:"listbox","aria-label":"Commands",children:p.length===0?jsxRuntime.jsxs("div",{className:"flex flex-col items-center gap-2 py-8 text-sm text-secondary-400",children:[jsxRuntime.jsx(lucideReact.Command,{className:"h-8 w-8 opacity-30"}),jsxRuntime.jsx("span",{children:"No commands found"})]}):f.map(w=>jsxRuntime.jsxs("div",{className:"mb-1 last:mb-0",children:[w.label&&jsxRuntime.jsx("p",{className:"px-4 pb-1 pt-2 text-xs font-semibold uppercase tracking-wide text-secondary-400 dark:text-secondary-500",children:w.label}),w.items.map(y=>{let M=x++,v=M===u;return jsxRuntime.jsxs("button",{id:`cmd-item-${y.id}`,"data-active":v,role:"option","aria-selected":v,className:i("cmd-item group flex w-full items-center gap-3 px-4 py-2.5 text-left text-sm",v?"bg-primary-100 text-primary-900 dark:bg-primary-800 dark:text-primary-50":"text-primary-700 hover:bg-primary-50 dark:text-primary-300 dark:hover:bg-primary-800/50"),onMouseEnter:()=>h(M),onClick:()=>{y.onSelect(),t(false);},children:[y.icon&&jsxRuntime.jsx("span",{className:i("flex h-7 w-7 shrink-0 items-center justify-center rounded-md border text-xs",v?"border-primary-300 bg-white text-primary-700 dark:border-primary-600 dark:bg-primary-700 dark:text-primary-200":"border-primary-200 bg-primary-50 text-primary-500 dark:border-primary-700 dark:bg-primary-800 dark:text-primary-400"),children:y.icon}),jsxRuntime.jsxs("span",{className:"min-w-0 flex-1",children:[jsxRuntime.jsx("span",{className:"block truncate font-medium",children:y.label}),y.description&&jsxRuntime.jsx("span",{className:"block truncate text-xs text-secondary-400 dark:text-secondary-500",children:y.description})]}),y.shortcut&&jsxRuntime.jsx("span",{className:"flex shrink-0 items-center gap-0.5",children:y.shortcut.map((N,L)=>jsxRuntime.jsx("kbd",{className:"rounded border border-primary-200 px-1.5 py-0.5 text-xs text-secondary-500 dark:border-primary-700 dark:text-secondary-400",children:N},L))})]},y.id)})]},w.label||"_default"))}),p.length>0&&jsxRuntime.jsxs("div",{className:"flex items-center justify-between border-t border-primary-100 px-4 py-2 dark:border-primary-700",children:[jsxRuntime.jsxs("span",{className:"text-xs text-secondary-400",children:[p.length," result",p.length!==1?"s":""]}),jsxRuntime.jsxs("span",{className:"flex items-center gap-3 text-xs text-secondary-400",children:[jsxRuntime.jsxs("span",{className:"flex items-center gap-1",children:[jsxRuntime.jsx("kbd",{className:"rounded border border-primary-200 px-1 dark:border-primary-700",children:"\u2191"}),jsxRuntime.jsx("kbd",{className:"rounded border border-primary-200 px-1 dark:border-primary-700",children:"\u2193"}),"Navigate"]}),jsxRuntime.jsxs("span",{className:"flex items-center gap-1",children:[jsxRuntime.jsx("kbd",{className:"rounded border border-primary-200 px-1 dark:border-primary-700",children:"\u21B5"}),"Select"]})]})]})]})}),document.body)}var El={complete:"bg-success-500 border-success-500 text-white dark:bg-success-600 dark:border-success-600",active:"bg-primary-500 border-primary-500 text-white dark:bg-primary-400 dark:border-primary-400",error:"bg-danger-500 border-danger-500 text-white dark:bg-danger-600 dark:border-danger-600",pending:"bg-white border-primary-300 text-secondary-400 dark:bg-primary-800 dark:border-primary-600"},Dl={complete:"shadow-[0_0_0_4px_theme(colors.success.100)] dark:shadow-[0_0_0_4px_theme(colors.success.900/30)]",active:"shadow-[0_0_0_4px_theme(colors.primary.100)] dark:shadow-[0_0_0_4px_theme(colors.primary.800/50)] animate-pulse",error:"shadow-[0_0_0_4px_theme(colors.danger.100)] dark:shadow-[0_0_0_4px_theme(colors.danger.900/30)]",pending:""};function Vl({status:e,icon:t}){return t?jsxRuntime.jsx(jsxRuntime.Fragment,{children:t}):e==="complete"?jsxRuntime.jsx(lucideReact.Check,{className:"h-3 w-3"}):e==="error"?jsxRuntime.jsx(lucideReact.AlertCircle,{className:"h-3 w-3"}):e==="active"?jsxRuntime.jsx(lucideReact.Dot,{className:"h-4 w-4"}):jsxRuntime.jsx(lucideReact.Clock,{className:"h-3 w-3"})}function Il({images:e,title:t}){let r=e.slice(0,4),n=e.length>4?e.length-4:0,o=(s,a,l)=>jsxRuntime.jsxs("a",{href:s,target:"_blank",rel:"noopener noreferrer",className:i("relative block overflow-hidden",l),onClick:d=>d.stopPropagation(),children:[jsxRuntime.jsx("img",{src:s,alt:`${t} ${a+1}`,className:"h-full w-full object-cover transition-transform duration-300 hover:scale-105"}),a===r.length-1&&n>0&&jsxRuntime.jsx("div",{className:"absolute inset-0 flex items-center justify-center bg-black/60",children:jsxRuntime.jsxs("span",{className:"text-sm font-semibold text-white",children:["+",n]})})]},a);return r.length===0?null:r.length===1?jsxRuntime.jsx("div",{className:"mt-2.5 h-36 overflow-hidden rounded-xl",children:o(r[0],0,"h-full")}):r.length===2?jsxRuntime.jsx("div",{className:"mt-2.5 grid h-28 grid-cols-2 gap-0.5 overflow-hidden rounded-xl",children:r.map((s,a)=>o(s,a))}):r.length===3?jsxRuntime.jsxs("div",{className:"mt-2.5 grid h-36 grid-cols-2 grid-rows-2 gap-0.5 overflow-hidden rounded-xl",children:[o(r[0],0,"row-span-2"),o(r[1],1),o(r[2],2)]}):jsxRuntime.jsx("div",{className:"mt-2.5 grid h-44 grid-cols-2 grid-rows-2 gap-0.5 overflow-hidden rounded-xl",children:r.map((s,a)=>o(s,a))})}function Al({actions:e}){let t=e.filter(a=>a.variant!=="primary"),r=e.filter(a=>a.variant==="primary"),n="inline-flex items-center gap-1.5 rounded-lg px-2.5 py-1 text-xs font-medium text-secondary-500 transition-colors hover:bg-secondary-100/80 hover:text-secondary-700 dark:text-secondary-400 dark:hover:bg-primary-800/60 dark:hover:text-secondary-200",o="inline-flex items-center gap-1.5 rounded-lg border border-primary-200/70 bg-primary-50/80 px-3 py-1 text-xs font-semibold text-primary-700 transition-colors hover:bg-primary-100 dark:border-primary-600/60 dark:bg-primary-800/60 dark:text-primary-300 dark:hover:bg-primary-700/60",s=(a,l,d)=>a.href?jsxRuntime.jsxs("a",{href:a.href,target:"_blank",rel:"noopener noreferrer",className:d,onClick:m=>m.stopPropagation(),children:[a.icon,a.label]},l):jsxRuntime.jsxs("button",{type:"button",onClick:a.onClick,className:d,children:[a.icon,a.label]},l);return jsxRuntime.jsxs("div",{className:"mt-3 flex items-center gap-1 border-t border-primary-100/50 pt-2.5 dark:border-primary-700/40",children:[t.map((a,l)=>s(a,l,n)),r.length>0&&jsxRuntime.jsx("span",{className:"flex-1"}),r.map((a,l)=>s(a,l,o))]})}function Hl({item:e,isActive:t,animated:r,visible:n,orientation:o}){let s=e.status??"pending",a={complete:"bg-gradient-to-br from-white to-success-50/40 dark:from-primary-900 dark:to-success-900/10",active:"bg-gradient-to-br from-white to-primary-50/60 dark:from-primary-900 dark:to-primary-800/40",error:"bg-gradient-to-br from-white to-danger-50/40 dark:from-primary-900 dark:to-danger-900/10",pending:"bg-white dark:bg-primary-900"}[s],l={complete:"border-success-200/70 dark:border-success-800/50",active:"border-primary-300/80 dark:border-primary-600/70",error:"border-danger-200/70 dark:border-danger-800/50",pending:"border-primary-200/60 dark:border-primary-700/50"}[s],d=t?"shadow-lg shadow-primary-300/30 dark:shadow-primary-500/20":s==="complete"?"shadow-md shadow-success-300/20 dark:shadow-success-400/10":s==="error"?"shadow-md shadow-danger-300/20 dark:shadow-danger-400/10":"shadow-sm shadow-primary-100/50 dark:shadow-black/20",m=s==="complete"?"conic-gradient(from 30deg, transparent 0%, var(--tl-glow-complete-1) 18%, var(--tl-glow-complete-2) 30%, var(--tl-holo-cyan) 44%, transparent 60%)":s==="error"?"conic-gradient(from 150deg, transparent 0%, var(--tl-glow-error-1) 18%, var(--tl-glow-error-2) 32%, var(--tl-glow-error-3) 44%, transparent 58%)":null,c={complete:"bg-success-100 text-success-700 dark:bg-success-900/40 dark:text-success-300",active:"bg-primary-100 text-primary-700 dark:bg-primary-800/60 dark:text-primary-300",error:"bg-danger-100 text-danger-700 dark:bg-danger-900/40 dark:text-danger-300",pending:"bg-secondary-100 text-secondary-600 dark:bg-primary-800/50 dark:text-secondary-400"}[s];return jsxRuntime.jsxs("div",{className:i("relative isolate",r&&"transition-all duration-700",r?n?"opacity-100 translate-y-0":o==="vertical"?"opacity-0 translate-y-6":"opacity-0 translate-x-6":"",o==="horizontal"?"w-56 shrink-0":"flex-1",e.className),children:[!t&&m&&jsxRuntime.jsx("div",{className:"pointer-events-none absolute animate-[tl-glow-pulse_5s_ease-in-out_infinite]",style:{inset:"-6px",borderRadius:"1.5rem",zIndex:-1,background:m,filter:"blur(14px)",opacity:.22},"aria-hidden":true}),t&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("div",{className:"pointer-events-none absolute",style:{inset:"-7px",borderRadius:"1.5rem",zIndex:-1,background:"conic-gradient(from var(--tl-angle, 0deg) at 50% 50%, var(--tl-holo-base) 0%, var(--tl-holo-indigo) 18%, var(--tl-holo-violet) 30%, var(--tl-holo-cyan) 45%, var(--tl-holo-mid) 62%, var(--tl-holo-base) 100%)",filter:"blur(10px)",animation:"tl-breathe 2.8s ease-in-out infinite, tl-holo-spin 9s linear infinite"},"aria-hidden":true}),jsxRuntime.jsx("div",{className:"pointer-events-none absolute",style:{inset:"-1.5px",borderRadius:"1.0625rem",zIndex:-1,padding:"1.5px",background:"conic-gradient(from var(--tl-angle, 0deg) at 50% 50%, transparent 0deg, var(--tl-holo-indigo) 55deg, var(--tl-holo-violet) 85deg, var(--tl-holo-cyan) 115deg, transparent 175deg, transparent 360deg)",WebkitMask:"linear-gradient(white 0 0) content-box, linear-gradient(white 0 0)",WebkitMaskComposite:"xor",maskComposite:"exclude",animation:"tl-holo-spin 5s linear infinite"},"aria-hidden":true})]}),jsxRuntime.jsx("div",{className:i("relative overflow-hidden rounded-2xl border backdrop-blur-[2px]",t?"border-transparent":i("border",l),a,d),children:e.imagePosition==="left"&&e.image?jsxRuntime.jsxs("div",{className:"flex min-h-[8rem]",children:[jsxRuntime.jsx("a",{href:e.image,target:"_blank",rel:"noopener noreferrer",className:"w-28 shrink-0 overflow-hidden",onClick:p=>p.stopPropagation(),"aria-label":e.title,children:jsxRuntime.jsx("img",{src:e.image,alt:e.title,className:"h-full w-full object-cover transition-transform duration-500 hover:scale-105"})}),jsxRuntime.jsxs("div",{className:"flex flex-1 flex-col p-4",children:[e.date&&jsxRuntime.jsx("span",{className:i("mb-2 inline-flex items-center gap-1 rounded-md px-2 py-0.5 text-[0.65rem] font-semibold tracking-wide",c),children:e.date}),jsxRuntime.jsx("h3",{className:i("text-sm font-semibold leading-snug",t?"text-primary-900 dark:text-white":"text-primary-800 dark:text-primary-100"),children:e.title}),e.description&&jsxRuntime.jsx("p",{className:"mt-1 text-xs leading-relaxed text-secondary-500 dark:text-secondary-400",children:e.description}),e.images&&e.images.length>0&&jsxRuntime.jsx(Il,{images:e.images,title:e.title}),e.actions&&e.actions.length>0&&jsxRuntime.jsx(Al,{actions:e.actions})]})]}):jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[e.image&&jsxRuntime.jsx("div",{className:"overflow-hidden",children:jsxRuntime.jsx("img",{src:e.image,alt:e.title,className:"h-32 w-full object-cover transition-transform duration-500 hover:scale-105"})}),e.svg&&!e.image&&jsxRuntime.jsx("div",{className:"flex items-center justify-center bg-primary-50/60 p-4 dark:bg-primary-800/40",children:e.svg}),jsxRuntime.jsxs("div",{className:i("p-4",(e.image||e.svg)&&"pt-3"),children:[e.date&&jsxRuntime.jsx("span",{className:i("mb-2.5 inline-flex items-center gap-1 rounded-md px-2 py-0.5 text-[0.65rem] font-semibold tracking-wide",c),children:e.date}),jsxRuntime.jsx("h3",{className:i("text-sm font-semibold leading-snug",t?"text-primary-900 dark:text-white":"text-primary-800 dark:text-primary-100"),children:e.title}),e.description&&jsxRuntime.jsx("p",{className:"mt-1 text-xs leading-relaxed text-secondary-500 dark:text-secondary-400",children:e.description}),e.images&&e.images.length>0&&jsxRuntime.jsx(Il,{images:e.images,title:e.title}),e.actions&&e.actions.length>0&&jsxRuntime.jsx(Al,{actions:e.actions})]})]})})]})}function Rs({items:e,orientation:t="vertical",activeIndex:r,animated:n=true,lineStyle:o="solid",className:s}){let a=Kr.useRef(null),l=Kr.useRef([]),[d,m]=Kr.useState(new Set);Kr.useEffect(()=>{if(!n){m(new Set(e.map((p,u)=>u)));return}let f=new IntersectionObserver(p=>{m(u=>{let h=new Set(u);return p.forEach(g=>{let x=Number(g.target.dataset.idx);g.isIntersecting&&h.add(x);}),h});},{threshold:.15});return l.current.forEach(p=>p&&f.observe(p)),()=>f.disconnect()},[e,n]),Kr.useEffect(()=>{if(r==null)return;let f=l.current[r];f&&f.scrollIntoView({behavior:"smooth",block:"center",inline:"center"});},[r]);let c=o==="dashed"?"border-dashed":"";return t==="vertical"?jsxRuntime.jsxs("div",{ref:a,className:i("relative",s),children:[jsxRuntime.jsx("div",{className:"absolute left-5 top-0 h-full w-px bg-primary-200 dark:bg-primary-700"}),jsxRuntime.jsx("div",{className:"space-y-6",children:e.map((f,p)=>{let u=f.status??"pending",h=p===r;return jsxRuntime.jsxs("div",{ref:g=>{l.current[p]=g;},"data-idx":p,className:"relative flex gap-4",children:[jsxRuntime.jsx("div",{className:"relative z-10 flex shrink-0 flex-col items-center",children:jsxRuntime.jsx("div",{className:i("flex h-10 w-10 items-center justify-center rounded-full border-2 transition-all duration-300 [&_svg]:shrink-0",El[u],h&&Dl[u]),children:jsxRuntime.jsx(Vl,{status:u,icon:f.icon})})}),jsxRuntime.jsx(Hl,{item:f,isActive:h,animated:n,visible:d.has(p),orientation:"vertical"})]},f.id??p)})})]}):jsxRuntime.jsx("div",{ref:a,className:i("relative overflow-x-auto pb-4",s),children:jsxRuntime.jsx("div",{className:"flex min-w-max gap-6 px-4",children:e.map((f,p)=>{let u=f.status??"pending",h=p===r,g=p===e.length-1;return jsxRuntime.jsxs("div",{ref:x=>{l.current[p]=x;},"data-idx":p,className:"relative flex flex-col items-center gap-3",children:[jsxRuntime.jsxs("div",{className:"flex items-center",children:[jsxRuntime.jsx("div",{className:i("flex h-10 w-10 items-center justify-center rounded-full border-2 transition-all duration-300 z-10 [&_svg]:shrink-0",El[u],h&&Dl[u]),children:jsxRuntime.jsx(Vl,{status:u,icon:f.icon})}),!g&&jsxRuntime.jsx("div",{className:i("h-px w-28 border-t-2",c,u==="complete"?"border-success-400":"border-primary-200 dark:border-primary-700")})]}),jsxRuntime.jsx(Hl,{item:f,isActive:h,animated:n,visible:d.has(p),orientation:"horizontal"})]},f.id??p)})})})}var kf={FilmReel:cs,MiniPlayer:ms,CinePlayer:us,FileExplorer:ys,Masonry:Ns,TypewriterText:ko,CommandPalette:No,Timeline:Rs},Ms=kf;var Fl=classVarianceAuthority.cva("w-full",{variants:{intent:{default:"",card:"rounded-(--form-radius) border border-primary-200 bg-white p-6 shadow-sm dark:border-primary-700 dark:bg-primary-900",inset:"rounded-(--form-radius) bg-primary-50 p-6 dark:bg-primary-800/50"},size:{sm:"",md:"",lg:""}},defaultVariants:{intent:"default",size:"md"}});classVarianceAuthority.cva("flex w-full",{variants:{layout:{stacked:"flex-col gap-1.5",inline:"flex-row items-start gap-(--form-item-gap-md)"},size:{sm:"",md:"",lg:""}},defaultVariants:{layout:"stacked",size:"md"}});var _l=classVarianceAuthority.cva("mt-1 flex items-center gap-1 text-xs [&_svg]:h-3.5 [&_svg]:w-3.5 [&_svg]:shrink-0",{variants:{status:{error:"text-danger-600 dark:text-danger-400",warning:"text-warning-600 dark:text-warning-400",success:"text-success-600 dark:text-success-400",hint:"text-primary-400 dark:text-primary-500"}},defaultVariants:{status:"hint"}});var Ls=Kr.createContext({layout:"stacked",size:"md",labelWidth:"var(--form-label-w-md, 7rem)",bulkErrors:{}}),Pf={sm:"var(--form-label-w-sm, 5rem)",md:"var(--form-label-w-md, 7rem)",lg:"var(--form-label-w-lg, 9rem)"},Ol={sm:"gap-(--form-row-gap-sm)",md:"gap-(--form-row-gap-md)",lg:"gap-(--form-row-gap-lg)"};function Es({children:e,className:t,intent:r,size:n="md",layout:o="stacked",title:s,description:a,footer:l,onValues:d,onSubmit:m,...c}){let f=Pf[n??"md"],[p,u]=Kr.useState({}),h=Kr.useCallback(g=>{if(g.preventDefault(),m?.(g),d){let x=Object.fromEntries(new FormData(g.currentTarget).entries()),w=d(x,g),y=M=>{if(!M)return;let v={};for(let[N,{result:L,reason:R}]of Object.entries(M))R&&(v[N]={status:L?"success":"error",message:R});u(v);};w instanceof Promise?w.then(y).catch(()=>{}):y(w);}},[m,d]);return jsxRuntime.jsx(Ls.Provider,{value:{layout:o??"stacked",size:n??"md",labelWidth:f,bulkErrors:p},children:jsxRuntime.jsxs("form",{className:i(Fl({intent:r,size:n}),"flex flex-col",t),onSubmit:h,...c,children:[(s||a)&&jsxRuntime.jsxs("div",{className:"mb-(--form-header-mb)",children:[s&&jsxRuntime.jsx("h2",{className:"text-base font-semibold text-primary-900 dark:text-primary-100",children:s}),a&&jsxRuntime.jsx("p",{className:"mt-1 text-xs text-primary-500 dark:text-primary-400",children:a})]}),jsxRuntime.jsx("div",{className:i("flex flex-col",Ol[n??"md"]),children:e}),l&&jsxRuntime.jsx("div",{className:"mt-(--form-footer-pt) flex flex-wrap items-center justify-end gap-(--form-footer-gap) border-t border-primary-200 pt-(--form-footer-pt) dark:border-primary-700",children:l})]})})}var Sf={error:jsxRuntime.jsx(lucideReact.AlertCircle,{}),warning:jsxRuntime.jsx(lucideReact.AlertTriangle,{}),success:jsxRuntime.jsx(lucideReact.CheckCircle,{}),hint:jsxRuntime.jsx(lucideReact.Info,{})};function Lf({label:e,layout:t,required:r,hint:n,validation:o,name:s,onValidate:a,className:l,children:d}){let m=Kr.useContext(Ls),c=Kr.useId(),[f,p]=Kr.useState(void 0),u=s?m.bulkErrors[s]:void 0,h=o??f??u,x=(t??m.layout)==="inline",w=Kr.useCallback(L=>{let R=L!=null&&typeof L=="object"&&"target"in L?L.target.value:L;if(s&&m.bulkErrors[s]&&(m.bulkErrors[s]=void 0),!a){p(void 0);return}let{result:D,reason:A}=a(R);p(A?{status:D?"success":"error",message:A}:void 0);},[a,s,m.bulkErrors]),y=h?`${c}-validation`:n?`${c}-hint`:void 0,M=Kr__default.default.Children.map(d,(L,R)=>{if(R!==0||!Kr__default.default.isValidElement(L))return L;let D=L,A={};if(D.props.id||(A.id=c),y&&!D.props["aria-describedby"]&&(A["aria-describedby"]=y),h?.status==="error"&&!D.props["aria-invalid"]&&(A["aria-invalid"]=true),s&&!D.props.name&&(A.name=s),a){let V=D.props.onChange;A.onChange=k=>{V?.(k),w(k);};}return Object.keys(A).length?Kr__default.default.cloneElement(D,A):L}),v=e!=null&&jsxRuntime.jsx("label",{htmlFor:c,className:i("shrink-0 text-sm font-medium","text-primary-700 dark:text-primary-300",r&&"after:ml-0.5 after:text-danger-500 after:content-['*']",x&&"pt-1.75"),style:x?{width:m.labelWidth,minWidth:m.labelWidth}:void 0,children:e}),N=o?`${c}-validation`:n?`${c}-hint`:void 0;return jsxRuntime.jsxs("div",{className:i("flex w-full flex-col gap-1.5",x&&"md:flex-row md:items-start md:gap-(--form-item-gap-md)",l),children:[v,jsxRuntime.jsxs("div",{className:"flex min-w-0 flex-1 flex-col",children:[M,h&&jsxRuntime.jsxs("p",{id:`${c}-validation`,className:i(_l({status:h.status})),role:h.status==="error"?"alert":void 0,children:[Sf[h.status],jsxRuntime.jsx("span",{children:h.message})]}),n&&jsxRuntime.jsx("p",{id:N===`${c}-hint`?N:void 0,className:"mt-1 text-xs text-primary-400 dark:text-primary-500",children:n})]})]})}function Ef({title:e,description:t,className:r,children:n}){let{size:o}=Kr.useContext(Ls);return jsxRuntime.jsxs("fieldset",{className:i("flex flex-col rounded-(--form-radius) border border-primary-200 p-4 dark:border-primary-700",Ol[o],r),children:[(e||t)&&jsxRuntime.jsxs("legend",{className:"px-1.5 pb-1",children:[e&&jsxRuntime.jsx("span",{className:"text-sm font-semibold text-primary-700 dark:text-primary-300",children:e}),t&&jsxRuntime.jsx("span",{className:"ml-2 text-xs text-primary-400 dark:text-primary-500",children:t})]}),n]})}var Df={Form:Es},Ds=Df;var vt=classVarianceAuthority.cva("relative w-full font-sans select-none",{variants:{size:{sm:"text-xs",md:"text-sm",lg:"text-base"}},defaultVariants:{size:"md"}}),kt=classVarianceAuthority.cva("flex flex-wrap gap-3 items-center justify-center",{variants:{position:{top:"mb-3",bottom:"mt-3",left:"flex-col mr-4",right:"flex-col ml-4"}},defaultVariants:{position:"bottom"}}),wt=classVarianceAuthority.cva("absolute z-50 pointer-events-none px-3 py-2 rounded-lg text-xs shadow-lg border transition-opacity duration-150 bg-primary-900 text-primary-50 border-primary-700 dark:bg-primary-950 dark:border-primary-800");function _t(e){let[t,r]=Kr.useState(()=>new Set(e)),n=Kr.useCallback(a=>{r(l=>{let d=new Set(l);return d.has(a)?d.delete(a):d.add(a),d});},[]),o=Kr.useCallback(a=>t.has(a),[t]),s=Kr.useCallback(()=>{r(new Set(e));},[e]);return {visible:t,toggle:n,isVisible:o,showAll:s}}function Bt(e){let t=["var(--color-chart-1)","var(--color-chart-2)","var(--color-chart-3)","var(--color-chart-4)","var(--color-chart-5)","var(--color-chart-6)","var(--color-chart-7)","var(--color-chart-8)"];return Array.from({length:e},(r,n)=>t[n%t.length])}function zt(e,t,r=.1){if(e===t)return [e-1,t+1];let o=(t-e)*r;return [Math.floor(e-o),Math.ceil(t+o)]}function Lr(e,t,r){if(r<=1)return [e];let n=(t-e)/(r-1);return Array.from({length:r},(o,s)=>+(e+s*n).toFixed(10))}function Ve(e,t){return t?t(e):typeof e=="number"?Math.abs(e)>=1e6?`${(e/1e6).toFixed(1)}M`:Math.abs(e)>=1e3?`${(e/1e3).toFixed(1)}K`:Number.isInteger(e)?e.toString():e.toFixed(2):String(e)}function st(e,t,r,n){let o=(n-90)*Math.PI/180;return {x:e+r*Math.cos(o),y:t+r*Math.sin(o)}}function $t(e,t,r){return {top:20,right:r?65:20,bottom:e?52:36,left:t?65:52}}function Ot(e,t,r){let n=Math.max(e,120);return {width:n,height:t,margins:r,plotLeft:r.left,plotTop:r.top,plotRight:n-r.right,plotBottom:t-r.bottom,plotWidth:Math.max(n-r.left-r.right,10),plotHeight:Math.max(t-r.top-r.bottom,10)}}function Kl(e,t){let r=new Set,n=[];for(let o of e)if(t.has(o.id))for(let s of o.data){let a=String(s.x);r.has(a)||(r.add(a),n.push(a));}return n}function As(e,t,r){let n=1/0,o=-1/0;for(let l of e)if(t.has(l.id))for(let d of l.data)d.y<n&&(n=d.y),d.y>o&&(o=d.y);if(!isFinite(n))return [0,1];let[s,a]=zt(n,o);return [r?.min??s,r?.max??a]}function Co(e,t){let[r,n]=e,[o,s]=t;return n===r?()=>(o+s)/2:a=>o+(a-r)/(n-r)*(s-o)}function To(e,t){let r=e.length;if(r===0)return ()=>(t[0]+t[1])/2;let n=(t[1]-t[0])/r;return o=>{let s=e.indexOf(o);return s<0?(t[0]+t[1])/2:t[0]+s*n+n/2}}function Xl(e,t,r){return e.map(n=>`${t(n.x).toFixed(2)},${r(n.y).toFixed(2)}`).join(" ")}function Hs(e,t,r){if(e.length===0)return "";let n=e.map(a=>({x:t(a.x),y:r(a.y)}));if(n.length===1)return `M ${n[0].x.toFixed(2)} ${n[0].y.toFixed(2)}`;let o=.5,s=`M ${n[0].x.toFixed(2)} ${n[0].y.toFixed(2)}`;for(let a=0;a<n.length-1;a++){let l=a===0?{x:2*n[0].x-n[1].x,y:2*n[0].y-n[1].y}:n[a-1],d=n[a],m=n[a+1],c=a+2<n.length?n[a+2]:{x:2*n[n.length-1].x-n[n.length-2].x,y:2*n[n.length-1].y-n[n.length-2].y},f=d.x+(m.x-l.x)*o/3,p=d.y+(m.y-l.y)*o/3,u=m.x-(c.x-d.x)*o/3,h=m.y-(c.y-d.y)*o/3;s+=` C ${f.toFixed(2)} ${p.toFixed(2)}, ${u.toFixed(2)} ${h.toFixed(2)}, ${m.x.toFixed(2)} ${m.y.toFixed(2)}`;}return s}function jl(e,t,r,n,o){if(e.length===0)return "";let s=n?Hs(e,t,r):`M ${e.map(d=>`${t(d.x).toFixed(2)},${r(d.y).toFixed(2)}`).join(" L ")}`,a=t(e[e.length-1].x).toFixed(2),l=t(e[0].x).toFixed(2);return `${s} L ${a},${o.toFixed(2)} L ${l},${o.toFixed(2)} Z`}function Ro(e,t=5){return Lr(e[0],e[1],t)}function Fs(e,t,r){if(t.length===0)return -1;let n=1/0,o=0;for(let s=0;s<t.length;s++){let a=Math.abs(r(t[s])-e);a<n&&(n=a,o=s);}return o}function _s(e,t){return e.data.find(r=>String(r.x)===t)?.y}function Wl(e){for(let t of e)for(let r of t.data)if(typeof r.x=="string")return true;return false}function Mo({items:e,position:t,onToggle:r}){return jsxRuntime.jsx("div",{className:kt({position:t}),children:e.map(n=>jsxRuntime.jsxs("button",{onClick:()=>r(n.id),className:i("flex items-center gap-1.5 cursor-pointer rounded px-1.5 py-1 text-xs text-primary-700 transition-opacity hover:bg-primary-100 dark:text-primary-300 dark:hover:bg-primary-800",!n.visible&&"opacity-40"),"aria-pressed":n.visible,children:[jsxRuntime.jsx("span",{className:"h-2.5 w-5 rounded-sm shrink-0",style:{background:n.color}}),n.label]},n.id))})}function $s({series:e,xAxis:t,yAxis:r,y2Axis:n,y2Series:o=[],smooth:s=false,showDots:a=true,area:l=false,strokeWidth:d=2,title:m,height:c=300,className:f,legend:p=true,legendPosition:u="bottom",animateOnMount:h=true,emptyText:g="No data to display"}){let x=Kr.useRef(null),w=Kr.useRef(null),[y,M]=Kr.useState(600),[v,N]=Kr.useState(null),[L,R]=Kr.useState(null);Kr.useEffect(()=>{let P=w.current;if(!P)return;let ce=P.getBoundingClientRect().width;ce>0&&M(ce);let ae=new ResizeObserver(he=>{let ge=he[0]?.contentRect.width;ge&&ge>0&&M(ge);});return ae.observe(P),()=>ae.disconnect()},[]);let D=Kr.useMemo(()=>e.map(P=>P.id),[e]),{visible:A,toggle:V,isVisible:k}=_t(D),O=Kr.useMemo(()=>Bt(e.length),[e.length]),C=Kr.useMemo(()=>new Map(e.map((P,ce)=>[P.id,P.color??O[ce]])),[e,O]),X=Kr.useMemo(()=>$t(!!t?.label,!!r?.label,!!n),[t?.label,r?.label,n]),T=Kr.useMemo(()=>Ot(y,c,X),[y,c,X]),re=Kr.useMemo(()=>Wl(e),[e]),_=Kr.useMemo(()=>re?Kl(e,A):[],[e,A,re]),de=Kr.useMemo(()=>{if(re){let ge=To(_,[T.plotLeft,T.plotRight]);return Me=>ge(Me)}let P=e.flatMap(ge=>ge.data.map(Me=>Me.x));if(P.length===0)return ()=>T.plotLeft;let ce=Math.min(...P),ae=Math.max(...P),he=Co([ce,ae],[T.plotLeft,T.plotRight]);return ge=>he(ge)},[e,re,_,T]),J=Kr.useMemo(()=>As(e,A,r),[e,A,r]),pe=Kr.useMemo(()=>Co(J,[T.plotBottom,T.plotTop]),[J,T]),fe=Kr.useMemo(()=>Ro(J,r?.tickCount??5),[J,r?.tickCount]),$=Kr.useMemo(()=>{if(!n)return null;let P=e.filter(ce=>o.includes(ce.id));return As(P,A,n)},[n,e,o,A]),U=Kr.useMemo(()=>$?Co($,[T.plotBottom,T.plotTop]):null,[$,T]),me=Kr.useMemo(()=>$?Ro($,n?.tickCount??5):[],[$,n?.tickCount]),j=Kr.useMemo(()=>{if(re)return _;let P=e.flatMap(he=>he.data.map(ge=>Number(ge.x)));if(P.length===0)return [];let ce=Math.min(...P),ae=Math.max(...P);return Ro([ce,ae],t?.tickCount??6)},[re,_,e,t?.tickCount]),b=Kr.useCallback(P=>{let ce=P.currentTarget.closest("svg");if(!ce)return;let ae=ce.getBoundingClientRect(),he=P.clientX-ae.left,ge=x.current?.getBoundingClientRect();if(!ge)return;let Me="",ke=he;if(re&&_.length>0){let q=To(_,[T.plotLeft,T.plotRight]),xe=Fs(he,_,q);Me=_[xe]??"",ke=q(Me);}else if(!re){let q=j;Me=Ve((he-T.plotLeft)/T.plotWidth*(q[q.length-1]-q[0])+q[0],t?.format),ke=he;}let F=e.filter(q=>k(q.id)).map(q=>{o.includes(q.id)&&U!=null?U:pe;let He;if(re)He=_s(q,Me);else {let G=he,ye=1/0,E;for(let Z of q.data){let ne=de(Z.x),H=Math.abs(ne-G);H<ye&&(ye=H,E=Z.y);}He=E;}return {name:q.name,value:He!==void 0?Ve(He,r?.format):"\u2014",color:C.get(q.id)??"var(--color-chart-1)"}});ke>=T.plotLeft&&ke<=T.plotRight&&R(ke);let ee=P.clientX-ge.left+12,z=P.clientY-ge.top-10;N({x:ee,y:z,label:Me,items:F});},[re,_,T,e,k,o,U,pe,de,j,t?.format,r?.format,C]),I=Kr.useCallback(()=>{N(null),R(null);},[]),W=Kr.useCallback(P=>{P.preventDefault();let ce=P.touches[0];if(!ce)return;let ae=P.currentTarget.closest("svg");if(!ae)return;let he=ae.getBoundingClientRect(),ge=x.current?.getBoundingClientRect();if(!ge)return;let Me=ce.clientX-he.left,ke=Me,F="";if(re&&_.length>0){let z=To(_,[T.plotLeft,T.plotRight]),q=Fs(Me,_,z);F=_[q]??"",ke=z(F);}ke>=T.plotLeft&&ke<=T.plotRight&&R(ke);let ee=e.filter(z=>k(z.id)).map(z=>({name:z.name,value:re&&F?Ve(_s(z,F)??0,r?.format):"\u2014",color:C.get(z.id)??"var(--color-chart-1)"}));N({x:ce.clientX-ge.left+12,y:ce.clientY-ge.top-10,label:F,items:ee});},[re,_,T,e,k,r?.format,C]),K=Kr.useMemo(()=>e.map((P,ce)=>({id:P.id,label:P.name,color:P.color??O[ce],visible:k(P.id)})),[e,O,k]),B=e.some(P=>P.data.length>0),Q=jsxRuntime.jsxs("svg",{role:"img","aria-label":m??"Line chart",width:T.width,height:T.height,viewBox:`0 0 ${T.width} ${T.height}`,shapeRendering:"geometricPrecision",children:[r?.gridLines!==false&&fe.map(P=>{let ce=pe(P);return jsxRuntime.jsx("line",{x1:T.plotLeft,x2:T.plotRight,y1:ce,y2:ce,stroke:"currentColor",strokeWidth:.5,strokeDasharray:"4 4",className:"text-secondary-200 dark:text-secondary-700"},P)}),l&&e.map(P=>{if(!k(P.id)||P.data.length===0)return null;let ae=o.includes(P.id)&&U!=null?U:pe,he=C.get(P.id)??"var(--color-chart-1)",ge=jl(P.data,de,ae,s,T.plotBottom);return jsxRuntime.jsx("path",{d:ge,fill:he,fillOpacity:.15,stroke:"none",className:h?"chart-area-animate":""},`area-${P.id}`)}),e.map(P=>{if(!k(P.id)||P.data.length===0)return null;let ae=o.includes(P.id)&&U!=null?U:pe,he=C.get(P.id)??"var(--color-chart-1)";return s?jsxRuntime.jsx("path",{d:Hs(P.data,de,ae),fill:"none",stroke:he,strokeWidth:d,strokeLinecap:"round",strokeLinejoin:"round",className:h?"chart-line-animate":""},P.id):jsxRuntime.jsx("polyline",{points:Xl(P.data,de,ae),fill:"none",stroke:he,strokeWidth:d,strokeLinecap:"round",strokeLinejoin:"round",className:h?"chart-line-animate":""},P.id)}),a&&e.map(P=>{if(!k(P.id))return null;let ae=o.includes(P.id)&&U!=null?U:pe,he=C.get(P.id)??"var(--color-chart-1)";return P.data.map((ge,Me)=>jsxRuntime.jsx("circle",{cx:de(ge.x),cy:ae(ge.y),r:3,fill:he,stroke:"white",strokeWidth:1.5,className:i("chart-dot",h?"chart-dot-animate":"")},`${P.id}-${Me}`))}),L!=null&&jsxRuntime.jsx("line",{className:"chart-crosshair",x1:L,x2:L,y1:T.plotTop,y2:T.plotBottom,stroke:"currentColor",strokeWidth:1,strokeDasharray:"4 4",opacity:.5,style:{color:"var(--color-secondary-400)"}}),jsxRuntime.jsx("line",{x1:T.plotLeft,x2:T.plotLeft,y1:T.plotTop,y2:T.plotBottom,stroke:"currentColor",strokeWidth:1,className:"text-secondary-300 dark:text-secondary-600"}),fe.map(P=>{let ce=pe(P);return jsxRuntime.jsxs("g",{children:[jsxRuntime.jsx("line",{x1:T.plotLeft-4,x2:T.plotLeft,y1:ce,y2:ce,stroke:"currentColor",strokeWidth:1,className:"text-secondary-300 dark:text-secondary-600"}),jsxRuntime.jsx("text",{x:T.plotLeft-6,y:ce,textAnchor:"end",dominantBaseline:"middle",fontSize:10,fill:"currentColor",className:"text-secondary-500 dark:text-secondary-400",children:Ve(P,r?.format)})]},P)}),r?.label&&jsxRuntime.jsx("text",{x:-(T.plotTop+T.plotHeight/2),y:14,textAnchor:"middle",fontSize:11,fill:"currentColor",className:"text-secondary-600 dark:text-secondary-400",transform:"rotate(-90)",children:r.label}),n&&U&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("line",{x1:T.plotRight,x2:T.plotRight,y1:T.plotTop,y2:T.plotBottom,stroke:"currentColor",strokeWidth:1,className:"text-secondary-300 dark:text-secondary-600"}),me.map(P=>{let ce=U(P);return jsxRuntime.jsxs("g",{children:[jsxRuntime.jsx("line",{x1:T.plotRight,x2:T.plotRight+4,y1:ce,y2:ce,stroke:"currentColor",strokeWidth:1,className:"text-secondary-300 dark:text-secondary-600"}),jsxRuntime.jsx("text",{x:T.plotRight+6,y:ce,textAnchor:"start",dominantBaseline:"middle",fontSize:10,fill:"currentColor",className:"text-secondary-500 dark:text-secondary-400",children:Ve(P,n?.format)})]},P)}),n?.label&&jsxRuntime.jsx("text",{x:T.plotTop+T.plotHeight/2,y:-(T.width-14),textAnchor:"middle",fontSize:11,fill:"currentColor",className:"text-secondary-600 dark:text-secondary-400",transform:"rotate(90)",children:n.label})]}),jsxRuntime.jsx("line",{x1:T.plotLeft,x2:T.plotRight,y1:T.plotBottom,y2:T.plotBottom,stroke:"currentColor",strokeWidth:1,className:"text-secondary-300 dark:text-secondary-600"}),(re?_:j).map((P,ce)=>{let ae=de(P);return jsxRuntime.jsxs("g",{children:[jsxRuntime.jsx("line",{x1:ae,x2:ae,y1:T.plotBottom,y2:T.plotBottom+4,stroke:"currentColor",strokeWidth:1,className:"text-secondary-300 dark:text-secondary-600"}),jsxRuntime.jsx("text",{x:ae,y:T.plotBottom+14,textAnchor:"middle",fontSize:10,fill:"currentColor",className:"text-secondary-500 dark:text-secondary-400",children:Ve(P,t?.format)})]},ce)}),t?.label&&jsxRuntime.jsx("text",{x:T.plotLeft+T.plotWidth/2,y:T.height-4,textAnchor:"middle",fontSize:11,fill:"currentColor",className:"text-secondary-600 dark:text-secondary-400",children:t.label}),jsxRuntime.jsx("rect",{x:T.plotLeft,y:T.plotTop,width:T.plotWidth,height:T.plotHeight,fill:"transparent",onMouseMove:b,onMouseLeave:I,onTouchStart:W,onTouchMove:W,onTouchEnd:I,style:{cursor:"crosshair"}})]}),ve=u==="left"||u==="right";return jsxRuntime.jsxs("div",{ref:x,className:i(vt(),f),children:[m&&jsxRuntime.jsx("h3",{className:"mb-2 text-sm font-semibold text-primary-700 dark:text-primary-200",children:m}),p&&u==="top"&&jsxRuntime.jsx(Mo,{items:K,position:"top",onToggle:V}),jsxRuntime.jsxs("div",{className:i("flex items-start",ve&&"gap-0"),children:[p&&u==="left"&&jsxRuntime.jsx(Mo,{items:K,position:"left",onToggle:V}),jsxRuntime.jsx("div",{ref:w,className:"flex-1 min-w-0 overflow-hidden",children:B?Q:jsxRuntime.jsx("div",{className:"flex items-center justify-center text-secondary-400 dark:text-secondary-500",style:{height:c},children:g})}),p&&u==="right"&&jsxRuntime.jsx(Mo,{items:K,position:"right",onToggle:V})]}),p&&u==="bottom"&&jsxRuntime.jsx(Mo,{items:K,position:"bottom",onToggle:V}),v&&jsxRuntime.jsxs("div",{className:wt(),style:{left:v.x,top:v.y},role:"tooltip",children:[v.label&&jsxRuntime.jsx("div",{className:"mb-1 font-medium text-primary-200",children:v.label}),v.items.map((P,ce)=>jsxRuntime.jsxs("div",{className:"flex items-center gap-1.5",children:[jsxRuntime.jsx("span",{className:"h-2 w-2 rounded-full shrink-0",style:{background:P.color}}),jsxRuntime.jsxs("span",{className:"text-primary-300",children:[P.name,":"]}),jsxRuntime.jsx("span",{className:"font-medium",children:P.value})]},ce))]})]})}function Yl(e,t){let r=new Set,n=[];for(let o of e)if(t.has(o.id))for(let s of o.data){let a=String(s.x);r.has(a)||(r.add(a),n.push(a));}return n}function Ul(e,t,r,n){if(r){let o=0;for(let a of e)if(t.has(a.id))for(let l of a.data)l.y>o&&(o=l.y);o===0&&(o=1);let[,s]=zt(0,o,.05);return [n?.min??0,n?.max??s]}else {let o=new Map;for(let l of e)if(t.has(l.id))for(let d of l.data){let m=String(d.x);o.set(m,(o.get(m)??0)+d.y);}let s=Math.max(0,...o.values()),[,a]=zt(0,s===0?1:s,.05);return [n?.min??0,n?.max??a]}}function ql(e,t){let[r,n]=e,[o,s]=t;return n===r?()=>(o+s)/2:a=>o+(a-r)/(n-r)*(s-o)}function Zl(e,t=5){return Lr(e[0],e[1],t)}function Ql(e,t,r,n,o,s,a,l,d,m,c){let f=e.filter(y=>t.has(y.id)),p=r.length,u=f.length;if(p===0||u===0)return [];let h=s/p,g=h*(1-m),x=u>0?g*(1-c)/u:0,w=[];for(let y=0;y<r.length;y++){let M=r[y],v=o+y*h+(h-g)/2;for(let N=0;N<f.length;N++){let L=f[N],R=L.data.find(V=>String(V.x)===M);if(!R)continue;let D=v+N*(x+g*c/u),A=d(R.y);w.push({seriesId:L.id,category:M,x:D,y:A,width:Math.max(x,1),height:Math.max(a-A,0),stackBase:a,value:R.y,color:n.get(L.id)??"var(--color-chart-1)"});}}return w}function Jl(e,t,r,n,o,s,a,l,d,m){let c=e.filter(w=>t.has(w.id)),f=r.length,p=c.length;if(f===0||p===0)return [];let u=a/f,h=u*(1-d),g=p>0?h*(1-m)/p:0,x=[];for(let w=0;w<r.length;w++){let y=r[w],M=s+w*u+(u-h)/2;for(let v=0;v<c.length;v++){let N=c[v],L=N.data.find(A=>String(A.x)===y);if(!L)continue;let R=M+v*(g+h*m/Math.max(p,1)),D=l(L.y);x.push({seriesId:N.id,category:y,x:o,y:R,width:Math.max(D-o,0),height:Math.max(g,1),stackBase:o,value:L.y,color:n.get(N.id)??"var(--color-chart-1)"});}}return x}function ec(e,t,r,n,o,s,a,l,d){let m=e.filter(h=>t.has(h.id)),c=r.length;if(c===0)return [];let f=a/c*(1-d),p=[],u=new Map;r.forEach(h=>u.set(h,o));for(let h of m)for(let g of r){let x=h.data.find(N=>String(N.x)===g);if(!x)continue;let w=u.get(g)??o,y=Math.max(l(x.y)-o,0),M=r.indexOf(g),v=s+(M+.5)*(a/c);p.push({seriesId:h.id,category:g,x:w,y:v-f/2,width:y,height:Math.max(f,1),stackBase:w,value:x.y,color:n.get(h.id)??"var(--color-chart-1)"}),u.set(g,w+y);}return p}function tc(e,t,r,n,o,s,a,l,d){let m=e.filter(h=>t.has(h.id)),c=r.length;if(c===0)return [];let f=s/c*(1-d),p=[],u=new Map;r.forEach(h=>u.set(h,a));for(let h of m)for(let g of r){let x=h.data.find(L=>String(L.x)===g);if(!x)continue;let w=u.get(g)??a,y=Math.max(a-l(x.y),0),M=w-y,v=r.indexOf(g),N=o+(v+.5)*(s/c);p.push({seriesId:h.id,category:g,x:N-f/2,y:M,width:Math.max(f,1),height:y,stackBase:w,value:x.y,color:n.get(h.id)??"var(--color-chart-1)"}),u.set(g,M);}return p}function Po({items:e,position:t,onToggle:r}){return jsxRuntime.jsx("div",{className:kt({position:t}),children:e.map(n=>jsxRuntime.jsxs("button",{onClick:()=>r(n.id),className:i("flex items-center gap-1.5 cursor-pointer rounded px-1.5 py-1 text-xs text-primary-700 transition-opacity hover:bg-primary-100 dark:text-primary-300 dark:hover:bg-primary-800",!n.visible&&"opacity-40"),"aria-pressed":n.visible,children:[jsxRuntime.jsx("span",{className:"h-2.5 w-5 rounded-sm shrink-0",style:{background:n.color}}),n.label]},n.id))})}function Os({series:e,xAxis:t,yAxis:r,orientation:n="vertical",grouped:o=true,barRadius:s=4,barPadding:a=.2,groupPadding:l=.3,title:d,height:m=300,className:c,legend:f=true,legendPosition:p="bottom",animateOnMount:u=true,emptyText:h="No data to display"}){let g=Kr.useRef(null),x=Kr.useRef(null),[w,y]=Kr.useState(600),[M,v]=Kr.useState(null);Kr.useEffect(()=>{let b=x.current;if(!b)return;let I=b.getBoundingClientRect().width;I>0&&y(I);let W=new ResizeObserver(K=>{let B=K[0]?.contentRect.width;B&&B>0&&y(B);});return W.observe(b),()=>W.disconnect()},[]);let N=Kr.useMemo(()=>e.map(b=>b.id),[e]),{visible:L,toggle:R,isVisible:D}=_t(N),A=Kr.useMemo(()=>Bt(e.length),[e.length]),V=Kr.useMemo(()=>new Map(e.map((b,I)=>[b.id,b.color??A[I]])),[e,A]),k=n==="horizontal",O=Kr.useMemo(()=>$t(!!t?.label,!!r?.label,false),[t?.label,r?.label]),C=Kr.useMemo(()=>Ot(w,m,O),[w,m,O]),X=Kr.useMemo(()=>Yl(e,L),[e,L]),T=Kr.useMemo(()=>Ul(e,L,o,k?t:r),[e,L,o,k,t,r]),re=Kr.useMemo(()=>ql(T,k?[C.plotLeft,C.plotRight]:[C.plotBottom,C.plotTop]),[T,C,k]),_=Kr.useMemo(()=>Zl(T,(k?t:r)?.tickCount??5),[T,k,t,r]),de=Kr.useMemo(()=>k?o?Jl(e,L,X,V,C.plotLeft,C.plotTop,C.plotHeight,re,l,a):ec(e,L,X,V,C.plotLeft,C.plotTop,C.plotHeight,re,l):o?Ql(e,L,X,V,C.plotLeft,C.plotWidth,C.plotBottom,C.plotTop,re,l,a):tc(e,L,X,V,C.plotLeft,C.plotWidth,C.plotBottom,re,l),[e,L,X,V,C,re,o,k,l,a]),J=X.length>0?C.plotWidth/X.length:1,pe=X.length>0?C.plotHeight/X.length:1,fe=Kr.useCallback((b,I)=>{let W=g.current?.getBoundingClientRect();if(!W)return;let K=e.filter(B=>D(B.id)).map(B=>{let Q=B.data.find(ve=>String(ve.x)===I);return {name:B.name,value:Q?Ve(Q.y,r?.format):"\u2014",color:V.get(B.id)??"var(--color-chart-1)"}});v({x:b.clientX-W.left+12,y:b.clientY-W.top-10,category:I,items:K});},[e,D,V,r?.format]),$=Kr.useMemo(()=>e.map((b,I)=>({id:b.id,label:b.name,color:b.color??A[I],visible:D(b.id)})),[e,A,D]),U=e.some(b=>b.data.length>0),me=p==="left"||p==="right",j=jsxRuntime.jsxs("svg",{role:"img","aria-label":d??"Bar chart",width:C.width,height:C.height,viewBox:`0 0 ${C.width} ${C.height}`,shapeRendering:"geometricPrecision",children:[_.map(b=>{let I=re(b);return k?jsxRuntime.jsx("line",{x1:I,x2:I,y1:C.plotTop,y2:C.plotBottom,stroke:"currentColor",strokeWidth:.5,strokeDasharray:"4 4",className:"text-secondary-200 dark:text-secondary-700"},b):jsxRuntime.jsx("line",{x1:C.plotLeft,x2:C.plotRight,y1:I,y2:I,stroke:"currentColor",strokeWidth:.5,strokeDasharray:"4 4",className:"text-secondary-200 dark:text-secondary-700"},b)}),de.map(b=>{let I=Math.min(s,b.width/2,b.height/2),W=`${b.seriesId}-${b.category}`;return k?jsxRuntime.jsx("rect",{x:b.x,y:b.y,width:b.width,height:b.height,rx:I,fill:b.color,className:i("chart-bar-h",u&&"chart-bar-animate"),onMouseMove:K=>fe(K,b.category),onMouseLeave:()=>v(null)},W):jsxRuntime.jsx("rect",{x:b.x,y:b.y,width:b.width,height:b.height,rx:I,fill:b.color,className:i("chart-bar-v",u&&"chart-bar-animate"),onMouseMove:K=>fe(K,b.category),onMouseLeave:()=>v(null)},W)}),jsxRuntime.jsx("line",{x1:C.plotLeft,x2:C.plotLeft,y1:C.plotTop,y2:C.plotBottom,stroke:"currentColor",strokeWidth:1,className:"text-secondary-300 dark:text-secondary-600"}),jsxRuntime.jsx("line",{x1:C.plotLeft,x2:C.plotRight,y1:C.plotBottom,y2:C.plotBottom,stroke:"currentColor",strokeWidth:1,className:"text-secondary-300 dark:text-secondary-600"}),!k&&_.map(b=>{let I=re(b);return jsxRuntime.jsxs("g",{children:[jsxRuntime.jsx("line",{x1:C.plotLeft-4,x2:C.plotLeft,y1:I,y2:I,stroke:"currentColor",strokeWidth:1,className:"text-secondary-300 dark:text-secondary-600"}),jsxRuntime.jsx("text",{x:C.plotLeft-6,y:I,textAnchor:"end",dominantBaseline:"middle",fontSize:10,fill:"currentColor",className:"text-secondary-500 dark:text-secondary-400",children:Ve(b,r?.format)})]},b)}),k&&_.map(b=>{let I=re(b);return jsxRuntime.jsxs("g",{children:[jsxRuntime.jsx("line",{x1:I,x2:I,y1:C.plotBottom,y2:C.plotBottom+4,stroke:"currentColor",strokeWidth:1,className:"text-secondary-300 dark:text-secondary-600"}),jsxRuntime.jsx("text",{x:I,y:C.plotBottom+14,textAnchor:"middle",fontSize:10,fill:"currentColor",className:"text-secondary-500 dark:text-secondary-400",children:Ve(b,t?.format)})]},b)}),X.map((b,I)=>{if(k){let K=C.plotTop+(I+.5)*pe;return jsxRuntime.jsx("text",{x:C.plotLeft-6,y:K,textAnchor:"end",dominantBaseline:"middle",fontSize:10,fill:"currentColor",className:"text-secondary-500 dark:text-secondary-400",children:b},b)}let W=C.plotLeft+(I+.5)*J;return jsxRuntime.jsx("text",{x:W,y:C.plotBottom+14,textAnchor:"middle",fontSize:10,fill:"currentColor",className:"text-secondary-500 dark:text-secondary-400",children:b},b)}),r?.label&&!k&&jsxRuntime.jsx("text",{x:-(C.plotTop+C.plotHeight/2),y:14,textAnchor:"middle",fontSize:11,fill:"currentColor",className:"text-secondary-600 dark:text-secondary-400",transform:"rotate(-90)",children:r.label}),t?.label&&jsxRuntime.jsx("text",{x:C.plotLeft+C.plotWidth/2,y:C.height-4,textAnchor:"middle",fontSize:11,fill:"currentColor",className:"text-secondary-600 dark:text-secondary-400",children:t.label})]});return jsxRuntime.jsxs("div",{ref:g,className:i(vt(),c),children:[d&&jsxRuntime.jsx("h3",{className:"mb-2 text-sm font-semibold text-primary-700 dark:text-primary-200",children:d}),f&&p==="top"&&jsxRuntime.jsx(Po,{items:$,position:"top",onToggle:R}),jsxRuntime.jsxs("div",{className:i("flex items-start",me&&"gap-0"),children:[f&&p==="left"&&jsxRuntime.jsx(Po,{items:$,position:"left",onToggle:R}),jsxRuntime.jsx("div",{ref:x,className:"flex-1 min-w-0 overflow-hidden",children:U?j:jsxRuntime.jsx("div",{className:"flex items-center justify-center text-secondary-400 dark:text-secondary-500",style:{height:m},children:h})}),f&&p==="right"&&jsxRuntime.jsx(Po,{items:$,position:"right",onToggle:R})]}),f&&p==="bottom"&&jsxRuntime.jsx(Po,{items:$,position:"bottom",onToggle:R}),M&&jsxRuntime.jsxs("div",{className:wt(),style:{left:M.x,top:M.y},role:"tooltip",children:[jsxRuntime.jsx("div",{className:"mb-1 font-medium text-primary-200",children:M.category}),M.items.map((b,I)=>jsxRuntime.jsxs("div",{className:"flex items-center gap-1.5",children:[jsxRuntime.jsx("span",{className:"h-2 w-2 rounded-full shrink-0",style:{background:b.color}}),jsxRuntime.jsxs("span",{className:"text-primary-300",children:[b.name,":"]}),jsxRuntime.jsx("span",{className:"font-medium",children:b.value})]},I))]})]})}function oc(e,t,r,n,o,s,a,l,d){let m=e.filter(h=>t.has(h.id)),c=m.reduce((h,g)=>h+g.value,0);if(c===0)return [];let f=new Map(e.map((h,g)=>[h.id,h.color??r[g%r.length]])),p=[],u=l;for(let h of m){let g=h.value/c*360,x=d/2,w=u+x,y=u+g-x,M=(w+y)/2,v;if(Math.abs(y-w)>=359.9){let N=st(s,a,n,w),L=st(s,a,n,w+180);v=`M ${N.x.toFixed(3)} ${N.y.toFixed(3)} A ${n} ${n} 0 1 1 ${L.x.toFixed(3)} ${L.y.toFixed(3)} A ${n} ${n} 0 1 1 ${N.x.toFixed(3)} ${N.y.toFixed(3)} Z`;}else if(o>0){let N=st(s,a,n,w),L=st(s,a,n,y),R=st(s,a,o,y),D=st(s,a,o,w),A=y-w>180?1:0;v=`M ${N.x.toFixed(3)} ${N.y.toFixed(3)} A ${n} ${n} 0 ${A} 1 ${L.x.toFixed(3)} ${L.y.toFixed(3)} L ${R.x.toFixed(3)} ${R.y.toFixed(3)} A ${o} ${o} 0 ${A} 0 ${D.x.toFixed(3)} ${D.y.toFixed(3)} Z`;}else {let N=st(s,a,n,w),L=st(s,a,n,y),R=y-w>180?1:0;v=`M ${s.toFixed(3)} ${a.toFixed(3)} L ${N.x.toFixed(3)} ${N.y.toFixed(3)} A ${n} ${n} 0 ${R} 1 ${L.x.toFixed(3)} ${L.y.toFixed(3)} Z`;}p.push({id:h.id,label:h.label,value:h.value,percent:Math.round(h.value/c*1e3)/10,color:f.get(h.id)??"var(--color-chart-1)",startAngle:w,endAngle:y,midAngle:M,path:v,outerR:n,innerR:o,cx:s,cy:a}),u+=g;}return p}function ac(e,t){let r=(e-90)*Math.PI/180;return {dx:Math.cos(r)*t,dy:Math.sin(r)*t}}function Eo({items:e,position:t,onToggle:r}){return jsxRuntime.jsx("div",{className:kt({position:t}),children:e.map(n=>jsxRuntime.jsxs("button",{onClick:()=>r(n.id),className:i("flex items-center gap-1.5 cursor-pointer rounded px-1.5 py-1 text-xs text-primary-700 transition-opacity hover:bg-primary-100 dark:text-primary-300 dark:hover:bg-primary-800",!n.visible&&"opacity-40"),"aria-pressed":n.visible,children:[jsxRuntime.jsx("span",{className:"h-2.5 w-2.5 rounded-full shrink-0",style:{background:n.color}}),jsxRuntime.jsx("span",{children:n.label}),jsxRuntime.jsxs("span",{className:"text-secondary-400",children:["(",n.percent,"%)"]})]},n.id))})}function js({data:e,donut:t=false,donutThickness:r=.5,startAngle:n=-90,padAngle:o=0,labelType:s="percent",centerLabel:a,centerSubLabel:l,explodeOnHover:d=true,explodeOffset:m=8,title:c,height:f=300,className:p,legend:u=true,legendPosition:h="bottom",animateOnMount:g=true,emptyText:x="No data to display"}){let w=Kr.useRef(null),y=Kr.useRef(null),[M,v]=Kr.useState(400),[N,L]=Kr.useState(null),[R,D]=Kr.useState(null),[A,V]=Kr.useState({}),k=Kr.useRef(null);Kr.useEffect(()=>{let F=y.current;if(!F)return;let ee=F.getBoundingClientRect().width;ee>0&&v(ee);let z=new ResizeObserver(q=>{let xe=q[0]?.contentRect.width;xe&&xe>0&&v(xe);});return z.observe(F),()=>z.disconnect()},[]),Kr.useEffect(()=>{function F(z){let q=k.current;if(!q)return;"touches"in z&&z.cancelable&&z.preventDefault();let xe="touches"in z?z.touches[0]?.clientX??q.startX:z.clientX,Ae="touches"in z?z.touches[0]?.clientY??q.startY:z.clientY;V(He=>({...He,[q.id]:{dx:q.origDx+xe-q.startX,dy:q.origDy+Ae-q.startY}}));}function ee(){k.current=null;}return window.addEventListener("mousemove",F),window.addEventListener("mouseup",ee),window.addEventListener("touchmove",F,{passive:false}),window.addEventListener("touchend",ee),()=>{window.removeEventListener("mousemove",F),window.removeEventListener("mouseup",ee),window.removeEventListener("touchmove",F),window.removeEventListener("touchend",ee);}},[]);let O=Kr.useMemo(()=>e.map(F=>F.id),[e]),{visible:C,toggle:X,isVisible:T}=_t(O),re=Kr.useMemo(()=>Bt(e.length),[e.length]),_=10,de=6.4,J=18,pe=14,fe=6,$=M,U=f,me=$/2,j=U/2,b=s!=="none"?J+fe+4:fe+4,I=Math.max(Math.min(me,j)-b,20),W=t?I*r:0,K=Kr.useMemo(()=>oc(e,C,re,I,W,me,j,n,o),[e,C,re,I,W,me,j,n,o]),B=Kr.useMemo(()=>K.map(F=>F.id).join(","),[K]);Kr.useEffect(()=>{V({});},[B]);let Q=Kr.useCallback((F,ee)=>{if(k.current)return;let z=w.current?.getBoundingClientRect();if(!z)return;L(ee);let q=K.find(xe=>xe.id===ee);q&&D({x:F.clientX-z.left+12,y:F.clientY-z.top-10,items:[{label:q.label,value:Ve(q.value),percent:`${q.percent}%`,color:q.color}]});},[K]),ve=Kr.useCallback(()=>{L(null),D(null);},[]),P=Kr.useCallback((F,ee,z)=>{let q=A[F]??{dx:0,dy:0};k.current={id:F,startX:ee,startY:z,origDx:q.dx,origDy:q.dy};},[A]),ce=Kr.useCallback((F,ee)=>{F.preventDefault(),L(ee);let z=w.current?.getBoundingClientRect();if(!z)return;let q=F.touches[0];if(!q)return;let xe=K.find(Ae=>Ae.id===ee);xe&&D({x:q.clientX-z.left+12,y:q.clientY-z.top-10,items:[{label:xe.label,value:Ve(xe.value),percent:`${xe.percent}%`,color:xe.color}]});},[K]),ae=Kr.useMemo(()=>{let F=e.reduce((ee,z)=>ee+z.value,0);return e.map((ee,z)=>({id:ee.id,label:ee.label,color:ee.color??re[z],visible:T(ee.id),percent:F>0?Math.round(ee.value/F*1e3)/10:0}))},[e,re,T]),he=e.length>0&&e.some(F=>F.value>0),ge=h==="left"||h==="right",Me=Kr.useMemo(()=>{if(s==="none")return [];let F=_+3,ee=fe+_*.5,z=U-fe-_*.5,q=K.filter(G=>G.percent>=3).map(G=>{let ye="";switch(s){case "percent":ye=`${G.percent}%`;break;case "value":ye=Ve(G.value);break;case "label":ye=G.label;break;case "label+percent":ye=`${G.label} ${G.percent}%`;break}let E=st(G.cx,G.cy,G.outerR+2,G.midAngle),Z=st(G.cx,G.cy,G.outerR+J,G.midAngle),ne=(G.midAngle-90)*Math.PI/180,H=Math.cos(ne)>=0,be=Math.ceil(ye.length*de);return {id:G.id,color:G.color,text:ye,textW:be,p1:E,elbowX:Z.x,y:Z.y,isRight:H}}),xe=q.filter(G=>G.isRight).sort((G,ye)=>G.y-ye.y),Ae=q.filter(G=>!G.isRight).sort((G,ye)=>G.y-ye.y);function He(G){if(G.length!==0)for(let ye=0;ye<20;ye++){let E=false;for(let ne=1;ne<G.length;ne++){let H=G[ne].y-G[ne-1].y;if(H<F){let be=(F-H)/2;G[ne-1].y-=be,G[ne].y+=be,E=true;}}G[0].y<ee&&(G[0].y=ee);for(let ne=1;ne<G.length;ne++)G[ne].y<G[ne-1].y+F&&(G[ne].y=G[ne-1].y+F);let Z=G.length-1;G[Z].y>z&&(G[Z].y=z);for(let ne=Z-1;ne>=0;ne--)G[ne].y>G[ne+1].y-F&&(G[ne].y=G[ne+1].y-F);for(let ne of G)ne.y=Math.max(ee,Math.min(z,ne.y));if(!E)break}}return He(xe),He(Ae),[...Ae,...xe]},[K,s,U]),ke=jsxRuntime.jsxs("svg",{role:"img","aria-label":c??"Pie chart",width:$,height:U,viewBox:`0 0 ${$} ${U}`,shapeRendering:"geometricPrecision",children:[jsxRuntime.jsxs("g",{className:g?"chart-pie-animate":"",children:[K.map((F,ee)=>{let z=N===F.id,q=d&&z,xe=ac(F.midAngle,q?m:0);return jsxRuntime.jsx("path",{d:F.path,fill:F.color,transform:q?`translate(${xe.dx}, ${xe.dy})`:void 0,className:i("chart-slice",g&&`chart-slice-animate-${Math.min(ee,7)}`,z&&"chart-slice--exploded"),stroke:F.color,strokeWidth:.6,onMouseMove:Ae=>Q(Ae,F.id),onMouseLeave:ve,onTouchStart:Ae=>ce(Ae,F.id),onTouchEnd:ve,"aria-label":`${F.label}: ${F.percent}%`},F.id)}),Me.map(F=>{let ee=A[F.id]??{dx:0,dy:0},z=F.elbowX+ee.dx,q=F.y+ee.dy,xe=z+(F.isRight?pe:-pe),Ae=F.isRight?xe+3:xe-3,He=pe+3+F.textW+6,G=F.isRight?z:z-He,ye=q-_-2,E=_*2+4;return jsxRuntime.jsxs("g",{style:{userSelect:"none"},children:[jsxRuntime.jsx("polyline",{points:[`${F.p1.x.toFixed(2)},${F.p1.y.toFixed(2)}`,`${z.toFixed(2)},${q.toFixed(2)}`,`${xe.toFixed(2)},${q.toFixed(2)}`].join(" "),fill:"none",stroke:F.color,strokeWidth:1.2,opacity:.85,strokeLinejoin:"round",strokeLinecap:"round",style:{pointerEvents:"none"}}),jsxRuntime.jsx("text",{x:Ae.toFixed(2),y:q.toFixed(2),textAnchor:F.isRight?"start":"end",dominantBaseline:"middle",fontSize:_,fill:"currentColor",className:"text-primary-700 dark:text-primary-300",style:{pointerEvents:"none"},children:F.text}),jsxRuntime.jsx("rect",{x:G,y:ye,width:He,height:E,fill:"transparent",style:{cursor:"grab",touchAction:"none"},onMouseDown:Z=>{Z.stopPropagation(),P(F.id,Z.clientX,Z.clientY);},onTouchStart:Z=>{Z.stopPropagation();let ne=Z.touches[0];ne&&P(F.id,ne.clientX,ne.clientY);}})]},`label-${F.id}`)})]}),t&&jsxRuntime.jsx("g",{style:{pointerEvents:"none"},children:N&&K.find(F=>F.id===N)?jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsxs("text",{x:me,y:j-8,textAnchor:"middle",dominantBaseline:"middle",fontSize:18,fontWeight:600,fill:"currentColor",className:"text-primary-800 dark:text-primary-100",children:[K.find(F=>F.id===N)?.percent,"%"]}),jsxRuntime.jsx("text",{x:me,y:j+12,textAnchor:"middle",dominantBaseline:"middle",fontSize:10,fill:"currentColor",className:"text-secondary-500 dark:text-secondary-400",children:K.find(F=>F.id===N)?.label})]}):jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[a&&jsxRuntime.jsx("text",{x:me,y:j-(l?8:0),textAnchor:"middle",dominantBaseline:"middle",fontSize:16,fontWeight:600,fill:"currentColor",className:"text-primary-800 dark:text-primary-100",children:a}),l&&jsxRuntime.jsx("text",{x:me,y:j+14,textAnchor:"middle",dominantBaseline:"middle",fontSize:11,fill:"currentColor",className:"text-secondary-500 dark:text-secondary-400",children:l})]})})]});return jsxRuntime.jsxs("div",{ref:w,className:i(vt(),p),children:[c&&jsxRuntime.jsx("h3",{className:"mb-2 text-sm font-semibold text-primary-700 dark:text-primary-200",children:c}),u&&h==="top"&&jsxRuntime.jsx(Eo,{items:ae,position:"top",onToggle:X}),jsxRuntime.jsxs("div",{className:i("flex items-start justify-center",ge&&"gap-0"),children:[u&&h==="left"&&jsxRuntime.jsx(Eo,{items:ae,position:"left",onToggle:X}),jsxRuntime.jsx("div",{ref:y,className:"flex-1 min-w-0 overflow-hidden",children:he?ke:jsxRuntime.jsx("div",{className:"flex items-center justify-center text-secondary-400 dark:text-secondary-500",style:{height:f},children:x})}),u&&h==="right"&&jsxRuntime.jsx(Eo,{items:ae,position:"right",onToggle:X})]}),u&&h==="bottom"&&jsxRuntime.jsx(Eo,{items:ae,position:"bottom",onToggle:X}),R&&jsxRuntime.jsx("div",{className:wt(),style:{left:R.x,top:R.y},role:"tooltip",children:R.items.map((F,ee)=>jsxRuntime.jsxs("div",{className:"flex items-center gap-2",children:[jsxRuntime.jsx("span",{className:"h-2.5 w-2.5 rounded-full shrink-0",style:{background:F.color}}),jsxRuntime.jsxs("span",{className:"font-medium",children:[F.label,":"]}),jsxRuntime.jsx("span",{children:F.value}),jsxRuntime.jsxs("span",{className:"text-primary-300",children:["(",F.percent,")"]})]},ee))})]})}function ic(e,t,r){let n=1/0,o=-1/0;for(let l of e)if(t.has(l.id))for(let d of l.data){let m=Number(d.x);m<n&&(n=m),m>o&&(o=m);}if(!isFinite(n))return [0,1];let[s,a]=zt(n,o);return [r?.min??s,r?.max??a]}function lc(e,t,r){let n=1/0,o=-1/0;for(let l of e)if(t.has(l.id))for(let d of l.data)d.y<n&&(n=d.y),d.y>o&&(o=d.y);if(!isFinite(n))return [0,1];let[s,a]=zt(n,o);return [r?.min??s,r?.max??a]}function Ws(e,t){let[r,n]=e,[o,s]=t;return n===r?()=>(o+s)/2:a=>o+(a-r)/(n-r)*(s-o)}function Gs(e,t=5){return Lr(e[0],e[1],t)}function cc(e,t,r){let n=1.618033988749895,o=e*137+t,s=o*n%1*2-1,a=o*n*n%1*2-1;return [s*r,a*r]}function dc(e,t,r=12){if(e.length<2)return null;let n=Math.min(...e),o=Math.max(...e),s=Math.min(...t),a=Math.max(...t);return {cx:(n+o)/2,cy:(s+a)/2,rx:(o-n)/2+r,ry:(a-s)/2+r}}function Do({items:e,position:t,onToggle:r}){return jsxRuntime.jsx("div",{className:kt({position:t}),children:e.map(n=>jsxRuntime.jsxs("button",{onClick:()=>r(n.id),className:i("flex items-center gap-1.5 cursor-pointer rounded px-1.5 py-1 text-xs text-primary-700 transition-opacity hover:bg-primary-100 dark:text-primary-300 dark:hover:bg-primary-800",!n.visible&&"opacity-40"),"aria-pressed":n.visible,children:[jsxRuntime.jsx("span",{className:"h-2.5 w-2.5 rounded-full shrink-0",style:{background:n.color}}),n.label]},n.id))})}function Ys({series:e,xAxis:t,yAxis:r,dotRadius:n=5,dotOpacity:o=.75,clusters:s=false,jitter:a=false,jitterAmount:l=12,linkedLines:d=false,title:m,height:c=300,className:f,legend:p=true,legendPosition:u="bottom",animateOnMount:h=true,emptyText:g="No data to display"}){let x=Kr.useRef(null),w=Kr.useRef(null),[y,M]=Kr.useState(600),[v,N]=Kr.useState(null);Kr.useEffect(()=>{let b=w.current;if(!b)return;let I=b.getBoundingClientRect().width;I>0&&M(I);let W=new ResizeObserver(K=>{let B=K[0]?.contentRect.width;B&&B>0&&M(B);});return W.observe(b),()=>W.disconnect()},[]);let L=Kr.useMemo(()=>e.map(b=>b.id),[e]),{visible:R,toggle:D,isVisible:A}=_t(L),V=Kr.useMemo(()=>Bt(e.length),[e.length]),k=Kr.useMemo(()=>new Map(e.map((b,I)=>[b.id,b.color??V[I]])),[e,V]),O=Kr.useMemo(()=>$t(!!t?.label,!!r?.label,false),[t?.label,r?.label]),C=Kr.useMemo(()=>Ot(y,c,O),[y,c,O]),X=Kr.useMemo(()=>ic(e,R,t),[e,R,t]),T=Kr.useMemo(()=>lc(e,R,r),[e,R,r]),re=Kr.useMemo(()=>Ws(X,[C.plotLeft,C.plotRight]),[X,C]),_=Kr.useMemo(()=>Ws(T,[C.plotBottom,C.plotTop]),[T,C]),de=Kr.useMemo(()=>Gs(X,t?.tickCount??6),[X,t?.tickCount]),J=Kr.useMemo(()=>Gs(T,r?.tickCount??5),[T,r?.tickCount]),pe=Kr.useCallback((b,I,W,K,B)=>{let Q=x.current?.getBoundingClientRect();Q&&N({x:b.clientX-Q.left+12,y:b.clientY-Q.top-10,seriesName:I,xVal:Ve(W,t?.format),yVal:Ve(K,r?.format),color:B});},[t?.format,r?.format]),fe=Kr.useCallback((b,I,W,K,B)=>{b.preventDefault();let Q=x.current?.getBoundingClientRect();if(!Q)return;let ve=b.touches[0];ve&&N({x:ve.clientX-Q.left+12,y:ve.clientY-Q.top-10,seriesName:I,xVal:Ve(W,t?.format),yVal:Ve(K,r?.format),color:B});},[t?.format,r?.format]),$=Kr.useMemo(()=>e.map((b,I)=>({id:b.id,label:b.name,color:b.color??V[I],visible:A(b.id)})),[e,V,A]),U=e.some(b=>b.data.length>0),me=u==="left"||u==="right",j=jsxRuntime.jsxs("svg",{role:"img","aria-label":m??"Scatter chart",width:C.width,height:C.height,viewBox:`0 0 ${C.width} ${C.height}`,shapeRendering:"geometricPrecision",children:[J.map(b=>jsxRuntime.jsx("line",{x1:C.plotLeft,x2:C.plotRight,y1:_(b),y2:_(b),stroke:"currentColor",strokeWidth:.5,strokeDasharray:"4 4",className:"text-secondary-200 dark:text-secondary-700"},b)),s&&e.map((b,I)=>{if(!A(b.id)||b.data.length<2)return null;let W=k.get(b.id)??"var(--color-chart-1)",K=b.data.map(ve=>re(Number(ve.x))),B=b.data.map(ve=>_(ve.y)),Q=dc(K,B,16);return Q?jsxRuntime.jsx("ellipse",{cx:Q.cx,cy:Q.cy,rx:Q.rx,ry:Q.ry,fill:W,fillOpacity:.06,stroke:W,strokeOpacity:.3,strokeWidth:1.5,strokeDasharray:"5 3",className:h?"chart-cluster-ellipse":"",style:{animationDelay:`${I*.1}s`}},`cluster-${b.id}`):null}),d&&e.map(b=>{if(!A(b.id)||b.data.length<2)return null;let I=k.get(b.id)??"var(--color-chart-1)",K=[...b.data].sort((B,Q)=>Number(B.x)-Number(Q.x)).map(B=>`${re(Number(B.x)).toFixed(2)},${_(B.y).toFixed(2)}`).join(" ");return jsxRuntime.jsx("polyline",{points:K,fill:"none",stroke:I,strokeWidth:1.5,className:"chart-scatter-link"},`link-${b.id}`)}),e.map((b,I)=>{if(!A(b.id))return null;let W=k.get(b.id)??"var(--color-chart-1)";return jsxRuntime.jsx("g",{className:"chart-scatter-group",children:b.data.map((K,B)=>{let[Q,ve]=a?cc(I,B,l):[0,0],P=re(Number(K.x))+Q,ce=_(K.y)+ve;return jsxRuntime.jsx("circle",{cx:P,cy:ce,r:n,fill:W,fillOpacity:o,stroke:W,strokeWidth:1,strokeOpacity:.5,className:i("chart-scatter-dot",h&&"chart-scatter-dot--animate"),style:{color:W},onMouseMove:ae=>pe(ae,b.name,K.x,K.y,W),onMouseLeave:()=>N(null),onTouchStart:ae=>fe(ae,b.name,K.x,K.y,W),onTouchEnd:()=>N(null)},B)})},b.id)}),jsxRuntime.jsx("line",{x1:C.plotLeft,x2:C.plotLeft,y1:C.plotTop,y2:C.plotBottom,stroke:"currentColor",strokeWidth:1,className:"text-secondary-300 dark:text-secondary-600"}),jsxRuntime.jsx("line",{x1:C.plotLeft,x2:C.plotRight,y1:C.plotBottom,y2:C.plotBottom,stroke:"currentColor",strokeWidth:1,className:"text-secondary-300 dark:text-secondary-600"}),J.map(b=>{let I=_(b);return jsxRuntime.jsxs("g",{children:[jsxRuntime.jsx("line",{x1:C.plotLeft-4,x2:C.plotLeft,y1:I,y2:I,stroke:"currentColor",strokeWidth:1,className:"text-secondary-300 dark:text-secondary-600"}),jsxRuntime.jsx("text",{x:C.plotLeft-6,y:I,textAnchor:"end",dominantBaseline:"middle",fontSize:10,fill:"currentColor",className:"text-secondary-500 dark:text-secondary-400",children:Ve(b,r?.format)})]},b)}),de.map(b=>{let I=re(b);return jsxRuntime.jsxs("g",{children:[jsxRuntime.jsx("line",{x1:I,x2:I,y1:C.plotBottom,y2:C.plotBottom+4,stroke:"currentColor",strokeWidth:1,className:"text-secondary-300 dark:text-secondary-600"}),jsxRuntime.jsx("text",{x:I,y:C.plotBottom+14,textAnchor:"middle",fontSize:10,fill:"currentColor",className:"text-secondary-500 dark:text-secondary-400",children:Ve(b,t?.format)})]},b)}),r?.label&&jsxRuntime.jsx("text",{x:-(C.plotTop+C.plotHeight/2),y:14,textAnchor:"middle",fontSize:11,fill:"currentColor",className:"text-secondary-600 dark:text-secondary-400",transform:"rotate(-90)",children:r.label}),t?.label&&jsxRuntime.jsx("text",{x:C.plotLeft+C.plotWidth/2,y:C.height-4,textAnchor:"middle",fontSize:11,fill:"currentColor",className:"text-secondary-600 dark:text-secondary-400",children:t.label})]});return jsxRuntime.jsxs("div",{ref:x,className:i(vt(),f),children:[m&&jsxRuntime.jsx("h3",{className:"mb-2 text-sm font-semibold text-primary-700 dark:text-primary-200",children:m}),p&&u==="top"&&jsxRuntime.jsx(Do,{items:$,position:"top",onToggle:D}),jsxRuntime.jsxs("div",{className:i("flex items-start",me&&"gap-0"),children:[p&&u==="left"&&jsxRuntime.jsx(Do,{items:$,position:"left",onToggle:D}),jsxRuntime.jsx("div",{ref:w,className:"flex-1 min-w-0 overflow-hidden",children:U?j:jsxRuntime.jsx("div",{className:"flex items-center justify-center text-secondary-400 dark:text-secondary-500",style:{height:c},children:g})}),p&&u==="right"&&jsxRuntime.jsx(Do,{items:$,position:"right",onToggle:D})]}),p&&u==="bottom"&&jsxRuntime.jsx(Do,{items:$,position:"bottom",onToggle:D}),v&&jsxRuntime.jsxs("div",{className:wt(),style:{left:v.x,top:v.y},role:"tooltip",children:[jsxRuntime.jsxs("div",{className:"flex items-center gap-1.5 mb-1",children:[jsxRuntime.jsx("span",{className:"h-2 w-2 rounded-full",style:{background:v.color}}),jsxRuntime.jsx("span",{className:"font-medium",children:v.seriesName})]}),jsxRuntime.jsxs("div",{className:"text-primary-300",children:["X: ",jsxRuntime.jsx("span",{className:"font-medium text-primary-50",children:v.xVal})," ","Y: ",jsxRuntime.jsx("span",{className:"font-medium text-primary-50",children:v.yVal})]})]})]})}var Bf={LineChart:$s,BarChart:Os,PieChart:js,ScatterChart:Ys},Us=Bf;var zf={Primitives:na,Layout:la,DataDisplay:Na,Navigation:Ea,Disclosure:Aa,Overlay:Ya,Feedback:ss,Extras:Ms,Forms:Ds,Chart:Us},eN=zf;exports.Accordion=Va;exports.AccordionContent=sp;exports.AccordionItem=op;exports.AccordionTrigger=ap;exports.Alert=Qa;exports.AlertContent=Up;exports.AlertDescription=qp;exports.AlertIcon=Yp;exports.AlertTitle=Gp;exports.Avatar=Tn;exports.AvatarGroup=Rn;exports.Badge=Wo;exports.BarChart=Os;exports.Breadcrumb=Xn;exports.Button=dr;exports.Card=oa;exports.CardContent=xd;exports.CardDescription=hd;exports.CardFooter=yd;exports.CardHeader=gd;exports.CardTitle=bd;exports.Chart=Us;exports.Chat=ba;exports.Checkbox=Jo;exports.CinePlayer=us;exports.CodeBlock=va;exports.CommandPalette=No;exports.ContextMenu=Ga;exports.DataDisplay=Na;exports.DataTable=Od;exports.Dialog=Jr;exports.DialogClose=Np;exports.DialogContent=Ba;exports.DialogDescription=Oa;exports.DialogFooter=Ka;exports.DialogHeader=za;exports.DialogTitle=$a;exports.Disclosure=Aa;exports.Drawer=to;exports.DrawerBody=Ki;exports.DrawerClose=ji;exports.DrawerFooter=Xi;exports.DrawerHeader=Oi;exports.Dropdown=zo;exports.DropdownButton=pr;exports.Extras=Ms;exports.Feedback=ss;exports.FileExplorer=ys;exports.FilmReel=cs;exports.Form=Es;exports.FormItem=Lf;exports.FormSection=Ef;exports.Forms=Ds;exports.Header=Ma;exports.HorizontalCard=vd;exports.ImageCard=aa;exports.ImageCardActions=Td;exports.ImageCardBody=wd;exports.ImageCardDescription=Cd;exports.ImageCardTitle=Nd;exports.Indicator=Yo;exports.Input=qo;exports.Label=Uo;exports.Layout=la;exports.LineChart=$s;exports.List=ua;exports.ListItem=jd;exports.Masonry=Ns;exports.MetricCard=wa;exports.MiniPlayer=ms;exports.NavLink=Pa;exports.Navigation=Ea;exports.Overlay=Ya;exports.Pagination=Wn;exports.Panel=sa;exports.PanelContent=Md;exports.PanelHeader=Rd;exports.PieChart=js;exports.Primitives=na;exports.ProgressBar=ts;exports.Radio=ta;exports.RadioGroup=ea;exports.RibbonBar=La;exports.ScatterChart=Ys;exports.SideNav=Ra;exports.Skeleton=lo;exports.Slider=Pn;exports.SliderRange=Sn;exports.SortableTable=zd;exports.Spin=ns;exports.Stat=ka;exports.Switch=Qo;exports.TabContent=up;exports.TabList=dp;exports.TabPanels=pp;exports.TabTrigger=mp;exports.Table=Or;exports.TableBody=ma;exports.TableCell=Zt;exports.TableEmpty=pa;exports.TableHead=qt;exports.TableHeader=da;exports.TableRow=$r;exports.Tabs=Ia;exports.Tag=Go;exports.TextBox=Zo;exports.Timeline=Rs;exports.ToastContext=cn;exports.ToastProvider=co;exports.Tooltip=Xa;exports.Tree=fa;exports.TreeItem=Qd;exports.TypewriterText=ko;exports.accordionContentVariants=Yn;exports.accordionTriggerVariants=Gn;exports.accordionVariants=Un;exports.alertVariants=nn;exports.avatarVariants=Vr;exports.badgeVariants=mn;exports.buttonVariants=lr;exports.cardVariants=_r;exports.chartContainerVariants=vt;exports.chartLegendVariants=kt;exports.chartTooltipVariants=wt;exports.checkboxVariants=fn;exports.cn=i;exports.codeBlockVariants=Br;exports.configureAlertTopOffset=eu;exports.default=eN;exports.dialogContentVariants=Qr;exports.indicatorVariants=pn;exports.inputVariants=cr;exports.labelVariants=un;exports.listItemVariants=Vn;exports.listVariants=Dn;exports.metricCardVariants=Hn;exports.navLinkVariants=$n;exports.panelVariants=Ln;exports.progressBarVariants=no;exports.radioVariants=gn;exports.skeletonVariants=on;exports.sliderVariants=Ir;exports.spinVariants=vr;exports.statVariants=An;exports.switchTrackVariants=bn;exports.tabListVariants=qn;exports.tabTriggerVariants=Zn;exports.tableVariants=En;exports.tagVariants=hn;exports.toastVariants=oo;exports.tooltipVariants=eo;exports.treeItemVariants=In;exports.useAlert=lu;exports.useSpin=ku;exports.useToast=mo;
84
+ `}),jsxRuntime.jsx(ln,{open:re,onOpenChange:B,children:jsxRuntime.jsxs(Zo,{size:"sm",children:[jsxRuntime.jsxs(Jo,{children:[jsxRuntime.jsxs(ei,{children:[jsxRuntime.jsx(lucideReact.AlertTriangle,{className:"text-danger-500"}),"Confirm Deletion"]}),jsxRuntime.jsxs(ti,{children:[R.size===1?`Are you sure you want to delete "${ne[Array.from(R)[0]]?.name}"?`:`Are you sure you want to delete ${R.size} selected items?`," ","This action cannot be undone."]})]}),jsxRuntime.jsxs(ri,{children:[jsxRuntime.jsx(gr,{intent:"ghost",onClick:()=>B(false),children:"Cancel"}),jsxRuntime.jsxs(gr,{intent:"danger",onClick:()=>{let D=Array.from(R).map(ce=>ne[ce]).filter(Boolean);p?.(D),V(new Set),E(null),B(false);},children:[jsxRuntime.jsx(lucideReact.Trash2,{className:"h-4 w-4"}),"Delete"]})]})]})})]})}function Ir({label:e,value:t,mono:r}){return jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("div",{className:"mb-0.5 font-semibold uppercase tracking-wider text-(--fe-text-muted)",children:e}),jsxRuntime.jsx("div",{className:s("text-(--fe-text) break-all leading-snug",r&&"font-mono text-[9px]"),children:t})]})}function Bf(e,t){let r=t.getBoundingClientRect(),n=Math.max(r.width,r.height)*1.2,a=e.clientX-r.left,i=e.clientY-r.top,o=document.createElement("span");o.className="masonry-ripple",o.style.width=`${n}px`,o.style.height=`${n}px`,o.style.left=`${a}px`,o.style.top=`${i}px`,t.appendChild(o),o.addEventListener("animationend",()=>o.remove());}function Hi({columns:e,columnWidth:t=240,gap:r=16,items:n,onItemClick:a,className:i,style:o,children:l,...c}){let m=qr.useRef(null),d=qr.useRef([]),[f,p]=qr.useState(()=>e??1),[u,h]=qr.useState([]),[g,b]=qr.useState(0),N=n?n.map((R,V)=>({key:R.key??V,node:R.content})):qr__default.default.Children.toArray(l).map((R,V)=>({key:R.key??V,node:R})),x=N.length,T=qr.useCallback(R=>e??Math.max(1,Math.floor((R+r)/(t+r))),[e,t,r]),w=qr.useCallback(()=>{let R=m.current;if(!R)return;let V=R.clientWidth,I=T(V);p(I);let E=(V-(I-1)*r)/I,v=new Array(I).fill(0),U=[];for(let q=0;q<x;q++){let M=d.current[q],W=M?M.offsetHeight:0,$=0;for(let ue=1;ue<I;ue++)v[ue]<v[$]&&($=ue);U.push({top:v[$],left:$*(E+r),width:E}),v[$]+=W+r;}let k=Math.max(0,...v)-(x?r:0);h(U),b(k);},[x,T,r]);qr.useEffect(()=>{let R=m.current;if(!R)return;let V=new ResizeObserver(()=>w());return V.observe(R),()=>V.disconnect()},[w]),qr.useEffect(()=>{let R=requestAnimationFrame(w);return ()=>cancelAnimationFrame(R)},[w]),qr.useEffect(()=>{let R=new ResizeObserver(()=>w());return d.current.forEach(V=>{V&&R.observe(V);}),()=>R.disconnect()},[x,f,w]);let C=qr.useCallback((R,V)=>{let I=R.currentTarget;Bf(R,I),a?.(n?.[V],V);},[a,n]),S=R=>{if(!n)return false;let V=n[R];return !!(V.title||V.description||V.actions)};return jsxRuntime.jsx("div",{ref:m,className:s("relative",i),style:{...o,height:g},...c,children:N.map((R,V)=>jsxRuntime.jsxs("div",{ref:I=>{d.current[V]=I;},className:"masonry-item",role:"button",tabIndex:0,onClick:I=>C(I,V),onKeyDown:I=>{(I.key==="Enter"||I.key===" ")&&(I.preventDefault(),a?.(n?.[V],V));},style:{position:"absolute",top:u[V]?.top??0,left:u[V]?.left??0,width:u[V]?.width??"100%"},children:[R.node,S(V)&&jsxRuntime.jsxs("div",{className:"masonry-item-overlay",children:[n[V].title&&jsxRuntime.jsx("p",{className:"masonry-item-overlay-title",children:n[V].title}),n[V].description&&jsxRuntime.jsx("p",{className:"masonry-item-overlay-desc",children:n[V].description}),n[V].actions&&jsxRuntime.jsx("div",{className:"masonry-item-overlay-actions",children:n[V].actions})]})]},R.key))})}function La({text:e="",mode:t="typewriter",speed:r=40,cursor:n=true,cursorChar:a="\u258B",thinking:i=false,streaming:o=false,delay:l=0,onComplete:c,as:m="span",className:d}){let[f,p]=qr.useState(t==="instant"?e:""),[u,h]=qr.useState(false),[g,b]=qr.useState(t==="instant"),[N,x]=qr.useState(false),T=qr.useRef(0),w=qr.useRef(c);w.current=c;let C=qr.useRef(e);C.current=e,qr.useEffect(()=>{if(t!=="typewriter")return;if(p(""),b(false),x(false),h(false),!e){b(true);return}let E=Math.max(10,1e3/r),v=0,U,k=()=>{h(true),U=setInterval(()=>{let M=C.current;v++,p(M.slice(0,v)),v>=M.length&&(clearInterval(U),h(false),b(true),w.current?.());},E);},q;return l>0?q=setTimeout(k,l):k(),()=>{clearTimeout(q),clearInterval(U);}},[e,t]),qr.useEffect(()=>{if(t!=="stream")return;if(e.length===0){T.current=0,p(""),h(false),b(false),x(false);return}if(e.length<=T.current)return;let E=Math.max(10,1e3/r),v=T.current;h(true),b(false),x(false);let U=setInterval(()=>{v++,T.current=v,p(C.current.slice(0,v)),v>=C.current.length&&(clearInterval(U),h(false),w.current?.());},E);return ()=>clearInterval(U)},[e,t]),qr.useEffect(()=>{t==="instant"&&(p(e),h(false),b(true));},[e,t]);let S=qr.useRef(o);qr.useEffect(()=>{let E=S.current;if(S.current=o,E&&!o&&!u&&t==="stream"){x(true);let v=setTimeout(()=>{x(false),b(true);},650);return ()=>clearTimeout(v)}},[o,u,t]);let R=n&&(i||u||N||t==="stream"&&o&&!g||t==="typewriter"&&!g),V=i?"tw-cursor--blink":u?"tw-cursor--solid":N?"tw-cursor--out":"tw-cursor--blink";return jsxRuntime.jsxs(m,{className:s(d),children:[i&&!f&&jsxRuntime.jsx("span",{"aria-hidden":"true",children:"\u200B"}),f,R&&jsxRuntime.jsx("span",{className:s("tw-cursor",V),"aria-hidden":"true",children:a})]})}function Ea(e){return e.toLowerCase().replace(/\s+/g," ").trim()}function $f(e,t){if(!t)return true;let r=Ea(t);return Ea(e.label).includes(r)||(e.description?Ea(e.description).includes(r):false)||(e.keywords?e.keywords.some(n=>Ea(n).includes(r)):false)}function Yf(e){let t=new Map;for(let r of e){let n=r.group??"";t.has(n)||t.set(n,[]),t.get(n).push(r);}return Array.from(t.entries()).map(([r,n])=>({label:r,items:n}))}function Bl(e,t,r,n){let[a,i]=qr.useState(""),[o,l]=qr.useState(0);qr.useEffect(()=>{t&&(i(""),l(0));},[t]);let c=qr.useMemo(()=>e.filter(p=>!p.disabled&&$f(p,a)),[e,a]),m=qr.useMemo(()=>Yf(c),[c]);qr.useEffect(()=>{l(p=>Math.min(p,Math.max(0,c.length-1)));},[c.length]);let d=qr.useCallback(()=>{let p=c[o];p&&(p.onSelect(),r(false));},[c,o,r]),f=qr.useCallback(p=>{switch(p.key){case "ArrowDown":p.preventDefault(),l(u=>(u+1)%Math.max(1,c.length));break;case "ArrowUp":p.preventDefault(),l(u=>(u-1+Math.max(1,c.length))%Math.max(1,c.length));break;case "Enter":p.preventDefault(),d();break;case "Escape":p.preventDefault(),r(false);break}},[c.length,d,r]);return qr.useEffect(()=>{if(!n)return;function p(u){(u.metaKey||u.ctrlKey)&&u.key==="k"&&(u.preventDefault(),r(!t));}return window.addEventListener("keydown",p),()=>window.removeEventListener("keydown",p)},[n,t,r]),{query:a,setQuery:i,groups:m,filtered:c,activeIndex:o,setActiveIndex:l,handleKeyDown:f}}function Va({open:e,onOpenChange:t,commands:r,placeholder:n="Type a command or search\u2026",hotkey:a=true,maxItems:i=8,className:o}){let l=qr.useRef(null),c=qr.useRef(null),{query:m,setQuery:d,groups:f,filtered:p,activeIndex:u,setActiveIndex:h,handleKeyDown:g}=Bl(r,e,t,a);if(qr.useEffect(()=>{if(e){let N=setTimeout(()=>l.current?.focus(),40);return ()=>clearTimeout(N)}},[e]),qr.useEffect(()=>{c.current?.querySelector("[data-active='true']")?.scrollIntoView({block:"nearest"});},[u]),!e)return null;let b=0;return reactDom.createPortal(jsxRuntime.jsx("div",{className:"cmd-backdrop fixed inset-0 z-50 flex items-start justify-center pt-[15vh]",onClick:()=>t(false),role:"presentation",children:jsxRuntime.jsxs("div",{className:s("cmd-panel relative flex w-full max-w-lg flex-col overflow-hidden rounded-xl","border border-primary-200 bg-white shadow-2xl","dark:border-primary-700 dark:bg-primary-900",o),onClick:N=>N.stopPropagation(),onKeyDown:g,role:"dialog","aria-label":"Command palette","aria-modal":"true",children:[jsxRuntime.jsxs("div",{className:"flex items-center gap-3 border-b border-primary-100 px-4 dark:border-primary-700",children:[jsxRuntime.jsx(lucideReact.Search,{className:"h-4 w-4 shrink-0 text-secondary-400","aria-hidden":"true"}),jsxRuntime.jsx("input",{ref:l,value:m,onChange:N=>d(N.target.value),placeholder:n,className:"flex-1 bg-transparent py-3.5 text-sm text-primary-900 outline-none placeholder:text-secondary-400 dark:text-primary-50","aria-label":"Search commands","aria-controls":"cmd-results","aria-autocomplete":"list","aria-activedescendant":p[u]?`cmd-item-${p[u].id}`:void 0,spellCheck:false,autoComplete:"off"}),jsxRuntime.jsx("kbd",{className:"hidden shrink-0 rounded border border-primary-200 px-1.5 py-0.5 text-xs text-secondary-400 dark:border-primary-600 sm:block",children:"esc"})]}),jsxRuntime.jsx("div",{id:"cmd-results",ref:c,className:"overflow-y-auto py-2",style:{maxHeight:`${i*2.75}rem`},role:"listbox","aria-label":"Commands",children:p.length===0?jsxRuntime.jsxs("div",{className:"flex flex-col items-center gap-2 py-8 text-sm text-secondary-400",children:[jsxRuntime.jsx(lucideReact.Command,{className:"h-8 w-8 opacity-30"}),jsxRuntime.jsx("span",{children:"No commands found"})]}):f.map(N=>jsxRuntime.jsxs("div",{className:"mb-1 last:mb-0",children:[N.label&&jsxRuntime.jsx("p",{className:"px-4 pb-1 pt-2 text-xs font-semibold uppercase tracking-wide text-secondary-400 dark:text-secondary-500",children:N.label}),N.items.map(x=>{let T=b++,w=T===u;return jsxRuntime.jsxs("button",{id:`cmd-item-${x.id}`,"data-active":w,role:"option","aria-selected":w,className:s("cmd-item group flex w-full items-center gap-3 px-4 py-2.5 text-left text-sm",w?"bg-primary-100 text-primary-900 dark:bg-primary-800 dark:text-primary-50":"text-primary-700 hover:bg-primary-50 dark:text-primary-300 dark:hover:bg-primary-800/50"),onMouseEnter:()=>h(T),onClick:()=>{x.onSelect(),t(false);},children:[x.icon&&jsxRuntime.jsx("span",{className:s("flex h-7 w-7 shrink-0 items-center justify-center rounded-md border text-xs",w?"border-primary-300 bg-white text-primary-700 dark:border-primary-600 dark:bg-primary-700 dark:text-primary-200":"border-primary-200 bg-primary-50 text-primary-500 dark:border-primary-700 dark:bg-primary-800 dark:text-primary-400"),children:x.icon}),jsxRuntime.jsxs("span",{className:"min-w-0 flex-1",children:[jsxRuntime.jsx("span",{className:"block truncate font-medium",children:x.label}),x.description&&jsxRuntime.jsx("span",{className:"block truncate text-xs text-secondary-400 dark:text-secondary-500",children:x.description})]}),x.shortcut&&jsxRuntime.jsx("span",{className:"flex shrink-0 items-center gap-0.5",children:x.shortcut.map((C,S)=>jsxRuntime.jsx("kbd",{className:"rounded border border-primary-200 px-1.5 py-0.5 text-xs text-secondary-500 dark:border-primary-700 dark:text-secondary-400",children:C},S))})]},x.id)})]},N.label||"_default"))}),p.length>0&&jsxRuntime.jsxs("div",{className:"flex items-center justify-between border-t border-primary-100 px-4 py-2 dark:border-primary-700",children:[jsxRuntime.jsxs("span",{className:"text-xs text-secondary-400",children:[p.length," result",p.length!==1?"s":""]}),jsxRuntime.jsxs("span",{className:"flex items-center gap-3 text-xs text-secondary-400",children:[jsxRuntime.jsxs("span",{className:"flex items-center gap-1",children:[jsxRuntime.jsx("kbd",{className:"rounded border border-primary-200 px-1 dark:border-primary-700",children:"\u2191"}),jsxRuntime.jsx("kbd",{className:"rounded border border-primary-200 px-1 dark:border-primary-700",children:"\u2193"}),"Navigate"]}),jsxRuntime.jsxs("span",{className:"flex items-center gap-1",children:[jsxRuntime.jsx("kbd",{className:"rounded border border-primary-200 px-1 dark:border-primary-700",children:"\u21B5"}),"Select"]})]})]})]})}),document.body)}var Xl={complete:"bg-success-500 border-success-500 text-white dark:bg-success-600 dark:border-success-600",active:"bg-primary-500 border-primary-500 text-white dark:bg-primary-400 dark:border-primary-400",error:"bg-danger-500 border-danger-500 text-white dark:bg-danger-600 dark:border-danger-600",pending:"bg-white border-primary-300 text-secondary-400 dark:bg-primary-800 dark:border-primary-600"},Wl={complete:"shadow-[0_0_0_4px_theme(colors.success.100)] dark:shadow-[0_0_0_4px_theme(colors.success.900/30)]",active:"shadow-[0_0_0_4px_theme(colors.primary.100)] dark:shadow-[0_0_0_4px_theme(colors.primary.800/50)] animate-pulse",error:"shadow-[0_0_0_4px_theme(colors.danger.100)] dark:shadow-[0_0_0_4px_theme(colors.danger.900/30)]",pending:""};function jl({status:e,icon:t}){return t?jsxRuntime.jsx(jsxRuntime.Fragment,{children:t}):e==="complete"?jsxRuntime.jsx(lucideReact.Check,{className:"h-3 w-3"}):e==="error"?jsxRuntime.jsx(lucideReact.AlertCircle,{className:"h-3 w-3"}):e==="active"?jsxRuntime.jsx(lucideReact.Dot,{className:"h-4 w-4"}):jsxRuntime.jsx(lucideReact.Clock,{className:"h-3 w-3"})}function Gl({images:e,title:t}){let r=e.slice(0,4),n=e.length>4?e.length-4:0,a=(i,o,l)=>jsxRuntime.jsxs("a",{href:i,target:"_blank",rel:"noopener noreferrer",className:s("relative block overflow-hidden",l),onClick:c=>c.stopPropagation(),children:[jsxRuntime.jsx("img",{src:i,alt:`${t} ${o+1}`,className:"h-full w-full object-cover transition-transform duration-300 hover:scale-105"}),o===r.length-1&&n>0&&jsxRuntime.jsx("div",{className:"absolute inset-0 flex items-center justify-center bg-black/60",children:jsxRuntime.jsxs("span",{className:"text-sm font-semibold text-white",children:["+",n]})})]},o);return r.length===0?null:r.length===1?jsxRuntime.jsx("div",{className:"mt-2.5 h-36 overflow-hidden rounded-xl",children:a(r[0],0,"h-full")}):r.length===2?jsxRuntime.jsx("div",{className:"mt-2.5 grid h-28 grid-cols-2 gap-0.5 overflow-hidden rounded-xl",children:r.map((i,o)=>a(i,o))}):r.length===3?jsxRuntime.jsxs("div",{className:"mt-2.5 grid h-36 grid-cols-2 grid-rows-2 gap-0.5 overflow-hidden rounded-xl",children:[a(r[0],0,"row-span-2"),a(r[1],1),a(r[2],2)]}):jsxRuntime.jsx("div",{className:"mt-2.5 grid h-44 grid-cols-2 grid-rows-2 gap-0.5 overflow-hidden rounded-xl",children:r.map((i,o)=>a(i,o))})}function Ul({actions:e}){let t=e.filter(o=>o.variant!=="primary"),r=e.filter(o=>o.variant==="primary"),n="inline-flex items-center gap-1.5 rounded-lg px-2.5 py-1 text-xs font-medium text-secondary-500 transition-colors hover:bg-secondary-100/80 hover:text-secondary-700 dark:text-secondary-400 dark:hover:bg-primary-800/60 dark:hover:text-secondary-200",a="inline-flex items-center gap-1.5 rounded-lg border border-primary-200/70 bg-primary-50/80 px-3 py-1 text-xs font-semibold text-primary-700 transition-colors hover:bg-primary-100 dark:border-primary-600/60 dark:bg-primary-800/60 dark:text-primary-300 dark:hover:bg-primary-700/60",i=(o,l,c)=>o.href?jsxRuntime.jsxs("a",{href:o.href,target:"_blank",rel:"noopener noreferrer",className:c,onClick:m=>m.stopPropagation(),children:[o.icon,o.label]},l):jsxRuntime.jsxs("button",{type:"button",onClick:o.onClick,className:c,children:[o.icon,o.label]},l);return jsxRuntime.jsxs("div",{className:"mt-3 flex items-center gap-1 border-t border-primary-100/50 pt-2.5 dark:border-primary-700/40",children:[t.map((o,l)=>i(o,l,n)),r.length>0&&jsxRuntime.jsx("span",{className:"flex-1"}),r.map((o,l)=>i(o,l,a))]})}function ql({item:e,isActive:t,animated:r,visible:n,orientation:a}){let i=e.status??"pending",o={complete:"bg-gradient-to-br from-white to-success-50/40 dark:from-primary-900 dark:to-success-900/10",active:"bg-gradient-to-br from-white to-primary-50/60 dark:from-primary-900 dark:to-primary-800/40",error:"bg-gradient-to-br from-white to-danger-50/40 dark:from-primary-900 dark:to-danger-900/10",pending:"bg-white dark:bg-primary-900"}[i],l={complete:"border-success-200/70 dark:border-success-800/50",active:"border-primary-300/80 dark:border-primary-600/70",error:"border-danger-200/70 dark:border-danger-800/50",pending:"border-primary-200/60 dark:border-primary-700/50"}[i],c=t?"shadow-lg shadow-primary-300/30 dark:shadow-primary-500/20":i==="complete"?"shadow-md shadow-success-300/20 dark:shadow-success-400/10":i==="error"?"shadow-md shadow-danger-300/20 dark:shadow-danger-400/10":"shadow-sm shadow-primary-100/50 dark:shadow-black/20",m=i==="complete"?"conic-gradient(from 30deg, transparent 0%, var(--tl-glow-complete-1) 18%, var(--tl-glow-complete-2) 30%, var(--tl-holo-cyan) 44%, transparent 60%)":i==="error"?"conic-gradient(from 150deg, transparent 0%, var(--tl-glow-error-1) 18%, var(--tl-glow-error-2) 32%, var(--tl-glow-error-3) 44%, transparent 58%)":null,d={complete:"bg-success-100 text-success-700 dark:bg-success-900/40 dark:text-success-300",active:"bg-primary-100 text-primary-700 dark:bg-primary-800/60 dark:text-primary-300",error:"bg-danger-100 text-danger-700 dark:bg-danger-900/40 dark:text-danger-300",pending:"bg-secondary-100 text-secondary-600 dark:bg-primary-800/50 dark:text-secondary-400"}[i];return jsxRuntime.jsxs("div",{className:s("relative isolate",r&&"transition-all duration-700",r?n?"opacity-100 translate-y-0":a==="vertical"?"opacity-0 translate-y-6":"opacity-0 translate-x-6":"",a==="horizontal"?"w-56 shrink-0":"flex-1",e.className),children:[!t&&m&&jsxRuntime.jsx("div",{className:"pointer-events-none absolute animate-[tl-glow-pulse_5s_ease-in-out_infinite]",style:{inset:"-6px",borderRadius:"1.5rem",zIndex:-1,background:m,filter:"blur(14px)",opacity:.22},"aria-hidden":true}),t&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("div",{className:"pointer-events-none absolute",style:{inset:"-7px",borderRadius:"1.5rem",zIndex:-1,background:"conic-gradient(from var(--tl-angle, 0deg) at 50% 50%, var(--tl-holo-base) 0%, var(--tl-holo-indigo) 18%, var(--tl-holo-violet) 30%, var(--tl-holo-cyan) 45%, var(--tl-holo-mid) 62%, var(--tl-holo-base) 100%)",filter:"blur(10px)",animation:"tl-breathe 2.8s ease-in-out infinite, tl-holo-spin 9s linear infinite"},"aria-hidden":true}),jsxRuntime.jsx("div",{className:"pointer-events-none absolute",style:{inset:"-1.5px",borderRadius:"1.0625rem",zIndex:-1,padding:"1.5px",background:"conic-gradient(from var(--tl-angle, 0deg) at 50% 50%, transparent 0deg, var(--tl-holo-indigo) 55deg, var(--tl-holo-violet) 85deg, var(--tl-holo-cyan) 115deg, transparent 175deg, transparent 360deg)",WebkitMask:"linear-gradient(white 0 0) content-box, linear-gradient(white 0 0)",WebkitMaskComposite:"xor",maskComposite:"exclude",animation:"tl-holo-spin 5s linear infinite"},"aria-hidden":true})]}),jsxRuntime.jsx("div",{className:s("relative overflow-hidden rounded-2xl border backdrop-blur-[2px]",t?"border-transparent":s("border",l),o,c),children:e.imagePosition==="left"&&e.image?jsxRuntime.jsxs("div",{className:"flex min-h-[8rem]",children:[jsxRuntime.jsx("a",{href:e.image,target:"_blank",rel:"noopener noreferrer",className:"w-28 shrink-0 overflow-hidden",onClick:p=>p.stopPropagation(),"aria-label":e.title,children:jsxRuntime.jsx("img",{src:e.image,alt:e.title,className:"h-full w-full object-cover transition-transform duration-500 hover:scale-105"})}),jsxRuntime.jsxs("div",{className:"flex flex-1 flex-col p-4",children:[e.date&&jsxRuntime.jsx("span",{className:s("mb-2 inline-flex items-center gap-1 rounded-md px-2 py-0.5 text-[0.65rem] font-semibold tracking-wide",d),children:e.date}),jsxRuntime.jsx("h3",{className:s("text-sm font-semibold leading-snug",t?"text-primary-900 dark:text-white":"text-primary-800 dark:text-primary-100"),children:e.title}),e.description&&jsxRuntime.jsx("p",{className:"mt-1 text-xs leading-relaxed text-secondary-500 dark:text-secondary-400",children:e.description}),e.images&&e.images.length>0&&jsxRuntime.jsx(Gl,{images:e.images,title:e.title}),e.actions&&e.actions.length>0&&jsxRuntime.jsx(Ul,{actions:e.actions})]})]}):jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[e.image&&jsxRuntime.jsx("div",{className:"overflow-hidden",children:jsxRuntime.jsx("img",{src:e.image,alt:e.title,className:"h-32 w-full object-cover transition-transform duration-500 hover:scale-105"})}),e.svg&&!e.image&&jsxRuntime.jsx("div",{className:"flex items-center justify-center bg-primary-50/60 p-4 dark:bg-primary-800/40",children:e.svg}),jsxRuntime.jsxs("div",{className:s("p-4",(e.image||e.svg)&&"pt-3"),children:[e.date&&jsxRuntime.jsx("span",{className:s("mb-2.5 inline-flex items-center gap-1 rounded-md px-2 py-0.5 text-[0.65rem] font-semibold tracking-wide",d),children:e.date}),jsxRuntime.jsx("h3",{className:s("text-sm font-semibold leading-snug",t?"text-primary-900 dark:text-white":"text-primary-800 dark:text-primary-100"),children:e.title}),e.description&&jsxRuntime.jsx("p",{className:"mt-1 text-xs leading-relaxed text-secondary-500 dark:text-secondary-400",children:e.description}),e.images&&e.images.length>0&&jsxRuntime.jsx(Gl,{images:e.images,title:e.title}),e.actions&&e.actions.length>0&&jsxRuntime.jsx(Ul,{actions:e.actions})]})]})})]})}function zi({items:e,orientation:t="vertical",activeIndex:r,animated:n=true,lineStyle:a="solid",className:i}){let o=qr.useRef(null),l=qr.useRef([]),[c,m]=qr.useState(new Set);qr.useEffect(()=>{if(!n){m(new Set(e.map((p,u)=>u)));return}let f=new IntersectionObserver(p=>{m(u=>{let h=new Set(u);return p.forEach(g=>{let b=Number(g.target.dataset.idx);g.isIntersecting&&h.add(b);}),h});},{threshold:.15});return l.current.forEach(p=>p&&f.observe(p)),()=>f.disconnect()},[e,n]),qr.useEffect(()=>{if(r==null)return;let f=l.current[r];f&&f.scrollIntoView({behavior:"smooth",block:"center",inline:"center"});},[r]);let d=a==="dashed"?"border-dashed":"";return t==="vertical"?jsxRuntime.jsxs("div",{ref:o,className:s("relative",i),children:[jsxRuntime.jsx("div",{className:"absolute left-5 top-0 h-full w-px bg-primary-200 dark:bg-primary-700"}),jsxRuntime.jsx("div",{className:"space-y-6",children:e.map((f,p)=>{let u=f.status??"pending",h=p===r;return jsxRuntime.jsxs("div",{ref:g=>{l.current[p]=g;},"data-idx":p,className:"relative flex gap-4",children:[jsxRuntime.jsx("div",{className:"relative z-10 flex shrink-0 flex-col items-center",children:jsxRuntime.jsx("div",{className:s("flex h-10 w-10 items-center justify-center rounded-full border-2 transition-all duration-300 [&_svg]:shrink-0",Xl[u],h&&Wl[u]),children:jsxRuntime.jsx(jl,{status:u,icon:f.icon})})}),jsxRuntime.jsx(ql,{item:f,isActive:h,animated:n,visible:c.has(p),orientation:"vertical"})]},f.id??p)})})]}):jsxRuntime.jsx("div",{ref:o,className:s("relative overflow-x-auto pb-4",i),children:jsxRuntime.jsx("div",{className:"flex min-w-max gap-6 px-4",children:e.map((f,p)=>{let u=f.status??"pending",h=p===r,g=p===e.length-1;return jsxRuntime.jsxs("div",{ref:b=>{l.current[p]=b;},"data-idx":p,className:"relative flex flex-col items-center gap-3",children:[jsxRuntime.jsxs("div",{className:"flex items-center",children:[jsxRuntime.jsx("div",{className:s("flex h-10 w-10 items-center justify-center rounded-full border-2 transition-all duration-300 z-10 [&_svg]:shrink-0",Xl[u],h&&Wl[u]),children:jsxRuntime.jsx(jl,{status:u,icon:f.icon})}),!g&&jsxRuntime.jsx("div",{className:s("h-px w-28 border-t-2",d,u==="complete"?"border-success-400":"border-primary-200 dark:border-primary-700")})]}),jsxRuntime.jsx(ql,{item:f,isActive:h,animated:n,visible:c.has(p),orientation:"horizontal"})]},f.id??p)})})})}function xn(e="en-US",t="long"){return Array.from({length:12},(r,n)=>new Intl.DateTimeFormat(e,{month:t}).format(new Date(2e3,n,1)))}function Ql(e="en-US",t="narrow"){let r=new Date(2e3,0,2);return Array.from({length:7},(n,a)=>{let i=new Date(r);return i.setDate(r.getDate()+a),new Intl.DateTimeFormat(e,{weekday:t}).format(i)})}function Zl(e,t=true,r=true){return e==="date"?"YYYY-MM-DD":e==="time"?t?r?"HH:mm:ss":"HH:mm":r?"hh:mm:ss A":"hh:mm A":t?r?"YYYY-MM-DD HH:mm:ss":"YYYY-MM-DD HH:mm":r?"YYYY-MM-DD hh:mm:ss A":"YYYY-MM-DD hh:mm A"}function Zf(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Jl(e,t,r="en-US"){let n=e.getHours(),a=xn(r,"long"),i=xn(r,"short"),o={YYYY:String(e.getFullYear()),YY:String(e.getFullYear()).slice(-2),MMMM:a[e.getMonth()],MMM:i[e.getMonth()],MM:String(e.getMonth()+1).padStart(2,"0"),M:String(e.getMonth()+1),DD:String(e.getDate()).padStart(2,"0"),D:String(e.getDate()),HH:String(n).padStart(2,"0"),H:String(n),hh:String(n%12||12).padStart(2,"0"),h:String(n%12||12),mm:String(e.getMinutes()).padStart(2,"0"),ss:String(e.getSeconds()).padStart(2,"0"),A:n<12?"AM":"PM",a:n<12?"am":"pm"},l=Object.keys(o).sort((m,d)=>d.length-m.length),c=new RegExp(l.map(Zf).join("|"),"g");return t.replace(c,m=>o[m]??m)}function Ar(e,t){return new Date(e,t+1,0).getDate()}function ec(e,t){let r=new Date(e,t,1).getDay(),n=Ar(e,t),a=Ar(e,t-1),i=[];for(let l=r-1;l>=0;l--)i.push({date:new Date(e,t-1,a-l),thisMonth:false});for(let l=1;l<=n;l++)i.push({date:new Date(e,t,l),thisMonth:true});let o=42-i.length;for(let l=1;l<=o;l++)i.push({date:new Date(e,t+1,l),thisMonth:false});return i}function Hr(e){return new Date(e.getFullYear(),e.getMonth(),e.getDate())}function Bi(e,t){return Hr(e).getTime()===Hr(t).getTime()}function tc(e,t){return Hr(e)<Hr(t)}function rc(e,t){return Hr(e)>Hr(t)}function Ia(e,t,r){return t&&e<t?new Date(t):r&&e>r?new Date(r):e}function nc(e,t,r,n){let a=new Date(e),o=t*(n==="future"?1:-1);switch(r){case "day":a.setDate(a.getDate()+o);break;case "week":a.setDate(a.getDate()+o*7);break;case "month":a.setMonth(a.getMonth()+o);break;case "year":a.setFullYear(a.getFullYear()+o);break}return a}function ac(e,t=200){let r=e-Math.floor(t/2);return Array.from({length:t},(n,a)=>r+a)}function oc(e){let{value:t,defaultValue:r,onChange:n,mode:a="datetime",minDate:i,maxDate:o,use24Hour:l=true,showSeconds:c=true,locale:m="en-US",format:d,onOpen:f,onClose:p}=e,u=t!==void 0,[h,g]=qr.useState(r??null),b=u?t??null:h,[N,x]=qr.useState(false),[T,w]=qr.useState(()=>b??new Date),[C,S]=qr.useState("drum"),[R,V]=qr.useState(()=>(b??new Date).getFullYear()),[I,E]=qr.useState(()=>(b??new Date).getMonth()),[v,U]=qr.useState(1),[k,q]=qr.useState("day"),[M,W]=qr.useState("future"),$=d??Zl(a,l,c),ue=b?Jl(b,$,m):"",J=qr.useCallback(()=>{let y=b??new Date;w(new Date(y)),V(y.getFullYear()),E(y.getMonth()),S("drum"),x(true),f?.();},[b,f]),de=qr.useCallback(()=>{x(false),p?.();},[p]),re=qr.useCallback(()=>{let y=Ia(T,i,o);u||g(y),n?.(y),de();},[T,i,o,u,n,de]),B=qr.useCallback(()=>{u||g(null),n?.(null),de();},[u,n,de]),j=qr.useCallback((y,L)=>{w(G=>{let O=new Date(G);switch(y){case "year":O.setFullYear(L);break;case "month":{O.setMonth(L);let _=Ar(O.getFullYear(),L);O.getDate()>_&&O.setDate(_);break}case "day":O.setDate(L);break;case "hour":O.setHours(L);break;case "minute":O.setMinutes(L);break;case "second":O.setSeconds(L);break}return Ia(O,i,o)});},[i,o]),pe=qr.useCallback(()=>{let y=Ia(nc(new Date,v,k,M),i,o);w(y),V(y.getFullYear()),E(y.getMonth());},[v,k,M,i,o]),ye=qr.useCallback(y=>{let L=I+y,G=R;L<0&&(L=11,G--),L>11&&(L=0,G++),E(L),V(G);},[I,R]);return {isOpen:N,displayValue:ue,workingDate:T,view:C,calYear:R,calMonth:I,offsetAmount:v,offsetUnit:k,offsetDirection:M,mode:a,use24Hour:l,showSeconds:c,locale:m,minDate:i,maxDate:o,openPicker:J,closePicker:de,confirm:re,clear:B,updateField:j,setView:S,setCalYear:V,setCalMonth:E,setOffsetAmount:U,setOffsetUnit:q,setOffsetDirection:W,applyQuickOffset:pe,navigateCalendar:ye}}var wn=40;function lc(e,t,r=true){let n=qr.useRef(t);n.current=t,qr.useEffect(()=>{if(!r)return;function a(i){let o=i.target;e.some(c=>c.current?.contains(o))||n.current();}return document.addEventListener("mousedown",a),()=>document.removeEventListener("mousedown",a)},[e,r]);}function cc(e,t,r){let n=qr.useRef(false),a=qr.useRef(void 0),i=qr.useRef(r);i.current=r;let o=qr.useRef(t);o.current=t;let l=qr.useCallback((m,d="smooth")=>{let f=e.current;if(!f)return;let p=m*wn;Math.abs(f.scrollTop-p)<2&&d!=="instant"||(d==="instant"?f.scrollTop=p:f.scrollTo({top:p,behavior:d}));},[e]),c=qr.useCallback(()=>{e.current&&(n.current=true,clearTimeout(a.current),a.current=setTimeout(()=>{n.current=false;let d=e.current;if(!d)return;let f=Math.round(d.scrollTop/wn),p=Math.max(0,Math.min(o.current-1,f)),u=p*wn;Math.abs(d.scrollTop-u)>1&&d.scrollTo({top:u,behavior:"smooth"}),i.current(p);},120));},[e]);return {scrollToIndex:l,handleScroll:c,isScrollingRef:n}}function dc(e,t,r){qr.useEffect(()=>{if(!r)return;function n(){let i=e.current,o=t.current;if(!i||!o)return;if(window.innerWidth<=640){o.style.top="",o.style.left="";return}let l=i.getBoundingClientRect(),c=window.innerHeight,m=window.innerWidth,d=o.offsetHeight||460,f=o.offsetWidth||340,p=l.bottom+8,u=l.left;p+d>c-16&&(p=Math.max(16,l.top-d-8)),u+f>m-16&&(u=Math.max(16,m-f-16)),u<16&&(u=16),o.style.top=`${Math.round(p)}px`,o.style.left=`${Math.round(u)}px`;}let a=setTimeout(n,0);return window.addEventListener("resize",n),window.addEventListener("scroll",n,true),()=>{clearTimeout(a),window.removeEventListener("resize",n),window.removeEventListener("scroll",n,true);}},[r,e,t]);}function Yt({items:e,selectedValue:t,onSelect:r,label:n}){let a=qr.useRef(null),i=qr.useRef(t),o=qr.useRef(false),{scrollToIndex:l,handleScroll:c}=cc(a,e.length,m=>{let d=e[m];d&&(o.current=true,r(d.value),setTimeout(()=>{o.current=false;},200));});return qr.useEffect(()=>{let m=a.current;if(!m)return;let d=e.findIndex(f=>f.value===t);d>=0&&(m.scrollTop=d*wn);},[]),qr.useEffect(()=>{if(i.current!==t&&(i.current=t,!o.current)){let m=e.findIndex(d=>d.value===t);m>=0&&l(m,"smooth");}},[t,e,l]),jsxRuntime.jsxs("div",{className:"dtp-column",role:"group","aria-label":n,children:[jsxRuntime.jsx("div",{className:"dtp-column-highlight","aria-hidden":"true"}),jsxRuntime.jsx("div",{ref:a,className:"dtp-column-list",onScroll:c,role:"listbox","aria-label":n,children:e.map(m=>jsxRuntime.jsx("div",{className:s("dtp-item",m.value===t&&"dtp-item--selected"),onClick:()=>{let d=e.findIndex(f=>f.value===m.value);d>=0&&l(d,"smooth"),r(m.value);},role:"option","aria-selected":m.value===t,children:m.label},m.value))}),jsxRuntime.jsx("div",{className:"dtp-fade-top","aria-hidden":"true"}),jsxRuntime.jsx("div",{className:"dtp-fade-bottom","aria-hidden":"true"})]})}function ag({year:e,month:t,selectedDate:r,today:n,minDate:a,maxDate:i,locale:o,onSelectDay:l,onPrev:c,onNext:m}){let d=Ql(o,"narrow"),f=xn(o,"long"),p=ec(e,t);return jsxRuntime.jsxs("div",{className:"dtp-calendar",children:[jsxRuntime.jsxs("div",{className:"dtp-cal-nav",children:[jsxRuntime.jsx("button",{type:"button",className:"dtp-cal-nav-btn",onClick:c,"aria-label":"Previous month",children:jsxRuntime.jsx(lucideReact.ChevronLeft,{className:"h-4 w-4"})}),jsxRuntime.jsxs("span",{className:"dtp-cal-title",children:[f[t]," ",e]}),jsxRuntime.jsx("button",{type:"button",className:"dtp-cal-nav-btn",onClick:m,"aria-label":"Next month",children:jsxRuntime.jsx(lucideReact.ChevronRight,{className:"h-4 w-4"})})]}),jsxRuntime.jsx("div",{className:"dtp-cal-weekdays",role:"row",children:d.map((u,h)=>jsxRuntime.jsx("div",{className:"dtp-cal-weekday",role:"columnheader","aria-label":u,children:u},h))}),jsxRuntime.jsx("div",{className:"dtp-cal-days",role:"grid",children:p.map(({date:u,thisMonth:h},g)=>{let b=Bi(u,r),N=Bi(u,n),x=a!=null&&tc(u,a)||i!=null&&rc(u,i);return jsxRuntime.jsx("button",{type:"button",role:"gridcell",className:s("dtp-cal-day",!h&&"dtp-cal-day--other",b&&"dtp-cal-day--selected",N&&!b&&"dtp-cal-day--today",x&&"dtp-cal-day--disabled"),onClick:()=>!x&&l(u),disabled:x,"aria-current":N?"date":void 0,"aria-selected":b,"aria-disabled":x,children:u.getDate()},g)})})]})}function og({amount:e,unit:t,direction:r,onAmountChange:n,onUnitChange:a,onDirectionChange:i,onApply:o,locale:l}){let c=l.startsWith("zh"),m=[{value:"day",label:c?"\u5929":"Day"},{value:"week",label:c?"\u5468":"Week"},{value:"month",label:c?"\u6708":"Month"},{value:"year",label:c?"\u5E74":"Year"}],d=[{value:"future",label:c?"\u4EE5\u540E":"from now"},{value:"past",label:c?"\u4EE5\u524D":"before now"}];return jsxRuntime.jsxs("div",{className:"dtp-quick-offset","aria-label":c?"\u5FEB\u901F\u504F\u79FB":"Quick offset",children:[jsxRuntime.jsx("input",{type:"number",className:"dtp-offset-input",value:e,min:1,max:9999,"aria-label":c?"\u504F\u79FB\u6570\u91CF":"Offset amount",onChange:f=>{let p=parseInt(f.target.value,10);!isNaN(p)&&p>=1&&n(p);}}),jsxRuntime.jsx("select",{className:"dtp-offset-select",value:t,"aria-label":c?"\u504F\u79FB\u5355\u4F4D":"Offset unit",onChange:f=>a(f.target.value),children:m.map(f=>jsxRuntime.jsx("option",{value:f.value,children:f.label},f.value))}),jsxRuntime.jsx("select",{className:"dtp-offset-select",value:r,"aria-label":c?"\u504F\u79FB\u65B9\u5411":"Offset direction",onChange:f=>i(f.target.value),children:d.map(f=>jsxRuntime.jsx("option",{value:f.value,children:f.label},f.value))}),jsxRuntime.jsx("button",{type:"button",className:"dtp-offset-apply",onClick:o,children:c?"\u5E94\u7528":"Apply"})]})}function Aa({className:e,popupClassName:t,triggerClassName:r,disabled:n=false,placeholder:a,...i}){let{isOpen:o,displayValue:l,workingDate:c,view:m,calYear:d,calMonth:f,offsetAmount:p,offsetUnit:u,offsetDirection:h,mode:g,use24Hour:b,showSeconds:N,locale:x,minDate:T,maxDate:w,openPicker:C,closePicker:S,confirm:R,clear:V,updateField:I,setView:E,setCalYear:v,setCalMonth:U,setOffsetAmount:k,setOffsetUnit:q,setOffsetDirection:M,applyQuickOffset:W,navigateCalendar:$}=oc({...i}),ue=qr.useRef(null),J=qr.useRef(null),de=new Date;lc([ue,J],S,o),dc(ue,J,o);let re=x.startsWith("zh"),B={cancel:re?"\u53D6\u6D88":"Cancel",confirm:re?"\u786E\u5B9A":"Confirm",calendarView:re?"\u65E5\u5386":"Calendar",scrollView:re?"\u6EDA\u8F6E":"Scroll",placeholder:a??(re?"\u9009\u62E9\u65E5\u671F\u65F6\u95F4":"Select date / time")},j=g==="date"||g==="datetime",pe=g==="time"||g==="datetime",ye=ac(c.getFullYear(),200).map(X=>({label:String(X),value:X})),y=xn(x,"short").map((X,fe)=>({label:X,value:fe})),L=Ar(c.getFullYear(),c.getMonth()),G=Array.from({length:L},(X,fe)=>({label:String(fe+1).padStart(2,"0"),value:fe+1})),O=Array.from({length:24},(X,fe)=>({label:String(fe).padStart(2,"0"),value:fe})),_=Array.from({length:12},(X,fe)=>({label:String(fe===0?12:fe).padStart(2,"0"),value:fe})),ee=[{label:"AM",value:0},{label:"PM",value:1}],xe=Array.from({length:60},(X,fe)=>({label:String(fe).padStart(2,"0"),value:fe})),P=c.getHours(),F=P%12,K=P<12?0:1,oe=pe&&!j?lucideReact.Clock:lucideReact.Calendar;return jsxRuntime.jsxs("div",{className:s("dtp-root",e),children:[jsxRuntime.jsxs("div",{className:"dtp-trigger-wrap",children:[jsxRuntime.jsxs("button",{ref:ue,type:"button",className:s("dtp-trigger",l&&"dtp-trigger--has-clear",n&&"dtp-trigger--disabled",r),onClick:()=>!n&&(o?S():C()),disabled:n,"aria-haspopup":"dialog","aria-expanded":o,children:[jsxRuntime.jsx(oe,{className:"dtp-trigger-icon","aria-hidden":"true"}),jsxRuntime.jsx("span",{className:s("dtp-trigger-text",!l&&"dtp-trigger-placeholder"),children:l||B.placeholder})]}),l&&jsxRuntime.jsx("button",{type:"button",className:"dtp-trigger-clear","aria-label":re?"\u6E05\u9664":"Clear value",onClick:()=>!n&&V(),children:jsxRuntime.jsx(lucideReact.X,{className:"h-3.5 w-3.5"})})]}),o&&reactDom.createPortal(jsxRuntime.jsxs("div",{ref:J,className:s("dtp-panel",t),role:"dialog","aria-modal":"true","aria-label":re?"\u65E5\u671F\u65F6\u95F4\u9009\u62E9\u5668":"Date time picker",children:[jsxRuntime.jsxs("div",{className:"dtp-panel-header",children:[jsxRuntime.jsx("span",{className:"dtp-panel-preview",children:l||B.placeholder}),jsxRuntime.jsx("div",{className:"dtp-panel-actions",children:j&&jsxRuntime.jsx("button",{type:"button",className:s("dtp-view-btn",m==="calendar"&&"dtp-view-btn--active"),"aria-pressed":m==="calendar",title:m==="calendar"?B.scrollView:B.calendarView,onClick:()=>{m!=="calendar"&&(v(c.getFullYear()),U(c.getMonth())),E(m==="calendar"?"drum":"calendar");},children:jsxRuntime.jsx(lucideReact.Calendar,{className:"h-4 w-4"})})})]}),jsxRuntime.jsx("div",{className:"dtp-panel-body",children:m==="drum"?jsxRuntime.jsxs("div",{className:"dtp-drum",children:[j&&jsxRuntime.jsxs("div",{className:"dtp-drum-date",children:[jsxRuntime.jsx(Yt,{label:re?"\u5E74":"Year",items:ye,selectedValue:c.getFullYear(),onSelect:X=>I("year",X)}),jsxRuntime.jsx(Yt,{label:re?"\u6708":"Month",items:y,selectedValue:c.getMonth(),onSelect:X=>I("month",X)}),jsxRuntime.jsx(Yt,{label:re?"\u65E5":"Day",items:G,selectedValue:c.getDate(),onSelect:X=>I("day",X)})]}),j&&pe&&jsxRuntime.jsx("div",{className:"dtp-drum-sep","aria-hidden":"true"}),pe&&jsxRuntime.jsxs("div",{className:"dtp-drum-time",children:[b?jsxRuntime.jsx(Yt,{label:re?"\u65F6":"Hour",items:O,selectedValue:P,onSelect:X=>I("hour",X)}):jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(Yt,{label:re?"\u65F6":"Hour",items:_,selectedValue:F,onSelect:X=>{I("hour",K===1?X+12:X);}}),jsxRuntime.jsx(Yt,{label:"AM/PM",items:ee,selectedValue:K,onSelect:X=>{I("hour",F+(X===1?12:0));}})]}),jsxRuntime.jsx(Yt,{label:re?"\u5206":"Min",items:xe,selectedValue:c.getMinutes(),onSelect:X=>I("minute",X)}),N&&jsxRuntime.jsx(Yt,{label:re?"\u79D2":"Sec",items:xe,selectedValue:c.getSeconds(),onSelect:X=>I("second",X)})]})]}):jsxRuntime.jsx(ag,{year:d,month:f,selectedDate:c,today:de,minDate:T,maxDate:w,locale:x,onSelectDay:X=>{I("year",X.getFullYear()),I("month",X.getMonth()),I("day",X.getDate()),E("drum");},onPrev:()=>$(-1),onNext:()=>$(1)})}),j&&jsxRuntime.jsx("div",{className:"dtp-panel-offset",children:jsxRuntime.jsx(og,{amount:p,unit:u,direction:h,onAmountChange:k,onUnitChange:q,onDirectionChange:M,onApply:W,locale:x})}),jsxRuntime.jsxs("div",{className:"dtp-panel-footer",children:[jsxRuntime.jsx("button",{type:"button",className:"dtp-btn-cancel",onClick:S,children:B.cancel}),jsxRuntime.jsx("button",{type:"button",className:"dtp-btn-confirm",onClick:R,children:B.confirm})]})]}),document.body)]})}var sg={FilmReel:ki,MiniPlayer:Ci,CinePlayer:Mi,FileExplorer:Ei,Masonry:Hi,TypewriterText:La,CommandPalette:Va,Timeline:zi,DateTimePicker:Aa},Oi=sg;var uc=classVarianceAuthority.cva("w-full",{variants:{intent:{default:"",card:"rounded-(--form-radius) border border-primary-200 bg-white p-6 shadow-sm dark:border-primary-700 dark:bg-primary-900",inset:"rounded-(--form-radius) bg-primary-50 p-6 dark:bg-primary-800/50"},size:{sm:"",md:"",lg:""}},defaultVariants:{intent:"default",size:"md"}});classVarianceAuthority.cva("flex w-full",{variants:{layout:{stacked:"flex-col gap-1.5",inline:"flex-row items-start gap-(--form-item-gap-md)"},size:{sm:"",md:"",lg:""}},defaultVariants:{layout:"stacked",size:"md"}});var fc=classVarianceAuthority.cva("mt-1 flex items-center gap-1 text-xs [&_svg]:h-3.5 [&_svg]:w-3.5 [&_svg]:shrink-0",{variants:{status:{error:"text-danger-600 dark:text-danger-400",warning:"text-warning-600 dark:text-warning-400",success:"text-success-600 dark:text-success-400",hint:"text-primary-400 dark:text-primary-500"}},defaultVariants:{status:"hint"}});var Ki=qr.createContext({layout:"stacked",size:"md",labelWidth:"var(--form-label-w-md, 7rem)",bulkErrors:{}}),fg={sm:"var(--form-label-w-sm, 5rem)",md:"var(--form-label-w-md, 7rem)",lg:"var(--form-label-w-lg, 9rem)"},yc={sm:"gap-(--form-row-gap-sm)",md:"gap-(--form-row-gap-md)",lg:"gap-(--form-row-gap-lg)"};function Xi({children:e,className:t,intent:r,size:n="md",layout:a="stacked",title:i,description:o,footer:l,onValues:c,onSubmit:m,...d}){let f=fg[n??"md"],[p,u]=qr.useState({}),h=qr.useCallback(g=>{if(g.preventDefault(),m?.(g),c){let b=Object.fromEntries(new FormData(g.currentTarget).entries()),N=c(b,g),x=T=>{if(!T)return;let w={};for(let[C,{result:S,reason:R}]of Object.entries(T))R&&(w[C]={status:S?"success":"error",message:R});u(w);};N instanceof Promise?N.then(x).catch(()=>{}):x(N);}},[m,c]);return jsxRuntime.jsx(Ki.Provider,{value:{layout:a??"stacked",size:n??"md",labelWidth:f,bulkErrors:p},children:jsxRuntime.jsxs("form",{className:s(uc({intent:r,size:n}),"flex flex-col",t),onSubmit:h,...d,children:[(i||o)&&jsxRuntime.jsxs("div",{className:"mb-(--form-header-mb)",children:[i&&jsxRuntime.jsx("h2",{className:"text-base font-semibold text-primary-900 dark:text-primary-100",children:i}),o&&jsxRuntime.jsx("p",{className:"mt-1 text-xs text-primary-500 dark:text-primary-400",children:o})]}),jsxRuntime.jsx("div",{className:s("flex flex-col",yc[n??"md"]),children:e}),l&&jsxRuntime.jsx("div",{className:"mt-(--form-footer-pt) flex flex-wrap items-center justify-end gap-(--form-footer-gap) border-t border-primary-200 pt-(--form-footer-pt) dark:border-primary-700",children:l})]})})}var gg={error:jsxRuntime.jsx(lucideReact.AlertCircle,{}),warning:jsxRuntime.jsx(lucideReact.AlertTriangle,{}),success:jsxRuntime.jsx(lucideReact.CheckCircle,{}),hint:jsxRuntime.jsx(lucideReact.Info,{})};function bg({label:e,layout:t,required:r,hint:n,validation:a,name:i,onValidate:o,className:l,children:c}){let m=qr.useContext(Ki),d=qr.useId(),[f,p]=qr.useState(void 0),u=i?m.bulkErrors[i]:void 0,h=a??f??u,b=(t??m.layout)==="inline",N=qr.useCallback(S=>{let R=S!=null&&typeof S=="object"&&"target"in S?S.target.value:S;if(i&&m.bulkErrors[i]&&(m.bulkErrors[i]=void 0),!o){p(void 0);return}let{result:V,reason:I}=o(R);p(I?{status:V?"success":"error",message:I}:void 0);},[o,i,m.bulkErrors]),x=h?`${d}-validation`:n?`${d}-hint`:void 0,T=qr__default.default.Children.map(c,(S,R)=>{if(R!==0||!qr__default.default.isValidElement(S))return S;let V=S,I={};if(V.props.id||(I.id=d),x&&!V.props["aria-describedby"]&&(I["aria-describedby"]=x),h?.status==="error"&&!V.props["aria-invalid"]&&(I["aria-invalid"]=true),i&&!V.props.name&&(I.name=i),o){let E=V.props.onChange;I.onChange=v=>{E?.(v),N(v);};}return Object.keys(I).length?qr__default.default.cloneElement(V,I):S}),w=e!=null&&jsxRuntime.jsx("label",{htmlFor:d,className:s("shrink-0 text-sm font-medium","text-primary-700 dark:text-primary-300",r&&"after:ml-0.5 after:text-danger-500 after:content-['*']",b&&"pt-1.75"),style:b?{width:m.labelWidth,minWidth:m.labelWidth}:void 0,children:e}),C=a?`${d}-validation`:n?`${d}-hint`:void 0;return jsxRuntime.jsxs("div",{className:s("flex w-full flex-col gap-1.5",b&&"md:flex-row md:items-start md:gap-(--form-item-gap-md)",l),children:[w,jsxRuntime.jsxs("div",{className:"flex min-w-0 flex-1 flex-col",children:[T,h&&jsxRuntime.jsxs("p",{id:`${d}-validation`,className:s(fc({status:h.status})),role:h.status==="error"?"alert":void 0,children:[gg[h.status],jsxRuntime.jsx("span",{children:h.message})]}),n&&jsxRuntime.jsx("p",{id:C===`${d}-hint`?C:void 0,className:"mt-1 text-xs text-primary-400 dark:text-primary-500",children:n})]})]})}function hg({title:e,description:t,className:r,children:n}){let{size:a}=qr.useContext(Ki);return jsxRuntime.jsxs("fieldset",{className:s("flex flex-col rounded-(--form-radius) border border-primary-200 p-4 dark:border-primary-700",yc[a],r),children:[(e||t)&&jsxRuntime.jsxs("legend",{className:"px-1.5 pb-1",children:[e&&jsxRuntime.jsx("span",{className:"text-sm font-semibold text-primary-700 dark:text-primary-300",children:e}),t&&jsxRuntime.jsx("span",{className:"ml-2 text-xs text-primary-400 dark:text-primary-500",children:t})]}),n]})}var yg={Form:Xi},Wi=yg;var Nt=classVarianceAuthority.cva("relative w-full font-sans select-none",{variants:{size:{sm:"text-xs",md:"text-sm",lg:"text-base"}},defaultVariants:{size:"md"}}),Ct=classVarianceAuthority.cva("flex flex-wrap gap-3 items-center justify-center",{variants:{position:{top:"mb-3",bottom:"mt-3",left:"flex-col mr-4",right:"flex-col ml-4"}},defaultVariants:{position:"bottom"}}),Tt=classVarianceAuthority.cva("absolute z-50 pointer-events-none px-3 py-2 rounded-lg text-xs shadow-lg border transition-opacity duration-150 bg-primary-900 text-primary-50 border-primary-700 dark:bg-primary-950 dark:border-primary-800");function Kt(e){let[t,r]=qr.useState(()=>new Set(e)),n=qr.useCallback(o=>{r(l=>{let c=new Set(l);return c.has(o)?c.delete(o):c.add(o),c});},[]),a=qr.useCallback(o=>t.has(o),[t]),i=qr.useCallback(()=>{r(new Set(e));},[e]);return {visible:t,toggle:n,isVisible:a,showAll:i}}function Xt(e){let t=["var(--color-chart-1)","var(--color-chart-2)","var(--color-chart-3)","var(--color-chart-4)","var(--color-chart-5)","var(--color-chart-6)","var(--color-chart-7)","var(--color-chart-8)"];return Array.from({length:e},(r,n)=>t[n%t.length])}function Wt(e,t,r=.1){if(e===t)return [e-1,t+1];let a=(t-e)*r;return [Math.floor(e-a),Math.ceil(t+a)]}function Fr(e,t,r){if(r<=1)return [e];let n=(t-e)/(r-1);return Array.from({length:r},(a,i)=>+(e+i*n).toFixed(10))}function Ie(e,t){return t?t(e):typeof e=="number"?Math.abs(e)>=1e6?`${(e/1e6).toFixed(1)}M`:Math.abs(e)>=1e3?`${(e/1e3).toFixed(1)}K`:Number.isInteger(e)?e.toString():e.toFixed(2):String(e)}function ct(e,t,r,n){let a=(n-90)*Math.PI/180;return {x:e+r*Math.cos(a),y:t+r*Math.sin(a)}}function jt(e,t,r){return {top:20,right:r?65:20,bottom:e?52:36,left:t?65:52}}function Gt(e,t,r){let n=Math.max(e,120);return {width:n,height:t,margins:r,plotLeft:r.left,plotTop:r.top,plotRight:n-r.right,plotBottom:t-r.bottom,plotWidth:Math.max(n-r.left-r.right,10),plotHeight:Math.max(t-r.top-r.bottom,10)}}function xc(e,t){let r=new Set,n=[];for(let a of e)if(t.has(a.id))for(let i of a.data){let o=String(i.x);r.has(o)||(r.add(o),n.push(o));}return n}function Ui(e,t,r){let n=1/0,a=-1/0;for(let l of e)if(t.has(l.id))for(let c of l.data)c.y<n&&(n=c.y),c.y>a&&(a=c.y);if(!isFinite(n))return [0,1];let[i,o]=Wt(n,a);return [r?.min??i,r?.max??o]}function Ha(e,t){let[r,n]=e,[a,i]=t;return n===r?()=>(a+i)/2:o=>a+(o-r)/(n-r)*(i-a)}function Fa(e,t){let r=e.length;if(r===0)return ()=>(t[0]+t[1])/2;let n=(t[1]-t[0])/r;return a=>{let i=e.indexOf(a);return i<0?(t[0]+t[1])/2:t[0]+i*n+n/2}}function vc(e,t,r){return e.map(n=>`${t(n.x).toFixed(2)},${r(n.y).toFixed(2)}`).join(" ")}function qi(e,t,r){if(e.length===0)return "";let n=e.map(o=>({x:t(o.x),y:r(o.y)}));if(n.length===1)return `M ${n[0].x.toFixed(2)} ${n[0].y.toFixed(2)}`;let a=.5,i=`M ${n[0].x.toFixed(2)} ${n[0].y.toFixed(2)}`;for(let o=0;o<n.length-1;o++){let l=o===0?{x:2*n[0].x-n[1].x,y:2*n[0].y-n[1].y}:n[o-1],c=n[o],m=n[o+1],d=o+2<n.length?n[o+2]:{x:2*n[n.length-1].x-n[n.length-2].x,y:2*n[n.length-1].y-n[n.length-2].y},f=c.x+(m.x-l.x)*a/3,p=c.y+(m.y-l.y)*a/3,u=m.x-(d.x-c.x)*a/3,h=m.y-(d.y-c.y)*a/3;i+=` C ${f.toFixed(2)} ${p.toFixed(2)}, ${u.toFixed(2)} ${h.toFixed(2)}, ${m.x.toFixed(2)} ${m.y.toFixed(2)}`;}return i}function wc(e,t,r,n,a){if(e.length===0)return "";let i=n?qi(e,t,r):`M ${e.map(c=>`${t(c.x).toFixed(2)},${r(c.y).toFixed(2)}`).join(" L ")}`,o=t(e[e.length-1].x).toFixed(2),l=t(e[0].x).toFixed(2);return `${i} L ${o},${a.toFixed(2)} L ${l},${a.toFixed(2)} Z`}function _a(e,t=5){return Fr(e[0],e[1],t)}function Qi(e,t,r){if(t.length===0)return -1;let n=1/0,a=0;for(let i=0;i<t.length;i++){let o=Math.abs(r(t[i])-e);o<n&&(n=o,a=i);}return a}function Zi(e,t){return e.data.find(r=>String(r.x)===t)?.y}function kc(e){for(let t of e)for(let r of t.data)if(typeof r.x=="string")return true;return false}function za({items:e,position:t,onToggle:r}){return jsxRuntime.jsx("div",{className:Ct({position:t}),children:e.map(n=>jsxRuntime.jsxs("button",{onClick:()=>r(n.id),className:s("flex items-center gap-1.5 cursor-pointer rounded px-1.5 py-1 text-xs text-primary-700 transition-opacity hover:bg-primary-100 dark:text-primary-300 dark:hover:bg-primary-800",!n.visible&&"opacity-40"),"aria-pressed":n.visible,children:[jsxRuntime.jsx("span",{className:"h-2.5 w-5 rounded-sm shrink-0",style:{background:n.color}}),n.label]},n.id))})}function ts({series:e,xAxis:t,yAxis:r,y2Axis:n,y2Series:a=[],smooth:i=false,showDots:o=true,area:l=false,strokeWidth:c=2,title:m,height:d=300,className:f,legend:p=true,legendPosition:u="bottom",animateOnMount:h=true,emptyText:g="No data to display"}){let b=qr.useRef(null),N=qr.useRef(null),[x,T]=qr.useState(600),[w,C]=qr.useState(null),[S,R]=qr.useState(null);qr.useEffect(()=>{let P=N.current;if(!P)return;let F=P.getBoundingClientRect().width;F>0&&T(F);let K=new ResizeObserver(oe=>{let X=oe[0]?.contentRect.width;X&&X>0&&T(X);});return K.observe(P),()=>K.disconnect()},[]);let V=qr.useMemo(()=>e.map(P=>P.id),[e]),{visible:I,toggle:E,isVisible:v}=Kt(V),U=qr.useMemo(()=>Xt(e.length),[e.length]),k=qr.useMemo(()=>new Map(e.map((P,F)=>[P.id,P.color??U[F]])),[e,U]),q=qr.useMemo(()=>jt(!!t?.label,!!r?.label,!!n),[t?.label,r?.label,n]),M=qr.useMemo(()=>Gt(x,d,q),[x,d,q]),W=qr.useMemo(()=>kc(e),[e]),$=qr.useMemo(()=>W?xc(e,I):[],[e,I,W]),ue=qr.useMemo(()=>{if(W){let X=Fa($,[M.plotLeft,M.plotRight]);return fe=>X(fe)}let P=e.flatMap(X=>X.data.map(fe=>fe.x));if(P.length===0)return ()=>M.plotLeft;let F=Math.min(...P),K=Math.max(...P),oe=Ha([F,K],[M.plotLeft,M.plotRight]);return X=>oe(X)},[e,W,$,M]),J=qr.useMemo(()=>Ui(e,I,r),[e,I,r]),de=qr.useMemo(()=>Ha(J,[M.plotBottom,M.plotTop]),[J,M]),re=qr.useMemo(()=>_a(J,r?.tickCount??5),[J,r?.tickCount]),B=qr.useMemo(()=>{if(!n)return null;let P=e.filter(F=>a.includes(F.id));return Ui(P,I,n)},[n,e,a,I]),j=qr.useMemo(()=>B?Ha(B,[M.plotBottom,M.plotTop]):null,[B,M]),pe=qr.useMemo(()=>B?_a(B,n?.tickCount??5):[],[B,n?.tickCount]),ye=qr.useMemo(()=>{if(W)return $;let P=e.flatMap(oe=>oe.data.map(X=>Number(X.x)));if(P.length===0)return [];let F=Math.min(...P),K=Math.max(...P);return _a([F,K],t?.tickCount??6)},[W,$,e,t?.tickCount]),y=qr.useCallback(P=>{let F=P.currentTarget.closest("svg");if(!F)return;let K=F.getBoundingClientRect(),oe=P.clientX-K.left,X=b.current?.getBoundingClientRect();if(!X)return;let fe="",we=oe;if(W&&$.length>0){let Q=Fa($,[M.plotLeft,M.plotRight]),ke=Qi(oe,$,Q);fe=$[ke]??"",we=Q(fe);}else if(!W){let Q=ye;fe=Ie((oe-M.plotLeft)/M.plotWidth*(Q[Q.length-1]-Q[0])+Q[0],t?.format),we=oe;}let H=e.filter(Q=>v(Q.id)).map(Q=>{a.includes(Q.id)&&j!=null?j:de;let Fe;if(W)Fe=Zi(Q,fe);else {let Z=oe,Ne=1/0,A;for(let ae of Q.data){let se=ue(ae.x),z=Math.abs(se-Z);z<Ne&&(Ne=z,A=ae.y);}Fe=A;}return {name:Q.name,value:Fe!==void 0?Ie(Fe,r?.format):"\u2014",color:k.get(Q.id)??"var(--color-chart-1)"}});we>=M.plotLeft&&we<=M.plotRight&&R(we);let ne=P.clientX-X.left+12,Y=P.clientY-X.top-10;C({x:ne,y:Y,label:fe,items:H});},[W,$,M,e,v,a,j,de,ue,ye,t?.format,r?.format,k]),L=qr.useCallback(()=>{C(null),R(null);},[]),G=qr.useCallback(P=>{P.preventDefault();let F=P.touches[0];if(!F)return;let K=P.currentTarget.closest("svg");if(!K)return;let oe=K.getBoundingClientRect(),X=b.current?.getBoundingClientRect();if(!X)return;let fe=F.clientX-oe.left,we=fe,H="";if(W&&$.length>0){let Y=Fa($,[M.plotLeft,M.plotRight]),Q=Qi(fe,$,Y);H=$[Q]??"",we=Y(H);}we>=M.plotLeft&&we<=M.plotRight&&R(we);let ne=e.filter(Y=>v(Y.id)).map(Y=>({name:Y.name,value:W&&H?Ie(Zi(Y,H)??0,r?.format):"\u2014",color:k.get(Y.id)??"var(--color-chart-1)"}));C({x:F.clientX-X.left+12,y:F.clientY-X.top-10,label:H,items:ne});},[W,$,M,e,v,r?.format,k]),O=qr.useMemo(()=>e.map((P,F)=>({id:P.id,label:P.name,color:P.color??U[F],visible:v(P.id)})),[e,U,v]),_=e.some(P=>P.data.length>0),ee=jsxRuntime.jsxs("svg",{role:"img","aria-label":m??"Line chart",width:M.width,height:M.height,viewBox:`0 0 ${M.width} ${M.height}`,shapeRendering:"geometricPrecision",children:[r?.gridLines!==false&&re.map(P=>{let F=de(P);return jsxRuntime.jsx("line",{x1:M.plotLeft,x2:M.plotRight,y1:F,y2:F,stroke:"currentColor",strokeWidth:.5,strokeDasharray:"4 4",className:"text-secondary-200 dark:text-secondary-700"},P)}),l&&e.map(P=>{if(!v(P.id)||P.data.length===0)return null;let K=a.includes(P.id)&&j!=null?j:de,oe=k.get(P.id)??"var(--color-chart-1)",X=wc(P.data,ue,K,i,M.plotBottom);return jsxRuntime.jsx("path",{d:X,fill:oe,fillOpacity:.15,stroke:"none",className:h?"chart-area-animate":""},`area-${P.id}`)}),e.map(P=>{if(!v(P.id)||P.data.length===0)return null;let K=a.includes(P.id)&&j!=null?j:de,oe=k.get(P.id)??"var(--color-chart-1)";return i?jsxRuntime.jsx("path",{d:qi(P.data,ue,K),fill:"none",stroke:oe,strokeWidth:c,strokeLinecap:"round",strokeLinejoin:"round",className:h?"chart-line-animate":""},P.id):jsxRuntime.jsx("polyline",{points:vc(P.data,ue,K),fill:"none",stroke:oe,strokeWidth:c,strokeLinecap:"round",strokeLinejoin:"round",className:h?"chart-line-animate":""},P.id)}),o&&e.map(P=>{if(!v(P.id))return null;let K=a.includes(P.id)&&j!=null?j:de,oe=k.get(P.id)??"var(--color-chart-1)";return P.data.map((X,fe)=>jsxRuntime.jsx("circle",{cx:ue(X.x),cy:K(X.y),r:3,fill:oe,stroke:"white",strokeWidth:1.5,className:s("chart-dot",h?"chart-dot-animate":"")},`${P.id}-${fe}`))}),S!=null&&jsxRuntime.jsx("line",{className:"chart-crosshair",x1:S,x2:S,y1:M.plotTop,y2:M.plotBottom,stroke:"currentColor",strokeWidth:1,strokeDasharray:"4 4",opacity:.5,style:{color:"var(--color-secondary-400)"}}),jsxRuntime.jsx("line",{x1:M.plotLeft,x2:M.plotLeft,y1:M.plotTop,y2:M.plotBottom,stroke:"currentColor",strokeWidth:1,className:"text-secondary-300 dark:text-secondary-600"}),re.map(P=>{let F=de(P);return jsxRuntime.jsxs("g",{children:[jsxRuntime.jsx("line",{x1:M.plotLeft-4,x2:M.plotLeft,y1:F,y2:F,stroke:"currentColor",strokeWidth:1,className:"text-secondary-300 dark:text-secondary-600"}),jsxRuntime.jsx("text",{x:M.plotLeft-6,y:F,textAnchor:"end",dominantBaseline:"middle",fontSize:10,fill:"currentColor",className:"text-secondary-500 dark:text-secondary-400",children:Ie(P,r?.format)})]},P)}),r?.label&&jsxRuntime.jsx("text",{x:-(M.plotTop+M.plotHeight/2),y:14,textAnchor:"middle",fontSize:11,fill:"currentColor",className:"text-secondary-600 dark:text-secondary-400",transform:"rotate(-90)",children:r.label}),n&&j&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("line",{x1:M.plotRight,x2:M.plotRight,y1:M.plotTop,y2:M.plotBottom,stroke:"currentColor",strokeWidth:1,className:"text-secondary-300 dark:text-secondary-600"}),pe.map(P=>{let F=j(P);return jsxRuntime.jsxs("g",{children:[jsxRuntime.jsx("line",{x1:M.plotRight,x2:M.plotRight+4,y1:F,y2:F,stroke:"currentColor",strokeWidth:1,className:"text-secondary-300 dark:text-secondary-600"}),jsxRuntime.jsx("text",{x:M.plotRight+6,y:F,textAnchor:"start",dominantBaseline:"middle",fontSize:10,fill:"currentColor",className:"text-secondary-500 dark:text-secondary-400",children:Ie(P,n?.format)})]},P)}),n?.label&&jsxRuntime.jsx("text",{x:M.plotTop+M.plotHeight/2,y:-(M.width-14),textAnchor:"middle",fontSize:11,fill:"currentColor",className:"text-secondary-600 dark:text-secondary-400",transform:"rotate(90)",children:n.label})]}),jsxRuntime.jsx("line",{x1:M.plotLeft,x2:M.plotRight,y1:M.plotBottom,y2:M.plotBottom,stroke:"currentColor",strokeWidth:1,className:"text-secondary-300 dark:text-secondary-600"}),(W?$:ye).map((P,F)=>{let K=ue(P);return jsxRuntime.jsxs("g",{children:[jsxRuntime.jsx("line",{x1:K,x2:K,y1:M.plotBottom,y2:M.plotBottom+4,stroke:"currentColor",strokeWidth:1,className:"text-secondary-300 dark:text-secondary-600"}),jsxRuntime.jsx("text",{x:K,y:M.plotBottom+14,textAnchor:"middle",fontSize:10,fill:"currentColor",className:"text-secondary-500 dark:text-secondary-400",children:Ie(P,t?.format)})]},F)}),t?.label&&jsxRuntime.jsx("text",{x:M.plotLeft+M.plotWidth/2,y:M.height-4,textAnchor:"middle",fontSize:11,fill:"currentColor",className:"text-secondary-600 dark:text-secondary-400",children:t.label}),jsxRuntime.jsx("rect",{x:M.plotLeft,y:M.plotTop,width:M.plotWidth,height:M.plotHeight,fill:"transparent",onMouseMove:y,onMouseLeave:L,onTouchStart:G,onTouchMove:G,onTouchEnd:L,style:{cursor:"crosshair"}})]}),xe=u==="left"||u==="right";return jsxRuntime.jsxs("div",{ref:b,className:s(Nt(),f),children:[m&&jsxRuntime.jsx("h3",{className:"mb-2 text-sm font-semibold text-primary-700 dark:text-primary-200",children:m}),p&&u==="top"&&jsxRuntime.jsx(za,{items:O,position:"top",onToggle:E}),jsxRuntime.jsxs("div",{className:s("flex items-start",xe&&"gap-0"),children:[p&&u==="left"&&jsxRuntime.jsx(za,{items:O,position:"left",onToggle:E}),jsxRuntime.jsx("div",{ref:N,className:"flex-1 min-w-0 overflow-hidden",children:_?ee:jsxRuntime.jsx("div",{className:"flex items-center justify-center text-secondary-400 dark:text-secondary-500",style:{height:d},children:g})}),p&&u==="right"&&jsxRuntime.jsx(za,{items:O,position:"right",onToggle:E})]}),p&&u==="bottom"&&jsxRuntime.jsx(za,{items:O,position:"bottom",onToggle:E}),w&&jsxRuntime.jsxs("div",{className:Tt(),style:{left:w.x,top:w.y},role:"tooltip",children:[w.label&&jsxRuntime.jsx("div",{className:"mb-1 font-medium text-primary-200",children:w.label}),w.items.map((P,F)=>jsxRuntime.jsxs("div",{className:"flex items-center gap-1.5",children:[jsxRuntime.jsx("span",{className:"h-2 w-2 rounded-full shrink-0",style:{background:P.color}}),jsxRuntime.jsxs("span",{className:"text-primary-300",children:[P.name,":"]}),jsxRuntime.jsx("span",{className:"font-medium",children:P.value})]},F))]})]})}function Cc(e,t){let r=new Set,n=[];for(let a of e)if(t.has(a.id))for(let i of a.data){let o=String(i.x);r.has(o)||(r.add(o),n.push(o));}return n}function Tc(e,t,r,n){if(r){let a=0;for(let o of e)if(t.has(o.id))for(let l of o.data)l.y>a&&(a=l.y);a===0&&(a=1);let[,i]=Wt(0,a,.05);return [n?.min??0,n?.max??i]}else {let a=new Map;for(let l of e)if(t.has(l.id))for(let c of l.data){let m=String(c.x);a.set(m,(a.get(m)??0)+c.y);}let i=Math.max(0,...a.values()),[,o]=Wt(0,i===0?1:i,.05);return [n?.min??0,n?.max??o]}}function Mc(e,t){let[r,n]=e,[a,i]=t;return n===r?()=>(a+i)/2:o=>a+(o-r)/(n-r)*(i-a)}function Rc(e,t=5){return Fr(e[0],e[1],t)}function Sc(e,t,r,n,a,i,o,l,c,m,d){let f=e.filter(x=>t.has(x.id)),p=r.length,u=f.length;if(p===0||u===0)return [];let h=i/p,g=h*(1-m),b=u>0?g*(1-d)/u:0,N=[];for(let x=0;x<r.length;x++){let T=r[x],w=a+x*h+(h-g)/2;for(let C=0;C<f.length;C++){let S=f[C],R=S.data.find(E=>String(E.x)===T);if(!R)continue;let V=w+C*(b+g*d/u),I=c(R.y);N.push({seriesId:S.id,category:T,x:V,y:I,width:Math.max(b,1),height:Math.max(o-I,0),stackBase:o,value:R.y,color:n.get(S.id)??"var(--color-chart-1)"});}}return N}function Pc(e,t,r,n,a,i,o,l,c,m){let d=e.filter(N=>t.has(N.id)),f=r.length,p=d.length;if(f===0||p===0)return [];let u=o/f,h=u*(1-c),g=p>0?h*(1-m)/p:0,b=[];for(let N=0;N<r.length;N++){let x=r[N],T=i+N*u+(u-h)/2;for(let w=0;w<d.length;w++){let C=d[w],S=C.data.find(I=>String(I.x)===x);if(!S)continue;let R=T+w*(g+h*m/Math.max(p,1)),V=l(S.y);b.push({seriesId:C.id,category:x,x:a,y:R,width:Math.max(V-a,0),height:Math.max(g,1),stackBase:a,value:S.y,color:n.get(C.id)??"var(--color-chart-1)"});}}return b}function Dc(e,t,r,n,a,i,o,l,c){let m=e.filter(h=>t.has(h.id)),d=r.length;if(d===0)return [];let f=o/d*(1-c),p=[],u=new Map;r.forEach(h=>u.set(h,a));for(let h of m)for(let g of r){let b=h.data.find(C=>String(C.x)===g);if(!b)continue;let N=u.get(g)??a,x=Math.max(l(b.y)-a,0),T=r.indexOf(g),w=i+(T+.5)*(o/d);p.push({seriesId:h.id,category:g,x:N,y:w-f/2,width:x,height:Math.max(f,1),stackBase:N,value:b.y,color:n.get(h.id)??"var(--color-chart-1)"}),u.set(g,N+x);}return p}function Lc(e,t,r,n,a,i,o,l,c){let m=e.filter(h=>t.has(h.id)),d=r.length;if(d===0)return [];let f=i/d*(1-c),p=[],u=new Map;r.forEach(h=>u.set(h,o));for(let h of m)for(let g of r){let b=h.data.find(S=>String(S.x)===g);if(!b)continue;let N=u.get(g)??o,x=Math.max(o-l(b.y),0),T=N-x,w=r.indexOf(g),C=a+(w+.5)*(i/d);p.push({seriesId:h.id,category:g,x:C-f/2,y:T,width:Math.max(f,1),height:x,stackBase:N,value:b.y,color:n.get(h.id)??"var(--color-chart-1)"}),u.set(g,T);}return p}function Ba({items:e,position:t,onToggle:r}){return jsxRuntime.jsx("div",{className:Ct({position:t}),children:e.map(n=>jsxRuntime.jsxs("button",{onClick:()=>r(n.id),className:s("flex items-center gap-1.5 cursor-pointer rounded px-1.5 py-1 text-xs text-primary-700 transition-opacity hover:bg-primary-100 dark:text-primary-300 dark:hover:bg-primary-800",!n.visible&&"opacity-40"),"aria-pressed":n.visible,children:[jsxRuntime.jsx("span",{className:"h-2.5 w-5 rounded-sm shrink-0",style:{background:n.color}}),n.label]},n.id))})}function rs({series:e,xAxis:t,yAxis:r,orientation:n="vertical",grouped:a=true,barRadius:i=4,barPadding:o=.2,groupPadding:l=.3,title:c,height:m=300,className:d,legend:f=true,legendPosition:p="bottom",animateOnMount:u=true,emptyText:h="No data to display"}){let g=qr.useRef(null),b=qr.useRef(null),[N,x]=qr.useState(600),[T,w]=qr.useState(null);qr.useEffect(()=>{let y=b.current;if(!y)return;let L=y.getBoundingClientRect().width;L>0&&x(L);let G=new ResizeObserver(O=>{let _=O[0]?.contentRect.width;_&&_>0&&x(_);});return G.observe(y),()=>G.disconnect()},[]);let C=qr.useMemo(()=>e.map(y=>y.id),[e]),{visible:S,toggle:R,isVisible:V}=Kt(C),I=qr.useMemo(()=>Xt(e.length),[e.length]),E=qr.useMemo(()=>new Map(e.map((y,L)=>[y.id,y.color??I[L]])),[e,I]),v=n==="horizontal",U=qr.useMemo(()=>jt(!!t?.label,!!r?.label,false),[t?.label,r?.label]),k=qr.useMemo(()=>Gt(N,m,U),[N,m,U]),q=qr.useMemo(()=>Cc(e,S),[e,S]),M=qr.useMemo(()=>Tc(e,S,a,v?t:r),[e,S,a,v,t,r]),W=qr.useMemo(()=>Mc(M,v?[k.plotLeft,k.plotRight]:[k.plotBottom,k.plotTop]),[M,k,v]),$=qr.useMemo(()=>Rc(M,(v?t:r)?.tickCount??5),[M,v,t,r]),ue=qr.useMemo(()=>v?a?Pc(e,S,q,E,k.plotLeft,k.plotTop,k.plotHeight,W,l,o):Dc(e,S,q,E,k.plotLeft,k.plotTop,k.plotHeight,W,l):a?Sc(e,S,q,E,k.plotLeft,k.plotWidth,k.plotBottom,k.plotTop,W,l,o):Lc(e,S,q,E,k.plotLeft,k.plotWidth,k.plotBottom,W,l),[e,S,q,E,k,W,a,v,l,o]),J=q.length>0?k.plotWidth/q.length:1,de=q.length>0?k.plotHeight/q.length:1,re=qr.useCallback((y,L)=>{let G=g.current?.getBoundingClientRect();if(!G)return;let O=e.filter(_=>V(_.id)).map(_=>{let ee=_.data.find(xe=>String(xe.x)===L);return {name:_.name,value:ee?Ie(ee.y,r?.format):"\u2014",color:E.get(_.id)??"var(--color-chart-1)"}});w({x:y.clientX-G.left+12,y:y.clientY-G.top-10,category:L,items:O});},[e,V,E,r?.format]),B=qr.useMemo(()=>e.map((y,L)=>({id:y.id,label:y.name,color:y.color??I[L],visible:V(y.id)})),[e,I,V]),j=e.some(y=>y.data.length>0),pe=p==="left"||p==="right",ye=jsxRuntime.jsxs("svg",{role:"img","aria-label":c??"Bar chart",width:k.width,height:k.height,viewBox:`0 0 ${k.width} ${k.height}`,shapeRendering:"geometricPrecision",children:[$.map(y=>{let L=W(y);return v?jsxRuntime.jsx("line",{x1:L,x2:L,y1:k.plotTop,y2:k.plotBottom,stroke:"currentColor",strokeWidth:.5,strokeDasharray:"4 4",className:"text-secondary-200 dark:text-secondary-700"},y):jsxRuntime.jsx("line",{x1:k.plotLeft,x2:k.plotRight,y1:L,y2:L,stroke:"currentColor",strokeWidth:.5,strokeDasharray:"4 4",className:"text-secondary-200 dark:text-secondary-700"},y)}),ue.map(y=>{let L=Math.min(i,y.width/2,y.height/2),G=`${y.seriesId}-${y.category}`;return v?jsxRuntime.jsx("rect",{x:y.x,y:y.y,width:y.width,height:y.height,rx:L,fill:y.color,className:s("chart-bar-h",u&&"chart-bar-animate"),onMouseMove:O=>re(O,y.category),onMouseLeave:()=>w(null)},G):jsxRuntime.jsx("rect",{x:y.x,y:y.y,width:y.width,height:y.height,rx:L,fill:y.color,className:s("chart-bar-v",u&&"chart-bar-animate"),onMouseMove:O=>re(O,y.category),onMouseLeave:()=>w(null)},G)}),jsxRuntime.jsx("line",{x1:k.plotLeft,x2:k.plotLeft,y1:k.plotTop,y2:k.plotBottom,stroke:"currentColor",strokeWidth:1,className:"text-secondary-300 dark:text-secondary-600"}),jsxRuntime.jsx("line",{x1:k.plotLeft,x2:k.plotRight,y1:k.plotBottom,y2:k.plotBottom,stroke:"currentColor",strokeWidth:1,className:"text-secondary-300 dark:text-secondary-600"}),!v&&$.map(y=>{let L=W(y);return jsxRuntime.jsxs("g",{children:[jsxRuntime.jsx("line",{x1:k.plotLeft-4,x2:k.plotLeft,y1:L,y2:L,stroke:"currentColor",strokeWidth:1,className:"text-secondary-300 dark:text-secondary-600"}),jsxRuntime.jsx("text",{x:k.plotLeft-6,y:L,textAnchor:"end",dominantBaseline:"middle",fontSize:10,fill:"currentColor",className:"text-secondary-500 dark:text-secondary-400",children:Ie(y,r?.format)})]},y)}),v&&$.map(y=>{let L=W(y);return jsxRuntime.jsxs("g",{children:[jsxRuntime.jsx("line",{x1:L,x2:L,y1:k.plotBottom,y2:k.plotBottom+4,stroke:"currentColor",strokeWidth:1,className:"text-secondary-300 dark:text-secondary-600"}),jsxRuntime.jsx("text",{x:L,y:k.plotBottom+14,textAnchor:"middle",fontSize:10,fill:"currentColor",className:"text-secondary-500 dark:text-secondary-400",children:Ie(y,t?.format)})]},y)}),q.map((y,L)=>{if(v){let O=k.plotTop+(L+.5)*de;return jsxRuntime.jsx("text",{x:k.plotLeft-6,y:O,textAnchor:"end",dominantBaseline:"middle",fontSize:10,fill:"currentColor",className:"text-secondary-500 dark:text-secondary-400",children:y},y)}let G=k.plotLeft+(L+.5)*J;return jsxRuntime.jsx("text",{x:G,y:k.plotBottom+14,textAnchor:"middle",fontSize:10,fill:"currentColor",className:"text-secondary-500 dark:text-secondary-400",children:y},y)}),r?.label&&!v&&jsxRuntime.jsx("text",{x:-(k.plotTop+k.plotHeight/2),y:14,textAnchor:"middle",fontSize:11,fill:"currentColor",className:"text-secondary-600 dark:text-secondary-400",transform:"rotate(-90)",children:r.label}),t?.label&&jsxRuntime.jsx("text",{x:k.plotLeft+k.plotWidth/2,y:k.height-4,textAnchor:"middle",fontSize:11,fill:"currentColor",className:"text-secondary-600 dark:text-secondary-400",children:t.label})]});return jsxRuntime.jsxs("div",{ref:g,className:s(Nt(),d),children:[c&&jsxRuntime.jsx("h3",{className:"mb-2 text-sm font-semibold text-primary-700 dark:text-primary-200",children:c}),f&&p==="top"&&jsxRuntime.jsx(Ba,{items:B,position:"top",onToggle:R}),jsxRuntime.jsxs("div",{className:s("flex items-start",pe&&"gap-0"),children:[f&&p==="left"&&jsxRuntime.jsx(Ba,{items:B,position:"left",onToggle:R}),jsxRuntime.jsx("div",{ref:b,className:"flex-1 min-w-0 overflow-hidden",children:j?ye:jsxRuntime.jsx("div",{className:"flex items-center justify-center text-secondary-400 dark:text-secondary-500",style:{height:m},children:h})}),f&&p==="right"&&jsxRuntime.jsx(Ba,{items:B,position:"right",onToggle:R})]}),f&&p==="bottom"&&jsxRuntime.jsx(Ba,{items:B,position:"bottom",onToggle:R}),T&&jsxRuntime.jsxs("div",{className:Tt(),style:{left:T.x,top:T.y},role:"tooltip",children:[jsxRuntime.jsx("div",{className:"mb-1 font-medium text-primary-200",children:T.category}),T.items.map((y,L)=>jsxRuntime.jsxs("div",{className:"flex items-center gap-1.5",children:[jsxRuntime.jsx("span",{className:"h-2 w-2 rounded-full shrink-0",style:{background:y.color}}),jsxRuntime.jsxs("span",{className:"text-primary-300",children:[y.name,":"]}),jsxRuntime.jsx("span",{className:"font-medium",children:y.value})]},L))]})]})}function Ic(e,t,r,n,a,i,o,l,c){let m=e.filter(h=>t.has(h.id)),d=m.reduce((h,g)=>h+g.value,0);if(d===0)return [];let f=new Map(e.map((h,g)=>[h.id,h.color??r[g%r.length]])),p=[],u=l;for(let h of m){let g=h.value/d*360,b=c/2,N=u+b,x=u+g-b,T=(N+x)/2,w;if(Math.abs(x-N)>=359.9){let C=ct(i,o,n,N),S=ct(i,o,n,N+180);w=`M ${C.x.toFixed(3)} ${C.y.toFixed(3)} A ${n} ${n} 0 1 1 ${S.x.toFixed(3)} ${S.y.toFixed(3)} A ${n} ${n} 0 1 1 ${C.x.toFixed(3)} ${C.y.toFixed(3)} Z`;}else if(a>0){let C=ct(i,o,n,N),S=ct(i,o,n,x),R=ct(i,o,a,x),V=ct(i,o,a,N),I=x-N>180?1:0;w=`M ${C.x.toFixed(3)} ${C.y.toFixed(3)} A ${n} ${n} 0 ${I} 1 ${S.x.toFixed(3)} ${S.y.toFixed(3)} L ${R.x.toFixed(3)} ${R.y.toFixed(3)} A ${a} ${a} 0 ${I} 0 ${V.x.toFixed(3)} ${V.y.toFixed(3)} Z`;}else {let C=ct(i,o,n,N),S=ct(i,o,n,x),R=x-N>180?1:0;w=`M ${i.toFixed(3)} ${o.toFixed(3)} L ${C.x.toFixed(3)} ${C.y.toFixed(3)} A ${n} ${n} 0 ${R} 1 ${S.x.toFixed(3)} ${S.y.toFixed(3)} Z`;}p.push({id:h.id,label:h.label,value:h.value,percent:Math.round(h.value/d*1e3)/10,color:f.get(h.id)??"var(--color-chart-1)",startAngle:N,endAngle:x,midAngle:T,path:w,outerR:n,innerR:a,cx:i,cy:o}),u+=g;}return p}function Ac(e,t){let r=(e-90)*Math.PI/180;return {dx:Math.cos(r)*t,dy:Math.sin(r)*t}}function Ya({items:e,position:t,onToggle:r}){return jsxRuntime.jsx("div",{className:Ct({position:t}),children:e.map(n=>jsxRuntime.jsxs("button",{onClick:()=>r(n.id),className:s("flex items-center gap-1.5 cursor-pointer rounded px-1.5 py-1 text-xs text-primary-700 transition-opacity hover:bg-primary-100 dark:text-primary-300 dark:hover:bg-primary-800",!n.visible&&"opacity-40"),"aria-pressed":n.visible,children:[jsxRuntime.jsx("span",{className:"h-2.5 w-2.5 rounded-full shrink-0",style:{background:n.color}}),jsxRuntime.jsx("span",{children:n.label}),jsxRuntime.jsxs("span",{className:"text-secondary-400",children:["(",n.percent,"%)"]})]},n.id))})}function os({data:e,donut:t=false,donutThickness:r=.5,startAngle:n=-90,padAngle:a=0,labelType:i="percent",centerLabel:o,centerSubLabel:l,explodeOnHover:c=true,explodeOffset:m=8,title:d,height:f=300,className:p,legend:u=true,legendPosition:h="bottom",animateOnMount:g=true,emptyText:b="No data to display"}){let N=qr.useRef(null),x=qr.useRef(null),[T,w]=qr.useState(400),[C,S]=qr.useState(null),[R,V]=qr.useState(null),[I,E]=qr.useState({}),v=qr.useRef(null);qr.useEffect(()=>{let H=x.current;if(!H)return;let ne=H.getBoundingClientRect().width;ne>0&&w(ne);let Y=new ResizeObserver(Q=>{let ke=Q[0]?.contentRect.width;ke&&ke>0&&w(ke);});return Y.observe(H),()=>Y.disconnect()},[]),qr.useEffect(()=>{function H(Y){let Q=v.current;if(!Q)return;"touches"in Y&&Y.cancelable&&Y.preventDefault();let ke="touches"in Y?Y.touches[0]?.clientX??Q.startX:Y.clientX,He="touches"in Y?Y.touches[0]?.clientY??Q.startY:Y.clientY;E(Fe=>({...Fe,[Q.id]:{dx:Q.origDx+ke-Q.startX,dy:Q.origDy+He-Q.startY}}));}function ne(){v.current=null;}return window.addEventListener("mousemove",H),window.addEventListener("mouseup",ne),window.addEventListener("touchmove",H,{passive:false}),window.addEventListener("touchend",ne),()=>{window.removeEventListener("mousemove",H),window.removeEventListener("mouseup",ne),window.removeEventListener("touchmove",H),window.removeEventListener("touchend",ne);}},[]);let U=qr.useMemo(()=>e.map(H=>H.id),[e]),{visible:k,toggle:q,isVisible:M}=Kt(U),W=qr.useMemo(()=>Xt(e.length),[e.length]),$=10,ue=6.4,J=18,de=14,re=6,B=T,j=f,pe=B/2,ye=j/2,y=i!=="none"?J+re+4:re+4,L=Math.max(Math.min(pe,ye)-y,20),G=t?L*r:0,O=qr.useMemo(()=>Ic(e,k,W,L,G,pe,ye,n,a),[e,k,W,L,G,pe,ye,n,a]),_=qr.useMemo(()=>O.map(H=>H.id).join(","),[O]);qr.useEffect(()=>{E({});},[_]);let ee=qr.useCallback((H,ne)=>{if(v.current)return;let Y=N.current?.getBoundingClientRect();if(!Y)return;S(ne);let Q=O.find(ke=>ke.id===ne);Q&&V({x:H.clientX-Y.left+12,y:H.clientY-Y.top-10,items:[{label:Q.label,value:Ie(Q.value),percent:`${Q.percent}%`,color:Q.color}]});},[O]),xe=qr.useCallback(()=>{S(null),V(null);},[]),P=qr.useCallback((H,ne,Y)=>{let Q=I[H]??{dx:0,dy:0};v.current={id:H,startX:ne,startY:Y,origDx:Q.dx,origDy:Q.dy};},[I]),F=qr.useCallback((H,ne)=>{H.preventDefault(),S(ne);let Y=N.current?.getBoundingClientRect();if(!Y)return;let Q=H.touches[0];if(!Q)return;let ke=O.find(He=>He.id===ne);ke&&V({x:Q.clientX-Y.left+12,y:Q.clientY-Y.top-10,items:[{label:ke.label,value:Ie(ke.value),percent:`${ke.percent}%`,color:ke.color}]});},[O]),K=qr.useMemo(()=>{let H=e.reduce((ne,Y)=>ne+Y.value,0);return e.map((ne,Y)=>({id:ne.id,label:ne.label,color:ne.color??W[Y],visible:M(ne.id),percent:H>0?Math.round(ne.value/H*1e3)/10:0}))},[e,W,M]),oe=e.length>0&&e.some(H=>H.value>0),X=h==="left"||h==="right",fe=qr.useMemo(()=>{if(i==="none")return [];let H=$+3,ne=re+$*.5,Y=j-re-$*.5,Q=O.filter(Z=>Z.percent>=3).map(Z=>{let Ne="";switch(i){case "percent":Ne=`${Z.percent}%`;break;case "value":Ne=Ie(Z.value);break;case "label":Ne=Z.label;break;case "label+percent":Ne=`${Z.label} ${Z.percent}%`;break}let A=ct(Z.cx,Z.cy,Z.outerR+2,Z.midAngle),ae=ct(Z.cx,Z.cy,Z.outerR+J,Z.midAngle),se=(Z.midAngle-90)*Math.PI/180,z=Math.cos(se)>=0,ve=Math.ceil(Ne.length*ue);return {id:Z.id,color:Z.color,text:Ne,textW:ve,p1:A,elbowX:ae.x,y:ae.y,isRight:z}}),ke=Q.filter(Z=>Z.isRight).sort((Z,Ne)=>Z.y-Ne.y),He=Q.filter(Z=>!Z.isRight).sort((Z,Ne)=>Z.y-Ne.y);function Fe(Z){if(Z.length!==0)for(let Ne=0;Ne<20;Ne++){let A=false;for(let se=1;se<Z.length;se++){let z=Z[se].y-Z[se-1].y;if(z<H){let ve=(H-z)/2;Z[se-1].y-=ve,Z[se].y+=ve,A=true;}}Z[0].y<ne&&(Z[0].y=ne);for(let se=1;se<Z.length;se++)Z[se].y<Z[se-1].y+H&&(Z[se].y=Z[se-1].y+H);let ae=Z.length-1;Z[ae].y>Y&&(Z[ae].y=Y);for(let se=ae-1;se>=0;se--)Z[se].y>Z[se+1].y-H&&(Z[se].y=Z[se+1].y-H);for(let se of Z)se.y=Math.max(ne,Math.min(Y,se.y));if(!A)break}}return Fe(ke),Fe(He),[...He,...ke]},[O,i,j]),we=jsxRuntime.jsxs("svg",{role:"img","aria-label":d??"Pie chart",width:B,height:j,viewBox:`0 0 ${B} ${j}`,shapeRendering:"geometricPrecision",children:[jsxRuntime.jsxs("g",{className:g?"chart-pie-animate":"",children:[O.map((H,ne)=>{let Y=C===H.id,Q=c&&Y,ke=Ac(H.midAngle,Q?m:0);return jsxRuntime.jsx("path",{d:H.path,fill:H.color,transform:Q?`translate(${ke.dx}, ${ke.dy})`:void 0,className:s("chart-slice",g&&`chart-slice-animate-${Math.min(ne,7)}`,Y&&"chart-slice--exploded"),stroke:H.color,strokeWidth:.6,onMouseMove:He=>ee(He,H.id),onMouseLeave:xe,onTouchStart:He=>F(He,H.id),onTouchEnd:xe,"aria-label":`${H.label}: ${H.percent}%`},H.id)}),fe.map(H=>{let ne=I[H.id]??{dx:0,dy:0},Y=H.elbowX+ne.dx,Q=H.y+ne.dy,ke=Y+(H.isRight?de:-de),He=H.isRight?ke+3:ke-3,Fe=de+3+H.textW+6,Z=H.isRight?Y:Y-Fe,Ne=Q-$-2,A=$*2+4;return jsxRuntime.jsxs("g",{style:{userSelect:"none"},children:[jsxRuntime.jsx("polyline",{points:[`${H.p1.x.toFixed(2)},${H.p1.y.toFixed(2)}`,`${Y.toFixed(2)},${Q.toFixed(2)}`,`${ke.toFixed(2)},${Q.toFixed(2)}`].join(" "),fill:"none",stroke:H.color,strokeWidth:1.2,opacity:.85,strokeLinejoin:"round",strokeLinecap:"round",style:{pointerEvents:"none"}}),jsxRuntime.jsx("text",{x:He.toFixed(2),y:Q.toFixed(2),textAnchor:H.isRight?"start":"end",dominantBaseline:"middle",fontSize:$,fill:"currentColor",className:"text-primary-700 dark:text-primary-300",style:{pointerEvents:"none"},children:H.text}),jsxRuntime.jsx("rect",{x:Z,y:Ne,width:Fe,height:A,fill:"transparent",style:{cursor:"grab",touchAction:"none"},onMouseDown:ae=>{ae.stopPropagation(),P(H.id,ae.clientX,ae.clientY);},onTouchStart:ae=>{ae.stopPropagation();let se=ae.touches[0];se&&P(H.id,se.clientX,se.clientY);}})]},`label-${H.id}`)})]}),t&&jsxRuntime.jsx("g",{style:{pointerEvents:"none"},children:C&&O.find(H=>H.id===C)?jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsxs("text",{x:pe,y:ye-8,textAnchor:"middle",dominantBaseline:"middle",fontSize:18,fontWeight:600,fill:"currentColor",className:"text-primary-800 dark:text-primary-100",children:[O.find(H=>H.id===C)?.percent,"%"]}),jsxRuntime.jsx("text",{x:pe,y:ye+12,textAnchor:"middle",dominantBaseline:"middle",fontSize:10,fill:"currentColor",className:"text-secondary-500 dark:text-secondary-400",children:O.find(H=>H.id===C)?.label})]}):jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[o&&jsxRuntime.jsx("text",{x:pe,y:ye-(l?8:0),textAnchor:"middle",dominantBaseline:"middle",fontSize:16,fontWeight:600,fill:"currentColor",className:"text-primary-800 dark:text-primary-100",children:o}),l&&jsxRuntime.jsx("text",{x:pe,y:ye+14,textAnchor:"middle",dominantBaseline:"middle",fontSize:11,fill:"currentColor",className:"text-secondary-500 dark:text-secondary-400",children:l})]})})]});return jsxRuntime.jsxs("div",{ref:N,className:s(Nt(),p),children:[d&&jsxRuntime.jsx("h3",{className:"mb-2 text-sm font-semibold text-primary-700 dark:text-primary-200",children:d}),u&&h==="top"&&jsxRuntime.jsx(Ya,{items:K,position:"top",onToggle:q}),jsxRuntime.jsxs("div",{className:s("flex items-start justify-center",X&&"gap-0"),children:[u&&h==="left"&&jsxRuntime.jsx(Ya,{items:K,position:"left",onToggle:q}),jsxRuntime.jsx("div",{ref:x,className:"flex-1 min-w-0 overflow-hidden",children:oe?we:jsxRuntime.jsx("div",{className:"flex items-center justify-center text-secondary-400 dark:text-secondary-500",style:{height:f},children:b})}),u&&h==="right"&&jsxRuntime.jsx(Ya,{items:K,position:"right",onToggle:q})]}),u&&h==="bottom"&&jsxRuntime.jsx(Ya,{items:K,position:"bottom",onToggle:q}),R&&jsxRuntime.jsx("div",{className:Tt(),style:{left:R.x,top:R.y},role:"tooltip",children:R.items.map((H,ne)=>jsxRuntime.jsxs("div",{className:"flex items-center gap-2",children:[jsxRuntime.jsx("span",{className:"h-2.5 w-2.5 rounded-full shrink-0",style:{background:H.color}}),jsxRuntime.jsxs("span",{className:"font-medium",children:[H.label,":"]}),jsxRuntime.jsx("span",{children:H.value}),jsxRuntime.jsxs("span",{className:"text-primary-300",children:["(",H.percent,")"]})]},ne))})]})}function Fc(e,t,r){let n=1/0,a=-1/0;for(let l of e)if(t.has(l.id))for(let c of l.data){let m=Number(c.x);m<n&&(n=m),m>a&&(a=m);}if(!isFinite(n))return [0,1];let[i,o]=Wt(n,a);return [r?.min??i,r?.max??o]}function _c(e,t,r){let n=1/0,a=-1/0;for(let l of e)if(t.has(l.id))for(let c of l.data)c.y<n&&(n=c.y),c.y>a&&(a=c.y);if(!isFinite(n))return [0,1];let[i,o]=Wt(n,a);return [r?.min??i,r?.max??o]}function is(e,t){let[r,n]=e,[a,i]=t;return n===r?()=>(a+i)/2:o=>a+(o-r)/(n-r)*(i-a)}function ss(e,t=5){return Fr(e[0],e[1],t)}function zc(e,t,r){let n=1.618033988749895,a=e*137+t,i=a*n%1*2-1,o=a*n*n%1*2-1;return [i*r,o*r]}function Bc(e,t,r=12){if(e.length<2)return null;let n=Math.min(...e),a=Math.max(...e),i=Math.min(...t),o=Math.max(...t);return {cx:(n+a)/2,cy:(i+o)/2,rx:(a-n)/2+r,ry:(o-i)/2+r}}function Ka({items:e,position:t,onToggle:r}){return jsxRuntime.jsx("div",{className:Ct({position:t}),children:e.map(n=>jsxRuntime.jsxs("button",{onClick:()=>r(n.id),className:s("flex items-center gap-1.5 cursor-pointer rounded px-1.5 py-1 text-xs text-primary-700 transition-opacity hover:bg-primary-100 dark:text-primary-300 dark:hover:bg-primary-800",!n.visible&&"opacity-40"),"aria-pressed":n.visible,children:[jsxRuntime.jsx("span",{className:"h-2.5 w-2.5 rounded-full shrink-0",style:{background:n.color}}),n.label]},n.id))})}function ls({series:e,xAxis:t,yAxis:r,dotRadius:n=5,dotOpacity:a=.75,clusters:i=false,jitter:o=false,jitterAmount:l=12,linkedLines:c=false,title:m,height:d=300,className:f,legend:p=true,legendPosition:u="bottom",animateOnMount:h=true,emptyText:g="No data to display"}){let b=qr.useRef(null),N=qr.useRef(null),[x,T]=qr.useState(600),[w,C]=qr.useState(null);qr.useEffect(()=>{let y=N.current;if(!y)return;let L=y.getBoundingClientRect().width;L>0&&T(L);let G=new ResizeObserver(O=>{let _=O[0]?.contentRect.width;_&&_>0&&T(_);});return G.observe(y),()=>G.disconnect()},[]);let S=qr.useMemo(()=>e.map(y=>y.id),[e]),{visible:R,toggle:V,isVisible:I}=Kt(S),E=qr.useMemo(()=>Xt(e.length),[e.length]),v=qr.useMemo(()=>new Map(e.map((y,L)=>[y.id,y.color??E[L]])),[e,E]),U=qr.useMemo(()=>jt(!!t?.label,!!r?.label,false),[t?.label,r?.label]),k=qr.useMemo(()=>Gt(x,d,U),[x,d,U]),q=qr.useMemo(()=>Fc(e,R,t),[e,R,t]),M=qr.useMemo(()=>_c(e,R,r),[e,R,r]),W=qr.useMemo(()=>is(q,[k.plotLeft,k.plotRight]),[q,k]),$=qr.useMemo(()=>is(M,[k.plotBottom,k.plotTop]),[M,k]),ue=qr.useMemo(()=>ss(q,t?.tickCount??6),[q,t?.tickCount]),J=qr.useMemo(()=>ss(M,r?.tickCount??5),[M,r?.tickCount]),de=qr.useCallback((y,L,G,O,_)=>{let ee=b.current?.getBoundingClientRect();ee&&C({x:y.clientX-ee.left+12,y:y.clientY-ee.top-10,seriesName:L,xVal:Ie(G,t?.format),yVal:Ie(O,r?.format),color:_});},[t?.format,r?.format]),re=qr.useCallback((y,L,G,O,_)=>{y.preventDefault();let ee=b.current?.getBoundingClientRect();if(!ee)return;let xe=y.touches[0];xe&&C({x:xe.clientX-ee.left+12,y:xe.clientY-ee.top-10,seriesName:L,xVal:Ie(G,t?.format),yVal:Ie(O,r?.format),color:_});},[t?.format,r?.format]),B=qr.useMemo(()=>e.map((y,L)=>({id:y.id,label:y.name,color:y.color??E[L],visible:I(y.id)})),[e,E,I]),j=e.some(y=>y.data.length>0),pe=u==="left"||u==="right",ye=jsxRuntime.jsxs("svg",{role:"img","aria-label":m??"Scatter chart",width:k.width,height:k.height,viewBox:`0 0 ${k.width} ${k.height}`,shapeRendering:"geometricPrecision",children:[J.map(y=>jsxRuntime.jsx("line",{x1:k.plotLeft,x2:k.plotRight,y1:$(y),y2:$(y),stroke:"currentColor",strokeWidth:.5,strokeDasharray:"4 4",className:"text-secondary-200 dark:text-secondary-700"},y)),i&&e.map((y,L)=>{if(!I(y.id)||y.data.length<2)return null;let G=v.get(y.id)??"var(--color-chart-1)",O=y.data.map(xe=>W(Number(xe.x))),_=y.data.map(xe=>$(xe.y)),ee=Bc(O,_,16);return ee?jsxRuntime.jsx("ellipse",{cx:ee.cx,cy:ee.cy,rx:ee.rx,ry:ee.ry,fill:G,fillOpacity:.06,stroke:G,strokeOpacity:.3,strokeWidth:1.5,strokeDasharray:"5 3",className:h?"chart-cluster-ellipse":"",style:{animationDelay:`${L*.1}s`}},`cluster-${y.id}`):null}),c&&e.map(y=>{if(!I(y.id)||y.data.length<2)return null;let L=v.get(y.id)??"var(--color-chart-1)",O=[...y.data].sort((_,ee)=>Number(_.x)-Number(ee.x)).map(_=>`${W(Number(_.x)).toFixed(2)},${$(_.y).toFixed(2)}`).join(" ");return jsxRuntime.jsx("polyline",{points:O,fill:"none",stroke:L,strokeWidth:1.5,className:"chart-scatter-link"},`link-${y.id}`)}),e.map((y,L)=>{if(!I(y.id))return null;let G=v.get(y.id)??"var(--color-chart-1)";return jsxRuntime.jsx("g",{className:"chart-scatter-group",children:y.data.map((O,_)=>{let[ee,xe]=o?zc(L,_,l):[0,0],P=W(Number(O.x))+ee,F=$(O.y)+xe;return jsxRuntime.jsx("circle",{cx:P,cy:F,r:n,fill:G,fillOpacity:a,stroke:G,strokeWidth:1,strokeOpacity:.5,className:s("chart-scatter-dot",h&&"chart-scatter-dot--animate"),style:{color:G},onMouseMove:K=>de(K,y.name,O.x,O.y,G),onMouseLeave:()=>C(null),onTouchStart:K=>re(K,y.name,O.x,O.y,G),onTouchEnd:()=>C(null)},_)})},y.id)}),jsxRuntime.jsx("line",{x1:k.plotLeft,x2:k.plotLeft,y1:k.plotTop,y2:k.plotBottom,stroke:"currentColor",strokeWidth:1,className:"text-secondary-300 dark:text-secondary-600"}),jsxRuntime.jsx("line",{x1:k.plotLeft,x2:k.plotRight,y1:k.plotBottom,y2:k.plotBottom,stroke:"currentColor",strokeWidth:1,className:"text-secondary-300 dark:text-secondary-600"}),J.map(y=>{let L=$(y);return jsxRuntime.jsxs("g",{children:[jsxRuntime.jsx("line",{x1:k.plotLeft-4,x2:k.plotLeft,y1:L,y2:L,stroke:"currentColor",strokeWidth:1,className:"text-secondary-300 dark:text-secondary-600"}),jsxRuntime.jsx("text",{x:k.plotLeft-6,y:L,textAnchor:"end",dominantBaseline:"middle",fontSize:10,fill:"currentColor",className:"text-secondary-500 dark:text-secondary-400",children:Ie(y,r?.format)})]},y)}),ue.map(y=>{let L=W(y);return jsxRuntime.jsxs("g",{children:[jsxRuntime.jsx("line",{x1:L,x2:L,y1:k.plotBottom,y2:k.plotBottom+4,stroke:"currentColor",strokeWidth:1,className:"text-secondary-300 dark:text-secondary-600"}),jsxRuntime.jsx("text",{x:L,y:k.plotBottom+14,textAnchor:"middle",fontSize:10,fill:"currentColor",className:"text-secondary-500 dark:text-secondary-400",children:Ie(y,t?.format)})]},y)}),r?.label&&jsxRuntime.jsx("text",{x:-(k.plotTop+k.plotHeight/2),y:14,textAnchor:"middle",fontSize:11,fill:"currentColor",className:"text-secondary-600 dark:text-secondary-400",transform:"rotate(-90)",children:r.label}),t?.label&&jsxRuntime.jsx("text",{x:k.plotLeft+k.plotWidth/2,y:k.height-4,textAnchor:"middle",fontSize:11,fill:"currentColor",className:"text-secondary-600 dark:text-secondary-400",children:t.label})]});return jsxRuntime.jsxs("div",{ref:b,className:s(Nt(),f),children:[m&&jsxRuntime.jsx("h3",{className:"mb-2 text-sm font-semibold text-primary-700 dark:text-primary-200",children:m}),p&&u==="top"&&jsxRuntime.jsx(Ka,{items:B,position:"top",onToggle:V}),jsxRuntime.jsxs("div",{className:s("flex items-start",pe&&"gap-0"),children:[p&&u==="left"&&jsxRuntime.jsx(Ka,{items:B,position:"left",onToggle:V}),jsxRuntime.jsx("div",{ref:N,className:"flex-1 min-w-0 overflow-hidden",children:j?ye:jsxRuntime.jsx("div",{className:"flex items-center justify-center text-secondary-400 dark:text-secondary-500",style:{height:d},children:g})}),p&&u==="right"&&jsxRuntime.jsx(Ka,{items:B,position:"right",onToggle:V})]}),p&&u==="bottom"&&jsxRuntime.jsx(Ka,{items:B,position:"bottom",onToggle:V}),w&&jsxRuntime.jsxs("div",{className:Tt(),style:{left:w.x,top:w.y},role:"tooltip",children:[jsxRuntime.jsxs("div",{className:"flex items-center gap-1.5 mb-1",children:[jsxRuntime.jsx("span",{className:"h-2 w-2 rounded-full",style:{background:w.color}}),jsxRuntime.jsx("span",{className:"font-medium",children:w.seriesName})]}),jsxRuntime.jsxs("div",{className:"text-primary-300",children:["X: ",jsxRuntime.jsx("span",{className:"font-medium text-primary-50",children:w.xVal})," ","Y: ",jsxRuntime.jsx("span",{className:"font-medium text-primary-50",children:w.yVal})]})]})]})}var Tg={LineChart:ts,BarChart:rs,PieChart:os,ScatterChart:ls},cs=Tg;var Mg={Primitives:bo,Layout:wo,DataDisplay:Ho,Navigation:Ko,Disclosure:Go,Overlay:si,Feedback:xi,Extras:Oi,Forms:Wi,Chart:cs},cC=Mg;exports.Accordion=Wo;exports.AccordionContent=Fp;exports.AccordionItem=Ap;exports.AccordionTrigger=Hp;exports.Alert=mi;exports.AlertContent=Mu;exports.AlertDescription=Ru;exports.AlertIcon=Tu;exports.AlertTitle=Cu;exports.Avatar=Fn;exports.AvatarGroup=_n;exports.Badge=ao;exports.BarChart=rs;exports.Breadcrumb=ta;exports.Button=gr;exports.Card=ho;exports.CardContent=Gd;exports.CardDescription=jd;exports.CardFooter=Ud;exports.CardHeader=Xd;exports.CardTitle=Wd;exports.Chart=cs;exports.Chat=Po;exports.Checkbox=po;exports.CinePlayer=Mi;exports.CodeBlock=Vo;exports.CommandPalette=Va;exports.ContextMenu=ii;exports.DataDisplay=Ho;exports.DataTable=ym;exports.DateTimePicker=Aa;exports.Dialog=ln;exports.DialogClose=eu;exports.DialogContent=Zo;exports.DialogDescription=ti;exports.DialogFooter=ri;exports.DialogHeader=Jo;exports.DialogTitle=ei;exports.Disclosure=Go;exports.Drawer=pa;exports.DrawerBody=nl;exports.DrawerClose=ol;exports.DrawerFooter=al;exports.DrawerHeader=rl;exports.Dropdown=Za;exports.DropdownButton=hr;exports.Extras=Oi;exports.Feedback=xi;exports.FileExplorer=Ei;exports.FilmReel=ki;exports.Form=Xi;exports.FormItem=bg;exports.FormSection=hg;exports.Forms=Wi;exports.Header=Bo;exports.HorizontalCard=qd;exports.ImageCard=yo;exports.ImageCardActions=tm;exports.ImageCardBody=Zd;exports.ImageCardDescription=em;exports.ImageCardTitle=Jd;exports.Indicator=io;exports.Input=lo;exports.Label=so;exports.Layout=wo;exports.LineChart=ts;exports.List=Mo;exports.ListItem=wm;exports.Masonry=Hi;exports.MetricCard=Ao;exports.MiniPlayer=Ci;exports.NavLink=Oo;exports.Navigation=Ko;exports.Overlay=si;exports.Pagination=na;exports.Panel=xo;exports.PanelContent=nm;exports.PanelHeader=rm;exports.PieChart=os;exports.Primitives=bo;exports.ProgressBar=fi;exports.Radio=fo;exports.RadioGroup=uo;exports.RibbonBar=Yo;exports.ScatterChart=ls;exports.SideNav=zo;exports.Skeleton=xa;exports.Slider=Bn;exports.SliderRange=On;exports.SortableTable=bm;exports.Spin=bi;exports.Stat=Io;exports.Switch=mo;exports.TabContent=Kp;exports.TabList=Op;exports.TabPanels=Yp;exports.TabTrigger=$p;exports.Table=Ur;exports.TableBody=Co;exports.TableCell=nr;exports.TableEmpty=To;exports.TableHead=rr;exports.TableHeader=No;exports.TableRow=Gr;exports.Tabs=jo;exports.Tag=oo;exports.TextBox=co;exports.Timeline=zi;exports.ToastContext=hn;exports.ToastProvider=va;exports.Tooltip=ni;exports.Tree=Ro;exports.TreeItem=Sm;exports.TypewriterText=La;exports.accordionContentVariants=oa;exports.accordionTriggerVariants=aa;exports.accordionVariants=ia;exports.alertVariants=pn;exports.avatarVariants=Br;exports.badgeVariants=Nn;exports.buttonVariants=ur;exports.cardVariants=Xr;exports.chartContainerVariants=Nt;exports.chartLegendVariants=Ct;exports.chartTooltipVariants=Tt;exports.checkboxVariants=Mn;exports.cn=s;exports.codeBlockVariants=Wr;exports.configureAlertTopOffset=Lu;exports.default=cC;exports.dialogContentVariants=sn;exports.indicatorVariants=Cn;exports.inputVariants=fr;exports.labelVariants=Tn;exports.listItemVariants=Xn;exports.listVariants=Kn;exports.metricCardVariants=Gn;exports.navLinkVariants=Zn;exports.panelVariants=$n;exports.progressBarVariants=fa;exports.radioVariants=Rn;exports.skeletonVariants=un;exports.sliderVariants=Or;exports.spinVariants=Tr;exports.statVariants=jn;exports.switchTrackVariants=Sn;exports.tabListVariants=sa;exports.tabTriggerVariants=la;exports.tableVariants=Yn;exports.tagVariants=Pn;exports.toastVariants=ga;exports.tooltipVariants=ma;exports.treeItemVariants=Wn;exports.useAlert=zu;exports.useSpin=Zu;exports.useToast=wa;