@neuctra/ui
Version:
A modern, responsive, customizable React UI component library powered by Tailwind CSS and Vite.
56 lines • 254 kB
JavaScript
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=require("react/jsx-runtime"),O=require("clsx"),p=require("react"),vl=require("tailwind-merge"),H=require("lucide-react"),wl=require("react-dom");function jl(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const n in e)if(n!=="default"){const s=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,s.get?s:{enumerable:!0,get:()=>e[n]})}}return t.default=e,Object.freeze(t)}const un=jl(p),Sl={uppercase:"uppercase",lowercase:"lowercase",capitalize:"capitalize"},Tl={default:"text-foreground",primary:"text-primary",muted:"text-muted-foreground"};function Cl({as:e,children:t,transform:n,italic:s,underline:r,strikethrough:o,truncate:i,color:a="default",className:c,...u}){const d=e||"p",f=d==="a";return l.jsx(d,{className:O(c,n&&Sl[n],s&&"italic",r&&"underline",o&&"line-through",i&&"truncate",f&&"text-primary hover:opacity-80 underline",Tl[a]||a),...f&&{rel:"noopener noreferrer"},...u,children:t})}const m=(...e)=>vl.twMerge(O(e)),Et=p.forwardRef(function({children:t,iconBefore:n,iconAfter:s,loading:r=!1,loadingText:o="Loading...",fullWidth:i=!1,variant:a="default",size:c="sm",disabled:u,className:d,contentClassName:f,iconClassName:h,loaderClassName:g,textClassName:x,style:y,contentStyle:b,iconStyle:w,loaderStyle:S,textStyle:v,type:j="button",...T},P){const k=u||r,C={xs:"px-3 py-1.5 text-xs min-h-[28px] rounded-md",sm:"px-4 py-2 text-sm min-h-[32px] rounded-md",md:"px-6 py-2.5 text-[15px] min-h-[40px] rounded-lg",lg:"px-8 py-3 text-base min-h-[48px] rounded-xl",xl:"px-10 py-3.5 text-lg min-h-[56px] rounded-2xl"},M={xs:"gap-1.5",sm:"gap-2",md:"gap-2",lg:"gap-2.5",xl:"gap-3"},D={xs:"border",sm:"border-2",md:"border-2",lg:"border-2",xl:"border-[3px]"},B={default:"bg-primary text-primary-foreground hover:opacity-90",outline:"border border-border bg-background text-foreground hover:bg-accent",ghost:"bg-transparent text-foreground hover:bg-accent",secondary:"bg-muted text-muted-foreground hover:opacity-90",destructive:"bg-destructive text-destructive-foreground hover:opacity-90",success:"bg-success text-success-foreground hover:opacity-90",warning:"bg-warning text-warning-foreground hover:opacity-90",info:"bg-info text-info-foreground hover:opacity-90"},V={xs:14,sm:16,md:20,lg:24,xl:28};return l.jsx("button",{ref:P,type:j,disabled:k,"aria-busy":r||void 0,className:m("inline-flex items-center justify-center transition-all duration-200","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background",C[c]??C.md,B[a]??B.default,i&&"w-full",k&&"opacity-60 cursor-not-allowed",d),style:y,...T,children:l.jsx("span",{className:m("inline-flex items-center",M[c]??M.md,f),style:b,children:r?l.jsxs(l.Fragment,{children:[l.jsx("span",{"aria-hidden":"true",className:m("border-current border-t-transparent rounded-full animate-spin",D[c]??D.md,g),style:{width:V[c],height:V[c],flexShrink:0,...S}}),l.jsx("span",{className:m("whitespace-nowrap text-current",x),style:v,children:o})]}):l.jsxs(l.Fragment,{children:[n&&l.jsx("span",{"aria-hidden":"true",className:m("inline-flex items-center justify-center shrink-0 text-current","[&_svg]:w-full [&_svg]:h-full",h),style:{width:V[c],height:V[c],...w},children:n}),t!=null&&l.jsx("span",{className:m("whitespace-nowrap text-current",x),style:v,children:t}),s&&l.jsx("span",{"aria-hidden":"true",className:m("inline-flex items-center justify-center shrink-0 text-current","[&_svg]:w-full [&_svg]:h-full",h),style:{width:V[c],height:V[c],...w},children:s})]})})})});Et.displayName="Button";const Us=e=>{if(e)return typeof e!="object"||!("base"in e)?e:e.base},Bi=p.forwardRef((e,t)=>{const{src:n,alt:s="",title:r,width:o="100%",height:i,aspectRatio:a,radius:c,border:u,shadow:d,opacity:f=1,objectFit:h="cover",overlay:g,overlayColor:x="color-mix(in srgb, var(--background) 60%, transparent)",clickable:y,onClick:b,fallback:w,loading:S="lazy",className:v,imageClassName:j,overlayClassName:T,fallbackClassName:P,style:k,imageStyle:C,overlayStyle:M,fallbackStyle:D,...B}=e,V=Us(o),$=Us(i),E=p.useMemo(()=>({width:V,height:$,aspectRatio:a,borderRadius:c,border:u,overflow:"hidden",position:"relative",display:"inline-block",cursor:y?"pointer":void 0,boxShadow:d?"0 4px 12px color-mix(in srgb, var(--foreground) 15%, transparent)":void 0,backgroundColor:"var(--background)",...k}),[V,$,a,c,u,d,y,k]),N={width:"100%",height:"100%",objectFit:h,opacity:f,display:"block",...C},L={position:"absolute",inset:0,background:x,display:"flex",alignItems:"center",justifyContent:"center",color:"var(--primary-foreground)",...M},K={width:"100%",height:"100%",display:"flex",alignItems:"center",justifyContent:"center",padding:16,color:"var(--muted-foreground)",backgroundColor:"var(--muted)",...D},R=I=>{y&&(I.key==="Enter"||I.key===" ")&&(I.preventDefault(),b?.(I))};return l.jsxs("div",{ref:t,role:y?"button":void 0,tabIndex:y?0:void 0,"aria-label":s,title:r,onClick:y?b:void 0,onKeyDown:R,style:E,className:v,...B,children:[n?l.jsx("img",{src:n,alt:s,loading:S,style:N,className:j}):l.jsx("div",{style:K,className:P,children:w||"No Image"}),g&&l.jsx("div",{style:L,className:T,children:g})]})});Bi.displayName="Image";const Nl={sm:"max-w-sm",md:"max-w-md",lg:"max-w-lg",xl:"max-w-xl","2xl":"max-w-2xl",full:"w-full"},kl={none:"p-0",sm:"p-4",md:"p-6",lg:"p-8",xl:"p-12"},Fi=p.forwardRef(({size:e="full",padding:t="none",center:n=!0,className:s,style:r,children:o,...i},a)=>{const c=O(s,"w-full box-border",Nl[e],kl[t],n&&"mx-auto");return l.jsx("div",{ref:a,className:c,style:{...r},...i,children:o})});Fi.displayName="Container";const Pl={xs:"text-xs",sm:"text-sm",md:"text-base",lg:"text-lg",xl:"text-xl","2xl":"text-2xl"},Dl={xs:"w-6 h-6",sm:"w-8 h-8",md:"w-10 h-10",lg:"w-12 h-12",xl:"w-14 h-14","2xl":"w-16 h-16"},yn={circular:"rounded-full",rounded:"rounded-lg",square:"rounded-none"},El={"top-left":"-top-0.5 -left-0.5","top-right":"-top-0.5 -right-0.5","bottom-left":"-bottom-0.5 -left-0.5","bottom-right":"-bottom-0.5 -right-0.5"},Al=e=>({xs:"w-2 h-2",sm:"w-2.5 h-2.5",md:"w-3 h-3",lg:"w-3.5 h-3.5",xl:"w-4 h-4","2xl":"w-4.5 h-4.5"})[e],Ml=e=>({xs:"border",sm:"border",md:"border-2",lg:"border-2",xl:"border-[3px]","2xl":"border-[3px]"})[e],Rl=({src:e,alt:t="User avatar",size:n="md",variant:s="circular",isOnline:r=!1,isOffline:o=!1,fallback:i,ring:a=!1,onClick:c,statusPosition:u="bottom-right",className:d="",statusClassName:f="",style:h,statusStyle:g,imageClassName:x="",fallbackClassName:y="",iconClassName:b=""})=>{const[w,S]=p.useState(!1),v=!!c,j=n==="responsive"?"md":n,T=i||t.split(" ").map(M=>M[0]).join("").toUpperCase().slice(0,2),P=r?"bg-success":o?"bg-muted-foreground":"",k=Al(j),C=Ml(j);return l.jsxs("div",{role:v?"button":"img",tabIndex:v?0:-1,"aria-label":t,onClick:c,className:`relative inline-flex items-center justify-center
${Dl[j]}
${yn[s]}
bg-background text-foreground
transition-all duration-200
${v?"cursor-pointer hover:scale-105 active:scale-95":""}
${a?"ring-2 ring-border ring-offset-2":""}
${d}`,style:{...h,...a?{ringColor:"var(--border)"}:{}},onKeyDown:M=>{v&&(M.key==="Enter"||M.key===" ")&&(M.preventDefault(),c?.())},children:[e&&!w?l.jsx("img",{src:e,alt:t,onError:()=>S(!0),className:m("w-full h-full object-cover",yn[s],x)}):l.jsx("div",{className:m("w-full h-full flex items-center justify-center bg-muted text-foreground font-semibold",Pl[j],yn[s],y),children:T||l.jsx(H.User,{className:m("w-1/2 h-1/2 text-muted-foreground",b)})}),(r||o)&&l.jsx("span",{"aria-label":r?"Online":"Offline",title:r?"Online":"Offline",className:`
absolute
${El[u]}
${P}
${k}
${C}
border-background
rounded-full
shadow-md
z-10
${f}
`,style:{...g}})]})},Oi=p.memo(({text:e,icon:t,iconPosition:n="left",variant:s="solid",size:r="sm",rounded:o=!0,notificationDot:i=!1,count:a,pulse:c=!1,className:u,style:d,dotClassName:f,dotStyle:h,countClassName:g,countStyle:x,iconClassName:y,iconStyle:b,textClassName:w,textStyle:S,onClick:v})=>{const j={sm:"px-2.5 py-0.5 text-[11px] gap-1",md:"px-3 py-1 text-xs gap-1.5",lg:"px-4 py-1.5 text-sm gap-2"},T={sm:"w-3 h-3",md:"w-3.5 h-3.5",lg:"w-4 h-4"},P={solid:"bg-primary text-primary-foreground",outline:"border border-primary text-primary bg-transparent",soft:"bg-primary/10 text-primary"},k=!!v;return l.jsxs("span",{onClick:v,role:k?"button":void 0,tabIndex:k?0:void 0,onKeyDown:k?C=>{(C.key==="Enter"||C.key===" ")&&(C.preventDefault(),v?.())}:void 0,style:d,className:m("relative inline-flex items-center justify-center font-medium","transition-all duration-200 select-none",P[s]??P.solid,o?"rounded-full":"rounded-md",j[r]??j.sm,k&&"cursor-pointer focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background "+(s==="solid"?"hover:bg-primary/90":s==="outline"?"hover:bg-primary/10":"hover:bg-primary/20"),u),children:[i&&a===void 0&&l.jsx("span",{"aria-hidden":"true",style:h,className:m("absolute -top-1 -right-1 w-2 h-2 rounded-full bg-destructive",c&&"before:absolute before:inset-0 before:rounded-full before:bg-destructive before:animate-ping motion-reduce:before:animate-none",f)}),a!==void 0&&l.jsx("span",{role:"status",style:x,className:m("absolute -top-2 -right-2 min-w-[18px] h-[18px] px-1 text-[10px]","flex items-center justify-center rounded-full","bg-destructive text-destructive-foreground",g),children:a}),t&&n==="left"&&l.jsx("span",{"aria-hidden":"true",style:b,className:m("flex items-center shrink-0 [&_svg]:w-full [&_svg]:h-full",T[r]??T.sm,y),children:t}),e&&l.jsx("span",{style:S,className:m(w),children:e}),t&&n==="right"&&l.jsx("span",{"aria-hidden":"true",style:b,className:m("flex items-center shrink-0 [&_svg]:w-full [&_svg]:h-full",T[r]??T.sm,y),children:t})]})});Oi.displayName="Badge";const Il={sm:"text-xs",md:"text-sm",lg:"text-base"},Vl={compact:{sm:"px-2 py-1",md:"px-2.5 py-1.5",lg:"px-3 py-2"},normal:{sm:"px-2.5 py-1.5",md:"px-3 py-2",lg:"px-3.5 py-2.5"},comfortable:{sm:"px-3 py-2",md:"px-3.5 py-2.5",lg:"px-4 py-3"}},Ll={default:"rounded-md hover:bg-accent",nav:"rounded-lg hover:bg-accent hover:text-foreground",menu:"rounded-md hover:bg-accent",card:"rounded-lg border border-border bg-card hover:bg-accent",ghost:"rounded-md hover:bg-accent/70"},Bl={default:"bg-accent text-foreground",nav:"bg-primary text-foreground",menu:"bg-accent text-foreground",card:"border-primary bg-primary/10 text-foreground",ghost:"bg-accent text-foreground"},Vn=(e,t,n)=>e.id??`${n}-${t}-${String(e.text??e.label??"item")}`,Fl=e=>e.subItems??e.items??[],Ol=e=>e.text??e.label,$l=(e,t)=>t??(e==="_blank"?"noreferrer":void 0),as=e=>{const t=e.item??{id:e.id,text:e.text,label:e.label,description:e.description,icon:e.icon,leading:e.leading,trailing:e.trailing,badge:e.badge,shortcut:e.shortcut,href:e.href,target:e.target,rel:e.rel,download:e.download,onClick:e.onClick,subItems:e.subItems,items:e.items,expanded:e.expanded,defaultExpanded:e.defaultExpanded,collapsible:e.collapsible,active:e.active,disabled:e.disabled,danger:e.danger,separator:e.separator,hidden:e.hidden,title:e.title,ariaLabel:e.ariaLabel,role:e.role,className:e.className,contentClassName:e.contentClassName,iconClassName:e.iconClassName,textClassName:e.textClassName,descriptionClassName:e.descriptionClassName,badgeClassName:e.badgeClassName,subListClassName:e.subListClassName,style:e.style,contentStyle:e.contentStyle,iconStyle:e.iconStyle,textStyle:e.textStyle,descriptionStyle:e.descriptionStyle,badgeStyle:e.badgeStyle,subListStyle:e.subListStyle},{index:n=0,depth:s=0,isInline:r=!1,isOrdered:o=!1,showTree:i=!1,showBullets:a=!1,showDividers:c=!1,interactive:u=!0,disabled:d=!1,variant:f="default",size:h="md",density:g="normal",nestedMode:x="collapse",bulletVariant:y="dot",activeItemId:b,expandedIds:w,toggleExpanded:S,selectItem:v,linkComponent:j,renderItem:T,itemClassName:P,itemContentClassName:k,bulletClassName:C,textClassName:M,iconClassName:D,badgeClassName:B,shortcutClassName:V,trailingClassName:$,subListClassName:E,separatorClassName:N,chevronClassName:L,externalIconClassName:K,itemStyle:R,itemContentStyle:I,bulletStyle:A,textStyle:z,iconStyle:F,badgeStyle:W,shortcutStyle:G,trailingStyle:Q,subListStyle:ue,separatorStyle:ge}=e;if(t.hidden)return null;const ve=Vn(t,n,s),We=Fl(t),ye=We.length>0,ae=d||!!t.disabled,we=t.active||b===ve,Me=t.expanded,je=w?.has(ve),Ne=Me??je??t.defaultExpanded??x==="always",ke=t.collapsible??x==="collapse",Ke=Ol(t),ee=t.leading??t.icon,Y=j??"a",$e=!!t.href||!!t.onClick||ye,Re=u&&$e&&!ae,He=t.target==="_blank",le=()=>{!ye||ae||S?.(ve,t)},de=Ie=>{if(ae){Ie.preventDefault();return}ye&&(!t.href||ke)&&le(),t.onClick?.(Ie,t),v?.(ve,t)};if(t.separator)return l.jsx("li",{role:"separator",className:O("my-1 h-px bg-border",N),style:ge});const te=a&&!o&&!r&&!ee&&y!=="none",_e=l.jsxs(l.Fragment,{children:[te&&l.jsx("span",{"aria-hidden":"true",className:O("shrink-0",y==="line"&&"mt-1.5 h-px w-4 bg-current opacity-50",y==="number"&&"flex h-5 min-w-5 items-center justify-center rounded-full bg-primary/10 px-1 text-xs font-medium text-foreground",y==="dot"&&"mt-1.5 h-2 w-2 rounded-full bg-primary",C),style:A,children:y==="number"?n+1:null}),ee&&l.jsx("span",{className:O("shrink-0 text-foreground/70",t.iconClassName,D),style:{...F,...t.iconStyle},children:ee}),l.jsxs("span",{className:"min-w-0 flex-1",children:[l.jsx("span",{className:O("block truncate",t.textClassName,M),style:{...z,...t.textStyle},children:Ke}),t.description&&l.jsx("span",{className:O("mt-0.5 block truncate text-xs text-foreground/70",t.descriptionClassName),style:t.descriptionStyle,children:t.description})]}),t.badge&&l.jsx("span",{className:O("shrink-0 rounded-full bg-primary/10 px-2 py-0.5 text-xs font-medium text-foreground",t.badgeClassName,B),style:{...W,...t.badgeStyle},children:t.badge}),t.shortcut&&l.jsx("kbd",{className:O("shrink-0 rounded border border-border bg-muted px-1.5 py-0.5 text-[11px] text-foreground/60",V),style:e.shortcutStyle,children:t.shortcut}),t.trailing&&l.jsx("span",{className:O("shrink-0 text-foreground/70",$),style:Q,children:t.trailing}),He&&l.jsx(H.ExternalLink,{"aria-hidden":"true",className:O("h-3.5 w-3.5 shrink-0 text-foreground/60",K)}),ye&&ke&&!t.trailing&&l.jsx("span",{className:O("shrink-0 text-foreground/60",L),children:Ne?l.jsx(H.ChevronDown,{size:16}):l.jsx(H.ChevronRight,{size:16})})]}),Pe=O("group/list-item flex min-w-0 items-center gap-2.5 transition-all","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",Il[h],Vl[g][h],Ll[f],we&&Bl[f],t.danger&&"text-foreground hover:bg-destructive/10",ae&&"pointer-events-none opacity-50",Re&&"cursor-pointer",!Re&&"cursor-default",t.contentClassName,k),ze={title:t.title,"aria-label":t.ariaLabel,"aria-current":we?"page":void 0,"aria-expanded":ye&&ke?Ne:void 0,className:Pe,style:{...I,...t.contentStyle}},Ge=l.jsx(l.Fragment,{children:t.href?l.jsx(Y,{...ze,href:t.href,target:t.target,rel:$l(t.target,t.rel),download:t.download,onClick:de,children:_e}):l.jsx(l.Fragment,{children:Re?l.jsx("button",{...ze,type:"button",disabled:ae,onClick:de,children:_e}):l.jsx("div",{...ze,children:_e})})});return l.jsxs("li",{role:t.role,className:O("relative",c&&"border-b border-border last:border-b-0",i&&s>0&&!r&&"pl-4",r&&"shrink-0",t.className,P),style:{...R,...t.style},children:[i&&s>0&&!r&&l.jsxs(l.Fragment,{children:[l.jsx("span",{className:"absolute left-1.5 top-0 h-full w-px bg-border"}),l.jsx("span",{className:"absolute left-1.5 top-5 h-px w-3 bg-border"})]}),T?T({item:t,index:n,depth:s,active:we,expanded:Ne,disabled:ae,hasChildren:ye,toggle:le,select:de}):Ge,ye&&!r&&Ne&&l.jsx("ul",{role:"group",className:O("mt-1 list-none space-y-1 pl-3",i&&"pl-4",t.subListClassName,E),style:{...ue,...t.subListStyle},children:We.map((Ie,ce)=>l.jsx(as,{item:Ie,index:ce,depth:s+1,isOrdered:o,showTree:i,showBullets:a,showDividers:c,interactive:u,disabled:d,variant:f,size:h,density:g,nestedMode:x,bulletVariant:y,activeItemId:b,expandedIds:w,toggleExpanded:S,selectItem:v,linkComponent:j,renderItem:T,itemClassName:P,itemContentClassName:k,bulletClassName:C,textClassName:M,iconClassName:D,badgeClassName:B,shortcutClassName:V,trailingClassName:$,subListClassName:E,separatorClassName:N,chevronClassName:L,externalIconClassName:K,itemStyle:R,itemContentStyle:I,bulletStyle:A,textStyle:z,iconStyle:F,badgeStyle:W,shortcutStyle:G,trailingStyle:Q,subListStyle:ue,separatorStyle:ge},Vn(Ie,ce,s+1)))})]})},_l=({title:e,titleIcon:t,description:n,items:s,type:r="unordered",variant:o="default",size:i="md",density:a="normal",nestedMode:c="collapse",bulletVariant:u="dot",showTree:d=!1,showBullets:f=!1,showDividers:h=!1,interactive:g=!0,fullWidth:x=!0,disabled:y=!1,activeItemId:b,defaultActiveItemId:w,onActiveChange:S,expandedIds:v,defaultExpandedIds:j=[],onExpandedChange:T,role:P,ariaLabel:k,emptyState:C,linkComponent:M,renderItem:D,className:B,headerClassName:V,listClassName:$,itemClassName:E,itemContentClassName:N,titleClassName:L,descriptionClassName:K,bulletClassName:R,textClassName:I,iconClassName:A,badgeClassName:z,shortcutClassName:F,trailingClassName:W,subListClassName:G,separatorClassName:Q,chevronClassName:ue,externalIconClassName:ge,emptyStateClassName:ve,style:We,headerStyle:ye,listStyle:ae,itemStyle:we,itemContentStyle:Me,titleStyle:je,descriptionStyle:Ne,bulletStyle:ke,textStyle:Ke,iconStyle:ee,badgeStyle:Y,shortcutStyle:$e,trailingStyle:Re,subListStyle:He,separatorStyle:le})=>{const de=r==="ordered",te=r==="inline",_e=de?"ol":"ul",[Pe,ze]=p.useState(w),[Ge,Ie]=p.useState(j),ce=b??Pe,be=v??Ge,re=p.useMemo(()=>new Set(be),[be]),at=s.filter(fe=>!fe.hidden),Lt=fe=>{const Ve=re.has(fe)?be.filter(Bt=>Bt!==fe):[...be,fe];v||Ie(Ve),T?.(Ve)},bt=(fe,Ve)=>{b===void 0&&ze(fe),S?.(fe,Ve)};return l.jsxs("div",{className:O("text-foreground",x?"w-full":"inline-block",B),style:We,children:[(e||n)&&l.jsxs("div",{className:O("mb-3 flex items-start gap-2",V),style:ye,children:[t&&l.jsx("span",{className:O("mt-0.5 shrink-0 text-foreground/70",A),style:ee,children:t}),l.jsxs("div",{className:"min-w-0",children:[e&&l.jsx("div",{className:O("truncate text-base font-semibold text-foreground",L),style:je,children:e}),n&&l.jsx("p",{className:O("mt-0.5 text-sm text-foreground/70",K),style:Ne,children:n})]})]}),at.length===0?l.jsx("div",{className:O("rounded-md border border-dashed border-border px-3 py-4 text-sm text-foreground/70",ve),children:C??"No items to show."}):l.jsx(_e,{role:P,"aria-label":k,className:O(te?"flex list-none flex-wrap gap-2 p-0":de?"list-decimal space-y-1 pl-5":"list-none space-y-1 p-0",o==="menu"&&"rounded-lg border border-border bg-popover p-1",o==="card"&&!de&&!te&&"space-y-2",$),style:ae,children:at.map((fe,Ve)=>l.jsx(as,{item:fe,index:Ve,depth:0,isInline:te,isOrdered:de,showTree:d,showBullets:f,showDividers:h,interactive:g,disabled:y,variant:o,size:i,density:a,nestedMode:c,bulletVariant:u,activeItemId:ce,expandedIds:re,toggleExpanded:Lt,selectItem:bt,linkComponent:M,renderItem:D,itemClassName:E,itemContentClassName:N,bulletClassName:R,textClassName:I,iconClassName:A,badgeClassName:z,shortcutClassName:F,trailingClassName:W,subListClassName:G,separatorClassName:Q,chevronClassName:ue,externalIconClassName:ge,itemStyle:we,itemContentStyle:Me,bulletStyle:ke,textStyle:Ke,iconStyle:ee,badgeStyle:Y,shortcutStyle:$e,trailingStyle:Re,subListStyle:He,separatorStyle:le},Vn(fe,Ve,0)))})]})},ls=p.createContext({});function cs(e){const t=p.useRef(null);return t.current===null&&(t.current=e()),t.current}const zl=typeof window<"u",$i=zl?p.useLayoutEffect:p.useEffect,dn=p.createContext(null);function us(e,t){e.indexOf(t)===-1&&e.push(t)}function en(e,t){const n=e.indexOf(t);n>-1&&e.splice(n,1)}const Oe=(e,t,n)=>n>t?t:n<e?e:n;function Ln(e,t){return t?`${e}. For more information and steps for solving, visit https://motion.dev/troubleshooting/${t}`:e}let pt=()=>{},Ue=()=>{};typeof process<"u"&&process.env?.NODE_ENV!=="production"&&(pt=(e,t,n)=>{!e&&typeof console<"u"&&console.warn(Ln(t,n))},Ue=(e,t,n)=>{if(!e)throw new Error(Ln(t,n))});const qe={},_i=e=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(e);function zi(e){return typeof e=="object"&&e!==null}const Ui=e=>/^0[^.\s]+$/u.test(e);function Wi(e){let t;return()=>(t===void 0&&(t=e()),t)}const Ce=e=>e,Ul=(e,t)=>n=>t(e(n)),At=(...e)=>e.reduce(Ul),Nt=(e,t,n)=>{const s=t-e;return s===0?1:(n-e)/s};class ds{constructor(){this.subscriptions=[]}add(t){return us(this.subscriptions,t),()=>en(this.subscriptions,t)}notify(t,n,s){const r=this.subscriptions.length;if(r)if(r===1)this.subscriptions[0](t,n,s);else for(let o=0;o<r;o++){const i=this.subscriptions[o];i&&i(t,n,s)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}const xe=e=>e*1e3,Te=e=>e/1e3;function Ki(e,t){return t?e*(1e3/t):0}const Ws=new Set;function fs(e,t,n){e||Ws.has(t)||(console.warn(Ln(t,n)),Ws.add(t))}const Hi=(e,t,n)=>(((1-3*n+3*t)*e+(3*n-6*t))*e+3*t)*e,Wl=1e-7,Kl=12;function Hl(e,t,n,s,r){let o,i,a=0;do i=t+(n-t)/2,o=Hi(i,s,r)-e,o>0?n=i:t=i;while(Math.abs(o)>Wl&&++a<Kl);return i}function Mt(e,t,n,s){if(e===t&&n===s)return Ce;const r=o=>Hl(o,0,1,e,n);return o=>o===0||o===1?o:Hi(r(o),t,s)}const Gi=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2,Yi=e=>t=>1-e(1-t),Xi=Mt(.33,1.53,.69,.99),hs=Yi(Xi),qi=Gi(hs),Zi=e=>e>=1?1:(e*=2)<1?.5*hs(e):.5*(2-Math.pow(2,-10*(e-1))),ms=e=>1-Math.sin(Math.acos(e)),Ji=Yi(ms),Qi=Gi(ms),Gl=Mt(.42,0,1,1),Yl=Mt(0,0,.58,1),eo=Mt(.42,0,.58,1),Xl=e=>Array.isArray(e)&&typeof e[0]!="number",to=e=>Array.isArray(e)&&typeof e[0]=="number",Ks={linear:Ce,easeIn:Gl,easeInOut:eo,easeOut:Yl,circIn:ms,circInOut:Qi,circOut:Ji,backIn:hs,backInOut:qi,backOut:Xi,anticipate:Zi},ql=e=>typeof e=="string",Hs=e=>{if(to(e)){Ue(e.length===4,"Cubic bezier arrays must contain four numerical values.","cubic-bezier-length");const[t,n,s,r]=e;return Mt(t,n,s,r)}else if(ql(e))return Ue(Ks[e]!==void 0,`Invalid easing type '${e}'`,"invalid-easing-type"),Ks[e];return e},Ot=["setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender"];function Zl(e,t){let n=new Set,s=new Set,r=!1,o=!1;const i=new WeakSet;let a={delta:0,timestamp:0,isProcessing:!1};function c(d){i.has(d)&&(u.schedule(d),e()),d(a)}const u={schedule:(d,f=!1,h=!1)=>{const x=h&&r?n:s;return f&&i.add(d),x.add(d),d},cancel:d=>{s.delete(d),i.delete(d)},process:d=>{if(a=d,r){o=!0;return}r=!0;const f=n;n=s,s=f,n.forEach(c),n.clear(),r=!1,o&&(o=!1,u.process(d))}};return u}const Jl=40;function no(e,t){let n=!1,s=!0;const r={delta:0,timestamp:0,isProcessing:!1},o=()=>n=!0,i=Ot.reduce((v,j)=>(v[j]=Zl(o),v),{}),{setup:a,read:c,resolveKeyframes:u,preUpdate:d,update:f,preRender:h,render:g,postRender:x}=i,y=()=>{const v=qe.useManualTiming,j=v?r.timestamp:performance.now();n=!1,v||(r.delta=s?1e3/60:Math.max(Math.min(j-r.timestamp,Jl),1)),r.timestamp=j,r.isProcessing=!0,a.process(r),c.process(r),u.process(r),d.process(r),f.process(r),h.process(r),g.process(r),x.process(r),r.isProcessing=!1,n&&t&&(s=!1,e(y))},b=()=>{n=!0,s=!0,r.isProcessing||e(y)};return{schedule:Ot.reduce((v,j)=>{const T=i[j];return v[j]=(P,k=!1,C=!1)=>(n||b(),T.schedule(P,k,C)),v},{}),cancel:v=>{for(let j=0;j<Ot.length;j++)i[Ot[j]].cancel(v)},state:r,steps:i}}const{schedule:X,cancel:Ze,state:ie,steps:bn}=no(typeof requestAnimationFrame<"u"?requestAnimationFrame:Ce,!0);let Kt;function Ql(){Kt=void 0}const he={now:()=>(Kt===void 0&&he.set(ie.isProcessing||qe.useManualTiming?ie.timestamp:performance.now()),Kt),set:e=>{Kt=e,queueMicrotask(Ql)}},so=e=>t=>typeof t=="string"&&t.startsWith(e),ro=so("--"),ec=so("var(--"),ps=e=>ec(e)?tc.test(e.split("/*")[0].trim()):!1,tc=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu;function Gs(e){return typeof e!="string"?!1:e.split("/*")[0].includes("var(--")}const gt={test:e=>typeof e=="number",parse:parseFloat,transform:e=>e},kt={...gt,transform:e=>Oe(0,1,e)},$t={...gt,default:1},jt=e=>Math.round(e*1e5)/1e5,gs=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function nc(e){return e==null}const sc=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,xs=(e,t)=>n=>!!(typeof n=="string"&&sc.test(n)&&n.startsWith(e)||t&&!nc(n)&&Object.prototype.hasOwnProperty.call(n,t)),io=(e,t,n)=>s=>{if(typeof s!="string")return s;const[r,o,i,a]=s.match(gs);return{[e]:parseFloat(r),[t]:parseFloat(o),[n]:parseFloat(i),alpha:a!==void 0?parseFloat(a):1}},rc=e=>Oe(0,255,e),vn={...gt,transform:e=>Math.round(rc(e))},st={test:xs("rgb","red"),parse:io("red","green","blue"),transform:({red:e,green:t,blue:n,alpha:s=1})=>"rgba("+vn.transform(e)+", "+vn.transform(t)+", "+vn.transform(n)+", "+jt(kt.transform(s))+")"};function ic(e){let t="",n="",s="",r="";return e.length>5?(t=e.substring(1,3),n=e.substring(3,5),s=e.substring(5,7),r=e.substring(7,9)):(t=e.substring(1,2),n=e.substring(2,3),s=e.substring(3,4),r=e.substring(4,5),t+=t,n+=n,s+=s,r+=r),{red:parseInt(t,16),green:parseInt(n,16),blue:parseInt(s,16),alpha:r?parseInt(r,16)/255:1}}const Bn={test:xs("#"),parse:ic,transform:st.transform},Rt=e=>({test:t=>typeof t=="string"&&t.endsWith(e)&&t.split(" ").length===1,parse:parseFloat,transform:t=>`${t}${e}`}),Ye=Rt("deg"),Fe=Rt("%"),_=Rt("px"),oc=Rt("vh"),ac=Rt("vw"),Ys={...Fe,parse:e=>Fe.parse(e)/100,transform:e=>Fe.transform(e*100)},ct={test:xs("hsl","hue"),parse:io("hue","saturation","lightness"),transform:({hue:e,saturation:t,lightness:n,alpha:s=1})=>"hsla("+Math.round(e)+", "+Fe.transform(jt(t))+", "+Fe.transform(jt(n))+", "+jt(kt.transform(s))+")"},ne={test:e=>st.test(e)||Bn.test(e)||ct.test(e),parse:e=>st.test(e)?st.parse(e):ct.test(e)?ct.parse(e):Bn.parse(e),transform:e=>typeof e=="string"?e:e.hasOwnProperty("red")?st.transform(e):ct.transform(e),getAnimatableNone:e=>{const t=ne.parse(e);return t.alpha=0,ne.transform(t)}},lc=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function cc(e){return isNaN(e)&&typeof e=="string"&&(e.match(gs)?.length||0)+(e.match(lc)?.length||0)>0}const oo="number",ao="color",uc="var",dc="var(",Xs="${}",fc=/var\s*\(\s*--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)|#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\)|-?(?:\d+(?:\.\d+)?|\.\d+)/giu;function ht(e){const t=e.toString(),n=[],s={color:[],number:[],var:[]},r=[];let o=0;const a=t.replace(fc,c=>(ne.test(c)?(s.color.push(o),r.push(ao),n.push(ne.parse(c))):c.startsWith(dc)?(s.var.push(o),r.push(uc),n.push(c)):(s.number.push(o),r.push(oo),n.push(parseFloat(c))),++o,Xs)).split(Xs);return{values:n,split:a,indexes:s,types:r}}function hc(e){return ht(e).values}function lo({split:e,types:t}){const n=e.length;return s=>{let r="";for(let o=0;o<n;o++)if(r+=e[o],s[o]!==void 0){const i=t[o];i===oo?r+=jt(s[o]):i===ao?r+=ne.transform(s[o]):r+=s[o]}return r}}function mc(e){return lo(ht(e))}const pc=e=>typeof e=="number"?0:ne.test(e)?ne.getAnimatableNone(e):e,gc=(e,t)=>typeof e=="number"?t?.trim().endsWith("/")?e:0:pc(e);function xc(e){const t=ht(e);return lo(t)(t.values.map((s,r)=>gc(s,t.split[r])))}const Ae={test:cc,parse:hc,createTransformer:mc,getAnimatableNone:xc};function wn(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?e+(t-e)*6*n:n<1/2?t:n<2/3?e+(t-e)*(2/3-n)*6:e}function yc({hue:e,saturation:t,lightness:n,alpha:s}){e/=360,t/=100,n/=100;let r=0,o=0,i=0;if(!t)r=o=i=n;else{const a=n<.5?n*(1+t):n+t-n*t,c=2*n-a;r=wn(c,a,e+1/3),o=wn(c,a,e),i=wn(c,a,e-1/3)}return{red:Math.round(r*255),green:Math.round(o*255),blue:Math.round(i*255),alpha:s}}function tn(e,t){return n=>n>0?t:e}const Z=(e,t,n)=>e+(t-e)*n,jn=(e,t,n)=>{const s=e*e,r=n*(t*t-s)+s;return r<0?0:Math.sqrt(r)},bc=[Bn,st,ct],vc=e=>bc.find(t=>t.test(e));function qs(e){const t=vc(e);if(pt(!!t,`'${e}' is not an animatable color. Use the equivalent color code instead.`,"color-not-animatable"),!t)return!1;let n=t.parse(e);return t===ct&&(n=yc(n)),n}const Zs=(e,t)=>{const n=qs(e),s=qs(t);if(!n||!s)return tn(e,t);const r={...n};return o=>(r.red=jn(n.red,s.red,o),r.green=jn(n.green,s.green,o),r.blue=jn(n.blue,s.blue,o),r.alpha=Z(n.alpha,s.alpha,o),st.transform(r))},Fn=new Set(["none","hidden"]);function wc(e,t){return Fn.has(e)?n=>n<=0?e:t:n=>n>=1?t:e}function jc(e,t){return n=>Z(e,t,n)}function ys(e){return typeof e=="number"?jc:typeof e=="string"?ps(e)?tn:ne.test(e)?Zs:Cc:Array.isArray(e)?co:typeof e=="object"?ne.test(e)?Zs:Sc:tn}function co(e,t){const n=[...e],s=n.length,r=e.map((o,i)=>ys(o)(o,t[i]));return o=>{for(let i=0;i<s;i++)n[i]=r[i](o);return n}}function Sc(e,t){const n={...e,...t},s={};for(const r in n)e[r]!==void 0&&t[r]!==void 0&&(s[r]=ys(e[r])(e[r],t[r]));return r=>{for(const o in s)n[o]=s[o](r);return n}}function Tc(e,t){const n=[],s={color:0,var:0,number:0};for(let r=0;r<t.values.length;r++){const o=t.types[r],i=e.indexes[o][s[o]],a=e.values[i]??0;n[r]=a,s[o]++}return n}const Cc=(e,t)=>{const n=Ae.createTransformer(t),s=ht(e),r=ht(t);return s.indexes.var.length===r.indexes.var.length&&s.indexes.color.length===r.indexes.color.length&&s.indexes.number.length>=r.indexes.number.length?Fn.has(e)&&!r.values.length||Fn.has(t)&&!s.values.length?wc(e,t):At(co(Tc(s,r),r.values),n):(pt(!0,`Complex values '${e}' and '${t}' too different to mix. Ensure all colors are of the same type, and that each contains the same quantity of number and color values. Falling back to instant transition.`,"complex-values-different"),tn(e,t))};function uo(e,t,n){return typeof e=="number"&&typeof t=="number"&&typeof n=="number"?Z(e,t,n):ys(e)(e,t)}const Nc=e=>{const t=({timestamp:n})=>e(n);return{start:(n=!0)=>X.update(t,n),stop:()=>Ze(t),now:()=>ie.isProcessing?ie.timestamp:he.now()}},fo=(e,t,n=10)=>{let s="";const r=Math.max(Math.round(t/n),2);for(let o=0;o<r;o++)s+=Math.round(e(o/(r-1))*1e4)/1e4+", ";return`linear(${s.substring(0,s.length-2)})`},nn=2e4;function bs(e){let t=0;const n=50;let s=e.next(t);for(;!s.done&&t<nn;)t+=n,s=e.next(t);return t>=nn?1/0:t}function kc(e,t=100,n){const s=n({...e,keyframes:[0,t]}),r=Math.min(bs(s),nn);return{type:"keyframes",ease:o=>s.next(r*o).value/t,duration:Te(r)}}const J={stiffness:100,damping:10,mass:1,velocity:0,duration:800,bounce:.3,visualDuration:.3,restSpeed:{granular:.01,default:2},restDelta:{granular:.005,default:.5},minDuration:.01,maxDuration:10,minDamping:.05,maxDamping:1};function On(e,t){return e*Math.sqrt(1-t*t)}const Pc=12;function Dc(e,t,n){let s=n;for(let r=1;r<Pc;r++)s=s-e(s)/t(s);return s}const Sn=.001;function Ec({duration:e=J.duration,bounce:t=J.bounce,velocity:n=J.velocity,mass:s=J.mass}){let r,o;pt(e<=xe(J.maxDuration),"Spring duration must be 10 seconds or less","spring-duration-limit");let i=1-t;i=Oe(J.minDamping,J.maxDamping,i),e=Oe(J.minDuration,J.maxDuration,Te(e)),i<1?(r=u=>{const d=u*i,f=d*e,h=d-n,g=On(u,i),x=Math.exp(-f);return Sn-h/g*x},o=u=>{const f=u*i*e,h=f*n+n,g=Math.pow(i,2)*Math.pow(u,2)*e,x=Math.exp(-f),y=On(Math.pow(u,2),i);return(-r(u)+Sn>0?-1:1)*((h-g)*x)/y}):(r=u=>{const d=Math.exp(-u*e),f=(u-n)*e+1;return-Sn+d*f},o=u=>{const d=Math.exp(-u*e),f=(n-u)*(e*e);return d*f});const a=5/e,c=Dc(r,o,a);if(e=xe(e),isNaN(c))return{stiffness:J.stiffness,damping:J.damping,duration:e};{const u=Math.pow(c,2)*s;return{stiffness:u,damping:i*2*Math.sqrt(s*u),duration:e}}}const Ac=["duration","bounce"],Mc=["stiffness","damping","mass"];function Js(e,t){return t.some(n=>e[n]!==void 0)}function Rc(e){let t={velocity:J.velocity,stiffness:J.stiffness,damping:J.damping,mass:J.mass,isResolvedFromDuration:!1,...e};if(!Js(e,Mc)&&Js(e,Ac))if(t.velocity=0,e.visualDuration){const n=e.visualDuration,s=2*Math.PI/(n*1.2),r=s*s,o=2*Oe(.05,1,1-(e.bounce||0))*Math.sqrt(r);t={...t,mass:J.mass,stiffness:r,damping:o}}else{const n=Ec({...e,velocity:0});t={...t,...n,mass:J.mass},t.isResolvedFromDuration=!0}return t}function sn(e=J.visualDuration,t=J.bounce){const n=typeof e!="object"?{visualDuration:e,keyframes:[0,1],bounce:t}:e;let{restSpeed:s,restDelta:r}=n;const o=n.keyframes[0],i=n.keyframes[n.keyframes.length-1],a={done:!1,value:o},{stiffness:c,damping:u,mass:d,duration:f,velocity:h,isResolvedFromDuration:g}=Rc({...n,velocity:-Te(n.velocity||0)}),x=h||0,y=u/(2*Math.sqrt(c*d)),b=i-o,w=Te(Math.sqrt(c/d)),S=Math.abs(b)<5;s||(s=S?J.restSpeed.granular:J.restSpeed.default),r||(r=S?J.restDelta.granular:J.restDelta.default);let v,j,T,P,k,C;if(y<1)T=On(w,y),P=(x+y*w*b)/T,v=D=>{const B=Math.exp(-y*w*D);return i-B*(P*Math.sin(T*D)+b*Math.cos(T*D))},k=y*w*P+b*T,C=y*w*b-P*T,j=D=>Math.exp(-y*w*D)*(k*Math.sin(T*D)+C*Math.cos(T*D));else if(y===1){v=B=>i-Math.exp(-w*B)*(b+(x+w*b)*B);const D=x+w*b;j=B=>Math.exp(-w*B)*(w*D*B-x)}else{const D=w*Math.sqrt(y*y-1);v=E=>{const N=Math.exp(-y*w*E),L=Math.min(D*E,300);return i-N*((x+y*w*b)*Math.sinh(L)+D*b*Math.cosh(L))/D};const B=(x+y*w*b)/D,V=y*w*B-b*D,$=y*w*b-B*D;j=E=>{const N=Math.exp(-y*w*E),L=Math.min(D*E,300);return N*(V*Math.sinh(L)+$*Math.cosh(L))}}const M={calculatedDuration:g&&f||null,velocity:D=>xe(j(D)),next:D=>{if(!g&&y<1){const V=Math.exp(-y*w*D),$=Math.sin(T*D),E=Math.cos(T*D),N=i-V*(P*$+b*E),L=xe(V*(k*$+C*E));return a.done=Math.abs(L)<=s&&Math.abs(i-N)<=r,a.value=a.done?i:N,a}const B=v(D);if(g)a.done=D>=f;else{const V=xe(j(D));a.done=Math.abs(V)<=s&&Math.abs(i-B)<=r}return a.value=a.done?i:B,a},toString:()=>{const D=Math.min(bs(M),nn),B=fo(V=>M.next(D*V).value,D,30);return D+"ms "+B},toTransition:()=>{}};return M}sn.applyToOptions=e=>{const t=kc(e,100,sn);return e.ease=t.ease,e.duration=xe(t.duration),e.type="keyframes",e};const Ic=5;function ho(e,t,n){const s=Math.max(t-Ic,0);return Ki(n-e(s),t-s)}function $n({keyframes:e,velocity:t=0,power:n=.8,timeConstant:s=325,bounceDamping:r=10,bounceStiffness:o=500,modifyTarget:i,min:a,max:c,restDelta:u=.5,restSpeed:d}){const f=e[0],h={done:!1,value:f},g=C=>a!==void 0&&C<a||c!==void 0&&C>c,x=C=>a===void 0?c:c===void 0||Math.abs(a-C)<Math.abs(c-C)?a:c;let y=n*t;const b=f+y,w=i===void 0?b:i(b);w!==b&&(y=w-f);const S=C=>-y*Math.exp(-C/s),v=C=>w+S(C),j=C=>{const M=S(C),D=v(C);h.done=Math.abs(M)<=u,h.value=h.done?w:D};let T,P;const k=C=>{g(h.value)&&(T=C,P=sn({keyframes:[h.value,x(h.value)],velocity:ho(v,C,h.value),damping:r,stiffness:o,restDelta:u,restSpeed:d}))};return k(0),{calculatedDuration:null,next:C=>{let M=!1;return!P&&T===void 0&&(M=!0,j(C),k(C)),T!==void 0&&C>=T?P.next(C-T):(!M&&j(C),h)}}}function Vc(e,t,n){const s=[],r=n||qe.mix||uo,o=e.length-1;for(let i=0;i<o;i++){let a=r(e[i],e[i+1]);if(t){const c=Array.isArray(t)?t[i]||Ce:t;a=At(c,a)}s.push(a)}return s}function Lc(e,t,{clamp:n=!0,ease:s,mixer:r}={}){const o=e.length;if(Ue(o===t.length,"Both input and output ranges must be the same length","range-length"),o===1)return()=>t[0];if(o===2&&t[0]===t[1])return()=>t[1];const i=e[0]===e[1];e[0]>e[o-1]&&(e=[...e].reverse(),t=[...t].reverse());const a=Vc(t,s,r),c=a.length,u=d=>{if(i&&d<e[0])return t[0];let f=0;if(c>1)for(;f<e.length-2&&!(d<e[f+1]);f++);const h=Nt(e[f],e[f+1],d);return a[f](h)};return n?d=>u(Oe(e[0],e[o-1],d)):u}function Bc(e,t){const n=e[e.length-1];for(let s=1;s<=t;s++){const r=Nt(0,t,s);e.push(Z(n,1,r))}}function Fc(e){const t=[0];return Bc(t,e.length-1),t}function Oc(e,t){return e.map(n=>n*t)}function $c(e,t){return e.map(()=>t||eo).splice(0,e.length-1)}function ut({duration:e=300,keyframes:t,times:n,ease:s="easeInOut"}){const r=Xl(s)?s.map(Hs):Hs(s),o={done:!1,value:t[0]},i=Oc(n&&n.length===t.length?n:Fc(t),e),a=Lc(i,t,{ease:Array.isArray(r)?r:$c(t,r)});return{calculatedDuration:e,next:c=>(o.value=a(c),o.done=c>=e,o)}}const _c=e=>e!==null;function fn(e,{repeat:t,repeatType:n="loop"},s,r=1){const o=e.filter(_c),a=r<0||t&&n!=="loop"&&t%2===1?0:o.length-1;return!a||s===void 0?o[a]:s}const zc={decay:$n,inertia:$n,tween:ut,keyframes:ut,spring:sn};function mo(e){typeof e.type=="string"&&(e.type=zc[e.type])}class vs{constructor(){this.updateFinished()}get finished(){return this._finished}updateFinished(){this._finished=new Promise(t=>{this.resolve=t})}notifyFinished(){this.resolve()}then(t,n){return this.finished.then(t,n)}}const Uc=e=>e/100;class rn extends vs{constructor(t){super(),this.state="idle",this.startTime=null,this.isStopped=!1,this.currentTime=0,this.holdTime=null,this.playbackSpeed=1,this.delayState={done:!1,value:void 0},this.stop=()=>{const{motionValue:n}=this.options;n&&n.updatedAt!==he.now()&&this.tick(he.now()),this.isStopped=!0,this.state!=="idle"&&(this.teardown(),this.options.onStop?.())},this.options=t,this.initAnimation(),this.play(),t.autoplay===!1&&this.pause()}initAnimation(){const{options:t}=this;mo(t);const{type:n=ut,repeat:s=0,repeatDelay:r=0,repeatType:o,velocity:i=0}=t;let{keyframes:a}=t;const c=n||ut;process.env.NODE_ENV!=="production"&&c!==ut&&Ue(a.length<=2,`Only two keyframes currently supported with spring and inertia animations. Trying to animate ${a}`,"spring-two-frames"),c!==ut&&typeof a[0]!="number"&&(this.mixKeyframes=At(Uc,uo(a[0],a[1])),a=[0,100]);const u=c({...t,keyframes:a});o==="mirror"&&(this.mirroredGenerator=c({...t,keyframes:[...a].reverse(),velocity:-i})),u.calculatedDuration===null&&(u.calculatedDuration=bs(u));const{calculatedDuration:d}=u;this.calculatedDuration=d,this.resolvedDuration=d+r,this.totalDuration=this.resolvedDuration*(s+1)-r,this.generator=u}updateTime(t){const n=Math.round(t-this.startTime)*this.playbackSpeed;this.holdTime!==null?this.currentTime=this.holdTime:this.currentTime=n}tick(t,n=!1){const{generator:s,totalDuration:r,mixKeyframes:o,mirroredGenerator:i,resolvedDuration:a,calculatedDuration:c}=this;if(this.startTime===null)return s.next(0);const{delay:u=0,keyframes:d,repeat:f,repeatType:h,repeatDelay:g,type:x,onUpdate:y,finalKeyframe:b}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,t):this.speed<0&&(this.startTime=Math.min(t-r/this.speed,this.startTime)),n?this.currentTime=t:this.updateTime(t);const w=this.currentTime-u*(this.playbackSpeed>=0?1:-1),S=this.playbackSpeed>=0?w<0:w>r;this.currentTime=Math.max(w,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=r);let v=this.currentTime,j=s;if(f){const C=Math.min(this.currentTime,r)/a;let M=Math.floor(C),D=C%1;!D&&C>=1&&(D=1),D===1&&M--,M=Math.min(M,f+1),!!(M%2)&&(h==="reverse"?(D=1-D,g&&(D-=g/a)):h==="mirror"&&(j=i)),v=Oe(0,1,D)*a}let T;S?(this.delayState.value=d[0],T=this.delayState):T=j.next(v),o&&!S&&(T.value=o(T.value));let{done:P}=T;!S&&c!==null&&(P=this.playbackSpeed>=0?this.currentTime>=r:this.currentTime<=0);const k=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&P);return k&&x!==$n&&(T.value=fn(d,this.options,b,this.speed)),y&&y(T.value),k&&this.finish(),T}then(t,n){return this.finished.then(t,n)}get duration(){return Te(this.calculatedDuration)}get iterationDuration(){const{delay:t=0}=this.options||{};return this.duration+Te(t)}get time(){return Te(this.currentTime)}set time(t){t=xe(t),this.currentTime=t,this.startTime===null||this.holdTime!==null||this.playbackSpeed===0?this.holdTime=t:this.driver&&(this.startTime=this.driver.now()-t/this.playbackSpeed),this.driver?this.driver.start(!1):(this.startTime=0,this.state="paused",this.holdTime=t,this.tick(t))}getGeneratorVelocity(){const t=this.currentTime;if(t<=0)return this.options.velocity||0;if(this.generator.velocity)return this.generator.velocity(t);const n=this.generator.next(t).value;return ho(s=>this.generator.next(s).value,t,n)}get speed(){return this.playbackSpeed}set speed(t){const n=this.playbackSpeed!==t;n&&this.driver&&this.updateTime(he.now()),this.playbackSpeed=t,n&&this.driver&&(this.time=Te(this.currentTime))}play(){if(this.isStopped)return;const{driver:t=Nc,startTime:n}=this.options;this.driver||(this.driver=t(r=>this.tick(r))),this.options.onPlay?.();const s=this.driver.now();this.state==="finished"?(this.updateFinished(),this.startTime=s):this.holdTime!==null?this.startTime=s-this.holdTime:this.startTime||(this.startTime=n??s),this.state==="finished"&&this.speed<0&&(this.startTime+=this.calculatedDuration),this.holdTime=null,this.state="running",this.driver.start()}pause(){this.state="paused",this.updateTime(he.now()),this.holdTime=this.currentTime}complete(){this.state!=="running"&&this.play(),this.state="finished",this.holdTime=null}finish(){this.notifyFinished(),this.teardown(),this.state="finished",this.options.onComplete?.()}cancel(){this.holdTime=null,this.startTime=0,this.tick(0),this.teardown(),this.options.onCancel?.()}teardown(){this.state="idle",this.stopDriver(),this.startTime=this.holdTime=null}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(t){return this.startTime=0,this.tick(t,!0)}attachTimeline(t){return this.options.allowFlatten&&(this.options.type="keyframes",this.options.ease="linear",this.initAnimation()),this.driver?.stop(),t.observe(this)}}function Wc(e){for(let t=1;t<e.length;t++)e[t]??(e[t]=e[t-1])}const rt=e=>e*180/Math.PI,_n=e=>{const t=rt(Math.atan2(e[1],e[0]));return zn(t)},Kc={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:e=>(Math.abs(e[0])+Math.abs(e[3]))/2,rotate:_n,rotateZ:_n,skewX:e=>rt(Math.atan(e[1])),skewY:e=>rt(Math.atan(e[2])),skew:e=>(Math.abs(e[1])+Math.abs(e[2]))/2},zn=e=>(e=e%360,e<0&&(e+=360),e),Qs=_n,er=e=>Math.sqrt(e[0]*e[0]+e[1]*e[1]),tr=e=>Math.sqrt(e[4]*e[4]+e[5]*e[5]),Hc={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:er,scaleY:tr,scale:e=>(er(e)+tr(e))/2,rotateX:e=>zn(rt(Math.atan2(e[6],e[5]))),rotateY:e=>zn(rt(Math.atan2(-e[2],e[0]))),rotateZ:Qs,rotate:Qs,skewX:e=>rt(Math.atan(e[4])),skewY:e=>rt(Math.atan(e[1])),skew:e=>(Math.abs(e[1])+Math.abs(e[4]))/2};function Un(e){return e.includes("scale")?1:0}function Wn(e,t){if(!e||e==="none")return Un(t);const n=e.match(/^matrix3d\(([-\d.e\s,]+)\)$/u);let s,r;if(n)s=Hc,r=n;else{const a=e.match(/^matrix\(([-\d.e\s,]+)\)$/u);s=Kc,r=a}if(!r)return Un(t);const o=s[t],i=r[1].split(",").map(Yc);return typeof o=="function"?o(i):i[o]}const Gc=(e,t)=>{const{transform:n="none"}=getComputedStyle(e);return Wn(n,t)};function Yc(e){return parseFloat(e.trim())}const xt=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],yt=new Set(xt),nr=e=>e===gt||e===_,Xc=new Set(["x","y","z"]),qc=xt.filter(e=>!Xc.has(e));function Zc(e){const t=[];return qc.forEach(n=>{const s=e.getValue(n);s!==void 0&&(t.push([n,s.get()]),s.set(n.startsWith("scale")?1:0))}),t}const Xe={width:({x:e},{paddingLeft:t="0",paddingRight:n="0",boxSizing:s})=>{const r=e.max-e.min;return s==="border-box"?r:r-parseFloat(t)-parseFloat(n)},height:({y:e},{paddingTop:t="0",paddingBottom:n="0",boxSizing:s})=>{const r=e.max-e.min;return s==="border-box"?r:r-parseFloat(t)-parseFloat(n)},top:(e,{top:t})=>parseFloat(t),left:(e,{left:t})=>parseFloat(t),bottom:({y:e},{top:t})=>parseFloat(t)+(e.max-e.min),right:({x:e},{left:t})=>parseFloat(t)+(e.max-e.min),x:(e,{transform:t})=>Wn(t,"x"),y:(e,{transform:t})=>Wn(t,"y")};Xe.translateX=Xe.x;Xe.translateY=Xe.y;const it=new Set;let Kn=!1,Hn=!1,Gn=!1;function po(){if(Hn){const e=Array.from(it).filter(s=>s.needsMeasurement),t=new Set(e.map(s=>s.element)),n=new Map;t.forEach(s=>{const r=Zc(s);r.length&&(n.set(s,r),s.render())}),e.forEach(s=>s.measureInitialState()),t.forEach(s=>{s.render();const r=n.get(s);r&&r.forEach(([o,i])=>{s.getValue(o)?.set(i)})}),e.forEach(s=>s.measureEndState()),e.forEach(s=>{s.suspendedScrollY!==void 0&&window.scrollTo(0,s.suspendedScrollY)})}Hn=!1,Kn=!1,it.forEach(e=>e.complete(Gn)),it.clear()}function go(){it.forEach(e=>{e.readKeyframes(),e.needsMeasurement&&(Hn=!0)})}function Jc(){Gn=!0,go(),po(),Gn=!1}class ws{constructor(t,n,s,r,o,i=!1){this.state="pending",this.isAsync=!1,this.needsMeasurement=!1,this.unresolvedKeyframes=[...t],this.onComplete=n,this.name=s,this.motionValue=r,this.element=o,this.isAsync=i}scheduleResolve(){this.state="scheduled",this.isAsync?(it.add(this),Kn||(Kn=!0,X.read(go),X.resolveKeyframes(po))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:t,name:n,element:s,motionValue:r}=this;if(t[0]===null){const o=r?.get(),i=t[t.length-1];if(o!==void 0)t[0]=o;else if(s&&n){const a=s.readValue(n,i);a!=null&&(t[0]=a)}t[0]===void 0&&(t[0]=i),r&&o===void 0&&r.set(t[0])}Wc(t)}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(t=!1){this.state="complete",this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,t),it.delete(this)}cancel(){this.state==="scheduled"&&(it.delete(this),this.state="pending")}resume(){this.state==="pending"&&this.scheduleResolve()}}const Qc=e=>e.startsWith("--");function xo(e,t,n){Qc(t)?e.style.setProperty(t,n):e.style[t]=n}const eu={};function yo(e,t){const n=Wi(e);return()=>eu[t]??n()}const tu=yo(()=>window.ScrollTimeline!==void 0,"scrollTimeline"),bo=yo(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing"),wt=([e,t,n,s])=>`cubic-bezier(${e}, ${t}, ${n}, ${s})`,sr={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:wt([0,.65,.55,1]),circOut:wt([.55,0,1,.45]),backIn:wt([.31,.01,.66,-.59]),backOut:wt([.33,1.53,.69,.99])};function vo(e,t){if(e)return typeof e=="function"?bo()?fo(e,t):"ease-out":to(e)?wt(e):Array.isArray(e)?e.map(n=>vo(n,t)||sr.easeOut):sr[e]}function nu(e,t,n,{delay:s=0,duration:r=300,repeat:o=0,repeatType:i="loop",ease:a="easeOut",times:c}={},u=void 0){const d={[t]:n};c&&(d.offset=c);const f=vo(a,r);Array.isArray(f)&&(d.easing=f);const h={delay:s,duration:r,easing:Array.isArray(f)?"linear":f,fill:"both",iterations:o+1,direction:i==="reverse"?"alternate":"normal"};return u&&(h.pseudoElement=u),e.animate(d,h)}function wo(e){return typeof e=="function"&&"applyToOptions"in e}function su({type:e,...t}){return wo(e)&&bo()?e.applyToOptions(t):(t.duration??(t.duration=300),t.ease??(t.ease="easeOut"),t)}class jo extends vs{constructor(t){if(super(),this.finishedTime=null,this.isStopped=!1,this.manualStartTime=null,!t)return;const{element:n,name:s,keyframes:r,pseudoElement:o,allowFlatten:i=!1,finalKeyframe:a,onComplete:c}=t;this.isPseudoElement=!!o,this.allowFlatten=i,this.options=t,Ue(typeof t.type!="string",`Mini animate() doesn't support "type" as a string.`,"mini-spring");const u=su(t);this.animation=nu(n,s,r,u,o),u.autoplay===!1&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!o){const d=fn(r,this.options,a,this.speed);this.updateMotionValue&&this.updateMotionValue(d),xo(n,s,d),this.animation.cancel()}c?.(),this.notifyFinished()}}play(){this.isStopped||(this.manualStartTime=null,this.animation.play(),this.state==="finished"&&this.updateFinished())}pause(){this.animation.pause()}complete(){this.animation.finish?.()}cancel(){try{this.animation.cancel()}catch{}}stop(){if(this.isStopped)return;this.isStopped=!0;const{state:t}=this;t==="idle"||t==="finished"||(this.updateMotionValue?this.updateMotionValue():this.commitStyles(),this.isPseudoElement||this.cancel())}commitStyles(){const t=this.options?.element;!this.isPseudoElement&&t?.isConnected&&this.animation.commitStyles?.()}get duration(){const t=this.animation.effect?.getComputedTiming?.().duration||0;return Te(Number(t))}get iterationDuration(){const{delay:t=0}=this.options||{};return this.duration+Te(t)}get time(){return Te(Number(this.animation.currentTime)||0)}set time(t){const n=this.finishedTime!==null;this.manualStartTime=null,this.finishedTime=null,this.animation.currentTime=xe(t),n&&this.animation.pause()}get speed(){return this.animation.playbackRate}set speed(t){t<0&&(this.finishedTime=null),this.animation.playbackRate=t}get state(){return this.finishedTime!==null?"finished":this.animation.playState}get startTime(){return this.manualStartTime??Number(this.animation.startTime)}set startTime(t){this.manualStartTime=this.animation.startTime=t}attachTimeline({timeline:t,rangeStart:n,rangeEnd:s,observe:r}){return this.allowFlatten&&this.animation.effect?.updateTiming({easing:"linear"}),this.animation.onfinish=null,t&&tu()?(this.animation.timeline=t,n&&(this.animation.rangeStart=n),s&&(this.animation.rangeEnd=s),Ce):r(this)}}const So={anticipate:Zi,backInOut:qi,circInOut:Qi};function ru(e){return e in So}function iu(e){typeof e.ease=="string"&&ru(e.ease)&&(e.ease=So[e.ease])}const Tn=10;class ou extends jo{constructor(t){iu(t),mo(t),super(t),t.startTime!==void 0&&t.autoplay!==!1&&(this.startTime=t.startTime),this.options=t}updateMotionValue(t){const{motionValue:n,onUpdate:s,onComplete:r,element:o,...i}=this.options;if(!n)return;if(t!==void 0){n.set(t);return}const a=new rn({...i,autoplay:!1}),c=Math.max(Tn,he.now()-this.startTime),u=Oe(0,Tn,c-Tn),d=a.sample(c).value,{name:f}=this.options;o&&f&&xo(o,f,d),n.setWithVelocity(a.sample(Math.max(0,c-u)).value,d,u),a.stop()}}const rr=(e,t)=>t==="zIndex"?!1:!!(typeof e=="number"||Array.isArray(e)||typeof e=="string"&&(Ae.test(e)||e==="0")&&!e.startsWith("url("));function au(e){const t=e[0];if(e.length===1)return!0;for(let n=0;n<e.length;n++)if(e[n]!==t)return!0}function lu(e,t,n,s){const r=e[0];if(r===null)return!1;if(t==="display"||t==="visibility")return!0;const o=e[e.length-1],i=rr(r,t),a=rr(o,t);return pt(i===a,`You are trying to animate ${t} from "${r}" to "${o}". "${i?o:r}" is not an animatable value.`,"value-not-animatable"),!i||!a?!1:au(e)||(n==="spring"||wo(n))&&s}function Yn(e){e.duration=0,e.type="keyframes"}const To=new Set(["opacity","clipPath","filter","transform"]),cu=/^(?:oklch|oklab|lab|lch|color|color-mix|light-dark)\(/;function uu(e){for(let t=0;t<e.length;t++)if(typeof e[t]=="string"&&cu.test(e[t]))return!0;return!1}const du=new Set(["color","backgroundColor","outlineColor","fill","stroke","borderColor","borderTopColor","borderRightColor","borderBottomColor","borderLeftColor"]),fu=Wi(()=>Object.hasOwnProperty.call(Element.prototype,"animate"));function hu(e){const{motionValue:t,name:n,repeatDelay:s,repeatType:r,damping:o,type:i,keyframes:a}=e;if(!(t?.owner?.current instanceof HTMLElement))return!1;const{onUpdate:u,transformTemplate:d}=t.owner.getProps();return fu()&&n&&(To.has(n)||du.has(n)&&uu(a))&&(n!=="transform"||!d)&&!u&&!s&&r!=="mirror"&&o!==0&&i!=="inertia"}const mu=40;class pu extends vs{constructor({autoplay:t=!0,delay:n=0,type:s="keyframes",repeat:r=0,repeatDelay:o=0,repeatType:i="loop",keyframes:a,name:c,motionValue:u,element:d,...f}){super(),this.stop=()=>{this._animation&&(this._animation.stop(),this.stopTimeline?.()),this.keyframeResolver?.cancel()},this.createdAt=he.now();const h={autoplay:t,delay:n,type:s,repeat:r,repeatDelay:o,repeatType:i,name:c,motionValue:u,element:d,...f},g=d?.KeyframeResolver||ws;this.keyframeResolver=new g(a,(x,y,b)=>this.onKeyframesResolved(x,y,h,!b),c,u,d),this.keyframeResolver?.scheduleResolve()}onKeyframesResolved(t,n,s,r){this.keyframeResolver=void 0;const{name:o,type:i,velocity:a,delay:c,isHandoff:u,onUpdate:d}=s;this.resolvedAt=he.now();let f=!0;lu(t,o,i,a)||(f=!1,(qe.instantAnimations||!c)&&d?.(fn(t,s,n)),t[0]=t[t.length-1],Yn(s),s.repeat=0);const g={startTime:r?this.resolvedAt?this.resolvedAt-this.createdAt>mu?this.resolvedAt:this.createdAt:this.createdAt:void 0,finalKeyframe:n,...s,keyframes:t},x=f&&!u&&hu(g),y=g.motionValue?.owner?.current;let b;if(x)try{b=new ou({...g,element:y})}catch{b=new rn(g)}else b=new rn(g);b.finished.then(()=>{this.notifyFinished()}).catch(Ce),this.pendingTimeline&&(this.stopTimeline=b.attachTimeline(this.pendingTimeline),this.pendingTimeline=void 0),this._animation=b}get finished(){return this._animation?this.animation.finished:this._finished}then(t,n){return this.finished.finally(t).then(()=>{})}get animation(){return this._animation||(this.keyframeResolver?.resume(),Jc()),this._animation}get duration(){return this.animation.duration}get iterationDuration(){return this.animation.iterationDuration}get time(){return this.animation.time}set time(t){this.animation.time=t}get speed(){return this.animation.speed}get state(){return this.animation.state}set speed(t){this.animation.speed=t}get startTime(){return this.animation.startTime}attachTimeline(t){return this._animation?this.stopTimeline=this.animation.attachTimeline(t):this.pendingTimeline=t,()=>this.stop()}play(){this.animation.play()}pause(){this.animation.pause()}complete(){this.animation.complete()}cancel(){this._animation&&this.animation.cancel(),this.keyframeResolver?.cancel()}}function Co(e,t,n,s=0,r=1){const o=Array.from(e).sort((u,d)=>u.sortNodePosition(d)).indexOf(t),i=e.size,a=(i-1)*s;return typeof n=="function"?n(o,i):r===1?o*s:a-o*s}const gu=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function xu(e){const t=gu.exec(e);if(!t)return[,];const[,n,s,r]=t;return[`--${n??s}`,r]}const yu=4;function No(e,t,n=1){Ue(n<=yu,`Max CSS variable fallback depth detected in property "${e}". This may indicate a circular fallback dependency.`,"max-css-var-depth");const[s,r]=xu(e);if(!s)return;const o=window.getComputedStyle(t).getPropertyValue(s);if(o){const i=o.trim();return _i(i)?parseFloat(i):i}return ps(r)?No(r,t,n+1):r}const bu={type:"spring",stiffness:500,damping:25,restSpeed:10},vu=e=>({type:"spring",stiffness:550,damping:e===0?2*Math.sqrt(550):30,restSpeed:10}),wu={type:"keyframes",duration:.8},ju={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},Su=(e,{keyframes:t})=>t.length>2?wu:yt.has(e)?e.startsWith("scale")?vu(t[1]):bu:ju;function ko(e,t){if(e?.inherit&&t){const{inherit:n,...s}=e;return{...t,...s}}return e}function js(e,t){const n=e?.[t]??e?.default??e;return n!==e?ko(n,e):n}const Tu=new Set(["when","delay","delayChildren","staggerChildren","staggerDirection","repeat","repeatType","repeatDelay","from","elapsed"]);function Cu(e){for(const t in e)if(!Tu.has(t))return!0;return!1}const Ss=(e,t,n,s={},r,o)=>i=>{const a=js(s,e)||{},c=a.delay||s.delay||0;let{elapsed:u=0}=s;u=u-xe(c);const d={keyframes:Array.isArray(n)?n:[null,n],ease:"easeOut",velocity:t.getVelocity(),...a,delay:-u,onUpdate:h=>{t.set(h),a.onUpdate&&a.onUpdate(h)},onComplete:()=>{i(),a.onComplete&&a.onComplete()},name:e,motionValue:t,element:o?void 0:r};Cu(a)||Object.assign(d,Su(e,d)),d.duration&&(d.duration=xe(d.duration)),d.repeatDelay&&(d.repeatDelay=xe(d.repeatDelay)),d.from!==void 0&&(d.keyframes[0]=d.from);let f=!1;if((d.type===!1||d.duration===0&&!d.repeatDelay)&&(Yn(d),d.delay===0&&(f=!0)),(qe.instantAnimations||qe.skipAnimations||r?.shouldSkipAnimations)&&(f=!0,Yn(d),d.delay=0),d.allowFlatten=!a.type&&!a.ease,f&&!o&&t.get()!==void 0){const h=fn(d.keyframes,a);if(h!==void 0){X.update(()=>{d.onUpdate(h),d.onComplete()});return}}return a.isSync?new rn(d):new pu(d)};function ir(e){const t=[{},{}];return e?.values.forEach((n,s)=>{t[0][s]=n.get(),t[1][s]=n.getVelocity()}),t}function Ts(e,t,n,s){if(typeof t=="function"){const[r,o]=ir(s);t=t(n!==void 0?n:e.custom,r,o)}if(typeof t=="string"&&(t=e.variants&&e.variants[t]),typeof t=="function"){const[r,o]=ir(s);t=t(n!==void 0?n:e.custom,r,o)}return t}function ot(e,t,n){const s=e.getProps();return Ts(s,t,n!==void 0?n:s.custom,e)}const Po=new Set(["width","height","top","left","right","bottom",...xt]),or=30,Nu=e=>!isNaN(parseFloat(e));class ku{constructor(t,n={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=s=>{const r=he.now();if(this.updatedAt!==r&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(s),this.current!==this.prev&&(this.events.change?.notify(this.current),this.dependents))for(const o of this.dependents)o.dirty()},this.hasAnimated=!1,this.setCurrent(t),this.owner=n.owner}setCurrent(t){this.current=t,this.updatedAt=he.now(),this.canTrackVelocity===null&&t!==void 0&&(this.canTrackVelocity=Nu(this.current))}setPrevFrameValue(t=this.current){this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt}onChange(t){return process.env.NODE_ENV!=="production"&&fs(!1,'value.onChange(callback) is deprecated. Switch to value.on("change", callback).'),this.on("change",t)}on(t,n){this.events[t]||(this.events[t]=new ds);const s=this.events[t].add(n);return t==="change"?()=>{s(),X.read(()=>{this.events.change.getSize()||this.stop()})}:s}clearListeners(){for(const t in this.events)this.events[t].clear()}attach(t,n){this.passiveEffect=t,this.stopPassiveEffect=n}set(t){this.passiveEffect?this.passiveEffect(t,this.updateAndNotify):this.updateAndNotify(t)}setWithVelocity(t,n,s){this.set(n),this.prev=void 0,this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt-s}jump(t,n=!0){this.updateAndNotify(t),this.prev=t,this.prevUpdatedAt=this.prevFrameValue=void 0,n&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}dirty(){this.events.change?.notify(this.current)}addDependent(t){this.dependents||(this.dependents=new Set),this.dependents.add(t)}removeDependent(t){this.dependents&&this.dependents.delete(t)}get(){return this.current}getPrevious(){return this.prev}getVelocity(){const t=he.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||t-this.updatedAt>or)return 0;const n=Math.min(this.updatedAt-this.prevUpdatedAt,or);return Ki(parseFloat(this.current)-parseFloat(this.prevFrameValue),n)}start(t){return this.stop(),new Promise(n=>{this.hasAnimated=!0,this.animation=t(n),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){this.dependents?.clear(),this.events.destroy?.notify(),this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function mt(e,t){return new ku(e,t)}const Xn=e=>Array.isArray(e);function Pu(e,t,n){e.hasValue(t)?e.getValue(t).set(n):e.addValue(t,mt(n))}function Du(e){return Xn(e)?e[e.length-1]||0:e}function Eu(e,t){const n=ot(e,t);let{transitionEnd:s={},transition:r={},...o}=n||{};o={...o,...s};for(const i in o){const a=Du(o[i]);Pu(e,i,a)}}const oe=e=>!!(e&&e.getVelocity);function Au(e){return!!(oe(e)&&e.add)}function qn(e,t){const n=e.getValue("willChange");if(Au(n))return n.add(t);if(!n&&qe.WillChange){const s=new qe.WillChange("auto");e.addValue("willChange",s),s.add(t)}}function Cs(e){return e.replace(/([A-Z])/g,t=>`-${t.toLowerCase()}`)}const Mu="framerAppearId",Do="data-"+Cs(Mu);function Eo(e){return e.props[Do]}function Ru({protectedKeys:e,needsAnimating:t},n){const s=e.hasOwnProperty(n)&&t[n]!==!0;return t[n]=!1,s}function Ao(e,t,{delay:n=0,transitionOverride:s,type:r}={}){let{transition:o,transitionEnd:i,...a}=t;const c=e.getDefaultTransition();o=o?ko(o,c):c;const u=o?.reduceMotion;s&&(o=s);const d=[],f=r&&e.animationState&&e.animationState.getState()[r];for(const h in a){const g=e.getValue(h,e.latestValues[h]??null),x=a[h];if(x===void 0||f&&Ru(f,h))continue;const y={delay:n,...js(o||{},h)},b=g.get();if(b!==void 0&&!g.isAnimating()&&!Array.isArray(x)&&x===b&&!y.velocity){X.update(()=>g.set(x));continue}let w=!1;if(window.MotionHandoffAnimation){const j=Eo(e);if(j){const T=window.MotionHandoffAnimation(j,h,X);T!==null&&(y.startTime=T,w=!0)}}qn(e,h);const S=u??e.shouldReduceMotion;g.start(Ss(h,g,x,S&&Po.has(h)?{type:!1}:y,e,w));const v=g.animation;v&&d.push(v)}if(i){const h=()=>X.update(()=>{i&&Eu(e,i)});d.length?Promise.all(d).then(h):h()}return d}function Zn(e,t,n={}){const s=ot(e,t,n.type==="exit"?e.presenceContext?.custom:void 0);let{transition:r=e.getDefaultTransition()||{}}=s||{};n.transitionOverride&&(r=n.transitionOverride);const o=s?()=>Promise.all(Ao(e,s,n)):()=>Promise.resolve(),i=e.variantChildren&&e.variantChildren.size?(c=0)=>{const{delayChildren:u=0,staggerChildren:d,staggerDirection:f}=r;return Iu(e,t,c,u,d,f,n)}:()=>Promise.resolve(),{when:a}=r;if(a){const[c,u]=a==="beforeChildren"?[o,i]:[i,o];return c().then(()=>u())}else return Promise.all([o(),i(n.delay)])}function Iu(e,t,n=0,s=0,r=0,o=1,i){const a=[];for(const c of e.variantChildren)c.notify("AnimationStart",t),a.push(Zn(c,t,{...i,delay:n+(typeof s=="function"?0:s)+Co(e.variantChildren,c,s,r,o)}).then(()=>c.notify("AnimationComplete",t)));return Promise.all(a)}function Vu(e,t,n={}){e.notify("AnimationStart",t);let s;if(Array.isArray(t)){const r=t.map(o=>Zn(e,o,n));s=Promise.all(r)}else if(typeof t=="string")s=Zn(e,t,n);else{const r=typeof t=="function"?ot(e,t,n.custom):t;s=Promise.all(Ao(e,r,n))}return s.then(()=>{e.notify("AnimationComplete",t)})}const Lu={test:e=>e==="auto",parse:e=>e},Mo=e=>t=>t.test(e),Ro=[gt,_,Fe,Ye,ac,oc,Lu],ar=e=>Ro.find(Mo(e));function Bu(e){return typeof e=="number"?e===0:e!==null?e==="none"||e==="0"||Ui(e):!0}const Fu=new Set(["brightness","contrast","saturate","opacity"]);function Ou(e){const[t,n]=e.slice(0,-1).split("(");if(t==="drop-shadow")return e;const[s]=n.match(gs)||[];if(!s)return e;const r=n.replace(s,"");let o=Fu.has(t)?1:0;return s!==n&&(o*=100),t+"("+o+r+")"}const $u=/\b([a-z-]*)\(.*?\)/gu,Jn={...Ae,getAnimatableNone:e=>{const t=e.match($u);return t?t.map(Ou).join(" "):e}},Qn={...Ae,getAnimatableNone:e=>{const t=Ae.parse(e);return Ae.createTransformer(e)(t.map(s=>typeof s=="number"?0:typeof s=="object"?{...s,alpha:1}:s))}},lr={...gt,transform:Math.round},_u={rotate:Ye,rotateX:Ye,rotateY:Ye,rotateZ:Ye,scale:$t,scaleX:$t,scaleY:$t,scaleZ:$t,skew:Ye,skewX:Ye,skewY:Ye,distance:_,translateX:_,translateY:_,translateZ:_,x:_,y:_,z:_,perspective:_,transformPerspective:_,opacity:kt,originX:Ys,originY:Ys,originZ:_},Ns={borderWidth:_,borderTopWidth:_,borderRightWidth:_,borderBottomWidth:_,borderLeftWidth:_,borderRadius:_,borderTopLeftRadius:_,borderTopRightRadius:_,borderBottomRightRadius:_,borderBottomLeftRadius:_,width:_,maxWidth:_,height:_,maxHeight:_,top:_,right:_,bottom:_,left:_,inset:_,insetBlock:_,insetBlockStart:_,insetBlockEnd:_,insetInline:_,insetInlineStart:_,insetInlineEnd:_,padding:_,paddingTop:_,paddingRight:_,paddingBottom:_,paddingLeft:_,paddingBlock:_,paddingBlockStart:_,paddingBlockEnd:_,paddingInline:_,paddingInlineStart:_,paddingInlineEnd:_,margin:_,marginTop:_,marginRight:_,marginBottom:_,marginLeft:_,marginBlock:_,marginBlockStart:_,marginBlockEnd:_,marginInline:_,marginInlineStart:_,marginInlineEnd:_,fontSize:_,backgroundPositionX:_,backgroundPositionY:_,..._u,zIndex:lr,fillOpacity:kt,strokeOpacity:kt,numOctaves:lr},zu={...Ns,color:ne,backgroundColor:ne,outlineColor:ne,fill:ne,stroke:ne,borderColor:ne,borderTopColor:ne,borderRightColor:ne,borderBottomColor:ne,borderLeftColor:ne,filter:Jn,WebkitFilter:Jn,mask:Qn,WebkitMask:Qn},Io=e=>zu[e],Uu=new Set([Jn,Qn]);function Vo(e,t){let n=Io(e);return Uu.has(n)||(n=Ae),n.getAnimatableNone?n.getAnimatableNone(t):void 0}const Wu=new Set(["auto","none","0"]);function Ku(e,t,n){let s=0,r;for(;s<e.length&&!r;){const o=e[s];typeof o=="string"&&!Wu.has(o)&&ht(o).values.length&&(r=e[s]),s++}if(r&&n)for(const o of t)e[o]=Vo(n,r)}class Hu extends ws{constructor(t,n,s,r,o){super(t,n,s,r,o,!0)}readKeyframes(){const{unresolvedKeyframes:t,element:n,name:s}=this;if(!n||!n.current)return;super.readKeyframes();for(let d=0;d<t.length;d++){let f=t[d];if(typeof f=="string"&&(f=f.trim(),ps(f))){const h=No(f,n.current);h!==void 0&&(t[d]=h),d===t.length-1&&(this.finalKeyframe=f)}}if(this.resolveNoneKeyframes(),!Po.has(s)||t.length!==2)return;const[r,o]=t,i=ar(r),a=ar(o),c=Gs(r),u=Gs(o);if(c!==u&&Xe[s]){this.needsMeasurement=!0;return}if(i!==a)if(nr(i)&&nr(a))for(let d=0;d<t.length;d++){const f=t[d];typeof f=="string"&&(t[d]=parseFloat(f))}else Xe[s]&&(this.needsMeasurement=!0)}resolveNoneKeyframes(){const{unresolvedKeyframes:t,name:n}=this,s=[];for(let r=0;r<t.length;r++)(t[r]===null||Bu(t[r]))&&s.push(r);s.length&&Ku(t,s,n)}measureInitialState(){const{element:t,unresolvedKeyframes:n,name:s}=this;if(!t||!t.current)return;s==="height"&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=Xe[s](t.measureViewportBox(),window.getComputedStyle(t.current)),n[0]=this.measuredOrigin;const r=n[n.length-1];r!==void 0&&t.getValue(s,r).jump(r,!1)}measureEndState(){const{element:t,name:n,unresolvedKeyframes:s}=this;if(!t||!t.current)return;const r=t.getValue(n);r&&r.jump(this.measuredOrigin,!1);const o=s.length-1,i=s[o];s[o]=Xe[n](t.measureViewportBox(),window.getComputedStyle(t.current)),i!==null&&this.finalKeyframe===void 0&&(this.finalKeyframe=i),this.removedTransforms?.length&&this.removedTransforms.forEach(([a,c])=>{t.getValue(a).set(c)}),this.resolveNoneKeyframes()}}function Lo(e,t,n){if(e==null)return[];if(e instanceof EventTarget)return[e];if(typeof e=="string"){let s=document;const r=n?.[e]??s.querySelectorAll(e);return r?Array.from(r):[]}return Array.from(e).filter(s=>s!=null)}const Bo=(e,t)=>t&&typeof e=="number"?t.transform(e):e;function Ht(e){return zi(e)&&"offsetHeight"in e&&!("ownerSVGElement"in e)}const{schedule:ks}=no(queueMicrotask,!1),Ee={x:!1,y:!1};function Fo(){return Ee.x||Ee.y}function Gu(e){return e==="x"||e==="y"?Ee[e]?null:(Ee[e]=!0,()=>{Ee[e]=!1}):Ee.x||Ee.y?null:(Ee.x=Ee.y=!0,()=>{Ee.x=Ee.y=!1})}function Oo(e,t){const n=Lo(e),s=new AbortController,r={passive:!0,...t,signal:s.signal};return[n,r,()=>s.abort()]}function Yu(e){return!(e.pointerType==="touch"||Fo())}function Xu(e,t,n={}){const[s,r,o]=Oo(e,n);return s.forEach(i=>{let a=!1,c=!1,u;const d=()=>{i.removeEventListener("pointerleave",x)},f=b=>{u&&(u(b),u=void 0),d()},h=b=>{a=!1,window.removeEventListener("pointerup",h),window.removeEventListener("pointercancel",h),c&&(c=!1,f(b))},g=()=>{a=!0,window.addEventListener("pointerup",h,r),window.addEventListener("pointercancel",h,r)},x=b=>{if(b.pointerType!=="touch"){if(a){c=!0;return}f(b)}},y=b=>{if(!Yu(b))return;c=!1;const w=t(i,b);typeof w=="function"&&(u=w,i.addEventListener("pointerleave",x,r))};i.addEventListener("pointerenter",y,r),i.addEventListener("pointerdown",g,r)}),o}const $o=(e,t)=>t?e===t?!0:$o(e,t.parentElement):!1,Ps=e=>e.pointerType==="mouse"?typeof e.button!="number"||e.button<=0:e.isPrimary!==!1,qu=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function Zu(e){return qu.has(e.tagName)||e.isContentEditable===!0}const Ju=new Set(["INPUT","SELECT","TEXTAREA"]);function Qu(e){return Ju.has(e.tagName)||e.isContentEditable===!0}const Gt=new WeakSet;function cr(e){return t=>{t.key==="Enter"&&e(t)}}function Cn(e,t){e.dispatchEvent(new PointerEvent("pointer"+t,{isPrimary:!0,bubbles:!0}))}const ed=(e,t)=>{const n=e.currentTarget;if(!n)return;const s=cr(()=>{if(Gt.has(n))return;Cn(n,"down");const r=cr(()=>{Cn(n,"up")}),o=()=>Cn(n,"cancel");n.addEventListener("keyup",r,t),n.addEventListener("blur",o,t)});n.addEventListener("keydown",s,t),n.addEventListener("blur",()=>n.removeEventListener("keydown",s),t)};function ur(e){return Ps(e)&&!Fo()}const dr=new WeakSet;function td(e,t,n={}){const[s,r,o]=Oo(e,n),i=a=>{const c=a.currentTarget;if(!ur(a)||dr.has(a))return;Gt.add(c),n.stopPropagation&&dr.add(a);const u=t(c,a),d=(g,x)=>{window.removeEventListener("pointerup",f),window.removeEventListener("pointercancel",h),Gt.has(c)&&Gt.delete(c),ur(g)&&typeof u=="function"&&u(g,{success:x})},f=g=>{d(g,c===window||c===document||n.useGlobalTarget||$o(c,g.target))},h=g=>{d(g,!1)};window.addEventListener("pointerup",f,r),window.addEventListener("pointercancel",h,r)};return s.forEach(a=>{(n.useGlobalTarget?window:a).addEventListener("pointerdown",i,r),Ht(a)&&(a.addEventListener("focus",u=>ed(u,r)),!Zu(a)&&!a.hasAttribute("tabindex")&&(a.tabIndex=0))}),o}function Ds(e){return zi(e)&&"ownerSVGElement"in e}const Yt=new WeakMap;let Xt;const _o=(e,t,n)=>(s,r)=>r&&r[0]?r[0][e+"Size"]:Ds(s)&&"getBBox"in s?s.getBBox()[t]:s[n],nd=_o("inline","width","offsetWidth"),sd=_o("block","height","offsetHeight");function rd({target:e,borderBoxSize:t}){Yt.get(e)?.forEach(n=>{n(e,{get width(){return nd(e,t)},get height(){return sd(e,t)}})})}function id(e){e.forEach(rd)}function od(){typeof ResizeObserver>"u"||(Xt=new ResizeObserver(id))}function ad(e,t){Xt||od();const n=Lo(e);return n.forEach(s=>{let r=Yt.get(s);r||(r=new Set,Yt.set(s,r)),r.add(t),Xt?.observe(s)}),()=>{n.forEach(s=>{const r=Yt.get(s);r?.delete(t),r?.size||Xt?.unobserve(s)})}}const qt=new Set;let dt;function ld(){dt=()=>{const e={get width(){return window.innerWidth},get height(){return window.innerHeight}};qt.forEach(t=>t(e))},window.addEventListener("resize",dt)}function cd(e){return qt.add(e),dt||ld(),()=>{qt.delete(e),!qt.size&&typeof dt=="function"&&(window.removeEventListener("resize",dt),dt=void 0)}}function fr(e,t){return typeof e=="function"?cd(e):ad(e,t)}function ud(e){return Ds(e)&&e.tagName==="svg"}const dd=[...Ro,ne,Ae],fd=e=>dd.find(Mo(e)),hr=()=>({translate:0,scale:1,origin:0,originPoint:0}),ft=()=>({x:hr(),y:hr()}),mr=()=>({min:0,max:0}),se=()=>({x:mr(),y:mr()}),hd=new WeakMap;function hn(e){return e!==null&&typeof e=="object"&&typeof e.start=="function"}function Pt(e){return typeof e=="string"||Array.isArray(e)}const Es=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],As=["initial",...Es];function mn(e){return hn(e.animate)||As.some(t=>Pt(e[t]))}function zo(e){return!!(mn(e)||e.variants)}function md(e,t,n){for(const s in t){const r=t[s],o=n[s];if(oe(r))e.addValue(s,r);else if(oe(o))e.addValue(s,mt(r,{owner:e}));else if(o!==r)if(e.hasValue(s)){const i=e.getValue(s);i.liveStyle===!0?i.jump(r):i.hasAnimated||i.set(r)}else{const i=e.getStaticValue(s);e.addValue(s,mt(i!==void 0?i:r,{owner:e}))}}for(const s in n)t[s]===void 0&&e.removeValue(s);return t}const es={current:null},Uo={current:!1},pd=typeof window<"u";function gd(){if(Uo.current=!0,!!pd)if(window.matchMedia){const e=window.matchMedia("(prefers-reduced-motion)"),t=()=>es.current=e.matches;e.addEventListener("change",t),t()}else es.current=!1}const pr=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];let on={};function Wo(e){on=e}function xd(){return on}class yd{scrapeMotionValuesFromProps(t,n,s){return{}}constructor({parent:t,props:n,presenceContext:s,reducedMotionConfig:r,skipAnimations:o,blockInitialAnimation:i,visualState:a},c={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.shouldSkipAnimations=!1,this.values=new Map,this.KeyframeResolver=ws,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.hasBeenMounted=!1,this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.renderScheduledAt=0,this.scheduleRender=()=>{const g=he.now();this.renderScheduledAt<g&&(this.renderScheduledAt=g,X.render(this.render,!1,!0))};const{latestValues:u,renderState:d}=a;this.latestValues=u,this.baseTarget={...u},this.initialValues=n.initial?{...u}:{},this.renderState=d,this.parent=t,this.props=n,this.presenceContext=s,this.depth=t?t.depth+1:0,this.reducedMotionConfig=r,this.skipAnimationsConfig=o,this.options=c,this.blockInitialAnimation=!!i,this.isControllingVariants=mn(n),this.isVariantNode=zo(n),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(t&&t.current);const{willChange:f,...h}=this.scrapeMotionValuesFromProps(n,{},this);for(const g in h){const x=h[g];u[g]!==void 0&&oe(x)&&x.set(u[g])}}mount(t){if(this.hasBeenMounted)for(const n in this.initialValues)this.values.get(n)?.jump(this.initialValues[n]),this.latestValues[n]=this.initialValues[n];this.current=t,hd.set(t,this),this.projection&&!this.projection.instance&&this.projection.mount(t),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach((n,s)=>this.bindToMotionValue(s,n)),this.reducedMotionConfig==="never"?this.shouldReduceMotion=!1:this.reducedMotionConfig==="always"?this.shouldReduceMotion=!0:(Uo.current||gd(),this.shouldReduceMotion=es.current),process.env.NODE_ENV!=="production"&&fs(this.shouldReduceMotion!==!0,"You have Reduced Motion enabled on your device. Animations may not appear as expected.","reduced-motion-disabled"),this.shouldSkipAnimations=this.skipAnimationsConfig??!1,this.parent?.addChild(this),this.update(this.props,this.presenceContext),this.hasBeenMounted=!0}unmount(){this.projection&&this.projection.unmount(),Ze(this.notifyUpdate),Ze(this.render),this.valueSubscriptions.forEach(t=>t()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent?.removeChild(this);for(const t in this.events)this.events[t].clear();for(const t in this.features){const n=this.features[t];n&&(n.unmount(),n.isMounted=!1)}this.current=null}addChild(t){this.children.add(t),this.enteringChildren??(this.enteringChildren=new Set),this.enteringChildren.add(t)}removeChild(t){this.children.delete(t),this.enteringChildren&&this.enteringChildren.delete(t)}bindToMotionValue(t,n){if(this.valueSubscriptions.has(t)&&this.valueSubscriptions.get(t)(),n.accelerate&&To.has(t)&&this.current instanceof HTMLElement){const{factory:i,keyframes:a,times:c,ease:u,duration:d}=n.accelerate,f=new jo({element:this.current,name:t,keyframes:a,times:c,ease:u,duration:xe(d)}),h=i(f);this.valueSubscriptions.set(t,()=>{h(),f.cancel()});return}const s=yt.has(t);s&&this.onBindTransform&&this.onBindTransform();const r=n.on("change",i=>{this.latestValues[t]=i,this.props.onUpdate&&X.preRender(this.notifyUpdate),s&&this.projection&&(this.projection.isTransformDirty=!0),this.scheduleRender()});let o;typeof window<"u"&&window.MotionCheckAppearSync&&(o=window.MotionCheckAppearSync(this,t,n)),this.valueSubscriptions.set(t,()=>{r(),o&&o(),n.owner&&n.stop()})}sortNodePosition(t){return!this.current||!this.sortInstanceNodePosition||this.type!==t.type?0:this.sortInstanceNodePosition(this.current,t.current)}updateFeatures(){let t="animation";for(t in on){const n=on[t];if(!n)continue;const{isEnabled:s,Feature:r}=n;if(!this.features[t]&&r&&s(this.props)&&(this.features[t]=new r(this)),this.features[t]){const o=this.features[t];o.isMounted?o.update():(o.mount(),o.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):se()}getStaticValue(t){return this.latestValues[t]}setStaticValue(t,n){this.latestValues[t]=n}update(t,n){(t.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=t,this.prevPresenceContext=this.presenceContext,this.presenceContext=n;for(let s=0;s<pr.length;s++){const r=pr[s];this.propEventSubscriptions[r]&&(this.propEventSubscriptions[r](),delete this.propEventSubscriptions[r]);const o="on"+r,i=t[o];i&&(this.propEventSubscriptions[r]=this.on(r,i))}this.prevMotionValues=md(this,this.scrapeMotionValuesFromProps(t,this.prevProps||{},this),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue()}getProps(){return this.props}getVariant(t){return this.props.variants?this.props.variants[t]:void 0}getDefaultTransition(){return this.props.transition}getTransformPagePoint(){return this.props.transformPagePoint}getClosestVariantNode(){return this.isVariantNode?this:this.parent?this.parent.getClosestVariantNode():void 0}addVariantChild(t){const n=this.getClosestVariantNode();if(n)return n.variantChildren&&n.variantChildren.add(t),()=>n.variantChildren.delete(t)}addValue(t,n){const s=this.values.get(t);n!==s&&(s&&this.removeValue(t),this.bindToMotionValue(t,n),this.values.set(t,n),this.latestValues[t]=n.get())}removeValue(t){this.values.delete(t);const n=this.valueSubscriptions.get(t);n&&(n(),this.valueSubscriptions.delete(t)),delete this.latestValues[t],this.removeValueFromRenderState(t,this.renderState)}hasValue(t){return this.values.has(t)}getValue(t,n){if(this.props.values&&this.props.values[t])return this.props.values[t];let s=this.values.get(t);return s===void 0&&n!==void 0&&(s=mt(n===null?void 0:n,{owner:this}),this.addValue(t,s)),s}readValue(t,n){let s=this.latestValues[t]!==void 0||!this.current?this.latestValues[t]:this.getBaseTargetFromProps(this.props,t)??this.readValueFromInstance(this.current,t,this.options);return s!=null&&(typeof s=="string"&&(_i(s)||Ui(s))?s=parseFloat(s):!fd(s)&&Ae.test(n)&&(s=Vo(t,n)),this.setBaseTarget(t,oe(s)?s.get():s)),oe(s)?s.get():s}setBaseTarget(t,n){this.baseTarget[t]=n}getBaseTarget(t){const{initial:n}=this.props;let s;if(typeof n=="string"||typeof n=="object"){const o=Ts(this.props,n,this.presenceContext?.custom);o&&(s=o[t])}if(n&&s!==void 0)return s;const r=this.getBaseTargetFromProps(this.props,t);return r!==void 0&&!oe(r)?r:this.initialValues[t]!==void 0&&s===void 0?void 0:this.baseTarget[t]}on(t,n){return this.events[t]||(this.events[t]=new ds),this.events[t].add(n)}notify(t,...n){this.events[t]&&this.events[t].notify(...n)}scheduleRenderMicrotask(){ks.render(this.render)}}class Ko extends yd{constructor(){super(...arguments),this.KeyframeResolver=Hu}sortInstanceNodePosition(t,n){return t.compareDocumentPosition(n)&2?1:-1}getBaseTargetFromProps(t,n){const s=t.style;return s?s[n]:void 0}removeValueFromRenderState(t,{vars:n,style:s}){delete n[t],delete s[t]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:t}=this.props;oe(t)&&(this.childSubscription=t.on("change",n=>{this.current&&(this.current.textContent=`${n}`)}))}}class Qe{constructor(t){this.isMounted=!1,this.node=t}update(){}}function Ho({top:e,left:t,right:n,bottom:s}){return{x:{min:t,max:n},y:{min:e,max:s}}}function bd({x:e,y:t}){return{top:t.min,right:e.max,bottom:t.max,left:e.min}}function vd(e,t){if(!t)return e;const n=t({x:e.left,y:e.top}),s=t({x:e.right,y:e.bottom});return{top:n.y,left:n.x,bottom:s.y,right:s.x}}function Nn(e){return e===void 0||e===1}function ts({scale:e,scaleX:t,scaleY:n}){return!Nn(e)||!Nn(t)||!Nn(n)}function nt(e){return ts(e)||Go(e)||e.z||e.rotate||e.rotateX||e.rotateY||e.skewX||e.skewY}function Go(e){return gr(e.x)||gr(e.y)}function gr(e){return e&&e!=="0%"}function an(e,t,n){const s=e-n,r=t*s;return n+r}function xr(e,t,n,s,r){return r!==void 0&&(e=an(e,r,s)),an(e,n,s)+t}function ns(e,t=0,n=1,s,r){e.min=xr(e.min,t,n,s,r),e.max=xr(e.max,t,n,s,r)}function Yo(e,{x:t,y:n}){ns(e.x,t.translate,t.scale,t.originPoint),ns(e.y,n.translate,n.scale,n.originPoint)}const yr=.999999999999,br=1.0000000000001;function wd(e,t,n,s=!1){const r=n.length;if(!r)return;t.x=t.y=1;let o,i;for(let a=0;a<r;a++){o=n[a],i=o.projectionDelta;const{visualElement:c}=o.options;c&&c.props.style&&c.props.style.display==="contents"||(s&&o.options.layoutScroll&&o.scroll&&o!==o.root&&(Be(e.x,-o.scroll.offset.x),Be(e.y,-o.scroll.offset.y)),i&&(t.x*=i.x.scale,t.y*=i.y.scale,Yo(e,i)),s&&nt(o.latestValues)&&Zt(e,o.latestValues,o.layout?.layoutBox))}t.x<br&&t.x>yr&&(t.x=1),t.y<br&&t.y>yr&&(t.y=1)}function Be(e,t){e.min+=t,e.max+=t}function vr(e,t,n,s,r=.5){const o=Z(e.min,e.max,r);ns(e,t,n,o,s)}function wr(e,t){return typeof e=="string"?parseFloat(e)/100*(t.max-t.min):e}function Zt(e,t,n){const s=n??e;vr(e.x,wr(t.x,s.x),t.scaleX,t.scale,t.originX),vr(e.y,wr(t.y,s.y),t.scaleY,t.scale,t.originY)}function Xo(e,t){return Ho(vd(e.getBoundingClientRect(),t))}function jd(e,t,n){const s=Xo(e,n),{scroll:r}=t;return r&&(Be(s.x,r.offset.x),Be(s.y,r.offset.y)),s}const Sd={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},Td=xt.length;function Cd(e,t,n){let s="",r=!0;for(let o=0;o<Td;o++){const i=xt[o],a=e[i];if(a===void 0)continue;let c=!0;if(typeof a=="number")c=a===(i.startsWith("scale")?1:0);else{const u=parseFloat(a);c=i.startsWith("scale")?u===1:u===0}if(!c||n){const u=Bo(a,Ns[i]);if(!c){r=!1;const d=Sd[i]||i;s+=`${d}(${u}) `}n&&(t[i]=u)}}return s=s.trim(),n?s=n(t,r?"":s):r&&(s="none"),s}function Ms(e,t,n){const{style:s,vars:r,transformOrigin:o}=e;let i=!1,a=!1;for(const c in t){const u=t[c];if(yt.has(c)){i=!0;continue}else if(ro(c)){r[c]=u;continue}else{const d=Bo(u,Ns[c]);c.startsWith("origin")?(a=!0,o[c]=d):s[c]=d}}if(t.transform||(i||n?s.transform=Cd(t,e.transform,n):s.transform&&(s.transform="none")),a){const{originX:c="50%",originY:u="50%",originZ:d=0}=o;s.transformOrigin=`${c} ${u} ${d}`}}function qo(e,{style:t,vars:n},s,r){const o=e.style;let i;for(i in t)o[i]=t[i];r?.applyProjectionStyles(o,s);for(i in n)o.setProperty(i,n[i])}function jr(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}const vt={correct:(e,t)=>{if(!t.target)return e;if(typeof e=="string")if(_.test(e))e=parseFloat(e);else return e;const n=jr(e,t.target.x),s=jr(e,t.target.y);return`${n}% ${s}%`}},Nd={correct:(e,{treeScale:t,projectionDelta:n})=>{const s=e,r=Ae.parse(e);if(r.length>5)return s;const o=Ae.createTransformer(e),i=typeof r[0]!="number"?1:0,a=n.x.scale*t.x,c=n.y.scale*t.y;r[0+i]/=a,r[1+i]/=c;const u=Z(a,c,.5);return typeof r[2+i]=="number"&&(r[2+i]/=u),typeof r[3+i]=="number"&&(r[3+i]/=u),o(r)}},ss={borderRadius:{...vt,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:vt,borderTopRightRadius:vt,borderBottomLeftRadius:vt,borderBottomRightRadius:vt,boxShadow:Nd};function Zo(e,{layout:t,layoutId:n}){return yt.has(e)||e.startsWith("origin")||(t||n!==void 0)&&(!!ss[e]||e==="opacity")}function Rs(e,t,n){const s=e.style,r=t?.style,o={};if(!s)return o;for(const i in s)(oe(s[i])||r&&oe(r[i])||Zo(i,e)||n?.getValue(i)?.liveStyle!==void 0)&&(o[i]=s[i]);return o}function kd(e){return window.getComputedStyle(e)}class Pd extends Ko{constructor(){super(...arguments),this.type="html",this.renderInstance=qo}readValueFromInstance(t,n){if(yt.has(n))return this.projection?.isProjecting?Un(n):Gc(t,n);{const s=kd(t),r=(ro(n)?s.getPropertyValue(n):s[n])||0;return typeof r=="string"?r.trim():r}}measureInstanceViewportBox(t,{transformPagePoint:n}){return Xo(t,n)}build(t,n,s){Ms(t,n,s.transformTemplate)}scrapeMotionValuesFromProps(t,n,s){return Rs(t,n,s)}}const Dd={offset:"stroke-dashoffset",array:"stroke-dasharray"},Ed={offset:"strokeDashoffset",array:"strokeDasharray"};function Ad(e,t,n=1,s=0,r=!0){e.pathLength=1;const o=r?Dd:Ed;e[o.offset]=`${-s}`,e[o.array]=`${t} ${n}`}const Md=["offsetDistance","offsetPath","offsetRotate","offsetAnchor"];function Jo(e,{attrX:t,attrY:n,attrScale:s,pathLength:r,pathSpacing:o=1,pathOffset:i=0,...a},c,u,d){if(Ms(e,a,u),c){e.style.viewBox&&(e.attrs.viewBox=e.style.viewBox);return}e.attrs=e.style,e.style={};const{attrs:f,style:h}=e;f.transform&&(h.transform=f.transform,delete f.transform),(h.transform||f.transformOrigin)&&(h.transformOrigin=f.transformOrigin??"50% 50%",delete f.transformOrigin),h.transform&&(h.transformBox=d?.transformBox??"fill-box",delete f.transformBox);for(const g of Md)f[g]!==void 0&&(h[g]=f[g],delete f[g]);t!==void 0&&(f.x=t),n!==void 0&&(f.y=n),s!==void 0&&(f.scale=s),r!==void 0&&Ad(f,r,o,i,!1)}const Qo=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues","viewBox","gradientTransform","pathLength","startOffset","textLength","lengthAdjust"]),ea=e=>typeof e=="string"&&e.toLowerCase()==="svg";function Rd(e,t,n,s){qo(e,t,void 0,s);for(const r in t.attrs)e.setAttribute(Qo.has(r)?r:Cs(r),t.attrs[r])}function ta(e,t,n){const s=Rs(e,t,n);for(const r in e)if(oe(e[r])||oe(t[r])){const o=xt.indexOf(r)!==-1?"attr"+r.charAt(0).toUpperCase()+r.substring(1):r;s[o]=e[r]}return s}class Id extends Ko{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=se}getBaseTargetFromProps(t,n){return t[n]}readValueFromInstance(t,n){if(yt.has(n)){const s=Io(n);return s&&s.default||0}return n=Qo.has(n)?n:Cs(n),t.getAttribute(n)}scrapeMotionValuesFromProps(t,n,s){return ta(t,n,s)}build(t,n,s){Jo(t,n,this.isSVGTag,s.transformTemplate,s.style)}renderInstance(t,n,s,r){Rd(t,n,s,r)}mount(t){this.isSVGTag=ea(t.tagName),super.mount(t)}}const Vd=As.length;function na(e){if(!e)return;if(!e.isControllingVariants){const n=e.parent?na(e.parent)||{}:{};return e.props.initial!==void 0&&(n.initial=e.props.initial),n}const t={};for(let n=0;n<Vd;n++){const s=As[n],r=e.props[s];(Pt(r)||r===!1)&&(t[s]=r)}return t}function sa(e,t){if(!Array.isArray(t))return!1;const n=t.length;if(n!==e.length)return!1;for(let s=0;s<n;s++)if(t[s]!==e[s])return!1;return!0}const Ld=[...Es].reverse(),Bd=Es.length;function Fd(e){return t=>Promise.all(t.map(({animation:n,options:s})=>Vu(e,n,s)))}function Od(e){let t=Fd(e),n=Sr(),s=!0,r=!1;const o=u=>(d,f)=>{const h=ot(e,f,u==="exit"?e.presenceContext?.custom:void 0);if(h){const{transition:g,transitionEnd:x,...y}=h;d={...d,...y,...x}}return d};function i(u){t=u(e)}function a(u){const{props:d}=e,f=na(e.parent)||{},h=[],g=new Set;let x={},y=1/0;for(let w=0;w<Bd;w++){const S=Ld[w],v=n[S],j=d[S]!==void 0?d[S]:f[S],T=Pt(j),P=S===u?v.isActive:null;P===!1&&(y=w);let k=j===f[S]&&j!==d[S]&&T;if(k&&(s||r)&&e.manuallyAnimateOnMount&&(k=!1),v.protectedKeys={...x},!v.isActive&&P===null||!j&&!v.prevProp||hn(j)||typeof j=="boolean")continue;if(S==="exit"&&v.isActive&&P!==!0){v.prevResolvedValues&&(x={...x,...v.prevResolvedValues});continue}const C=$d(v.prevProp,j);let M=C||S===u&&v.isActive&&!k&&T||w>y&&T,D=!1;const B=Array.isArray(j)?j:[j];let V=B.reduce(o(S),{});P===!1&&(V={});const{prevResolvedValues:$={}}=v,E={...$,...V},N=R=>{M=!0,g.has(R)&&(D=!0,g.delete(R)),v.needsAnimating[R]=!0;const I=e.getValue(R);I&&(I.liveStyle=!1)};for(const R in E){const I=V[R],A=$[R];if(x.hasOwnProperty(R))continue;let z=!1;Xn(I)&&Xn(A)?z=!sa(I,A):z=I!==A,z?I!=null?N(R):g.add(R):I!==void 0&&g.has(R)?N(R):v.protectedKeys[R]=!0}v.prevProp=j,v.prevResolvedValues=V,v.isActive&&(x={...x,...V}),(s||r)&&e.blockInitialAnimation&&(M=!1);const L=k&&C;M&&(!L||D)&&h.push(...B.map(R=>{const I={type:S};if(typeof R=="string"&&(s||r)&&!L&&e.manuallyAnimateOnMount&&e.parent){const{parent:A}=e,z=ot(A,R);if(A.enteringChildren&&z){const{delayChildren:F}=z.transition||{};I.delay=Co(A.enteringChildren,e,F)}}return{animation:R,options:I}}))}if(g.size){const w={};if(typeof d.initial!="boolean"){const S=ot(e,Array.isArray(d.initial)?d.initial[0]:d.initial);S&&S.transition&&(w.transition=S.transition)}g.forEach(S=>{const v=e.getBaseTarget(S),j=e.getValue(S);j&&(j.liveStyle=!0),w[S]=v??null}),h.push({animation:w})}let b=!!h.length;return s&&(d.initial===!1||d.initial===d.animate)&&!e.manuallyAnimateOnMount&&(b=!1),s=!1,r=!1,b?t(h):Promise.resolve()}function c(u,d){if(n[u].isActive===d)return Promise.resolve();e.variantChildren?.forEach(h=>h.animationState?.setActive(u,d)),n[u].isActive=d;const f=a(u);for(const h in n)n[h].protectedKeys={};return f}return{animateChanges:a,setActive:c,setAnimateFunction:i,getState:()=>n,reset:()=>{n=Sr(),r=!0}}}function $d(e,t){return typeof t=="string"?t!==e:Array.isArray(t)?!sa(t,e):!1}function tt(e=!1){return{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function Sr(){return{animate:tt(!0),whileInView:tt(),whileHover:tt(),whileTap:tt(),whileDrag:tt(),whileFocus:tt(),exit:tt()}}function rs(e,t){e.min=t.min,e.max=t.max}function De(e,t){rs(e.x,t.x),rs(e.y,t.y)}function Tr(e,t){e.translate=t.translate,e.scale=t.scale,e.originPoint=t.originPoint,e.origin=t.origin}const ra=1e-4,_d=1-ra,zd=1+ra,ia=.01,Ud=0-ia,Wd=0+ia;function me(e){return e.max-e.min}function Kd(e,t,n){return Math.abs(e-t)<=n}function Cr(e,t,n,s=.5){e.origin=s,e.originPoint=Z(t.min,t.max,e.origin),e.scale=me(n)/me(t),e.translate=Z(n.min,n.max,e.origin)-e.originPoint,(e.scale>=_d&&e.scale<=zd||isNaN(e.scale))&&(e.scale=1),(e.translate>=Ud&&e.translate<=Wd||isNaN(e.translate))&&(e.translate=0)}function St(e,t,n,s){Cr(e.x,t.x,n.x,s?s.originX:void 0),Cr(e.y,t.y,n.y,s?s.originY:void 0)}function Nr(e,t,n,s=0){const r=s?Z(n.min,n.max,s):n.min;e.min=r+t.min,e.max=e.min+me(t)}function Hd(e,t,n,s){Nr(e.x,t.x,n.x,s?.x),Nr(e.y,t.y,n.y,s?.y)}function kr(e,t,n,s=0){const r=s?Z(n.min,n.max,s):n.min;e.min=t.min-r,e.max=e.min+me(t)}function ln(e,t,n,s){kr(e.x,t.x,n.x,s?.x),kr(e.y,t.y,n.y,s?.y)}function Pr(e,t,n,s,r){return e-=t,e=an(e,1/n,s),r!==void 0&&(e=an(e,1/r,s)),e}function Gd(e,t=0,n=1,s=.5,r,o=e,i=e){if(Fe.test(t)&&(t=parseFloat(t),t=Z(i.min,i.max,t/100)-i.min),typeof t!="number")return;let a=Z(o.min,o.max,s);e===o&&(a-=t),e.min=Pr(e.min,t,n,a,r),e.max=Pr(e.max,t,n,a,r)}function Dr(e,t,[n,s,r],o,i){Gd(e,t[n],t[s],t[r],t.scale,o,i)}const Yd=["x","scaleX","originX"],Xd=["y","scaleY","originY"];function Er(e,t,n,s){Dr(e.x,t,Yd,n?n.x:void 0,s?s.x:void 0),Dr(e.y,t,Xd,n?n.y:void 0,s?s.y:void 0)}function Ar(e){return e.translate===0&&e.scale===1}function oa(e){return Ar(e.x)&&Ar(e.y)}function Mr(e,t){return e.min===t.min&&e.max===t.max}function qd(e,t){return Mr(e.x,t.x)&&Mr(e.y,t.y)}function Rr(e,t){return Math.round(e.min)===Math.round(t.min)&&Math.round(e.max)===Math.round(t.max)}function aa(e,t){return Rr(e.x,t.x)&&Rr(e.y,t.y)}function Ir(e){return me(e.x)/me(e.y)}function Vr(e,t){return e.translate===t.translate&&e.scale===t.scale&&e.originPoint===t.originPoint}function Le(e){return[e("x"),e("y")]}function Zd(e,t,n){let s="";const r=e.x.translate/t.x,o=e.y.translate/t.y,i=n?.z||0;if((r||o||i)&&(s=`translate3d(${r}px, ${o}px, ${i}px) `),(t.x!==1||t.y!==1)&&(s+=`scale(${1/t.x}, ${1/t.y}) `),n){const{transformPerspective:u,rotate:d,rotateX:f,rotateY:h,skewX:g,skewY:x}=n;u&&(s=`perspective(${u}px) ${s}`),d&&(s+=`rotate(${d}deg) `),f&&(s+=`rotateX(${f}deg) `),h&&(s+=`rotateY(${h}deg) `),g&&(s+=`skewX(${g}deg) `),x&&(s+=`skewY(${x}deg) `)}const a=e.x.scale*t.x,c=e.y.scale*t.y;return(a!==1||c!==1)&&(s+=`scale(${a}, ${c})`),s||"none"}const la=["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"],Jd=la.length,Lr=e=>typeof e=="string"?parseFloat(e):e,Br=e=>typeof e=="number"||_.test(e);function Qd(e,t,n,s,r,o){r?(e.opacity=Z(0,n.opacity??1,ef(s)),e.opacityExit=Z(t.opacity??1,0,tf(s))):o&&(e.opacity=Z(t.opacity??1,n.opacity??1,s));for(let i=0;i<Jd;i++){const a=la[i];let c=Fr(t,a),u=Fr(n,a);if(c===void 0&&u===void 0)continue;c||(c=0),u||(u=0),c===0||u===0||Br(c)===Br(u)?(e[a]=Math.max(Z(Lr(c),Lr(u),s),0),(Fe.test(u)||Fe.test(c))&&(e[a]+="%")):e[a]=u}(t.rotate||n.rotate)&&(e.rotate=Z(t.rotate||0,n.rotate||0,s))}function Fr(e,t){return e[t]!==void 0?e[t]:e.borderRadius}const ef=ca(0,.5,Ji),tf=ca(.5,.95,Ce);function ca(e,t,n){return s=>s<e?0:s>t?1:n(Nt(e,t,s))}function nf(e,t,n){const s=oe(e)?e:mt(e);return s.start(Ss("",s,t,n)),s.animation}function Dt(e,t,n,s={passive:!0}){return e.addEventListener(t,n,s),()=>e.removeEventListener(t,n)}const sf=(e,t)=>e.depth-t.depth;class rf{constructor(){this.children=[],this.isDirty=!1}add(t){us(this.children,t),this.isDirty=!0}remove(t){en(this.children,t),this.isDirty=!0}forEach(t){this.isDirty&&this.children.sort(sf),this.isDirty=!1,this.children.forEach(t)}}function of(e,t){const n=he.now(),s=({timestamp:r})=>{const o=r-n;o>=t&&(Ze(s),e(o-t))};return X.setup(s,!0),()=>Ze(s)}function Jt(e){return oe(e)?e.get():e}class af{constructor(){this.members=[]}add(t){us(this.members,t);for(let n=this.members.length-1;n>=0;n--){const s=this.members[n];if(s===t||s===this.lead||s===this.prevLead)continue;const r=s.instance;(!r||r.isConnected===!1)&&!s.snapshot&&(en(this.members,s),s.unmount())}t.scheduleRender()}remove(t){if(en(this.members,t),t===this.prevLead&&(this.prevLead=void 0),t===this.lead){const n=this.members[this.members.length-1];n&&this.promote(n)}}relegate(t){for(let n=this.members.indexOf(t)-1;n>=0;n--){const s=this.members[n];if(s.isPresent!==!1&&s.instance?.isConnected!==!1)return this.promote(s),!0}return!1}promote(t,n){const s=this.lead;if(t!==s&&(this.prevLead=s,this.lead=t,t.show(),s)){s.updateSnapshot(),t.scheduleRender();const{layoutDependency:r}=s.options,{layoutDependency:o}=t.options;(r===void 0||r!==o)&&(t.resumeFrom=s,n&&(s.preserveOpacity=!0),s.snapshot&&(t.snapshot=s.snapshot,t.snapshot.latestValues=s.animationValues||s.latestValues),t.root?.isUpdating&&(t.isLayoutDirty=!0)),t.options.crossfade===!1&&s.hide()}}exitAnimationComplete(){this.members.forEach(t=>{t.options.onExitComplete?.(),t.resumingFrom?.options.onExitComplete?.()})}scheduleRender(){this.members.forEach(t=>t.instance&&t.scheduleRender(!1))}removeLeadSnapshot(){this.lead?.snapshot&&(this.lead.snapshot=void 0)}}const Qt={hasAnimatedSinceResize:!0,hasEverUpdated:!1},kn=["","X","Y","Z"],lf=1e3;let cf=0;function Pn(e,t,n,s){const{latestValues:r}=t;r[e]&&(n[e]=r[e],t.setStaticValue(e,0),s&&(s[e]=0))}function ua(e){if(e.hasCheckedOptimisedAppear=!0,e.root===e)return;const{visualElement:t}=e.options;if(!t)return;const n=Eo(t);if(window.MotionHasOptimisedAnimation(n,"transform")){const{layout:r,layoutId:o}=e.options;window.MotionCancelOptimisedAnimation(n,"transform",X,!(r||o))}const{parent:s}=e;s&&!s.hasCheckedOptimisedAppear&&ua(s)}function da({attachResizeListener:e,defaultParent:t,measureScroll:n,checkIsScrollRoot:s,resetTransform:r}){return class{constructor(i={},a=t?.()){this.id=cf++,this.animationId=0,this.animationCommitId=0,this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.isProjectionDirty=!1,this.isSharedProjectionDirty=!1,this.isTransformDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.hasCheckedOptimisedAppear=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.hasTreeAnimated=!1,this.layoutVersion=0,this.updateScheduled=!1,this.scheduleUpdate=()=>this.update(),this.projectionUpdateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.projectionUpdateScheduled=!1,this.nodes.forEach(ff),this.nodes.forEach(yf),this.nodes.forEach(bf),this.nodes.forEach(hf)},this.resolvedRelativeTargetAt=0,this.linkedParentVersion=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=i,this.root=a?a.root||a:this,this.path=a?[...a.path,a]:[],this.parent=a,this.depth=a?a.depth+1:0;for(let c=0;c<this.path.length;c++)this.path[c].shouldResetTransform=!0;this.root===this&&(this.nodes=new rf)}addEventListener(i,a){return this.eventHandlers.has(i)||this.eventHandlers.set(i,new ds),this.eventHandlers.get(i).add(a)}notifyListeners(i,...a){const c=this.eventHandlers.get(i);c&&c.notify(...a)}hasListeners(i){return this.eventHandlers.has(i)}mount(i){if(this.instance)return;this.isSVG=Ds(i)&&!ud(i),this.instance=i;const{layoutId:a,layout:c,visualElement:u}=this.options;if(u&&!u.current&&u.mount(i),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),this.root.hasTreeAnimated&&(c||a)&&(this.isLayoutDirty=!0),e){let d,f=0;const h=()=>this.root.updateBlockedByResize=!1;X.read(()=>{f=window.innerWidth}),e(i,()=>{const g=window.innerWidth;g!==f&&(f=g,this.root.updateBlockedByResize=!0,d&&d(),d=of(h,250),Qt.hasAnimatedSinceResize&&(Qt.hasAnimatedSinceResize=!1,this.nodes.forEach(_r)))})}a&&this.root.registerSharedNode(a,this),this.options.animate!==!1&&u&&(a||c)&&this.addEventListener("didUpdate",({delta:d,hasLayoutChanged:f,hasRelativeLayoutChanged:h,layout:g})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const x=this.options.transition||u.getDefaultTransition()||Tf,{onLayoutAnimationStart:y,onLayoutAnimationComplete:b}=u.getProps(),w=!this.targetLayout||!aa(this.targetLayout,g),S=!f&&h;if(this.options.layoutRoot||this.resumeFrom||S||f&&(w||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0);const v={...js(x,"layout"),onPlay:y,onComplete:b};(u.shouldReduceMotion||this.options.layoutRoot)&&(v.delay=0,v.type=!1),this.startAnimation(v),this.setAnimationOrigin(d,S)}else f||_r(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=g})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const i=this.getStack();i&&i.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,this.eventHandlers.clear(),Ze(this.updateProjection)}blockUpdate(){this.updateManuallyBlocked=!0}unblockUpdate(){this.updateManuallyBlocked=!1}isUpdateBlocked(){return this.updateManuallyBlocked||this.updateBlockedByResize}isTreeAnimationBlocked(){return this.isAnimationBlocked||this.parent&&this.parent.isTreeAnimationBlocked()||!1}startUpdate(){this.isUpdateBlocked()||(this.isUpdating=!0,this.nodes&&this.nodes.forEach(vf),this.animationId++)}getTransformTemplate(){const{visualElement:i}=this.options;return i&&i.getProps().transformTemplate}willUpdate(i=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&ua(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let d=0;d<this.path.length;d++){const f=this.path[d];f.shouldResetTransform=!0,(typeof f.latestValues.x=="string"||typeof f.latestValues.y=="string")&&(f.isLayoutDirty=!0),f.updateScroll("snapshot"),f.options.layoutRoot&&f.willUpdate(!1)}const{layoutId:a,layout:c}=this.options;if(a===void 0&&!c)return;const u=this.getTransformTemplate();this.prevTransformTemplateValue=u?u(this.latestValues,""):void 0,this.updateSnapshot(),i&&this.notifyListeners("willUpdate")}update(){if(this.updateScheduled=!1,this.isUpdateBlocked()){const c=this.updateBlockedByResize;this.unblockUpdate(),this.updateBlockedByResize=!1,this.clearAllSnapshots(),c&&this.nodes.forEach(pf),this.nodes.forEach(Or);return}if(this.animationId<=this.animationCommitId){this.nodes.forEach($r);return}this.animationCommitId=this.animationId,this.isUpdating?(this.isUpdating=!1,this.nodes.forEach(gf),this.nodes.forEach(xf),this.nodes.forEach(uf),this.nodes.forEach(df)):this.nodes.forEach($r),this.clearAllSnapshots();const a=he.now();ie.delta=Oe(0,1e3/60,a-ie.timestamp),ie.timestamp=a,ie.isProcessing=!0,bn.update.process(ie),bn.preRender.process(ie),bn.render.process(ie),ie.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,ks.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(mf),this.sharedNodes.forEach(wf)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,X.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){X.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure(),this.snapshot&&!me(this.snapshot.measuredBox.x)&&!me(this.snapshot.measuredBox.y)&&(this.snapshot=void 0))}updateLayout(){if(!this.instance||(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead())&&!this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let c=0;c<this.path.length;c++)this.path[c].updateScroll();const i=this.layout;this.layout=this.measure(!1),this.layoutVersion++,this.layoutCorrected||(this.layoutCorrected=se()),this.isLayoutDirty=!1,this.projectionDelta=void 0,this.notifyListeners("measure",this.layout.layoutBox);const{visualElement:a}=this.options;a&&a.notify("LayoutMeasure",this.layout.layoutBox,i?i.layoutBox:void 0)}updateScroll(i="measure"){let a=!!(this.options.layoutScroll&&this.instance);if(this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===i&&(a=!1),a&&this.instance){const c=s(this.instance);this.scroll={animationId:this.root.animationId,phase:i,isRoot:c,offset:n(this.instance),wasRoot:this.scroll?this.scroll.isRoot:c}}}resetTransform(){if(!r)return;const i=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout,a=this.projectionDelta&&!oa(this.projectionDelta),c=this.getTransformTemplate(),u=c?c(this.latestValues,""):void 0,d=u!==this.prevTransformTemplateValue;i&&this.instance&&(a||nt(this.latestValues)||d)&&(r(this.instance,u),this.shouldResetTransform=!1,this.scheduleRender())}measure(i=!0){const a=this.measurePageBox();let c=this.removeElementScroll(a);return i&&(c=this.removeTransform(c)),Cf(c),{animationId:this.root.animationId,measuredBox:a,layoutBox:c,latestValues:{},source:this.id}}measurePageBox(){const{visualElement:i}=this.options;if(!i)return se();const a=i.measureViewportBox();if(!(this.scroll?.wasRoot||this.path.some(Nf))){const{scroll:u}=this.root;u&&(Be(a.x,u.offset.x),Be(a.y,u.offset.y))}return a}removeElementScroll(i){const a=se();if(De(a,i),this.scroll?.wasRoot)return a;for(let c=0;c<this.path.length;c++){const u=this.path[c],{scroll:d,options:f}=u;u!==this.root&&d&&f.layoutScroll&&(d.wasRoot&&De(a,i),Be(a.x,d.offset.x),Be(a.y,d.offset.y))}return a}applyTransform(i,a=!1,c){const u=c||se();De(u,i);for(let d=0;d<this.path.length;d++){const f=this.path[d];!a&&f.options.layoutScroll&&f.scroll&&f!==f.root&&(Be(u.x,-f.scroll.offset.x),Be(u.y,-f.scroll.offset.y)),nt(f.latestValues)&&Zt(u,f.latestValues,f.layout?.layoutBox)}return nt(this.latestValues)&&Zt(u,this.latestValues,this.layout?.layoutBox),u}removeTransform(i){const a=se();De(a,i);for(let c=0;c<this.path.length;c++){const u=this.path[c];if(!nt(u.latestValues))continue;let d;u.instance&&(ts(u.latestValues)&&u.updateSnapshot(),d=se(),De(d,u.measurePageBox())),Er(a,u.latestValues,u.snapshot?.layoutBox,d)}return nt(this.latestValues)&&Er(a,this.latestValues),a}setTargetDelta(i){this.targetDelta=i,this.root.scheduleUpdateProjection(),this.isProjectionDirty=!0}setOptions(i){this.options={...this.options,...i,crossfade:i.crossfade!==void 0?i.crossfade:!0}}clearMeasurements(){this.scroll=void 0,this.layout=void 0,this.snapshot=void 0,this.prevTransformTemplateValue=void 0,this.targetDelta=void 0,this.target=void 0,this.isLayoutDirty=!1}forceRelativeParentToResolveTarget(){this.relativeParent&&this.relativeParent.resolvedRelativeTargetAt!==ie.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(i=!1){const a=this.getLead();this.isProjectionDirty||(this.isProjectionDirty=a.isProjectionDirty),this.isTransformDirty||(this.isTransformDirty=a.isTransformDirty),this.isSharedProjectionDirty||(this.isSharedProjectionDirty=a.isSharedProjectionDirty);const c=!!this.resumingFrom||this!==a;if(!(i||c&&this.isSharedProjectionDirty||this.isProjectionDirty||this.parent?.isProjectionDirty||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;const{layout:d,layoutId:f}=this.options;if(!this.layout||!(d||f))return;this.resolvedRelativeTargetAt=ie.timestamp;const h=this.getClosestProjectingParent();h&&this.linkedParentVersion!==h.layoutVersion&&!h.options.layoutRoot&&this.removeRelativeTarget(),!this.targetDelta&&!this.relativeTarget&&(this.options.layoutAnchor!==!1&&h&&h.layout?this.createRelativeTarget(h,this.layout.layoutBox,h.layout.layoutBox):this.removeRelativeTarget()),!(!this.relativeTarget&&!this.targetDelta)&&(this.target||(this.target=se(),this.targetWithTransforms=se()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),Hd(this.target,this.relativeTarget,this.relativeParent.target,this.options.layoutAnchor||void 0)):this.targetDelta?(this.resumingFrom?this.applyTransform(this.layout.layoutBox,!1,this.target):De(this.target,this.layout.layoutBox),Yo(this.target,this.targetDelta)):De(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget&&(this.attemptToResolveRelativeTarget=!1,this.options.layoutAnchor!==!1&&h&&!!h.resumingFrom==!!this.resumingFrom&&!h.options.layoutScroll&&h.target&&this.animationProgress!==1?this.createRelativeTarget(h,this.target,h.target):this.relativeParent=this.relativeTarget=void 0))}getClosestProjectingParent(){if(!(!this.parent||ts(this.parent.latestValues)||Go(this.parent.latestValues)))return this.parent.isProjecting()?this.parent:this.parent.getClosestProjectingParent()}isProjecting(){return!!((this.relativeTarget||this.targetDelta||this.options.layoutRoot)&&this.layout)}createRelativeTarget(i,a,c){this.relativeParent=i,this.linkedParentVersion=i.layoutVersion,this.forceRelativeParentToResolveTarget(),this.relativeTarget=se(),this.relativeTargetOrigin=se(),ln(this.relativeTargetOrigin,a,c,this.options.layoutAnchor||void 0),De(this.relativeTarget,this.relativeTargetOrigin)}removeRelativeTarget(){this.relativeParent=this.relativeTarget=void 0}calcProjection(){const i=this.getLead(),a=!!this.resumingFrom||this!==i;let c=!0;if((this.isProjectionDirty||this.parent?.isProjectionDirty)&&(c=!1),a&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(c=!1),this.resolvedRelativeTargetAt===ie.timestamp&&(c=!1),c)return;const{layout:u,layoutId:d}=this.options;if(this.isTreeAnimating=!!(this.parent&&this.parent.isTreeAnimating||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!(u||d))return;De(this.layoutCorrected,this.layout.layoutBox);const f=this.treeScale.x,h=this.treeScale.y;wd(this.layoutCorrected,this.treeScale,this.path,a),i.layout&&!i.target&&(this.treeScale.x!==1||this.treeScale.y!==1)&&(i.target=i.layout.layoutBox,i.targetWithTransforms=se());const{target:g}=i;if(!g){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():(Tr(this.prevProjectionDelta.x,this.projectionDelta.x),Tr(this.prevProjectionDelta.y,this.projectionDelta.y)),St(this.projectionDelta,this.layoutCorrected,g,this.latestValues),(this.treeScale.x!==f||this.treeScale.y!==h||!Vr(this.projectionDelta.x,this.prevProjectionDelta.x)||!Vr(this.projectionDelta.y,this.prevProjectionDelta.y))&&(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",g))}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(i=!0){if(this.options.visualElement?.scheduleRender(),i){const a=this.getStack();a&&a.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta=ft(),this.projectionDelta=ft(),this.projectionDeltaWithTransform=ft()}setAnimationOrigin(i,a=!1){const c=this.snapshot,u=c?c.latestValues:{},d={...this.latestValues},f=ft();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!a;const h=se(),g=c?c.source:void 0,x=this.layout?this.layout.source:void 0,y=g!==x,b=this.getStack(),w=!b||b.members.length<=1,S=!!(y&&!w&&this.options.crossfade===!0&&!this.path.some(Sf));this.animationProgress=0;let v;this.mixTargetDelta=j=>{const T=j/1e3;zr(f.x,i.x,T),zr(f.y,i.y,T),this.setTargetDelta(f),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(ln(h,this.layout.layoutBox,this.relativeParent.layout.layoutBox,this.options.layoutAnchor||void 0),jf(this.relativeTarget,this.relativeTargetOrigin,h,T),v&&qd(this.relativeTarget,v)&&(this.isProjectionDirty=!1),v||(v=se()),De(v,this.relativeTarget)),y&&(this.animationValues=d,Qd(d,u,this.latestValues,T,S,w)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=T},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(i){this.notifyListeners("animationStart"),this.currentAnimation?.stop(),this.resumingFrom?.currentAnimation?.stop(),this.pendingAnimation&&(Ze(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=X.update(()=>{Qt.hasAnimatedSinceResize=!0,this.motionValue||(this.motionValue=mt(0)),this.motionValue.jump(0,!1),this.currentAnimation=nf(this.motionValue,[0,1e3],{...i,velocity:0,isSync:!0,onUpdate:a=>{this.mixTargetDelta(a),i.onUpdate&&i.onUpdate(a)},onStop:()=>{},onComplete:()=>{i.onComplete&&i.onComplete(),this.completeAnimation()}}),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0);const i=this.getStack();i&&i.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(lf),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const i=this.getLead();let{targetWithTransforms:a,target:c,layout:u,latestValues:d}=i;if(!(!a||!c||!u)){if(this!==i&&this.layout&&u&&fa(this.options.animationType,this.layout.layoutBox,u.layoutBox)){c=this.target||se();const f=me(this.layout.layoutBox.x);c.x.min=i.target.x.min,c.x.max=c.x.min+f;const h=me(this.layout.layoutBox.y);c.y.min=i.target.y.min,c.y.max=c.y.min+h}De(a,c),Zt(a,d),St(this.projectionDeltaWithTransform,this.layoutCorrected,a,d)}}registerSharedNode(i,a){this.sharedNodes.has(i)||this.sharedNodes.set(i,new af),this.sharedNodes.get(i).add(a);const u=a.options.initialPromotionConfig;a.promote({transition:u?u.transition:void 0,preserveFollowOpacity:u&&u.shouldPreserveFollowOpacity?u.shouldPreserveFollowOpacity(a):void 0})}isLead(){const i=this.getStack();return i?i.lead===this:!0}getLead(){const{layoutId:i}=this.options;return i?this.getStack()?.lead||this:this}getPrevLead(){const{layoutId:i}=this.options;return i?this.getStack()?.prevLead:void 0}getStack(){const{layoutId:i}=this.options;if(i)return this.root.sharedNodes.get(i)}promote({needsReset:i,transition:a,preserveFollowOpacity:c}={}){const u=this.getStack();u&&u.promote(this,c),i&&(this.projectionDelta=void 0,this.needsReset=!0),a&&this.setOptions({transition:a})}relegate(){const i=this.getStack();return i?i.relegate(this):!1}resetSkewAndRotation(){const{visualElement:i}=this.options;if(!i)return;let a=!1;const{latestValues:c}=i;if((c.z||c.rotate||c.rotateX||c.rotateY||c.rotateZ||c.skewX||c.skewY)&&(a=!0),!a)return;const u={};c.z&&Pn("z",i,u,this.animationValues);for(let d=0;d<kn.length;d++)Pn(`rotate${kn[d]}`,i,u,this.animationValues),Pn(`skew${kn[d]}`,i,u,this.animationValues);i.render();for(const d in u)i.setStaticValue(d,u[d]),this.animationValues&&(this.animationValues[d]=u[d]);i.scheduleRender()}applyProjectionStyles(i,a){if(!this.instance||this.isSVG)return;if(!this.isVisible){i.visibility="hidden";return}const c=this.getTransformTemplate();if(this.needsReset){this.needsReset=!1,i.visibility="",i.opacity="",i.pointerEvents=Jt(a?.pointerEvents)||"",i.transform=c?c(this.latestValues,""):"none";return}const u=this.getLead();if(!this.projectionDelta||!this.layout||!u.target){this.options.layoutId&&(i.opacity=this.latestValues.opacity!==void 0?this.latestValues.opacity:1,i.pointerEvents=Jt(a?.pointerEvents)||""),this.hasProjected&&!nt(this.latestValues)&&(i.transform=c?c({},""):"none",this.hasProjected=!1);return}i.visibility="";const d=u.animationValues||u.latestValues;this.applyTransformsToTarget();let f=Zd(this.projectionDeltaWithTransform,this.treeScale,d);c&&(f=c(d,f)),i.transform=f;const{x:h,y:g}=this.projectionDelta;i.transformOrigin=`${h.origin*100}% ${g.origin*100}% 0`,u.animationValues?i.opacity=u===this?d.opacity??this.latestValues.opacity??1:this.preserveOpacity?this.latestValues.opacity:d.opacityExit:i.opacity=u===this?d.opacity!==void 0?d.opacity:"":d.opacityExit!==void 0?d.opacityExit:0;for(const x in ss){if(d[x]===void 0)continue;const{correct:y,applyTo:b,isCSSVariable:w}=ss[x],S=f==="none"?d[x]:y(d[x],u);if(b){const v=b.length;for(let j=0;j<v;j++)i[b[j]]=S}else w?this.options.visualElement.renderState.vars[x]=S:i[x]=S}this.options.layoutId&&(i.pointerEvents=u===this?Jt(a?.pointerEvents)||"":"none")}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(i=>i.currentAnimation?.stop()),this.root.nodes.forEach(Or),this.root.sharedNodes.clear()}}}function uf(e){e.updateLayout()}function df(e){const t=e.resumeFrom?.snapshot||e.snapshot;if(e.isLead()&&e.layout&&t&&e.hasListeners("didUpdate")){const{layoutBox:n,measuredBox:s}=e.layout,{animationType:r}=e.options,o=t.source!==e.layout.source;if(r==="size")Le(d=>{const f=o?t.measuredBox[d]:t.layoutBox[d],h=me(f);f.min=n[d].min,f.max=f.min+h});else if(r==="x"||r==="y"){const d=r==="x"?"y":"x";rs(o?t.measuredBox[d]:t.layoutBox[d],n[d])}else fa(r,t.layoutBox,n)&&Le(d=>{const f=o?t.measuredBox[d]:t.layoutBox[d],h=me(n[d]);f.max=f.min+h,e.relativeTarget&&!e.currentAnimation&&(e.isProjectionDirty=!0,e.relativeTarget[d].max=e.relativeTarget[d].min+h)});const i=ft();St(i,n,t.layoutBox);const a=ft();o?St(a,e.applyTransform(s,!0),t.measuredBox):St(a,n,t.layoutBox);const c=!oa(i);let u=!1;if(!e.resumeFrom){const d=e.getClosestProjectingParent();if(d&&!d.resumeFrom){const{snapshot:f,layout:h}=d;if(f&&h){const g=e.options.layoutAnchor||void 0,x=se();ln(x,t.layoutBox,f.layoutBox,g);const y=se();ln(y,n,h.layoutBox,g),aa(x,y)||(u=!0),d.options.layoutRoot&&(e.relativeTarget=y,e.relativeTargetOrigin=x,e.relativeParent=d)}}}e.notifyListeners("didUpdate",{layout:n,snapshot:t,delta:a,layoutDelta:i,hasLayoutChanged:c,hasRelativeLayoutChanged:u})}else if(e.isLead()){const{onExitComplete:n}=e.options;n&&n()}e.options.transition=void 0}function ff(e){e.parent&&(e.isProjecting()||(e.isProjectionDirty=e.parent.isProjectionDirty),e.isSharedProjectionDirty||(e.isSharedProjectionDirty=!!(e.isProjectionDirty||e.parent.isProjectionDirty||e.parent.isSharedProjectionDirty)),e.isTransformDirty||(e.isTransformDirty=e.parent.isTransformDirty))}function hf(e){e.isProjectionDirty=e.isSharedProjectionDirty=e.isTransformDirty=!1}function mf(e){e.clearSnapshot()}function Or(e){e.clearMeasurements()}function pf(e){e.isLayoutDirty=!0,e.updateLayout()}function $r(e){e.isLayoutDirty=!1}function gf(e){e.isAnimationBlocked&&e.layout&&!e.isLayoutDirty&&(e.snapshot=e.layout,e.isLayoutDirty=!0)}function xf(e){const{visualElement:t}=e.options;t&&t.getProps().onBeforeLayoutMeasure&&t.notify("BeforeLayoutMeasure"),e.resetTransform()}function _r(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0,e.isProjectionDirty=!0}function yf(e){e.resolveTargetDelta()}function bf(e){e.calcProjection()}function vf(e){e.resetSkewAndRotation()}function wf(e){e.removeLeadSnapshot()}function zr(e,t,n){e.translate=Z(t.translate,0,n),e.scale=Z(t.scale,1,n),e.origin=t.origin,e.originPoint=t.originPoint}function Ur(e,t,n,s){e.min=Z(t.min,n.min,s),e.max=Z(t.max,n.max,s)}function jf(e,t,n,s){Ur(e.x,t.x,n.x,s),Ur(e.y,t.y,n.y,s)}function Sf(e){return e.animationValues&&e.animationValues.opacityExit!==void 0}const Tf={duration:.45,ease:[.4,0,.1,1]},Wr=e=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(e),Kr=Wr("applewebkit/")&&!Wr("chrome/")?Math.round:Ce;function Hr(e){e.min=Kr(e.min),e.max=Kr(e.max)}function Cf(e){Hr(e.x),Hr(e.y)}function fa(e,t,n){return e==="position"||e==="preserve-aspect"&&!Kd(Ir(t),Ir(n),.2)}function Nf(e){return e!==e.root&&e.scroll?.wasRoot}const kf=da({attachResizeListener:(e,t)=>Dt(e,"resize",t),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body?.scrollLeft||0,y:document.documentElement.scrollTop||document.body?.scrollTop||0}),checkIsScrollRoot:()=>!0}),Dn={current:void 0},ha=da({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!Dn.current){const e=new kf({});e.mount(window),e.setOptions({layoutScroll:!0}),Dn.current=e}return Dn.current},resetTransform:(e,t)=>{e.style.transform=t!==void 0?t:"none"},checkIsScrollRoot:e=>window.getComputedStyle(e).position==="fixed"}),Is=p.createContext({transformPagePoint:e=>e,isStatic:!1,reducedMotion:"never"});function Gr(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function Pf(...e){return t=>{let n=!1;const s=e.map(r=>{const o=Gr(r,t);return!n&&typeof o=="function"&&(n=!0),o});if(n)return()=>{for(let r=0;r<s.length;r++){const o=s[r];typeof o=="function"?o():Gr(e[r],null)}}}}function Df(...e){return un.useCallback(Pf(...e),e)}class Ef extends un.Component{getSnapshotBeforeUpdate(t){const n=this.props.childRef.current;if(Ht(n)&&t.isPresent&&!this.props.isPresent&&this.props.pop!==!1){const s=n.offsetParent,r=Ht(s)&&s.offsetWidth||0,o=Ht(s)&&s.offsetHeight||0,i=getComputedStyle(n),a=this.props.sizeRef.current;a.height=parseFloat(i.height),a.width=parseFloat(i.width),a.top=n.offsetTop,a.left=n.offsetLeft,a.right=r-a.width-a.left,a.bottom=o-a.height-a.top}return null}componentDidUpdate(){}render(){return this.props.children}}function Af({children:e,isPresent:t,anchorX:n,anchorY:s,root:r,pop:o}){const i=p.useId(),a=p.useRef(null),c=p.useRef({width:0,height:0,top:0,left:0,right:0,bottom:0}),{nonce:u}=p.useContext(Is),d=e.props?.ref??e?.ref,f=Df(a,d);return p.useInsertionEffect(()=>{const{width:h,height:g,top:x,left:y,right:b,bottom:w}=c.current;if(t||o===!1||!a.current||!h||!g)return;const S=n==="left"?`left: ${y}`:`right: ${b}`,v=s==="bottom"?`bottom: ${w}`:`top: ${x}`;a.current.dataset.motionPopId=i;const j=document.createElement("style");u&&(j.nonce=u);const T=r??document.head;return T.appendChild(j),j.sheet&&j.sheet.insertRule(`
[data-motion-pop-id="${i}"] {
position: absolute !important;
width: ${h}px !important;
height: ${g}px !important;
${S}px !important;
${v}px !important;
}
`),()=>{a.current?.removeAttribute("data-motion-pop-id"),T.contains(j)&&T.removeChild(j)}},[t]),l.jsx(Ef,{isPresent:t,childRef:a,sizeRef:c,pop:o,children:o===!1?e:un.cloneElement(e,{ref:f})})}const Mf=({children:e,initial:t,isPresent:n,onExitComplete:s,custom:r,presenceAffectsLayout:o,mode:i,anchorX:a,anchorY:c,root:u})=>{const d=cs(Rf),f=p.useId();let h=!0,g=p.useMemo(()=>(h=!1,{id:f,initial:t,isPresent:n,custom:r,onExitComplete:x=>{d.set(x,!0);for(const y of d.values())if(!y)return;s&&s()},register:x=>(d.set(x,!1),()=>d.delete(x))}),[n,d,s]);return o&&h&&(g={...g}),p.useMemo(()=>{d.forEach((x,y)=>d.set(y,!1))},[n]),un.useEffect(()=>{!n&&!d.size&&s&&s()},[n]),e=l.jsx(Af,{pop:i==="popLayout",isPresent:n,anchorX:a,anchorY:c,root:u,children:e}),l.jsx(dn.Provider,{value:g,children:e})};function Rf(){return new Map}function ma(e=!0){const t=p.useContext(dn);if(t===null)return[!0,null];const{isPresent:n,onExitComplete:s,register:r}=t,o=p.useId();p.useEffect(()=>{if(e)return r(o)},[e]);const i=p.useCallback(()=>e&&s&&s(o),[o,s,e]);return!n&&s?[!1,i]:[!0]}const _t=e=>e.key||"";function Yr(e){const t=[];return p.Children.forEach(e,n=>{p.isValidElement(n)&&t.push(n)}),t}const It=({children:e,custom:t,initial:n=!0,onExitComplete:s,presenceAffectsLayout:r=!0,mode:o="sync",propagate:i=!1,anchorX:a="left",anchorY:c="top",root:u})=>{const[d,f]=ma(i),h=p.useMemo(()=>Yr(e),[e]),g=i&&!d?[]:h.map(_t),x=p.useRef(!0),y=p.useRef(h),b=cs(()=>new Map),w=p.useRef(new Set),[S,v]=p.useState(h),[j,T]=p.useState(h);$i(()=>{x.current=!1,y.current=h;for(let C=0;C<j.length;C++){const M=_t(j[C]);g.includes(M)?(b.delete(M),w.current.delete(M)):b.get(M)!==!0&&b.set(M,!1)}},[j,g.length,g.join("-")]);const P=[];if(h!==S){let C=[...h];for(let M=0;M<j.length;M++){const D=j[M],B=_t(D);g.includes(B)||(C.splice(M,0,D),P.push(D))}return o==="wait"&&P.length&&(C=P),T(Yr(C)),v(h),null}process.env.NODE_ENV!=="production"&&o==="wait"&&j.length>1&&console.warn(`You're attempting to animate multiple children within AnimatePresence, but its mode is set to "wait". This will lead to odd visual behaviour.`);const{forceRender:k}=p.useContext(ls);return l.jsx(l.Fragment,{children:j.map(C=>{const M=_t(C),D=i&&!d?!1:h===j||g.includes(M),B=()=>{if(w.current.has(M))return;if(b.has(M))w.current.add(M),b.set(M,!0);else return;let V=!0;b.forEach($=>{$||(V=!1)}),V&&(k?.(),T(y.current),i&&f?.(),s&&s())};return l.jsx(Mf,{isPresent:D,initial:!x.current||n?void 0:!1,custom:t,presenceAffectsLayout:r,mode:o,root:u,onExitComplete:D?void 0:B,anchorX:a,anchorY:c,children:C},M)})})},pa=p.createContext({strict:!1}),Xr={animation:["animate","variants","whileHover","whileTap","exit","whileInView","whileFocus","whileDrag"],exit:["exit"],drag:["drag","dragControls"],focus:["whileFocus"],hover:["whileHover","onHoverStart","onHoverEnd"],tap:["whileTap","onTap","onTapStart","onTapCancel"],pan:["onPan","onPanStart","onPanSessionStart","onPanEnd"],inView:["whileInView","onViewportEnter","onViewportLeave"],layout:["layout","layoutId"]};let qr=!1;function If(){if(qr)return;const e={};for(const t in Xr)e[t]={isEnabled:n=>Xr[t].some(s=>!!n[s])};Wo(e),qr=!0}function ga(){return If(),xd()}function Vf(e){const t=ga();for(const n in e)t[n]={...t[n],...e[n]};Wo(t)}const Lf=new Set(["animate","exit","variants","initial","style","values","variants","transition","transformTemplate","custom","inherit","onBeforeLayoutMeasure","onAnimationStart","onAnimationComplete","onUpdate","onDragStart","onDrag","onDragEnd","onMeasureDragConstraints","onDirectionLock","onDragTransitionEnd","_dragX","_dragY","onHoverStart","onHoverEnd","onViewportEnter","onViewportLeave","globalTapTarget","propagate","ignoreStrict","viewport"]);function cn(e){return e.startsWith("while")||e.startsWith("drag")&&e!=="draggable"||e.startsWith("layout")||e.startsWith("onTap")||e.startsWith("onPan")||e.startsWith("onLayout")||Lf.has(e)}let xa=e=>!cn(e);function Bf(e){typeof e=="function"&&(xa=t=>t.startsWith("on")?!cn(t):e(t))}try{Bf(require("@emotion/is-prop-valid").default)}catch{}function Ff(e,t,n){const s={};for(const r in e)r==="values"&&typeof e.values=="object"||oe(e[r])||(xa(r)||n===!0&&cn(r)||!t&&!cn(r)||e.draggable&&r.startsWith("onDrag"))&&(s[r]=e[r]);return s}const pn=p.createContext({});function Of(e,t){if(mn(e)){const{initial:n,animate:s}=e;return{initial:n===!1||Pt(n)?n:void 0,animate:Pt(s)?s:void 0}}return e.inherit!==!1?t:{}}function $f(e){const{initial:t,animate:n}=Of(e,p.useContext(pn));return p.useMemo(()=>({initial:t,animate:n}),[Zr(t),Zr(n)])}function Zr(e){return Array.isArray(e)?e.join(" "):e}const Vs=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function ya(e,t,n){for(const s in t)!oe(t[s])&&!Zo(s,n)&&(e[s]=t[s])}function _f({transformTemplate:e},t){return p.useMemo(()=>{const n=Vs();return Ms(n,t,e),Object.assign({},n.vars,n.style)},[t])}function zf(e,t){const n=e.style||{},s={};return ya(s,n,e),Object.assign(s,_f(e,t)),s}function Uf(e,t){const n={},s=zf(e,t);return e.drag&&e.dragListener!==!1&&(n.draggable=!1,s.userSelect=s.WebkitUserSelect=s.WebkitTouchCallout="none",s.touchAction=e.drag===!0?"none":`pan-${e.drag==="x"?"y":"x"}`),e.tabIndex===void 0&&(e.onTap||e.onTapStart||e.whileTap)&&(n.tabIndex=0),n.style=s,n}const ba=()=>({...Vs(),attrs:{}});function Wf(e,t,n,s){const r=p.useMemo(()=>{const o=ba();return Jo(o,t,ea(s),e.transformTemplate,e.style),{...o.attrs,style:{...o.style}}},[t]);if(e.style){const o={};ya(o,e.style,e),r.style={...o,...r.style}}return r}const Kf=["animate","circle","defs","desc","ellipse","g","image","line","filter","marker","mask","metadata","path","pattern","polygon","polyline","rect","stop","switch","symbol","svg","text","tspan","use","view"];function Ls(e){return typeof e!="string"||e.includes("-")?!1:!!(Kf.indexOf(e)>-1||/[A-Z]/u.test(e))}function Hf(e,t,n,{latestValues:s},r,o=!1,i){const c=(i??Ls(e)?Wf:Uf)(t,s,r,e),u=Ff(t,typeof e=="string",o),d=e!==p.Fragment?{...u,...c,ref:n}:{},{children:f}=t,h=p.useMemo(()=>oe(f)?f.get():f,[f]);return p.createElement(e,{...d,children:h})}function Gf({scrapeMotionValuesFromProps:e,createRenderState:t},n,s,r){return{latestValues:Yf(n,s,r,e),renderState:t()}}function Yf(e,t,n,s){const r={},o=s(e,{});for(const h in o)r[h]=Jt(o[h]);let{initial:i,animate:a}=e;const c=mn(e),u=zo(e);t&&u&&!c&&e.inherit!==!1&&(i===void 0&&(i=t.initial),a===void 0&&(a=t.animate));let d=n?n.initial===!1:!1;d=d||i===!1;const f=d?a:i;if(f&&typeof f!="boolean"&&!hn(f)){const h=Array.isArray(f)?f:[f];for(let g=0;g<h.length;g++){const x=Ts(e,h[g]);if(x){const{transitionEnd:y,transition:b,...w}=x;for(const S in w){let v=w[S];if(Array.isArray(v)){const j=d?v.length-1:0;v=v[j]}v!==null&&(r[S]=v)}for(const S in y)r[S]=y[S]}}}return r}const va=e=>(t,n)=>{const s=p.useContext(pn),r=p.useContext(dn),o=()=>Gf(e,t,s,r);return n?o():cs(o)},Xf=va({scrapeMotionValuesFromProps:Rs,createRenderState:Vs}),qf=va({scrapeMotionValuesFromProps:ta,createRenderState:ba}),Zf=Symbol.for("motionComponentSymbol");function Jf(e,t,n){const s=p.useRef(n);p.useInsertionEffect(()=>{s.current=n});const r=p.useRef(null);return p.useCallback(o=>{o&&e.onMount?.(o);const i=s.current;if(typeof i=="function")if(o){const a=i(o);typeof a=="function"&&(r.current=a)}else r.current?(r.current(),r.current=null):i(o);else i&&(i.current=o);t&&(o?t.mount(o):t.unmount())},[t])}const wa=p.createContext({});function lt(e){return e&&typeof e=="object"&&Object.prototype.hasOwnProperty.call(e,"current")}function Qf(e,t,n,s,r,o){const{visualElement:i}=p.useContext(pn),a=p.useContext(pa),c=p.useContext(dn),u=p.useContext(Is),d=u.reducedMotion,f=u.skipAnimations,h=p.useRef(null),g=p.useRef(!1);s=s||a.renderer,!h.current&&s&&(h.current=s(e,{visualState:t,parent:i,props:n,presenceContext:c,blockInitialAnimation:c?c.initial===!1:!1,reducedMotionConfig:d,skipAnimations:f,isSVG:o}),g.current&&h.current&&(h.current.manuallyAnimateOnMount=!0));const x=h.current,y=p.useContext(wa);x&&!x.projection&&r&&(x.type==="html"||x.type==="svg")&&eh(h.current,n,r,y);const b=p.useRef(!1);p.useInsertionEffect(()=>{x&&b.current&&x.update(n,c)});const w=n[Do],S=p.useRef(!!w&&typeof window<"u"&&!window.MotionHandoffIsComplete?.(w)&&window.MotionHasOptimisedAnimation?.(w));return $i(()=>{g.current=!0,x&&(b.current=!0,window.MotionIsMounted=!0,x.updateFeatures(),x.scheduleRenderMicrotask(),S.current&&x.animationState&&x.animationState.animateChanges())}),p.useEffect(()=>{x&&(!S.current&&x.animationState&&x.animationState.animateChanges(),S.current&&(queueMicrotask(()=>{window.MotionHandoffMarkAsComplete?.(w)}),S.current=!1),x.enteringChildren=void 0)}),x}function eh(e,t,n,s){const{layoutId:r,layout:o,drag:i,dragConstraints:a,layoutScroll:c,layoutRoot:u,layoutAnchor:d,layoutCrossfade:f}=t;e.projection=new n(e.latestValues,t["data-framer-portal-id"]?void 0:ja(e.parent)),e.projection.setOptions({layoutId:r,layout:o,alwaysMeasureLayout:!!i||a&<(a),visualElement:e,animationType:typeof o=="string"?o:"both",initialPromotionConfig:s,crossfade:f,layoutScroll:c,layoutRoot:u,layoutAnchor:d})}function ja(e){if(e)return e.options.allowProjection!==!1?e.projection:ja(e.parent)}function En(e,{forwardMotionProps:t=!1,type:n}={},s,r){s&&Vf(s);const o=n?n==="svg":Ls(e),i=o?qf:Xf;function a(u,d){let f;const h={...p.useContext(Is),...u,layoutId:th(u)},{isStatic:g}=h,x=$f(u),y=i(u,g);if(!g&&typeof window<"u"){nh(h,s);const b=sh(h);f=b.MeasureLayout,x.visualElement=Qf(e,y,h,r,b.ProjectionNode,o)}return l.jsxs(pn.Provider,{value:x,children:[f&&x.visualElement?l.jsx(f,{visualElement:x.visualElement,...h}):null,Hf(e,u,Jf(y,x.visualElement,d),y,g,t,o)]})}a.displayName=`motion.${typeof e=="string"?e:`create(${e.displayName??e.name??""})`}`;const c=p.forwardRef(a);return c[Zf]=e,c}function th({layoutId:e}){const t=p.useContext(ls).id;return t&&e!==void 0?t+"-"+e:e}function nh(e,t){const n=p.useContext(pa).strict;if(process.env.NODE_ENV!=="production"&&t&&n){const s="You have rendered a `motion` component within a `LazyMotion` component. This will break tree shaking. Import and render a `m` component instead.";e.ignoreStrict?pt(!1,s,"lazy-strict-mode"):Ue(!1,s,"lazy-strict-mode")}}function sh(e){const t=ga(),{drag:n,layout:s}=t;if(!n&&!s)return{};const r={...n,...s};return{MeasureLayout:n?.isEnabled(e)||s?.isEnabled(e)?r.MeasureLayout:void 0,ProjectionNode:r.ProjectionNode}}function rh(e,t){if(typeof Proxy>"u")return En;const n=new Map,s=(o,i)=>En(o,i,e,t),r=(o,i)=>(process.env.NODE_ENV!=="production"&&fs(!1,"motion() is deprecated. Use motion.create() instead."),s(o,i));return new Proxy(r,{get:(o,i)=>i==="create"?s:(n.has(i)||n.set(i,En(i,void 0,e,t)),n.get(i))})}const ih=(e,t)=>t.isSVG??Ls(e)?new Id(t):new Pd(t,{allowProjection:e!==p.Fragment});class oh extends Qe{constructor(t){super(t),t.animationState||(t.animationState=Od(t))}updateAnimationControlsSubscription(){const{animate:t}=this.node.getProps();hn(t)&&(this.unmountControls=t.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){const{animate:t}=this.node.getProps(),{animate:n}=this.node.prevProps||{};t!==n&&this.updateAnimationControlsSubscription()}unmount(){this.node.animationState.reset(),this.unmountControls?.()}}let ah=0;class lh extends Qe{constructor(){super(...arguments),this.id=ah++,this.isExitComplete=!1}update(){if(!this.node.presenceContext)return;const{isPresent:t,onExitComplete:n}=this.node.presenceContext,{isPresent:s}=this.node.prevPresenceContext||{};if(!this.node.animationState||t===s)return;if(t&&s===!1){if(this.isExitComplete){const{initial:o,custom:i}=this.node.getProps();if(typeof o=="string"){const a=ot(this.node,o,i);if(a){const{transition:c,transitionEnd:u,...d}=a;for(const f in d)this.node.getValue(f)?.jump(d[f])}}this.node.animationState.reset(),this.node.animationState.animateChanges()}else this.node.animationState.setActive("exit",!1);this.isExitComplete=!1;return}const r=this.node.animationState.setActive("exit",!t);n&&!t&&r.then(()=>{this.isExitComplete=!0,n(this.id)})}mount(){const{register:t,onExitComplete:n}=this.node.presenceContext||{};n&&n(this.id),t&&(this.unmount=t(this.id))}unmount(){}}const ch={animation:{Feature:oh},exit:{Feature:lh}};function Vt(e){return{point:{x:e.pageX,y:e.pageY}}}const uh=e=>t=>Ps(t)&&e(t,Vt(t));function Tt(e,t,n,s){return Dt(e,t,uh(n),s)}const Sa=({current:e})=>e?e.ownerDocument.defaultView:null,Jr=(e,t)=>Math.abs(e-t);function dh(e,t){const n=Jr(e.x,t.x),s=Jr(e.y,t.y);return Math.sqrt(n**2+s**2)}const Qr=new Set(["auto","scroll"]);class Ta{constructor(t,n,{transformPagePoint:s,contextWindow:r=window,dragSnapToOrigin:o=!1,distanceThreshold:i=3,element:a}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.lastRawMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.scrollPositions=new Map,this.removeScrollListeners=null,this.onElementScroll=g=>{this.handleScroll(g.target)},this.onWindowScroll=()=>{this.handleScroll(window)},this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;this.lastRawMoveEventInfo&&(this.lastMoveEventInfo=zt(this.lastRawMoveEventInfo,this.transformPagePoint));const g=An(this.lastMoveEventInfo,this.history),x=this.startEvent!==null,y=dh(g.offset,{x:0,y:0})>=this.distanceThreshold;if(!x&&!y)return;const{point:b}=g,{timestamp:w}=ie;this.history.push({...b,timestamp:w});const{onStart:S,onMove:v}=this.handlers;x||(S&&S(this.lastMoveEvent,g),this.startEvent=this.lastMoveEvent),v&&v(this.lastMoveEvent,g)},this.handlePointerMove=(g,x)=>{this.lastMoveEvent=g,this.lastRawMoveEventInfo=x,this.lastMoveEventInfo=zt(x,this.transformPagePoint),X.update(this.updatePoint,!0)},this.handlePointerUp=(g,x)=>{this.end();const{onEnd:y,onSessionEnd:b,resumeAnimation:w}=this.handlers;if((this.dragSnapToOrigin||!this.startEvent)&&w&&w(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const S=An(g.type==="pointercancel"?this.lastMoveEventInfo:zt(x,this.transformPagePoint),this.history);this.startEvent&&y&&y(g,S),b&&b(g,S)},!Ps(t))return;this.dragSnapToOrigin=o,this.handlers=n,this.transformPagePoint=s,this.distanceThreshold=i,this.contextWindow=r||window;const c=Vt(t),u=zt(c,this.transformPagePoint),{point:d}=u,{timestamp:f}=ie;this.history=[{...d,timestamp:f}];const{onSessionStart:h}=n;h&&h(t,An(u,this.history)),this.removeListeners=At(Tt(this.contextWindow,"pointermove",this.handlePointerMove),Tt(this.contextWindow,"pointerup",this.handlePointerUp),Tt(this.contextWindow,"pointercancel",this.handlePointerUp)),a&&this.startScrollTracking(a)}startScrollTracking(t){let n=t.parentElement;for(;n;){const s=getComputedStyle(n);(Qr.has(s.overflowX)||Qr.has(s.overflowY))&&this.scrollPositions.set(n,{x:n.scrollLeft,y:n.scrollTop}),n=n.parentElement}this.scrollPositions.set(window,{x:window.scrollX,y:window.scrollY}),window.addEventListener("scroll",this.onElementScroll,{capture:!0}),window.addEventListener("scroll",this.onWindowScroll),this.removeScrollListeners=()=>{window.removeEventListener("scroll",this.onElementScroll,{capture:!0}),window.removeEventListener("scroll",this.onWindowScroll)}}handleScroll(t){const n=this.scrollPositions.get(t);if(!n)return;const s=t===window,r=s?{x:window.scrollX,y:window.scrollY}:{x:t.scrollLeft,y:t.scrollTop},o={x:r.x-n.x,y:r.y-n.y};o.x===0&&o.y===0||(s?this.lastMoveEventInfo&&(this.lastMoveEventInfo.point.x+=o.x,this.lastMoveEventInfo.point.y+=o.y):this.history.length>0&&(this.history[0].x-=o.x,this.history[0].y-=o.y),this.scrollPositions.set(t,r),X.update(this.updatePoint,!0))}updateHandlers(t){this.handlers=t}end(){this.removeListeners&&this.removeListeners(),this.removeScrollListeners&&this.removeScrollListeners(),this.scrollPositions.clear(),Ze(this.updatePoint)}}function zt(e,t){return t?{point:t(e.point)}:e}function ei(e,t){return{x:e.x-t.x,y:e.y-t.y}}function An({point:e},t){return{point:e,delta:ei(e,Ca(t)),offset:ei(e,fh(t)),velocity:hh(t,.1)}}function fh(e){return e[0]}function Ca(e){return e[e.length-1]}function hh(e,t){if(e.length<2)return{x:0,y:0};let n=e.length-1,s=null;const r=Ca(e);for(;n>=0&&(s=e[n],!(r.timestamp-s.timestamp>xe(t)));)n--;if(!s)return{x:0,y:0};s===e[0]&&e.length>2&&r.timestamp-s.timestamp>xe(t)*2&&(s=e[1]);const o=Te(r.timestamp-s.timestamp);if(o===0)return{x:0,y:0};const i={x:(r.x-s.x)/o,y:(r.y-s.y)/o};return i.x===1/0&&(i.x=0),i.y===1/0&&(i.y=0),i}function mh(e,{min:t,max:n},s){return t!==void 0&&e<t?e=s?Z(t,e,s.min):Math.max(e,t):n!==void 0&&e>n&&(e=s?Z(n,e,s.max):Math.min(e,n)),e}function ti(e,t,n){return{min:t!==void 0?e.min+t:void 0,max:n!==void 0?e.max+n-(e.max-e.min):void 0}}function ph(e,{top:t,left:n,bottom:s,right:r}){return{x:ti(e.x,n,r),y:ti(e.y,t,s)}}function ni(e,t){let n=t.min-e.min,s=t.max-e.max;return t.max-t.min<e.max-e.min&&([n,s]=[s,n]),{min:n,max:s}}function gh(e,t){return{x:ni(e.x,t.x),y:ni(e.y,t.y)}}function xh(e,t){let n=.5;const s=me(e),r=me(t);return r>s?n=Nt(t.min,t.max-s,e.min):s>r&&(n=Nt(e.min,e.max-r,t.min)),Oe(0,1,n)}function yh(e,t){const n={};return t.min!==void 0&&(n.min=t.min-e.min),t.max!==void 0&&(n.max=t.max-e.min),n}const is=.35;function bh(e=is){return e===!1?e=0:e===!0&&(e=is),{x:si(e,"left","right"),y:si(e,"top","bottom")}}function si(e,t,n){return{min:ri(e,t),max:ri(e,n)}}function ri(e,t){return typeof e=="number"?e:e[t]||0}const vh=new WeakMap;class wh{constructor(t){this.openDragLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=se(),this.latestPointerEvent=null,this.latestPanInfo=null,this.visualElement=t}start(t,{snapToCursor:n=!1,distanceThreshold:s}={}){const{presenceContext:r}=this.visualElement;if(r&&r.isPresent===!1)return;const o=f=>{n&&this.snapToCursor(Vt(f).point),this.stopAnimation()},i=(f,h)=>{const{drag:g,dragPropagation:x,onDragStart:y}=this.getProps();if(g&&!x&&(this.openDragLock&&this.openDragLock(),this.openDragLock=Gu(g),!this.openDragLock))return;this.latestPointerEvent=f,this.latestPanInfo=h,this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),Le(w=>{let S=this.getAxisMotionValue(w).get()||0;if(Fe.test(S)){const{projection:v}=this.visualElement;if(v&&v.layout){const j=v.layout.layoutBox[w];j&&(S=me(j)*(parseFloat(S)/100))}}this.originPoint[w]=S}),y&&X.update(()=>y(f,h),!1,!0),qn(this.visualElement,"transform");const{animationState:b}=this.visualElement;b&&b.setActive("whileDrag",!0)},a=(f,h)=>{this.latestPointerEvent=f,this.latestPanInfo=h;const{dragPropagation:g,dragDirectionLock:x,onDirectionLock:y,onDrag:b}=this.getProps();if(!g&&!this.openDragLock)return;const{offset:w}=h;if(x&&this.currentDirection===null){this.currentDirection=Sh(w),this.currentDirection!==null&&y&&y(this.currentDirection);return}this.updateAxis("x",h.point,w),this.updateAxis("y",h.point,w),this.visualElement.render(),b&&X.update(()=>b(f,h),!1,!0)},c=(f,h)=>{this.latestPointerEvent=f,this.latestPanInfo=h,this.stop(f,h),this.latestPointerEvent=null,this.latestPanInfo=null},u=()=>{const{dragSnapToOrigin:f}=this.getProps();(f||this.constraints)&&this.startAnimation({x:0,y:0})},{dragSnapToOrigin:d}=this.getProps();this.panSession=new Ta(t,{onSessionStart:o,onStart:i,onMove:a,onSessionEnd:c,resumeAnimation:u},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:d,distanceThreshold:s,contextWindow:Sa(this.visualElement),element:this.visualElement.current})}stop(t,n){const s=t||this.latestPointerEvent,r=n||this.latestPanInfo,o=this.isDragging;if(this.cancel(),!o||!r||!s)return;const{velocity:i}=r;this.startAnimation(i);const{onDragEnd:a}=this.getProps();a&&X.postRender(()=>a(s,r))}cancel(){this.isDragging=!1;const{projection:t,animationState:n}=this.visualElement;t&&(t.isAnimationBlocked=!1),this.endPanSession();const{dragPropagation:s}=this.getProps();!s&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),n&&n.setActive("whileDrag",!1)}endPanSession(){this.panSession&&this.panSession.end(),this.panSession=void 0}updateAxis(t,n,s){const{drag:r}=this.getProps();if(!s||!Ut(t,r,this.currentDirection))return;const o=this.getAxisMotionValue(t);let i=this.originPoint[t]+s[t];this.constraints&&this.constraints[t]&&(i=mh(i,this.constraints[t],this.elastic[t])),o.set(i)}resolveConstraints(){const{dragConstraints:t,dragElastic:n}=this.getProps(),s=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):this.visualElement.projection?.layout,r=this.constraints;t&<(t)?this.constraints||(this.constraints=this.resolveRefConstraints()):t&&s?this.constraints=ph(s.layoutBox,t):this.constraints=!1,this.elastic=bh(n),r!==this.constraints&&!lt(t)&&s&&this.constraints&&!this.hasMutatedConstraints&&Le(o=>{this.constraints!==!1&&this.getAxisMotionValue(o)&&(this.constraints[o]=yh(s.layoutBox[o],this.constraints[o]))})}resolveRefConstraints(){const{dragConstraints:t,onMeasureDragConstraints:n}=this.getProps();if(!t||!lt(t))return!1;const s=t.current;Ue(s!==null,"If `dragConstraints` is set as a React ref, that ref must be passed to another component's `ref` prop.","drag-constraints-ref");const{projection:r}=this.visualElement;if(!r||!r.layout)return!1;const o=jd(s,r.root,this.visualElement.getTransformPagePoint());let i=gh(r.layout.layoutBox,o);if(n){const a=n(bd(i));this.hasMutatedConstraints=!!a,a&&(i=Ho(a))}return i}startAnimation(t){const{drag:n,dragMomentum:s,dragElastic:r,dragTransition:o,dragSnapToOrigin:i,onDragTransitionEnd:a}=this.getProps(),c=this.constraints||{},u=Le(d=>{if(!Ut(d,n,this.currentDirection))return;let f=c&&c[d]||{};(i===!0||i===d)&&(f={min:0,max:0});const h=r?200:1e6,g=r?40:1e7,x={type:"inertia",velocity:s?t[d]:0,bounceStiffness:h,bounceDamping:g,timeConstant:750,restDelta:1,restSpeed:10,...o,...f};return this.startAxisValueAnimation(d,x)});return Promise.all(u).then(a)}startAxisValueAnimation(t,n){const s=this.getAxisMotionValue(t);return qn(this.visualElement,t),s.start(Ss(t,s,0,n,this.visualElement,!1))}stopAnimation(){Le(t=>this.getAxisMotionValue(t).stop())}getAxisMotionValue(t){const n=`_drag${t.toUpperCase()}`,s=this.visualElement.getProps(),r=s[n];return r||this.visualElement.getValue(t,(s.initial?s.initial[t]:void 0)||0)}snapToCursor(t){Le(n=>{const{drag:s}=this.getProps();if(!Ut(n,s,this.currentDirection))return;const{projection:r}=this.visualElement,o=this.getAxisMotionValue(n);if(r&&r.layout){const{min:i,max:a}=r.layout.layoutBox[n],c=o.get()||0;o.set(t[n]-Z(i,a,.5)+c)}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:t,dragConstraints:n}=this.getProps(),{projection:s}=this.visualElement;if(!lt(n)||!s||!this.constraints)return;this.stopAnimation();const r={x:0,y:0};Le(i=>{const a=this.getAxisMotionValue(i);if(a&&this.constraints!==!1){const c=a.get();r[i]=xh({min:c,max:c},this.constraints[i])}});const{transformTemplate:o}=this.visualElement.getProps();this.visualElement.current.style.transform=o?o({},""):"none",s.root&&s.root.updateScroll(),s.updateLayout(),this.constraints=!1,this.resolveConstraints(),Le(i=>{if(!Ut(i,t,null))return;const a=this.getAxisMotionValue(i),{min:c,max:u}=this.constraints[i];a.set(Z(c,u,r[i]))}),this.visualElement.render()}addListeners(){if(!this.visualElement.current)return;vh.set(this.visualElement,this);const t=this.visualElement.current,n=Tt(t,"pointerdown",u=>{const{drag:d,dragListener:f=!0}=this.getProps(),h=u.target,g=h!==t&&Qu(h);d&&f&&!g&&this.start(u)});let s;const r=()=>{const{dragConstraints:u}=this.getProps();lt(u)&&u.current&&(this.constraints=this.resolveRefConstraints(),s||(s=jh(t,u.current,()=>this.scalePositionWithinConstraints())))},{projection:o}=this.visualElement,i=o.addEventListener("measure",r);o&&!o.layout&&(o.root&&o.root.updateScroll(),o.updateLayout()),X.read(r);const a=Dt(window,"resize",()=>this.scalePositionWithinConstraints()),c=o.addEventListener("didUpdate",(({delta:u,hasLayoutChanged:d})=>{this.isDragging&&d&&(Le(f=>{const h=this.getAxisMotionValue(f);h&&(this.originPoint[f]+=u[f].translate,h.set(h.get()+u[f].translate))}),this.visualElement.render())}));return()=>{a(),n(),i(),c&&c(),s&&s()}}getProps(){const t=this.visualElement.getProps(),{drag:n=!1,dragDirectionLock:s=!1,dragPropagation:r=!1,dragConstraints:o=!1,dragElastic:i=is,dragMomentum:a=!0}=t;return{...t,drag:n,dragDirectionLock:s,dragPropagation:r,dragConstraints:o,dragElastic:i,dragMomentum:a}}}function ii(e){let t=!0;return()=>{if(t){t=!1;return}e()}}function jh(e,t,n){const s=fr(e,ii(n)),r=fr(t,ii(n));return()=>{s(),r()}}function Ut(e,t,n){return(t===!0||t===e)&&(n===null||n===e)}function Sh(e,t=10){let n=null;return Math.abs(e.y)>t?n="y":Math.abs(e.x)>t&&(n="x"),n}class Th extends Qe{constructor(t){super(t),this.removeGroupControls=Ce,this.removeListeners=Ce,this.controls=new wh(t)}mount(){const{dragControls:t}=this.node.getProps();t&&(this.removeGroupControls=t.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||Ce}update(){const{dragControls:t}=this.node.getProps(),{dragControls:n}=this.node.prevProps||{};t!==n&&(this.removeGroupControls(),t&&(this.removeGroupControls=t.subscribe(this.controls)))}unmount(){this.removeGroupControls(),this.removeListeners(),this.controls.isDragging||this.controls.endPanSession()}}const Mn=e=>(t,n)=>{e&&X.update(()=>e(t,n),!1,!0)};class Ch extends Qe{constructor(){super(...arguments),this.removePointerDownListener=Ce}onPointerDown(t){this.session=new Ta(t,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:Sa(this.node)})}createPanHandlers(){const{onPanSessionStart:t,onPanStart:n,onPan:s,onPanEnd:r}=this.node.getProps();return{onSessionStart:Mn(t),onStart:Mn(n),onMove:Mn(s),onEnd:(o,i)=>{delete this.session,r&&X.postRender(()=>r(o,i))}}}mount(){this.removePointerDownListener=Tt(this.node.current,"pointerdown",t=>this.onPointerDown(t))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}}let Rn=!1;class Nh extends p.Component{componentDidMount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:s,layoutId:r}=this.props,{projection:o}=t;o&&(n.group&&n.group.add(o),s&&s.register&&r&&s.register(o),Rn&&o.root.didUpdate(),o.addEventListener("animationComplete",()=>{this.safeToRemove()}),o.setOptions({...o.options,layoutDependency:this.props.layoutDependency,onExitComplete:()=>this.safeToRemove()})),Qt.hasEverUpdated=!0}getSnapshotBeforeUpdate(t){const{layoutDependency:n,visualElement:s,drag:r,isPresent:o}=this.props,{projection:i}=s;return i&&(i.isPresent=o,t.layoutDependency!==n&&i.setOptions({...i.options,layoutDependency:n}),Rn=!0,r||t.layoutDependency!==n||n===void 0||t.isPresent!==o?i.willUpdate():this.safeToRemove(),t.isPresent!==o&&(o?i.promote():i.relegate()||X.postRender(()=>{const a=i.getStack();(!a||!a.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{visualElement:t,layoutAnchor:n}=this.props,{projection:s}=t;s&&(s.options.layoutAnchor=n,s.root.didUpdate(),ks.postRender(()=>{!s.currentAnimation&&s.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:s}=this.props,{projection:r}=t;Rn=!0,r&&(r.scheduleCheckAfterUnmount(),n&&n.group&&n.group.remove(r),s&&s.deregister&&s.deregister(r))}safeToRemove(){const{safeToRemove:t}=this.props;t&&t()}render(){return null}}function Na(e){const[t,n]=ma(),s=p.useContext(ls);return l.jsx(Nh,{...e,layoutGroup:s,switchLayoutGroup:p.useContext(wa),isPresent:t,safeToRemove:n})}const kh={pan:{Feature:Ch},drag:{Feature:Th,ProjectionNode:ha,MeasureLayout:Na}};function oi(e,t,n){const{props:s}=e;e.animationState&&s.whileHover&&e.animationState.setActive("whileHover",n==="Start");const r="onHover"+n,o=s[r];o&&X.postRender(()=>o(t,Vt(t)))}class Ph extends Qe{mount(){const{current:t}=this.node;t&&(this.unmount=Xu(t,(n,s)=>(oi(this.node,s,"Start"),r=>oi(this.node,r,"End"))))}unmount(){}}class Dh extends Qe{constructor(){super(...arguments),this.isActive=!1}onFocus(){let t=!1;try{t=this.node.current.matches(":focus-visible")}catch{t=!0}!t||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!0),this.isActive=!0)}onBlur(){!this.isActive||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!1),this.isActive=!1)}mount(){this.unmount=At(Dt(this.node.current,"focus",()=>this.onFocus()),Dt(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}function ai(e,t,n){const{props:s}=e;if(e.current instanceof HTMLButtonElement&&e.current.disabled)return;e.animationState&&s.whileTap&&e.animationState.setActive("whileTap",n==="Start");const r="onTap"+(n==="End"?"":n),o=s[r];o&&X.postRender(()=>o(t,Vt(t)))}class Eh extends Qe{mount(){const{current:t}=this.node;if(!t)return;const{globalTapTarget:n,propagate:s}=this.node.props;this.unmount=td(t,(r,o)=>(ai(this.node,o,"Start"),(i,{success:a})=>ai(this.node,i,a?"End":"Cancel")),{useGlobalTarget:n,stopPropagation:s?.tap===!1})}unmount(){}}const os=new WeakMap,In=new WeakMap,Ah=e=>{const t=os.get(e.target);t&&t(e)},Mh=e=>{e.forEach(Ah)};function Rh({root:e,...t}){const n=e||document;In.has(n)||In.set(n,{});const s=In.get(n),r=JSON.stringify(t);return s[r]||(s[r]=new IntersectionObserver(Mh,{root:e,...t})),s[r]}function Ih(e,t,n){const s=Rh(t);return os.set(e,n),s.observe(e),()=>{os.delete(e),s.unobserve(e)}}const Vh={some:0,all:1};class Lh extends Qe{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.stopObserver?.();const{viewport:t={}}=this.node.getProps(),{root:n,margin:s,amount:r="some",once:o}=t,i={root:n?n.current:void 0,rootMargin:s,threshold:typeof r=="number"?r:Vh[r]},a=c=>{const{isIntersecting:u}=c;if(this.isInView===u||(this.isInView=u,o&&!u&&this.hasEnteredView))return;u&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",u);const{onViewportEnter:d,onViewportLeave:f}=this.node.getProps(),h=u?d:f;h&&h(c)};this.stopObserver=Ih(this.node.current,i,a)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;const{props:t,prevProps:n}=this.node;["amount","margin","root"].some(Bh(t,n))&&this.startObserver()}unmount(){this.stopObserver?.(),this.hasEnteredView=!1,this.isInView=!1}}function Bh({viewport:e={}},{viewport:t={}}={}){return n=>e[n]!==t[n]}const Fh={inView:{Feature:Lh},tap:{Feature:Eh},focus:{Feature:Dh},hover:{Feature:Ph}},Oh={layout:{ProjectionNode:ha,MeasureLayout:Na}},$h={...ch,...Fh,...kh,...Oh},Je=rh($h,ih),ka=p.forwardRef(function({trigger:t,items:n,open:s,onOpenChange:r,align:o="right",width:i=220,closeOnClick:a=!0,className:c,menuClassName:u,itemClassName:d,triggerClassName:f,menuListClassName:h,separatorClassName:g,itemIconClassName:x,itemLabelClassName:y,style:b,menuStyle:w},S){const[v,j]=p.useState(!1),[T,P]=p.useState({top:0,left:0}),[k,C]=p.useState("bottom"),M=s!==void 0,D=M?s:v,B=p.useRef(null),V=p.useRef(null),$=p.useId(),E=p.useRef(R=>{M||j(R),r?.(R)});E.current=R=>{M||j(R),r?.(R)};const N=R=>E.current(R);p.useEffect(()=>{if(!D)return;const R=A=>{const z=A.target;B.current&&!B.current.contains(z)&&!V.current?.contains(z)&&E.current(!1)},I=A=>{A.key==="Escape"&&E.current(!1)};return document.addEventListener("mousedown",R),document.addEventListener("keydown",I),()=>{document.removeEventListener("mousedown",R),document.removeEventListener("keydown",I)}},[D]),p.useLayoutEffect(()=>{if(!D||!B.current||!V.current)return;const R=()=>{const I=B.current.getBoundingClientRect(),A=V.current.offsetHeight,z=window.innerHeight-I.bottom,F=I.top,W=z<A+10&&F>A,G=W?I.top-A-8:I.bottom+8;let Q=o==="right"?I.right-i:I.left;const ue=window.innerWidth-i-8;Q=Math.max(8,Math.min(Q,ue)),C(W?"top":"bottom"),P({top:G,left:Q})};return R(),window.addEventListener("scroll",R,!0),window.addEventListener("resize",R),()=>{window.removeEventListener("scroll",R,!0),window.removeEventListener("resize",R)}},[D,o,i]);const L=R=>{B.current=R,typeof S=="function"?S(R):S&&(S.current=R)},K=l.jsx(It,{children:D&&l.jsx(Je.div,{ref:V,initial:{opacity:0,y:k==="bottom"?8:-8,scale:.96},animate:{opacity:1,y:0,scale:1},exit:{opacity:0,y:k==="bottom"?8:-8,scale:.96},transition:{duration:.16,ease:"easeOut"},onClick:R=>R.stopPropagation(),className:O("fixed z-[9999] overflow-hidden rounded-2xl border border-border","bg-background shadow-2xl backdrop-blur-xl","min-w-[180px]",u),style:{width:i,top:T.top,left:T.left,...w},children:l.jsx("div",{id:$,role:"menu",className:O("text-sm text-foreground",h),children:n.map((R,I)=>R.separator?l.jsx("div",{role:"separator",className:O("my-1 h-px bg-border",g)},`separator-${I}`):l.jsxs("button",{type:"button",role:"menuitem",disabled:R.disabled,onClick:()=>{R.disabled||(R.onClick?.(),a&&N(!1))},className:O("flex w-full items-center gap-3 px-4 py-2.5 text-left","transition-all duration-150","hover:bg-accent","focus:outline-none focus-visible:bg-accent focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-ring",R.danger&&"text-destructive hover:bg-destructive/10",R.disabled&&"opacity-50",d,R.className),style:R.style,children:[R.icon&&l.jsx("span",{className:O("shrink-0 text-current",x),children:R.icon}),l.jsx("span",{className:O("truncate",y),children:R.label})]},typeof R.label=="string"?R.label:I))})})});return l.jsxs(l.Fragment,{children:[l.jsx("div",{ref:L,className:O("inline-flex",c),style:b,children:l.jsx("div",{className:O("flex",f),role:"button",tabIndex:0,"aria-haspopup":"menu","aria-expanded":D,"aria-controls":D?$:void 0,onKeyDown:R=>{(R.key==="Enter"||R.key===" ")&&(R.preventDefault(),R.stopPropagation(),N(!D))},onClick:R=>{R.stopPropagation(),N(!D)},children:t})}),typeof document<"u"&&wl.createPortal(K,document.body)]})});ka.displayName="Dropdown";class _h{toasts=[];listeners=new Set;timers=new Map;counter=0;maxToasts=5;subscribe=t=>(this.listeners.add(t),t(this.toasts),()=>{this.listeners.delete(t)});setMaxToasts(t){this.maxToasts=t}emit(){this.listeners.forEach(t=>t(this.toasts))}clearTimer(t){const n=this.timers.get(t);n&&(clearTimeout(n),this.timers.delete(t))}dismiss=t=>{t?(this.clearTimer(t),this.toasts=this.toasts.filter(n=>n.id!==t)):(this.timers.forEach(n=>clearTimeout(n)),this.timers.clear(),this.toasts=[]),this.emit()};create(t){const n=t.id??`toast-${++this.counter}`;this.clearTimer(n);const s={...t,id:n,type:t.type??"info",variant:t.variant??"light",duration:t.duration??4e3},r=this.toasts.findIndex(o=>o.id===n);if(r>=0){const o=[...this.toasts];o[r]=s,this.toasts=o}else{const o=[...this.toasts,s];this.toasts=o.length>this.maxToasts?o.slice(o.length-this.maxToasts):o}return s.duration&&s.duration>0&&this.timers.set(n,setTimeout(()=>this.dismiss(n),s.duration)),this.emit(),n}}const pe=new _h,et=(e=>typeof e=="string"?pe.create({description:e}):pe.create(e));et.success=(e,t)=>pe.create({title:e,type:"success",...t});et.error=(e,t)=>pe.create({title:e,type:"error",...t});et.warning=(e,t)=>pe.create({title:e,type:"warning",...t});et.info=(e,t)=>pe.create({title:e,type:"info",...t});et.loading=(e,t)=>pe.create({title:e,type:"loading",duration:0,...t});et.dismiss=e=>pe.dismiss(e);et.promise=(e,t,n)=>{const s=pe.create({title:t.loading,type:"loading",duration:0,...n});return e.then(r=>{const o=typeof t.success=="function"?t.success(r):t.success;return pe.create({id:s,title:o,type:"success",duration:4e3,...n}),r},r=>{const o=typeof t.error=="function"?t.error(r):t.error;throw pe.create({id:s,title:o,type:"error",duration:4e3,...n}),r})};const Pa=et,zh=()=>p.useMemo(()=>({toast:Pa,dismiss:pe.dismiss}),[]),Uh={"top-left":"top-4 left-4 sm:top-6 sm:left-6 items-start","top-center":"top-4 left-1/2 -translate-x-1/2 sm:top-6 items-center","top-right":"top-4 right-4 sm:top-6 sm:right-6 items-end","bottom-left":"bottom-4 left-4 sm:bottom-6 sm:left-6 items-start","bottom-center":"bottom-4 left-1/2 -translate-x-1/2 sm:bottom-6 items-center","bottom-right":"bottom-4 right-4 sm:bottom-6 sm:right-6 items-end"},Wh=({children:e,maxToasts:t=5,containerClassName:n,position:s="bottom-right"})=>{const[r,o]=p.useState([]);return p.useEffect(()=>{pe.setMaxToasts(t)},[t]),p.useEffect(()=>pe.subscribe(o),[]),l.jsxs(l.Fragment,{children:[e,l.jsx("div",{role:"region","aria-label":"Notifications","aria-live":"polite",className:m("fixed z-60 flex flex-col gap-2",Uh[s],n),children:r.map(i=>l.jsx(Hh,{toast:i,onClose:()=>pe.dismiss(i.id)},i.id))})]})},li={light:{success:{bg:"bg-popover",border:"border-border",text:"text-popover-foreground",icon:"text-success"},error:{bg:"bg-popover",border:"border-border",text:"text-popover-foreground",icon:"text-destructive"},warning:{bg:"bg-popover",border:"border-border",text:"text-popover-foreground",icon:"text-warning"},info:{bg:"bg-popover",border:"border-border",text:"text-popover-foreground",icon:"text-info"},loading:{bg:"bg-popover",border:"border-border",text:"text-popover-foreground",icon:"text-muted-foreground"}},soft:{success:{bg:"bg-success/10",border:"border-success/30",text:"text-success",icon:"text-success"},error:{bg:"bg-destructive/10",border:"border-destructive/30",text:"text-destructive",icon:"text-destructive"},warning:{bg:"bg-warning/10",border:"border-warning/30",text:"text-warning",icon:"text-warning"},info:{bg:"bg-info/10",border:"border-info/30",text:"text-info",icon:"text-info"},loading:{bg:"bg-muted",border:"border-border",text:"text-foreground",icon:"text-muted-foreground"}},dark:{success:{bg:"bg-success text-success-foreground",border:"border-success",text:"text-success-foreground",icon:"text-success-foreground"},error:{bg:"bg-destructive text-destructive-foreground",border:"border-destructive",text:"text-destructive-foreground",icon:"text-destructive-foreground"},warning:{bg:"bg-warning text-warning-foreground",border:"border-warning",text:"text-warning-foreground",icon:"text-warning-foreground"},info:{bg:"bg-info text-info-foreground",border:"border-info",text:"text-info-foreground",icon:"text-info-foreground"},loading:{bg:"bg-muted text-foreground",border:"border-border",text:"text-foreground",icon:"text-muted-foreground"}}},Kh={success:H.CheckCircle,error:H.AlertCircle,warning:H.AlertTriangle,info:H.Info,loading:H.Loader2},Hh=({toast:e,onClose:t})=>{const{title:n,description:s,type:r="info",variant:o="light",icon:i,className:a,style:c,titleClassName:u,descriptionClassName:d,iconClassName:f,contentClassName:h,closeButtonClassName:g}=e,x=li[o]?.[r]??li.light.info,y=Kh[r]??H.Info;return l.jsxs("div",{className:m("group relative flex w-full sm:min-w-[200px] sm:max-w-sm md:max-w-md lg:max-w-lg items-start gap-2 rounded-xl","border p-4 pr-10",x.border,x.bg,"shadow-md dark:shadow-black/40","transition-shadow duration-300 ease-out","animate-in slide-in-from-right-full","hover:shadow-lg",a),style:c,role:r==="error"?"alert":"status",children:[i!==void 0?i!==null&&l.jsx("span",{"aria-hidden":"true",className:m("inline-flex h-5 w-5 shrink-0 items-center justify-center",x.icon,f),children:i}):l.jsx(y,{"aria-hidden":"true",className:m("h-5 w-5 shrink-0",x.icon,r==="loading"&&"animate-spin",f)}),l.jsxs("div",{className:m("flex-1",h),children:[n&&l.jsx("div",{className:m("text-sm font-medium",x.text,u),children:n}),s&&l.jsx("div",{className:m("text-sm text-muted-foreground",d),children:s})]}),l.jsx("button",{type:"button","aria-label":"Dismiss notification",onClick:t,className:m("absolute right-2 top-2 rounded-md p-1.5 transition-opacity","text-current opacity-60 hover:opacity-100","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",g),children:l.jsx(H.X,{className:"h-4 w-4","aria-hidden":"true"})})]})},Da=p.memo(({items:e,allowMultiple:t=!1,defaultOpen:n=[],className:s,style:r,itemClassName:o,itemStyle:i,headerClassName:a,headerStyle:c,titleClassName:u,titleStyle:d,iconClassName:f,iconStyle:h,contentWrapperClassName:g,contentWrapperStyle:x,contentClassName:y,contentStyle:b,hoverClassName:w,hoverStyle:S,borderColor:v="var(--border)",radius:j="0.5rem",shadow:T="none",duration:P=300,iconOpen:k,iconClose:C,renderItem:M})=>{const[D,B]=p.useState(n),V=p.useId(),$=E=>{B(N=>t?N.includes(E)?N.filter(L=>L!==E):[...N,E]:N.includes(E)?[]:[E])};return l.jsx("div",{className:O(s,"w-full space-y-2 text-foreground"),style:r,children:e.map((E,N)=>{const L=D.includes(N);return M?l.jsx(p.Fragment,{children:M({item:E,index:N,open:L,toggle:()=>$(N)})},N):l.jsxs("div",{className:O(o,"overflow-hidden transition-all bg-accent text-foreground","rounded-md"),style:{...i},children:[l.jsxs("button",{type:"button",id:`${V}-trigger-${N}`,"aria-expanded":L,"aria-controls":`${V}-panel-${N}`,onClick:()=>$(N),className:m("w-full flex items-center justify-between","px-4 py-3.5 text-left transition-colors","hover:bg-accent-foreground/5","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-ring",a,w),style:{...c,...S},children:[l.jsx("span",{className:m("text-sm text-foreground",u),style:d,children:E.title}),l.jsx("span",{"aria-hidden":"true",className:m("text-muted-foreground",f),style:h,children:L?k||l.jsx(H.ChevronUp,{size:18}):C||l.jsx(H.ChevronDown,{size:18})})]}),l.jsx("div",{id:`${V}-panel-${N}`,role:"region","aria-labelledby":`${V}-trigger-${N}`,className:m("grid overflow-hidden",L?"grid-rows-[1fr]":"grid-rows-[0fr]",g),style:{transition:`grid-template-rows ${P}ms ease`,...x},children:l.jsx("div",{className:"min-h-0 overflow-hidden",children:l.jsx("div",{inert:L?void 0:!0,className:m("px-4 py-3.5 text-sm border-t border-border text-accent-foreground bg-background",y),style:b,children:E.content})})})]},N)})})});Da.displayName="Accordion";const Gh=({mode:e="single",name:t,options:n=[],selectedValues:s=[],onChange:r,label:o,checked:i=!1,onCheckedChange:a,disabled:c=!1,readOnly:u=!1,required:d=!1,error:f,className:h,containerClassName:g,itemClassName:x,labelClassName:y,textClassName:b,iconClassName:w,checkClassName:S,errorClassName:v,style:j,containerStyle:T,itemStyle:P,labelStyle:k,textStyle:C,iconStyle:M,errorStyle:D,customIcon:B,iconSize:V=20,renderItem:$})=>{const E=p.useRef(null),[N,L]=p.useState(null),K=p.useId(),R=f?`${K}-error`:void 0,I=F=>{if(!r||c||u||n.find(G=>G.value===F)?.disabled)return;const W=s.includes(F)?s.filter(G=>G!==F):[...s,F];r(W)},A=()=>{!a||c||u||a(!i)},z=F=>l.jsx("span",{className:m("inline-flex items-center justify-center rounded border transition-colors shrink-0",F?"border-primary bg-primary":"border-border bg-transparent","peer-focus-visible:ring-2 peer-focus-visible:ring-ring peer-focus-visible:ring-offset-2 peer-focus-visible:ring-offset-background",w),style:{width:V,height:V,...M},children:F&&l.jsx("svg",{viewBox:"0 0 24 24",className:m("text-primary-foreground",S),fill:"none",stroke:"currentColor",strokeWidth:3,style:{width:V*.6,height:V*.6},children:l.jsx("polyline",{points:"20 6 9 17 4 12"})})});if(e==="single"){const F=A;return $?l.jsx("div",{className:h,style:j,children:$({checked:i,focused:!1,toggle:F})}):l.jsxs("div",{className:h,style:j,children:[l.jsxs("label",{className:m("flex items-center justify-between",c?"opacity-50 cursor-not-allowed":"cursor-pointer",x,y),style:{...P,...k},children:[l.jsx("span",{className:m("text-sm text-foreground",b),style:C,children:o}),l.jsx("input",{type:"checkbox",className:"sr-only peer",name:t,checked:i,disabled:c||u,required:d,"aria-invalid":f?!0:void 0,"aria-describedby":R,onChange:F}),B?B(i):z(i)]}),f&&l.jsx("p",{id:R,role:"alert",className:m("text-sm text-destructive mt-1",v),style:D,children:f})]})}return l.jsxs("div",{ref:E,role:"group","aria-invalid":f?!0:void 0,"aria-describedby":R,className:m("flex flex-col gap-2",g||h),style:T||j,children:[n.map((F,W)=>{const G=s.includes(F.value),Q=N===W,ue=()=>I(F.value);if($)return l.jsx(p.Fragment,{children:$({option:F,checked:G,focused:Q,toggle:ue})},F.value);const ge=c||F.disabled;return l.jsxs("label",{onFocus:()=>L(W),className:m("flex items-center justify-between",ge?"opacity-50 cursor-not-allowed":"cursor-pointer",x,y),style:{...P,...k},children:[l.jsx("span",{className:m("text-sm text-foreground",b),style:C,children:F.label}),l.jsx("input",{type:"checkbox",className:"sr-only peer",name:t,value:F.value,checked:G,disabled:ge||u,onChange:ue}),B?B(G,F):z(G)]},F.value)}),f&&l.jsx("p",{id:R,role:"alert",className:m("text-sm text-destructive mt-1",v),style:D,children:f})]})},Yh=({name:e,options:t,selectedValue:n,onChange:s,disabled:r=!1,readOnly:o=!1,required:i=!1,error:a,className:c,style:u,itemClassName:d,itemStyle:f,labelClassName:h,labelStyle:g,descriptionClassName:x,descriptionStyle:y,iconWrapperClassName:b,iconWrapperStyle:w,indicatorClassName:S,indicatorStyle:v,dotClassName:j,dotStyle:T,errorClassName:P,errorStyle:k,size:C="md",orientation:M="vertical",animationDuration:D=.2})=>{const B=p.useRef(null),[V,$]=p.useState(null),N={sm:{item:"px-3 py-2",indicator:"w-4 h-4",dot:"w-2 h-2",text:"text-xs",desc:"text-xs",icon:"w-3.5 h-3.5",outerGap:"gap-3",innerGap:"gap-2"},md:{item:"px-4 py-3",indicator:"w-5 h-5",dot:"w-2.5 h-2.5",text:"text-sm",desc:"text-xs",icon:"w-4 h-4",outerGap:"gap-4",innerGap:"gap-3"},lg:{item:"px-5 py-4",indicator:"w-6 h-6",dot:"w-3 h-3",text:"text-base",desc:"text-sm",icon:"w-5 h-5",outerGap:"gap-4",innerGap:"gap-3"}}[C],L=p.useId(),K=e??L,R=a?`${L}-error`:void 0;return l.jsxs("div",{ref:B,role:"radiogroup","aria-required":i,"aria-invalid":!!a,"aria-describedby":R,className:m("outline-none",M==="vertical"?"flex flex-col gap-2":"flex flex-row gap-2 flex-wrap",c),style:u,children:[t.map((I,A)=>{const z=n===I.value,F=r||I.disabled,W=()=>{F||o||(s?.(I.value),$(A))};return l.jsxs("label",{className:m("relative flex items-center justify-between rounded-xl border transition-all",N.outerGap,N.item,"bg-background border-border",!F&&"hover:bg-accent/60 cursor-pointer",z&&"border-primary bg-primary/5",F&&"opacity-50 cursor-not-allowed","has-focus-visible:ring-2 has-focus-visible:ring-ring has-focus-visible:ring-offset-2 has-focus-visible:ring-offset-background",d),style:f,children:[l.jsxs("div",{className:m("flex items-center min-w-0 flex-1",N.innerGap),children:[I.icon&&l.jsx("div",{className:m("text-muted-foreground shrink-0 [&_svg]:w-full [&_svg]:h-full",N.icon,b),style:w,children:I.icon}),l.jsxs("div",{className:"min-w-0 flex-1",children:[l.jsx("p",{className:O(h,"font-medium text-foreground truncate",N.text),style:g,children:I.label}),I.description&&l.jsx("p",{className:O(x,"text-muted-foreground truncate",N.desc),style:y,children:I.description})]})]}),l.jsx("input",{type:"radio",name:K,value:I.value,checked:z,onChange:W,disabled:F,readOnly:o,required:i&&A===0,className:"sr-only","aria-describedby":R}),l.jsx("div",{className:O(S,"relative flex items-center justify-center rounded-full border transition-all shrink-0",N.indicator,z?"border-primary bg-primary":"border-muted-foreground/40"),style:v,children:l.jsx(It,{children:z&&l.jsx(Je.div,{initial:{scale:0},animate:{scale:1},exit:{scale:0},transition:{duration:D},className:O(j,"rounded-full bg-background",N.dot),style:T})})})]},I.value)}),a&&l.jsx(Je.p,{initial:{opacity:0,y:-10},animate:{opacity:1,y:0},className:O(P,"text-destructive mt-1",N.desc),style:k,id:R,children:a})]})},Xh=({mode:e="single",name:t,options:n,selectedValues:s=[],onChange:r,label:o,checked:i=!1,onCheckedChange:a,disabled:c=!1,readOnly:u=!1,required:d=!1,error:f,className:h,itemClassName:g,labelClassName:x,textClassName:y,switchClassName:b,thumbClassName:w,errorClassName:S,style:v,itemStyle:j,labelStyle:T,textStyle:P,switchStyle:k,thumbStyle:C,errorStyle:M,iconSize:D=20})=>{const B=p.useRef(null),[V,$]=p.useState(null),E=p.useId(),N=f?`${E}-error`:void 0,L=D*2,K=Math.round(D*1.1),R=2,I=K-R*2,A=W=>{if(!r||c||u||!n)return;const G=s.includes(W)?s.filter(Q=>Q!==W):[...s,W];r(G)},z=()=>{!a||c||u||a(!i)},F=(W,G,Q,ue=!1)=>l.jsxs(l.Fragment,{children:[l.jsx("input",{type:"checkbox",className:"sr-only peer",role:"switch","aria-checked":W,name:t,value:Q,checked:W,disabled:c||u,required:ue,"aria-describedby":N,onChange:G}),l.jsx("span",{className:m("relative inline-flex shrink-0 rounded-full transition-colors",W?"bg-primary":"bg-muted","peer-focus-visible:ring-2 peer-focus-visible:ring-ring peer-focus-visible:ring-offset-2 peer-focus-visible:ring-offset-background",b),style:{width:L,height:K,...k},children:l.jsx("span",{className:m("absolute top-1/2 rounded-full shadow bg-background",w),style:{left:0,width:I,height:I,transform:`translate(${W?L-I-R:R}px, -50%)`,transition:"transform 0.25s ease",...C}})})]});return l.jsxs("div",{ref:B,role:e==="group"?"group":void 0,"aria-invalid":!!f,"aria-describedby":N,className:m("flex flex-col gap-2 text-foreground",h),style:v,children:[e==="single"?l.jsxs("label",{className:O("flex items-center justify-between cursor-pointer transition-colors","text-foreground",c&&"opacity-50 cursor-not-allowed",g,x),style:{...j,...T},children:[l.jsx("span",{className:O("text-sm text-foreground",y),style:P,children:o}),F(i,z,void 0,d)]}):n?.map((W,G)=>{const Q=s.includes(W.value);return l.jsxs("label",{onFocus:()=>$(G),className:O("flex items-center justify-between cursor-pointer transition-colors","text-foreground",c&&"opacity-50 cursor-not-allowed",g,x),style:{...j,...T},children:[l.jsx("span",{className:O("text-sm text-foreground",y),style:P,children:W.label}),F(Q,()=>A(W.value),W.value)]},W.value)}),f&&l.jsx("p",{id:N,role:"alert",className:m("text-sm text-destructive",S),style:M,children:f})]})};let Ct=0,Ea="",Aa="";const qh=()=>{if(!(typeof document>"u")){if(Ct===0){const{body:e,documentElement:t}=document;Ea=e.style.overflow,Aa=e.style.paddingRight;const n=window.innerWidth-t.clientWidth;if(n>0){const s=parseFloat(getComputedStyle(e).paddingRight)||0;e.style.paddingRight=`${s+n}px`}e.style.overflow="hidden"}Ct+=1}},Zh=()=>{typeof document>"u"||(Ct=Math.max(0,Ct-1),Ct===0&&(document.body.style.overflow=Ea,document.body.style.paddingRight=Aa))},Ma=e=>{p.useEffect(()=>{if(e)return qh(),Zh},[e])},ci=["a[href]","button:not([disabled])","input:not([disabled])","select:not([disabled])","textarea:not([disabled])",'[tabindex]:not([tabindex="-1"])'].join(","),Ra=(e,t)=>{p.useEffect(()=>{if(!t)return;const n=e.current,s=document.activeElement,o=requestAnimationFrame(()=>{const a=e.current;if(!a)return;(a.querySelector(ci)??a).focus?.()}),i=a=>{if(a.key!=="Tab")return;const c=e.current;if(!c)return;const u=Array.from(c.querySelectorAll(ci)).filter(g=>g.offsetParent!==null||g===document.activeElement);if(u.length===0){a.preventDefault();return}const d=u[0],f=u[u.length-1],h=document.activeElement;a.shiftKey&&(h===d||!c.contains(h))?(a.preventDefault(),f.focus()):!a.shiftKey&&h===f&&(a.preventDefault(),d.focus())};return document.addEventListener("keydown",i),()=>{cancelAnimationFrame(o),document.removeEventListener("keydown",i),(!n||n.contains(document.activeElement))&&s?.focus?.()}},[t,e])};function Ia({isOpen:e,onClose:t,children:n,renderContent:s,position:r="right",size:o="320px",disableOverlayClose:i=!1,disableEscapeClose:a,ariaLabel:c,overlayClassName:u,overlayStyle:d,panelClassName:f}){const h=p.useRef(null),g=a??i,x=p.useRef(t);x.current=t,p.useEffect(()=>{if(!e||g)return;const v=j=>{j.key==="Escape"&&x.current()};return document.addEventListener("keydown",v),()=>document.removeEventListener("keydown",v)},[e,g]),Ma(e),Ra(h,e);const y=()=>{switch(r){case"left":return{initial:{x:"-100%"},animate:{x:0},exit:{x:"-100%"}};case"right":return{initial:{x:"100%"},animate:{x:0},exit:{x:"100%"}};case"top":return{initial:{y:"-100%"},animate:{y:0},exit:{y:"-100%"}};case"bottom":return{initial:{y:"100%"},animate:{y:0},exit:{y:"100%"}}}},b=()=>{switch(r){case"left":case"right":return{width:`min(${o}, 100vw)`,height:"100%"};case"top":case"bottom":return{height:`min(${o}, 100vh)`,width:"100%"};default:return{width:`min(${o}, 100vw)`,height:"100%"}}},w=()=>{i||t()},S=y();return l.jsx(It,{children:e&&l.jsxs("div",{className:"fixed inset-0 z-50",children:[l.jsx(Je.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},onClick:w,className:m("absolute inset-0 bg-background/80 backdrop-blur-sm",u),style:d}),l.jsx(Je.div,{...S,ref:h,role:"dialog","aria-modal":"true","aria-label":c,tabIndex:-1,transition:{duration:.25},className:m("absolute flex flex-col bg-background border-border shadow-2xl outline-none","border",r==="right"&&"right-0 top-0",r==="left"&&"left-0 top-0",r==="top"&&"top-0 left-0 right-0",r==="bottom"&&"bottom-0 left-0 right-0",f),style:b(),children:s?s(t):n})]},"drawer-root")})}function Jh({children:e,className:t,style:n}){return l.jsx("div",{className:O("flex flex-col h-full",t),style:n,children:e})}function Qh({children:e,className:t,style:n}){return l.jsx("div",{className:m("flex-1 p-6 overflow-auto",t),style:n,children:e})}function em({title:e,icon:t,onClose:n,className:s,style:r,titleWrapperClassName:o,titleClassName:i,closeButtonClassName:a}){return l.jsxs("div",{className:m("flex items-center justify-between px-6 py-4 border-b border-border",s),style:r,children:[l.jsxs("div",{className:m("flex items-center gap-2 font-semibold",o),children:[t,e&&l.jsx("h3",{className:m("text-sm",i),children:e})]}),n&&l.jsx("button",{type:"button","aria-label":"Close drawer",onClick:n,className:m("p-2 rounded-lg hover:bg-accent focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",a),children:l.jsx(H.X,{size:18,"aria-hidden":"true"})})]})}function tm({children:e,className:t,style:n}){return l.jsx("div",{className:m("flex justify-end gap-3 px-6 py-3 border-t border-border bg-accent/60",t),style:n,children:e})}function nm({children:e,drawerContent:t,drawerProps:n,onClick:s,...r}){const[o,i]=p.useState(!1);return l.jsxs(l.Fragment,{children:[l.jsx(Et,{...r,onClick:a=>{s?.(a),i(!0)},children:e}),l.jsx(Ia,{...n,isOpen:o,onClose:()=>i(!1),children:t({close:()=>i(!1)})})]})}const sm=({label:e="",icon:t,iconPosition:n="left",onClick:s,className:r,style:o,labelClassName:i,iconClassName:a})=>l.jsxs("button",{type:"button",onClick:s,style:o,className:O("inline-flex items-center justify-center transition-all",r),children:[t&&n==="left"&&l.jsx("span",{className:a,children:t}),l.jsx("span",{className:i,children:e}),t&&n==="right"&&l.jsx("span",{className:a,children:t})]}),Va=p.forwardRef((e,t)=>{const{label:n,name:s,value:r,defaultValue:o,onValueChange:i,options:a=[],placeholder:c="Select...",required:u,disabled:d,error:f,success:h,helperText:g,multiple:x=!1,showDescription:y=!1,showCheckIcon:b=!0,labelIcon:w,prefixIcon:S,dropdownIcon:v=H.ChevronDown,searchClassName:j,searchStyle:T,searchPlaceholder:P,searchable:k=!1,size:C="md",maxDropdownHeight:M="240px",className:D,containerClassName:B,labelClassName:V,triggerClassName:$,valueClassName:E,dropdownClassName:N,itemClassName:L,iconClassName:K,helperClassName:R,labelIconClassName:I,searchWrapperClassName:A,emptyClassName:z,itemLabelClassName:F,itemDescriptionClassName:W,itemIconClassName:G,itemIconStyle:Q,checkIconClassName:ue,checkIconStyle:ge,style:ve,triggerStyle:We,dropdownStyle:ye,itemStyle:ae}=e,we=p.useRef(null);p.useImperativeHandle(t,()=>we.current);const Me=p.useId(),[je,Ne]=p.useState({top:0,left:0,width:0}),[ke,Ke]=p.useState("bottom"),[ee,Y]=p.useState(!1),[$e,Re]=p.useState(""),[He,le]=p.useState(o),[de,te]=p.useState(-1),_e=r!==void 0,Pe=_e?r:He,ze=p.useRef(null),Ge=p.useRef(null),Ie=p.useRef(null),ce={sm:{trigger:"px-2.5 py-1.5 text-xs",triggerWithPrefix:"pl-7 pr-2.5 py-1.5 text-xs",prefixInset:"left-2",item:"px-2.5 py-1.5 text-xs",icon:"w-3 h-3",checkIcon:"w-3 h-3",search:"px-2 py-1 text-xs",empty:"px-2.5 py-1.5 text-xs"},md:{trigger:"px-3 py-2 text-sm",triggerWithPrefix:"pl-9 pr-3 py-2 text-sm",prefixInset:"left-3",item:"px-3 py-2 text-sm",icon:"w-4 h-4",checkIcon:"w-4 h-4",search:"px-2 py-1.5 text-sm",empty:"px-3 py-2 text-sm"},lg:{trigger:"px-4 py-3 text-base",triggerWithPrefix:"pl-11 pr-4 py-3 text-base",prefixInset:"left-3.5",item:"px-4 py-3 text-base",icon:"w-5 h-5",checkIcon:"w-5 h-5",search:"px-2.5 py-2 text-base",empty:"px-4 py-3 text-base"}},be=p.useMemo(()=>x?Array.isArray(Pe)?Pe:Pe?[Pe]:[]:Pe?[Pe]:[],[x,Pe]),re=p.useMemo(()=>a.filter(U=>U.label.toLowerCase().includes($e.toLowerCase())),[a,$e]);p.useLayoutEffect(()=>{if(!ee||!ze.current||!Ge.current)return;const U=()=>{const q=ze.current.getBoundingClientRect(),Se=Ge.current.offsetHeight||240,Ft=window.innerHeight-q.bottom,xn=q.top,zs=Ft<Se+10&&xn>Se,xl=zs?q.top-Se-8:q.bottom+8,yl=q.left,bl=q.width;Ke(zs?"top":"bottom"),Ne({top:xl,left:yl,width:bl})};return U(),window.addEventListener("scroll",U,!0),window.addEventListener("resize",U),()=>{window.removeEventListener("scroll",U,!0),window.removeEventListener("resize",U)}},[ee]),p.useEffect(()=>{const U=q=>{we.current&&!we.current.contains(q.target)&&Y(!1)};return document.addEventListener("mousedown",U),()=>document.removeEventListener("mousedown",U)},[]),p.useEffect(()=>{if(!ee)return;const U=re.findIndex(q=>be.includes(q.value));te(U>=0?U:0),requestAnimationFrame(()=>{Ge.current?.children?.[U>=0?U:0]?.scrollIntoView({block:"nearest"})})},[ee]),p.useEffect(()=>{if(ee){if(re.length===0){te(-1);return}te(U=>U<0?0:U>=re.length?re.length-1:U)}},[re,ee]),p.useEffect(()=>{if(!ee||!k)return;const U=requestAnimationFrame(()=>Ie.current?.focus());return()=>cancelAnimationFrame(U)},[ee,k]);const at=p.useCallback((U,q)=>{if(d)return;U.onClick?.(U,q);let Se;x?Se=be.includes(U.value)?be.filter(xn=>xn!==U.value):[...be,U.value]:(Se=U.value,Y(!1),te(-1)),_e||le(Se),i?.(Se,s)},[d,be,x,_e,s,i]),Lt=p.useCallback(U=>{if(!ee){(U.key==="Enter"||U.key===" "||U.key==="ArrowDown")&&(U.preventDefault(),d||(Y(!0),te(0)));return}if(re.length===0){U.key==="Escape"&&(U.preventDefault(),Y(!1),te(-1));return}switch(U.key){case"Escape":U.preventDefault(),Y(!1),te(-1);break;case"Enter":case" ":U.preventDefault(),de>=0&&de<re.length&&at(re[de]);break;case"ArrowDown":U.preventDefault(),te(q=>q<re.length-1?q+1:q);break;case"ArrowUp":U.preventDefault(),te(q=>q>0?q-1:q);break;case"Home":U.preventDefault(),te(0);break;case"End":U.preventDefault(),te(re.length-1);break;case"PageUp":U.preventDefault(),te(q=>Math.max(0,q-5));break;case"PageDown":U.preventDefault(),te(q=>Math.min(re.length-1,q+5));break}},[ee,d,de,re,at]),bt=p.useMemo(()=>a.filter(U=>be.includes(U.value)).map(U=>U.label),[a,be]),fe=!!f,Ve=bt.length>0,Bt=g||f?`${Me}-description`:void 0,$s=`${Me}-trigger`,_s=`${Me}-label`,gl=p.useMemo(()=>typeof M=="number"?{maxHeight:`${M}px`}:{maxHeight:M},[M]);return l.jsxs("div",{ref:we,className:O("w-full space-y-1.5",D,B),style:ve,children:[n&&l.jsxs("label",{id:_s,htmlFor:$s,className:O("flex items-center gap-1.5 text-[13px] font-medium leading-none text-foreground",V),children:[w&&l.jsx(w,{className:O(ce[C].icon,"shrink-0",I)}),n,u&&l.jsx("span",{className:"text-destructive",children:"*"})]}),l.jsxs("div",{className:"relative",children:[S&&l.jsx("div",{className:O("pointer-events-none absolute top-1/2 -translate-y-1/2 text-muted-foreground",ce[C].prefixInset,K),children:l.jsx(S,{className:ce[C].icon})}),l.jsxs("button",{type:"button",ref:ze,id:$s,disabled:d,onClick:()=>!d&&Y(U=>!U),onKeyDown:Lt,role:"combobox","aria-expanded":ee,"aria-haspopup":"listbox","aria-required":u,"aria-invalid":fe,"aria-describedby":Bt,"aria-labelledby":n?_s:void 0,className:O("w-full flex items-center justify-between gap-2","rounded-lg transition-all outline-none","border border-border bg-input/30 text-foreground","hover:bg-accent/10","focus-visible:ring-2 focus-visible:ring-ring focus-visible:border-ring",d&&"opacity-50 cursor-not-allowed",fe&&"border-destructive focus-visible:ring-destructive/50",h&&"border-success focus-visible:ring-success/50",S?ce[C].triggerWithPrefix:ce[C].trigger,$),style:{...We},children:[l.jsx("span",{className:O("truncate flex-1 text-left",Ve?"text-foreground":"text-muted-foreground",E),children:Ve?x?bt.join(", "):bt[0]:c}),l.jsx(v,{className:O("transition-transform text-muted-foreground",ee&&"rotate-180",ce[C].icon,K)})]}),l.jsx(It,{children:ee&&l.jsxs(Je.div,{initial:{opacity:0,y:ke==="bottom"?-6:6,scale:.98},animate:{opacity:1,y:0,scale:1},exit:{opacity:0,y:ke==="bottom"?-6:6,scale:.98},transition:{duration:.12},className:O(N,"fixed z-[9999] rounded-lg p-[5px] overflow-hidden","bg-background border border-border"),style:{top:je.top,left:je.left,width:je.width,...ye},role:"listbox","aria-label":"Options",children:[k&&l.jsx("div",{className:O("p-2 border-b border-border",A),children:l.jsx("input",{ref:Ie,type:"text",value:$e,onChange:U=>{Re(U.target.value),te(0)},onKeyDown:Lt,placeholder:P||"Search...","aria-label":P||"Search options",className:O("w-full rounded-md outline-none","bg-background border border-border text-foreground","focus-visible:ring-2 focus-visible:ring-ring",ce[C].search,j),style:T})}),l.jsx("ul",{ref:Ge,className:"overflow-y-auto",style:gl,children:re.length===0?l.jsx("li",{role:"option","aria-disabled":!0,"aria-selected":!1,className:O("text-muted-foreground text-center",ce[C].empty,z),children:"No options available"}):re.map((U,q)=>{const Se=be.includes(U.value);return l.jsxs("li",{onClick:Ft=>at(U,Ft),role:"option","aria-selected":Se,className:O(L,"flex items-center justify-between rounded-md cursor-pointer transition-all relative hover:bg-accent",ce[C].item,Se&&"bg-accent"),style:{...ae},children:[l.jsxs("div",{className:"flex flex-col truncate",children:[l.jsxs("div",{className:"flex items-center gap-2",children:[U.icon&&l.jsx("span",{className:O(ce[C].icon,G),style:Q,children:U.icon}),l.jsx("span",{className:O("font-medium",F),children:U.label})]}),y&&U.description&&l.jsx("span",{className:O("text-xs text-muted-foreground mt-0.5",W),children:U.description})]}),b&&Se&&l.jsx("div",{children:l.jsx(H.Check,{className:O(ce[C].checkIcon,ue,"text-primary"),style:{...ge}})})]},U.value)})})]})})]}),(g||f)&&l.jsx("p",{id:Bt,className:O("text-xs",fe?"text-destructive":h?"text-primary":"text-muted-foreground",R),children:typeof f=="string"?f:g})]})});Va.displayName="Select";const rm={sm:{base:"py-1.5 text-xs",padLeft:{none:"pl-3",icon:"pl-8",text:"pl-8",both:"pl-12"},padRight:{none:"pr-3",suffix:"pr-8"},iconSize:14,prefixInset:"left-2.5",suffixInset:"right-2.5",gap:"gap-1",labelIconSize:14,textSize:"text-[11px]"},md:{base:"py-2 text-sm",padLeft:{none:"pl-4",icon:"pl-10",text:"pl-9",both:"pl-14"},padRight:{none:"pr-4",suffix:"pr-10"},iconSize:16,prefixInset:"left-3",suffixInset:"right-3",gap:"gap-1.5",labelIconSize:16,textSize:"text-xs"},lg:{base:"py-2.5 text-base",padLeft:{none:"pl-4",icon:"pl-11",text:"pl-10",both:"pl-16"},padRight:{none:"pr-4",suffix:"pr-11"},iconSize:20,prefixInset:"left-3.5",suffixInset:"right-3.5",gap:"gap-2",labelIconSize:18,textSize:"text-sm"}},im=p.forwardRef(function(t,n){const{label:s,name:r="",id:o,type:i="text",placeholder:a="",description:c,value:u,defaultValue:d,onChange:f,onFocus:h,onBlur:g,required:x,disabled:y,readOnly:b,error:w,success:S,helperText:v,icon:j,prefix:T,prefixIcon:P,suffixIcon:k,min:C,max:M,step:D,maxLength:B,rows:V=4,size:$="md",wrapperClassName:E="",labelClassName:N="",inputClassName:L="",textareaClassName:K="",prefixClassName:R="",suffixClassName:I="",helperTextClassName:A="",descriptionClassName:z="",wrapperStyle:F,inputStyle:W,labelStyle:G}=t,Q=p.useRef(null);p.useImperativeHandle(n,()=>Q.current);const ue=p.useId(),ge=o??ue,ve=v||w?`${ge}-description`:void 0,[We,ye]=p.useState(d||""),[ae,we]=p.useState(!1),Me=!!P,je=!!T,Ne=Me||je,ke=u!==void 0?u:We,Ke=le=>{u===void 0&&ye(le.target.value),f?.(le)},ee=le=>{i==="number"&&le.key==="-"&&!le.metaKey&&!le.ctrlKey&&le.preventDefault()},Y=rm[$],$e=!!k||i==="password",Re=()=>{const le=Ne?Me&&je?Y.padLeft.both:je?Y.padLeft.text:Y.padLeft.icon:Y.padLeft.none,de=$e?Y.padRight.suffix:Y.padRight.none;return`${Y.base} ${le} ${de}`},He="w-full min-w-0 rounded-lg border border-input bg-transparent text-foreground outline-none transition-colors placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:bg-input/50 disabled:opacity-50 dark:bg-input/30 dark:disabled:bg-input/80 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/40 focus-visible:border-ring";return l.jsxs("div",{className:m("w-full space-y-1.5",E),style:F,children:[s&&l.jsxs("div",{className:"flex items-baseline justify-between gap-2",children:[l.jsxs("label",{htmlFor:ge,className:m("flex items-center gap-1.5 text-[13px] font-medium leading-none",N),style:G,children:[j&&l.jsx(j,{size:Y.labelIconSize,strokeWidth:1.5}),s,x&&l.jsx("span",{className:"ml-1 text-destructive",children:"*"})]}),c&&l.jsx("span",{className:m("text-xs text-muted-foreground",z),children:c})]}),l.jsxs("div",{className:"relative",children:[Ne&&l.jsxs("div",{className:m("absolute inset-y-0 flex items-center text-muted-foreground pointer-events-none",Y.prefixInset,Y.gap,R),children:[P&&l.jsx(P,{size:Y.iconSize,strokeWidth:1.5}),je&&l.jsx("span",{className:m("font-medium",Y.textSize),children:T})]}),i==="textarea"?l.jsx("textarea",{ref:Q,id:ge,name:r,value:ke,onChange:Ke,onFocus:h,onBlur:g,placeholder:a,rows:V,required:x,disabled:y,readOnly:b,maxLength:B,"aria-invalid":w?!0:void 0,"aria-describedby":ve,style:W,className:m(He,Re(),"resize-none",w&&"border-destructive focus-visible:ring-destructive/50",S&&"border-success focus-visible:ring-success/50",K)}):l.jsx("input",{ref:Q,id:ge,type:i==="password"?ae?"text":"password":i,name:r,value:ke,onChange:Ke,onFocus:h,onBlur:g,onKeyDown:ee,placeholder:a,required:x,disabled:y,readOnly:b,min:i==="number"?C:void 0,max:i==="number"?M:void 0,step:i==="number"?D:void 0,maxLength:B,"aria-invalid":w?!0:void 0,"aria-describedby":ve,style:W,className:m(He,Re(),w&&"border-destructive focus-visible:ring-destructive/50",S&&"border-success focus-visible:ring-success/50",L)}),i==="password"&&l.jsx("button",{type:"button","aria-label":ae?"Hide password":"Show password","aria-pressed":ae,onClick:()=>we(!ae),disabled:y,className:m("absolute top-1/2 -translate-y-1/2 rounded text-muted-foreground transition-colors","hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/40",Y.suffixInset,I),children:ae?l.jsx(H.EyeOff,{size:Y.iconSize}):l.jsx(H.Eye,{size:Y.iconSize})}),k&&i!=="password"&&l.jsx("span",{className:m("absolute top-1/2 -translate-y-1/2 flex items-center text-muted-foreground pointer-events-none",Y.suffixInset,I),children:k})]}),(v||w)&&l.jsx("p",{id:ve,role:w?"alert":void 0,className:m("text-xs font-medium",w?"text-destructive":S?"text-success":"text-muted-foreground",A),children:w&&typeof w=="string"?w:v})]})}),La=p.forwardRef(({label:e,name:t,icon:n,value:s,onChange:r,placeholder:o,required:i,disabled:a,error:c,success:u,helperText:d,maxLength:f,autoResize:h=!0,minRows:g=3,maxRows:x=6,submitOnEnter:y,onSubmit:b,className:w="",containerClassName:S="",labelClassName:v="",iconClassName:j="",helperClassName:T="",countClassName:P="",style:k,containerStyle:C,labelStyle:M,helperStyle:D,countStyle:B,...V},$)=>{const E=p.useRef(null),N=A=>{E.current=A,typeof $=="function"?$(A):$&&($.current=A)},L=()=>{const A=E.current;if(!A||!h)return;A.style.height="auto";const z=24,F=g*z,W=x*z,G=Math.min(Math.max(A.scrollHeight,F),W);A.style.height=G+"px",A.style.overflowY=A.scrollHeight>W?"auto":"hidden"};p.useEffect(()=>{L()},[s]);const K=A=>{y&&A.key==="Enter"&&!A.shiftKey&&(A.preventDefault(),b?.())},R=typeof s=="string"?s.length:E.current?.value?.length||0,I=typeof f=="number"&&f>0;return l.jsxs("div",{className:`w-full space-y-1.5 ${S}`,style:C,children:[e&&l.jsxs("label",{htmlFor:t,className:`flex items-center gap-2 text-[13px] leading-none font-medium ${v}`,style:M,children:[n&&l.jsx(n,{size:14,className:j||void 0}),e,i&&l.jsx("span",{className:"text-destructive",children:"*"})]}),l.jsxs("div",{className:"relative group",children:[l.jsx("textarea",{ref:N,id:t,name:t,value:s,onChange:A=>{r?.(A),L()},onKeyDown:K,placeholder:o,required:i,disabled:a,maxLength:f,rows:g,className:m("w-full px-4 py-3 text-sm rounded-lg",I&&"pb-8","resize-none transition-all duration-200 ease-out","outline-none border","bg-input/30 text-foreground","placeholder:text-muted-foreground","border-border","focus-visible:ring-2 focus-visible:ring-ring/40 focus-visible:border-ring","hover:border-muted-foreground/40","disabled:opacity-50 disabled:cursor-not-allowed",c&&"border-destructive focus-visible:ring-destructive/50",u&&"border-success",w),style:{...k},...V}),I&&l.jsxs("span",{className:m("pointer-events-none absolute bottom-2.5 right-3 text-[11px] tabular-nums text-muted-foreground",P),style:B,children:[R,"/",f]})]}),d&&l.jsx("p",{className:`text-xs ${c?"text-destructive":u?"text-primary":"text-muted-foreground"} ${T}`,style:D,children:d})]})});La.displayName="Textarea";function Ba({isOpen:e,onClose:t,children:n,disableOverlayClose:s=!1,disableEscapeClose:r,ariaLabel:o,overlayClassName:i,overlayStyle:a,style:c,dialogClassName:u}){const d=p.useRef(null),f=r??s,h=p.useRef(t);h.current=t,p.useEffect(()=>{if(!e||f)return;const y=b=>{b.key==="Escape"&&h.current()};return document.addEventListener("keydown",y),()=>document.removeEventListener("keydown",y)},[e,f]),Ma(e),Ra(d,e);const g=p.useRef(!1),x=p.useCallback(()=>{!s&&g.current&&t(),g.current=!1},[s,t]);return l.jsx(It,{children:e&&l.jsx(Je.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},onMouseDown:y=>{g.current=y.target===y.currentTarget},onClick:x,className:m("fixed inset-0 z-50 flex items-center justify-center","bg-background/80 backdrop-blur-sm p-4",i),style:{...a,...c},children:l.jsx("div",{ref:d,role:"dialog","aria-modal":"true","aria-label":o,tabIndex:-1,className:m("contents outline-none",u),children:n})},"modal-overlay")})}function om({children:e,className:t,style:n,maxWidth:s="max-w-md",onClose:r,showCloseButton:o=!1,closeButtonClassName:i,closeButtonStyle:a}){const c=o&&typeof r=="function";return l.jsxs(Je.div,{initial:{y:20,scale:.96},animate:{y:0,scale:1},exit:{y:20,scale:.96},transition:{duration:.2},onClick:u=>u.stopPropagation(),className:O("relative w-full rounded-2xl border border-border bg-background shadow-2xl overflow-hidden",s,t),style:n,children:[c&&l.jsx("button",{type:"button",onClick:r,"aria-label":"Close modal",className:O("absolute top-4 right-4 z-10 p-2 rounded-full transition-colors","hover:bg-accent/20 focus:outline-none ",i),style:a,children:l.jsx(H.X,{size:18})}),e]})}function am({title:e,icon:t,onClose:n,className:s,style:r,titleWrapperClassName:o,iconClassName:i,titleClassName:a,closeButtonClassName:c}){return l.jsxs("div",{className:O(s,"flex items-center justify-between px-6 py-4 border-b border-border"),style:r,children:[l.jsxs("div",{className:m("flex items-center gap-2 font-semibold text-foreground",o),children:[t&&l.jsx("span",{className:i,children:t}),e&&l.jsx("h3",{className:m("text-sm",a),children:e})]}),n&&l.jsx("button",{type:"button","aria-label":"Close modal",onClick:n,className:m("p-2 rounded-lg hover:bg-accent transition focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",c),children:l.jsx(H.X,{size:18,"aria-hidden":"true"})})]})}function lm({children:e,className:t,style:n}){return l.jsx("div",{className:O(t,"p-6 text-foreground space-y-4"),style:n,children:e})}function cm({children:e,className:t,style:n}){return l.jsx("div",{className:O("flex justify-end gap-3 px-6 py-3 border-t border-border bg-accent/60",t),style:n,children:e})}function um({onClose:e,closeOnClick:t,action:n,onClick:s,disabled:r,...o}){const[i,a]=p.useState(!1),c=async u=>{if(s&&s(u),n){a(!0);try{await n()}catch(d){throw a(!1),d}a(!1)}t&&e&&e()};return l.jsx(Et,{size:"sm",...o,disabled:r||i,loading:o.loading||i,onClick:c})}function dm({children:e,modalContent:t,modalProps:n,onClick:s,...r}){const[o,i]=p.useState(!1);return l.jsxs(l.Fragment,{children:[l.jsx(Et,{...r,onClick:a=>{s?.(a),i(!0)},children:e}),l.jsx(Ba,{...n,isOpen:o,onClose:()=>i(!1),children:t({close:()=>i(!1)})})]})}function fm({children:e,className:t,style:n,tableClassName:s,tableStyle:r,responsive:o=!0,striped:i=!1,hoverable:a=!0,bordered:c=!1,dense:u=!1}){return l.jsx("div",{className:O("w-full rounded-2xl border bg-background text-foreground shadow-sm","border-border",o&&"overflow-x-auto",t),style:n,children:l.jsx("table",{className:O("w-full border-collapse text-sm",u?"text-xs":"text-sm",s),style:{borderSpacing:0,...r},children:p.Children.map(e,d=>p.isValidElement(d)?p.cloneElement(d,{striped:i,hoverable:a,bordered:c,dense:u}):d)})})}function hm({children:e,className:t,style:n,bordered:s}){return l.jsx("thead",{className:O("bg-accent text-foreground",t),style:n,children:p.Children.map(e,r=>p.isValidElement(r)?p.cloneElement(r,{bordered:s}):r)})}function mm({children:e,className:t,style:n,striped:s,hoverable:r,bordered:o}){return l.jsx("tbody",{className:O("bg-background",t),style:n,children:p.Children.map(e,(i,a)=>p.isValidElement(i)?p.cloneElement(i,{striped:s,hoverable:r,bordered:o,index:a}):i)})}function pm({children:e,className:t,style:n,onClick:s,striped:r,hoverable:o,bordered:i,index:a=0}){return l.jsx("tr",{onClick:s,className:O(t,i&&"border-b border-border",r&&a%2===0&&"bg-accent/30",o&&"hover:bg-accent/60",s&&"cursor-pointer","transition-all duration-200"),style:n,children:e})}function gm({children:e,className:t,style:n,bordered:s,dense:r}){return l.jsx("th",{className:O(t,"text-left font-medium text-foreground",r?"px-3 py-2":"px-5 py-3",s&&"border-b border-border"),style:n,children:e})}function xm({children:e,className:t,style:n,dense:s}){return l.jsx("td",{className:O(t,"text-accent-foreground",s?"px-3 py-2":"px-5 py-3"),style:n,children:e})}function ym(e=768){const[t,n]=p.useState(!1);return p.useEffect(()=>{const s=window.matchMedia(`(max-width: ${e}px)`),r=o=>n(o.matches);return n(s.matches),s.addEventListener("change",r),()=>s.removeEventListener("change",r)},[e]),t}const Fa=p.createContext(null);function Bs(){const e=p.useContext(Fa);if(!e)throw new Error("<Tab>, <TabList>, <TabPanel> must be inside <Tabs>");return e}const bm=({children:e,defaultActive:t=0,position:n="top",variant:s="solid",fullWidth:r=!1,radius:o=8,transitionDuration:i=200,bordered:a=!1,mobileBreakpoint:c=768,mobileVariant:u="scroll",backgroundColor:d,primaryColor:f="var(--primary)",activeColor:h="var(--foreground)",textColor:g="",hoverColor:x="var(--primary)",borderColor:y="var(--border)",disabledColor:b="var(--muted-foreground)",onTabChange:w,tabCount:S=0,style:v,className:j})=>{const[T,P]=p.useState(t),[k,C]=p.useState(S),[M,D]=p.useState(!1),B=p.useRef(null),V=ym(c);p.useEffect(()=>{!S&&B.current&&C(B.current.querySelectorAll("[data-tab-button]").length)},[S,e]),p.useEffect(()=>{V||D(!1)},[V]);const $=L=>{P(L),w?.(L),V&&u==="drawer"&&D(!1)},E=V&&(n==="left"||n==="right")?"top":n,N=E==="left"||E==="right";return l.jsx(Fa.Provider,{value:{active:T,setActive:$,variant:s,position:E,primaryColor:f,activeColor:h,textColor:g,hoverColor:x,borderColor:y,disabledColor:b,radius:o,transitionDuration:i,fullWidth:r,tabCount:k,isMobile:V,mobileVariant:u,drawerOpen:M,setDrawerOpen:D},children:l.jsxs("div",{ref:B,className:O("modern-tabs","text-foreground",N?"flex flex-row":"flex flex-col",E==="right"&&"flex-row-reverse",E==="bottom"&&"flex-col-reverse",a&&"border border-border",j),style:{background:d??"var(--background)",borderRadius:o,overflow:"hidden",...v},children:[l.jsx("style",{children:`
@keyframes tab-fade-in {
from { opacity: 0; transform: translateY(4px); }
to { opacity: 1; transform: translateY(0); }
}
@keyframes tab-drawer-open {
from { opacity: 0; transform: translateY(-6px); }
to { opacity: 1; transform: translateY(0); }
}
.tab-panel-active {
animation: tab-fade-in ${i}ms ease;
}
.tab-drawer-menu {
animation: tab-drawer-open ${i}ms ease;
}
.tab-scroll-strip {
overflow-x: auto;
scrollbar-width: none;
-ms-overflow-style: none;
scroll-snap-type: x mandatory;
-webkit-overflow-scrolling: touch;
}
.tab-scroll-strip::-webkit-scrollbar { display: none; }
.tab-scroll-strip [data-tab-button] {
scroll-snap-align: start;
flex-shrink: 0;
}
`}),e]})})},vm=({open:e})=>l.jsx("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",style:{transform:e?"rotate(180deg)":"rotate(0deg)",transition:"transform 200ms ease",display:"flex",flexShrink:0},children:l.jsx("polyline",{points:"6 9 12 15 18 9"})}),wm=({children:e,gap:t=8,drawerLabel:n="Select tab",style:s,className:r,triggerClassName:o,menuClassName:i})=>{const{position:a,isMobile:c,mobileVariant:u,drawerOpen:d,setDrawerOpen:f,radius:h,active:g}=Bs(),x=a==="left"||a==="right";if(c&&u==="drawer"){const w=p.Children.toArray(e)[g]?.props?.children??n;return l.jsxs("div",{className:O("relative w-full bg-background text-foreground",r),style:{padding:8,...s},children:[l.jsxs("button",{onClick:()=>f(!d),className:m("flex items-center justify-between w-full font-medium border border-border bg-background text-foreground hover:bg-accent transition-colors",o),style:{padding:"10px 16px",borderRadius:h,cursor:"pointer",fontSize:14},children:[l.jsx("span",{children:w}),l.jsx(vm,{open:d})]}),d&&l.jsx("div",{className:m("tab-drawer-menu absolute left-0 right-0 z-50 flex flex-col bg-background text-foreground border border-border",i),style:{top:"calc(100% + 4px)",borderRadius:h,boxShadow:"0 8px 24px rgba(0,0,0,0.12)",gap:4,padding:6},children:e})]})}return c&&u==="scroll"?l.jsx("div",{role:"tablist",className:O("tab-scroll-strip flex flex-row w-full bg-background text-foreground",r),style:{gap:t,padding:8,...s},children:e}):c&&u==="stack"?l.jsx("div",{role:"tablist",className:O("flex flex-col w-full bg-background text-foreground",r),style:{gap:t,padding:8,...s},children:e}):c&&u==="collapse"?l.jsx("div",{role:"tablist",className:O("flex flex-row flex-wrap w-full bg-background text-foreground",r),style:{gap:t,padding:8,...s},children:e}):l.jsx("div",{role:"tablist",className:O("flex text-foreground",x?"flex-col":"flex-row",x?"min-w-40":"w-full",r),style:{gap:t,padding:8,...s},children:e})},jm=({children:e,index:t,icon:n,disabled:s=!1,ariaLabel:r,className:o,iconClassName:i})=>{const{active:a,setActive:c,variant:u,tabCount:d,isMobile:f,mobileVariant:h}=Bs(),g=p.useRef(t),x=p.useRef(null),y=()=>{if(g.current!==void 0)return g.current;if(!x.current)return 0;const P=x.current.closest("[role=tablist], .tab-drawer-menu")?.querySelectorAll("[data-tab-button]");return P?Array.from(P).indexOf(x.current):0},b=y()===a,w=P=>{const k=d||1,C=y();P.key==="ArrowRight"||P.key==="ArrowDown"?(P.preventDefault(),c((C+1)%k)):(P.key==="ArrowLeft"||P.key==="ArrowUp")&&(P.preventDefault(),c((C-1+k)%k))},S=f&&(h==="stack"||h==="drawer"||h==="collapse"),v=u==="outline"?"border border-border bg-transparent":u==="underline"?"!border-b-2 border-transparent rounded-none":u==="pill"?"!rounded-full":"border-none",j=u==="solid"||u==="pill"?"bg-primary text-primary-foreground":u==="outline"?"border-primary text-primary !bg-primary/5":u==="underline"?"!border-primary !text-primary":"",T=u==="underline"?"hover:text-foreground":"hover:bg-accent hover:text-foreground";return l.jsxs("button",{ref:x,"data-tab-button":!0,role:"tab","aria-selected":b,"aria-label":r,disabled:s,onClick:()=>!s&&c(y()),onKeyDown:w,className:O("flex items-center rounded-lg justify-center gap-2 font-medium select-none transition-all","text-muted-foreground text-sm whitespace-nowrap",!s&&"cursor-pointer",s&&"opacity-60 cursor-not-allowed",S&&"w-full",v,!s&&T,b&&"text-foreground",b&&j,o),style:{padding:"10px 16px"},children:[n&&l.jsx("span",{className:m("shrink-0",i),children:n}),e]})},Sm=({children:e,style:t,className:n})=>l.jsx("div",{className:O("flex-1 min-w-0 text-foreground",n),style:{...t},children:e}),Tm=({children:e,index:t,keepMounted:n=!1,style:s,className:r})=>{const{active:o}=Bs(),i=t===o;return!n&&!i?null:l.jsx("div",{role:"tabpanel",hidden:!i,className:O(i&&"tab-panel-active","text-foreground",r),style:{display:i?void 0:"none",...s},children:e})},Cm=({context:e,className:t="",sunClassName:n,moonClassName:s})=>{const{isDark:r,toggleTheme:o}=e;return l.jsxs("button",{onClick:o,type:"button","aria-label":r?"Switch to light mode":"Switch to dark mode",className:m("relative flex h-9 w-9 shrink-0 items-center justify-center overflow-hidden rounded-full","text-foreground transition-colors duration-200 hover:bg-accent","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background",t),children:[l.jsx(H.Sun,{size:18,"aria-hidden":"true",className:m("absolute text-warning transition-all duration-300",r?"rotate-0 scale-100 opacity-100":"-rotate-90 scale-0 opacity-0",n)}),l.jsx(H.Moon,{size:18,"aria-hidden":"true",className:m("absolute text-info transition-all duration-300",r?"rotate-90 scale-0 opacity-0":"rotate-0 scale-100 opacity-100",s)})]})},gn=p.createContext("md"),Fs={none:"",sm:"px-4 py-3",md:"px-6 py-4",lg:"px-8 py-6"},Oa=p.forwardRef(function({variant:t="default",padding:n="md",hoverable:s=!1,className:r,children:o,...i},a){const c={default:"bg-card text-card-foreground border border-border",outline:"bg-transparent text-foreground border border-border",elevated:"bg-card text-card-foreground border border-border shadow-lg shadow-black/5",ghost:"bg-muted/50 text-foreground border border-transparent"};return l.jsx(gn.Provider,{value:n,children:l.jsx("div",{ref:a,className:m("rounded-xl transition-shadow",c[t]??c.default,s&&"hover:shadow-lg hover:shadow-black/10",r),...i,children:o})})});Oa.displayName="Card";const $a=p.forwardRef(function({title:t,description:n,icon:s,action:r,className:o,iconClassName:i,titleClassName:a,descriptionClassName:c,actionClassName:u,children:d,...f},h){const g=p.useContext(gn);return l.jsxs("div",{ref:h,className:m("flex items-start justify-between gap-3 border-b border-border",Fs[g],o),...f,children:[l.jsxs("div",{className:"flex min-w-0 items-start gap-3",children:[s&&l.jsx("span",{"aria-hidden":"true",className:m("flex h-6 shrink-0 items-center text-primary [&_svg]:h-5 [&_svg]:w-5",i),children:s}),l.jsxs("div",{className:"min-w-0",children:[t&&l.jsx("h3",{className:m("text-sm font-semibold leading-6 text-foreground",a),children:t}),n&&l.jsx("p",{className:m("text-xs text-muted-foreground",c),children:n}),d]})]}),r&&l.jsx("div",{className:m("shrink-0",u),children:r})]})});$a.displayName="CardHeader";const _a=p.forwardRef(function({className:t,children:n,...s},r){const o=p.useContext(gn);return l.jsx("div",{ref:r,className:m(Fs[o],t),...s,children:n})});_a.displayName="CardBody";const za=p.forwardRef(function({className:t,children:n,...s},r){const o=p.useContext(gn);return l.jsx("div",{ref:r,className:m("flex items-center justify-end gap-3 border-t border-border bg-accent/40","rounded-b-[inherit]",Fs[o],t),...s,children:n})});za.displayName="CardFooter";const ui={none:"my-0",sm:"my-2",md:"my-4",lg:"my-8"},Nm={none:"mx-0",sm:"mx-2",md:"mx-4",lg:"mx-8"},Ua=p.forwardRef(function({orientation:t="horizontal",label:n,dashed:s=!1,spacing:r="md",className:o,lineClassName:i,labelClassName:a,...c},u){return t==="vertical"?l.jsx("div",{ref:u,role:"separator","aria-orientation":"vertical",className:m("inline-block self-stretch w-px min-h-4 bg-border",s&&"bg-transparent border-l border-dashed border-border",Nm[r],o),...c}):n?l.jsxs("div",{ref:u,role:"separator","aria-orientation":"horizontal",className:m("flex items-center gap-3 text-xs text-muted-foreground",ui[r],o),...c,children:[l.jsx("span",{"aria-hidden":"true",className:m("h-px flex-1 bg-border",s&&"bg-transparent border-t border-dashed border-border",i)}),l.jsx("span",{className:m("shrink-0",a),children:n}),l.jsx("span",{"aria-hidden":"true",className:m("h-px flex-1 bg-border",s&&"bg-transparent border-t border-dashed border-border",i)})]}):l.jsx("div",{ref:u,role:"separator","aria-orientation":"horizontal",className:m("h-px w-full bg-border",s&&"bg-transparent border-t border-dashed border-border",ui[r],o),...c})});Ua.displayName="Divider";const di={sm:{root:"h-6 px-2 text-[11px] gap-1",icon:"w-3 h-3",remove:"w-3 h-3"},md:{root:"h-7 px-2.5 text-xs gap-1.5",icon:"w-3.5 h-3.5",remove:"w-3.5 h-3.5"},lg:{root:"h-8 px-3 text-sm gap-2",icon:"w-4 h-4",remove:"w-4 h-4"}},fi={primary:{solid:"bg-primary text-primary-foreground",soft:"bg-primary/10 text-primary",outline:"border border-primary text-primary"},neutral:{solid:"bg-foreground text-background",soft:"bg-muted text-foreground",outline:"border border-border text-foreground"},destructive:{solid:"bg-destructive text-destructive-foreground",soft:"bg-destructive/10 text-destructive",outline:"border border-destructive text-destructive"},success:{solid:"bg-success text-success-foreground",soft:"bg-success/10 text-success",outline:"border border-success text-success"}},Wa=p.forwardRef(function({label:t,variant:n="soft",color:s="primary",size:r="md",icon:o,onRemove:i,disabled:a=!1,className:c,iconClassName:u,labelClassName:d,removeButtonClassName:f,removeIconClassName:h,...g},x){const y=di[r]??di.md,b=fi[s]??fi.primary;return l.jsxs("span",{ref:x,className:m("inline-flex max-w-full items-center rounded-full font-medium select-none",y.root,b[n]??b.soft,a&&"opacity-50",c),...g,children:[o&&l.jsx("span",{"aria-hidden":"true",className:m("shrink-0 [&_svg]:w-full [&_svg]:h-full",y.icon,u),children:o}),l.jsx("span",{className:m("min-w-0 truncate",d),children:t}),i&&l.jsx("button",{type:"button","aria-label":typeof t=="string"?`Remove ${t}`:"Remove",disabled:a,onClick:i,className:m("shrink-0 -mr-0.5 rounded-full opacity-70 transition-opacity","hover:opacity-100 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",a&&"cursor-not-allowed",f),children:l.jsx(H.X,{"aria-hidden":"true",className:m(y.remove,h)})})]})});Wa.displayName="Chip";const Ka=p.forwardRef(function({children:t,size:n="md",className:s,...r},o){return l.jsx("kbd",{ref:o,className:m("inline-flex items-center justify-center align-middle whitespace-nowrap select-none","rounded-md border border-border bg-muted font-mono font-medium leading-none text-muted-foreground","shadow-[0_2px_0_0_var(--border)]",n==="sm"?"min-w-5 h-5 px-1 text-[10px]":"min-w-6 h-6 px-1.5 text-xs",s),...r,children:t})});Ka.displayName="Kbd";const Ha=p.forwardRef(function({variant:t="text",width:n,height:s,lines:r=1,animated:o=!0,className:i,lineClassName:a,style:c,...u},d){const f=m("bg-muted",o&&"animate-pulse motion-reduce:animate-none");return t==="text"&&r>1?l.jsx("div",{ref:d,"aria-hidden":"true",className:m("w-full space-y-2",i),style:{width:n,...c},...u,children:Array.from({length:r},(h,g)=>l.jsx("div",{className:m(f,"h-4 rounded",g===r-1?"w-3/5":"w-full",a)},g))}):l.jsx("div",{ref:d,"aria-hidden":"true",className:m(f,t==="circular"&&"rounded-full",t==="rectangular"&&"rounded-lg",t==="text"&&"h-4 rounded",i),style:{width:n??(t==="circular"?40:"100%"),height:s??(t==="circular"?40:t==="rectangular"?96:void 0),...c},...u})});Ha.displayName="Skeleton";const hi={xs:"w-3 h-3 border-2",sm:"w-4 h-4 border-2",md:"w-6 h-6 border-2",lg:"w-8 h-8 border-[3px]",xl:"w-12 h-12 border-4"},Ga=p.forwardRef(function({size:t="md",label:n="Loading…",colorClassName:s,labelClassName:r,className:o,...i},a){return l.jsxs("span",{ref:a,role:"status",className:m("inline-flex items-center justify-center",o),...i,children:[l.jsx("span",{"aria-hidden":"true",className:m("inline-block rounded-full border-current border-t-transparent animate-spin motion-reduce:animate-[spin_1.5s_linear_infinite]",hi[t]??hi.md,s??"text-primary")}),l.jsx("span",{className:m("sr-only",r),children:n})]})});Ga.displayName="Spinner";const mi={sm:"h-1",md:"h-2",lg:"h-3"},pi={sm:32,md:48,lg:64},Ya=p.forwardRef(function({value:t,max:n=100,variant:s="linear",size:r="md",showValue:o=!1,label:i,colorClassName:a,trackClassName:c,fillClassName:u,valueClassName:d,className:f,...h},g){const x=t==null,y=x?0:Math.min(Math.max(t,0),n),b=x?0:Math.round(y/n*100),w={role:"progressbar","aria-label":i,"aria-valuemin":0,"aria-valuemax":n,"aria-valuenow":x?void 0:y};if(s==="circular"){const S=pi[r]??pi.md,v=r==="sm"?3:4,j=(S-v)/2,T=2*Math.PI*j,P=T*(1-b/100);return l.jsxs("div",{ref:g,...w,className:m("relative inline-flex items-center justify-center",f),...h,children:[l.jsxs("svg",{width:S,height:S,viewBox:`0 0 ${S} ${S}`,className:m(x&&"animate-spin"),"aria-hidden":"true",children:[l.jsx("circle",{cx:S/2,cy:S/2,r:j,fill:"none",strokeWidth:v,className:m("stroke-muted",c)}),l.jsx("circle",{cx:S/2,cy:S/2,r:j,fill:"none",strokeWidth:v,strokeLinecap:"round",strokeDasharray:T,strokeDashoffset:x?T*.75:P,transform:`rotate(-90 ${S/2} ${S/2})`,className:m("transition-[stroke-dashoffset] duration-300",a??"stroke-primary",u)})]}),o&&!x&&l.jsxs("span",{className:m("absolute font-semibold tabular-nums text-foreground",r==="lg"?"text-xs":"text-[10px]",d),children:[b,"%"]})]})}return l.jsxs("div",{ref:g,className:m("flex w-full items-center gap-3",f),...h,children:[l.jsx("div",{...w,className:m("w-full overflow-hidden rounded-full bg-muted",mi[r]??mi.md,c),children:l.jsx("div",{className:m("h-full rounded-full transition-[width] duration-300",a??"bg-primary",x&&"w-1/3 animate-[progress-indeterminate_1.2s_ease-in-out_infinite] motion-reduce:animate-none",u),style:x?void 0:{width:`${b}%`}})}),o&&!x&&l.jsxs("span",{className:m("shrink-0 text-xs font-medium tabular-nums text-muted-foreground",d),children:[b,"%"]})]})});Ya.displayName="Progress";const Xa=p.forwardRef(function({label:t,value:n,icon:s,trend:r,trendValue:o,description:i,bordered:a=!0,className:c,headerClassName:u,labelClassName:d,iconClassName:f,valueClassName:h,footerClassName:g,trendClassName:x,trendIconClassName:y,descriptionClassName:b,...w},S){const v=r==="up"?H.TrendingUp:r==="down"?H.TrendingDown:H.Minus;return l.jsxs("div",{ref:S,className:m("min-w-0",a&&"rounded-xl border border-border bg-card p-5",c),...w,children:[l.jsxs("div",{className:m("flex items-start justify-between gap-3",u),children:[l.jsx("p",{className:m("text-xs font-medium uppercase tracking-wide text-muted-foreground",d),children:t}),s&&l.jsx("span",{"aria-hidden":"true",className:m("shrink-0 rounded-lg bg-primary/10 p-2 text-primary [&_svg]:h-4 [&_svg]:w-4",f),children:s})]}),l.jsx("p",{className:m("mt-2 truncate text-2xl font-bold tabular-nums text-foreground",h),children:n}),(r||i)&&l.jsxs("div",{className:m("mt-2 flex flex-wrap items-center gap-2 text-xs",g),children:[r&&l.jsxs("span",{className:m("inline-flex items-center gap-1 rounded-full px-1.5 py-0.5 font-medium",r==="up"&&"bg-success/10 text-success",r==="down"&&"bg-destructive/10 text-destructive",r==="neutral"&&"bg-muted text-muted-foreground",x),children:[l.jsx(v,{"aria-hidden":"true",className:m("h-3 w-3",y)}),o]}),i&&l.jsx("span",{className:m("text-muted-foreground",b),children:i})]})]})});Xa.displayName="Stat";const gi={sm:{root:"py-8 px-4",icon:"h-10 w-10 [&_svg]:h-5 [&_svg]:w-5",title:"text-sm",desc:"text-xs max-w-xs"},md:{root:"py-12 px-6",icon:"h-12 w-12 [&_svg]:h-6 [&_svg]:w-6",title:"text-base",desc:"text-sm max-w-sm"},lg:{root:"py-16 px-8",icon:"h-14 w-14 [&_svg]:h-7 [&_svg]:w-7",title:"text-lg",desc:"text-sm max-w-md"}},qa=p.forwardRef(function({icon:t,title:n,description:s,action:r,size:o="md",className:i,iconClassName:a,titleClassName:c,descriptionClassName:u,actionClassName:d,...f},h){const g=gi[o]??gi.md;return l.jsxs("div",{ref:h,className:m("flex w-full flex-col items-center justify-center text-center",g.root,i),...f,children:[l.jsx("span",{"aria-hidden":"true",className:m("mb-4 inline-flex items-center justify-center rounded-full bg-muted text-muted-foreground",g.icon,a),children:t??l.jsx(H.Inbox,{})}),l.jsx("h3",{className:m("font-semibold text-foreground",g.title,c),children:n}),s&&l.jsx("p",{className:m("mt-1 text-muted-foreground",g.desc,u),children:s}),r&&l.jsx("div",{className:m("mt-5",d),children:r})]})});qa.displayName="EmptyState";const km={done:"bg-primary text-primary-foreground border-primary",active:"bg-primary/15 text-primary border-primary",pending:"bg-muted text-muted-foreground border-border"},Za=p.forwardRef(function({items:t,size:n="md",className:s,itemClassName:r,connectorClassName:o,dotClassName:i,contentClassName:a,titleClassName:c,timeClassName:u,descriptionClassName:d,...f},h){const g=n==="sm";return l.jsx("ol",{ref:h,className:m("relative",s),...f,children:t.map((x,y)=>{const b=x.status??"pending",w=y===t.length-1;return l.jsxs("li",{className:m("relative flex gap-4",!w&&(g?"pb-6":"pb-8"),r),children:[!w&&l.jsx("span",{"aria-hidden":"true",className:m("absolute top-8 bottom-0 w-px bg-border",g?"left-3.5 top-7":"left-4",o)}),l.jsx("span",{"aria-hidden":"true",className:m("relative z-10 flex shrink-0 items-center justify-center rounded-full border",g?"h-7 w-7 [&_svg]:h-3 [&_svg]:w-3":"h-8 w-8 [&_svg]:h-3.5 [&_svg]:w-3.5",km[b],i),children:x.icon??(b==="done"?l.jsx(H.Check,{}):l.jsx("span",{className:m("rounded-full",g?"h-1.5 w-1.5":"h-2 w-2",b==="active"?"bg-primary":"bg-muted-foreground/50")}))}),l.jsxs("div",{className:m("min-w-0 flex-1 pt-1",a),children:[l.jsxs("div",{className:"flex flex-wrap items-baseline justify-between gap-x-3 gap-y-0.5",children:[l.jsx("h4",{className:m("font-medium","text-sm",b==="pending"?"text-muted-foreground":"text-foreground",c),children:x.title}),x.time&&l.jsx("span",{className:m("text-xs text-muted-foreground",u),children:x.time})]}),x.description&&l.jsx("p",{className:m("mt-1 text-xs leading-relaxed text-muted-foreground",d),children:x.description})]})]},y)})})});Za.displayName="Timeline";const xi={sm:{text:"text-xs",icon:"[&_svg]:h-3 [&_svg]:w-3",sep:"h-3 w-3"},md:{text:"text-sm",icon:"[&_svg]:h-3.5 [&_svg]:w-3.5",sep:"h-3.5 w-3.5"}},Ja=p.forwardRef(function({items:t,separator:n,maxItems:s,size:r="md",className:o,listClassName:i,itemClassName:a,activeItemClassName:c,triggerClassName:u,iconClassName:d,labelClassName:f,separatorClassName:h,ellipsisClassName:g,...x},y){const b=xi[r]??xi.md;let w=t;return s&&s>=2&&t.length>s&&(w=[t[0],"ellipsis",...t.slice(t.length-(s-1))]),l.jsx("nav",{ref:y,"aria-label":"Breadcrumb",className:m("min-w-0",o),...x,children:l.jsx("ol",{className:m("flex flex-wrap items-center gap-1.5",b.text,i),children:w.map((S,v)=>{if(S==="ellipsis")return l.jsxs("li",{className:m("flex items-center gap-1.5 text-muted-foreground",g),children:[l.jsx(H.MoreHorizontal,{"aria-hidden":"true",className:b.sep}),l.jsx(H.ChevronRight,{"aria-hidden":"true",className:m(b.sep,"opacity-60")})]},"ellipsis");const j=v===w.length-1,T=l.jsxs(l.Fragment,{children:[S.icon&&l.jsx("span",{"aria-hidden":"true",className:m("shrink-0",b.icon,d),children:S.icon}),l.jsx("span",{className:m("truncate",f),children:S.label})]});return l.jsxs("li",{className:m("flex min-w-0 items-center gap-1.5",a),children:[j?l.jsx("span",{"aria-current":"page",className:m("flex min-w-0 items-center gap-1.5 font-medium text-foreground",c),children:T}):S.href?l.jsx("a",{href:S.href,onClick:S.onClick,className:m("flex min-w-0 items-center gap-1.5 rounded text-muted-foreground transition-colors","hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",u),children:T}):l.jsx("button",{type:"button",onClick:S.onClick,className:m("flex min-w-0 items-center gap-1.5 rounded text-muted-foreground transition-colors","hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",u),children:T}),!j&&l.jsx("span",{"aria-hidden":"true",className:m("shrink-0 text-muted-foreground/60",h),children:n??l.jsx(H.ChevronRight,{className:b.sep})})]},`${v}-${typeof S.label=="string"?S.label:"item"}`)})})})});Ja.displayName="Breadcrumb";const yi={sm:"h-7 min-w-7 px-1 text-xs [&_svg]:h-3.5 [&_svg]:w-3.5",md:"h-9 min-w-9 px-1.5 text-sm [&_svg]:h-4 [&_svg]:w-4",lg:"h-11 min-w-11 px-2 text-base [&_svg]:h-5 [&_svg]:w-5"},Pm=(e,t,n)=>{const s=n*2+5;if(t<=s)return Array.from({length:t},(u,d)=>d+1);const r=Math.max(e-n,1),o=Math.min(e+n,t),i=r>2,a=o<t-1,c=[];for(let u=i?r:1;u<=(a?o:t);u++)c.push(u);return[...i?[1,"ellipsis-l"]:[],...c,...a?["ellipsis-r",t]:[]]},Qa=p.forwardRef(function({page:t,totalPages:n,onPageChange:s,siblingCount:r=1,size:o="md",disabled:i=!1,className:a,prevButtonClassName:c,nextButtonClassName:u,pageButtonClassName:d,activePageButtonClassName:f,ellipsisClassName:h,...g},x){if(n<1)return null;const y=Math.min(Math.max(t,1),n),b=Pm(y,n,Math.max(r,0)),w=yi[o]??yi.md,S=j=>{if(i)return;const T=Math.min(Math.max(j,1),n);T!==y&&s?.(T)},v=m("inline-flex items-center justify-center rounded-lg font-medium transition-colors","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background","disabled:pointer-events-none disabled:opacity-40",w);return l.jsxs("nav",{ref:x,"aria-label":"Pagination",className:m("flex flex-wrap items-center gap-1",a),...g,children:[l.jsx("button",{type:"button","aria-label":"Previous page",disabled:i||y<=1,onClick:()=>S(y-1),className:m(v,"text-muted-foreground hover:bg-accent hover:text-foreground",c),children:l.jsx(H.ChevronLeft,{"aria-hidden":"true"})}),b.map(j=>typeof j!="number"?l.jsx("span",{"aria-hidden":"true",className:m("inline-flex items-center justify-center text-muted-foreground",w,h),children:l.jsx(H.MoreHorizontal,{})},j):l.jsx("button",{type:"button","aria-label":`Page ${j}`,"aria-current":j===y?"page":void 0,disabled:i,onClick:()=>S(j),className:m(v,"tabular-nums",j===y?"bg-primary text-primary-foreground":"text-muted-foreground hover:bg-accent hover:text-foreground",d,j===y&&f),children:j},j)),l.jsx("button",{type:"button","aria-label":"Next page",disabled:i||y>=n,onClick:()=>S(y+1),className:m(v,"text-muted-foreground hover:bg-accent hover:text-foreground",u),children:l.jsx(H.ChevronRight,{"aria-hidden":"true"})})]})});Qa.displayName="Pagination";const bi={sm:{dot:"h-7 w-7 text-xs [&_svg]:h-3.5 [&_svg]:w-3.5",label:"text-xs",desc:"text-[11px]"},md:{dot:"h-9 w-9 text-sm [&_svg]:h-4 [&_svg]:w-4",label:"text-sm",desc:"text-xs"}},el=p.forwardRef(function({steps:t,activeStep:n,onStepClick:s,orientation:r="horizontal",size:o="md",className:i,itemClassName:a,dotClassName:c,dotButtonClassName:u,connectorClassName:d,contentClassName:f,labelClassName:h,descriptionClassName:g,...x},y){const b=bi[o]??bi.md,w=r==="vertical",S=(v,j)=>{const T=v<n,P=v===n,k=!!s&&T,C=l.jsx("span",{"aria-hidden":"true",className:m("flex shrink-0 items-center justify-center rounded-full border-2 font-semibold transition-colors",b.dot,T&&"border-primary bg-primary text-primary-foreground",P&&"border-primary bg-primary/10 text-primary",!T&&!P&&"border-border bg-transparent text-muted-foreground",c),children:T?l.jsx(H.Check,{}):j.icon??v+1});return k?l.jsx("button",{type:"button",onClick:()=>s?.(v),"aria-label":typeof j.label=="string"?`Go to step: ${j.label}`:`Go to step ${v+1}`,className:m("rounded-full focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background",u),children:C}):C};return l.jsx("div",{ref:y,className:m(w?"flex flex-col":"flex w-full items-start",i),...x,children:t.map((v,j)=>{const T=j<n,P=j===n,k=j===t.length-1;return w?l.jsxs("div",{className:m("flex gap-3",a),children:[l.jsxs("div",{className:"flex flex-col items-center",children:[S(j,v),!k&&l.jsx("span",{"aria-hidden":"true",className:m("my-1 w-0.5 flex-1 min-h-6 rounded-full",T?"bg-primary":"bg-border",d)})]}),l.jsxs("div",{className:m("min-w-0 pb-6 pt-1",k&&"pb-0",f),children:[l.jsx("p",{"aria-current":P?"step":void 0,className:m("font-medium",b.label,P||T?"text-foreground":"text-muted-foreground",h),children:v.label}),v.description&&l.jsx("p",{className:m("mt-0.5 text-muted-foreground",b.desc,g),children:v.description})]})]},j):l.jsxs(p.Fragment,{children:[l.jsxs("div",{className:m("flex min-w-0 flex-col items-center gap-2 text-center",a),children:[S(j,v),l.jsxs("div",{className:m("min-w-0",f),children:[l.jsx("p",{"aria-current":P?"step":void 0,className:m("font-medium",b.label,P||T?"text-foreground":"text-muted-foreground",h),children:v.label}),v.description&&l.jsx("p",{className:m("mt-0.5 text-muted-foreground",b.desc,g),children:v.description})]})]}),!k&&l.jsx("span",{"aria-hidden":"true",className:m("mx-2 mt-4 h-0.5 flex-1 rounded-full",o==="sm"&&"mt-3.5",T?"bg-primary":"bg-border",d)})]},j)})})});el.displayName="Stepper";const vi={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"},wi={top:"top-full left-1/2 -translate-x-1/2 border-t-foreground border-x-transparent border-b-transparent",bottom:"bottom-full left-1/2 -translate-x-1/2 border-b-foreground border-x-transparent border-t-transparent",left:"left-full top-1/2 -translate-y-1/2 border-l-foreground border-y-transparent border-r-transparent",right:"right-full top-1/2 -translate-y-1/2 border-r-foreground border-y-transparent border-l-transparent"},tl=({content:e,children:t,position:n="top",delay:s=150,disabled:r=!1,className:o,contentClassName:i,arrowClassName:a})=>{const c=p.useId(),[u,d]=p.useState(!1),f=p.useRef(null),h=()=>{r||(f.current=setTimeout(()=>d(!0),s))},g=()=>{f.current&&clearTimeout(f.current),d(!1)};return p.useEffect(()=>{if(!u)return;const x=y=>{y.key==="Escape"&&g()};return document.addEventListener("keydown",x),()=>document.removeEventListener("keydown",x)},[u]),p.useEffect(()=>()=>{f.current&&clearTimeout(f.current)},[]),l.jsxs("span",{className:m("relative inline-flex",o),onMouseEnter:h,onMouseLeave:g,onFocus:h,onBlur:g,"aria-describedby":u?c:void 0,children:[t,u&&!r&&l.jsxs("span",{id:c,role:"tooltip",className:m("pointer-events-none absolute z-50 w-max max-w-60 rounded-md px-2.5 py-1.5","bg-foreground text-background text-xs font-medium shadow-lg wrap-break-word","animate-in fade-in",vi[n]??vi.top,i),children:[e,l.jsx("span",{"aria-hidden":"true",className:m("absolute border-4",wi[n]??wi.top,a)})]})]})};tl.displayName="Tooltip";const ji={top:{start:"bottom-full left-0 mb-2",center:"bottom-full left-1/2 -translate-x-1/2 mb-2",end:"bottom-full right-0 mb-2"},bottom:{start:"top-full left-0 mt-2",center:"top-full left-1/2 -translate-x-1/2 mt-2",end:"top-full right-0 mt-2"},left:{start:"right-full top-0 mr-2",center:"right-full top-1/2 -translate-y-1/2 mr-2",end:"right-full bottom-0 mr-2"},right:{start:"left-full top-0 ml-2",center:"left-full top-1/2 -translate-y-1/2 ml-2",end:"left-full bottom-0 ml-2"}},nl=p.forwardRef(function({trigger:t,children:n,position:s="bottom",align:r="center",open:o,defaultOpen:i=!1,onOpenChange:a,closeOnClickOutside:c=!0,closeOnEscape:u=!0,disabled:d=!1,className:f,triggerClassName:h,contentClassName:g,contentStyle:x},y){const b=p.useId(),w=p.useRef(null),[S,v]=p.useState(i),j=o!==void 0,T=j?o:S,P=p.useRef(k=>{j||v(k),a?.(k)});return P.current=k=>{j||v(k),a?.(k)},p.useEffect(()=>{if(!T)return;const k=M=>{c&&w.current&&!w.current.contains(M.target)&&P.current(!1)},C=M=>{u&&M.key==="Escape"&&P.current(!1)};return document.addEventListener("mousedown",k),document.addEventListener("keydown",C),()=>{document.removeEventListener("mousedown",k),document.removeEventListener("keydown",C)}},[T,c,u]),l.jsxs("div",{ref:k=>{w.current=k,typeof y=="function"?y(k):y&&(y.current=k)},className:m("relative inline-flex",f),children:[l.jsx("div",{role:"button",tabIndex:d?-1:0,"aria-haspopup":"dialog","aria-expanded":T,"aria-controls":T?b:void 0,onClick:()=>!d&&P.current(!T),onKeyDown:k=>{d||(k.key==="Enter"||k.key===" ")&&(k.preventDefault(),P.current(!T))},className:m("inline-flex rounded-lg",d&&"cursor-not-allowed opacity-50",h),children:t}),T&&l.jsx("div",{id:b,role:"dialog",className:m("absolute z-50 min-w-48 rounded-xl border border-border bg-popover p-4","text-sm text-popover-foreground shadow-xl","animate-in fade-in",ji[s]?.[r]??ji.bottom.center,g),style:x,children:n})]})});nl.displayName="Popover";const Si={sm:"h-1 [&::-webkit-slider-thumb]:h-3.5 [&::-webkit-slider-thumb]:w-3.5 [&::-moz-range-thumb]:h-3.5 [&::-moz-range-thumb]:w-3.5",md:"h-1.5 [&::-webkit-slider-thumb]:h-4 [&::-webkit-slider-thumb]:w-4 [&::-moz-range-thumb]:h-4 [&::-moz-range-thumb]:w-4",lg:"h-2 [&::-webkit-slider-thumb]:h-5 [&::-webkit-slider-thumb]:w-5 [&::-moz-range-thumb]:h-5 [&::-moz-range-thumb]:w-5"},sl=p.forwardRef(function({value:t,defaultValue:n,onChange:s,min:r=0,max:o=100,step:i=1,label:a,showValue:c=!1,formatValue:u,marks:d,size:f="md",disabled:h,id:g,className:x,wrapperClassName:y,labelRowClassName:b,labelClassName:w,valueClassName:S,marksClassName:v,markClassName:j,...T},P){const k=p.useId(),C=g??k,[M,D]=p.useState(n??r),B=t!==void 0?t:M,V=o===r?0:(B-r)/(o-r)*100,$=E=>{const N=Number(E.target.value);t===void 0&&D(N),s?.(N)};return l.jsxs("div",{className:m("w-full",y),children:[(a||c)&&l.jsxs("div",{className:m("mb-2 flex items-baseline justify-between gap-2",b),children:[a&&l.jsx("label",{htmlFor:C,className:m("text-[13px] font-medium leading-none text-foreground",w),children:a}),c&&l.jsx("span",{className:m("text-xs font-medium tabular-nums text-muted-foreground",S),children:u?u(B):B})]}),l.jsx("input",{ref:P,id:C,type:"range",min:r,max:o,step:i,value:B,onChange:$,disabled:h,style:{background:`linear-gradient(to right, var(--primary) ${V}%, var(--muted) ${V}%)`},className:m("w-full cursor-pointer appearance-none rounded-full outline-none transition-opacity",Si[f]??Si.md,"[&::-webkit-slider-thumb]:appearance-none [&::-webkit-slider-thumb]:rounded-full","[&::-webkit-slider-thumb]:border-2 [&::-webkit-slider-thumb]:border-primary","[&::-webkit-slider-thumb]:bg-background [&::-webkit-slider-thumb]:shadow","[&::-webkit-slider-thumb]:transition-transform [&::-webkit-slider-thumb]:hover:scale-110","[&::-moz-range-thumb]:appearance-none [&::-moz-range-thumb]:rounded-full","[&::-moz-range-thumb]:border-2 [&::-moz-range-thumb]:border-primary","[&::-moz-range-thumb]:bg-background [&::-moz-range-thumb]:shadow","focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background",h&&"cursor-not-allowed opacity-50",x),...T}),d&&d.length>0&&l.jsx("div",{className:m("relative mt-1.5 h-4 text-[10px] text-muted-foreground",v),children:d.map(E=>{const N=o===r?0:(E.value-r)/(o-r)*100;return l.jsx("span",{className:m("absolute whitespace-nowrap",N<=0?"translate-x-0":N>=100?"-translate-x-full":"-translate-x-1/2",j),style:{left:`${N}%`},children:E.label??E.value},E.value)})})]})});sl.displayName="Slider";const Ti={sm:{input:"h-8 text-xs",button:"w-8 [&_svg]:h-3 [&_svg]:w-3"},md:{input:"h-10 text-sm",button:"w-10 [&_svg]:h-3.5 [&_svg]:w-3.5"},lg:{input:"h-12 text-base",button:"w-12 [&_svg]:h-4 [&_svg]:w-4"}},Ci=(e,t,n)=>t!==void 0&&e<t?t:n!==void 0&&e>n?n:e,rl=p.forwardRef(function({value:t,defaultValue:n,onChange:s,min:r,max:o,step:i=1,label:a,error:c,helperText:u,size:d="md",disabled:f,id:h,className:g,wrapperClassName:x,labelClassName:y,inputWrapperClassName:b,decrementButtonClassName:w,incrementButtonClassName:S,helperTextClassName:v,...j},T){const P=p.useId(),k=h??P,C=u||c?`${k}-description`:void 0,M=Ti[d]??Ti.md,[D,B]=p.useState(n!==void 0?String(n):""),V=t!==void 0,$=V?t===null?"":String(t):D,E=$===""?null:Number($),N=A=>{V||B(A===null?"":String(A)),s?.(A)},L=A=>{const z=E!==null&&!Number.isNaN(E)?E:r??0;N(Ci(z+A*i,r,o))},K=A=>{const z=A.target.value;if(!/^-?\d*\.?\d*$/.test(z))return;V||B(z);const F=z===""||z==="-"?null:Number(z);s?.(F!==null&&Number.isNaN(F)?null:F)},R=()=>{if(E===null||Number.isNaN(E))return;const A=Ci(E,r,o);A!==E&&N(A)},I="flex shrink-0 items-center justify-center text-muted-foreground transition-colors hover:bg-accent hover:text-foreground disabled:pointer-events-none disabled:opacity-40 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-ring";return l.jsxs("div",{className:m("w-full",x),children:[a&&l.jsx("label",{htmlFor:k,className:m("mb-1.5 block text-[13px] font-medium leading-none text-foreground",y),children:a}),l.jsxs("div",{className:m("flex w-full items-stretch overflow-hidden rounded-lg border bg-transparent transition-colors","dark:bg-input/30",c?"border-destructive":"border-input","focus-within:ring-2 focus-within:ring-ring/40 focus-within:border-ring",f&&"opacity-50",b),children:[l.jsx("button",{type:"button",tabIndex:-1,"aria-label":"Decrease value",disabled:f||E!==null&&r!==void 0&&E<=r,onClick:()=>L(-1),className:m(I,M.button,"border-r border-input",w),children:l.jsx(H.Minus,{"aria-hidden":"true"})}),l.jsx("input",{ref:T,id:k,type:"text",inputMode:"decimal",role:"spinbutton","aria-valuenow":E??void 0,"aria-valuemin":r,"aria-valuemax":o,"aria-invalid":c?!0:void 0,"aria-describedby":C,value:$,onChange:K,onBlur:R,onKeyDown:A=>{A.key==="ArrowUp"?(A.preventDefault(),L(1)):A.key==="ArrowDown"&&(A.preventDefault(),L(-1))},disabled:f,className:m("w-full min-w-0 flex-1 bg-transparent text-center text-foreground outline-none","placeholder:text-muted-foreground disabled:cursor-not-allowed",M.input,g),...j}),l.jsx("button",{type:"button",tabIndex:-1,"aria-label":"Increase value",disabled:f||E!==null&&o!==void 0&&E>=o,onClick:()=>L(1),className:m(I,M.button,"border-l border-input",S),children:l.jsx(H.Plus,{"aria-hidden":"true"})})]}),(u||c)&&l.jsx("p",{id:C,role:c?"alert":void 0,className:m("mt-1.5 text-xs font-medium",c?"text-destructive":"text-muted-foreground",v),children:c||u})]})});rl.displayName="NumberInput";const Ni={sm:"h-4 w-4",md:"h-5 w-5",lg:"h-6 w-6"},il=p.forwardRef(function({value:t,defaultValue:n=0,onChange:s,max:r=5,size:o="md",readOnly:i=!1,disabled:a=!1,allowClear:c=!0,label:u="Rating",showValue:d=!1,colorClassName:f="text-warning",starClassName:h,emptyStarClassName:g,starWrapperClassName:x,valueClassName:y,className:b,...w},S){const v=p.useId(),[j,T]=p.useState(n),[P,k]=p.useState(null),C=t!==void 0?t:j,M=P??C,D=Ni[o]??Ni.md,B=V=>{if(i||a)return;const $=c&&V===C?0:V;t===void 0&&T($),s?.($)};if(i){const V=Math.min(Math.max(C/r,0),1)*100;return l.jsxs("div",{ref:S,role:"img","aria-label":`${u}: ${C} out of ${r}`,className:m("inline-flex items-center gap-2",b),...w,children:[l.jsxs("span",{className:"relative inline-flex","aria-hidden":"true",children:[l.jsx("span",{className:m("flex gap-0.5 text-muted-foreground/40",g),children:Array.from({length:r},($,E)=>l.jsx(H.Star,{className:m(D,h),fill:"currentColor",strokeWidth:0},E))}),l.jsx("span",{className:m("absolute inset-0 flex gap-0.5 overflow-hidden",f),style:{width:`${V}%`},children:Array.from({length:r},($,E)=>l.jsx(H.Star,{className:m(D,"shrink-0",h),fill:"currentColor",strokeWidth:0},E))})]}),d&&l.jsx("span",{className:m("text-sm font-medium tabular-nums text-foreground",y),children:C})]})}return l.jsxs("div",{ref:S,role:"radiogroup","aria-label":u,onMouseLeave:()=>k(null),className:m("inline-flex items-center gap-2",a&&"opacity-50",b),...w,children:[l.jsx("span",{className:"flex gap-0.5",children:Array.from({length:r},(V,$)=>{const E=$+1,N=E<=M;return l.jsxs("label",{onMouseEnter:()=>!a&&k(E),className:m(!a&&"cursor-pointer",x),children:[l.jsx("input",{type:"radio",name:v,value:E,checked:C===E,onChange:()=>B(E),disabled:a,className:"sr-only peer","aria-label":`${E} of ${r}`}),l.jsx(H.Star,{"aria-hidden":"true",className:m(D,"transition-colors",N?f:m("text-muted-foreground/40",g),"peer-focus-visible:rounded peer-focus-visible:ring-2 peer-focus-visible:ring-ring",h),fill:N?"currentColor":"none",strokeWidth:N?0:1.5})]},E)})}),d&&l.jsx("span",{className:m("text-sm font-medium tabular-nums text-foreground",y),children:C})]})});il.displayName="Rating";const ki={sm:{root:"min-h-8 px-2 py-1 gap-1",chip:"h-5 px-1.5 text-[11px]",input:"text-xs h-5"},md:{root:"min-h-10 px-2.5 py-1.5 gap-1.5",chip:"h-6 px-2 text-xs",input:"text-sm h-6"},lg:{root:"min-h-12 px-3 py-2 gap-2",chip:"h-7 px-2.5 text-sm",input:"text-base h-7"}},ol=p.forwardRef(function({value:t,defaultValue:n=[],onChange:s,label:r,placeholder:o="Add a tag…",maxTags:i,validate:a,addOnBlur:c=!0,error:u,helperText:d,size:f="md",disabled:h=!1,id:g,className:x,wrapperClassName:y,labelClassName:b,chipClassName:w,chipRemoveClassName:S,inputClassName:v,helperClassName:j,countClassName:T},P){const k=p.useId(),C=g??k,M=d||u?`${C}-description`:void 0,D=ki[f]??ki.md,B=p.useRef(null),[V,$]=p.useState(n),[E,N]=p.useState(""),L=t!==void 0?t:V,K=i!==void 0&&L.length>=i,R=F=>{t===void 0&&$(F),s?.(F)},I=F=>{const W=F.trim();if(!(!W||h||K)){if(L.includes(W)){N("");return}a&&!a(W)||(R([...L,W]),N(""))}},A=F=>{h||R(L.filter((W,G)=>G!==F))},z=F=>{F.key==="Enter"||F.key===","?(F.preventDefault(),I(E)):F.key==="Backspace"&&E===""&&L.length>0&&A(L.length-1)};return l.jsxs("div",{className:m("w-full",y),children:[r&&l.jsx("label",{htmlFor:C,className:m("mb-1.5 block text-[13px] font-medium leading-none text-foreground",b),children:r}),l.jsxs("div",{onClick:()=>B.current?.focus(),className:m("flex w-full cursor-text flex-wrap items-center rounded-lg border bg-transparent transition-colors","dark:bg-input/30",u?"border-destructive":"border-input","focus-within:ring-2 focus-within:ring-ring/40 focus-within:border-ring",h&&"cursor-not-allowed opacity-50",D.root,x),children:[L.map((F,W)=>l.jsxs("span",{className:m("inline-flex items-center gap-1 rounded-full bg-primary/10 font-medium text-primary",D.chip,w),children:[l.jsx("span",{className:"max-w-40 truncate",children:F}),l.jsx("button",{type:"button","aria-label":`Remove ${F}`,disabled:h,onClick:G=>{G.stopPropagation(),A(W)},className:m("rounded-full opacity-70 transition-opacity hover:opacity-100 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",S),children:l.jsx(H.X,{"aria-hidden":"true",className:"h-3 w-3"})})]},`${F}-${W}`)),l.jsx("input",{ref:F=>{B.current=F,typeof P=="function"?P(F):P&&(P.current=F)},id:C,type:"text",value:E,onChange:F=>N(F.target.value),onKeyDown:z,onBlur:()=>c&&I(E),placeholder:K?"":o,disabled:h||K,"aria-invalid":u?!0:void 0,"aria-describedby":M,className:m("min-w-20 flex-1 bg-transparent text-foreground outline-none","placeholder:text-muted-foreground disabled:cursor-not-allowed",D.input,v)})]}),(d||u||i!==void 0)&&l.jsxs("div",{className:"mt-1.5 flex items-baseline justify-between gap-2",children:[l.jsx("p",{id:M,role:u?"alert":void 0,className:m("text-xs font-medium",u?"text-destructive":"text-muted-foreground",j),children:u||d}),i!==void 0&&l.jsxs("span",{className:m("shrink-0 text-[11px] tabular-nums text-muted-foreground",T),children:[L.length,"/",i]})]})]})});ol.displayName="TagInput";const Pi={sm:"h-9 w-9 text-sm rounded-md",md:"h-11 w-11 text-base rounded-lg",lg:"h-12 w-12 text-lg rounded-lg"},al=p.forwardRef(function({length:t=4,value:n,defaultValue:s="",onChange:r,onComplete:o,type:i="numeric",mask:a=!1,size:c="md",disabled:u=!1,error:d=!1,autoFocus:f=!1,label:h="PIN input",id:g,className:x,boxClassName:y},b){const w=p.useId(),S=g??w,v=p.useRef([]),[j,T]=p.useState(s.slice(0,t)),P=(n!==void 0?n:j).slice(0,t),k=Array.from({length:t},(N,L)=>P[L]??""),C=i==="numeric"?/^[0-9]$/:/^[a-zA-Z0-9]$/,M=N=>{n===void 0&&T(N),r?.(N),N.length===t&&o?.(N)},D=(N,L)=>{const K=k.slice();K[N]=L,M(K.join("").slice(0,t))},B=N=>{v.current[Math.min(Math.max(N,0),t-1)]?.focus()},V=(N,L)=>{const K=L.target.value.slice(-1);if(K===""){D(N,"");return}C.test(K)&&(D(N,K),B(N+1))},$=(N,L)=>{L.key==="Backspace"?(k[N]?D(N,""):(B(N-1),D(N-1,"")),L.preventDefault()):L.key==="ArrowLeft"?(L.preventDefault(),B(N-1)):L.key==="ArrowRight"&&(L.preventDefault(),B(N+1))},E=N=>{N.preventDefault();const L=N.clipboardData.getData("text").split("").filter(K=>C.test(K)).slice(0,t).join("");L&&(M(L),B(L.length-1))};return l.jsx("div",{ref:b,role:"group","aria-label":h,className:m("inline-flex items-center gap-2",x),children:k.map((N,L)=>l.jsx("input",{ref:K=>{v.current[L]=K},id:L===0?S:void 0,type:a?"password":"text",inputMode:i==="numeric"?"numeric":"text",autoComplete:L===0?"one-time-code":"off","aria-label":`Character ${L+1} of ${t}`,value:N,onChange:K=>V(L,K),onKeyDown:K=>$(L,K),onPaste:E,onFocus:K=>K.target.select(),disabled:u,autoFocus:f&&L===0,className:m("border bg-transparent text-center font-semibold text-foreground outline-none transition-colors","dark:bg-input/30 caret-primary",Pi[c]??Pi.md,d?"border-destructive":"border-input","focus-visible:ring-2 focus-visible:ring-ring/40 focus-visible:border-ring",u&&"cursor-not-allowed opacity-50",y)},L))})});al.displayName="PinInput";const Dm=e=>e<1024?`${e} B`:e<1024*1024?`${(e/1024).toFixed(1)} KB`:`${(e/(1024*1024)).toFixed(1)} MB`,ll=p.forwardRef(function({onFilesChange:t,onError:n,multiple:s=!1,accept:r,maxSizeMB:o,maxFiles:i,label:a="Click to upload or drag and drop",description:c,disabled:u=!1,hideFileList:d=!1,id:f,className:h,dropzoneClassName:g,iconClassName:x,labelClassName:y,descriptionClassName:b,errorClassName:w,listClassName:S,fileItemClassName:v,fileIconClassName:j,fileNameClassName:T,fileSizeClassName:P,removeButtonClassName:k},C){const M=p.useId(),D=f??M,B=p.useRef(null),[V,$]=p.useState([]),[E,N]=p.useState(!1),[L,K]=p.useState(null),R=A=>{if(u)return;K(null);let z=s?[...V]:[];for(const F of Array.from(A)){if(o&&F.size>o*1024*1024){const W=`"${F.name}" exceeds the ${o} MB limit`;K(W),n?.(W,F);continue}if(i&&z.length>=i){const W=`Maximum of ${i} files`;K(W),n?.(W,F);break}if(!z.some(W=>W.name===F.name&&W.size===F.size)&&(z.push(F),!s))break}$(z),t?.(z)},I=A=>{const z=V.filter((F,W)=>W!==A);$(z),t?.(z)};return l.jsxs("div",{className:m("w-full",h),children:[l.jsxs("label",{htmlFor:D,onDragOver:A=>{A.preventDefault(),u||N(!0)},onDragLeave:()=>N(!1),onDrop:A=>{A.preventDefault(),N(!1),R(A.dataTransfer.files)},className:m("flex w-full flex-col items-center justify-center gap-2 rounded-xl border-2 border-dashed px-6 py-10 text-center transition-colors",E?"border-primary bg-primary/5":"border-border bg-transparent hover:border-muted-foreground/50 hover:bg-accent/30",u?"cursor-not-allowed opacity-50":"cursor-pointer","focus-within:ring-2 focus-within:ring-ring focus-within:ring-offset-2 focus-within:ring-offset-background",g),children:[l.jsx("input",{ref:A=>{B.current=A,typeof C=="function"?C(A):C&&(C.current=A)},id:D,type:"file",multiple:s,accept:r,disabled:u,onChange:A=>{A.target.files&&R(A.target.files),A.target.value=""},className:"sr-only"}),l.jsx("span",{"aria-hidden":"true",className:m("rounded-full bg-muted p-3 text-muted-foreground",x),children:l.jsx(H.UploadCloud,{className:"h-6 w-6"})}),l.jsx("p",{className:m("text-sm font-medium text-foreground",y),children:a}),l.jsx("p",{className:m("text-xs text-muted-foreground",b),children:c??[r?`Accepted: ${r}`:null,o?`Max ${o} MB`:null,i?`Up to ${i} files`:null].filter(Boolean).join(" · ")})]}),L&&l.jsx("p",{role:"alert",className:m("mt-2 text-xs font-medium text-destructive",w),children:L}),!d&&V.length>0&&l.jsx("ul",{className:m("mt-3 space-y-2",S),children:V.map((A,z)=>l.jsxs("li",{className:m("flex items-center gap-3 rounded-lg border border-border bg-card px-3 py-2",v),children:[l.jsx(H.File,{"aria-hidden":"true",className:m("h-4 w-4 shrink-0 text-muted-foreground",j)}),l.jsxs("div",{className:"min-w-0 flex-1",children:[l.jsx("p",{className:m("truncate text-sm font-medium text-foreground",T),children:A.name}),l.jsx("p",{className:m("text-xs text-muted-foreground",P),children:Dm(A.size)})]}),l.jsx("button",{type:"button","aria-label":`Remove ${A.name}`,onClick:()=>I(z),className:m("shrink-0 rounded-md p-1.5 text-muted-foreground transition-colors hover:bg-accent hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",k),children:l.jsx(H.X,{"aria-hidden":"true",className:"h-4 w-4"})})]},`${A.name}-${A.size}-${z}`))})]})});ll.displayName="FileUpload";const Di={info:{soft:"border-info/30 bg-info/10 text-info",outline:"border-info/50 text-info",icon:H.Info},success:{soft:"border-success/30 bg-success/10 text-success",outline:"border-success/50 text-success",icon:H.CheckCircle},warning:{soft:"border-warning/30 bg-warning/10 text-warning",outline:"border-warning/50 text-warning",icon:H.AlertTriangle},error:{soft:"border-destructive/30 bg-destructive/10 text-destructive",outline:"border-destructive/50 text-destructive",icon:H.AlertCircle},neutral:{soft:"border-border bg-muted text-foreground",outline:"border-border text-foreground",icon:H.Info}},cl=p.forwardRef(function({type:t="info",variant:n="soft",title:s,children:r,icon:o,dismissible:i=!1,onDismiss:a,className:c,iconClassName:u,contentClassName:d,titleClassName:f,descriptionClassName:h,closeButtonClassName:g,...x},y){const[b,w]=p.useState(!1);if(b)return null;const S=Di[t]??Di.info,v=S.icon;return l.jsxs("div",{ref:y,role:t==="error"?"alert":"status",className:m("flex w-full items-start gap-3 rounded-xl border p-4",S[n]??S.soft,c),...x,children:[o!==null&&l.jsx("span",{"aria-hidden":"true",className:m("flex h-5 shrink-0 items-center [&_svg]:h-5 [&_svg]:w-5",u),children:o??l.jsx(v,{})}),l.jsxs("div",{className:m("min-w-0 flex-1",d),children:[s&&l.jsx("p",{className:m("text-sm font-semibold",f),children:s}),r&&l.jsx("div",{className:m("text-sm text-foreground/80",s&&"mt-1",h),children:r})]}),i&&l.jsx("button",{type:"button","aria-label":"Dismiss",onClick:()=>{a?.(),w(!0)},className:m("shrink-0 rounded-md p-1 opacity-70 transition-opacity hover:opacity-100 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",g),children:l.jsx(H.X,{"aria-hidden":"true",className:"h-4 w-4"})})]})});cl.displayName="Callout";const Ei={sm:"h-8 px-2.5 text-xs [&_svg]:h-3.5 [&_svg]:w-3.5",md:"h-9 px-3 text-sm [&_svg]:h-4 [&_svg]:w-4",lg:"h-11 px-4 text-base [&_svg]:h-5 [&_svg]:w-5"},ul=p.forwardRef(function({pressed:t,defaultPressed:n=!1,onPressedChange:s,variant:r="default",size:o="md",className:i,children:a,onClick:c,disabled:u,...d},f){const[h,g]=p.useState(n),x=t!==void 0?t:h;return l.jsx("button",{ref:f,type:"button","aria-pressed":x,disabled:u,onClick:y=>{c?.(y),t===void 0&&g(!x),s?.(!x)},className:m("inline-flex items-center justify-center gap-2 rounded-lg font-medium transition-colors","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background","disabled:pointer-events-none disabled:opacity-50",Ei[o]??Ei.md,r==="outline"&&"border border-border",x?"bg-accent text-foreground":"bg-transparent text-muted-foreground hover:bg-accent/60 hover:text-foreground",i),...d,children:a})});ul.displayName="Toggle";const Ai={sm:"h-8 px-2.5 text-xs [&_svg]:h-3.5 [&_svg]:w-3.5",md:"h-9 px-3 text-sm [&_svg]:h-4 [&_svg]:w-4",lg:"h-11 px-4 text-base [&_svg]:h-5 [&_svg]:w-5"},dl=p.forwardRef(function({options:t,type:n="single",value:s,defaultValue:r,onChange:o,size:i="md",fullWidth:a=!1,disabled:c=!1,className:u,itemClassName:d,iconClassName:f,...h},g){const[x,y]=p.useState(r??(n==="multiple"?[]:"")),b=s!==void 0?s:x,w=v=>n==="multiple"?Array.isArray(b)&&b.includes(v):b===v,S=v=>{let j;if(n==="multiple"){const T=Array.isArray(b)?b:[];j=T.includes(v)?T.filter(P=>P!==v):[...T,v]}else j=b===v?"":v;s===void 0&&y(j),o?.(j)};return l.jsx("div",{ref:g,role:"group",className:m("inline-flex items-stretch overflow-hidden rounded-lg border border-border bg-transparent",a&&"flex w-full",c&&"opacity-50",u),...h,children:t.map((v,j)=>{const T=w(v.value),P=c||v.disabled;return l.jsxs("button",{type:"button","aria-pressed":T,"aria-label":v.ariaLabel,disabled:P,onClick:()=>S(v.value),className:m("inline-flex items-center justify-center gap-2 font-medium transition-colors","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-ring","disabled:pointer-events-none disabled:opacity-50",Ai[i]??Ai.md,a&&"flex-1",j>0&&"border-l border-border",T?"bg-primary/10 text-primary":"bg-transparent text-muted-foreground hover:bg-accent/60 hover:text-foreground",d),children:[v.icon&&l.jsx("span",{"aria-hidden":"true",className:m("shrink-0",f),children:v.icon}),v.label]},v.value)})})});dl.displayName="ToggleGroup";const Mi={sm:"h-7 px-1.5 text-xs [&_svg]:h-3.5 [&_svg]:w-3.5",md:"h-9 px-2 text-sm [&_svg]:h-4 [&_svg]:w-4",lg:"h-11 px-3 text-base [&_svg]:h-5 [&_svg]:w-5"},Ri={sm:"w-7 px-0 justify-center",md:"w-9 px-0 justify-center",lg:"w-11 px-0 justify-center"},fl=p.forwardRef(function({value:t,label:n,feedbackDuration:s=1500,size:r="md",onCopied:o,className:i,iconClassName:a,labelClassName:c,onClick:u,...d},f){const[h,g]=p.useState(!1),x=p.useRef(null);p.useEffect(()=>()=>{x.current&&clearTimeout(x.current)},[]);const y=async b=>{u?.(b);try{if(navigator.clipboard&&window.isSecureContext)await navigator.clipboard.writeText(t);else{const w=document.createElement("textarea");w.value=t,w.style.position="fixed",w.style.opacity="0",document.body.appendChild(w),w.select(),document.execCommand("copy"),document.body.removeChild(w)}g(!0),o?.(t),x.current&&clearTimeout(x.current),x.current=setTimeout(()=>g(!1),s)}catch{}};return l.jsxs("button",{ref:f,type:"button","aria-label":h?"Copied":"Copy to clipboard","aria-live":"polite",onClick:y,className:m("inline-flex items-center gap-1.5 rounded-lg font-medium transition-colors","text-muted-foreground hover:bg-accent hover:text-foreground","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring","disabled:pointer-events-none disabled:opacity-50",Mi[r]??Mi.md,!n&&(Ri[r]??Ri.md),i),...d,children:[h?l.jsx(H.Check,{"aria-hidden":"true",className:m("text-success",a)}):l.jsx(H.Copy,{"aria-hidden":"true",className:m(a)}),n&&l.jsx("span",{className:m(c),children:h?"Copied":n})]})});fl.displayName="CopyButton";const Ii={sm:"h-8 w-8 text-[10px]",md:"h-10 w-10 text-xs",lg:"h-12 w-12 text-sm"},hl=p.forwardRef(function({children:t,max:n,size:s="md",spacing:r="normal",className:o,itemClassName:i,counterClassName:a,...c},u){const d=p.Children.toArray(t),f=n&&n>0?d.slice(0,n):d,h=d.length-f.length;return l.jsxs("div",{ref:u,className:m("flex items-center",r==="tight"?"-space-x-3":"-space-x-2",o),...c,children:[f.map((g,x)=>l.jsx("span",{className:m("relative inline-flex rounded-full ring-2 ring-background",i),style:{zIndex:f.length-x},children:g},x)),h>0&&l.jsxs("span",{"aria-label":`${h} more`,className:m("relative z-0 inline-flex items-center justify-center rounded-full","bg-muted font-semibold text-muted-foreground ring-2 ring-background",Ii[s]??Ii.md,a),children:["+",h]})]})});hl.displayName="AvatarGroup";const Vi=(e,t)=>!!e&&!!t&&e.getFullYear()===t.getFullYear()&&e.getMonth()===t.getMonth()&&e.getDate()===t.getDate(),Wt=e=>new Date(e.getFullYear(),e.getMonth(),e.getDate()),Os=p.forwardRef(function({value:t,defaultValue:n=null,onChange:s,defaultMonth:r,minDate:o,maxDate:i,isDateDisabled:a,weekStartsOn:c=1,locale:u,className:d,headerClassName:f,navButtonClassName:h,monthLabelClassName:g,weekdaysClassName:x,weekdayClassName:y,daysClassName:b,dayClassName:w,...S},v){const[j,T]=p.useState(n),P=t!==void 0?t:j,[k,C]=p.useState(()=>{const I=P??r??new Date;return new Date(I.getFullYear(),I.getMonth(),1)}),M=Wt(new Date),D=o?Wt(o):null,B=i?Wt(i):null,V=I=>D&&I<D||B&&I>B?!0:a?.(I)??!1,$=I=>{t===void 0&&T(I),s?.(I),I.getMonth()!==k.getMonth()&&C(new Date(I.getFullYear(),I.getMonth(),1))},E=I=>C(A=>new Date(A.getFullYear(),A.getMonth()+I,1)),N=(k.getDay()-c+7)%7,L=Array.from({length:42},(I,A)=>{const z=new Date(k.getFullYear(),k.getMonth(),1-N+A);return Wt(z)}),K=Array.from({length:7},(I,A)=>new Date(2023,0,1+(A+c)%7).toLocaleDateString(u,{weekday:"narrow"})),R=k.toLocaleDateString(u,{month:"long",year:"numeric"});return l.jsxs("div",{ref:v,className:m("w-64 select-none",d),...S,children:[l.jsxs("div",{className:m("mb-2 flex items-center justify-between",f),children:[l.jsx("button",{type:"button","aria-label":"Previous month",onClick:()=>E(-1),className:m("rounded-lg p-1.5 text-muted-foreground transition-colors hover:bg-accent hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",h),children:l.jsx(H.ChevronLeft,{"aria-hidden":"true",className:"h-4 w-4"})}),l.jsx("span",{"aria-live":"polite",className:m("text-sm font-semibold text-foreground",g),children:R}),l.jsx("button",{type:"button","aria-label":"Next month",onClick:()=>E(1),className:m("rounded-lg p-1.5 text-muted-foreground transition-colors hover:bg-accent hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",h),children:l.jsx(H.ChevronRight,{"aria-hidden":"true",className:"h-4 w-4"})})]}),l.jsx("div",{className:m("grid grid-cols-7 text-center",x),children:K.map((I,A)=>l.jsx("span",{"aria-hidden":"true",className:m("py-1 text-[11px] font-medium text-muted-foreground",y),children:I},A))}),l.jsx("div",{className:m("grid grid-cols-7",b),children:L.map(I=>{const A=I.getMonth()!==k.getMonth(),z=V(I),F=Vi(I,P),W=Vi(I,M);return l.jsx("button",{type:"button",disabled:z,"aria-label":I.toLocaleDateString(u,{weekday:"long",year:"numeric",month:"long",day:"numeric"}),"aria-pressed":F,"aria-current":W?"date":void 0,onClick:()=>$(I),className:m("m-0.5 flex h-8 items-center justify-center rounded-lg text-xs tabular-nums transition-colors","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring","disabled:pointer-events-none disabled:opacity-30",F?"bg-primary font-semibold text-primary-foreground":m("hover:bg-accent",A?"text-muted-foreground/50":"text-foreground",W&&"border border-primary/50 font-semibold text-primary"),w),children:I.getDate()},I.toISOString())})})]})});Os.displayName="Calendar";const Li={sm:"h-8 px-2.5 text-xs [&_svg]:h-3.5 [&_svg]:w-3.5",md:"h-10 px-3 text-sm [&_svg]:h-4 [&_svg]:w-4",lg:"h-12 px-4 text-base [&_svg]:h-5 [&_svg]:w-5"},ml=p.forwardRef(function({value:t,defaultValue:n=null,onChange:s,placeholder:r="Pick a date",formatDate:o,label:i,error:a,helperText:c,size:u="md",disabled:d=!1,clearable:f=!1,calendarProps:h,id:g,className:x,wrapperClassName:y,labelClassName:b,iconClassName:w,textClassName:S,clearButtonClassName:v,clearIconClassName:j,panelClassName:T,helperClassName:P},k){const C=p.useId(),M=g??C,D=`${C}-panel`,B=c||a?`${M}-description`:void 0,V=p.useRef(null),[$,E]=p.useState(!1),[N,L]=p.useState(n),K=t!==void 0?t:N,R=A=>{t===void 0&&L(A),s?.(A)};p.useEffect(()=>{if(!$)return;const A=F=>{V.current&&!V.current.contains(F.target)&&E(!1)},z=F=>{F.key==="Escape"&&E(!1)};return document.addEventListener("mousedown",A),document.addEventListener("keydown",z),()=>{document.removeEventListener("mousedown",A),document.removeEventListener("keydown",z)}},[$]);const I=K?o?o(K):K.toLocaleDateString():null;return l.jsxs("div",{ref:V,className:m("relative w-full",y),children:[i&&l.jsx("label",{htmlFor:M,className:m("mb-1.5 block text-[13px] font-medium leading-none text-foreground",b),children:i}),l.jsxs("div",{className:"relative",children:[l.jsxs("button",{ref:k,id:M,type:"button",disabled:d,"aria-haspopup":"dialog","aria-expanded":$,"aria-controls":$?D:void 0,"aria-invalid":a?!0:void 0,"aria-describedby":B,onClick:()=>E(A=>!A),className:m("flex w-full items-center gap-2 rounded-lg border bg-transparent text-left transition-colors","dark:bg-input/30",a?"border-destructive":"border-input","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/40 focus-visible:border-ring",d&&"cursor-not-allowed opacity-50",Li[u]??Li.md,f&&K&&"pr-9",x),children:[l.jsx(H.Calendar,{"aria-hidden":"true",className:m("shrink-0 text-muted-foreground",w)}),l.jsx("span",{className:m("truncate",I?"text-foreground":"text-muted-foreground",S),children:I??r})]}),f&&K&&!d&&l.jsx("button",{type:"button","aria-label":"Clear date",onClick:()=>R(null),className:m("absolute right-2 top-1/2 -translate-y-1/2 rounded-md p-1 text-muted-foreground transition-colors hover:bg-accent hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",v),children:l.jsx(H.X,{"aria-hidden":"true",className:m("h-3.5 w-3.5",j)})})]}),$&&l.jsx("div",{id:D,role:"dialog","aria-label":"Choose date",className:m("absolute left-0 z-50 mt-2 rounded-xl border border-border bg-popover p-3 shadow-xl","animate-in fade-in",T),children:l.jsx(Os,{...h,value:K,onChange:A=>{R(A),E(!1)}})}),(c||a)&&l.jsx("p",{id:B,role:a?"alert":void 0,className:m("mt-1.5 text-xs font-medium",a?"text-destructive":"text-muted-foreground",P),children:a||c})]})});ml.displayName="DatePicker";const pl=p.forwardRef(function({children:t,defaultIndex:n=0,onIndexChange:s,autoPlay:r=0,loop:o=!0,showArrows:i=!0,showDots:a=!0,label:c="Carousel",className:u,trackClassName:d,slidesClassName:f,slideClassName:h,arrowClassName:g,prevArrowClassName:x,nextArrowClassName:y,arrowIconClassName:b,dotsClassName:w,dotClassName:S,...v},j){const T=p.Children.toArray(t),P=T.length,[k,C]=p.useState(()=>Math.min(Math.max(n,0),Math.max(P-1,0))),[M,D]=p.useState(!1),B=p.useRef(null),V=E=>{let N=E;o?N=(E+P)%P:N=Math.min(Math.max(E,0),P-1),C(N),s?.(N)};if(p.useEffect(()=>{if(!r||M||P<=1)return;const E=setInterval(()=>{C(N=>{const L=o?(N+1)%P:Math.min(N+1,P-1);return s?.(L),L})},r);return()=>clearInterval(E)},[r,M,P,o]),P===0)return null;const $=m("absolute top-1/2 z-10 -translate-y-1/2 rounded-full border border-border bg-background/80 p-2","text-foreground backdrop-blur transition-colors hover:bg-accent","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring","disabled:pointer-events-none disabled:opacity-40",g);return l.jsxs("div",{ref:j,role:"region","aria-roledescription":"carousel","aria-label":c,onMouseEnter:()=>D(!0),onMouseLeave:()=>D(!1),onFocus:()=>D(!0),onBlur:()=>D(!1),onKeyDown:E=>{E.key==="ArrowLeft"?(E.preventDefault(),V(k-1)):E.key==="ArrowRight"&&(E.preventDefault(),V(k+1))},className:m("relative w-full",u),...v,children:[l.jsx("div",{className:m("overflow-hidden rounded-xl",d),onTouchStart:E=>{B.current=E.touches[0].clientX},onTouchEnd:E=>{if(B.current===null)return;const N=E.changedTouches[0].clientX-B.current;B.current=null,Math.abs(N)>40&&V(N<0?k+1:k-1)},children:l.jsx("div",{className:m("flex transition-transform duration-300 ease-out motion-reduce:transition-none",f),style:{transform:`translateX(-${k*100}%)`},children:T.map((E,N)=>l.jsx("div",{role:"group","aria-roledescription":"slide","aria-label":`Slide ${N+1} of ${P}`,"aria-hidden":N!==k,inert:N!==k?!0:void 0,className:m("w-full shrink-0",h),children:E},N))})}),i&&P>1&&l.jsxs(l.Fragment,{children:[l.jsx("button",{type:"button","aria-label":"Previous slide",disabled:!o&&k===0,onClick:()=>V(k-1),className:m($,"left-3",x),children:l.jsx(H.ChevronLeft,{"aria-hidden":"true",className:m("h-4 w-4",b)})}),l.jsx("button",{type:"button","aria-label":"Next slide",disabled:!o&&k===P-1,onClick:()=>V(k+1),className:m($,"right-3",y),children:l.jsx(H.ChevronRight,{"aria-hidden":"true",className:m("h-4 w-4",b)})})]}),a&&P>1&&l.jsx("div",{className:m("mt-3 flex justify-center gap-1.5",w),children:T.map((E,N)=>l.jsx("button",{type:"button","aria-label":`Go to slide ${N+1}`,"aria-current":N===k?"true":void 0,onClick:()=>V(N),className:m("h-2 rounded-full transition-all","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",N===k?"w-5 bg-primary":"w-2 bg-muted-foreground/40 hover:bg-muted-foreground/70",S)},N))})]})});pl.displayName="Carousel";exports.Accordion=Da;exports.Avatar=Rl;exports.AvatarGroup=hl;exports.Badge=Oi;exports.Breadcrumb=Ja;exports.Button=Et;exports.Calendar=Os;exports.Callout=cl;exports.Card=Oa;exports.CardBody=_a;exports.CardFooter=za;exports.CardHeader=$a;exports.Carousel=pl;exports.Checkbox=Gh;exports.Chip=Wa;exports.Container=Fi;exports.CopyButton=fl;exports.DatePicker=ml;exports.Divider=Ua;exports.Drawer=Ia;exports.DrawerBody=Qh;exports.DrawerButton=sm;exports.DrawerContent=Jh;exports.DrawerFooter=tm;exports.DrawerHeader=em;exports.DrawerTriggerButton=nm;exports.Dropdown=ka;exports.EmptyState=qa;exports.FileUpload=ll;exports.Image=Bi;exports.Input=im;exports.Kbd=Ka;exports.List=_l;exports.ListItem=as;exports.Modal=Ba;exports.ModalBody=lm;exports.ModalButton=um;exports.ModalContent=om;exports.ModalFooter=cm;exports.ModalHeader=am;exports.ModalTriggerButton=dm;exports.NumberInput=rl;exports.Pagination=Qa;exports.PinInput=al;exports.Popover=nl;exports.Progress=Ya;exports.RadioGroup=Yh;exports.Rating=il;exports.Select=Va;exports.Skeleton=Ha;exports.Slider=sl;exports.Spinner=Ga;exports.Stat=Xa;exports.Stepper=el;exports.Switch=Xh;exports.TBody=mm;exports.TD=xm;exports.TH=gm;exports.THead=hm;exports.TRow=pm;exports.Tab=jm;exports.TabList=wm;exports.TabPanel=Tm;exports.TabPanels=Sm;exports.Table=fm;exports.Tabs=bm;exports.TagInput=ol;exports.Text=Cl;exports.Textarea=La;exports.ThemeToggleButton=Cm;exports.Timeline=Za;exports.ToastProvider=Wh;exports.Toggle=ul;exports.ToggleGroup=dl;exports.Tooltip=tl;exports.cn=m;exports.toast=Pa;exports.useToast=zh;
//# sourceMappingURL=index.cjs.map