@sudobility/components 5.0.7 → 5.0.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.umd.js CHANGED
@@ -52,7 +52,7 @@ Nonce: ${u}`}function a(i,h=24){const u=new Date(i.getTime()+h*60*60*1e3);return
52
52
  .animate-bounce-slow {
53
53
  animation: bounce-slow 4s ease-in-out infinite;
54
54
  }
55
- `,sl(b))}}},[e]),t.jsx("div",{ref:u,className:`${y()} ${s}`,children:o})},ll=({children:e,delay:r=0,className:a=""})=>t.jsx(ar,{animation:"fade-in-up",delay:r,className:a,children:e}),il=({children:e,delay:r=0,className:a=""})=>t.jsx(ar,{animation:"fade-in-scale",delay:r,className:a,children:e}),cl=({children:e,className:r=""})=>t.jsx(ar,{animation:"float",className:r,children:e}),dl=({isOpen:e,onClick:r,opacity:a="medium",blur:n=!1,zIndex:o=50,className:s,children:l})=>{const c={light:"bg-black/20 dark:bg-black/30",medium:"bg-black/50 dark:bg-black/60",dark:"bg-black/75 dark:bg-black/80"};return e?t.jsx("div",{onClick:r,className:f("fixed inset-0","transition-all duration-200",c[a],n&&"backdrop-blur-sm",s),style:{zIndex:o},role:"presentation","aria-hidden":"true",children:l}):null},gl={[ge.InfoType.INFO]:{icon:P.InformationCircleIcon,container:"bg-blue-50 dark:bg-blue-950 border-blue-200 dark:border-blue-800",iconColor:"text-blue-600 dark:text-blue-400",titleColor:"text-blue-900 dark:text-blue-100",descriptionColor:"text-blue-700 dark:text-blue-300"},[ge.InfoType.SUCCESS]:{icon:P.CheckCircleIcon,container:"bg-green-50 dark:bg-green-950 border-green-200 dark:border-green-800",iconColor:"text-green-600 dark:text-green-400",titleColor:"text-green-900 dark:text-green-100",descriptionColor:"text-green-700 dark:text-green-300"},[ge.InfoType.WARNING]:{icon:P.ExclamationTriangleIcon,container:"bg-yellow-50 dark:bg-amber-950 border-yellow-200 dark:border-amber-800",iconColor:"text-yellow-600 dark:text-amber-400",titleColor:"text-yellow-900 dark:text-amber-100",descriptionColor:"text-yellow-700 dark:text-amber-300"},[ge.InfoType.ERROR]:{icon:P.XCircleIcon,container:"bg-red-50 dark:bg-red-950 border-red-200 dark:border-red-800",iconColor:"text-red-600 dark:text-red-400",titleColor:"text-red-900 dark:text-red-100",descriptionColor:"text-red-700 dark:text-red-300"}},ul=({isVisible:e,onDismiss:r,title:a,description:n,variant:o=ge.InfoType.INFO,duration:s=5e3,icon:l,className:c,closeAriaLabel:d="Dismiss banner"})=>{const[i,h]=p.useState("hidden"),u=p.useRef(null),y=p.useRef(null),m=gl[o],b=m.icon,v=p.useCallback(()=>{u.current&&(clearTimeout(u.current),u.current=null),y.current&&(clearTimeout(y.current),y.current=null)},[]),k=p.useCallback(()=>{v(),h("exiting"),y.current=setTimeout(()=>{h("hidden"),r()},300)},[v,r]);if(p.useEffect(()=>{e?(h("entering"),y.current=setTimeout(()=>{h("visible")},10)):(i==="visible"||i==="entering")&&k()},[e]),p.useEffect(()=>(i==="visible"&&s>0&&(u.current=setTimeout(()=>{k()},s)),()=>{u.current&&clearTimeout(u.current)}),[i,s,k]),p.useEffect(()=>()=>v(),[v]),i==="hidden")return null;const S=t.jsx("div",{role:"alert","aria-live":"polite","data-testid":"banner",className:f("fixed inset-x-0 top-0 z-[100] w-full","transition-all duration-300 ease-out",i==="entering"||i==="exiting"?"-translate-y-full opacity-0":"translate-y-0 opacity-100"),children:t.jsxs("div",{className:f("flex items-start gap-3 p-4 border-b shadow-lg","backdrop-blur-sm",m.container,c),children:[t.jsx("div",{className:f("flex-shrink-0 mt-0.5",m.iconColor),children:l||t.jsx(b,{className:"h-5 w-5"})}),t.jsxs("div",{className:"flex-1 min-w-0",children:[t.jsx("p",{className:f("font-semibold",m.titleColor),children:a}),n&&t.jsx("p",{className:f("text-sm mt-1",m.descriptionColor),children:n})]}),t.jsx("button",{type:"button",onClick:k,className:f("flex-shrink-0 p-1 rounded-md transition-colors","hover:bg-black/10 dark:hover:bg-white/10","focus:outline-none focus:ring-2 focus:ring-offset-2","focus:ring-current"),"aria-label":d,children:t.jsx(P.XMarkIcon,{className:f("h-5 w-5",m.iconColor)})})]})});return hr.createPortal(S,document.body)},hl=(e={})=>{const{defaultDuration:r=5e3}=e,[a,n]=p.useState(!1),[o,s]=p.useState(null),l=p.useCallback(({title:d,description:i,variant:h=ge.InfoType.INFO,duration:u=r})=>{s({title:d,description:i,variant:h,duration:u}),n(!0)},[r]),c=p.useCallback(()=>{n(!1)},[]);return{isVisible:a,bannerProps:o,showBanner:l,hideBanner:c}},Yt=({isOpen:e,onClose:r,children:a,size:n="md",showCloseButton:o=!0,closeOnOutsideClick:s=!0,closeOnEscape:l=!0,className:c})=>{if(p.useEffect(()=>{if(!l||!e||!r)return;const h=u=>{u.key==="Escape"&&r()};return document.addEventListener("keydown",h),()=>document.removeEventListener("keydown",h)},[e,r,l]),!e)return null;const d={sm:"max-w-sm",md:"max-w-md",lg:"max-w-lg",xl:"max-w-xl",full:"max-w-full mx-4"},i=()=>{s&&r&&r()};return t.jsxs(be,{children:[t.jsx(Ze,{isOpen:e,onClose:i,opacity:"dark",blur:!0}),t.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center p-4",children:t.jsxs("div",{className:f("relative w-full",d[n],"bg-white dark:bg-gray-900","rounded-lg shadow-xl","animate-in fade-in zoom-in-95 duration-200",c),onClick:h=>h.stopPropagation(),children:[o&&r&&t.jsx("button",{onClick:r,className:"absolute top-4 right-4 z-10 text-gray-400 hover:text-gray-600 dark:hover:text-gray-200 transition-colors","aria-label":"Close dialog",children:t.jsx("svg",{className:"w-6 h-6",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:t.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})}),a]})})]})},fl=({isOpen:e,onClose:r,items:a,placeholder:n="Type a command or search...",emptyMessage:o="No results found.",className:s})=>{const[l,c]=p.useState(""),[d,i]=p.useState(0),h=p.useRef(null),u=a.filter(v=>{const k=l.toLowerCase();return v.label.toLowerCase().includes(k)||v.keywords?.some(S=>S.toLowerCase().includes(k))||v.group?.toLowerCase().includes(k)}),y=u.reduce((v,k)=>{const S=k.group||"Commands";return v[S]||(v[S]=[]),v[S].push(k),v},{});p.useEffect(()=>{e||(c(""),i(0))},[e]),p.useEffect(()=>{e&&h.current&&h.current.focus()},[e]),p.useEffect(()=>{i(0)},[l]);const m=v=>{switch(v.key){case"ArrowDown":v.preventDefault(),i(k=>k<u.length-1?k+1:k);break;case"ArrowUp":v.preventDefault(),i(k=>k>0?k-1:k);break;case"Enter":v.preventDefault(),u[d]&&(u[d].onSelect(),r());break;case"Escape":v.preventDefault(),r();break}},b=v=>{v.onSelect(),r()};return t.jsxs(Yt,{isOpen:e,onClose:r,size:"lg",showCloseButton:!1,className:f("overflow-hidden p-0",s),children:[t.jsx("div",{className:"border-b border-gray-200 dark:border-gray-700 p-4",children:t.jsxs("div",{className:"flex items-center gap-3",children:[t.jsx("svg",{className:"w-5 h-5 text-gray-400",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:t.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z"})}),t.jsx("input",{ref:h,type:"text",value:l,onChange:v=>c(v.target.value),onKeyDown:m,placeholder:n,className:"flex-1 bg-transparent border-none outline-none text-gray-900 dark:text-white placeholder-gray-500"})]})}),t.jsx("div",{className:"max-h-96 overflow-y-auto p-2",children:Object.keys(y).length===0?t.jsx("div",{className:"px-4 py-8 text-sm text-gray-500 dark:text-gray-400 text-center",children:o}):Object.entries(y).map(([v,k])=>t.jsxs("div",{className:"mb-4 last:mb-0",children:[t.jsx("div",{className:"px-3 py-2 text-xs font-semibold text-gray-500 dark:text-gray-400 uppercase tracking-wider",children:v}),t.jsx("div",{className:"space-y-1",children:k.map(S=>{const N=u.indexOf(S)===d;return t.jsxs("button",{onClick:()=>b(S),className:f("w-full flex items-center gap-3 px-3 py-2 rounded-md","text-sm text-left transition-colors",N?"bg-blue-50 dark:bg-blue-900/30 text-blue-700 dark:text-blue-300":"hover:bg-gray-100 dark:hover:bg-gray-800 text-gray-900 dark:text-white"),children:[S.icon&&t.jsx("span",{className:"flex-shrink-0 w-4 h-4",children:S.icon}),t.jsx("span",{className:"flex-1 truncate",children:S.label}),S.shortcut&&t.jsx("span",{className:"flex-shrink-0 text-xs text-gray-500 dark:text-gray-400 font-mono",children:S.shortcut})]},S.id)})})]},v))}),t.jsxs("div",{className:"border-t border-gray-200 dark:border-gray-700 px-4 py-2 flex items-center justify-between text-xs text-gray-500 dark:text-gray-400",children:[t.jsxs("div",{className:"flex items-center gap-4",children:[t.jsxs("span",{className:"flex items-center gap-1",children:[t.jsx("kbd",{className:"px-1.5 py-0.5 bg-gray-100 dark:bg-gray-800 rounded",children:"↑"}),t.jsx("kbd",{className:"px-1.5 py-0.5 bg-gray-100 dark:bg-gray-800 rounded",children:"↓"}),"to navigate"]}),t.jsxs("span",{className:"flex items-center gap-1",children:[t.jsx("kbd",{className:"px-1.5 py-0.5 bg-gray-100 dark:bg-gray-800 rounded",children:"↵"}),"to select"]})]}),t.jsxs("span",{className:"flex items-center gap-1",children:[t.jsx("kbd",{className:"px-1.5 py-0.5 bg-gray-100 dark:bg-gray-800 rounded",children:"esc"}),"to close"]})]})]})},bl=X.cva("bg-white dark:bg-gray-800 rounded-lg shadow-md p-6 transition-all duration-200",{variants:{variant:{default:"border-gray-200 dark:border-gray-700 border hover:shadow-lg",elevated:"shadow-lg hover:shadow-xl",minimal:"bg-transparent shadow-none border-none p-4"},trend:{none:"",up:"border-l-4 border-green-500",down:"border-l-4 border-red-500",neutral:"border-l-4 border-gray-400"}},defaultVariants:{variant:"default",trend:"none"}}),ml=({label:e,value:r,change:a,trend:n="none",icon:o,variant:s="default",className:l})=>{const c={up:"text-green-600 dark:text-green-400",down:"text-red-600 dark:text-red-400",neutral:"text-gray-600 dark:text-gray-400",none:"text-gray-600 dark:text-gray-400"},d={up:"↗",down:"↘",neutral:"→",none:""};return t.jsx("div",{className:f(bl({variant:s,trend:n}),l),children:t.jsxs("div",{className:"flex items-center justify-between",children:[t.jsxs("div",{children:[t.jsx("p",{className:"text-sm font-medium text-gray-600 dark:text-gray-400 mb-1",children:e}),t.jsx("p",{className:"text-2xl font-bold text-gray-900 dark:text-white",children:r}),a&&t.jsxs("p",{className:f("text-sm font-medium flex items-center gap-1 mt-1",c[n||"none"]),children:[t.jsx("span",{children:d[n||"none"]}),a]})]}),o&&t.jsx("div",{className:"text-3xl opacity-80",children:o})]})})},yl=X.cva("space-y-6",{variants:{variant:{default:"",card:"bg-white dark:bg-gray-800 rounded-lg border-gray-200 dark:border-gray-700 border p-6",minimal:"space-y-4"},spacing:{tight:"space-y-3",normal:"space-y-4",relaxed:"space-y-6",loose:"space-y-8"}},defaultVariants:{variant:"default",spacing:"normal"}}),pl=({title:e,description:r,children:a,variant:n="default",spacing:o="normal",className:s})=>t.jsxs("div",{className:f(yl({variant:n,spacing:o}),s),children:[(e||r)&&t.jsxs("div",{className:"space-y-1",children:[e&&t.jsx("h3",{className:"text-lg font-medium text-gray-900 dark:text-white",children:e}),r&&t.jsx("p",{className:"text-sm text-gray-600 dark:text-gray-400",children:r})]}),a]}),vl=X.cva("flex flex-col items-center text-center space-y-4",{variants:{layout:{vertical:"flex-col items-center text-center",horizontal:"flex-row items-start text-left space-y-0 space-x-4",minimal:"flex-col space-y-2"},spacing:{tight:"space-y-2",normal:"space-y-4",relaxed:"space-y-6"},interactive:{true:"transition-all duration-200 hover:transform hover:scale-105 cursor-pointer",false:""}},defaultVariants:{layout:"vertical",spacing:"normal",interactive:!1}}),kl=({icon:e,title:r,description:a,layout:n="vertical",spacing:o="normal",interactive:s=!1,className:l,onClick:c})=>t.jsxs("div",{className:f(vl({layout:n,spacing:o,interactive:s}),l),onClick:c,children:[t.jsx("div",{className:"text-4xl mb-4 flex-shrink-0",children:e}),t.jsxs("div",{className:"space-y-2",children:[t.jsx("h3",{className:"text-xl font-bold text-gray-900 dark:text-white",children:r}),t.jsx("div",{className:"text-gray-600 dark:text-gray-300 leading-relaxed",children:a})]})]}),xl=({className:e,children:r,disabled:a=!1,onClick:n})=>t.jsx("div",{className:f("p-4 rounded-lg border transition-colors","bg-white dark:bg-gray-900","border-gray-200 dark:border-gray-700","text-gray-900 dark:text-white",a&&"opacity-50 cursor-not-allowed","hover:bg-gray-50 dark:hover:bg-gray-800",e),onClick:a?void 0:n,role:"region","aria-label":"UfocusUindicator",children:r||"UfocusUindicator Component"}),wl=({icon:e,size:r="md",shape:a="rounded",variant:n="blue-purple",gradientClasses:o,className:s,iconClassName:l})=>{const c={sm:{container:"w-10 h-10",icon:"h-5 w-5"},md:{container:"w-12 h-12",icon:"h-6 w-6"},lg:{container:"w-16 h-16",icon:"h-8 w-8"},xl:{container:"w-20 h-20",icon:"h-10 w-10"}},d={square:"rounded-lg",rounded:"rounded-xl",circle:"rounded-full"},i={"blue-purple":"bg-gradient-to-r from-blue-600 to-purple-600","green-blue":"bg-gradient-to-r from-green-600 to-blue-600","orange-red":"bg-gradient-to-r from-orange-600 to-red-600",gray:"bg-gradient-to-r from-gray-600 to-gray-800 dark:from-gray-700 dark:to-gray-900",custom:o||"bg-gradient-to-r from-blue-600 to-purple-600"},h=c[r];return t.jsx("div",{className:f("flex items-center justify-center flex-shrink-0",h.container,d[a],i[n],s),children:t.jsx(e,{className:f("text-white",h.icon,l)})})},Nl={sm:"w-12 h-12",md:"w-16 h-16",lg:"w-20 h-20",xl:"w-24 h-24"},Cl={sm:"h-6 w-6",md:"h-8 w-8",lg:"h-10 w-10",xl:"h-12 w-12"},Sl={primary:"bg-gradient-to-br from-blue-100 to-blue-200 text-blue-600 shadow-lg hover:shadow-blue-200",secondary:"bg-gradient-to-br from-purple-100 to-purple-200 text-purple-600 shadow-lg hover:shadow-purple-200",success:"bg-gradient-to-br from-green-100 to-green-200 text-green-600 shadow-lg hover:shadow-green-200",warning:"bg-gradient-to-br from-yellow-100 to-yellow-200 text-yellow-600 shadow-lg hover:shadow-yellow-200",error:"bg-gradient-to-br from-red-100 to-red-200 text-red-600 shadow-lg hover:shadow-red-200",neutral:"bg-gradient-to-br from-gray-100 to-gray-200 text-gray-600 shadow-lg hover:shadow-gray-200"},El={square:"rounded-none",rounded:"rounded-2xl",circle:"rounded-full"},Al={none:"",float:"animate-float",pulse:"animate-pulse",bounce:"animate-bounce-slow"},Tl=({children:e,size:r="lg",variant:a="primary",shape:n="rounded",animation:o="float",className:s})=>t.jsx("div",{className:f("flex items-center justify-center mx-auto mb-6 transition-all duration-300 group-hover:scale-105",Nl[r],Sl[a],El[n],Al[o],s),children:t.jsx("div",{className:f(Cl[r]),children:e})}),Il=({icon:e,children:r,iconPosition:a="left",gap:n="md",iconSize:o="md",align:s="left",variant:l="default",className:c,iconClassName:d,textClassName:i})=>{const h={xs:"gap-1",sm:"gap-2",md:"gap-3",lg:"gap-4"},u={xs:"h-3 w-3",sm:"h-4 w-4",md:"h-5 w-5",lg:"h-6 w-6",xl:"h-8 w-8"},y={left:"text-left",center:"text-center items-center",right:"text-right items-end"},m={default:"text-gray-700 dark:text-gray-300",primary:"text-blue-600 dark:text-blue-400",success:"text-green-600 dark:text-green-400",warning:"text-yellow-600 dark:text-yellow-400",danger:"text-red-600 dark:text-red-400",muted:"text-gray-500 dark:text-gray-400"},b={left:"flex items-center",right:"flex flex-row-reverse items-center",top:"flex flex-col"};return t.jsxs("div",{className:f(b[a],h[n],a==="top"&&y[s],m[l],c),children:[t.jsx(e,{className:f(u[o],"flex-shrink-0",d)}),t.jsx("span",{className:f(i),children:r})]})};function Ll({title:e,subtitle:r,items:a,renderItem:n,keyExtractor:o,actions:s,emptyMessage:l="No items",emptyIcon:c,emptyAction:d,loading:i=!1,className:h,headerClassName:u,listClassName:y,spacing:m="none",showDividers:b=!1}){const v={none:"",sm:"space-y-1",md:"space-y-2",lg:"space-y-4"},k=(S="secondary")=>{const x="inline-flex items-center gap-2 px-3 py-1.5 text-sm font-medium rounded-lg transition-colors disabled:opacity-50 disabled:cursor-not-allowed";switch(S){case"primary":return f(x,"bg-blue-600 text-white hover:bg-blue-700 dark:bg-blue-500 dark:hover:bg-blue-600");case"ghost":return f(x,"text-gray-600 hover:bg-gray-100 dark:text-gray-400 dark:hover:bg-gray-800");case"secondary":default:return f(x,"bg-gray-100 text-gray-700 hover:bg-gray-200 dark:bg-gray-800 dark:text-gray-300 dark:hover:bg-gray-700")}};return t.jsxs("div",{className:f("",h),children:[t.jsxs("div",{className:f("flex items-center justify-between gap-4 pb-4",u),children:[t.jsxs("div",{className:"min-w-0 flex-1",children:[t.jsx("h2",{className:"text-lg font-semibold text-gray-900 dark:text-gray-100 truncate",children:e}),r&&t.jsx("p",{className:"mt-0.5 text-sm text-gray-500 dark:text-gray-400",children:r})]}),s&&s.length>0&&t.jsx("div",{className:"flex items-center gap-2 flex-shrink-0",children:s.map(S=>t.jsxs("button",{onClick:S.onClick,disabled:S.disabled,className:k(S.variant),children:[S.icon,S.label]},S.id))})]}),i&&t.jsx("div",{className:"flex items-center justify-center py-12",children:t.jsx("div",{className:"w-6 h-6 border-2 border-blue-600 border-t-transparent rounded-full animate-spin"})}),!i&&a.length===0&&t.jsxs("div",{className:"flex flex-col items-center justify-center py-12 text-center",children:[c&&t.jsx("div",{className:"mb-4 text-gray-400 dark:text-gray-500",children:c}),t.jsx("p",{className:"text-gray-500 dark:text-gray-400",children:l}),d&&t.jsx("button",{onClick:d.onClick,className:"mt-4 text-sm font-medium text-blue-600 hover:text-blue-700 dark:text-blue-400 dark:hover:text-blue-300",children:d.label})]}),!i&&a.length>0&&t.jsx("div",{className:f(v[m],b&&"divide-y divide-gray-200 dark:divide-gray-700",y),children:a.map((S,x)=>t.jsx("div",{children:n(S,x)},o(S,x)))})]})}const Ml=({children:e,title:r,variant:a="info",size:n="md",icon:o,bordered:s=!0,className:l})=>{const c={info:{bg:"bg-blue-50 dark:bg-blue-900/20",border:"border-blue-200 dark:border-blue-800",title:"text-blue-900 dark:text-blue-300",text:"text-blue-800 dark:text-blue-400",icon:"text-blue-600 dark:text-blue-400"},success:{bg:"bg-green-50 dark:bg-green-900/20",border:"border-green-200 dark:border-green-800",title:"text-green-900 dark:text-green-300",text:"text-green-800 dark:text-green-400",icon:"text-green-600 dark:text-green-400"},warning:{bg:"bg-yellow-50 dark:bg-yellow-900/20",border:"border-yellow-200 dark:border-yellow-800",title:"text-yellow-900 dark:text-yellow-300",text:"text-yellow-800 dark:text-yellow-400",icon:"text-yellow-600 dark:text-yellow-400"},danger:{bg:"bg-red-50 dark:bg-red-900/20",border:"border-red-200 dark:border-red-800",title:"text-red-900 dark:text-red-300",text:"text-red-800 dark:text-red-400",icon:"text-red-600 dark:text-red-400"},neutral:{bg:"bg-gray-50 dark:bg-gray-800",border:"border-gray-200 dark:border-gray-700",title:"text-gray-900 dark:text-gray-100",text:"text-gray-700 dark:text-gray-300",icon:"text-gray-600 dark:text-gray-400"}},d={sm:"p-3",md:"p-4",lg:"p-6"},i=c[a];return t.jsxs("div",{className:f("rounded-lg",i.bg,s&&`border ${i.border}`,d[n],l),children:[(r||o)&&t.jsxs("div",{className:"flex items-start gap-3 mb-2",children:[o&&t.jsx(o,{className:f("h-5 w-5 flex-shrink-0 mt-0.5",i.icon)}),r&&t.jsx("h3",{className:f(U.body.strong.md(),i.title),children:r})]}),t.jsx("div",{className:f(!r&&!o&&i.text),children:e})]})},Pl=({className:e,children:r,disabled:a=!1,onClick:n})=>t.jsx("div",{className:f("p-4 rounded-lg border transition-colors","bg-white dark:bg-gray-900","border-gray-200 dark:border-gray-700","text-gray-900 dark:text-white",a&&"opacity-50 cursor-not-allowed","hover:bg-gray-50 dark:hover:bg-gray-800",e),onClick:a?void 0:n,role:"region","aria-label":"UkeyboardUshortcut",children:r||"UkeyboardUshortcut Component"}),Ol=({size:e="md",className:r="",showText:a=!0,onClick:n,logoSrc:o="/logo.png",logoAlt:s="Logo",logoText:l,fontFamily:c="Dancing Script, cursive"})=>{const i=(()=>{switch(e){case"sm":return{container:"space-x-2",image:"h-6 w-6",text:"text-lg"};case"md":return{container:"space-x-2",image:"h-8 w-8",text:"text-2xl"};case"lg":return{container:"space-x-3",image:"h-10 w-10",text:"text-3xl"};case"xl":return{container:"space-x-4",image:"h-12 w-12",text:"text-4xl"};default:return{container:"space-x-2",image:"h-8 w-8",text:"text-2xl"}}})(),h=t.jsxs(t.Fragment,{children:[t.jsx("img",{src:o,alt:s,className:i.image}),a&&t.jsx("div",{className:`${i.text} font-bold text-gray-900 dark:text-gray-100`,style:{fontFamily:c,fontWeight:"700"},children:l})]});return n?t.jsx("button",{onClick:n,className:`flex items-center ${i.container} ${r} hover:opacity-80 transition-opacity`,children:h}):t.jsx("div",{className:`flex items-center ${i.container} ${r}`,children:h})},Ul=({className:e,children:r,disabled:a=!1,onClick:n})=>t.jsx("div",{className:f("p-4 rounded-lg border transition-colors","bg-white dark:bg-gray-900","border-gray-200 dark:border-gray-700","text-gray-900 dark:text-white",a&&"opacity-50 cursor-not-allowed","hover:bg-gray-50 dark:hover:bg-gray-800",e),onClick:a?void 0:n,role:"region","aria-label":"UmorphUtransition",children:r||"UmorphUtransition Component"}),Dl=({title:e,description:r,count:a,countLabel:n,action:o,loading:s=!1,loadingText:l="Loading...",size:c="md",className:d})=>{const h={sm:{title:U.heading.h4(),description:U.body.sm(),count:U.caption.default()},md:{title:U.heading.h3(),description:U.body.md(),count:U.body.sm()},lg:{title:U.heading.h2(),description:U.body.lg(),count:U.body.md()}}[c];return t.jsxs("div",{className:f("flex items-start justify-between gap-4",d),children:[t.jsxs("div",{className:"flex-1 min-w-0",children:[t.jsxs("div",{className:"flex items-center gap-3 flex-wrap",children:[t.jsx("h2",{className:f(h.title,"text-gray-900 dark:text-gray-100"),children:e}),a!==void 0&&t.jsxs("span",{className:f(h.count,"text-gray-500 dark:text-gray-400"),children:["(",a,n&&` ${n}`,")"]}),s&&t.jsxs("span",{className:f(h.count,"text-gray-500 dark:text-gray-400 flex items-center gap-2"),children:[t.jsx("div",{className:"animate-spin rounded-full h-4 w-4 border-b-2 border-blue-600"}),l]})]}),r&&t.jsx("p",{className:f(h.description,"mt-1 text-gray-600 dark:text-gray-400"),children:r})]}),o&&t.jsx("div",{className:"flex-shrink-0",children:o})]})},zl=({className:e,children:r,disabled:a=!1,onClick:n})=>t.jsx("div",{className:f("p-4 rounded-lg border transition-colors","bg-white dark:bg-gray-900","border-gray-200 dark:border-gray-700","text-gray-900 dark:text-white",a&&"opacity-50 cursor-not-allowed","hover:bg-gray-50 dark:hover:bg-gray-800",e),onClick:a?void 0:n,role:"region","aria-label":"UparallaxUscroll",children:r||"UparallaxUscroll Component"}),jl=({actions:e,orientation:r="horizontal",columns:a=3,className:n})=>{const o={default:"bg-white dark:bg-gray-900 hover:bg-gray-50 dark:hover:bg-gray-800 text-gray-900 dark:text-white border-gray-200 dark:border-gray-700",primary:"bg-blue-500 hover:bg-blue-600 text-white border-blue-500",success:"bg-green-500 hover:bg-green-600 text-white border-green-500",warning:"bg-yellow-500 hover:bg-yellow-600 text-white border-yellow-500",danger:"bg-red-500 hover:bg-red-600 text-white border-red-500"},s={horizontal:"flex flex-wrap gap-2",vertical:"flex flex-col gap-2",grid:"grid gap-2"};return t.jsx("div",{className:f(s[r],r==="grid"&&`grid-cols-${a}`,n),style:r==="grid"?{gridTemplateColumns:`repeat(${a}, 1fr)`}:void 0,children:e.map(l=>t.jsxs("button",{onClick:l.onClick,disabled:l.disabled,className:f("flex items-center justify-center gap-2 px-4 py-3 rounded-lg border transition-colors font-medium",o[l.variant||"default"],l.disabled&&"opacity-50 cursor-not-allowed"),children:[l.icon&&t.jsx("span",{className:"w-5 h-5",children:l.icon}),t.jsx("span",{children:l.label})]},l.id))})},_l=({className:e,children:r,disabled:a=!1,onClick:n})=>t.jsx("div",{className:f("p-4 rounded-lg border transition-colors","bg-white dark:bg-gray-900","border-gray-200 dark:border-gray-700","text-gray-900 dark:text-white",a&&"opacity-50 cursor-not-allowed","hover:bg-gray-50 dark:hover:bg-gray-800",e),onClick:a?void 0:n,role:"region","aria-label":"UrevealUonUscroll",children:r||"UrevealUonUscroll Component"}),Bl={sm:{container:"px-6 py-3",icon:"h-5 w-5 mr-2",text:"font-semibold"},md:{container:"px-6 py-3",icon:"h-5 w-5 mr-2",text:"font-semibold"},lg:{container:"px-6 py-3",icon:"h-5 w-5 mr-2",text:"font-semibold"}},Fl=({icon:e,text:r,variant:a="default",size:n="md",className:o})=>{const{container:s,icon:l}=Ln(a),c=Bl[n];return t.jsxs("div",{className:f("inline-flex items-center rounded-full mb-6",s,c.container,o),children:[t.jsx("div",{className:f("animate-float-icon",l,c.icon),children:e}),t.jsx("span",{className:c.text,children:r})]})},Wl=({title:e,onAdd:r,addButtonTooltip:a,loading:n,className:o=""})=>t.jsx("div",{className:`p-4 border-b border-gray-200 dark:border-gray-700 ${o}`,children:t.jsxs("div",{className:"flex items-center justify-between",children:[t.jsx("h2",{className:"text-lg font-semibold text-gray-900 dark:text-gray-100",children:e}),t.jsxs("div",{className:"flex items-center space-x-2",children:[n&&t.jsx("div",{className:"w-5 h-5 border-2 border-blue-600 border-t-transparent rounded-full animate-spin"}),r&&t.jsx("button",{onClick:r,className:"p-1 rounded hover:bg-gray-200 dark:hover:bg-gray-700 transition-colors",title:a,"aria-label":a||"Add",children:t.jsx("svg",{className:"w-5 h-5 text-gray-600 dark:text-gray-400",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:t.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 4v16m8-8H4"})})})]})]})}),Vl=e=>{switch(e){case"cog":return P.Cog6ToothIcon;case"arrow-right":return P.ArrowRightIcon;case"shield":return P.ShieldCheckIcon;case"reply":case"chat":return P.ChatBubbleLeftRightIcon;case"filter":return P.FunnelIcon;case"plug":return P.LinkIcon;case"adjustments":return P.AdjustmentsHorizontalIcon;case"currency-dollar":return P.CurrencyDollarIcon;default:return P.Cog6ToothIcon}},$l=({settings:e,selectedSetting:r,onSettingSelect:a,className:n=""})=>t.jsx("nav",{className:f("space-y-1",n),"aria-label":"Settings navigation",children:t.jsx("ul",{className:"space-y-1",role:"list",children:e.map(o=>{const s=Vl(o.icon),l=r===o.id;return t.jsx("li",{children:t.jsx("button",{onClick:()=>a(o.id),className:f("w-full flex items-center text-left px-3 py-2 rounded-lg transition-colors h-[44px]",U.body.sm(),l?"bg-orange-100 dark:bg-orange-900/30 text-orange-700 dark:text-orange-300":"hover:bg-gray-100 dark:hover:bg-gray-700 text-gray-700 dark:text-gray-300"),"aria-current":l?"page":void 0,title:o.description,children:t.jsxs("div",{className:"flex items-center flex-1 min-w-0",children:[t.jsx(s,{className:"h-5 w-5 mr-3 flex-shrink-0","aria-hidden":"true"}),t.jsx("span",{className:"truncate",children:o.title})]})})},o.id)})})}),Hl=({className:e,children:r,disabled:a=!1,onClick:n})=>t.jsx("div",{className:f("p-4 rounded-lg border transition-colors","bg-white dark:bg-gray-900","border-gray-200 dark:border-gray-700","text-gray-900 dark:text-white",a&&"opacity-50 cursor-not-allowed","hover:bg-gray-50 dark:hover:bg-gray-800",e),onClick:a?void 0:n,role:"region","aria-label":"UskipUnavigation",children:r||"UskipUnavigation Component"}),ql=({className:e,children:r,disabled:a=!1,onClick:n})=>t.jsx("div",{className:f("p-4 rounded-lg border transition-colors","bg-white dark:bg-gray-900","border-gray-200 dark:border-gray-700","text-gray-900 dark:text-white",a&&"opacity-50 cursor-not-allowed","hover:bg-gray-50 dark:hover:bg-gray-800",e),onClick:a?void 0:n,role:"region","aria-label":"UsortUdropdown",children:r||"UsortUdropdown Component"}),Gl=({className:e,children:r,disabled:a=!1,onClick:n})=>t.jsx("div",{className:f("p-4 rounded-lg border transition-colors","bg-white dark:bg-gray-900","border-gray-200 dark:border-gray-700","text-gray-900 dark:text-white",a&&"opacity-50 cursor-not-allowed","hover:bg-gray-50 dark:hover:bg-gray-800",e),onClick:a?void 0:n,role:"region","aria-label":"UversionUbadge",children:r||"UversionUbadge Component"}),Yl=({children:e,as:r="span"})=>t.jsx(r,{className:"sr-only",children:e}),Kl=({time:e,isActive:r=!0,size:a="sm",showIcon:n=!0,className:o})=>{const s={sm:"gap-1.5",md:"gap-2",lg:"gap-2.5"},l={sm:"w-4 h-4",md:"w-5 h-5",lg:"w-6 h-6"},c={sm:"sm",md:"base",lg:"lg"};return t.jsxs("div",{className:f("flex items-center",s[a],o),role:"timer","aria-label":`Timer: ${e}`,children:[n&&t.jsx("svg",{className:f(l[a],r?"text-blue-600 dark:text-blue-400":"text-gray-400 dark:text-gray-500"),fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,"aria-hidden":"true",children:t.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 8v4l3 3m6-3a9 9 0 11-18 0 9 9 0 0118 0z"})}),t.jsx(nt,{as:"span",size:c[a],weight:"medium",color:r?"default":"muted",className:"font-mono tabular-nums",children:e})]})},Xl=["#3b82f6","#10b981","#f59e0b","#ef4444","#8b5cf6","#ec4899"],Zl=({show:e,onComplete:r,particleCount:a=50,duration:n=3e3,colors:o=Xl,className:s})=>{const[l,c]=p.useState([]),[d,i]=p.useState(!1);p.useEffect(()=>{if(e&&!d){i(!0);const u=[];for(let m=0;m<a;m++){const b=Math.PI*2*m/a+Math.random()*.5,v=2+Math.random()*4;u.push({id:m,x:50,y:50,vx:Math.cos(b)*v,vy:Math.sin(b)*v-2,color:o[Math.floor(Math.random()*o.length)],size:8+Math.random()*8,rotation:Math.random()*360,rotationSpeed:(Math.random()-.5)*20,isCircle:Math.random()>.5})}c(u);const y=setTimeout(()=>{i(!1),c([]),r?.()},n);return()=>clearTimeout(y)}},[e,d,r,a,n,o]);const h=p.useCallback(()=>{c(u=>u.map(y=>({...y,x:y.x+y.vx*.5,y:y.y+y.vy*.5,vy:y.vy+.15,rotation:y.rotation+y.rotationSpeed})))},[]);return p.useEffect(()=>{if(!d||l.length===0)return;const u=setInterval(h,16);return()=>clearInterval(u)},[d,l.length,h]),!d||l.length===0?null:t.jsx("div",{className:f("fixed inset-0 pointer-events-none z-50 overflow-hidden",s),"aria-hidden":"true",children:l.map(u=>t.jsx("div",{className:"absolute",style:{left:`${u.x}%`,top:`${u.y}%`,width:u.size,height:u.size,backgroundColor:u.color,transform:`rotate(${u.rotation}deg)`,borderRadius:u.isCircle?"50%":"2px",opacity:Math.max(0,1-u.y/150)}},u.id))})},nr=X.cva("transition-all duration-200 focus:outline-none focus:ring-2 focus:ring-blue-500 focus:ring-offset-2 rounded-sm",{variants:{variant:{subtle:U.link.subtle(),default:U.link.default(),muted:U.link.muted(),external:U.link.external(),inherit:"text-inherit hover:text-blue-600 dark:hover:text-blue-400 underline-offset-2 hover:underline transition-colors duration-200"},size:{sm:"text-sm",default:"text-base",lg:"text-lg"}},defaultVariants:{variant:"subtle",size:"default"}}),Ir=G.forwardRef(({className:e,variant:r,size:a,to:n,href:o,external:s,children:l,onTrack:c,trackingLabel:d,componentName:i,onClick:h,...u},y)=>{const m=n||o,b=s||m&&(m.startsWith("http")||m.startsWith("mailto:")),v=k=>{c&&c({action:"click",trackingLabel:d,componentName:i}),h?.(k)};return m?b?t.jsx("a",{className:f(nr({variant:r==="subtle"?"external":r,size:a,className:e})),href:m,target:"_blank",rel:"noopener noreferrer",ref:y,onClick:v,...u,children:l}):t.jsx(Z.Link,{className:f(nr({variant:r,size:a,className:e})),to:m,ref:y,onClick:v,...u,children:l}):t.jsx("span",{className:f(nr({variant:r,size:a,className:e})),onClick:v,...u,children:l})});Ir.displayName="SmartLink";const Jl=(e,r)=>G.useMemo(()=>{let a=e;return Object.entries(r).forEach(([n,o])=>{const s=new RegExp(`\\b${n.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}\\b`,"gi");a=a.replace(s,l=>`<SmartLink to="${o}" variant="subtle">${l}</SmartLink>`)}),a},[e,r]),Ql={documentation:"/document",settings:"/settings",about:"/about",contact:"/contact","privacy policy":"/privacy",privacy:"/privacy","terms of service":"/terms",terms:"/terms","cookie policy":"/cookies",cookies:"/cookies",points:"/points","earn points":"/how-to-earn-points","how to earn points":"/how-to-earn-points","connect wallet":"/connect","connect your wallet":"/connect","wallet connection":"/connect",wallet:"/connect",compose:"/compose","compose email":"/compose","send email":"/compose",mail:"/mail",email:"/mail",inbox:"/mail",dashboard:"/mail",delegate:"/delegate",delegation:"/delegate",manage:"/manage","manage preferences":"/preferences",profile:"/settings",account:"/settings",preferences:"/preferences",token:"/token","web3 users":"/web3-users","web3 projects":"/web3-projects","get started":"/connect","start here":"/connect","learn more":"/document","read more":"/document","our features":"/document",support:"/contact",help:"/document","contact us":"/contact"},Rl=({children:e,mappings:r=Ql,className:a,variant:n="subtle"})=>{const o=G.useMemo(()=>{if(!e||typeof e!="string")return e||"";let l=e;return Object.entries(r).sort(([d],[i])=>i.length-d.length).forEach(([d,i])=>{if(d&&i){const h=new RegExp(`\\b${d.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}\\b`,"gi");l=l.replace(h,u=>`__LINK_START__${i}__LINK_MID__${u}__LINK_END__`)}}),l},[e,r]);if(!o||typeof o!="string")return t.jsx("span",{className:a,children:e});const s=o.split(/(__LINK_START__.*?__LINK_END__)/);return t.jsx("span",{className:a,children:s.map((l,c)=>{const d=l.match(/__LINK_START__(.*?)__LINK_MID__(.*?)__LINK_END__/);if(d){const[,i,h]=d;return t.jsx(Ir,{to:i,variant:n,children:h},c)}return l})})},ei=({href:e,children:r,variant:a="default",external:n=!1,showExternalIcon:o=!1,disabled:s=!1,className:l,onTrack:c,trackingLabel:d,componentName:i,onClick:h,...u})=>{const y=n||e.startsWith("http://")||e.startsWith("https://"),m={default:"text-blue-600 dark:text-blue-400 hover:text-blue-700 dark:hover:text-blue-300",primary:"text-blue-600 dark:text-blue-400 hover:text-blue-700 dark:hover:text-blue-300 font-medium",secondary:"text-gray-600 dark:text-gray-400 hover:text-gray-900 dark:hover:text-gray-100",muted:"text-gray-500 dark:text-gray-500 hover:text-gray-700 dark:hover:text-gray-300",underline:"text-blue-600 dark:text-blue-400 hover:text-blue-700 dark:hover:text-blue-300 underline"},b=y?{target:"_blank",rel:"noopener noreferrer"}:{},v=k=>{c&&c({action:"click",trackingLabel:d,componentName:i}),h?.(k)};return s?t.jsxs("span",{className:f("cursor-not-allowed opacity-50",m[a],l),children:[r,o&&y&&t.jsx(P.ArrowTopRightOnSquareIcon,{className:"inline-block h-4 w-4 ml-1"})]}):t.jsxs("a",{href:e,className:f("inline-flex items-center transition-colors",m[a],l),onClick:v,...b,...u,children:[r,o&&y&&t.jsx(P.ArrowTopRightOnSquareIcon,{className:"inline-block h-4 w-4 ml-1 flex-shrink-0"})]})},ri=({href:e,children:r,showIcon:a=!0,iconPosition:n="right",size:o="md",variant:s="default",className:l,onClick:c})=>{const d={sm:{text:U.body.sm(),icon:"h-3 w-3",gap:"gap-1"},md:{text:U.body.md(),icon:"h-4 w-4",gap:"gap-1.5"},lg:{text:U.body.lg(),icon:"h-5 w-5",gap:"gap-2"}},i={default:"text-blue-600 dark:text-blue-400 hover:text-blue-700 dark:hover:text-blue-300",primary:"text-blue-700 dark:text-blue-300 hover:text-blue-800 dark:hover:text-blue-200 font-semibold",muted:"text-gray-600 dark:text-gray-400 hover:text-gray-800 dark:hover:text-gray-200"},h=d[o];return t.jsxs("a",{href:e,target:"_blank",rel:"noopener noreferrer",onClick:c,className:f("inline-flex items-center",h.gap,h.text,i[s],"underline decoration-1 underline-offset-2","hover:decoration-2","transition-all duration-200",l),children:[a&&n==="left"&&t.jsx(P.ArrowTopRightOnSquareIcon,{className:f(h.icon,"flex-shrink-0")}),t.jsx("span",{children:r}),a&&n==="right"&&t.jsx(P.ArrowTopRightOnSquareIcon,{className:f(h.icon,"flex-shrink-0")})]})},or=new Set,ti=()=>{or.clear()},ai=e=>or.has(e);function ni(e,r,a,n){let o=e;if(a.length>0){const s=new RegExp(`^/(${a.join("|")})/`);o=o.replace(s,"/")}for(const{pattern:s,replacement:l}of n)o=o.replace(s,l);if(r[o])return r[o];for(const[s,l]of Object.entries(r))if(o.endsWith(s))return l}const oi=({preload:e,preloadDelay:r=50,routeModules:a={},languagePrefixes:n=[],pathNormalizations:o=[],to:s,children:l,onMouseEnter:c,onMouseLeave:d,onFocus:i,...h})=>{const u=p.useRef(null),y=p.useCallback(()=>{const S=typeof s=="string"?s:s.pathname||"";if(or.has(S))return;const x=e||ni(S,a,n,o);x&&(u.current=setTimeout(()=>{x().then(()=>{or.add(S)}).catch(()=>{})},r))},[e,r,s,a,n,o]),m=p.useCallback(()=>{u.current&&(clearTimeout(u.current),u.current=null)},[]),b=p.useCallback(S=>{y(),c?.(S)},[y,c]),v=p.useCallback(S=>{m(),d?.(S)},[m,d]),k=p.useCallback(S=>{y(),i?.(S)},[y,i]);return t.jsx(Z.Link,{to:s,onMouseEnter:b,onMouseLeave:v,onFocus:k,...h,children:l})},si=({items:e,separator:r="/",className:a})=>t.jsx("nav",{className:f("flex items-center gap-2 text-sm",a),children:e.map((n,o)=>t.jsxs(p.Fragment,{children:[o>0&&t.jsx("span",{className:"text-gray-400 dark:text-gray-600",children:r}),o===e.length-1?t.jsx("span",{className:"text-gray-900 dark:text-white font-medium",children:n.label}):t.jsx("button",{onClick:n.onClick,className:"text-blue-600 dark:text-blue-400 hover:underline",children:n.label})]},o))}),Kt=G.forwardRef(({onTrack:e,trackingLabel:r,componentName:a,onValueChange:n,children:o,...s},l)=>{const c=d=>{e&&e({action:"change",trackingLabel:r,componentName:a}),n?.(d)};return t.jsx(fe.Root,{ref:l,onValueChange:c,...s,children:o})});Kt.displayName="Tabs";const Xt=G.forwardRef(({className:e,...r},a)=>t.jsx(fe.List,{ref:a,className:f(j.navigation.tabs.list(),e),...r}));Xt.displayName=fe.List.displayName;const Zt=G.forwardRef(({className:e,...r},a)=>t.jsx(fe.Trigger,{ref:a,className:f(j.navigation.tabs.trigger(),e),...r}));Zt.displayName=fe.Trigger.displayName;const Jt=G.forwardRef(({className:e,...r},a)=>t.jsx(fe.Content,{ref:a,className:f(j.navigation.tabs.content(),e),...r}));Jt.displayName=fe.Content.displayName;const li=({items:e,orientation:r="horizontal",className:a})=>{const[n,o]=p.useState(new Set),s=c=>{o(d=>{const i=new Set(d);return i.has(c)?i.delete(c):i.add(c),i})},l=(c,d)=>{const i=c.children&&c.children.length>0,h=n.has(d),u=t.jsxs(t.Fragment,{children:[c.icon&&t.jsx("span",{className:"flex-shrink-0 w-4 h-4",children:c.icon}),t.jsx("span",{className:"flex-1",children:c.label}),i&&t.jsx("svg",{className:f("w-4 h-4 transition-transform",r==="horizontal"&&!h&&"-rotate-90",h&&"rotate-180"),fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:t.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 9l-7 7-7-7"})})]}),y=f("flex items-center gap-2 px-4 py-2 text-sm font-medium","transition-colors",c.active?"text-blue-600 dark:text-blue-400 bg-blue-50 dark:bg-blue-900/20":"text-gray-700 dark:text-gray-300 hover:text-gray-900 dark:hover:text-white hover:bg-gray-100 dark:hover:bg-gray-800");return t.jsxs("div",{children:[i?t.jsx("button",{onClick:()=>s(d),className:f(y,"w-full"),children:u}):c.href?t.jsx("a",{href:c.href,className:y,onClick:c.onClick,children:u}):t.jsx("button",{onClick:c.onClick,className:f(y,"w-full"),children:u}),i&&h&&t.jsx("div",{className:f("bg-gray-50 dark:bg-gray-800/50",r==="horizontal"?"pl-4":"border-l-2 border-gray-200 dark:border-gray-700 ml-4"),children:c.children.map((m,b)=>t.jsx("div",{children:m.href?t.jsxs("a",{href:m.href,onClick:m.onClick,className:f("flex items-center gap-2 px-4 py-2 text-sm","transition-colors",m.active?"text-blue-600 dark:text-blue-400 bg-blue-50 dark:bg-blue-900/20":"text-gray-600 dark:text-gray-400 hover:text-gray-900 dark:hover:text-white hover:bg-gray-100 dark:hover:bg-gray-700"),children:[m.icon&&t.jsx("span",{className:"flex-shrink-0 w-4 h-4",children:m.icon}),m.label]}):t.jsxs("button",{onClick:m.onClick,className:f("w-full flex items-center gap-2 px-4 py-2 text-sm","transition-colors",m.active?"text-blue-600 dark:text-blue-400 bg-blue-50 dark:bg-blue-900/20":"text-gray-600 dark:text-gray-400 hover:text-gray-900 dark:hover:text-white hover:bg-gray-100 dark:hover:bg-gray-700"),children:[m.icon&&t.jsx("span",{className:"flex-shrink-0 w-4 h-4",children:m.icon}),m.label]})},b))})]},d)};return t.jsx("nav",{className:f("bg-white dark:bg-gray-900 border border-gray-200 dark:border-gray-700 rounded-lg",r==="horizontal"?"flex flex-wrap":"flex flex-col",a),children:e.map((c,d)=>l(c,d))})},ii=({items:e,selectedPath:r,onSelect:a,variant:n="default",className:o})=>{const s=n==="compact"?"space-y-1":"space-y-0";return t.jsx("div",{className:f(s,o),children:e.map(l=>{const c=l.icon,d=r===l.path,i=l.disabled,h=f("flex items-start cursor-pointer transition-colors",n==="compact"?"p-3 rounded-lg":"p-4 border-b border-gray-200 dark:border-gray-700 last:border-b-0",i&&"opacity-50 cursor-not-allowed"),u=d?"bg-blue-50 dark:bg-blue-900/20 text-blue-600 dark:text-blue-400":"hover:bg-gray-50 dark:hover:bg-gray-700 text-gray-700 dark:text-gray-300";return t.jsxs("div",{onClick:()=>!i&&a(l.path),className:f(h,!i&&u),role:"button",tabIndex:i?-1:0,"aria-current":d?"page":void 0,"aria-disabled":i,onKeyDown:y=>{!i&&(y.key==="Enter"||y.key===" ")&&(y.preventDefault(),a(l.path))},children:[t.jsx(c,{className:"h-5 w-5 mt-0.5 mr-3 flex-shrink-0"}),t.jsxs("div",{className:"flex-1 min-w-0",children:[t.jsxs("div",{className:f("font-medium",U.body.md()),children:[l.label,l.badge!==void 0&&l.badge>0&&t.jsx("span",{className:"ml-2 inline-flex items-center justify-center px-2 py-0.5 text-xs font-medium bg-blue-100 dark:bg-blue-900 text-blue-800 dark:text-blue-200 rounded-full",children:l.badge})]}),l.description&&t.jsx("div",{className:f("text-xs text-gray-500 dark:text-gray-400 mt-0.5"),children:l.description})]})]},l.id)})})},ci=({items:e,className:r})=>t.jsx("nav",{className:f("flex flex-col gap-1",r),children:e.map(a=>t.jsxs("button",{onClick:a.onClick,className:f("flex items-center gap-3 px-4 py-3 rounded-lg transition-colors",a.active?"bg-blue-50 dark:bg-blue-900/20 text-blue-600 dark:text-blue-400":"text-gray-700 dark:text-gray-300 hover:bg-gray-100 dark:hover:bg-gray-800"),children:[a.icon&&t.jsx("span",{className:"w-5 h-5",children:a.icon}),t.jsx("span",{className:"flex-1 text-left font-medium",children:a.label}),a.badge&&t.jsx("span",{className:"px-2 py-0.5 bg-gray-200 dark:bg-gray-700 rounded text-xs",children:a.badge})]},a.id))}),di=({currentPage:e,totalPages:r,onPageChange:a,siblingCount:n=1,showFirstLast:o=!1,size:s="md",className:l})=>{const d={sm:{button:"h-8 w-8 text-xs",icon:"h-3 w-3",text:U.body.sm()},md:{button:"h-10 w-10 text-sm",icon:"h-4 w-4",text:U.body.md()},lg:{button:"h-12 w-12 text-base",icon:"h-5 w-5",text:U.body.lg()}}[s],h=(()=>{const x=[];x.push(1);const N=Math.max(e-n,2),w=Math.min(e+n,r-1);N>2&&x.push("ellipsis");for(let E=N;E<=w;E++)x.push(E);return w<r-1&&x.push("ellipsis"),r>1&&x.push(r),x})(),u=()=>{e>1&&a(e-1)},y=()=>{e<r&&a(e+1)},m=()=>{a(1)},b=()=>{a(r)},v=f("inline-flex items-center justify-center","rounded-md border border-gray-300 dark:border-gray-600","transition-all duration-200","focus:outline-none focus:ring-2 focus:ring-blue-500","disabled:opacity-50 disabled:cursor-not-allowed"),k=x=>f(v,d.button,d.text,x?"bg-blue-600 text-white border-blue-600 dark:bg-blue-500 dark:border-blue-500":"bg-white dark:bg-gray-800 text-gray-700 dark:text-gray-300 hover:bg-gray-50 dark:hover:bg-gray-700"),S=f(v,d.button,"bg-white dark:bg-gray-800 text-gray-700 dark:text-gray-300","hover:bg-gray-50 dark:hover:bg-gray-700");return t.jsxs("nav",{className:f("flex items-center gap-1",l),"aria-label":"Pagination",children:[o&&t.jsx("button",{onClick:m,disabled:e===1,className:S,"aria-label":"Go to first page",children:t.jsx("span",{className:d.text,children:"First"})}),t.jsx("button",{onClick:u,disabled:e===1,className:S,"aria-label":"Go to previous page",children:t.jsx(P.ChevronLeftIcon,{className:d.icon})}),h.map((x,N)=>x==="ellipsis"?t.jsx("span",{className:f("inline-flex items-center justify-center",d.button,"text-gray-400 dark:text-gray-500"),children:"..."},`ellipsis-${N}`):t.jsx("button",{onClick:()=>a(x),className:k(x===e),"aria-label":`Go to page ${x}`,"aria-current":x===e?"page":void 0,children:x},x)),t.jsx("button",{onClick:y,disabled:e===r,className:S,"aria-label":"Go to next page",children:t.jsx(P.ChevronRightIcon,{className:d.icon})}),o&&t.jsx("button",{onClick:b,disabled:e===r,className:S,"aria-label":"Go to last page",children:t.jsx("span",{className:d.text,children:"Last"})})]})},gi=({currentPage:e,totalPages:r,onPageChange:a,maxVisible:n=7,className:o})=>{const s=[];if(r<=n)for(let l=1;l<=r;l++)s.push(l);else{s.push(1),e>3&&s.push("...");const l=Math.max(2,e-1),c=Math.min(r-1,e+1);for(let d=l;d<=c;d++)s.push(d);e<r-2&&s.push("..."),s.push(r)}return t.jsxs("nav",{className:f("flex items-center gap-1",o),children:[t.jsx("button",{onClick:()=>a(e-1),disabled:e===1,className:"px-3 py-2 rounded hover:bg-gray-100 dark:hover:bg-gray-800 disabled:opacity-50 disabled:cursor-not-allowed",children:"Previous"}),s.map((l,c)=>l==="..."?t.jsx("span",{className:"px-3 py-2",children:"..."},`ellipsis-${c}`):t.jsx("button",{onClick:()=>a(l),className:f("px-3 py-2 rounded",l===e?"bg-blue-500 text-white":"hover:bg-gray-100 dark:hover:bg-gray-800"),children:l},l)),t.jsx("button",{onClick:()=>a(e+1),disabled:e===r,className:"px-3 py-2 rounded hover:bg-gray-100 dark:hover:bg-gray-800 disabled:opacity-50 disabled:cursor-not-allowed",children:"Next"})]})},ui=({steps:e,currentStep:r,orientation:a="horizontal",clickable:n=!1,onStepClick:o,className:s})=>{const l=d=>{n&&o&&o(d)},c=d=>d<r?"completed":d===r?"active":"upcoming";return a==="horizontal"?t.jsx("div",{className:f("w-full",s),children:t.jsx("div",{className:"flex items-center justify-between",children:e.map((d,i)=>{const h=c(i),u=i===e.length-1;return t.jsxs(p.Fragment,{children:[t.jsxs("div",{className:"flex flex-col items-center",children:[t.jsx("button",{onClick:()=>l(i),disabled:!n,className:f("flex items-center justify-center w-10 h-10 rounded-full border-2 transition-all","disabled:cursor-default",n&&"hover:scale-110",h==="completed"&&"bg-blue-600 border-blue-600 dark:bg-blue-500 dark:border-blue-500",h==="active"&&"bg-white dark:bg-gray-900 border-blue-600 dark:border-blue-500",h==="upcoming"&&"bg-white dark:bg-gray-900 border-gray-300 dark:border-gray-700"),children:h==="completed"?t.jsx("svg",{className:"w-5 h-5 text-white",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:t.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:3,d:"M5 13l4 4L19 7"})}):d.icon?t.jsx("span",{className:f("w-5 h-5",h==="active"?"text-blue-600 dark:text-blue-500":"text-gray-400 dark:text-gray-600"),children:d.icon}):t.jsx("span",{className:f("text-sm font-semibold",h==="active"?"text-blue-600 dark:text-blue-500":"text-gray-400 dark:text-gray-600"),children:i+1})}),t.jsxs("div",{className:"mt-2 text-center",children:[t.jsx("p",{className:f("text-sm font-medium",h==="active"?"text-blue-600 dark:text-blue-500":h==="completed"?"text-gray-900 dark:text-white":"text-gray-500 dark:text-gray-400"),children:d.label}),d.description&&t.jsx("p",{className:"text-xs text-gray-500 dark:text-gray-400 mt-0.5",children:d.description})]})]}),!u&&t.jsx("div",{className:"flex-1 h-0.5 mx-2 bg-gray-300 dark:bg-gray-700 relative",children:t.jsx("div",{className:f("absolute left-0 top-0 h-full bg-blue-600 dark:bg-blue-500 transition-all duration-300",i<r?"w-full":"w-0")})})]},d.id)})})}):t.jsx("div",{className:f("w-full",s),children:t.jsx("div",{className:"space-y-4",children:e.map((d,i)=>{const h=c(i),u=i===e.length-1;return t.jsxs("div",{className:"flex gap-4",children:[t.jsxs("div",{className:"flex flex-col items-center",children:[t.jsx("button",{onClick:()=>l(i),disabled:!n,className:f("flex items-center justify-center w-10 h-10 rounded-full border-2 transition-all","disabled:cursor-default flex-shrink-0",n&&"hover:scale-110",h==="completed"&&"bg-blue-600 border-blue-600 dark:bg-blue-500 dark:border-blue-500",h==="active"&&"bg-white dark:bg-gray-900 border-blue-600 dark:border-blue-500",h==="upcoming"&&"bg-white dark:bg-gray-900 border-gray-300 dark:border-gray-700"),children:h==="completed"?t.jsx("svg",{className:"w-5 h-5 text-white",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:t.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:3,d:"M5 13l4 4L19 7"})}):d.icon?t.jsx("span",{className:f("w-5 h-5",h==="active"?"text-blue-600 dark:text-blue-500":"text-gray-400 dark:text-gray-600"),children:d.icon}):t.jsx("span",{className:f("text-sm font-semibold",h==="active"?"text-blue-600 dark:text-blue-500":"text-gray-400 dark:text-gray-600"),children:i+1})}),!u&&t.jsx("div",{className:"w-0.5 flex-1 min-h-[32px] bg-gray-300 dark:bg-gray-700 relative mt-2",children:t.jsx("div",{className:f("absolute top-0 left-0 w-full bg-blue-600 dark:bg-blue-500 transition-all duration-300",i<r?"h-full":"h-0")})})]}),t.jsxs("div",{className:"flex-1 pb-4",children:[t.jsx("p",{className:f("text-sm font-medium",h==="active"?"text-blue-600 dark:text-blue-500":h==="completed"?"text-gray-900 dark:text-white":"text-gray-500 dark:text-gray-400"),children:d.label}),d.description&&t.jsx("p",{className:"text-xs text-gray-500 dark:text-gray-400 mt-1",children:d.description})]})]},d.id)})})})},hi=({steps:e,currentStep:r,onStepClick:a,orientation:n="horizontal",className:o})=>t.jsx("nav",{className:f(n==="horizontal"?"flex items-center":"flex flex-col",o),children:e.map((s,l)=>t.jsxs("div",{className:f("flex items-center",n==="vertical"&&"flex-col items-start"),children:[t.jsxs("div",{className:"flex items-center gap-3",children:[t.jsx("button",{onClick:()=>a?.(l),disabled:l>r,className:f("w-10 h-10 rounded-full flex items-center justify-center font-semibold transition-colors",l<r&&"bg-green-500 text-white",l===r&&"bg-blue-500 text-white",l>r&&"bg-gray-200 dark:bg-gray-700 text-gray-600 dark:text-gray-400"),children:l<r?"✓":l+1}),t.jsxs("div",{children:[t.jsx("p",{className:"font-medium text-gray-900 dark:text-white",children:s.label}),s.description&&t.jsx("p",{className:"text-sm text-gray-600 dark:text-gray-400",children:s.description})]})]}),l<e.length-1&&t.jsx("div",{className:f(n==="horizontal"?"w-full h-0.5 mx-4":"h-8 w-0.5 ml-5 my-2","bg-gray-300 dark:bg-gray-700")})]},s.id))}),fi=({subsections:e,isExpanded:r,selectedSubsection:a,parentSectionId:n,onSubsectionSelect:o})=>{const s=p.useRef(null),[l,c]=p.useState(void 0);return p.useEffect(()=>{if(s.current){const d=s.current.scrollHeight;c(r?d+8:0)}},[r,e]),t.jsx("div",{className:"overflow-hidden transition-all duration-300 ease-in-out",style:{height:l!==void 0?`${l}px`:"auto"},children:t.jsx("div",{ref:s,className:"ml-6 mt-2 space-y-1",children:e.map(d=>t.jsx("button",{onClick:()=>o?.(d.id,n),className:`block w-full text-left px-3 py-2 rounded-md text-sm transition-all duration-200 hover:scale-[1.02] ${a===d.id?"bg-blue-100 dark:bg-blue-900/20 text-blue-700 dark:text-blue-300 shadow-sm":"text-gray-600 dark:text-gray-400 hover:bg-gray-100 dark:hover:bg-gray-800 hover:text-gray-800 dark:hover:text-gray-200"}`,children:d.title},d.id))})})},bi=({sections:e,selectedSection:r,selectedSubsection:a,expandedSections:n,onSectionSelect:o,onSubsectionSelect:s,onToggleSection:l,className:c=""})=>t.jsx("nav",{className:`space-y-2 ${c}`,children:e.map(d=>t.jsxs("div",{children:[t.jsxs("div",{className:"flex items-center",children:[t.jsx("button",{onClick:()=>o(d.id),className:`flex-1 text-left px-3 py-2 rounded-md text-sm font-medium transition-all duration-200 hover:scale-[1.02] ${r===d.id&&!a?"bg-blue-100 dark:bg-blue-900/20 text-blue-700 dark:text-blue-300 shadow-sm":"text-gray-700 dark:text-gray-300 hover:bg-gray-100 dark:hover:bg-gray-800 hover:text-gray-900 dark:hover:text-gray-100"}`,children:d.title}),d.subsections&&d.subsections.length>0&&t.jsx("button",{onClick:()=>l(d.id),className:"p-1 rounded-md hover:bg-gray-100 dark:hover:bg-gray-800 hover:scale-110 transition-all duration-200",children:t.jsx(P.ChevronRightIcon,{className:`h-4 w-4 text-gray-500 transition-transform duration-300 ease-in-out ${n.includes(d.id)?"rotate-90":"rotate-0"}`})})]}),d.subsections&&t.jsx(fi,{subsections:d.subsections,isExpanded:n.includes(d.id),selectedSubsection:a,parentSectionId:d.id,onSubsectionSelect:s})]},d.id))});function mi({columns:e,data:r,keyExtractor:a,sort:n,onSort:o,onRowClick:s,striped:l=!1,hoverable:c=!1,compact:d=!1,bordered:i=!1,emptyMessage:h="No data available",className:u}){const y=b=>{b.sortable&&o&&o(b.key)},m={left:"text-left",center:"text-center",right:"text-right"};return t.jsx("div",{className:f("w-full overflow-x-auto",u),children:t.jsxs("table",{className:"w-full",children:[t.jsx("thead",{className:"bg-gray-50 dark:bg-gray-800 border-b border-gray-200 dark:border-gray-700",children:t.jsx("tr",{children:e.map(b=>t.jsx("th",{className:f(d?"px-3 py-2":"px-6 py-3","text-xs font-medium text-gray-700 dark:text-gray-300 uppercase tracking-wider",m[b.align||"left"],b.sortable&&"cursor-pointer select-none hover:bg-gray-100 dark:hover:bg-gray-700",i&&"border-r border-gray-200 dark:border-gray-700 last:border-r-0"),style:{width:b.width},onClick:()=>b.sortable&&y(b),children:t.jsxs("div",{className:"flex items-center gap-2",children:[b.label,b.sortable&&t.jsx("span",{className:"flex flex-col",children:n?.column===b.key?n.direction==="asc"?t.jsx("svg",{className:"w-4 h-4",fill:"currentColor",viewBox:"0 0 20 20",children:t.jsx("path",{d:"M5 10l5-5 5 5H5z"})}):t.jsx("svg",{className:"w-4 h-4",fill:"currentColor",viewBox:"0 0 20 20",children:t.jsx("path",{d:"M15 10l-5 5-5-5h10z"})}):t.jsx("svg",{className:"w-4 h-4 text-gray-400",fill:"currentColor",viewBox:"0 0 20 20",children:t.jsx("path",{d:"M5 10l5-5 5 5H5z"})})})]})},b.key))})}),t.jsx("tbody",{className:"bg-white dark:bg-gray-900 divide-y divide-gray-200 dark:divide-gray-700",children:r.length===0?t.jsx("tr",{children:t.jsx("td",{colSpan:e.length,className:"px-6 py-8 text-center text-sm text-gray-500 dark:text-gray-400",children:h})}):r.map((b,v)=>t.jsx("tr",{className:f(l&&v%2===1&&"bg-gray-50 dark:bg-gray-800/50",c&&"hover:bg-gray-100 dark:hover:bg-gray-800 transition-colors",s&&"cursor-pointer"),onClick:()=>s?.(b,v),children:e.map(k=>t.jsx("td",{className:f(d?"px-3 py-2":"px-6 py-4","text-sm text-gray-900 dark:text-white",m[k.align||"left"],i&&"border-r border-gray-200 dark:border-gray-700 last:border-r-0"),children:k.render?k.render(b,v):b[k.key]},k.key))},a(b,v)))})]})})}const yi=({data:e,columns:r,hasActions:a=!1,renderCell:n,renderAction:o,emptyMessage:s="No data available",getRowKey:l=(d,i)=>String(i),className:c=""})=>!e||e.length===0?t.jsx("div",{className:`text-center py-8 bg-gray-50 dark:bg-gray-800 rounded-lg ${c}`,children:t.jsx("p",{className:`${U.body.sm()} text-gray-500 dark:text-gray-400`,children:s})}):t.jsx("div",{className:`relative ${c}`,children:t.jsx("div",{className:"overflow-x-auto",children:t.jsxs("table",{className:"w-full border-collapse",children:[t.jsx("thead",{children:t.jsxs("tr",{className:"border-b border-gray-200 dark:border-gray-700",children:[r.map((d,i)=>t.jsx("th",{className:`${U.label.default()} text-left py-3 px-4 whitespace-nowrap`,children:d},i)),a&&t.jsx("th",{className:`${U.label.default()} text-right py-3 px-4 sticky right-0 bg-white dark:bg-gray-900 whitespace-nowrap`})]})}),t.jsx("tbody",{children:e.map((d,i)=>t.jsxs("tr",{className:"border-b border-gray-100 dark:border-gray-800 hover:bg-gray-50 dark:hover:bg-gray-800/50",children:[r.map((h,u)=>{const y=n(d,u);return t.jsx("td",{className:"py-3 px-4",children:typeof y=="string"?t.jsx("span",{className:U.body.sm(),children:y}):y},u)}),a&&t.jsx("td",{className:"py-3 px-4 text-right sticky right-0 bg-white dark:bg-gray-900",children:o?.(d)})]},l(d,i)))})]})})}),pi=({className:e,children:r,disabled:a=!1,onClick:n})=>t.jsx("div",{className:f("p-4 rounded-lg border transition-colors","bg-white dark:bg-gray-900","border-gray-200 dark:border-gray-700","text-gray-900 dark:text-white",a&&"opacity-50 cursor-not-allowed","hover:bg-gray-50 dark:hover:bg-gray-800",e),onClick:a?void 0:n,role:"region","aria-label":"UdataUgrid",children:r||"UdataUgrid Component"}),vi=({className:e,children:r,disabled:a=!1,onClick:n})=>t.jsx("div",{className:f("p-4 rounded-lg border transition-colors","bg-white dark:bg-gray-900","border-gray-200 dark:border-gray-700","text-gray-900 dark:text-white",a&&"opacity-50 cursor-not-allowed","hover:bg-gray-50 dark:hover:bg-gray-800",e),onClick:a?void 0:n,role:"region","aria-label":"UpivotUtable",children:r||"UpivotUtable Component"}),ki=({className:e,children:r,disabled:a=!1,onClick:n})=>t.jsx("div",{className:f("p-4 rounded-lg border transition-colors","bg-white dark:bg-gray-900","border-gray-200 dark:border-gray-700","text-gray-900 dark:text-white",a&&"opacity-50 cursor-not-allowed","hover:bg-gray-50 dark:hover:bg-gray-800",e),onClick:a?void 0:n,role:"region","aria-label":"UspreadsheetUgrid",children:r||"UspreadsheetUgrid Component"}),xi=({className:e,children:r,disabled:a=!1,onClick:n})=>t.jsx("div",{className:f("p-4 rounded-lg border transition-colors","bg-white dark:bg-gray-900","border-gray-200 dark:border-gray-700","text-gray-900 dark:text-white",a&&"opacity-50 cursor-not-allowed","hover:bg-gray-50 dark:hover:bg-gray-800",e),onClick:a?void 0:n,role:"region","aria-label":"UcolumnUresize",children:r||"UcolumnUresize Component"}),wi=({className:e,children:r,disabled:a=!1,onClick:n})=>t.jsx("div",{className:f("p-4 rounded-lg border transition-colors","bg-white dark:bg-gray-900","border-gray-200 dark:border-gray-700","text-gray-900 dark:text-white",a&&"opacity-50 cursor-not-allowed","hover:bg-gray-50 dark:hover:bg-gray-800",e),onClick:a?void 0:n,role:"region","aria-label":"UcellUeditor",children:r||"UcellUeditor Component"}),Ni=({className:e,children:r,disabled:a=!1,onClick:n})=>t.jsx("div",{className:f("p-4 rounded-lg border transition-colors","bg-white dark:bg-gray-900","border-gray-200 dark:border-gray-700","text-gray-900 dark:text-white",a&&"opacity-50 cursor-not-allowed","hover:bg-gray-50 dark:hover:bg-gray-800",e),onClick:a?void 0:n,role:"region","aria-label":"UtableUreservation",children:r||"UtableUreservation Component"}),Ci=({children:e,type:r="unordered",spacing:a="sm",marker:n,size:o="md",className:s})=>{const l=r==="ordered"?"ol":"ul",c={none:"space-y-0",sm:"space-y-1",md:"space-y-2",lg:"space-y-4"},d={sm:"text-sm",md:"text-base",lg:"text-lg"},i=()=>n==="none"?"list-none":r==="unordered"?{disc:"list-disc",circle:"list-circle",square:"list-square",decimal:"list-disc",alpha:"list-disc",roman:"list-disc",none:"list-none"}[n||"disc"]:{decimal:"list-decimal",alpha:"list-alpha",roman:"list-roman",disc:"list-decimal",circle:"list-decimal",square:"list-decimal",none:"list-none"}[n||"decimal"];return t.jsx(l,{className:f("ml-6",i(),c[a],d[o],"text-gray-900 dark:text-gray-100",s),children:e})},Si=({children:e,className:r})=>t.jsx("li",{className:f("leading-relaxed",r),children:e}),Ei=({children:e,onAction:r,actionText:a="Remove",actionIcon:n=P.TrashIcon,destructive:o=!0,isProcessing:s=!1,variant:l="default",className:c})=>{const d="flex items-center justify-between p-4 rounded-lg transition-colors",i={default:"bg-gray-50 dark:bg-gray-700",compact:"bg-gray-50 dark:bg-gray-700 py-2 px-3",elevated:"bg-white dark:bg-gray-800 border border-gray-200 dark:border-gray-700 shadow-sm hover:shadow-md"};return t.jsxs("div",{className:f(d,i[l],c),children:[t.jsx("div",{className:"flex-1 text-sm text-gray-900 dark:text-white",children:e}),t.jsxs(ne,{variant:o?"ghost":"outline",size:"sm",onClick:r,disabled:s,className:f("ml-4",o&&"text-red-600 dark:text-red-400 hover:text-red-700 dark:hover:text-red-300 hover:bg-red-50 dark:hover:bg-red-900/20"),children:[t.jsx(n,{className:"h-4 w-4 mr-1"}),a]})]})},Ai=({className:e,children:r,disabled:a=!1,onClick:n})=>t.jsx("div",{className:f("p-4 rounded-lg border transition-colors","bg-white dark:bg-gray-900","border-gray-200 dark:border-gray-700","text-gray-900 dark:text-white",a&&"opacity-50 cursor-not-allowed","hover:bg-gray-50 dark:hover:bg-gray-800",e),onClick:a?void 0:n,role:"region","aria-label":"UuserUtable",children:r||"UuserUtable Component"}),Ti=({source:e,target:r,onChange:a,sourceTitle:n="Available",targetTitle:o="Selected",searchable:s=!0,sourceSearchPlaceholder:l="Search available...",targetSearchPlaceholder:c="Search selected...",height:d=300,disabled:i=!1,className:h})=>{const[u,y]=p.useState(""),[m,b]=p.useState(""),[v,k]=p.useState(new Set),[S,x]=p.useState(new Set),N=s?e.filter(D=>D.label.toLowerCase().includes(u.toLowerCase())):e,w=s?r.filter(D=>D.label.toLowerCase().includes(m.toLowerCase())):r,E=D=>{const B=new Set(v);B.has(D)?B.delete(D):B.add(D),k(B)},A=D=>{const B=new Set(S);B.has(D)?B.delete(D):B.add(D),x(B)},C=()=>{const D=e.filter(F=>v.has(F.id)),B=e.filter(F=>!v.has(F.id)),z=[...r,...D];a(B,z),k(new Set)},I=()=>{const D=r.filter(F=>S.has(F.id)),B=r.filter(F=>!S.has(F.id)),z=[...e,...D];a(z,B),x(new Set)},L=()=>{const D=[...r,...e];a([],D),k(new Set)},O=()=>{const D=[...e,...r];a(D,[]),x(new Set)},M=(D,B,z,F,V,R,Bh)=>t.jsxs("div",{className:"flex flex-col flex-1 border border-gray-300 dark:border-gray-700 rounded-md bg-white dark:bg-gray-900",children:[t.jsxs("div",{className:"px-3 py-2 border-b border-gray-300 dark:border-gray-700 bg-gray-50 dark:bg-gray-800",children:[t.jsx("h3",{className:"text-sm font-semibold text-gray-900 dark:text-white",children:B}),t.jsxs("p",{className:"text-xs text-gray-600 dark:text-gray-400",children:[D.length," item",D.length!==1?"s":""]})]}),s&&t.jsx("div",{className:"p-2 border-b border-gray-200 dark:border-gray-700",children:t.jsx("input",{type:"text",value:V,onChange:se=>R(se.target.value),placeholder:Bh,className:"w-full px-3 py-2 text-sm bg-gray-50 dark:bg-gray-800 border border-gray-300 dark:border-gray-700 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500 dark:focus:ring-blue-400"})}),t.jsx("div",{className:"overflow-y-auto p-2 space-y-1",style:{height:s?d-120:d-60},children:D.length===0?t.jsx("div",{className:"flex items-center justify-center h-full text-sm text-gray-500 dark:text-gray-400",children:"No items"}):D.map(se=>{const et=z.has(se.id);return t.jsx("button",{onClick:()=>!se.disabled&&F(se.id),disabled:se.disabled||i,className:f("w-full px-3 py-2 text-left rounded-md transition-colors","hover:bg-gray-100 dark:hover:bg-gray-800","disabled:opacity-50 disabled:cursor-not-allowed",et&&"bg-blue-50 dark:bg-blue-900/30 border border-blue-200 dark:border-blue-700"),children:t.jsxs("div",{className:"flex items-start gap-2",children:[t.jsx("div",{className:f("w-4 h-4 border-2 rounded flex items-center justify-center flex-shrink-0 mt-0.5",et?"bg-blue-600 border-blue-600 dark:bg-blue-500 dark:border-blue-500":"border-gray-300 dark:border-gray-600"),children:et&&t.jsx("svg",{className:"w-3 h-3 text-white",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:t.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:3,d:"M5 13l4 4L19 7"})})}),t.jsxs("div",{className:"flex-1 min-w-0",children:[t.jsx("p",{className:"text-sm font-medium text-gray-900 dark:text-white truncate",children:se.label}),se.description&&t.jsx("p",{className:"text-xs text-gray-600 dark:text-gray-400 truncate",children:se.description})]})]})},se.id)})})]});return t.jsxs("div",{className:f("flex gap-4",h),children:[M(N,n,v,E,u,y,l),t.jsxs("div",{className:"flex flex-col justify-center gap-2",children:[t.jsx("button",{onClick:L,disabled:i||e.length===0,className:f("px-3 py-2 text-sm bg-white dark:bg-gray-900","border border-gray-300 dark:border-gray-700","rounded-md","hover:bg-gray-50 dark:hover:bg-gray-800","transition-colors","disabled:opacity-50 disabled:cursor-not-allowed"),title:"Move all to selected",children:t.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:t.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M13 5l7 7-7 7M5 5l7 7-7 7"})})}),t.jsx("button",{onClick:C,disabled:i||v.size===0,className:f("px-3 py-2 text-sm bg-white dark:bg-gray-900","border border-gray-300 dark:border-gray-700","rounded-md","hover:bg-gray-50 dark:hover:bg-gray-800","transition-colors","disabled:opacity-50 disabled:cursor-not-allowed"),title:"Move selected to target",children:t.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:t.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 5l7 7-7 7"})})}),t.jsx("button",{onClick:I,disabled:i||S.size===0,className:f("px-3 py-2 text-sm bg-white dark:bg-gray-900","border border-gray-300 dark:border-gray-700","rounded-md","hover:bg-gray-50 dark:hover:bg-gray-800","transition-colors","disabled:opacity-50 disabled:cursor-not-allowed"),title:"Move selected to source",children:t.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:t.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M15 19l-7-7 7-7"})})}),t.jsx("button",{onClick:O,disabled:i||r.length===0,className:f("px-3 py-2 text-sm bg-white dark:bg-gray-900","border border-gray-300 dark:border-gray-700","rounded-md","hover:bg-gray-50 dark:hover:bg-gray-800","transition-colors","disabled:opacity-50 disabled:cursor-not-allowed"),title:"Move all to available",children:t.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:t.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M11 19l-7-7 7-7M19 19l-7-7 7-7"})})})]}),M(w,o,S,A,m,b,c)]})};function Ii({items:e,itemHeight:r,height:a,renderItem:n,keyExtractor:o,overscan:s=3,className:l}){const[c,d]=p.useState(0),i=p.useRef(null),h=v=>{d(v.currentTarget.scrollTop)},u=e.length*r,y=Math.max(0,Math.floor(c/r)-s),m=Math.min(e.length-1,Math.ceil((c+a)/r)+s),b=e.slice(y,m+1);return t.jsx("div",{ref:i,className:f("overflow-auto",l),style:{height:a},onScroll:h,children:t.jsx("div",{style:{height:u,position:"relative"},children:b.map((v,k)=>{const S=y+k;return t.jsx("div",{style:{position:"absolute",top:S*r,height:r,width:"100%"},children:n(v,S)},o(v,S))})})})}const Li=({data:e,selectedId:r,onSelect:a,expandedIds:n,onExpand:o,defaultExpanded:s=!1,showLines:l=!1,className:c})=>{const[d,i]=p.useState(new Set(s?e.map(b=>b.id):[])),h=n!==void 0?new Set(n):d,u=b=>{n!==void 0&&o?o(b):i(v=>{const k=new Set(v);return k.has(b)?k.delete(b):k.add(b),k})},y=b=>{!b.disabled&&a&&a(b)},m=(b,v=0)=>{const k=b.children&&b.children.length>0,S=h.has(b.id),x=r===b.id;return t.jsxs("div",{children:[t.jsxs("div",{className:f("flex items-center gap-2 px-2 py-1.5 rounded-md transition-colors",!b.disabled&&"hover:bg-gray-100 dark:hover:bg-gray-800",x&&"bg-blue-50 dark:bg-blue-900/30",b.disabled&&"opacity-50 cursor-not-allowed",!b.disabled&&"cursor-pointer"),style:{paddingLeft:`${v*1.5+.5}rem`},onClick:()=>y(b),children:[k?t.jsx("button",{onClick:N=>{N.stopPropagation(),u(b.id)},className:"flex-shrink-0 w-4 h-4 flex items-center justify-center hover:bg-gray-200 dark:hover:bg-gray-700 rounded transition-colors",children:t.jsx("svg",{className:f("w-3 h-3 transition-transform",S&&"rotate-90"),fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:t.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 5l7 7-7 7"})})}):t.jsx("div",{className:"w-4 h-4 flex-shrink-0"}),b.icon&&t.jsx("span",{className:"flex-shrink-0 w-4 h-4 text-gray-600 dark:text-gray-400",children:b.icon}),t.jsx("span",{className:f("flex-1 text-sm",x?"text-blue-700 dark:text-blue-300 font-medium":"text-gray-900 dark:text-white"),children:b.label})]}),k&&S&&t.jsx("div",{className:f(l&&"border-l-2 border-gray-200 dark:border-gray-700 ml-2"),children:b.children.map(N=>m(N,v+1))})]},b.id)};return t.jsx("div",{className:f("w-full",c),children:e.map(b=>m(b,0))})},Mi=({className:e,children:r,disabled:a=!1,onClick:n})=>t.jsx("div",{className:f("p-4 rounded-lg border transition-colors","bg-white dark:bg-gray-900","border-gray-200 dark:border-gray-700","text-gray-900 dark:text-white",a&&"opacity-50 cursor-not-allowed","hover:bg-gray-50 dark:hover:bg-gray-800",e),onClick:a?void 0:n,role:"region","aria-label":"UlistingUform",children:r||"UlistingUform Component"}),Pi="bg-gradient-to-r from-blue-50 to-indigo-50 dark:from-blue-900/20 dark:to-indigo-900/20 border border-blue-200 dark:border-blue-800",Oi={none:"",sm:"p-3",md:"p-6",lg:"p-8"},Lr=({variant:e="elevated",padding:r="md",icon:a,onClose:n,className:o,children:s,...l})=>{const d=["info","success","warning","error"].includes(e)&&(a||n),i=e==="callout"?Pi:Tn(e);return t.jsx("div",{className:f("rounded-lg",i,Oi[r],o),...l,children:d?t.jsxs("div",{className:"flex items-start gap-3",children:[a&&t.jsx("div",{className:"flex-shrink-0 text-lg",children:a}),t.jsx("div",{className:"flex-1 min-w-0",children:s}),n&&t.jsx("button",{onClick:n,className:"flex-shrink-0 text-current hover:opacity-70 transition-opacity","aria-label":"Close",children:t.jsx("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:t.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})})]}):s})},Ui=({title:e,description:r,className:a,children:n,...o})=>t.jsxs("div",{className:f("space-y-1.5",a),...o,children:[e&&t.jsx("h3",{className:U.heading.h4(),children:e}),r&&t.jsx("p",{className:U.body.sm(),children:r}),n]}),Di=({className:e,children:r,...a})=>t.jsx("div",{className:f("",e),...a,children:r}),zi=({className:e,children:r,...a})=>t.jsx("div",{className:f("flex items-center pt-4",e),...a,children:r}),ji=({title:e,children:r,variant:a="info",size:n="default",className:o})=>{const s={sm:"sm",default:"md",lg:"lg"},l=a==="neutral"?"bordered":a;return t.jsxs(Lr,{variant:l,padding:s[n],className:o,children:[e&&t.jsx("h3",{className:f("font-semibold mb-2",n==="sm"?"text-base":n==="lg"?"text-xl":"text-lg"),children:e}),r]})},_i=({title:e,icon:r,children:a,variant:n="gradient",size:o="default",centered:s=!1,className:l})=>{const c={sm:"sm",default:"md",lg:"lg"},d=n==="gradient"||n==="neutral"?"callout":n;return t.jsx(Lr,{variant:d,padding:c[o],className:l,children:t.jsxs("div",{className:f("space-y-4",s&&"text-center"),children:[r&&t.jsx("div",{className:f("font-bold",o==="sm"?"text-2xl":o==="lg"?"text-5xl":"text-4xl",s?"text-center":"text-left"),children:r}),e&&t.jsx("h3",{className:f("font-bold mb-4",o==="sm"?"text-lg":o==="lg"?"text-3xl":"text-2xl"),children:e}),t.jsx("div",{className:f("text-gray-600 dark:text-gray-400",o==="sm"?"text-sm":o==="lg"?"text-lg":"text-base"),children:a})]})})},Bi=({title:e,value:r,change:a,changePeriod:n="vs last period",icon:o,variant:s="default",className:l})=>{const c={default:"bg-white dark:bg-gray-900",primary:"bg-blue-50 dark:bg-blue-900/20",success:"bg-green-50 dark:bg-green-900/20",warning:"bg-yellow-50 dark:bg-yellow-900/20",danger:"bg-red-50 dark:bg-red-900/20"};return t.jsxs("div",{className:f("rounded-lg border border-gray-200 dark:border-gray-700 p-6",c[s],l),children:[t.jsxs("div",{className:"flex items-start justify-between mb-2",children:[t.jsx("h3",{className:"text-sm font-medium text-gray-600 dark:text-gray-400",children:e}),o&&t.jsx("div",{className:"text-gray-400 dark:text-gray-600",children:o})]}),t.jsx("div",{className:"flex items-end justify-between",children:t.jsxs("div",{children:[t.jsx("p",{className:"text-3xl font-bold text-gray-900 dark:text-white",children:r}),a!==void 0&&t.jsxs("div",{className:"flex items-center gap-1 mt-2",children:[t.jsxs("span",{className:f("text-sm font-medium",a>=0?"text-green-600 dark:text-green-400":"text-red-600 dark:text-red-400"),children:[a>=0?"↑":"↓"," ",Math.abs(a),"%"]}),t.jsx("span",{className:"text-xs text-gray-500 dark:text-gray-400",children:n})]})]})})]})},Fi=({src:e,alt:r="Avatar",fallback:a,name:n,size:o="md",status:s,className:l,onClick:c})=>{const[d,i]=p.useState(!1),h={sm:"w-8 h-8 text-xs",md:"w-10 h-10 text-sm",lg:"w-12 h-12 text-base"},u={sm:"w-2 h-2",md:"w-2.5 h-2.5",lg:"w-3 h-3"},y={online:"bg-green-500",offline:"bg-gray-400",away:"bg-yellow-500",busy:"bg-red-500"},b=a||(n?(S=>{const x=S.trim().split(/\s+/);return x.length===1?x[0].charAt(0).toUpperCase():x[0].charAt(0).toUpperCase()+x[x.length-1].charAt(0).toUpperCase()})(n):""),v=e&&!d,k=()=>{i(!0)};return t.jsxs("div",{className:"relative inline-block flex-shrink-0",children:[t.jsx("div",{className:f("flex items-center justify-center overflow-hidden rounded-full",h[o],!v&&"bg-gray-300 dark:bg-gray-600 text-gray-700 dark:text-gray-200",c&&"cursor-pointer hover:opacity-80 transition-opacity",l),onClick:c,role:c?"button":void 0,tabIndex:c?0:void 0,children:v?t.jsx("img",{src:e,alt:r,className:"w-full h-full object-cover",onError:k}):t.jsx("span",{className:"font-semibold",children:b})}),s&&t.jsx("span",{className:f("absolute bottom-0 right-0 rounded-full border-2 border-white dark:border-gray-800",y[s],u[o]),"aria-label":s})]})},Wi=({className:e,children:r,disabled:a=!1,onClick:n})=>t.jsx("div",{className:f("p-4 rounded-lg border transition-colors","bg-white dark:bg-gray-900","border-gray-200 dark:border-gray-700","text-gray-900 dark:text-white",a&&"opacity-50 cursor-not-allowed","hover:bg-gray-50 dark:hover:bg-gray-800",e),onClick:a?void 0:n,role:"region","aria-label":"UavatarUgroup",children:r||"UavatarUgroup Component"}),Vi=({className:e,children:r,disabled:a=!1,onClick:n})=>t.jsx("div",{className:f("p-4 rounded-lg border transition-colors","bg-white dark:bg-gray-900","border-gray-200 dark:border-gray-700","text-gray-900 dark:text-white",a&&"opacity-50 cursor-not-allowed","hover:bg-gray-50 dark:hover:bg-gray-800",e),onClick:a?void 0:n,role:"region","aria-label":"UprofileUheader",children:r||"UprofileUheader Component"}),$i=({label:e,value:r,orientation:a="vertical",align:n="start",labelWidth:o="auto",size:s="md",separator:l=!1,labelVariant:c="muted",valueVariant:d="default",className:i,labelClassName:h,valueClassName:u})=>{const y={sm:{label:U.body.sm(),value:U.body.sm(),gap:"gap-1"},md:{label:U.body.md(),value:U.body.md(),gap:"gap-2"},lg:{label:U.body.lg(),value:U.body.lg(),gap:"gap-3"}},m={auto:"",sm:"w-24",md:"w-32",lg:"w-40"},b={start:"justify-start",center:"justify-center",between:"justify-between"},v={default:"text-gray-700 dark:text-gray-300",muted:"text-gray-600 dark:text-gray-400",strong:"text-gray-900 dark:text-gray-100 font-semibold"},k={default:"text-gray-900 dark:text-gray-100",muted:"text-gray-600 dark:text-gray-400",strong:"text-gray-900 dark:text-gray-100 font-semibold",primary:"text-blue-600 dark:text-blue-400"},S=y[s];return t.jsxs("div",{className:f(a==="horizontal"?"flex items-center":"flex flex-col",a==="horizontal"&&b[n],S.gap,l&&"pb-3 mb-3 border-b border-gray-200 dark:border-gray-700",i),children:[t.jsx("dt",{className:f(S.label,v[c],a==="horizontal"&&m[o],a==="horizontal"&&"flex-shrink-0",h),children:e}),t.jsx("dd",{className:f(S.value,k[d],a==="horizontal"&&"flex-1",u),children:r})]})},Hi=({value:e,label:r,variant:a="neutral",size:n="md",align:o="center",icon:s,iconPosition:l="top",className:c,valueClassName:d,labelClassName:i})=>{const h={primary:{value:"text-blue-600 dark:text-blue-400",label:"text-blue-600/70 dark:text-blue-400/70",icon:"text-blue-600 dark:text-blue-400"},success:{value:"text-green-600 dark:text-green-400",label:"text-green-600/70 dark:text-green-400/70",icon:"text-green-600 dark:text-green-400"},warning:{value:"text-yellow-600 dark:text-yellow-400",label:"text-yellow-600/70 dark:text-yellow-400/70",icon:"text-yellow-600 dark:text-yellow-400"},danger:{value:"text-red-600 dark:text-red-400",label:"text-red-600/70 dark:text-red-400/70",icon:"text-red-600 dark:text-red-400"},neutral:{value:"text-gray-900 dark:text-gray-100",label:"text-gray-600 dark:text-gray-400",icon:"text-gray-600 dark:text-gray-400"},white:{value:"text-white",label:"text-white/70",icon:"text-white"}},u={sm:{value:U.heading.h5(),label:U.caption.default(),icon:"h-4 w-4"},md:{value:U.heading.h4(),label:U.body.sm(),icon:"h-5 w-5"},lg:{value:U.heading.h3(),label:U.body.md(),icon:"h-6 w-6"},xl:{value:U.heading.h2(),label:U.body.lg(),icon:"h-8 w-8"}},y={left:"text-left",center:"text-center",right:"text-right"},m=h[a],b=u[n];return t.jsxs("div",{className:f(y[o],c),children:[s&&l==="top"&&t.jsx(s,{className:f(b.icon,m.icon,"mb-2",o==="center"&&"mx-auto")}),t.jsxs("div",{className:f(l==="left"&&s&&"flex items-center gap-3",o==="center"&&l==="left"&&"justify-center"),children:[s&&l==="left"&&t.jsx(s,{className:f(b.icon,m.icon)}),t.jsxs("div",{children:[t.jsx("div",{className:f("font-bold",b.value,m.value,d),children:e}),t.jsx("div",{className:f(b.label,m.label,i),children:r})]})]})]})},Qt=({icon:e,title:r="No data",description:a,action:n,className:o})=>t.jsxs("div",{className:f("flex flex-col items-center justify-center py-12 px-4 text-center",o),children:[e&&t.jsx("div",{className:"mb-4 text-gray-400 dark:text-gray-600",children:e}),t.jsx("h3",{className:f(U.heading.h3(),"mb-2"),children:r}),a&&t.jsx("p",{className:f(U.body.sm(),"text-gray-600 dark:text-gray-400 max-w-sm mb-6"),children:a}),n&&t.jsx("div",{className:"mt-4",children:n})]}),qi=({title:e,subtext:r,className:a})=>t.jsx(Qt,{title:e,description:r,className:a}),Gi=({data:e,orientation:r="vertical",showValues:a=!1,showGrid:n=!0,barWidth:o=40,height:s=300,className:l})=>{const c=Math.max(...e.map(i=>i.value)),d="#3b82f6";return t.jsx("div",{className:f("w-full",l),children:t.jsxs("div",{className:"relative bg-white dark:bg-gray-900 rounded-lg p-6",style:{height:`${s}px`},children:[n&&t.jsx("div",{className:"absolute inset-6 flex flex-col justify-between",children:[...Array(5)].map((i,h)=>t.jsx("div",{className:"border-t border-gray-200 dark:border-gray-700"},h))}),r==="vertical"?t.jsx("div",{className:"relative h-full flex items-end justify-around gap-2",children:e.map((i,h)=>{const u=i.value/c*100;return t.jsxs("div",{className:"flex flex-col items-center gap-2",style:{width:`${o}px`},children:[a&&t.jsx("span",{className:"text-xs text-gray-600 dark:text-gray-400",children:i.value}),t.jsx("div",{className:"w-full rounded-t transition-all hover:opacity-80",style:{height:`${u}%`,backgroundColor:i.color||d}}),t.jsx("span",{className:"text-xs text-gray-600 dark:text-gray-400",children:i.label})]},h)})}):t.jsx("div",{className:"relative h-full flex flex-col justify-around gap-2",children:e.map((i,h)=>{const u=i.value/c*100;return t.jsxs("div",{className:"flex items-center gap-4",children:[t.jsx("span",{className:"text-sm text-gray-600 dark:text-gray-400 w-16 text-right",children:i.label}),t.jsxs("div",{className:"flex-1 flex items-center gap-2",children:[t.jsx("div",{className:"h-8 rounded transition-all hover:opacity-80",style:{width:`${u}%`,backgroundColor:i.color||d}}),a&&t.jsx("span",{className:"text-xs text-gray-600 dark:text-gray-400",children:i.value})]})]},h)})})]})})},Yi=({series:e,showLegend:r=!0,showGrid:a=!0,showPoints:n=!0,height:o=300,xLabels:s,className:l})=>{const c=e.flatMap(m=>m.data),d=Math.max(...c.map(m=>m.y)),i=Math.min(...c.map(m=>m.y)),h=Math.max(...c.map(m=>m.x)),u=["#3b82f6","#10b981","#f59e0b","#ef4444","#8b5cf6"],y=m=>m.length===0?"":`M ${m.map(v=>{const k=v.x/h*100,S=100-(v.y-i)/(d-i)*100;return`${k},${S}`}).join(" L ")}`;return t.jsxs("div",{className:f("w-full",l),children:[r&&t.jsx("div",{className:"flex flex-wrap gap-4 mb-4",children:e.map((m,b)=>t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx("div",{className:"w-3 h-3 rounded-full",style:{backgroundColor:m.color||u[b%u.length]}}),t.jsx("span",{className:"text-sm text-gray-700 dark:text-gray-300",children:m.name})]},b))}),t.jsxs("div",{className:"bg-white dark:bg-gray-900 rounded-lg p-6",children:[t.jsxs("div",{className:"relative",style:{height:`${o}px`},children:[a&&t.jsx("div",{className:"absolute inset-0",children:[...Array(5)].map((m,b)=>t.jsx("div",{className:"absolute w-full border-t border-gray-200 dark:border-gray-700",style:{top:`${b*25}%`}},b))}),t.jsx("svg",{viewBox:"0 0 100 100",preserveAspectRatio:"none",className:"absolute inset-0 w-full h-full",children:e.map((m,b)=>{const v=m.color||u[b%u.length];return t.jsxs("g",{children:[t.jsx("path",{d:y(m.data),fill:"none",stroke:v,strokeWidth:"0.5",vectorEffect:"non-scaling-stroke"}),n&&m.data.map((k,S)=>{const x=k.x/h*100,N=100-(k.y-i)/(d-i)*100;return t.jsx("circle",{cx:x,cy:N,r:"1",fill:v,vectorEffect:"non-scaling-stroke"},S)})]},b)})})]}),s&&t.jsx("div",{className:"flex justify-between mt-2",children:s.map((m,b)=>t.jsx("span",{className:"text-xs text-gray-600 dark:text-gray-400",children:m},b))})]})]})},Ki=({data:e,variant:r="pie",showLegend:a=!0,showPercentages:n=!1,size:o=200,donutHoleSize:s=40,className:l})=>{const c=e.reduce((b,v)=>b+v.value,0),d=["#3b82f6","#10b981","#f59e0b","#ef4444","#8b5cf6","#ec4899"],i=e.reduce((b,v,k)=>{const S=v.value/c*100,x=S/100*360,N=b.length>0?b[b.length-1].endAngle:-90,w=N+x;return b.push({...v,percentage:S,startAngle:N,endAngle:w,color:v.color||d[k%d.length]}),b},[]),h=(b,v,k,S)=>{const x=(S-90)*Math.PI/180;return{x:b+k*Math.cos(x),y:v+k*Math.sin(x)}},u=(b,v,k,S,x)=>{const N=h(b,v,k,x),w=h(b,v,k,S),E=x-S<=180?"0":"1";if(r==="donut"){const A=k*s/100,C=h(b,v,A,x),I=h(b,v,A,S);return["M",N.x,N.y,"A",k,k,0,E,0,w.x,w.y,"L",I.x,I.y,"A",A,A,0,E,1,C.x,C.y,"Z"].join(" ")}return["M",b,v,"L",N.x,N.y,"A",k,k,0,E,0,w.x,w.y,"Z"].join(" ")},y=o/2,m=o/2-10;return t.jsxs("div",{className:f("flex flex-col items-center gap-4",l),children:[t.jsx("svg",{width:o,height:o,className:"transform rotate-0",children:i.map((b,v)=>t.jsx("path",{d:u(y,y,m,b.startAngle,b.endAngle),fill:b.color,className:"transition-opacity hover:opacity-80"},v))}),a&&t.jsx("div",{className:"flex flex-col gap-2",children:i.map((b,v)=>t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx("div",{className:"w-3 h-3 rounded-sm",style:{backgroundColor:b.color}}),t.jsxs("span",{className:"text-sm text-gray-700 dark:text-gray-300",children:[b.label,n&&t.jsxs("span",{className:"text-gray-500 dark:text-gray-400 ml-1",children:["(",Math.round(b.percentage),"%)"]})]})]},v))})]})},Xi=({series:e,showLegend:r=!0,showGrid:a=!0,fillOpacity:n=.2,height:o=300,xLabels:s,className:l})=>{const c=e.flatMap(b=>b.data),d=Math.max(...c.map(b=>b.y)),i=Math.min(...c.map(b=>b.y)),h=Math.max(...c.map(b=>b.x)),u=["#3b82f6","#10b981","#f59e0b","#ef4444","#8b5cf6"],y=b=>{if(b.length===0)return"";const v=b.map(x=>{const N=x.x/h*100,w=100-(x.y-i)/(d-i)*100;return`${N},${w}`}),k=b[0].x/h*100,S=b[b.length-1].x/h*100;return`M ${k},100 L ${v.join(" L ")} L ${S},100 Z`},m=b=>b.length===0?"":`M ${b.map(k=>{const S=k.x/h*100,x=100-(k.y-i)/(d-i)*100;return`${S},${x}`}).join(" L ")}`;return t.jsxs("div",{className:f("w-full",l),children:[r&&t.jsx("div",{className:"flex flex-wrap gap-4 mb-4",children:e.map((b,v)=>t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx("div",{className:"w-3 h-3 rounded-full",style:{backgroundColor:b.color||u[v%u.length]}}),t.jsx("span",{className:"text-sm text-gray-700 dark:text-gray-300",children:b.name})]},v))}),t.jsxs("div",{className:"bg-white dark:bg-gray-900 rounded-lg p-6",children:[t.jsxs("div",{className:"relative",style:{height:`${o}px`},children:[a&&t.jsx("div",{className:"absolute inset-0",children:[...Array(5)].map((b,v)=>t.jsx("div",{className:"absolute w-full border-t border-gray-200 dark:border-gray-700",style:{top:`${v*25}%`}},v))}),t.jsx("svg",{viewBox:"0 0 100 100",preserveAspectRatio:"none",className:"absolute inset-0 w-full h-full",children:e.map((b,v)=>{const k=b.color||u[v%u.length];return t.jsxs("g",{children:[t.jsx("path",{d:y(b.data),fill:k,fillOpacity:n}),t.jsx("path",{d:m(b.data),fill:"none",stroke:k,strokeWidth:"0.5",vectorEffect:"non-scaling-stroke"})]},v)})})]}),s&&t.jsx("div",{className:"flex justify-between mt-2",children:s.map((b,v)=>t.jsx("span",{className:"text-xs text-gray-600 dark:text-gray-400",children:b},v))})]})]})},Zi=({className:e,children:r,disabled:a=!1,onClick:n})=>t.jsx("div",{className:f("p-4 rounded-lg border transition-colors","bg-white dark:bg-gray-900","border-gray-200 dark:border-gray-700","text-gray-900 dark:text-white",a&&"opacity-50 cursor-not-allowed","hover:bg-gray-50 dark:hover:bg-gray-800",e),onClick:a?void 0:n,role:"region","aria-label":"UradarUchart",children:r||"UradarUchart Component"}),Ji=({className:e,children:r,disabled:a=!1,onClick:n})=>t.jsx("div",{className:f("p-4 rounded-lg border transition-colors","bg-white dark:bg-gray-900","border-gray-200 dark:border-gray-700","text-gray-900 dark:text-white",a&&"opacity-50 cursor-not-allowed","hover:bg-gray-50 dark:hover:bg-gray-800",e),onClick:a?void 0:n,role:"region","aria-label":"UbubbleUchart",children:r||"UbubbleUchart Component"}),Qi=({className:e,children:r,disabled:a=!1,onClick:n})=>t.jsx("div",{className:f("p-4 rounded-lg border transition-colors","bg-white dark:bg-gray-900","border-gray-200 dark:border-gray-700","text-gray-900 dark:text-white",a&&"opacity-50 cursor-not-allowed","hover:bg-gray-50 dark:hover:bg-gray-800",e),onClick:a?void 0:n,role:"region","aria-label":"UscatterUplot",children:r||"UscatterUplot Component"}),Ri=({className:e,children:r,disabled:a=!1,onClick:n})=>t.jsx("div",{className:f("p-4 rounded-lg border transition-colors","bg-white dark:bg-gray-900","border-gray-200 dark:border-gray-700","text-gray-900 dark:text-white",a&&"opacity-50 cursor-not-allowed","hover:bg-gray-50 dark:hover:bg-gray-800",e),onClick:a?void 0:n,role:"region","aria-label":"UtreeUmap",children:r||"UtreeUmap Component"}),ec=({className:e,children:r,disabled:a=!1,onClick:n})=>t.jsx("div",{className:f("p-4 rounded-lg border transition-colors","bg-white dark:bg-gray-900","border-gray-200 dark:border-gray-700","text-gray-900 dark:text-white",a&&"opacity-50 cursor-not-allowed","hover:bg-gray-50 dark:hover:bg-gray-800",e),onClick:a?void 0:n,role:"region","aria-label":"UsankeyUdiagram",children:r||"UsankeyUdiagram Component"}),rc=({data:e,width:r=100,height:a=30,color:n="#3b82f6",fill:o=!1,className:s})=>{if(e.length===0)return null;const l=Math.max(...e),c=Math.min(...e),d=l-c||1,i=e.map((h,u)=>{const y=u/(e.length-1)*r,m=a-(h-c)/d*a;return`${y},${m}`}).join(" ");return t.jsxs("svg",{width:r,height:a,className:f("inline-block",s),children:[o&&t.jsx("polygon",{points:`0,${a} ${i} ${r},${a}`,fill:n,opacity:"0.2"}),t.jsx("polyline",{points:i,fill:"none",stroke:n,strokeWidth:"2",strokeLinejoin:"round",strokeLinecap:"round"})]})},tc=({className:e,children:r,disabled:a=!1,onClick:n})=>t.jsx("div",{className:f("p-4 rounded-lg border transition-colors","bg-white dark:bg-gray-900","border-gray-200 dark:border-gray-700","text-gray-900 dark:text-white",a&&"opacity-50 cursor-not-allowed","hover:bg-gray-50 dark:hover:bg-gray-800",e),onClick:a?void 0:n,role:"region","aria-label":"Uheatmap",children:r||"Uheatmap Component"}),ac=({className:e,children:r,disabled:a=!1,onClick:n})=>t.jsx("div",{className:f("p-4 rounded-lg border transition-colors","bg-white dark:bg-gray-900","border-gray-200 dark:border-gray-700","text-gray-900 dark:text-white",a&&"opacity-50 cursor-not-allowed","hover:bg-gray-50 dark:hover:bg-gray-800",e),onClick:a?void 0:n,role:"region","aria-label":"UfunnelUchart",children:r||"UfunnelUchart Component"}),nc=({className:e,children:r,disabled:a})=>t.jsx("div",{className:f("p-4 rounded-lg border transition-colors","bg-white dark:bg-gray-900","border-gray-200 dark:border-gray-700","text-gray-900 dark:text-white",a&&"opacity-50 cursor-not-allowed",e),role:"region","aria-label":"BurndownChart",children:r||"BurndownChart Component"}),oc=({className:e,children:r,disabled:a=!1,onClick:n})=>t.jsx("div",{className:f("p-4 rounded-lg border transition-colors","bg-white dark:bg-gray-900","border-gray-200 dark:border-gray-700","text-gray-900 dark:text-white",a&&"opacity-50 cursor-not-allowed","hover:bg-gray-50 dark:hover:bg-gray-800",e),onClick:a?void 0:n,role:"region","aria-label":"UperformanceUchart",children:r||"UperformanceUchart Component"}),sc=({className:e,children:r,disabled:a=!1,onClick:n})=>t.jsx("div",{className:f("p-4 rounded-lg border transition-colors","bg-white dark:bg-gray-900","border-gray-200 dark:border-gray-700","text-gray-900 dark:text-white",a&&"opacity-50 cursor-not-allowed","hover:bg-gray-50 dark:hover:bg-gray-800",e),onClick:a?void 0:n,role:"region","aria-label":"UmetricUcomparison",children:r||"UmetricUcomparison Component"}),lc=({value:e,min:r=0,max:a=100,size:n=120,strokeWidth:o=10,showValue:s=!0,label:l,variant:c="primary",className:d})=>{const i=Math.min(a,Math.max(r,e)),h=(i-r)/(a-r)*100,u=n/2,y=(n-o)/2,m=Math.PI*y,b=m-h/100*m,v={primary:"stroke-blue-600 dark:stroke-blue-500",success:"stroke-green-600 dark:stroke-green-500",warning:"stroke-yellow-600 dark:stroke-yellow-500",danger:"stroke-red-600 dark:stroke-red-500"};return t.jsxs("div",{className:f("inline-flex flex-col items-center gap-2",d),children:[t.jsxs("svg",{width:n,height:n*.65,className:"transform rotate-180",children:[t.jsx("path",{d:`M ${o/2} ${u} A ${y} ${y} 0 0 1 ${n-o/2} ${u}`,fill:"none",className:"stroke-gray-200 dark:stroke-gray-700",strokeWidth:o,strokeLinecap:"round"}),t.jsx("path",{d:`M ${o/2} ${u} A ${y} ${y} 0 0 1 ${n-o/2} ${u}`,fill:"none",className:f(v[c],"transition-all duration-500"),strokeWidth:o,strokeDasharray:m,strokeDashoffset:b,strokeLinecap:"round"})]}),s&&t.jsxs("div",{className:"text-center -mt-8",children:[t.jsx("div",{className:"text-2xl font-bold text-gray-900 dark:text-white",children:Math.round(i)}),l&&t.jsx("div",{className:"text-xs text-gray-600 dark:text-gray-400",children:l})]})]})},ic=({value:e=0,max:r=100,variant:a="default",size:n="md",showLabel:o=!1,label:s,indeterminate:l=!1,striped:c=!1,animated:d=!1,className:i})=>{const h=Math.min(Math.max(e/r*100,0),100),u={default:"bg-blue-600 dark:bg-blue-500",success:"bg-green-600 dark:bg-green-500",warning:"bg-yellow-600 dark:bg-yellow-500",danger:"bg-red-600 dark:bg-red-500"},y={sm:"h-1",md:"h-2",lg:"h-4"};return t.jsxs("div",{className:f("w-full",i),children:[t.jsx("div",{className:f("w-full bg-gray-200 dark:bg-gray-700 rounded-full overflow-hidden",y[n]),role:"progressbar","aria-valuenow":l?void 0:h,"aria-valuemin":0,"aria-valuemax":100,children:l?t.jsx("div",{className:f("h-full rounded-full animate-pulse",u[a]),style:{width:"100%"}}):t.jsx("div",{className:f("h-full rounded-full transition-all duration-300",u[a],c&&"bg-stripe",c&&d&&"animate-stripe"),style:{width:`${h}%`}})}),(o||s)&&t.jsx("div",{className:"mt-1 text-xs text-gray-600 dark:text-gray-400 text-right",children:s||`${Math.round(h)}%`})]})},cc=({value:e,size:r=100,strokeWidth:a=8,showValue:n=!0,label:o,variant:s="primary",color:l,trackColor:c,className:d})=>{const i=Math.min(100,Math.max(0,e)),h=r/2,u=(r-a)/2,y=2*Math.PI*u,m=y-i/100*y,b={primary:"stroke-blue-600 dark:stroke-blue-500",success:"stroke-green-600 dark:stroke-green-500",warning:"stroke-yellow-600 dark:stroke-yellow-500",danger:"stroke-red-600 dark:stroke-red-500"},v=c||"stroke-gray-200 dark:stroke-gray-700";return t.jsx("div",{className:f("inline-flex items-center justify-center",d),children:t.jsxs("div",{className:"relative",style:{width:r,height:r},children:[t.jsxs("svg",{width:r,height:r,className:"transform -rotate-90",children:[t.jsx("circle",{cx:h,cy:h,r:u,className:v,strokeWidth:a,fill:"none"}),t.jsx("circle",{cx:h,cy:h,r:u,className:f(l?"":b[s],"transition-all duration-300 ease-in-out"),stroke:l,strokeWidth:a,strokeDasharray:y,strokeDashoffset:m,strokeLinecap:"round",fill:"none"})]}),(n||o)&&t.jsxs("div",{className:"absolute inset-0 flex flex-col items-center justify-center",children:[n&&!o&&t.jsxs("span",{className:"text-gray-900 dark:text-white font-bold",style:{fontSize:r*.2},children:[Math.round(i),"%"]}),o&&t.jsx("span",{className:"text-gray-900 dark:text-white font-medium text-center px-2",style:{fontSize:r*.15},children:o})]})]})})},dc=({className:e,children:r,disabled:a=!1,onClick:n})=>t.jsx("div",{className:f("p-4 rounded-lg border transition-colors","bg-white dark:bg-gray-900","border-gray-200 dark:border-gray-700","text-gray-900 dark:text-white",a&&"opacity-50 cursor-not-allowed","hover:bg-gray-50 dark:hover:bg-gray-800",e),onClick:a?void 0:n,role:"region","aria-label":"UprogressUtracker",children:r||"UprogressUtracker Component"}),gc=({src:e,alt:r,fallback:a,width:n,height:o,objectFit:s="cover",loading:l="lazy",showLoader:c=!0,rounded:d="none",border:i=!1,className:h,onLoad:u,onError:y})=>{const[m,b]=p.useState(!0),[v,k]=p.useState(!1),[S,x]=p.useState(e);p.useEffect(()=>{b(!0),k(!1),x(e)},[e]);const N=()=>{b(!1),u?.()},w=()=>{b(!1),k(!0),a&&S!==a&&(x(a),k(!1),b(!0)),y?.()},E={none:"",sm:"rounded-sm",md:"rounded-md",lg:"rounded-lg",full:"rounded-full"},A={contain:"object-contain",cover:"object-cover",fill:"object-fill",none:"object-none","scale-down":"object-scale-down"},C={width:typeof n=="number"?`${n}px`:n,height:typeof o=="number"?`${o}px`:o};return t.jsxs("div",{className:f("relative inline-block overflow-hidden bg-gray-100 dark:bg-gray-800",E[d],i&&"border border-gray-200 dark:border-gray-700",h),style:C,children:[c&&m&&t.jsx("div",{className:"absolute inset-0 flex items-center justify-center",children:t.jsx("div",{className:"animate-pulse",children:t.jsx(P.PhotoIcon,{className:"h-8 w-8 text-gray-400"})})}),v&&t.jsx("div",{className:"absolute inset-0 flex items-center justify-center",children:t.jsx(P.PhotoIcon,{className:"h-8 w-8 text-gray-400"})}),!v&&t.jsx("img",{src:S,alt:r,loading:l,onLoad:N,onError:w,className:f("w-full h-full",A[s],m&&c&&"opacity-0")})]})},uc=({images:e,columns:r=3,gap:a=16,lightbox:n=!0,className:o})=>{const[s,l]=p.useState(null),c=u=>{n&&l(u)},d=()=>{l(null)},i=()=>{if(!s)return;const u=e.findIndex(m=>m.id===s.id),y=u>0?u-1:e.length-1;l(e[y])},h=()=>{if(!s)return;const u=e.findIndex(m=>m.id===s.id),y=u<e.length-1?u+1:0;l(e[y])};return t.jsxs(t.Fragment,{children:[t.jsx("div",{className:f("grid",o),style:{gridTemplateColumns:`repeat(${r}, 1fr)`,gap:`${a}px`},children:e.map(u=>t.jsxs("div",{className:f("relative aspect-square overflow-hidden rounded-lg bg-gray-200 dark:bg-gray-700",n&&"cursor-pointer hover:opacity-90 transition-opacity"),onClick:()=>c(u),children:[t.jsx("img",{src:u.thumbnail||u.src,alt:u.alt||"",className:"w-full h-full object-cover"}),u.caption&&t.jsx("div",{className:"absolute bottom-0 left-0 right-0 bg-black/50 text-white text-sm p-2",children:u.caption})]},u.id))}),n&&s&&t.jsxs("div",{className:"fixed inset-0 z-50 bg-black/90 flex items-center justify-center p-4",onClick:d,children:[t.jsx("button",{onClick:d,className:"absolute top-4 right-4 text-white hover:text-gray-300 transition-colors",children:t.jsx("svg",{className:"w-8 h-8",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:t.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})}),t.jsx("button",{onClick:u=>{u.stopPropagation(),i()},className:"absolute left-4 text-white hover:text-gray-300 transition-colors",children:t.jsx("svg",{className:"w-8 h-8",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:t.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M15 19l-7-7 7-7"})})}),t.jsx("button",{onClick:u=>{u.stopPropagation(),h()},className:"absolute right-4 text-white hover:text-gray-300 transition-colors",children:t.jsx("svg",{className:"w-8 h-8",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:t.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 5l7 7-7 7"})})}),t.jsxs("div",{className:"max-w-4xl max-h-full",onClick:u=>u.stopPropagation(),children:[t.jsx("img",{src:s.src,alt:s.alt||"",className:"max-w-full max-h-[80vh] object-contain"}),s.caption&&t.jsx("p",{className:"text-white text-center mt-4",children:s.caption})]})]})]})},hc=({className:e,children:r,disabled:a=!1,onClick:n})=>t.jsx("div",{className:f("p-4 rounded-lg border transition-colors","bg-white dark:bg-gray-900","border-gray-200 dark:border-gray-700","text-gray-900 dark:text-white",a&&"opacity-50 cursor-not-allowed","hover:bg-gray-50 dark:hover:bg-gray-800",e),onClick:a?void 0:n,role:"region","aria-label":"UimageUcomparison",children:r||"UimageUcomparison Component"}),fc=({src:e,onCropComplete:r,initialCrop:a,className:n})=>{const[o,s]=p.useState(a||{x:50,y:50,width:200,height:200}),l=p.useRef(null),c=async()=>{if(!l.current||!r)return;const d=document.createElement("canvas"),i=d.getContext("2d");if(!i)return;const h=l.current,u=h.naturalWidth/h.width,y=h.naturalHeight/h.height;d.width=o.width*u,d.height=o.height*y,i.drawImage(h,o.x*u,o.y*y,o.width*u,o.height*y,0,0,d.width,d.height);const m=d.toDataURL("image/png");r(m,o)};return t.jsxs("div",{className:f("inline-flex flex-col gap-4",n),children:[t.jsxs("div",{className:"relative inline-block",children:[t.jsx("img",{ref:l,src:e,alt:"Crop preview",className:"max-w-full h-auto",crossOrigin:"anonymous"}),t.jsxs("div",{className:"absolute border-2 border-blue-500 bg-blue-500/20",style:{left:`${o.x}px`,top:`${o.y}px`,width:`${o.width}px`,height:`${o.height}px`,cursor:"move"},children:[t.jsx("div",{className:"absolute -top-1 -left-1 w-3 h-3 bg-blue-500 rounded-full cursor-nw-resize"}),t.jsx("div",{className:"absolute -top-1 -right-1 w-3 h-3 bg-blue-500 rounded-full cursor-ne-resize"}),t.jsx("div",{className:"absolute -bottom-1 -left-1 w-3 h-3 bg-blue-500 rounded-full cursor-sw-resize"}),t.jsx("div",{className:"absolute -bottom-1 -right-1 w-3 h-3 bg-blue-500 rounded-full cursor-se-resize"})]})]}),t.jsxs("div",{className:"flex gap-2",children:[t.jsx("button",{onClick:c,className:f("px-4 py-2 text-sm font-medium","bg-blue-600 dark:bg-blue-500 text-white","rounded-md","hover:bg-blue-700 dark:hover:bg-blue-600","transition-colors"),children:"Crop Image"}),t.jsx("button",{onClick:()=>s(a||{x:50,y:50,width:200,height:200}),className:f("px-4 py-2 text-sm font-medium","bg-gray-200 dark:bg-gray-700 text-gray-900 dark:text-white","rounded-md","hover:bg-gray-300 dark:hover:bg-gray-600","transition-colors"),children:"Reset"})]}),t.jsx("p",{className:"text-xs text-gray-600 dark:text-gray-400",children:'Drag to adjust crop area. Click "Crop Image" to export.'})]})},bc=({images:e,index:r,isOpen:a,onClose:n,onIndexChange:o,showThumbnails:s=!1,showDownload:l=!1,showZoom:c=!0,className:d})=>{const[i,h]=p.useState(1),u=e[r],y=r>0,m=r<e.length-1,b=p.useCallback(()=>{if(y){const w=r-1;o?.(w),h(1)}},[y,r,o]),v=p.useCallback(()=>{if(m){const w=r+1;o?.(w),h(1)}},[m,r,o]),k=()=>{h(w=>Math.min(w+.5,3))},S=()=>{h(w=>Math.max(w-.5,.5))},x=()=>{h(1)},N=()=>{const w=document.createElement("a");w.href=u.src,w.download=u.alt||"image",w.click()};return p.useEffect(()=>{if(!a)return;const w=E=>{switch(E.key){case"Escape":n();break;case"ArrowLeft":b();break;case"ArrowRight":v();break;case"+":case"=":k();break;case"-":case"_":S();break;case"0":x();break}};return document.addEventListener("keydown",w),()=>document.removeEventListener("keydown",w)},[a,r,e.length,n,b,v]),p.useEffect(()=>(a?document.body.style.overflow="hidden":document.body.style.overflow="",()=>{document.body.style.overflow=""}),[a]),p.useEffect(()=>{h(1)},[r]),!a||!u?null:t.jsx(be,{children:t.jsxs("div",{className:f("fixed inset-0 z-50 flex items-center justify-center","bg-black/95",d),children:[t.jsx("div",{className:"absolute inset-0",onClick:n,"aria-label":"Close lightbox"}),t.jsx("button",{onClick:n,className:"absolute top-4 right-4 z-10 p-2 text-white hover:text-gray-300 transition-colors","aria-label":"Close",children:t.jsx("svg",{className:"w-8 h-8",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:t.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})}),y&&t.jsx("button",{onClick:b,className:"absolute left-4 top-1/2 -translate-y-1/2 z-10 p-3 text-white hover:text-gray-300 bg-black/50 hover:bg-black/70 rounded-full transition-all","aria-label":"Previous image",children:t.jsx("svg",{className:"w-6 h-6",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:t.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M15 19l-7-7 7-7"})})}),m&&t.jsx("button",{onClick:v,className:"absolute right-4 top-1/2 -translate-y-1/2 z-10 p-3 text-white hover:text-gray-300 bg-black/50 hover:bg-black/70 rounded-full transition-all","aria-label":"Next image",children:t.jsx("svg",{className:"w-6 h-6",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:t.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 5l7 7-7 7"})})}),t.jsxs("div",{className:"absolute top-4 left-4 z-10 flex gap-2",children:[t.jsxs("div",{className:"px-3 py-1.5 bg-black/50 text-white text-sm rounded-md",children:[r+1," / ",e.length]}),c&&t.jsxs("div",{className:"flex gap-1 bg-black/50 rounded-md p-1",children:[t.jsx("button",{onClick:S,className:"p-1.5 text-white hover:text-gray-300 transition-colors","aria-label":"Zoom out",children:t.jsx("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:t.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0zM13 10H7"})})}),t.jsxs("button",{onClick:x,className:"px-2 text-white text-sm hover:text-gray-300 transition-colors","aria-label":"Reset zoom",children:[Math.round(i*100),"%"]}),t.jsx("button",{onClick:k,className:"p-1.5 text-white hover:text-gray-300 transition-colors","aria-label":"Zoom in",children:t.jsx("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:t.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0zM10 7v3m0 0v3m0-3h3m-3 0H7"})})})]}),l&&t.jsx("button",{onClick:N,className:"p-1.5 bg-black/50 text-white hover:text-gray-300 rounded-md transition-colors","aria-label":"Download image",children:t.jsx("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:t.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M4 16v1a3 3 0 003 3h10a3 3 0 003-3v-1m-4-4l-4 4m0 0l-4-4m4 4V4"})})})]}),t.jsx("div",{className:"relative z-0 flex items-center justify-center max-w-7xl max-h-screen p-20",children:t.jsx("img",{src:u.src,alt:u.alt||"",className:"max-w-full max-h-full object-contain transition-transform",style:{transform:`scale(${i})`}})}),u.caption&&t.jsx("div",{className:"absolute bottom-20 left-0 right-0 z-10 text-center",children:t.jsx("p",{className:"px-4 py-2 bg-black/50 text-white text-sm inline-block rounded-md max-w-2xl",children:u.caption})}),s&&e.length>1&&t.jsx("div",{className:"absolute bottom-4 left-0 right-0 z-10 flex justify-center gap-2 px-4 overflow-x-auto",children:e.map((w,E)=>t.jsx("button",{onClick:()=>{o?.(E),h(1)},className:f("flex-shrink-0 w-16 h-16 rounded-md overflow-hidden","border-2 transition-all",E===r?"border-white scale-110":"border-transparent opacity-60 hover:opacity-100 hover:border-gray-400"),children:t.jsx("img",{src:w.thumbnail||w.src,alt:w.alt||"",className:"w-full h-full object-cover"})},E))})]})})},mc=({src:e,alt:r,scale:a=2,className:n,containerClassName:o,onLoad:s,onError:l})=>{const[c,d]=p.useState(null),i=u=>{const y=u.currentTarget;d({width:Math.round(y.naturalWidth/a),height:Math.round(y.naturalHeight/a)}),s?.()},h=u=>{l?.()};return t.jsx("img",{src:e,alt:r,className:f("max-w-full h-auto",n),onLoad:i,onError:h,width:c?.width,height:c?.height,style:c?void 0:{visibility:"hidden"}})},yc=({src:e,poster:r,autoPlay:a=!1,loop:n=!1,muted:o=!1,controls:s=!0,className:l})=>{const c=p.useRef(null),[d,i]=p.useState(a),[h,u]=p.useState(1),[y,m]=p.useState(0),[b,v]=p.useState(0);p.useEffect(()=>{const E=c.current;if(!E)return;const A=()=>m(E.currentTime),C=()=>v(E.duration),I=()=>i(!0),L=()=>i(!1);return E.addEventListener("timeupdate",A),E.addEventListener("loadedmetadata",C),E.addEventListener("play",I),E.addEventListener("pause",L),()=>{E.removeEventListener("timeupdate",A),E.removeEventListener("loadedmetadata",C),E.removeEventListener("play",I),E.removeEventListener("pause",L)}},[]);const k=()=>{c.current&&(d?c.current.pause():c.current.play())},S=E=>{const A=parseFloat(E.target.value);u(A),c.current&&(c.current.volume=A)},x=E=>{const A=parseFloat(E.target.value);m(A),c.current&&(c.current.currentTime=A)},N=()=>{c.current&&(document.fullscreenElement?document.exitFullscreen():c.current.requestFullscreen())},w=E=>{const A=Math.floor(E/60),C=Math.floor(E%60);return`${A}:${C.toString().padStart(2,"0")}`};return t.jsxs("div",{className:f("relative group",l),children:[t.jsx("video",{ref:c,src:e,poster:r,autoPlay:a,loop:n,muted:o,className:"w-full rounded-lg",onClick:k}),s&&t.jsxs("div",{className:"absolute bottom-0 left-0 right-0 bg-gradient-to-t from-black/70 to-transparent p-4 opacity-0 group-hover:opacity-100 transition-opacity",children:[t.jsx("input",{type:"range",min:"0",max:b||0,value:y,onChange:x,className:"w-full mb-2 accent-white"}),t.jsxs("div",{className:"flex items-center justify-between gap-4",children:[t.jsxs("div",{className:"flex items-center gap-3",children:[t.jsx("button",{onClick:k,className:"text-white hover:text-gray-300 transition-colors",children:d?t.jsx("svg",{className:"w-6 h-6",fill:"currentColor",viewBox:"0 0 24 24",children:t.jsx("path",{d:"M6 4h4v16H6V4zm8 0h4v16h-4V4z"})}):t.jsx("svg",{className:"w-6 h-6",fill:"currentColor",viewBox:"0 0 24 24",children:t.jsx("path",{d:"M8 5v14l11-7z"})})}),t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx("svg",{className:"w-4 h-4 text-white",fill:"currentColor",viewBox:"0 0 24 24",children:t.jsx("path",{d:"M3 9v6h4l5 5V4L7 9H3zm13.5 3c0-1.77-1.02-3.29-2.5-4.03v8.05c1.48-.73 2.5-2.25 2.5-4.02z"})}),t.jsx("input",{type:"range",min:"0",max:"1",step:"0.1",value:h,onChange:S,className:"w-20 accent-white"})]}),t.jsxs("span",{className:"text-white text-sm",children:[w(y)," / ",w(b)]})]}),t.jsx("button",{onClick:N,className:"text-white hover:text-gray-300 transition-colors",children:t.jsx("svg",{className:"w-5 h-5",fill:"currentColor",viewBox:"0 0 24 24",children:t.jsx("path",{d:"M7 14H5v5h5v-2H7v-3zm-2-4h2V7h3V5H5v5zm12 7h-3v2h5v-5h-2v3zM14 5v2h3v3h2V5h-5z"})})})]})]})]})},pc=({className:e,children:r,disabled:a=!1,onClick:n})=>t.jsx("div",{className:f("p-4 rounded-lg border transition-colors","bg-white dark:bg-gray-900","border-gray-200 dark:border-gray-700","text-gray-900 dark:text-white",a&&"opacity-50 cursor-not-allowed","hover:bg-gray-50 dark:hover:bg-gray-800",e),onClick:a?void 0:n,role:"region","aria-label":"UvideoUthumbnail",children:r||"UvideoUthumbnail Component"}),vc=({className:e,children:r,disabled:a})=>t.jsx("div",{className:f("p-4 rounded-lg border transition-colors","bg-white dark:bg-gray-900","border-gray-200 dark:border-gray-700","text-gray-900 dark:text-white",a&&"opacity-50 cursor-not-allowed",e),role:"region","aria-label":"VideoEditor",children:r||"VideoEditor Component"}),kc=({className:e,children:r,disabled:a=!1,onClick:n})=>t.jsx("div",{className:f("p-4 rounded-lg border transition-colors","bg-white dark:bg-gray-900","border-gray-200 dark:border-gray-700","text-gray-900 dark:text-white",a&&"opacity-50 cursor-not-allowed","hover:bg-gray-50 dark:hover:bg-gray-800",e),onClick:a?void 0:n,role:"region","aria-label":"UvideoUcall",children:r||"UvideoUcall Component"}),xc=({className:e,children:r,disabled:a})=>t.jsx("div",{className:f("p-4 rounded-lg border transition-colors","bg-white dark:bg-gray-900","border-gray-200 dark:border-gray-700","text-gray-900 dark:text-white",a&&"opacity-50 cursor-not-allowed",e),role:"region","aria-label":"LiveStream",children:r||"LiveStream Component"}),wc=({src:e,title:r,artist:a,artwork:n,autoPlay:o=!1,loop:s=!1,className:l})=>{const c=p.useRef(null),[d,i]=p.useState(o),[h,u]=p.useState(0),[y,m]=p.useState(0),[b,v]=p.useState(1);p.useEffect(()=>{const E=c.current;if(!E)return;const A=()=>u(E.currentTime),C=()=>m(E.duration),I=()=>i(!0),L=()=>i(!1),O=()=>i(!1);return E.addEventListener("timeupdate",A),E.addEventListener("loadedmetadata",C),E.addEventListener("play",I),E.addEventListener("pause",L),E.addEventListener("ended",O),()=>{E.removeEventListener("timeupdate",A),E.removeEventListener("loadedmetadata",C),E.removeEventListener("play",I),E.removeEventListener("pause",L),E.removeEventListener("ended",O)}},[]);const k=()=>{c.current&&(d?c.current.pause():c.current.play())},S=E=>{const A=parseFloat(E.target.value);u(A),c.current&&(c.current.currentTime=A)},x=E=>{const A=parseFloat(E.target.value);v(A),c.current&&(c.current.volume=A)},N=E=>{const A=Math.floor(E/60),C=Math.floor(E%60);return`${A}:${C.toString().padStart(2,"0")}`},w=y>0?h/y*100:0;return t.jsxs("div",{className:f("bg-white dark:bg-gray-900 rounded-lg p-6 shadow-lg",l),children:[t.jsx("audio",{ref:c,src:e,autoPlay:o,loop:s}),t.jsxs("div",{className:"flex items-center gap-4 mb-4",children:[n&&t.jsx("div",{className:"w-16 h-16 rounded-lg overflow-hidden flex-shrink-0 bg-gray-200 dark:bg-gray-700",children:t.jsx("img",{src:n,alt:r||"Album artwork",className:"w-full h-full object-cover"})}),t.jsxs("div",{className:"flex-1 min-w-0",children:[r&&t.jsx("h4",{className:"font-semibold text-gray-900 dark:text-white truncate",children:r}),a&&t.jsx("p",{className:"text-sm text-gray-600 dark:text-gray-400 truncate",children:a})]})]}),t.jsxs("div",{className:"mb-4",children:[t.jsx("input",{type:"range",min:"0",max:y||0,value:h,onChange:S,className:"w-full accent-blue-500"}),t.jsxs("div",{className:"flex justify-between text-xs text-gray-600 dark:text-gray-400 mt-1",children:[t.jsx("span",{children:N(h)}),t.jsx("span",{children:N(y)})]})]}),t.jsxs("div",{className:"flex items-center justify-between",children:[t.jsxs("div",{className:"flex items-center gap-4",children:[t.jsx("button",{onClick:k,className:"w-10 h-10 rounded-full bg-blue-500 text-white flex items-center justify-center hover:bg-blue-600 transition-colors",children:d?t.jsx("svg",{className:"w-5 h-5",fill:"currentColor",viewBox:"0 0 24 24",children:t.jsx("path",{d:"M6 4h4v16H6V4zm8 0h4v16h-4V4z"})}):t.jsx("svg",{className:"w-5 h-5 ml-0.5",fill:"currentColor",viewBox:"0 0 24 24",children:t.jsx("path",{d:"M8 5v14l11-7z"})})}),t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx("svg",{className:"w-4 h-4 text-gray-600 dark:text-gray-400",fill:"currentColor",viewBox:"0 0 24 24",children:t.jsx("path",{d:"M3 9v6h4l5 5V4L7 9H3zm13.5 3c0-1.77-1.02-3.29-2.5-4.03v8.05c1.48-.73 2.5-2.25 2.5-4.02z"})}),t.jsx("input",{type:"range",min:"0",max:"1",step:"0.1",value:b,onChange:x,className:"w-24 accent-blue-500"})]})]}),t.jsxs("span",{className:"text-sm text-gray-600 dark:text-gray-400",children:[w.toFixed(0),"%"]})]})]})},Nc=({className:e,children:r,disabled:a=!1,onClick:n})=>t.jsx("div",{className:f("p-4 rounded-lg border transition-colors","bg-white dark:bg-gray-900","border-gray-200 dark:border-gray-700","text-gray-900 dark:text-white",a&&"opacity-50 cursor-not-allowed","hover:bg-gray-50 dark:hover:bg-gray-800",e),onClick:a?void 0:n,role:"region","aria-label":"UaudioUwaveform",children:r||"UaudioUwaveform Component"}),Cc=({data:e,width:r=200,height:a=40,color:n="#3b82f6",gap:o=2,className:s})=>{if(e.length===0)return null;const l=(r-(e.length-1)*o)/e.length;return t.jsx("svg",{width:r,height:a,className:f("inline-block",s),children:e.map((c,d)=>{const i=Math.max(2,c*a),h=d*(l+o),u=(a-i)/2;return t.jsx("rect",{x:h,y:u,width:l,height:i,fill:n,rx:l/2},d)})})},Sc=({className:e,children:r,disabled:a=!1,onClick:n})=>t.jsx("div",{className:f("p-4 rounded-lg border transition-colors","bg-white dark:bg-gray-900","border-gray-200 dark:border-gray-700","text-gray-900 dark:text-white",a&&"opacity-50 cursor-not-allowed","hover:bg-gray-50 dark:hover:bg-gray-800",e),onClick:a?void 0:n,role:"region","aria-label":"UvoiceUrecorder",children:r||"UvoiceUrecorder Component"}),Ec=({className:e,children:r,disabled:a})=>t.jsx("div",{className:f("p-4 rounded-lg border transition-colors","bg-white dark:bg-gray-900","border-gray-200 dark:border-gray-700","text-gray-900 dark:text-white",a&&"opacity-50 cursor-not-allowed",e),role:"region","aria-label":"PodcastPlayer",children:r||"PodcastPlayer Component"}),Ac=({accept:e=["image/*","video/*","audio/*"],maxSize:r=50*1024*1024,maxFiles:a=10,multiple:n=!0,onUpload:o,onRemove:s,className:l})=>{const[c,d]=p.useState([]),[i,h]=p.useState(!1),u=p.useRef(null),y=N=>{N.preventDefault(),h(!0)},m=N=>{N.preventDefault(),h(!1)},b=N=>{N.preventDefault(),h(!1);const w=Array.from(N.dataTransfer.files);k(w)},v=N=>{if(N.target.files){const w=Array.from(N.target.files);k(w)}},k=N=>{const w=N.filter(I=>{const L=e.some(M=>{if(M.endsWith("/*")){const D=M.split("/")[0];return I.type.startsWith(D)}return I.type===M}),O=I.size<=r;return L&&O}),E=a-c.length,A=w.slice(0,E),C=A.map(I=>({id:`${Date.now()}-${Math.random()}`,file:I,preview:I.type.startsWith("image/")?URL.createObjectURL(I):void 0,status:"pending"}));d(I=>[...I,...C]),o&&o(A)},S=N=>{d(w=>w.filter(E=>E.id!==N)),s&&s(N)},x=N=>N<1024?`${N} B`:N<1024*1024?`${(N/1024).toFixed(1)} KB`:`${(N/(1024*1024)).toFixed(1)} MB`;return t.jsxs("div",{className:f("space-y-4",l),children:[t.jsxs("div",{onDragEnter:y,onDragOver:N=>N.preventDefault(),onDragLeave:m,onDrop:b,onClick:()=>u.current?.click(),className:f("border-2 border-dashed rounded-lg p-8 text-center cursor-pointer transition-colors",i?"border-blue-500 bg-blue-50 dark:bg-blue-900/20":"border-gray-300 dark:border-gray-700 hover:border-gray-400 dark:hover:border-gray-600"),children:[t.jsx("svg",{className:"w-12 h-12 mx-auto mb-4 text-gray-400 dark:text-gray-600",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:t.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M7 16a4 4 0 01-.88-7.903A5 5 0 1115.9 6L16 6a5 5 0 011 9.9M15 13l-3-3m0 0l-3 3m3-3v12"})}),t.jsx("p",{className:"text-gray-700 dark:text-gray-300 mb-2",children:"Drag and drop files here, or click to browse"}),t.jsxs("p",{className:"text-sm text-gray-500 dark:text-gray-400",children:["Max ",a," files, ",x(r)," each"]}),t.jsx("input",{ref:u,type:"file",multiple:n,accept:e.join(","),onChange:v,className:"hidden"})]}),c.length>0&&t.jsx("div",{className:"grid grid-cols-2 md:grid-cols-3 lg:grid-cols-4 gap-4",children:c.map(N=>t.jsxs("div",{className:"relative aspect-square rounded-lg overflow-hidden bg-gray-100 dark:bg-gray-800",children:[N.preview?t.jsx("img",{src:N.preview,alt:N.file.name,className:"w-full h-full object-cover"}):t.jsx("div",{className:"w-full h-full flex items-center justify-center",children:t.jsx("svg",{className:"w-12 h-12 text-gray-400",fill:"currentColor",viewBox:"0 0 24 24",children:t.jsx("path",{d:"M14 2H6a2 2 0 00-2 2v16a2 2 0 002 2h12a2 2 0 002-2V8l-6-6zm4 18H6V4h7v5h5v11z"})})}),t.jsx("button",{onClick:()=>S(N.id),className:"absolute top-2 right-2 w-6 h-6 rounded-full bg-red-500 text-white flex items-center justify-center hover:bg-red-600 transition-colors",children:t.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:t.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})}),t.jsxs("div",{className:"absolute bottom-0 left-0 right-0 bg-black/70 text-white text-xs p-2",children:[t.jsx("p",{className:"truncate",children:N.file.name}),t.jsx("p",{className:"text-gray-300",children:x(N.file.size)})]})]},N.id))})]})},Tc=({className:e,children:r,disabled:a=!1,onClick:n})=>t.jsx("div",{className:f("p-4 rounded-lg border transition-colors","bg-white dark:bg-gray-900","border-gray-200 dark:border-gray-700","text-gray-900 dark:text-white",a&&"opacity-50 cursor-not-allowed","hover:bg-gray-50 dark:hover:bg-gray-800",e),onClick:a?void 0:n,role:"region","aria-label":"UmediaUplaylist",children:r||"UmediaUplaylist Component"}),Ic=({className:e,children:r,disabled:a})=>t.jsx("div",{className:f("p-4 rounded-lg border transition-colors","bg-white dark:bg-gray-900","border-gray-200 dark:border-gray-700","text-gray-900 dark:text-white",a&&"opacity-50 cursor-not-allowed",e),role:"region","aria-label":"PlaylistManager",children:r||"PlaylistManager Component"}),Lc=({value:e,size:r=200,fgColor:a="#000000",bgColor:n="#ffffff",showDownload:o=!1,className:s})=>{const l=p.useRef(null);p.useEffect(()=>{const d=l.current;if(!d)return;const i=d.getContext("2d");if(!i)return;i.fillStyle=n,i.fillRect(0,0,r,r),i.fillStyle=a;const h=8,u=r/h,y=e.split("").reduce((b,v)=>b+v.charCodeAt(0),0);for(let b=0;b<h;b++)for(let v=0;v<h;v++)(y+b*h+v)%3!==0&&i.fillRect(v*u,b*u,u,u);const m=u*3;[[0,0],[r-m,0],[0,r-m]].forEach(([b,v])=>{i.strokeStyle=a,i.lineWidth=u,i.strokeRect(b+u/2,v+u/2,m-u,m-u)})},[e,r,a,n]);const c=()=>{const d=l.current;if(!d)return;const i=d.toDataURL("image/png"),h=document.createElement("a");h.download="qrcode.png",h.href=i,h.click()};return t.jsxs("div",{className:f("inline-flex flex-col items-center gap-3",s),children:[t.jsx("canvas",{ref:l,width:r,height:r,className:"border-2 border-gray-200 dark:border-gray-700 rounded-lg"}),o&&t.jsx("button",{onClick:c,className:f("px-4 py-2 text-sm font-medium","bg-blue-600 dark:bg-blue-500 text-white","rounded-md","hover:bg-blue-700 dark:hover:bg-blue-600","transition-colors"),children:"Download QR Code"}),t.jsx("p",{className:"text-xs text-gray-600 dark:text-gray-400 max-w-[200px] text-center break-all",children:e})]})},Mr=({isOpen:e,onClose:r,title:a,size:n="medium",variant:o="default",overlay:s="default",showCloseButton:l=!0,closeOnOverlayClick:c=!0,closeOnEscape:d=!0,children:i,className:h,"aria-labelledby":u,"aria-describedby":y,closeAriaLabel:m="Close modal"})=>{const b=p.useRef(null),v=p.useRef(null);if(p.useEffect(()=>{if(!e||!d)return;const N=w=>{w.key==="Escape"&&r()};return document.addEventListener("keydown",N),()=>document.removeEventListener("keydown",N)},[e,d,r]),p.useEffect(()=>{if(e)return v.current=document.activeElement,b.current&&b.current.focus(),document.body.style.overflow="hidden",()=>{document.body.style.overflow="unset",v.current&&v.current.focus()}},[e]),!e)return null;const k=()=>{const N=j.overlays.modal.content(),w=j.overlays.modal[n]();return f(N,w)},S=N=>{c&&N.target===N.currentTarget&&r()},x=t.jsxs(t.Fragment,{children:[t.jsx("div",{className:j.overlays.modal.backdrop(),onClick:S}),t.jsx("div",{className:j.overlays.modal.container(),role:"dialog","aria-modal":"true","aria-labelledby":u,"aria-describedby":y,children:t.jsxs("div",{ref:b,"data-testid":"modal-content",className:f(k(),h),tabIndex:-1,onClick:N=>N.stopPropagation(),children:[a&&t.jsxs("div",{className:j.overlays.modal.header(),children:[t.jsx("h2",{id:u,className:j.overlays.modal.title(),children:a}),l&&t.jsx("button",{onClick:r,className:j.overlays.modal.closeButton(),"aria-label":m,children:t.jsx(P.XMarkIcon,{className:j.icon.variant.muted.md()})})]}),i]})})]});return hr.createPortal(x,document.body)},Mc=({children:e,variant:r="default",className:a})=>t.jsx("div",{"data-testid":"modal-header",className:f(j.overlays.modal.header(),a),children:e}),Pr=({children:e,variant:r="default",className:a})=>t.jsx("div",{"data-testid":"modal-body",className:f(j.overlays.modal.body(),a),children:e}),Or=({children:e,variant:r="default",className:a})=>t.jsx("div",{"data-testid":"modal-footer",className:f(j.overlays.modal.footer(),a),children:e}),Pc=({isOpen:e,onClose:r,children:a,side:n="right",size:o="md",showCloseButton:s=!0,title:l,footer:c,className:d})=>{if(p.useEffect(()=>{const y=m=>{m.key==="Escape"&&e&&r()};if(e)return document.addEventListener("keydown",y),()=>document.removeEventListener("keydown",y)},[e,r]),!e)return null;const i={left:{sm:"w-64",md:"w-80",lg:"w-96",full:"w-full"},right:{sm:"w-64",md:"w-80",lg:"w-96",full:"w-full"},top:{sm:"h-64",md:"h-80",lg:"h-96",full:"h-full"},bottom:{sm:"h-64",md:"h-80",lg:"h-96",full:"h-full"}},h={left:"left-0 top-0 h-full",right:"right-0 top-0 h-full",top:"top-0 left-0 w-full",bottom:"bottom-0 left-0 w-full"},u={left:e?"translate-x-0":"-translate-x-full",right:e?"translate-x-0":"translate-x-full",top:e?"translate-y-0":"-translate-y-full",bottom:e?"translate-y-0":"translate-y-full"};return t.jsxs(be,{children:[t.jsx(Ze,{isOpen:e,onClose:r,opacity:"medium"}),t.jsxs("div",{className:f("fixed z-50","bg-white dark:bg-gray-900","shadow-xl","transition-transform duration-300 ease-in-out",h[n],i[n][o],u[n],d),children:[(l||s)&&t.jsxs("div",{className:"flex items-center justify-between px-6 py-4 border-b border-gray-200 dark:border-gray-700",children:[l&&t.jsx("h2",{className:"text-lg font-semibold text-gray-900 dark:text-white",children:l}),s&&t.jsx("button",{onClick:r,className:"text-gray-500 hover:text-gray-700 dark:text-gray-400 dark:hover:text-gray-200 transition-colors","aria-label":"Close drawer",children:t.jsx("svg",{className:"w-6 h-6",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:t.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})})]}),t.jsx("div",{className:"flex-1 overflow-y-auto p-6",children:a}),c&&t.jsx("div",{className:"px-6 py-4 border-t border-gray-200 dark:border-gray-700",children:c})]})]})},Oc=({children:e,active:r=!0,initialFocus:a,returnFocus:n=!0,className:o})=>{const s=p.useRef(null),l=p.useRef(null);return p.useEffect(()=>{if(!r)return;n&&(l.current=document.activeElement);const c=()=>{if(!s.current)return[];const u=["a[href]","button:not([disabled])","textarea:not([disabled])","input:not([disabled])","select:not([disabled])",'[tabindex]:not([tabindex="-1"])'].join(",");return Array.from(s.current.querySelectorAll(u))},d=()=>{if(a){const y=s.current?.querySelector(a);if(y){y.focus();return}}const u=c();u.length>0&&u[0].focus()},i=u=>{if(u.key!=="Tab")return;const y=c();if(y.length===0){u.preventDefault();return}const m=y[0],b=y[y.length-1];u.shiftKey?document.activeElement===m&&(u.preventDefault(),b.focus()):document.activeElement===b&&(u.preventDefault(),m.focus())},h=setTimeout(d,0);return document.addEventListener("keydown",i),()=>{clearTimeout(h),document.removeEventListener("keydown",i),n&&l.current&&l.current.focus()}},[r,a,n]),r?t.jsx("div",{ref:s,className:f(o),children:e}):t.jsx(t.Fragment,{children:e})},Uc=({children:e,onLoadMore:r,loading:a=!1,hasMore:n=!0,threshold:o=100,loader:s,endMessage:l,height:c,scrollDirection:d="vertical",reverse:i=!1,className:h})=>{const u=p.useRef(null),[y,m]=p.useState(!1);p.useEffect(()=>{const S=u.current;if(!S||a||!n)return;const x=()=>{const{scrollTop:N,scrollHeight:w,clientHeight:E,scrollLeft:A,scrollWidth:C,clientWidth:I}=S;d==="vertical"&&m(N>300);let L;d==="vertical"?i?L=N:L=w-N-E:i?L=A:L=C-A-I,L<o&&r()};return S.addEventListener("scroll",x),()=>S.removeEventListener("scroll",x)},[a,n,o,r,d,i]);const b=()=>{u.current?.scrollTo({top:0,behavior:"smooth"})},v=t.jsxs("div",{className:"flex justify-center items-center py-4",children:[t.jsx("div",{className:"w-6 h-6 border-2 border-blue-600 dark:border-blue-400 border-t-transparent rounded-full animate-spin"}),t.jsx("span",{className:"ml-2 text-sm text-gray-600 dark:text-gray-400",children:"Loading..."})]}),k=t.jsx("div",{className:"flex justify-center items-center py-4",children:t.jsx("span",{className:"text-sm text-gray-600 dark:text-gray-400",children:"No more items to load"})});return t.jsxs("div",{className:f("relative",h),children:[t.jsxs("div",{ref:u,className:f(d==="vertical"?"overflow-y-auto":"overflow-x-auto","overflow-auto"),style:{height:d==="vertical"?c:void 0,width:d==="horizontal"?"100%":void 0,display:d==="horizontal"?"flex":void 0,flexDirection:i&&d==="vertical"?"column-reverse":void 0},children:[i&&a&&(s||v),i&&!a&&!n&&l,t.jsx("div",{className:f(d==="horizontal"&&"flex",d==="horizontal"&&i&&"flex-row-reverse"),children:e}),!i&&a&&(s||v),!i&&!a&&!n&&(l||k)]}),d==="vertical"&&!i&&y&&t.jsx("button",{onClick:b,className:f("absolute bottom-4 right-4","p-3 rounded-full","bg-blue-600 dark:bg-blue-500","text-white","shadow-lg","hover:bg-blue-700 dark:hover:bg-blue-600","transition-colors","focus:outline-none focus:ring-2 focus:ring-blue-500 dark:focus:ring-blue-400"),"aria-label":"Scroll to top",children:t.jsx("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:t.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M5 10l7-7m0 0l7 7m-7-7v18"})})})]})},Dc=({trigger:e,children:r,placement:a="bottom",isOpen:n,onOpenChange:o,trigger_action:s="click",showArrow:l=!0,className:c})=>{const[d,i]=p.useState(!1),h=n!==void 0?n:d,u=p.useCallback(E=>{n===void 0&&i(E),o?.(E)},[n,o]),y=p.useRef(null),m=p.useRef(null),[b,v]=p.useState({top:0,left:0});p.useEffect(()=>{if(!h||!y.current)return;const E=()=>{const A=y.current.getBoundingClientRect(),C=8;let I=0,L=0;switch(a){case"top":I=A.top-C,L=A.left+A.width/2;break;case"top-start":I=A.top-C,L=A.left;break;case"top-end":I=A.top-C,L=A.right;break;case"bottom":I=A.bottom+C,L=A.left+A.width/2;break;case"bottom-start":I=A.bottom+C,L=A.left;break;case"bottom-end":I=A.bottom+C,L=A.right;break;case"left":I=A.top+A.height/2,L=A.left-C;break;case"right":I=A.top+A.height/2,L=A.right+C;break}v({top:I,left:L})};return E(),window.addEventListener("scroll",E),window.addEventListener("resize",E),()=>{window.removeEventListener("scroll",E),window.removeEventListener("resize",E)}},[h,a]),p.useEffect(()=>{if(!h)return;const E=A=>{y.current&&!y.current.contains(A.target)&&m.current&&!m.current.contains(A.target)&&u(!1)};return document.addEventListener("mousedown",E),()=>document.removeEventListener("mousedown",E)},[h,u]),p.useEffect(()=>{if(!h)return;const E=A=>{A.key==="Escape"&&u(!1)};return document.addEventListener("keydown",E),()=>document.removeEventListener("keydown",E)},[h,u]);const k=()=>{s==="click"&&u(!h)},S=()=>{s==="hover"&&u(!0)},x=()=>{s==="hover"&&u(!1)},N={top:"origin-bottom","top-start":"origin-bottom-left","top-end":"origin-bottom-right",bottom:"origin-top","bottom-start":"origin-top-left","bottom-end":"origin-top-right",left:"origin-right",right:"origin-left"},w={top:"-translate-x-1/2 -translate-y-full","top-start":"-translate-y-full","top-end":"-translate-x-full -translate-y-full",bottom:"-translate-x-1/2","bottom-start":"","bottom-end":"-translate-x-full",left:"-translate-x-full -translate-y-1/2",right:"-translate-y-1/2"};return t.jsxs("div",{className:f("relative inline-block",c),children:[t.jsx("div",{ref:y,onClick:k,onMouseEnter:S,onMouseLeave:x,className:"inline-block",children:e}),h&&t.jsxs("div",{ref:m,className:f("fixed z-50","bg-white dark:bg-gray-800","border border-gray-200 dark:border-gray-700","rounded-lg shadow-lg","transition-all duration-200","animate-in fade-in zoom-in-95",N[a],w[a]),style:{position:"fixed",top:b.top+"px",left:b.left+"px"},onMouseEnter:s==="hover"?()=>u(!0):void 0,onMouseLeave:s==="hover"?()=>u(!1):void 0,children:[r,l&&t.jsx("div",{className:f("arrow absolute w-2 h-2 bg-white dark:bg-gray-800 border border-gray-200 dark:border-gray-700 transform rotate-45",a.startsWith("top")&&"bottom-[-5px] border-t-0 border-l-0",a.startsWith("bottom")&&"top-[-5px] border-b-0 border-r-0",a==="left"&&"right-[-5px] border-l-0 border-b-0",a==="right"&&"left-[-5px] border-r-0 border-t-0",(a==="top"||a==="bottom")&&"left-1/2 -translate-x-1/2",(a==="left"||a==="right")&&"top-1/2 -translate-y-1/2")})]})]})},zc=({sections:e,activeId:r,onActiveChange:a,offset:n=80,container:o,smoothScroll:s=!0,showSubsections:l=!0,className:c})=>{const[d,i]=p.useState(""),h=p.useRef(null),u=r!==void 0?r:d;p.useEffect(()=>{const b=o?document.querySelector(o):window;if(!b)return;const v=x=>x.flatMap(N=>[N.id,...N.subsections?v(N.subsections):[]]),S=v(e).map(x=>document.getElementById(x)).filter(Boolean);if(S.length!==0)return h.current=new IntersectionObserver(x=>{x.forEach(N=>{if(N.isIntersecting){const w=N.target.id;r!==void 0&&a?a(w):i(w)}})},{root:o?b:null,rootMargin:`-${n}px 0px -50% 0px`,threshold:0}),S.forEach(x=>{h.current?.observe(x)}),()=>{h.current?.disconnect()}},[e,o,n,r,a]);const y=b=>{const v=document.getElementById(b);if(!v)return;const k=o?document.querySelector(o):window;if(!k)return;const x=v.offsetTop-n;s?k===window?window.scrollTo({top:x,behavior:"smooth"}):k.scrollTo({top:x,behavior:"smooth"}):k===window?window.scrollTo(0,x):k.scrollTop=x},m=(b,v=0)=>{const k=u===b.id,S=b.subsections?.some(x=>u===x.id)||!1;return t.jsxs("div",{children:[t.jsx("button",{onClick:()=>y(b.id),className:f("w-full text-left px-3 py-1.5 text-sm rounded-md transition-colors",v===0?"font-medium":"pl-6 text-sm",k?"text-blue-700 dark:text-blue-300 bg-blue-50 dark:bg-blue-900/30":S?"text-gray-700 dark:text-gray-300":"text-gray-600 dark:text-gray-400 hover:text-gray-900 dark:hover:text-white hover:bg-gray-100 dark:hover:bg-gray-800"),style:{paddingLeft:`${v*.75+.75}rem`},children:b.label}),l&&b.subsections&&b.subsections.length>0&&t.jsx("div",{className:"ml-2 border-l-2 border-gray-200 dark:border-gray-700",children:b.subsections.map(x=>m(x,v+1))})]},b.id)};return t.jsx("nav",{className:f("space-y-1",c),children:e.map(b=>m(b,0))})},jc=({isOpen:e,onClose:r,children:a,title:n,description:o,footer:s,side:l="bottom",size:c="md",showHandle:d=!0,showCloseButton:i=!0,className:h})=>{if(p.useEffect(()=>{if(!e)return;const b=v=>{v.key==="Escape"&&r()};return document.addEventListener("keydown",b),()=>document.removeEventListener("keydown",b)},[e,r]),!e)return null;const u={bottom:{sm:"h-1/3",md:"h-1/2",lg:"h-2/3",full:"h-full"},top:{sm:"h-1/3",md:"h-1/2",lg:"h-2/3",full:"h-full"},left:{sm:"w-80",md:"w-96",lg:"w-[32rem]",full:"w-full"},right:{sm:"w-80",md:"w-96",lg:"w-[32rem]",full:"w-full"}},y={bottom:"bottom-0 left-0 right-0 rounded-t-2xl",top:"top-0 left-0 right-0 rounded-b-2xl",left:"left-0 top-0 bottom-0 rounded-r-2xl",right:"right-0 top-0 bottom-0 rounded-l-2xl"},m={bottom:"animate-in slide-in-from-bottom duration-300",top:"animate-in slide-in-from-top duration-300",left:"animate-in slide-in-from-left duration-300",right:"animate-in slide-in-from-right duration-300"};return t.jsxs(be,{children:[t.jsx(Ze,{isOpen:e,onClose:r,opacity:"dark"}),t.jsxs("div",{className:f("fixed z-50","bg-white dark:bg-gray-900","shadow-xl","flex flex-col",y[l],u[l][c],m[l],h),children:[d&&(l==="bottom"||l==="top")&&t.jsx("div",{className:f("flex items-center justify-center",l==="bottom"?"pt-3 pb-2":"pb-3 pt-2"),children:t.jsx("div",{className:"w-12 h-1.5 bg-gray-300 dark:bg-gray-700 rounded-full"})}),(n||o||i)&&t.jsx("div",{className:"px-6 py-4 border-b border-gray-200 dark:border-gray-700",children:t.jsxs("div",{className:"flex items-start justify-between",children:[t.jsxs("div",{className:"flex-1",children:[n&&t.jsx("h2",{className:"text-lg font-semibold text-gray-900 dark:text-white",children:n}),o&&t.jsx("p",{className:"mt-1 text-sm text-gray-600 dark:text-gray-400",children:o})]}),i&&t.jsx("button",{onClick:r,className:"ml-4 text-gray-400 hover:text-gray-600 dark:hover:text-gray-200 transition-colors","aria-label":"Close sheet",children:t.jsx("svg",{className:"w-6 h-6",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:t.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})})]})}),t.jsx("div",{className:"flex-1 overflow-y-auto px-6 py-4",children:a}),s&&t.jsx("div",{className:"px-6 py-4 border-t border-gray-200 dark:border-gray-700",children:s})]})]})},_c=({isOpen:e,onClose:r,onSubmit:a,title:n,description:o,placeholder:s="",initialValue:l="",cancelText:c="Cancel",confirmText:d="Confirm",isLoading:i=!1,loadingText:h="Processing...",maxLength:u,required:y=!0,validate:m})=>{const[b,v]=p.useState(l),[k,S]=p.useState(null);p.useEffect(()=>{e&&(v(l),S(null))},[e,l]);const x=async E=>{if(E.preventDefault(),S(null),y&&!b.trim()){S("This field is required");return}if(m){const A=m(b);if(A){S(A);return}}try{await a(b.trim())}catch(A){S(A instanceof Error?A.message:"An error occurred")}},N=()=>{v(l),S(null),r()},w=y?b.trim().length>0:!0;return t.jsx(Mr,{isOpen:e,onClose:N,size:"small","aria-labelledby":"text-input-modal-title","aria-describedby":"text-input-modal-description",closeOnEscape:!i,closeOnOverlayClick:!i,children:t.jsxs("form",{onSubmit:x,children:[t.jsxs(Pr,{variant:"padded",children:[t.jsx("h3",{id:"text-input-modal-title",className:U.heading.h4(),children:n}),t.jsx("p",{id:"text-input-modal-description",className:`${U.body.md()} mt-2 mb-4`,children:o}),t.jsx(Je,{type:"text",value:b,onChange:E=>v(E.target.value),placeholder:s,maxLength:u,disabled:i,autoFocus:!0,"aria-invalid":!!k,"aria-describedby":k?"text-input-error":void 0}),k&&t.jsx("p",{id:"text-input-error",className:`${U.body.sm()} text-red-600 dark:text-red-400 mt-2`,role:"alert",children:k})]}),t.jsxs(Or,{children:[t.jsx(ne,{type:"button",variant:"outline",onClick:N,disabled:i,children:c}),t.jsx(ne,{type:"submit",variant:"default",disabled:!w||i,children:i?h:d})]})]})})},Rt=({content:e,children:r,placement:a="top",delayShow:n=0,delayHide:o=0,className:s,disabled:l=!1,showArrow:c=!0,variant:d="default",trigger:i="hover",isOpen:h,onVisibilityChange:u})=>{const[y,m]=p.useState(!1),b=p.useRef(void 0),v=p.useRef(void 0),k=p.useRef(null),S=p.useRef(null),x=h!==void 0,N=x?h:y,w=p.useCallback(()=>{l||x||(v.current&&(clearTimeout(v.current),v.current=void 0),n>0?b.current=setTimeout(()=>{m(!0),u?.(!0)},n):(m(!0),u?.(!0)))},[l,x,n,u]),E=p.useCallback(()=>{x||(b.current&&(clearTimeout(b.current),b.current=void 0),o>0?v.current=setTimeout(()=>{m(!1),u?.(!1)},o):(m(!1),u?.(!1)))},[x,o,u]);p.useEffect(()=>()=>{b.current&&clearTimeout(b.current),v.current&&clearTimeout(v.current)},[]),p.useEffect(()=>{if(i!=="click"||!N)return;const F=V=>{k.current&&!k.current.contains(V.target)&&S.current&&!S.current.contains(V.target)&&E()};return document.addEventListener("mousedown",F),()=>{document.removeEventListener("mousedown",F)}},[i,N,E]);const A=()=>{i==="hover"&&w()},C=()=>{i==="hover"&&E()},I=()=>{i==="hover"&&w()},L=()=>{i==="hover"&&E()},O=()=>{i==="click"&&!x&&(N?(m(!1),u?.(!1)):(m(!0),u?.(!0)))},M={top:"bottom-full left-1/2 -translate-x-1/2 -translate-y-2",bottom:"top-full left-1/2 -translate-x-1/2 translate-y-2",left:"right-full top-1/2 -translate-x-2 -translate-y-1/2",right:"left-full top-1/2 translate-x-2 -translate-y-1/2"},D={top:"top-full left-1/2 -translate-x-1/2 border-l-transparent border-r-transparent border-b-transparent",bottom:"bottom-full left-1/2 -translate-x-1/2 border-l-transparent border-r-transparent border-t-transparent",left:"left-full top-1/2 -translate-y-1/2 border-t-transparent border-b-transparent border-r-transparent",right:"right-full top-1/2 -translate-y-1/2 border-t-transparent border-b-transparent border-l-transparent"},B={default:"bg-gray-900 dark:bg-gray-700 text-white",info:"bg-blue-600 dark:bg-blue-500 text-white",success:"bg-green-600 dark:bg-green-500 text-white",warning:"bg-yellow-600 dark:bg-yellow-500 text-white",error:"bg-red-600 dark:bg-red-500 text-white"},z={default:{top:"border-t-gray-900 dark:border-t-gray-700",bottom:"border-b-gray-900 dark:border-b-gray-700",left:"border-l-gray-900 dark:border-l-gray-700",right:"border-r-gray-900 dark:border-r-gray-700"},info:{top:"border-t-blue-600 dark:border-t-blue-500",bottom:"border-b-blue-600 dark:border-b-blue-500",left:"border-l-blue-600 dark:border-l-blue-500",right:"border-r-blue-600 dark:border-r-blue-500"},success:{top:"border-t-green-600 dark:border-t-green-500",bottom:"border-b-green-600 dark:border-b-green-500",left:"border-l-green-600 dark:border-l-green-500",right:"border-r-green-600 dark:border-r-green-500"},warning:{top:"border-t-yellow-600 dark:border-t-yellow-500",bottom:"border-b-yellow-600 dark:border-b-yellow-500",left:"border-l-yellow-600 dark:border-l-yellow-500",right:"border-r-yellow-600 dark:border-r-yellow-500"},error:{top:"border-t-red-600 dark:border-t-red-500",bottom:"border-b-red-600 dark:border-b-red-500",left:"border-l-red-600 dark:border-l-red-500",right:"border-r-red-600 dark:border-r-red-500"}};return t.jsxs("div",{ref:S,className:"relative inline-block",onMouseEnter:A,onMouseLeave:C,onFocus:I,onBlur:L,onClick:O,children:[r,N&&!l&&t.jsxs("div",{ref:k,className:f("absolute z-50 px-2 py-1 text-xs font-medium rounded shadow-lg whitespace-nowrap pointer-events-none",M[a],B[d],s),role:"tooltip",children:[e,c&&t.jsx("div",{className:f("absolute w-0 h-0 border-4 arrow",D[a],z[d][a])})]})]})},Bc={default:P.InformationCircleIcon,warning:P.ExclamationTriangleIcon,danger:P.XCircleIcon,success:P.CheckCircleIcon,info:P.InformationCircleIcon},Fc={default:()=>j.icon.variant.default.lg(),warning:()=>j.icon.variant.warning.lg(),danger:()=>j.icon.variant.error.lg(),success:()=>j.icon.variant.success.lg(),info:()=>j.icon.variant.default.lg()},Wc={default:"default",warning:"default",danger:"destructive",success:"default",info:"default"},Vc=({isOpen:e,onClose:r,onConfirm:a,title:n,message:o,confirmText:s="Confirm",cancelText:l="Cancel",loadingText:c="Processing...",variant:d="default",isLoading:i=!1})=>{const h=Bc[d],u=Fc[d],y=Wc[d];return t.jsxs(Mr,{isOpen:e,onClose:r,size:"small",variant:"web3confirmation","aria-labelledby":"confirmation-dialog-title","aria-describedby":"confirmation-dialog-description",children:[t.jsxs(Pr,{variant:"padded",children:[t.jsxs("div",{className:"flex items-center gap-3 mb-4",children:[t.jsx(h,{className:u()}),t.jsx("h3",{id:"confirmation-dialog-title",className:U.heading.h4(),children:n})]}),t.jsx("p",{id:"confirmation-dialog-description",className:U.body.md(),children:o})]}),t.jsxs(Or,{children:[t.jsx(ne,{variant:"outline",onClick:r,disabled:i,children:l}),t.jsx(ne,{variant:y,onClick:a,disabled:i,children:i?c:s})]})]})},$c=({trigger:e,children:r,placement:a="bottom",openDelay:n=200,closeDelay:o=300,className:s})=>{const[l,c]=p.useState(!1),[d,i]=p.useState({top:0,left:0}),h=p.useRef(null),u=p.useRef(null),y=p.useRef(void 0),m=p.useRef(void 0);p.useEffect(()=>{if(!l||!h.current)return;const x=()=>{const N=h.current.getBoundingClientRect(),w=8;let E=0,A=0;switch(a){case"top":E=N.top-w,A=N.left+N.width/2;break;case"bottom":E=N.bottom+w,A=N.left+N.width/2;break;case"left":E=N.top+N.height/2,A=N.left-w;break;case"right":E=N.top+N.height/2,A=N.right+w;break}i({top:E,left:A})};return x(),window.addEventListener("scroll",x),window.addEventListener("resize",x),()=>{window.removeEventListener("scroll",x),window.removeEventListener("resize",x)}},[l,a]);const b=()=>{m.current&&clearTimeout(m.current),y.current=setTimeout(()=>{c(!0)},n)},v=()=>{y.current&&clearTimeout(y.current),m.current=setTimeout(()=>{c(!1)},o)},k={top:"origin-bottom",bottom:"origin-top",left:"origin-right",right:"origin-left"},S={top:"-translate-x-1/2 -translate-y-full",bottom:"-translate-x-1/2",left:"-translate-x-full -translate-y-1/2",right:"-translate-y-1/2"};return t.jsxs(t.Fragment,{children:[t.jsx("div",{ref:h,onMouseEnter:b,onMouseLeave:v,className:"inline-block",children:e}),l&&t.jsx(be,{children:t.jsx("div",{ref:u,className:f("fixed z-50","bg-white dark:bg-gray-800","border border-gray-200 dark:border-gray-700","rounded-lg shadow-lg","transition-all duration-200","animate-in fade-in zoom-in-95",k[a],S[a],s),style:{top:d.top+"px",left:d.left+"px"},onMouseEnter:()=>{m.current&&clearTimeout(m.current)},onMouseLeave:v,children:r})})]})},Hc=({children:e,onDrop:r,onDragOver:a,accept:n,showIndicator:o=!0,indicator:s,disabled:l=!1,className:c})=>{const[d,i]=p.useState(!1),[h,u]=p.useState(0),y=S=>{S.preventDefault(),S.stopPropagation(),!l&&(u(x=>x+1),S.dataTransfer.items&&S.dataTransfer.items.length>0&&i(!0))},m=S=>{S.preventDefault(),S.stopPropagation(),!l&&u(x=>{const N=x-1;return N===0&&i(!1),N})},b=S=>{S.preventDefault(),S.stopPropagation(),!l&&a&&a(S)},v=S=>{if(S.preventDefault(),S.stopPropagation(),l)return;if(i(!1),u(0),S.dataTransfer.files&&S.dataTransfer.files.length>0){const N=Array.from(S.dataTransfer.files);let w=N;n&&n.length>0&&(w=N.filter(E=>n.some(A=>{if(A.endsWith("/*")){const C=A.split("/")[0];return E.type.startsWith(C)}return E.type===A}))),r(w);return}const x=S.dataTransfer.getData("text/plain");if(x)try{const N=JSON.parse(x);r(N)}catch{r(x)}},k=t.jsxs("div",{className:"absolute inset-0 flex flex-col items-center justify-center bg-blue-50 dark:bg-blue-900/30 border-2 border-dashed border-blue-500 dark:border-blue-400 rounded-lg z-10",children:[t.jsx("svg",{className:"w-12 h-12 text-blue-600 dark:text-blue-400 mb-3",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:t.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M7 16a4 4 0 01-.88-7.903A5 5 0 1115.9 6L16 6a5 5 0 011 9.9M15 13l-3-3m0 0l-3 3m3-3v12"})}),t.jsx("p",{className:"text-blue-700 dark:text-blue-300 font-medium",children:"Drop here"})]});return t.jsxs("div",{onDragEnter:y,onDragLeave:m,onDragOver:b,onDrop:v,className:f("relative",l&&"opacity-50 cursor-not-allowed",c),children:[e,o&&d&&!l&&(s||k)]})},qc=({className:e,children:r,disabled:a=!1,onClick:n})=>t.jsx("div",{className:f("p-4 rounded-lg border transition-colors","bg-white dark:bg-gray-900","border-gray-200 dark:border-gray-700","text-gray-900 dark:text-white",a&&"opacity-50 cursor-not-allowed","hover:bg-gray-50 dark:hover:bg-gray-800",e),onClick:a?void 0:n,role:"region","aria-label":"UdragUdropUlist",children:r||"UdragUdropUlist Component"}),Gc=({className:e,children:r,disabled:a=!1,onClick:n})=>t.jsx("div",{className:f("p-4 rounded-lg border transition-colors","bg-white dark:bg-gray-900","border-gray-200 dark:border-gray-700","text-gray-900 dark:text-white",a&&"opacity-50 cursor-not-allowed","hover:bg-gray-50 dark:hover:bg-gray-800",e),onClick:a?void 0:n,role:"region","aria-label":"UsortableUgrid",children:r||"UsortableUgrid Component"}),Yc=({className:e,children:r,disabled:a=!1,onClick:n})=>t.jsx("div",{className:f("p-4 rounded-lg border transition-colors","bg-white dark:bg-gray-900","border-gray-200 dark:border-gray-700","text-gray-900 dark:text-white",a&&"opacity-50 cursor-not-allowed","hover:bg-gray-50 dark:hover:bg-gray-800",e),onClick:a?void 0:n,role:"region","aria-label":"UnestedUdrag",children:r||"UnestedUdrag Component"}),Kc=({className:e,children:r,disabled:a=!1,onClick:n})=>t.jsx("div",{className:f("p-4 rounded-lg border transition-colors","bg-white dark:bg-gray-900","border-gray-200 dark:border-gray-700","text-gray-900 dark:text-white",a&&"opacity-50 cursor-not-allowed","hover:bg-gray-50 dark:hover:bg-gray-800",e),onClick:a?void 0:n,role:"region","aria-label":"UgestureUdetector",children:r||"UgestureUdetector Component"}),Xc=({className:e,children:r,disabled:a=!1,onClick:n})=>t.jsx("div",{className:f("p-4 rounded-lg border transition-colors","bg-white dark:bg-gray-900","border-gray-200 dark:border-gray-700","text-gray-900 dark:text-white",a&&"opacity-50 cursor-not-allowed","hover:bg-gray-50 dark:hover:bg-gray-800",e),onClick:a?void 0:n,role:"region","aria-label":"UswipeUactions",children:r||"UswipeUactions Component"}),Zc=({className:e,children:r,disabled:a=!1,onClick:n})=>t.jsx("div",{className:f("p-4 rounded-lg border transition-colors","bg-white dark:bg-gray-900","border-gray-200 dark:border-gray-700","text-gray-900 dark:text-white",a&&"opacity-50 cursor-not-allowed","hover:bg-gray-50 dark:hover:bg-gray-800",e),onClick:a?void 0:n,role:"region","aria-label":"UpinchUzoom",children:r||"UpinchUzoom Component"}),Jc=({className:e,children:r,disabled:a=!1,onClick:n})=>t.jsx("div",{className:f("p-4 rounded-lg border transition-colors","bg-white dark:bg-gray-900","border-gray-200 dark:border-gray-700","text-gray-900 dark:text-white",a&&"opacity-50 cursor-not-allowed","hover:bg-gray-50 dark:hover:bg-gray-800",e),onClick:a?void 0:n,role:"region","aria-label":"UdoubleUtap",children:r||"UdoubleUtap Component"}),Qc=({className:e,children:r,disabled:a=!1,onClick:n})=>t.jsx("div",{className:f("p-4 rounded-lg border transition-colors","bg-white dark:bg-gray-900","border-gray-200 dark:border-gray-700","text-gray-900 dark:text-white",a&&"opacity-50 cursor-not-allowed","hover:bg-gray-50 dark:hover:bg-gray-800",e),onClick:a?void 0:n,role:"region","aria-label":"UlongUpress",children:r||"UlongUpress Component"}),Rc=({className:e,children:r,disabled:a=!1,onClick:n})=>t.jsx("div",{className:f("p-4 rounded-lg border transition-colors","bg-white dark:bg-gray-900","border-gray-200 dark:border-gray-700","text-gray-900 dark:text-white",a&&"opacity-50 cursor-not-allowed","hover:bg-gray-50 dark:hover:bg-gray-800",e),onClick:a?void 0:n,role:"region","aria-label":"UradialUmenu",children:r||"UradialUmenu Component"}),ed=({children:e,onRefresh:r,disabled:a=!1,refreshingText:n="Refreshing...",pullDownText:o="Pull down to refresh",releaseText:s="Release to refresh",threshold:l=80,maxPullDistance:c=120,className:d=""})=>{const[i,h]=p.useState(0),[u,y]=p.useState(!1),[m,b]=p.useState(!1),v=p.useRef(0),k=p.useRef(null);p.useEffect(()=>{const E=k.current;if(!E)return;const A=L=>{if(a||u)return;E.scrollTop<=0&&(v.current=L.touches[0].clientY,b(!0))},C=L=>{if(!m)return;const M=L.touches[0].clientY-v.current;if(M>0&&E.scrollTop<=0){const D=Math.min(M/c,1),B=Math.min(M*(1-D*.5),c);h(B),M>10&&L.preventDefault()}},I=async()=>{if(m)if(b(!1),i>=l&&!u){y(!0);try{await r()}catch{}finally{y(!1),h(0)}}else h(0)};return E.addEventListener("touchstart",A,{passive:!0}),E.addEventListener("touchmove",C,{passive:!1}),E.addEventListener("touchend",I),()=>{E.removeEventListener("touchstart",A),E.removeEventListener("touchmove",C),E.removeEventListener("touchend",I)}},[a,u,m,i,l,c,r]);const S=Math.min(i/l,1),x=m||u,N=m?i:u?l:0,w=()=>u?n:i>=l?s:o;return t.jsxs("div",{ref:k,className:`relative ${d}`,style:{height:"100%",overflowY:"auto",WebkitOverflowScrolling:"touch"},children:[t.jsx("div",{className:"sticky top-0 left-0 right-0 flex items-center justify-center bg-gradient-to-b from-blue-50/90 to-transparent dark:from-blue-900/20 dark:to-transparent backdrop-blur-sm z-10 transition-all duration-300 ease-out",style:{height:`${N}px`,marginTop:m?0:`-${N}px`,opacity:x?1:0,pointerEvents:"none"},children:t.jsxs("div",{className:"flex flex-col items-center justify-center gap-2",children:[t.jsx(P.ArrowPathIcon,{className:`w-6 h-6 text-blue-600 dark:text-blue-400 transition-transform duration-200 ${u?"animate-spin":""}`,style:{transform:`rotate(${S*360}deg)`}}),i>20&&t.jsx("span",{className:"text-xs font-medium text-blue-600 dark:text-blue-400",children:w()})]})}),t.jsx("div",{style:{paddingTop:m?`${i}px`:0,transition:m?"none":"padding-top 200ms ease-out"},children:e})]})},ie={twitter:(e,r,a)=>{const n=a.length>0?`&hashtags=${a.join(",")}`:"";return`https://twitter.com/intent/tweet?url=${encodeURIComponent(e)}&text=${encodeURIComponent(r)}${n}`},facebook:e=>`https://www.facebook.com/sharer/sharer.php?u=${encodeURIComponent(e)}`,linkedin:(e,r,a)=>`https://www.linkedin.com/sharing/share-offsite/?url=${encodeURIComponent(e)}`,reddit:(e,r)=>`https://reddit.com/submit?url=${encodeURIComponent(e)}&title=${encodeURIComponent(r)}`,telegram:(e,r)=>`https://t.me/share/url?url=${encodeURIComponent(e)}&text=${encodeURIComponent(r)}`,whatsapp:(e,r)=>`https://wa.me/?text=${encodeURIComponent(r+" "+e)}`,email:(e,r,a)=>`mailto:?subject=${encodeURIComponent(r)}&body=${encodeURIComponent(a+`
55
+ `,sl(b))}}},[e]),t.jsx("div",{ref:u,className:`${y()} ${s}`,children:o})},ll=({children:e,delay:r=0,className:a=""})=>t.jsx(ar,{animation:"fade-in-up",delay:r,className:a,children:e}),il=({children:e,delay:r=0,className:a=""})=>t.jsx(ar,{animation:"fade-in-scale",delay:r,className:a,children:e}),cl=({children:e,className:r=""})=>t.jsx(ar,{animation:"float",className:r,children:e}),dl=({isOpen:e,onClick:r,opacity:a="medium",blur:n=!1,zIndex:o=50,className:s,children:l})=>{const c={light:"bg-black/20 dark:bg-black/30",medium:"bg-black/50 dark:bg-black/60",dark:"bg-black/75 dark:bg-black/80"};return e?t.jsx("div",{onClick:r,className:f("fixed inset-0","transition-all duration-200",c[a],n&&"backdrop-blur-sm",s),style:{zIndex:o},role:"presentation","aria-hidden":"true",children:l}):null},gl={[ge.InfoType.INFO]:{icon:P.InformationCircleIcon,container:"bg-blue-50 dark:bg-blue-950 border-blue-200 dark:border-blue-800",iconColor:"text-blue-600 dark:text-blue-400",titleColor:"text-blue-900 dark:text-blue-100",descriptionColor:"text-blue-700 dark:text-blue-300"},[ge.InfoType.SUCCESS]:{icon:P.CheckCircleIcon,container:"bg-green-50 dark:bg-green-950 border-green-200 dark:border-green-800",iconColor:"text-green-600 dark:text-green-400",titleColor:"text-green-900 dark:text-green-100",descriptionColor:"text-green-700 dark:text-green-300"},[ge.InfoType.WARNING]:{icon:P.ExclamationTriangleIcon,container:"bg-yellow-50 dark:bg-amber-950 border-yellow-200 dark:border-amber-800",iconColor:"text-yellow-600 dark:text-amber-400",titleColor:"text-yellow-900 dark:text-amber-100",descriptionColor:"text-yellow-700 dark:text-amber-300"},[ge.InfoType.ERROR]:{icon:P.XCircleIcon,container:"bg-red-50 dark:bg-red-950 border-red-200 dark:border-red-800",iconColor:"text-red-600 dark:text-red-400",titleColor:"text-red-900 dark:text-red-100",descriptionColor:"text-red-700 dark:text-red-300"}},ul=({isVisible:e,onDismiss:r,title:a,description:n,variant:o=ge.InfoType.INFO,duration:s=5e3,icon:l,className:c,closeAriaLabel:d="Dismiss banner"})=>{const[i,h]=p.useState("hidden"),u=p.useRef(null),y=p.useRef(null),m=gl[o],b=m.icon,v=p.useCallback(()=>{u.current&&(clearTimeout(u.current),u.current=null),y.current&&(clearTimeout(y.current),y.current=null)},[]),k=p.useCallback(()=>{v(),h("exiting"),y.current=setTimeout(()=>{h("hidden"),r()},300)},[v,r]);if(p.useEffect(()=>{e?(h("entering"),y.current=setTimeout(()=>{h("visible")},10)):(i==="visible"||i==="entering")&&k()},[e]),p.useEffect(()=>(i==="visible"&&s>0&&(u.current=setTimeout(()=>{k()},s)),()=>{u.current&&clearTimeout(u.current)}),[i,s,k]),p.useEffect(()=>()=>v(),[v]),i==="hidden")return null;const S=t.jsx("div",{role:"alert","aria-live":"polite","data-testid":"banner",className:f("fixed inset-x-0 top-0 z-[100] w-full","transition-all duration-300 ease-out",i==="entering"||i==="exiting"?"-translate-y-full opacity-0":"translate-y-0 opacity-100"),children:t.jsxs("div",{className:f("flex items-start gap-3 p-4 border-b shadow-lg","backdrop-blur-sm",m.container,c),children:[t.jsx("div",{className:f("flex-shrink-0 mt-0.5",m.iconColor),children:l||t.jsx(b,{className:"h-5 w-5"})}),t.jsxs("div",{className:"flex-1 min-w-0",children:[t.jsx("p",{className:f("font-semibold",m.titleColor),children:a}),n&&t.jsx("p",{className:f("text-sm mt-1",m.descriptionColor),children:n})]}),t.jsx("button",{type:"button",onClick:k,className:f("flex-shrink-0 p-1 rounded-md transition-colors","hover:bg-black/10 dark:hover:bg-white/10","focus:outline-none focus:ring-2 focus:ring-offset-2","focus:ring-current"),"aria-label":d,children:t.jsx(P.XMarkIcon,{className:f("h-5 w-5",m.iconColor)})})]})});return hr.createPortal(S,document.body)},hl=(e={})=>{const{defaultDuration:r=5e3}=e,[a,n]=p.useState(!1),[o,s]=p.useState(null),l=p.useCallback(({title:d,description:i,variant:h=ge.InfoType.INFO,duration:u=r})=>{s({title:d,description:i,variant:h,duration:u}),n(!0)},[r]),c=p.useCallback(()=>{n(!1)},[]);return{isVisible:a,bannerProps:o,showBanner:l,hideBanner:c}},Yt=({isOpen:e,onClose:r,children:a,size:n="md",showCloseButton:o=!0,closeOnOutsideClick:s=!0,closeOnEscape:l=!0,className:c})=>{if(p.useEffect(()=>{if(!l||!e||!r)return;const h=u=>{u.key==="Escape"&&r()};return document.addEventListener("keydown",h),()=>document.removeEventListener("keydown",h)},[e,r,l]),!e)return null;const d={sm:"max-w-sm",md:"max-w-md",lg:"max-w-lg",xl:"max-w-xl",full:"max-w-full mx-4"},i=()=>{s&&r&&r()};return t.jsxs(be,{children:[t.jsx(Ze,{isOpen:e,onClose:i,opacity:"dark",blur:!0}),t.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center p-4",children:t.jsxs("div",{className:f("relative w-full",d[n],"bg-white dark:bg-gray-900","rounded-lg shadow-xl","animate-in fade-in zoom-in-95 duration-200",c),onClick:h=>h.stopPropagation(),children:[o&&r&&t.jsx("button",{onClick:r,className:"absolute top-4 right-4 z-10 text-gray-400 hover:text-gray-600 dark:hover:text-gray-200 transition-colors","aria-label":"Close dialog",children:t.jsx("svg",{className:"w-6 h-6",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:t.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})}),a]})})]})},fl=({isOpen:e,onClose:r,items:a,placeholder:n="Type a command or search...",emptyMessage:o="No results found.",className:s})=>{const[l,c]=p.useState(""),[d,i]=p.useState(0),h=p.useRef(null),u=a.filter(v=>{const k=l.toLowerCase();return v.label.toLowerCase().includes(k)||v.keywords?.some(S=>S.toLowerCase().includes(k))||v.group?.toLowerCase().includes(k)}),y=u.reduce((v,k)=>{const S=k.group||"Commands";return v[S]||(v[S]=[]),v[S].push(k),v},{});p.useEffect(()=>{e||(c(""),i(0))},[e]),p.useEffect(()=>{e&&h.current&&h.current.focus()},[e]),p.useEffect(()=>{i(0)},[l]);const m=v=>{switch(v.key){case"ArrowDown":v.preventDefault(),i(k=>k<u.length-1?k+1:k);break;case"ArrowUp":v.preventDefault(),i(k=>k>0?k-1:k);break;case"Enter":v.preventDefault(),u[d]&&(u[d].onSelect(),r());break;case"Escape":v.preventDefault(),r();break}},b=v=>{v.onSelect(),r()};return t.jsxs(Yt,{isOpen:e,onClose:r,size:"lg",showCloseButton:!1,className:f("overflow-hidden p-0",s),children:[t.jsx("div",{className:"border-b border-gray-200 dark:border-gray-700 p-4",children:t.jsxs("div",{className:"flex items-center gap-3",children:[t.jsx("svg",{className:"w-5 h-5 text-gray-400",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:t.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z"})}),t.jsx("input",{ref:h,type:"text",value:l,onChange:v=>c(v.target.value),onKeyDown:m,placeholder:n,className:"flex-1 bg-transparent border-none outline-none text-gray-900 dark:text-white placeholder-gray-500"})]})}),t.jsx("div",{className:"max-h-96 overflow-y-auto p-2",children:Object.keys(y).length===0?t.jsx("div",{className:"px-4 py-8 text-sm text-gray-500 dark:text-gray-400 text-center",children:o}):Object.entries(y).map(([v,k])=>t.jsxs("div",{className:"mb-4 last:mb-0",children:[t.jsx("div",{className:"px-3 py-2 text-xs font-semibold text-gray-500 dark:text-gray-400 uppercase tracking-wider",children:v}),t.jsx("div",{className:"space-y-1",children:k.map(S=>{const N=u.indexOf(S)===d;return t.jsxs("button",{onClick:()=>b(S),className:f("w-full flex items-center gap-3 px-3 py-2 rounded-md","text-sm text-left transition-colors",N?"bg-blue-50 dark:bg-blue-900/30 text-blue-700 dark:text-blue-300":"hover:bg-gray-100 dark:hover:bg-gray-800 text-gray-900 dark:text-white"),children:[S.icon&&t.jsx("span",{className:"flex-shrink-0 w-4 h-4",children:S.icon}),t.jsx("span",{className:"flex-1 truncate",children:S.label}),S.shortcut&&t.jsx("span",{className:"flex-shrink-0 text-xs text-gray-500 dark:text-gray-400 font-mono",children:S.shortcut})]},S.id)})})]},v))}),t.jsxs("div",{className:"border-t border-gray-200 dark:border-gray-700 px-4 py-2 flex items-center justify-between text-xs text-gray-500 dark:text-gray-400",children:[t.jsxs("div",{className:"flex items-center gap-4",children:[t.jsxs("span",{className:"flex items-center gap-1",children:[t.jsx("kbd",{className:"px-1.5 py-0.5 bg-gray-100 dark:bg-gray-800 rounded",children:"↑"}),t.jsx("kbd",{className:"px-1.5 py-0.5 bg-gray-100 dark:bg-gray-800 rounded",children:"↓"}),"to navigate"]}),t.jsxs("span",{className:"flex items-center gap-1",children:[t.jsx("kbd",{className:"px-1.5 py-0.5 bg-gray-100 dark:bg-gray-800 rounded",children:"↵"}),"to select"]})]}),t.jsxs("span",{className:"flex items-center gap-1",children:[t.jsx("kbd",{className:"px-1.5 py-0.5 bg-gray-100 dark:bg-gray-800 rounded",children:"esc"}),"to close"]})]})]})},bl=X.cva("bg-white dark:bg-gray-800 rounded-lg shadow-md p-6 transition-all duration-200",{variants:{variant:{default:"border-gray-200 dark:border-gray-700 border hover:shadow-lg",elevated:"shadow-lg hover:shadow-xl",minimal:"bg-transparent shadow-none border-none p-4"},trend:{none:"",up:"border-l-4 border-green-500",down:"border-l-4 border-red-500",neutral:"border-l-4 border-gray-400"}},defaultVariants:{variant:"default",trend:"none"}}),ml=({label:e,value:r,change:a,trend:n="none",icon:o,variant:s="default",className:l})=>{const c={up:"text-green-600 dark:text-green-400",down:"text-red-600 dark:text-red-400",neutral:"text-gray-600 dark:text-gray-400",none:"text-gray-600 dark:text-gray-400"},d={up:"↗",down:"↘",neutral:"→",none:""};return t.jsx("div",{className:f(bl({variant:s,trend:n}),l),children:t.jsxs("div",{className:"flex items-center justify-between",children:[t.jsxs("div",{children:[t.jsx("p",{className:"text-sm font-medium text-gray-600 dark:text-gray-400 mb-1",children:e}),t.jsx("p",{className:"text-2xl font-bold text-gray-900 dark:text-white",children:r}),a&&t.jsxs("p",{className:f("text-sm font-medium flex items-center gap-1 mt-1",c[n||"none"]),children:[t.jsx("span",{children:d[n||"none"]}),a]})]}),o&&t.jsx("div",{className:"text-3xl opacity-80",children:o})]})})},yl=X.cva("space-y-6",{variants:{variant:{default:"",card:"bg-white dark:bg-gray-800 rounded-lg border-gray-200 dark:border-gray-700 border p-6",minimal:"space-y-4"},spacing:{tight:"space-y-3",normal:"space-y-4",relaxed:"space-y-6",loose:"space-y-8"}},defaultVariants:{variant:"default",spacing:"normal"}}),pl=({title:e,description:r,children:a,variant:n="default",spacing:o="normal",className:s})=>t.jsxs("div",{className:f(yl({variant:n,spacing:o}),s),children:[(e||r)&&t.jsxs("div",{className:"space-y-1",children:[e&&t.jsx("h3",{className:"text-lg font-medium text-gray-900 dark:text-white",children:e}),r&&t.jsx("p",{className:"text-sm text-gray-600 dark:text-gray-400",children:r})]}),a]}),vl=X.cva("flex flex-col items-center text-center space-y-4",{variants:{layout:{vertical:"flex-col items-center text-center",horizontal:"flex-row items-start text-left space-y-0 space-x-4",minimal:"flex-col space-y-2"},spacing:{tight:"space-y-2",normal:"space-y-4",relaxed:"space-y-6"},interactive:{true:"transition-all duration-200 hover:transform hover:scale-105 cursor-pointer",false:""}},defaultVariants:{layout:"vertical",spacing:"normal",interactive:!1}}),kl=({icon:e,title:r,description:a,layout:n="vertical",spacing:o="normal",interactive:s=!1,className:l,onClick:c})=>t.jsxs("div",{className:f(vl({layout:n,spacing:o,interactive:s}),l),onClick:c,children:[t.jsx("div",{className:"text-4xl mb-4 flex-shrink-0",children:e}),t.jsxs("div",{className:"space-y-2",children:[t.jsx("h3",{className:"text-xl font-bold text-gray-900 dark:text-white",children:r}),t.jsx("div",{className:"text-gray-600 dark:text-gray-300 leading-relaxed",children:a})]})]}),xl=({className:e,children:r,disabled:a=!1,onClick:n})=>t.jsx("div",{className:f("p-4 rounded-lg border transition-colors","bg-white dark:bg-gray-900","border-gray-200 dark:border-gray-700","text-gray-900 dark:text-white",a&&"opacity-50 cursor-not-allowed","hover:bg-gray-50 dark:hover:bg-gray-800",e),onClick:a?void 0:n,role:"region","aria-label":"UfocusUindicator",children:r||"UfocusUindicator Component"}),wl=({icon:e,size:r="md",shape:a="rounded",variant:n="blue-purple",gradientClasses:o,className:s,iconClassName:l})=>{const c={sm:{container:"w-10 h-10",icon:"h-5 w-5"},md:{container:"w-12 h-12",icon:"h-6 w-6"},lg:{container:"w-16 h-16",icon:"h-8 w-8"},xl:{container:"w-20 h-20",icon:"h-10 w-10"}},d={square:"rounded-lg",rounded:"rounded-xl",circle:"rounded-full"},i={"blue-purple":"bg-gradient-to-r from-blue-600 to-purple-600","green-blue":"bg-gradient-to-r from-green-600 to-blue-600","orange-red":"bg-gradient-to-r from-orange-600 to-red-600",gray:"bg-gradient-to-r from-gray-600 to-gray-800 dark:from-gray-700 dark:to-gray-900",custom:o||"bg-gradient-to-r from-blue-600 to-purple-600"},h=c[r];return t.jsx("div",{className:f("flex items-center justify-center flex-shrink-0",h.container,d[a],i[n],s),children:t.jsx(e,{className:f("text-white",h.icon,l)})})},Nl={sm:"w-12 h-12",md:"w-16 h-16",lg:"w-20 h-20",xl:"w-24 h-24"},Cl={sm:"h-6 w-6",md:"h-8 w-8",lg:"h-10 w-10",xl:"h-12 w-12"},Sl={primary:"bg-gradient-to-br from-blue-100 to-blue-200 text-blue-600 shadow-lg hover:shadow-blue-200",secondary:"bg-gradient-to-br from-purple-100 to-purple-200 text-purple-600 shadow-lg hover:shadow-purple-200",success:"bg-gradient-to-br from-green-100 to-green-200 text-green-600 shadow-lg hover:shadow-green-200",warning:"bg-gradient-to-br from-yellow-100 to-yellow-200 text-yellow-600 shadow-lg hover:shadow-yellow-200",error:"bg-gradient-to-br from-red-100 to-red-200 text-red-600 shadow-lg hover:shadow-red-200",neutral:"bg-gradient-to-br from-gray-100 to-gray-200 text-gray-600 shadow-lg hover:shadow-gray-200"},El={square:"rounded-none",rounded:"rounded-2xl",circle:"rounded-full"},Al={none:"",float:"animate-float",pulse:"animate-pulse",bounce:"animate-bounce-slow"},Tl=({children:e,size:r="lg",variant:a="primary",shape:n="rounded",animation:o="float",className:s})=>t.jsx("div",{className:f("flex items-center justify-center mx-auto mb-6 transition-all duration-300 group-hover:scale-105",Nl[r],Sl[a],El[n],Al[o],s),children:t.jsx("div",{className:f(Cl[r]),children:e})}),Il=({icon:e,children:r,iconPosition:a="left",gap:n="md",iconSize:o="md",align:s="left",variant:l="default",className:c,iconClassName:d,textClassName:i})=>{const h={xs:"gap-1",sm:"gap-2",md:"gap-3",lg:"gap-4"},u={xs:"h-3 w-3",sm:"h-4 w-4",md:"h-5 w-5",lg:"h-6 w-6",xl:"h-8 w-8"},y={left:"text-left",center:"text-center items-center",right:"text-right items-end"},m={default:"text-gray-700 dark:text-gray-300",primary:"text-blue-600 dark:text-blue-400",success:"text-green-600 dark:text-green-400",warning:"text-yellow-600 dark:text-yellow-400",danger:"text-red-600 dark:text-red-400",muted:"text-gray-500 dark:text-gray-400"},b={left:"flex items-center",right:"flex flex-row-reverse items-center",top:"flex flex-col"};return t.jsxs("div",{className:f(b[a],h[n],a==="top"&&y[s],m[l],c),children:[t.jsx(e,{className:f(u[o],"flex-shrink-0",d)}),t.jsx("span",{className:f(i),children:r})]})};function Ll({title:e,subtitle:r,items:a,renderItem:n,keyExtractor:o,actions:s,emptyMessage:l="No items",emptyIcon:c,emptyAction:d,loading:i=!1,className:h,headerClassName:u,listClassName:y,spacing:m="none",showDividers:b=!1}){const v={none:"",sm:"space-y-1",md:"space-y-2",lg:"space-y-4"},k=(S="secondary")=>{const x="inline-flex items-center gap-2 px-3 py-1.5 text-sm font-medium rounded-lg transition-colors disabled:opacity-50 disabled:cursor-not-allowed";switch(S){case"primary":return f(x,"bg-blue-600 text-white hover:bg-blue-700 dark:bg-blue-500 dark:hover:bg-blue-600");case"ghost":return f(x,"text-gray-600 hover:bg-gray-100 dark:text-gray-400 dark:hover:bg-gray-800");case"secondary":default:return f(x,"bg-gray-100 text-gray-700 hover:bg-gray-200 dark:bg-gray-800 dark:text-gray-300 dark:hover:bg-gray-700")}};return t.jsxs("div",{className:f("",h),children:[t.jsxs("div",{className:f("flex items-center justify-between gap-4 pb-4",u),children:[t.jsxs("div",{className:"min-w-0 flex-1",children:[t.jsx("h2",{className:"text-lg font-semibold text-gray-900 dark:text-gray-100 truncate",children:e}),r&&t.jsx("p",{className:"mt-0.5 text-sm text-gray-500 dark:text-gray-400",children:r})]}),s&&s.length>0&&t.jsx("div",{className:"flex items-center gap-2 flex-shrink-0",children:s.map(S=>t.jsxs("button",{onClick:S.onClick,disabled:S.disabled,className:k(S.variant),children:[S.icon,S.label]},S.id))})]}),i&&t.jsx("div",{className:"flex items-center justify-center py-12",children:t.jsx("div",{className:"w-6 h-6 border-2 border-blue-600 border-t-transparent rounded-full animate-spin"})}),!i&&a.length===0&&t.jsxs("div",{className:"flex flex-col items-center justify-center py-12 text-center",children:[c&&t.jsx("div",{className:"mb-4 text-gray-400 dark:text-gray-500",children:c}),t.jsx("p",{className:"text-gray-500 dark:text-gray-400",children:l}),d&&t.jsx("button",{onClick:d.onClick,className:"mt-4 text-sm font-medium text-blue-600 hover:text-blue-700 dark:text-blue-400 dark:hover:text-blue-300",children:d.label})]}),!i&&a.length>0&&t.jsx("div",{className:f(v[m],b&&"divide-y divide-gray-200 dark:divide-gray-700",y),children:a.map((S,x)=>t.jsx("div",{children:n(S,x)},o(S,x)))})]})}const Ml=({children:e,title:r,variant:a="info",size:n="md",icon:o,bordered:s=!0,className:l})=>{const c={info:{bg:"bg-blue-50 dark:bg-blue-900/20",border:"border-blue-200 dark:border-blue-800",title:"text-blue-900 dark:text-blue-300",text:"text-blue-800 dark:text-blue-400",icon:"text-blue-600 dark:text-blue-400"},success:{bg:"bg-green-50 dark:bg-green-900/20",border:"border-green-200 dark:border-green-800",title:"text-green-900 dark:text-green-300",text:"text-green-800 dark:text-green-400",icon:"text-green-600 dark:text-green-400"},warning:{bg:"bg-yellow-50 dark:bg-yellow-900/20",border:"border-yellow-200 dark:border-yellow-800",title:"text-yellow-900 dark:text-yellow-300",text:"text-yellow-800 dark:text-yellow-400",icon:"text-yellow-600 dark:text-yellow-400"},danger:{bg:"bg-red-50 dark:bg-red-900/20",border:"border-red-200 dark:border-red-800",title:"text-red-900 dark:text-red-300",text:"text-red-800 dark:text-red-400",icon:"text-red-600 dark:text-red-400"},neutral:{bg:"bg-gray-50 dark:bg-gray-800",border:"border-gray-200 dark:border-gray-700",title:"text-gray-900 dark:text-gray-100",text:"text-gray-700 dark:text-gray-300",icon:"text-gray-600 dark:text-gray-400"}},d={sm:"p-3",md:"p-4",lg:"p-6"},i=c[a];return t.jsxs("div",{className:f("rounded-lg",i.bg,s&&`border ${i.border}`,d[n],l),children:[(r||o)&&t.jsxs("div",{className:"flex items-start gap-3 mb-2",children:[o&&t.jsx(o,{className:f("h-5 w-5 flex-shrink-0 mt-0.5",i.icon)}),r&&t.jsx("h3",{className:f(U.body.strong.md(),i.title),children:r})]}),t.jsx("div",{className:f(!r&&!o&&i.text),children:e})]})},Pl=({className:e,children:r,disabled:a=!1,onClick:n})=>t.jsx("div",{className:f("p-4 rounded-lg border transition-colors","bg-white dark:bg-gray-900","border-gray-200 dark:border-gray-700","text-gray-900 dark:text-white",a&&"opacity-50 cursor-not-allowed","hover:bg-gray-50 dark:hover:bg-gray-800",e),onClick:a?void 0:n,role:"region","aria-label":"UkeyboardUshortcut",children:r||"UkeyboardUshortcut Component"}),Ol=({size:e="md",className:r="",showText:a=!0,onClick:n,logoSrc:o="/logo.png",logoAlt:s="Logo",logoText:l,fontFamily:c="Dancing Script, cursive"})=>{const i=(()=>{switch(e){case"sm":return{container:"space-x-2",image:"h-6 w-6",text:"text-lg"};case"md":return{container:"space-x-2",image:"h-8 w-8",text:"text-2xl"};case"lg":return{container:"space-x-3",image:"h-10 w-10",text:"text-3xl"};case"xl":return{container:"space-x-4",image:"h-12 w-12",text:"text-4xl"};default:return{container:"space-x-2",image:"h-8 w-8",text:"text-2xl"}}})(),h=t.jsxs(t.Fragment,{children:[t.jsx("img",{src:o,alt:s,className:i.image}),a&&t.jsx("div",{className:`${i.text} font-bold text-gray-900 dark:text-gray-100`,style:{fontFamily:c,fontWeight:"700"},children:l})]});return n?t.jsx("button",{onClick:n,className:`flex items-center ${i.container} ${r} hover:opacity-80 transition-opacity`,children:h}):t.jsx("div",{className:`flex items-center ${i.container} ${r}`,children:h})},Ul=({className:e,children:r,disabled:a=!1,onClick:n})=>t.jsx("div",{className:f("p-4 rounded-lg border transition-colors","bg-white dark:bg-gray-900","border-gray-200 dark:border-gray-700","text-gray-900 dark:text-white",a&&"opacity-50 cursor-not-allowed","hover:bg-gray-50 dark:hover:bg-gray-800",e),onClick:a?void 0:n,role:"region","aria-label":"UmorphUtransition",children:r||"UmorphUtransition Component"}),Dl=({title:e,description:r,count:a,countLabel:n,action:o,loading:s=!1,loadingText:l="Loading...",size:c="md",className:d})=>{const h={sm:{title:U.heading.h4(),description:U.body.sm(),count:U.caption.default()},md:{title:U.heading.h3(),description:U.body.md(),count:U.body.sm()},lg:{title:U.heading.h2(),description:U.body.lg(),count:U.body.md()}}[c];return t.jsxs("div",{className:f("flex items-start justify-between gap-4",d),children:[t.jsxs("div",{className:"flex-1 min-w-0",children:[t.jsxs("div",{className:"flex items-center gap-3 flex-wrap",children:[t.jsx("h2",{className:f(h.title,"text-gray-900 dark:text-gray-100"),children:e}),a!==void 0&&t.jsxs("span",{className:f(h.count,"text-gray-500 dark:text-gray-400"),children:["(",a,n&&` ${n}`,")"]}),s&&t.jsxs("span",{className:f(h.count,"text-gray-500 dark:text-gray-400 flex items-center gap-2"),children:[t.jsx("div",{className:"animate-spin rounded-full h-4 w-4 border-b-2 border-blue-600"}),l]})]}),r&&t.jsx("p",{className:f(h.description,"mt-1 text-gray-600 dark:text-gray-400"),children:r})]}),o&&t.jsx("div",{className:"flex-shrink-0",children:o})]})},zl=({className:e,children:r,disabled:a=!1,onClick:n})=>t.jsx("div",{className:f("p-4 rounded-lg border transition-colors","bg-white dark:bg-gray-900","border-gray-200 dark:border-gray-700","text-gray-900 dark:text-white",a&&"opacity-50 cursor-not-allowed","hover:bg-gray-50 dark:hover:bg-gray-800",e),onClick:a?void 0:n,role:"region","aria-label":"UparallaxUscroll",children:r||"UparallaxUscroll Component"}),jl=({actions:e,orientation:r="horizontal",columns:a=3,className:n})=>{const o={default:"bg-white dark:bg-gray-900 hover:bg-gray-50 dark:hover:bg-gray-800 text-gray-900 dark:text-white border-gray-200 dark:border-gray-700",primary:"bg-blue-500 hover:bg-blue-600 text-white border-blue-500",success:"bg-green-500 hover:bg-green-600 text-white border-green-500",warning:"bg-yellow-500 hover:bg-yellow-600 text-white border-yellow-500",danger:"bg-red-500 hover:bg-red-600 text-white border-red-500"},s={horizontal:"flex flex-wrap gap-2",vertical:"flex flex-col gap-2",grid:"grid gap-2"};return t.jsx("div",{className:f(s[r],r==="grid"&&`grid-cols-${a}`,n),style:r==="grid"?{gridTemplateColumns:`repeat(${a}, 1fr)`}:void 0,children:e.map(l=>t.jsxs("button",{onClick:l.onClick,disabled:l.disabled,className:f("flex items-center justify-center gap-2 px-4 py-3 rounded-lg border transition-colors font-medium",o[l.variant||"default"],l.disabled&&"opacity-50 cursor-not-allowed"),children:[l.icon&&t.jsx("span",{className:"w-5 h-5",children:l.icon}),t.jsx("span",{children:l.label})]},l.id))})},_l=({className:e,children:r,disabled:a=!1,onClick:n})=>t.jsx("div",{className:f("p-4 rounded-lg border transition-colors","bg-white dark:bg-gray-900","border-gray-200 dark:border-gray-700","text-gray-900 dark:text-white",a&&"opacity-50 cursor-not-allowed","hover:bg-gray-50 dark:hover:bg-gray-800",e),onClick:a?void 0:n,role:"region","aria-label":"UrevealUonUscroll",children:r||"UrevealUonUscroll Component"}),Bl={sm:{container:"px-6 py-3",icon:"h-5 w-5 mr-2",text:"font-semibold"},md:{container:"px-6 py-3",icon:"h-5 w-5 mr-2",text:"font-semibold"},lg:{container:"px-6 py-3",icon:"h-5 w-5 mr-2",text:"font-semibold"}},Fl=({icon:e,text:r,variant:a="default",size:n="md",className:o})=>{const{container:s,icon:l}=Ln(a),c=Bl[n];return t.jsxs("div",{className:f("inline-flex items-center rounded-full mb-6",s,c.container,o),children:[t.jsx("div",{className:f("animate-float-icon",l,c.icon),children:e}),t.jsx("span",{className:c.text,children:r})]})},Wl=({title:e,onAdd:r,addButtonTooltip:a,loading:n,className:o=""})=>t.jsx("div",{className:`p-4 border-b border-gray-200 dark:border-gray-700 ${o}`,children:t.jsxs("div",{className:"flex items-center justify-between",children:[t.jsx("h2",{className:"text-lg font-semibold text-gray-900 dark:text-gray-100",children:e}),t.jsxs("div",{className:"flex items-center space-x-2",children:[n&&t.jsx("div",{className:"w-5 h-5 border-2 border-blue-600 border-t-transparent rounded-full animate-spin"}),r&&t.jsx("button",{onClick:r,className:"p-1 rounded hover:bg-gray-200 dark:hover:bg-gray-700 transition-colors",title:a,"aria-label":a||"Add",children:t.jsx("svg",{className:"w-5 h-5 text-gray-600 dark:text-gray-400",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:t.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 4v16m8-8H4"})})})]})]})}),Vl=e=>{switch(e){case"cog":return P.Cog6ToothIcon;case"arrow-right":return P.ArrowRightIcon;case"shield":return P.ShieldCheckIcon;case"reply":case"chat":return P.ChatBubbleLeftRightIcon;case"filter":return P.FunnelIcon;case"plug":return P.LinkIcon;case"adjustments":return P.AdjustmentsHorizontalIcon;case"currency-dollar":return P.CurrencyDollarIcon;default:return P.Cog6ToothIcon}},$l=({settings:e,selectedSetting:r,onSettingSelect:a,className:n=""})=>t.jsx("nav",{className:f("space-y-1",n),"aria-label":"Settings navigation",children:t.jsx("ul",{className:"space-y-1",role:"list",children:e.map(o=>{const s=Vl(o.icon),l=r===o.id;return t.jsx("li",{children:t.jsx("button",{onClick:()=>a(o.id),className:f("w-full flex items-center text-left px-3 py-2 rounded-lg transition-colors h-[44px]",U.body.sm(),l?"bg-orange-100 dark:bg-orange-900/30 text-orange-700 dark:text-orange-300":"hover:bg-gray-100 dark:hover:bg-gray-700 text-gray-700 dark:text-gray-300"),"aria-current":l?"page":void 0,title:o.description,children:t.jsxs("div",{className:"flex items-center flex-1 min-w-0",children:[t.jsx(s,{className:"h-5 w-5 mr-3 flex-shrink-0","aria-hidden":"true"}),t.jsx("span",{className:"truncate",children:o.title})]})})},o.id)})})}),Hl=({className:e,children:r,disabled:a=!1,onClick:n})=>t.jsx("div",{className:f("p-4 rounded-lg border transition-colors","bg-white dark:bg-gray-900","border-gray-200 dark:border-gray-700","text-gray-900 dark:text-white",a&&"opacity-50 cursor-not-allowed","hover:bg-gray-50 dark:hover:bg-gray-800",e),onClick:a?void 0:n,role:"region","aria-label":"UskipUnavigation",children:r||"UskipUnavigation Component"}),ql=({className:e,children:r,disabled:a=!1,onClick:n})=>t.jsx("div",{className:f("p-4 rounded-lg border transition-colors","bg-white dark:bg-gray-900","border-gray-200 dark:border-gray-700","text-gray-900 dark:text-white",a&&"opacity-50 cursor-not-allowed","hover:bg-gray-50 dark:hover:bg-gray-800",e),onClick:a?void 0:n,role:"region","aria-label":"UsortUdropdown",children:r||"UsortUdropdown Component"}),Gl=({className:e,children:r,disabled:a=!1,onClick:n})=>t.jsx("div",{className:f("p-4 rounded-lg border transition-colors","bg-white dark:bg-gray-900","border-gray-200 dark:border-gray-700","text-gray-900 dark:text-white",a&&"opacity-50 cursor-not-allowed","hover:bg-gray-50 dark:hover:bg-gray-800",e),onClick:a?void 0:n,role:"region","aria-label":"UversionUbadge",children:r||"UversionUbadge Component"}),Yl=({children:e,as:r="span"})=>t.jsx(r,{className:"sr-only",children:e}),Kl=({time:e,isActive:r=!0,size:a="sm",showIcon:n=!0,className:o})=>{const s={sm:"gap-1.5",md:"gap-2",lg:"gap-2.5"},l={sm:"w-4 h-4",md:"w-5 h-5",lg:"w-6 h-6"},c={sm:"sm",md:"base",lg:"lg"};return t.jsxs("div",{className:f("flex items-center",s[a],o),role:"timer","aria-label":`Timer: ${e}`,children:[n&&t.jsx("svg",{className:f(l[a],r?"text-blue-600 dark:text-blue-400":"text-gray-400 dark:text-gray-500"),fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,"aria-hidden":"true",children:t.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 8v4l3 3m6-3a9 9 0 11-18 0 9 9 0 0118 0z"})}),t.jsx(nt,{as:"span",size:c[a],weight:"medium",color:r?"default":"muted",className:"font-mono tabular-nums",children:e})]})},Xl=["#3b82f6","#10b981","#f59e0b","#ef4444","#8b5cf6","#ec4899"],Zl=({show:e,onComplete:r,particleCount:a=50,duration:n=3e3,colors:o=Xl,className:s})=>{const[l,c]=p.useState([]),[d,i]=p.useState(!1);p.useEffect(()=>{if(e&&!d){i(!0);const u=[];for(let m=0;m<a;m++){const b=Math.PI*2*m/a+Math.random()*.5,v=2+Math.random()*4;u.push({id:m,x:50,y:50,vx:Math.cos(b)*v,vy:Math.sin(b)*v-2,color:o[Math.floor(Math.random()*o.length)],size:8+Math.random()*8,rotation:Math.random()*360,rotationSpeed:(Math.random()-.5)*20,isCircle:Math.random()>.5})}c(u);const y=setTimeout(()=>{i(!1),c([]),r?.()},n);return()=>clearTimeout(y)}},[e,d,r,a,n,o]);const h=p.useCallback(()=>{c(u=>u.map(y=>({...y,x:y.x+y.vx*.5,y:y.y+y.vy*.5,vy:y.vy+.15,rotation:y.rotation+y.rotationSpeed})))},[]);return p.useEffect(()=>{if(!d||l.length===0)return;const u=setInterval(h,16);return()=>clearInterval(u)},[d,l.length,h]),!d||l.length===0?null:t.jsx("div",{className:f("fixed inset-0 pointer-events-none z-50 overflow-hidden",s),"aria-hidden":"true",children:l.map(u=>t.jsx("div",{className:"absolute",style:{left:`${u.x}%`,top:`${u.y}%`,width:u.size,height:u.size,backgroundColor:u.color,transform:`rotate(${u.rotation}deg)`,borderRadius:u.isCircle?"50%":"2px",opacity:Math.max(0,1-u.y/150)}},u.id))})},nr=X.cva("transition-all duration-200 focus:outline-none focus:ring-2 focus:ring-blue-500 focus:ring-offset-2 rounded-sm",{variants:{variant:{subtle:U.link.subtle(),default:U.link.default(),muted:U.link.muted(),external:U.link.external(),inherit:"text-inherit hover:text-blue-600 dark:hover:text-blue-400 underline-offset-2 hover:underline transition-colors duration-200"},size:{sm:"text-sm",default:"text-base",lg:"text-lg"}},defaultVariants:{variant:"subtle",size:"default"}}),Ir=G.forwardRef(({className:e,variant:r,size:a,to:n,href:o,external:s,children:l,onTrack:c,trackingLabel:d,componentName:i,onClick:h,...u},y)=>{const m=n||o,b=s||m&&(m.startsWith("http")||m.startsWith("mailto:")),v=k=>{c&&c({action:"click",trackingLabel:d,componentName:i}),h?.(k)};return m?b?t.jsx("a",{className:f(nr({variant:r==="subtle"?"external":r,size:a,className:e})),href:m,target:"_blank",rel:"noopener noreferrer",ref:y,onClick:v,...u,children:l}):t.jsx(Z.Link,{className:f(nr({variant:r,size:a,className:e})),to:m,ref:y,onClick:v,...u,children:l}):t.jsx("span",{className:f(nr({variant:r,size:a,className:e})),onClick:v,...u,children:l})});Ir.displayName="SmartLink";const Jl=(e,r)=>G.useMemo(()=>{let a=e;return Object.entries(r).forEach(([n,o])=>{const s=new RegExp(`\\b${n.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}\\b`,"gi");a=a.replace(s,l=>`<SmartLink to="${o}" variant="subtle">${l}</SmartLink>`)}),a},[e,r]),Ql={documentation:"/document",settings:"/settings",about:"/about",contact:"/contact","privacy policy":"/privacy",privacy:"/privacy","terms of service":"/terms",terms:"/terms","cookie policy":"/cookies",cookies:"/cookies",points:"/points","earn points":"/how-to-earn-points","how to earn points":"/how-to-earn-points","connect wallet":"/connect","connect your wallet":"/connect","wallet connection":"/connect",wallet:"/connect",compose:"/compose","compose email":"/compose","send email":"/compose",mail:"/mail",email:"/mail",inbox:"/mail",dashboard:"/mail",delegate:"/delegate",delegation:"/delegate",manage:"/manage","manage preferences":"/preferences",profile:"/settings",account:"/settings",preferences:"/preferences",token:"/token","web3 users":"/web3-users","web3 projects":"/web3-projects","get started":"/connect","start here":"/connect","learn more":"/document","read more":"/document","our features":"/document",support:"/contact",help:"/document","contact us":"/contact"},Rl=({children:e,mappings:r=Ql,className:a,variant:n="subtle"})=>{const o=G.useMemo(()=>{if(!e||typeof e!="string")return e||"";let l=e;return Object.entries(r).sort(([d],[i])=>i.length-d.length).forEach(([d,i])=>{if(d&&i){const h=new RegExp(`\\b${d.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}\\b`,"gi");l=l.replace(h,u=>`__LINK_START__${i}__LINK_MID__${u}__LINK_END__`)}}),l},[e,r]);if(!o||typeof o!="string")return t.jsx("span",{className:a,children:e});const s=o.split(/(__LINK_START__.*?__LINK_END__)/);return t.jsx("span",{className:a,children:s.map((l,c)=>{const d=l.match(/__LINK_START__(.*?)__LINK_MID__(.*?)__LINK_END__/);if(d){const[,i,h]=d;return t.jsx(Ir,{to:i,variant:n,children:h},c)}return l})})},ei=({href:e,children:r,variant:a="default",external:n=!1,showExternalIcon:o=!1,disabled:s=!1,className:l,onTrack:c,trackingLabel:d,componentName:i,onClick:h,...u})=>{const y=n||e.startsWith("http://")||e.startsWith("https://"),m={default:"text-blue-600 dark:text-blue-400 hover:text-blue-700 dark:hover:text-blue-300",primary:"text-blue-600 dark:text-blue-400 hover:text-blue-700 dark:hover:text-blue-300 font-medium",secondary:"text-gray-600 dark:text-gray-400 hover:text-gray-900 dark:hover:text-gray-100",muted:"text-gray-500 dark:text-gray-500 hover:text-gray-700 dark:hover:text-gray-300",underline:"text-blue-600 dark:text-blue-400 hover:text-blue-700 dark:hover:text-blue-300 underline"},b=y?{target:"_blank",rel:"noopener noreferrer"}:{},v=k=>{c&&c({action:"click",trackingLabel:d,componentName:i}),h?.(k)};return s?t.jsxs("span",{className:f("cursor-not-allowed opacity-50",m[a],l),children:[r,o&&y&&t.jsx(P.ArrowTopRightOnSquareIcon,{className:"inline-block h-4 w-4 ml-1"})]}):t.jsxs("a",{href:e,className:f("inline-flex items-center transition-colors",m[a],l),onClick:v,...b,...u,children:[r,o&&y&&t.jsx(P.ArrowTopRightOnSquareIcon,{className:"inline-block h-4 w-4 ml-1 flex-shrink-0"})]})},ri=({href:e,children:r,showIcon:a=!0,iconPosition:n="right",size:o="md",variant:s="default",className:l,onClick:c})=>{const d={sm:{text:U.body.sm(),icon:"h-3 w-3",gap:"gap-1"},md:{text:U.body.md(),icon:"h-4 w-4",gap:"gap-1.5"},lg:{text:U.body.lg(),icon:"h-5 w-5",gap:"gap-2"}},i={default:"text-blue-600 dark:text-blue-400 hover:text-blue-700 dark:hover:text-blue-300",primary:"text-blue-700 dark:text-blue-300 hover:text-blue-800 dark:hover:text-blue-200 font-semibold",muted:"text-gray-600 dark:text-gray-400 hover:text-gray-800 dark:hover:text-gray-200"},h=d[o];return t.jsxs("a",{href:e,target:"_blank",rel:"noopener noreferrer",onClick:c,className:f("inline-flex items-center",h.gap,h.text,i[s],"underline decoration-1 underline-offset-2","hover:decoration-2","transition-all duration-200",l),children:[a&&n==="left"&&t.jsx(P.ArrowTopRightOnSquareIcon,{className:f(h.icon,"flex-shrink-0")}),t.jsx("span",{children:r}),a&&n==="right"&&t.jsx(P.ArrowTopRightOnSquareIcon,{className:f(h.icon,"flex-shrink-0")})]})},or=new Set,ti=()=>{or.clear()},ai=e=>or.has(e);function ni(e,r,a,n){let o=e;if(a.length>0){const s=new RegExp(`^/(${a.join("|")})/`);o=o.replace(s,"/")}for(const{pattern:s,replacement:l}of n)o=o.replace(s,l);if(r[o])return r[o];for(const[s,l]of Object.entries(r))if(o.endsWith(s))return l}const oi=({preload:e,preloadDelay:r=50,routeModules:a={},languagePrefixes:n=[],pathNormalizations:o=[],to:s,children:l,onMouseEnter:c,onMouseLeave:d,onFocus:i,...h})=>{const u=p.useRef(null),y=p.useCallback(()=>{const S=typeof s=="string"?s:s.pathname||"";if(or.has(S))return;const x=e||ni(S,a,n,o);x&&(u.current=setTimeout(()=>{x().then(()=>{or.add(S)}).catch(()=>{})},r))},[e,r,s,a,n,o]),m=p.useCallback(()=>{u.current&&(clearTimeout(u.current),u.current=null)},[]),b=p.useCallback(S=>{y(),c?.(S)},[y,c]),v=p.useCallback(S=>{m(),d?.(S)},[m,d]),k=p.useCallback(S=>{y(),i?.(S)},[y,i]);return t.jsx(Z.Link,{to:s,onMouseEnter:b,onMouseLeave:v,onFocus:k,...h,children:l})},si=({items:e,separator:r="/",className:a})=>t.jsx("nav",{className:f("flex items-center gap-2 text-sm",a),children:e.map((n,o)=>t.jsxs(p.Fragment,{children:[o>0&&t.jsx("span",{className:"text-gray-400 dark:text-gray-600",children:r}),o===e.length-1?t.jsx("span",{className:"text-gray-900 dark:text-white font-medium",children:n.label}):t.jsx("button",{onClick:n.onClick,className:"text-blue-600 dark:text-blue-400 hover:underline",children:n.label})]},o))}),Kt=G.forwardRef(({onTrack:e,trackingLabel:r,componentName:a,onValueChange:n,children:o,...s},l)=>{const c=d=>{e&&e({action:"change",trackingLabel:r,componentName:a}),n?.(d)};return t.jsx(fe.Root,{ref:l,onValueChange:c,...s,children:o})});Kt.displayName="Tabs";const Xt=G.forwardRef(({className:e,...r},a)=>t.jsx(fe.List,{ref:a,className:f(j.navigation.tabs.list(),e),...r}));Xt.displayName=fe.List.displayName;const Zt=G.forwardRef(({className:e,...r},a)=>t.jsx(fe.Trigger,{ref:a,className:f(j.navigation.tabs.trigger(),e),...r}));Zt.displayName=fe.Trigger.displayName;const Jt=G.forwardRef(({className:e,...r},a)=>t.jsx(fe.Content,{ref:a,className:f(j.navigation.tabs.content(),e),...r}));Jt.displayName=fe.Content.displayName;const li=({items:e,orientation:r="horizontal",className:a})=>{const[n,o]=p.useState(new Set),s=c=>{o(d=>{const i=new Set(d);return i.has(c)?i.delete(c):i.add(c),i})},l=(c,d)=>{const i=c.children&&c.children.length>0,h=n.has(d),u=t.jsxs(t.Fragment,{children:[c.icon&&t.jsx("span",{className:"flex-shrink-0 w-4 h-4",children:c.icon}),t.jsx("span",{className:"flex-1",children:c.label}),i&&t.jsx("svg",{className:f("w-4 h-4 transition-transform",r==="horizontal"&&!h&&"-rotate-90",h&&"rotate-180"),fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:t.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 9l-7 7-7-7"})})]}),y=f("flex items-center gap-2 px-4 py-2 text-sm font-medium","transition-colors",c.active?"text-blue-600 dark:text-blue-400 bg-blue-50 dark:bg-blue-900/20":"text-gray-700 dark:text-gray-300 hover:text-gray-900 dark:hover:text-white hover:bg-gray-100 dark:hover:bg-gray-800");return t.jsxs("div",{children:[i?t.jsx("button",{onClick:()=>s(d),className:f(y,"w-full"),children:u}):c.href?t.jsx("a",{href:c.href,className:y,onClick:c.onClick,children:u}):t.jsx("button",{onClick:c.onClick,className:f(y,"w-full"),children:u}),i&&h&&t.jsx("div",{className:f("bg-gray-50 dark:bg-gray-800/50",r==="horizontal"?"pl-4":"border-l-2 border-gray-200 dark:border-gray-700 ml-4"),children:c.children.map((m,b)=>t.jsx("div",{children:m.href?t.jsxs("a",{href:m.href,onClick:m.onClick,className:f("flex items-center gap-2 px-4 py-2 text-sm","transition-colors",m.active?"text-blue-600 dark:text-blue-400 bg-blue-50 dark:bg-blue-900/20":"text-gray-600 dark:text-gray-400 hover:text-gray-900 dark:hover:text-white hover:bg-gray-100 dark:hover:bg-gray-700"),children:[m.icon&&t.jsx("span",{className:"flex-shrink-0 w-4 h-4",children:m.icon}),m.label]}):t.jsxs("button",{onClick:m.onClick,className:f("w-full flex items-center gap-2 px-4 py-2 text-sm","transition-colors",m.active?"text-blue-600 dark:text-blue-400 bg-blue-50 dark:bg-blue-900/20":"text-gray-600 dark:text-gray-400 hover:text-gray-900 dark:hover:text-white hover:bg-gray-100 dark:hover:bg-gray-700"),children:[m.icon&&t.jsx("span",{className:"flex-shrink-0 w-4 h-4",children:m.icon}),m.label]})},b))})]},d)};return t.jsx("nav",{className:f("bg-white dark:bg-gray-900 border border-gray-200 dark:border-gray-700 rounded-lg",r==="horizontal"?"flex flex-wrap":"flex flex-col",a),children:e.map((c,d)=>l(c,d))})},ii=({items:e,selectedPath:r,onSelect:a,variant:n="default",className:o})=>{const s=n==="compact"?"space-y-1":"space-y-0";return t.jsx("div",{className:f(s,o),children:e.map(l=>{const c=l.icon,d=r===l.path,i=l.disabled,h=f("flex items-start cursor-pointer transition-colors",n==="compact"?"p-3 rounded-lg":"p-4 border-b border-gray-200 dark:border-gray-700 last:border-b-0",i&&"opacity-50 cursor-not-allowed"),u=d?"bg-blue-50 dark:bg-blue-900/20 text-blue-600 dark:text-blue-400":"hover:bg-gray-50 dark:hover:bg-gray-700 text-gray-700 dark:text-gray-300";return t.jsxs("div",{onClick:()=>!i&&a(l.path),className:f(h,!i&&u),role:"button",tabIndex:i?-1:0,"aria-current":d?"page":void 0,"aria-disabled":i,onKeyDown:y=>{!i&&(y.key==="Enter"||y.key===" ")&&(y.preventDefault(),a(l.path))},children:[t.jsx(c,{className:"h-5 w-5 mt-0.5 mr-3 flex-shrink-0"}),t.jsxs("div",{className:"flex-1 min-w-0",children:[t.jsxs("div",{className:f("font-medium",U.body.md()),children:[l.label,l.badge!==void 0&&l.badge>0&&t.jsx("span",{className:"ml-2 inline-flex items-center justify-center px-2 py-0.5 text-xs font-medium bg-blue-100 dark:bg-blue-900 text-blue-800 dark:text-blue-200 rounded-full",children:l.badge})]}),l.description&&t.jsx("div",{className:f("text-xs text-gray-500 dark:text-gray-400 mt-0.5"),children:l.description})]})]},l.id)})})},ci=({items:e,className:r})=>t.jsx("nav",{className:f("flex flex-col gap-1",r),children:e.map(a=>t.jsxs("button",{onClick:a.onClick,className:f("flex items-center gap-3 px-4 py-3 rounded-lg transition-colors",a.active?"bg-blue-50 dark:bg-blue-900/20 text-blue-600 dark:text-blue-400":"text-gray-700 dark:text-gray-300 hover:bg-gray-100 dark:hover:bg-gray-800"),children:[a.icon&&t.jsx("span",{className:"w-5 h-5",children:a.icon}),t.jsx("span",{className:"flex-1 text-left font-medium",children:a.label}),a.badge&&t.jsx("span",{className:"px-2 py-0.5 bg-gray-200 dark:bg-gray-700 rounded text-xs",children:a.badge})]},a.id))}),di=({currentPage:e,totalPages:r,onPageChange:a,siblingCount:n=1,showFirstLast:o=!1,size:s="md",className:l})=>{const d={sm:{button:"h-8 w-8 text-xs",icon:"h-3 w-3",text:U.body.sm()},md:{button:"h-10 w-10 text-sm",icon:"h-4 w-4",text:U.body.md()},lg:{button:"h-12 w-12 text-base",icon:"h-5 w-5",text:U.body.lg()}}[s],h=(()=>{const x=[];x.push(1);const N=Math.max(e-n,2),w=Math.min(e+n,r-1);N>2&&x.push("ellipsis");for(let E=N;E<=w;E++)x.push(E);return w<r-1&&x.push("ellipsis"),r>1&&x.push(r),x})(),u=()=>{e>1&&a(e-1)},y=()=>{e<r&&a(e+1)},m=()=>{a(1)},b=()=>{a(r)},v=f("inline-flex items-center justify-center","rounded-md border border-gray-300 dark:border-gray-600","transition-all duration-200","focus:outline-none focus:ring-2 focus:ring-blue-500","disabled:opacity-50 disabled:cursor-not-allowed"),k=x=>f(v,d.button,d.text,x?"bg-blue-600 text-white border-blue-600 dark:bg-blue-500 dark:border-blue-500":"bg-white dark:bg-gray-800 text-gray-700 dark:text-gray-300 hover:bg-gray-50 dark:hover:bg-gray-700"),S=f(v,d.button,"bg-white dark:bg-gray-800 text-gray-700 dark:text-gray-300","hover:bg-gray-50 dark:hover:bg-gray-700");return t.jsxs("nav",{className:f("flex items-center gap-1",l),"aria-label":"Pagination",children:[o&&t.jsx("button",{onClick:m,disabled:e===1,className:S,"aria-label":"Go to first page",children:t.jsx("span",{className:d.text,children:"First"})}),t.jsx("button",{onClick:u,disabled:e===1,className:S,"aria-label":"Go to previous page",children:t.jsx(P.ChevronLeftIcon,{className:d.icon})}),h.map((x,N)=>x==="ellipsis"?t.jsx("span",{className:f("inline-flex items-center justify-center",d.button,"text-gray-400 dark:text-gray-500"),children:"..."},`ellipsis-${N}`):t.jsx("button",{onClick:()=>a(x),className:k(x===e),"aria-label":`Go to page ${x}`,"aria-current":x===e?"page":void 0,children:x},x)),t.jsx("button",{onClick:y,disabled:e===r,className:S,"aria-label":"Go to next page",children:t.jsx(P.ChevronRightIcon,{className:d.icon})}),o&&t.jsx("button",{onClick:b,disabled:e===r,className:S,"aria-label":"Go to last page",children:t.jsx("span",{className:d.text,children:"Last"})})]})},gi=({currentPage:e,totalPages:r,onPageChange:a,maxVisible:n=7,className:o})=>{const s=[];if(r<=n)for(let l=1;l<=r;l++)s.push(l);else{s.push(1),e>3&&s.push("...");const l=Math.max(2,e-1),c=Math.min(r-1,e+1);for(let d=l;d<=c;d++)s.push(d);e<r-2&&s.push("..."),s.push(r)}return t.jsxs("nav",{className:f("flex items-center gap-1",o),children:[t.jsx("button",{onClick:()=>a(e-1),disabled:e===1,className:"px-3 py-2 rounded hover:bg-gray-100 dark:hover:bg-gray-800 disabled:opacity-50 disabled:cursor-not-allowed",children:"Previous"}),s.map((l,c)=>l==="..."?t.jsx("span",{className:"px-3 py-2",children:"..."},`ellipsis-${c}`):t.jsx("button",{onClick:()=>a(l),className:f("px-3 py-2 rounded",l===e?"bg-blue-500 text-white":"hover:bg-gray-100 dark:hover:bg-gray-800"),children:l},l)),t.jsx("button",{onClick:()=>a(e+1),disabled:e===r,className:"px-3 py-2 rounded hover:bg-gray-100 dark:hover:bg-gray-800 disabled:opacity-50 disabled:cursor-not-allowed",children:"Next"})]})},ui=({steps:e,currentStep:r,orientation:a="horizontal",clickable:n=!1,onStepClick:o,className:s})=>{const l=d=>{n&&o&&o(d)},c=d=>d<r?"completed":d===r?"active":"upcoming";return a==="horizontal"?t.jsx("div",{className:f("w-full",s),children:t.jsx("div",{className:"flex items-center justify-between",children:e.map((d,i)=>{const h=c(i),u=i===e.length-1;return t.jsxs(p.Fragment,{children:[t.jsxs("div",{className:"flex flex-col items-center",children:[t.jsx("button",{onClick:()=>l(i),disabled:!n,className:f("flex items-center justify-center w-10 h-10 rounded-full border-2 transition-all","disabled:cursor-default",n&&"hover:scale-110",h==="completed"&&"bg-blue-600 border-blue-600 dark:bg-blue-500 dark:border-blue-500",h==="active"&&"bg-white dark:bg-gray-900 border-blue-600 dark:border-blue-500",h==="upcoming"&&"bg-white dark:bg-gray-900 border-gray-300 dark:border-gray-700"),children:h==="completed"?t.jsx("svg",{className:"w-5 h-5 text-white",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:t.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:3,d:"M5 13l4 4L19 7"})}):d.icon?t.jsx("span",{className:f("w-5 h-5",h==="active"?"text-blue-600 dark:text-blue-500":"text-gray-400 dark:text-gray-600"),children:d.icon}):t.jsx("span",{className:f("text-sm font-semibold",h==="active"?"text-blue-600 dark:text-blue-500":"text-gray-400 dark:text-gray-600"),children:i+1})}),t.jsxs("div",{className:"mt-2 text-center",children:[t.jsx("p",{className:f("text-sm font-medium",h==="active"?"text-blue-600 dark:text-blue-500":h==="completed"?"text-gray-900 dark:text-white":"text-gray-500 dark:text-gray-400"),children:d.label}),d.description&&t.jsx("p",{className:"text-xs text-gray-500 dark:text-gray-400 mt-0.5",children:d.description})]})]}),!u&&t.jsx("div",{className:"flex-1 h-0.5 mx-2 bg-gray-300 dark:bg-gray-700 relative",children:t.jsx("div",{className:f("absolute left-0 top-0 h-full bg-blue-600 dark:bg-blue-500 transition-all duration-300",i<r?"w-full":"w-0")})})]},d.id)})})}):t.jsx("div",{className:f("w-full",s),children:t.jsx("div",{className:"space-y-4",children:e.map((d,i)=>{const h=c(i),u=i===e.length-1;return t.jsxs("div",{className:"flex gap-4",children:[t.jsxs("div",{className:"flex flex-col items-center",children:[t.jsx("button",{onClick:()=>l(i),disabled:!n,className:f("flex items-center justify-center w-10 h-10 rounded-full border-2 transition-all","disabled:cursor-default flex-shrink-0",n&&"hover:scale-110",h==="completed"&&"bg-blue-600 border-blue-600 dark:bg-blue-500 dark:border-blue-500",h==="active"&&"bg-white dark:bg-gray-900 border-blue-600 dark:border-blue-500",h==="upcoming"&&"bg-white dark:bg-gray-900 border-gray-300 dark:border-gray-700"),children:h==="completed"?t.jsx("svg",{className:"w-5 h-5 text-white",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:t.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:3,d:"M5 13l4 4L19 7"})}):d.icon?t.jsx("span",{className:f("w-5 h-5",h==="active"?"text-blue-600 dark:text-blue-500":"text-gray-400 dark:text-gray-600"),children:d.icon}):t.jsx("span",{className:f("text-sm font-semibold",h==="active"?"text-blue-600 dark:text-blue-500":"text-gray-400 dark:text-gray-600"),children:i+1})}),!u&&t.jsx("div",{className:"w-0.5 flex-1 min-h-[32px] bg-gray-300 dark:bg-gray-700 relative mt-2",children:t.jsx("div",{className:f("absolute top-0 left-0 w-full bg-blue-600 dark:bg-blue-500 transition-all duration-300",i<r?"h-full":"h-0")})})]}),t.jsxs("div",{className:"flex-1 pb-4",children:[t.jsx("p",{className:f("text-sm font-medium",h==="active"?"text-blue-600 dark:text-blue-500":h==="completed"?"text-gray-900 dark:text-white":"text-gray-500 dark:text-gray-400"),children:d.label}),d.description&&t.jsx("p",{className:"text-xs text-gray-500 dark:text-gray-400 mt-1",children:d.description})]})]},d.id)})})})},hi=({steps:e,currentStep:r,onStepClick:a,orientation:n="horizontal",className:o})=>t.jsx("nav",{className:f(n==="horizontal"?"flex items-center":"flex flex-col",o),children:e.map((s,l)=>t.jsxs("div",{className:f("flex items-center",n==="vertical"&&"flex-col items-start"),children:[t.jsxs("div",{className:"flex items-center gap-3",children:[t.jsx("button",{onClick:()=>a?.(l),disabled:l>r,className:f("w-10 h-10 rounded-full flex items-center justify-center font-semibold transition-colors",l<r&&"bg-green-500 text-white",l===r&&"bg-blue-500 text-white",l>r&&"bg-gray-200 dark:bg-gray-700 text-gray-600 dark:text-gray-400"),children:l<r?"✓":l+1}),t.jsxs("div",{children:[t.jsx("p",{className:"font-medium text-gray-900 dark:text-white",children:s.label}),s.description&&t.jsx("p",{className:"text-sm text-gray-600 dark:text-gray-400",children:s.description})]})]}),l<e.length-1&&t.jsx("div",{className:f(n==="horizontal"?"w-full h-0.5 mx-4":"h-8 w-0.5 ml-5 my-2","bg-gray-300 dark:bg-gray-700")})]},s.id))}),fi=({subsections:e,isExpanded:r,selectedSubsection:a,parentSectionId:n,onSubsectionSelect:o})=>{const s=p.useRef(null),[l,c]=p.useState(void 0);return p.useEffect(()=>{if(s.current){const d=s.current.scrollHeight;c(r?d+8:0)}},[r,e]),t.jsx("div",{className:"overflow-hidden transition-all duration-300 ease-in-out",style:{height:l!==void 0?`${l}px`:"auto"},children:t.jsx("div",{ref:s,className:"ml-6 mt-2 space-y-1",children:e.map(d=>t.jsx("button",{onClick:()=>o?.(d.id,n),className:`block w-full text-left px-3 py-2 rounded-md text-sm transition-all duration-200 hover:scale-[1.02] ${a===d.id?"bg-blue-100 dark:bg-blue-900/20 text-blue-700 dark:text-blue-300 shadow-sm":"text-gray-600 dark:text-gray-400 hover:bg-gray-100 dark:hover:bg-gray-800 hover:text-gray-800 dark:hover:text-gray-200"}`,children:d.title},d.id))})})},bi=({sections:e,selectedSection:r,selectedSubsection:a,expandedSections:n,onSectionSelect:o,onSubsectionSelect:s,onToggleSection:l,className:c=""})=>t.jsx("nav",{className:`space-y-2 ${c}`,children:e.map(d=>t.jsxs("div",{children:[t.jsxs("div",{className:"flex items-center",children:[t.jsx("button",{onClick:()=>o(d.id),className:`flex-1 text-left px-3 py-2 rounded-md text-sm font-medium transition-all duration-200 hover:scale-[1.02] ${r===d.id&&!a?"bg-blue-100 dark:bg-blue-900/20 text-blue-700 dark:text-blue-300 shadow-sm":"text-gray-700 dark:text-gray-300 hover:bg-gray-100 dark:hover:bg-gray-800 hover:text-gray-900 dark:hover:text-gray-100"}`,children:d.title}),d.subsections&&d.subsections.length>0&&t.jsx("button",{onClick:()=>l(d.id),className:"p-1 rounded-md hover:bg-gray-100 dark:hover:bg-gray-800 hover:scale-110 transition-all duration-200",children:t.jsx(P.ChevronRightIcon,{className:`h-4 w-4 text-gray-500 transition-transform duration-300 ease-in-out ${n.includes(d.id)?"rotate-90":"rotate-0"}`})})]}),d.subsections&&t.jsx(fi,{subsections:d.subsections,isExpanded:n.includes(d.id),selectedSubsection:a,parentSectionId:d.id,onSubsectionSelect:s})]},d.id))});function mi({columns:e,data:r,keyExtractor:a,sort:n,onSort:o,onRowClick:s,striped:l=!1,hoverable:c=!1,compact:d=!1,bordered:i=!1,emptyMessage:h="No data available",className:u}){const y=b=>{b.sortable&&o&&o(b.key)},m={left:"text-left",center:"text-center",right:"text-right"};return t.jsx("div",{className:f("w-full overflow-x-auto",u),children:t.jsxs("table",{className:"w-full",children:[t.jsx("thead",{className:"bg-gray-50 dark:bg-gray-800 border-b border-gray-200 dark:border-gray-700",children:t.jsx("tr",{children:e.map(b=>t.jsx("th",{className:f(d?"px-3 py-2":"px-6 py-3","text-xs font-medium text-gray-700 dark:text-gray-300 uppercase tracking-wider",m[b.align||"left"],b.sortable&&"cursor-pointer select-none hover:bg-gray-100 dark:hover:bg-gray-700",i&&"border-r border-gray-200 dark:border-gray-700 last:border-r-0"),style:{width:b.width},onClick:()=>b.sortable&&y(b),children:t.jsxs("div",{className:"flex items-center gap-2",children:[b.label,b.sortable&&t.jsx("span",{className:"flex flex-col",children:n?.column===b.key?n.direction==="asc"?t.jsx("svg",{className:"w-4 h-4",fill:"currentColor",viewBox:"0 0 20 20",children:t.jsx("path",{d:"M5 10l5-5 5 5H5z"})}):t.jsx("svg",{className:"w-4 h-4",fill:"currentColor",viewBox:"0 0 20 20",children:t.jsx("path",{d:"M15 10l-5 5-5-5h10z"})}):t.jsx("svg",{className:"w-4 h-4 text-gray-400",fill:"currentColor",viewBox:"0 0 20 20",children:t.jsx("path",{d:"M5 10l5-5 5 5H5z"})})})]})},b.key))})}),t.jsx("tbody",{className:"bg-white dark:bg-gray-900 divide-y divide-gray-200 dark:divide-gray-700",children:r.length===0?t.jsx("tr",{children:t.jsx("td",{colSpan:e.length,className:"px-6 py-8 text-center text-sm text-gray-500 dark:text-gray-400",children:h})}):r.map((b,v)=>t.jsx("tr",{className:f(l&&v%2===1&&"bg-gray-50 dark:bg-gray-800/50",c&&"hover:bg-gray-100 dark:hover:bg-gray-800 transition-colors",s&&"cursor-pointer"),onClick:()=>s?.(b,v),children:e.map(k=>t.jsx("td",{className:f(d?"px-3 py-2":"px-6 py-4","text-sm text-gray-900 dark:text-white",m[k.align||"left"],i&&"border-r border-gray-200 dark:border-gray-700 last:border-r-0"),children:k.render?k.render(b,v):b[k.key]},k.key))},a(b,v)))})]})})}const yi=({data:e,columns:r,hasActions:a=!1,renderCell:n,renderAction:o,emptyMessage:s="No data available",getRowKey:l=(d,i)=>String(i),className:c=""})=>!e||e.length===0?t.jsx("div",{className:`text-center py-8 bg-gray-50 dark:bg-gray-800 rounded-lg ${c}`,children:t.jsx("p",{className:`${U.body.sm()} text-gray-500 dark:text-gray-400`,children:s})}):t.jsx("div",{className:`relative ${c}`,children:t.jsx("div",{className:"overflow-x-auto",children:t.jsxs("table",{className:"w-full border-collapse",children:[t.jsx("thead",{children:t.jsxs("tr",{className:"border-b border-gray-200 dark:border-gray-700",children:[r.map((d,i)=>t.jsx("th",{className:`${U.label.default()} text-left py-3 px-4 whitespace-nowrap`,children:d},i)),a&&t.jsx("th",{className:`${U.label.default()} text-right py-3 px-4 sticky right-0 bg-white dark:bg-gray-900 whitespace-nowrap`})]})}),t.jsx("tbody",{children:e.map((d,i)=>t.jsxs("tr",{className:"border-b border-gray-100 dark:border-gray-800 hover:bg-gray-50 dark:hover:bg-gray-800/50",children:[r.map((h,u)=>{const y=n(d,u);return t.jsx("td",{className:"py-3 px-4",children:typeof y=="string"?t.jsx("span",{className:U.body.sm(),children:y}):y},u)}),a&&t.jsx("td",{className:"py-3 px-4 text-right sticky right-0 bg-white dark:bg-gray-900",children:o?.(d)})]},l(d,i)))})]})})}),pi=({className:e,children:r,disabled:a=!1,onClick:n})=>t.jsx("div",{className:f("p-4 rounded-lg border transition-colors","bg-white dark:bg-gray-900","border-gray-200 dark:border-gray-700","text-gray-900 dark:text-white",a&&"opacity-50 cursor-not-allowed","hover:bg-gray-50 dark:hover:bg-gray-800",e),onClick:a?void 0:n,role:"region","aria-label":"UdataUgrid",children:r||"UdataUgrid Component"}),vi=({className:e,children:r,disabled:a=!1,onClick:n})=>t.jsx("div",{className:f("p-4 rounded-lg border transition-colors","bg-white dark:bg-gray-900","border-gray-200 dark:border-gray-700","text-gray-900 dark:text-white",a&&"opacity-50 cursor-not-allowed","hover:bg-gray-50 dark:hover:bg-gray-800",e),onClick:a?void 0:n,role:"region","aria-label":"UpivotUtable",children:r||"UpivotUtable Component"}),ki=({className:e,children:r,disabled:a=!1,onClick:n})=>t.jsx("div",{className:f("p-4 rounded-lg border transition-colors","bg-white dark:bg-gray-900","border-gray-200 dark:border-gray-700","text-gray-900 dark:text-white",a&&"opacity-50 cursor-not-allowed","hover:bg-gray-50 dark:hover:bg-gray-800",e),onClick:a?void 0:n,role:"region","aria-label":"UspreadsheetUgrid",children:r||"UspreadsheetUgrid Component"}),xi=({className:e,children:r,disabled:a=!1,onClick:n})=>t.jsx("div",{className:f("p-4 rounded-lg border transition-colors","bg-white dark:bg-gray-900","border-gray-200 dark:border-gray-700","text-gray-900 dark:text-white",a&&"opacity-50 cursor-not-allowed","hover:bg-gray-50 dark:hover:bg-gray-800",e),onClick:a?void 0:n,role:"region","aria-label":"UcolumnUresize",children:r||"UcolumnUresize Component"}),wi=({className:e,children:r,disabled:a=!1,onClick:n})=>t.jsx("div",{className:f("p-4 rounded-lg border transition-colors","bg-white dark:bg-gray-900","border-gray-200 dark:border-gray-700","text-gray-900 dark:text-white",a&&"opacity-50 cursor-not-allowed","hover:bg-gray-50 dark:hover:bg-gray-800",e),onClick:a?void 0:n,role:"region","aria-label":"UcellUeditor",children:r||"UcellUeditor Component"}),Ni=({className:e,children:r,disabled:a=!1,onClick:n})=>t.jsx("div",{className:f("p-4 rounded-lg border transition-colors","bg-white dark:bg-gray-900","border-gray-200 dark:border-gray-700","text-gray-900 dark:text-white",a&&"opacity-50 cursor-not-allowed","hover:bg-gray-50 dark:hover:bg-gray-800",e),onClick:a?void 0:n,role:"region","aria-label":"UtableUreservation",children:r||"UtableUreservation Component"}),Ci=({children:e,type:r="unordered",spacing:a="sm",marker:n,size:o="md",className:s})=>{const l=r==="ordered"?"ol":"ul",c={none:"space-y-0",sm:"space-y-1",md:"space-y-2",lg:"space-y-4"},d={sm:"text-sm",md:"text-base",lg:"text-lg"},i=()=>n==="none"?"list-none":r==="unordered"?{disc:"list-disc",circle:"list-circle",square:"list-square",decimal:"list-disc",alpha:"list-disc",roman:"list-disc",none:"list-none"}[n||"disc"]:{decimal:"list-decimal",alpha:"list-alpha",roman:"list-roman",disc:"list-decimal",circle:"list-decimal",square:"list-decimal",none:"list-none"}[n||"decimal"];return t.jsx(l,{className:f("ml-6",i(),c[a],d[o],"text-gray-900 dark:text-gray-100",s),children:e})},Si=({children:e,className:r})=>t.jsx("li",{className:f("leading-relaxed",r),children:e}),Ei=({children:e,onAction:r,actionText:a="Remove",actionIcon:n=P.TrashIcon,destructive:o=!0,isProcessing:s=!1,variant:l="default",className:c})=>{const d="flex items-center justify-between p-4 rounded-lg transition-colors",i={default:"bg-gray-50 dark:bg-gray-700",compact:"bg-gray-50 dark:bg-gray-700 py-2 px-3",elevated:"bg-white dark:bg-gray-800 border border-gray-200 dark:border-gray-700 shadow-sm hover:shadow-md"};return t.jsxs("div",{className:f(d,i[l],c),children:[t.jsx("div",{className:"flex-1 text-sm text-gray-900 dark:text-white",children:e}),t.jsxs(ne,{variant:o?"ghost":"outline",size:"sm",onClick:r,disabled:s,className:f("ml-4",o&&"text-red-600 dark:text-red-400 hover:text-red-700 dark:hover:text-red-300 hover:bg-red-50 dark:hover:bg-red-900/20"),children:[t.jsx(n,{className:"h-4 w-4 mr-1"}),a]})]})},Ai=({className:e,children:r,disabled:a=!1,onClick:n})=>t.jsx("div",{className:f("p-4 rounded-lg border transition-colors","bg-white dark:bg-gray-900","border-gray-200 dark:border-gray-700","text-gray-900 dark:text-white",a&&"opacity-50 cursor-not-allowed","hover:bg-gray-50 dark:hover:bg-gray-800",e),onClick:a?void 0:n,role:"region","aria-label":"UuserUtable",children:r||"UuserUtable Component"}),Ti=({source:e,target:r,onChange:a,sourceTitle:n="Available",targetTitle:o="Selected",searchable:s=!0,sourceSearchPlaceholder:l="Search available...",targetSearchPlaceholder:c="Search selected...",height:d=300,disabled:i=!1,className:h})=>{const[u,y]=p.useState(""),[m,b]=p.useState(""),[v,k]=p.useState(new Set),[S,x]=p.useState(new Set),N=s?e.filter(D=>D.label.toLowerCase().includes(u.toLowerCase())):e,w=s?r.filter(D=>D.label.toLowerCase().includes(m.toLowerCase())):r,E=D=>{const B=new Set(v);B.has(D)?B.delete(D):B.add(D),k(B)},A=D=>{const B=new Set(S);B.has(D)?B.delete(D):B.add(D),x(B)},C=()=>{const D=e.filter(F=>v.has(F.id)),B=e.filter(F=>!v.has(F.id)),z=[...r,...D];a(B,z),k(new Set)},I=()=>{const D=r.filter(F=>S.has(F.id)),B=r.filter(F=>!S.has(F.id)),z=[...e,...D];a(z,B),x(new Set)},L=()=>{const D=[...r,...e];a([],D),k(new Set)},O=()=>{const D=[...e,...r];a(D,[]),x(new Set)},M=(D,B,z,F,V,R,Fh)=>t.jsxs("div",{className:"flex flex-col flex-1 border border-gray-300 dark:border-gray-700 rounded-md bg-white dark:bg-gray-900",children:[t.jsxs("div",{className:"px-3 py-2 border-b border-gray-300 dark:border-gray-700 bg-gray-50 dark:bg-gray-800",children:[t.jsx("h3",{className:"text-sm font-semibold text-gray-900 dark:text-white",children:B}),t.jsxs("p",{className:"text-xs text-gray-600 dark:text-gray-400",children:[D.length," item",D.length!==1?"s":""]})]}),s&&t.jsx("div",{className:"p-2 border-b border-gray-200 dark:border-gray-700",children:t.jsx("input",{type:"text",value:V,onChange:se=>R(se.target.value),placeholder:Fh,className:"w-full px-3 py-2 text-sm bg-gray-50 dark:bg-gray-800 border border-gray-300 dark:border-gray-700 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500 dark:focus:ring-blue-400"})}),t.jsx("div",{className:"overflow-y-auto p-2 space-y-1",style:{height:s?d-120:d-60},children:D.length===0?t.jsx("div",{className:"flex items-center justify-center h-full text-sm text-gray-500 dark:text-gray-400",children:"No items"}):D.map(se=>{const et=z.has(se.id);return t.jsx("button",{onClick:()=>!se.disabled&&F(se.id),disabled:se.disabled||i,className:f("w-full px-3 py-2 text-left rounded-md transition-colors","hover:bg-gray-100 dark:hover:bg-gray-800","disabled:opacity-50 disabled:cursor-not-allowed",et&&"bg-blue-50 dark:bg-blue-900/30 border border-blue-200 dark:border-blue-700"),children:t.jsxs("div",{className:"flex items-start gap-2",children:[t.jsx("div",{className:f("w-4 h-4 border-2 rounded flex items-center justify-center flex-shrink-0 mt-0.5",et?"bg-blue-600 border-blue-600 dark:bg-blue-500 dark:border-blue-500":"border-gray-300 dark:border-gray-600"),children:et&&t.jsx("svg",{className:"w-3 h-3 text-white",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:t.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:3,d:"M5 13l4 4L19 7"})})}),t.jsxs("div",{className:"flex-1 min-w-0",children:[t.jsx("p",{className:"text-sm font-medium text-gray-900 dark:text-white truncate",children:se.label}),se.description&&t.jsx("p",{className:"text-xs text-gray-600 dark:text-gray-400 truncate",children:se.description})]})]})},se.id)})})]});return t.jsxs("div",{className:f("flex gap-4",h),children:[M(N,n,v,E,u,y,l),t.jsxs("div",{className:"flex flex-col justify-center gap-2",children:[t.jsx("button",{onClick:L,disabled:i||e.length===0,className:f("px-3 py-2 text-sm bg-white dark:bg-gray-900","border border-gray-300 dark:border-gray-700","rounded-md","hover:bg-gray-50 dark:hover:bg-gray-800","transition-colors","disabled:opacity-50 disabled:cursor-not-allowed"),title:"Move all to selected",children:t.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:t.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M13 5l7 7-7 7M5 5l7 7-7 7"})})}),t.jsx("button",{onClick:C,disabled:i||v.size===0,className:f("px-3 py-2 text-sm bg-white dark:bg-gray-900","border border-gray-300 dark:border-gray-700","rounded-md","hover:bg-gray-50 dark:hover:bg-gray-800","transition-colors","disabled:opacity-50 disabled:cursor-not-allowed"),title:"Move selected to target",children:t.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:t.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 5l7 7-7 7"})})}),t.jsx("button",{onClick:I,disabled:i||S.size===0,className:f("px-3 py-2 text-sm bg-white dark:bg-gray-900","border border-gray-300 dark:border-gray-700","rounded-md","hover:bg-gray-50 dark:hover:bg-gray-800","transition-colors","disabled:opacity-50 disabled:cursor-not-allowed"),title:"Move selected to source",children:t.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:t.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M15 19l-7-7 7-7"})})}),t.jsx("button",{onClick:O,disabled:i||r.length===0,className:f("px-3 py-2 text-sm bg-white dark:bg-gray-900","border border-gray-300 dark:border-gray-700","rounded-md","hover:bg-gray-50 dark:hover:bg-gray-800","transition-colors","disabled:opacity-50 disabled:cursor-not-allowed"),title:"Move all to available",children:t.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:t.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M11 19l-7-7 7-7M19 19l-7-7 7-7"})})})]}),M(w,o,S,A,m,b,c)]})};function Ii({items:e,itemHeight:r,height:a,renderItem:n,keyExtractor:o,overscan:s=3,className:l}){const[c,d]=p.useState(0),i=p.useRef(null),h=v=>{d(v.currentTarget.scrollTop)},u=e.length*r,y=Math.max(0,Math.floor(c/r)-s),m=Math.min(e.length-1,Math.ceil((c+a)/r)+s),b=e.slice(y,m+1);return t.jsx("div",{ref:i,className:f("overflow-auto",l),style:{height:a},onScroll:h,children:t.jsx("div",{style:{height:u,position:"relative"},children:b.map((v,k)=>{const S=y+k;return t.jsx("div",{style:{position:"absolute",top:S*r,height:r,width:"100%"},children:n(v,S)},o(v,S))})})})}const Li=({data:e,selectedId:r,onSelect:a,expandedIds:n,onExpand:o,defaultExpanded:s=!1,showLines:l=!1,className:c})=>{const[d,i]=p.useState(new Set(s?e.map(b=>b.id):[])),h=n!==void 0?new Set(n):d,u=b=>{n!==void 0&&o?o(b):i(v=>{const k=new Set(v);return k.has(b)?k.delete(b):k.add(b),k})},y=b=>{!b.disabled&&a&&a(b)},m=(b,v=0)=>{const k=b.children&&b.children.length>0,S=h.has(b.id),x=r===b.id;return t.jsxs("div",{children:[t.jsxs("div",{className:f("flex items-center gap-2 px-2 py-1.5 rounded-md transition-colors",!b.disabled&&"hover:bg-gray-100 dark:hover:bg-gray-800",x&&"bg-blue-50 dark:bg-blue-900/30",b.disabled&&"opacity-50 cursor-not-allowed",!b.disabled&&"cursor-pointer"),style:{paddingLeft:`${v*1.5+.5}rem`},onClick:()=>y(b),children:[k?t.jsx("button",{onClick:N=>{N.stopPropagation(),u(b.id)},className:"flex-shrink-0 w-4 h-4 flex items-center justify-center hover:bg-gray-200 dark:hover:bg-gray-700 rounded transition-colors",children:t.jsx("svg",{className:f("w-3 h-3 transition-transform",S&&"rotate-90"),fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:t.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 5l7 7-7 7"})})}):t.jsx("div",{className:"w-4 h-4 flex-shrink-0"}),b.icon&&t.jsx("span",{className:"flex-shrink-0 w-4 h-4 text-gray-600 dark:text-gray-400",children:b.icon}),t.jsx("span",{className:f("flex-1 text-sm",x?"text-blue-700 dark:text-blue-300 font-medium":"text-gray-900 dark:text-white"),children:b.label})]}),k&&S&&t.jsx("div",{className:f(l&&"border-l-2 border-gray-200 dark:border-gray-700 ml-2"),children:b.children.map(N=>m(N,v+1))})]},b.id)};return t.jsx("div",{className:f("w-full",c),children:e.map(b=>m(b,0))})},Mi=({className:e,children:r,disabled:a=!1,onClick:n})=>t.jsx("div",{className:f("p-4 rounded-lg border transition-colors","bg-white dark:bg-gray-900","border-gray-200 dark:border-gray-700","text-gray-900 dark:text-white",a&&"opacity-50 cursor-not-allowed","hover:bg-gray-50 dark:hover:bg-gray-800",e),onClick:a?void 0:n,role:"region","aria-label":"UlistingUform",children:r||"UlistingUform Component"}),Pi="bg-gradient-to-r from-blue-50 to-indigo-50 dark:from-blue-900/20 dark:to-indigo-900/20 border border-blue-200 dark:border-blue-800",Oi={none:"",sm:"p-3",md:"p-6",lg:"p-8"},Lr=({variant:e="elevated",padding:r="md",icon:a,onClose:n,className:o,children:s,...l})=>{const d=["info","success","warning","error"].includes(e)&&(a||n),i=e==="callout"?Pi:Tn(e);return t.jsx("div",{className:f("rounded-lg",i,Oi[r],o),...l,children:d?t.jsxs("div",{className:"flex items-start gap-3",children:[a&&t.jsx("div",{className:"flex-shrink-0 text-lg",children:a}),t.jsx("div",{className:"flex-1 min-w-0",children:s}),n&&t.jsx("button",{onClick:n,className:"flex-shrink-0 text-current hover:opacity-70 transition-opacity","aria-label":"Close",children:t.jsx("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:t.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})})]}):s})},Ui=({title:e,description:r,className:a,children:n,...o})=>t.jsxs("div",{className:f("space-y-1.5",a),...o,children:[e&&t.jsx("h3",{className:U.heading.h4(),children:e}),r&&t.jsx("p",{className:U.body.sm(),children:r}),n]}),Di=({className:e,children:r,...a})=>t.jsx("div",{className:f("",e),...a,children:r}),zi=({className:e,children:r,...a})=>t.jsx("div",{className:f("flex items-center pt-4",e),...a,children:r}),ji=({title:e,children:r,variant:a="info",size:n="default",className:o})=>{const s={sm:"sm",default:"md",lg:"lg"},l=a==="neutral"?"bordered":a;return t.jsxs(Lr,{variant:l,padding:s[n],className:o,children:[e&&t.jsx("h3",{className:f("font-semibold mb-2",n==="sm"?"text-base":n==="lg"?"text-xl":"text-lg"),children:e}),r]})},_i=({title:e,icon:r,children:a,variant:n="gradient",size:o="default",centered:s=!1,className:l})=>{const c={sm:"sm",default:"md",lg:"lg"},d=n==="gradient"||n==="neutral"?"callout":n;return t.jsx(Lr,{variant:d,padding:c[o],className:l,children:t.jsxs("div",{className:f("space-y-4",s&&"text-center"),children:[r&&t.jsx("div",{className:f("font-bold",o==="sm"?"text-2xl":o==="lg"?"text-5xl":"text-4xl",s?"text-center":"text-left"),children:r}),e&&t.jsx("h3",{className:f("font-bold mb-4",o==="sm"?"text-lg":o==="lg"?"text-3xl":"text-2xl"),children:e}),t.jsx("div",{className:f("text-gray-600 dark:text-gray-400",o==="sm"?"text-sm":o==="lg"?"text-lg":"text-base"),children:a})]})})},Bi=({title:e,value:r,change:a,changePeriod:n="vs last period",icon:o,variant:s="default",className:l})=>{const c={default:"bg-white dark:bg-gray-900",primary:"bg-blue-50 dark:bg-blue-900/20",success:"bg-green-50 dark:bg-green-900/20",warning:"bg-yellow-50 dark:bg-yellow-900/20",danger:"bg-red-50 dark:bg-red-900/20"};return t.jsxs("div",{className:f("rounded-lg border border-gray-200 dark:border-gray-700 p-6",c[s],l),children:[t.jsxs("div",{className:"flex items-start justify-between mb-2",children:[t.jsx("h3",{className:"text-sm font-medium text-gray-600 dark:text-gray-400",children:e}),o&&t.jsx("div",{className:"text-gray-400 dark:text-gray-600",children:o})]}),t.jsx("div",{className:"flex items-end justify-between",children:t.jsxs("div",{children:[t.jsx("p",{className:"text-3xl font-bold text-gray-900 dark:text-white",children:r}),a!==void 0&&t.jsxs("div",{className:"flex items-center gap-1 mt-2",children:[t.jsxs("span",{className:f("text-sm font-medium",a>=0?"text-green-600 dark:text-green-400":"text-red-600 dark:text-red-400"),children:[a>=0?"↑":"↓"," ",Math.abs(a),"%"]}),t.jsx("span",{className:"text-xs text-gray-500 dark:text-gray-400",children:n})]})]})})]})},Fi=({src:e,alt:r="Avatar",fallback:a,name:n,size:o="md",status:s,className:l,onClick:c})=>{const[d,i]=p.useState(!1),h={sm:"w-8 h-8 text-xs",md:"w-10 h-10 text-sm",lg:"w-12 h-12 text-base"},u={sm:"w-2 h-2",md:"w-2.5 h-2.5",lg:"w-3 h-3"},y={online:"bg-green-500",offline:"bg-gray-400",away:"bg-yellow-500",busy:"bg-red-500"},b=a||(n?(S=>{const x=S.trim().split(/\s+/);return x.length===1?x[0].charAt(0).toUpperCase():x[0].charAt(0).toUpperCase()+x[x.length-1].charAt(0).toUpperCase()})(n):""),v=e&&!d,k=()=>{i(!0)};return t.jsxs("div",{className:"relative inline-block flex-shrink-0",children:[t.jsx("div",{className:f("flex items-center justify-center overflow-hidden rounded-full",h[o],!v&&"bg-gray-300 dark:bg-gray-600 text-gray-700 dark:text-gray-200",c&&"cursor-pointer hover:opacity-80 transition-opacity",l),onClick:c,role:c?"button":void 0,tabIndex:c?0:void 0,children:v?t.jsx("img",{src:e,alt:r,className:"w-full h-full object-cover",onError:k}):t.jsx("span",{className:"font-semibold",children:b})}),s&&t.jsx("span",{className:f("absolute bottom-0 right-0 rounded-full border-2 border-white dark:border-gray-800",y[s],u[o]),"aria-label":s})]})},Wi=({className:e,children:r,disabled:a=!1,onClick:n})=>t.jsx("div",{className:f("p-4 rounded-lg border transition-colors","bg-white dark:bg-gray-900","border-gray-200 dark:border-gray-700","text-gray-900 dark:text-white",a&&"opacity-50 cursor-not-allowed","hover:bg-gray-50 dark:hover:bg-gray-800",e),onClick:a?void 0:n,role:"region","aria-label":"UavatarUgroup",children:r||"UavatarUgroup Component"}),Vi=({className:e,children:r,disabled:a=!1,onClick:n})=>t.jsx("div",{className:f("p-4 rounded-lg border transition-colors","bg-white dark:bg-gray-900","border-gray-200 dark:border-gray-700","text-gray-900 dark:text-white",a&&"opacity-50 cursor-not-allowed","hover:bg-gray-50 dark:hover:bg-gray-800",e),onClick:a?void 0:n,role:"region","aria-label":"UprofileUheader",children:r||"UprofileUheader Component"}),$i=({label:e,value:r,orientation:a="vertical",align:n="start",labelWidth:o="auto",size:s="md",separator:l=!1,labelVariant:c="muted",valueVariant:d="default",className:i,labelClassName:h,valueClassName:u})=>{const y={sm:{label:U.body.sm(),value:U.body.sm(),gap:"gap-1"},md:{label:U.body.md(),value:U.body.md(),gap:"gap-2"},lg:{label:U.body.lg(),value:U.body.lg(),gap:"gap-3"}},m={auto:"",sm:"w-24",md:"w-32",lg:"w-40"},b={start:"justify-start",center:"justify-center",between:"justify-between"},v={default:"text-gray-700 dark:text-gray-300",muted:"text-gray-600 dark:text-gray-400",strong:"text-gray-900 dark:text-gray-100 font-semibold"},k={default:"text-gray-900 dark:text-gray-100",muted:"text-gray-600 dark:text-gray-400",strong:"text-gray-900 dark:text-gray-100 font-semibold",primary:"text-blue-600 dark:text-blue-400"},S=y[s];return t.jsxs("div",{className:f(a==="horizontal"?"flex items-center":"flex flex-col",a==="horizontal"&&b[n],S.gap,l&&"pb-3 mb-3 border-b border-gray-200 dark:border-gray-700",i),children:[t.jsx("dt",{className:f(S.label,v[c],a==="horizontal"&&m[o],a==="horizontal"&&"flex-shrink-0",h),children:e}),t.jsx("dd",{className:f(S.value,k[d],a==="horizontal"&&"flex-1",u),children:r})]})},Hi=({value:e,label:r,variant:a="neutral",size:n="md",align:o="center",icon:s,iconPosition:l="top",className:c,valueClassName:d,labelClassName:i})=>{const h={primary:{value:"text-blue-600 dark:text-blue-400",label:"text-blue-600/70 dark:text-blue-400/70",icon:"text-blue-600 dark:text-blue-400"},success:{value:"text-green-600 dark:text-green-400",label:"text-green-600/70 dark:text-green-400/70",icon:"text-green-600 dark:text-green-400"},warning:{value:"text-yellow-600 dark:text-yellow-400",label:"text-yellow-600/70 dark:text-yellow-400/70",icon:"text-yellow-600 dark:text-yellow-400"},danger:{value:"text-red-600 dark:text-red-400",label:"text-red-600/70 dark:text-red-400/70",icon:"text-red-600 dark:text-red-400"},neutral:{value:"text-gray-900 dark:text-gray-100",label:"text-gray-600 dark:text-gray-400",icon:"text-gray-600 dark:text-gray-400"},white:{value:"text-white",label:"text-white/70",icon:"text-white"}},u={sm:{value:U.heading.h5(),label:U.caption.default(),icon:"h-4 w-4"},md:{value:U.heading.h4(),label:U.body.sm(),icon:"h-5 w-5"},lg:{value:U.heading.h3(),label:U.body.md(),icon:"h-6 w-6"},xl:{value:U.heading.h2(),label:U.body.lg(),icon:"h-8 w-8"}},y={left:"text-left",center:"text-center",right:"text-right"},m=h[a],b=u[n];return t.jsxs("div",{className:f(y[o],c),children:[s&&l==="top"&&t.jsx(s,{className:f(b.icon,m.icon,"mb-2",o==="center"&&"mx-auto")}),t.jsxs("div",{className:f(l==="left"&&s&&"flex items-center gap-3",o==="center"&&l==="left"&&"justify-center"),children:[s&&l==="left"&&t.jsx(s,{className:f(b.icon,m.icon)}),t.jsxs("div",{children:[t.jsx("div",{className:f("font-bold",b.value,m.value,d),children:e}),t.jsx("div",{className:f(b.label,m.label,i),children:r})]})]})]})},Qt=({icon:e,title:r="No data",description:a,action:n,className:o})=>t.jsxs("div",{className:f("flex flex-col items-center justify-center py-12 px-4 text-center",o),children:[e&&t.jsx("div",{className:"mb-4 text-gray-400 dark:text-gray-600",children:e}),t.jsx("h3",{className:f(U.heading.h3(),"mb-2"),children:r}),a&&t.jsx("p",{className:f(U.body.sm(),"text-gray-600 dark:text-gray-400 max-w-sm mb-6"),children:a}),n&&t.jsx("div",{className:"mt-4",children:n})]}),qi=({title:e,subtext:r,className:a})=>t.jsx(Qt,{title:e,description:r,className:a}),Gi=({data:e,orientation:r="vertical",showValues:a=!1,showGrid:n=!0,barWidth:o=40,height:s=300,className:l})=>{const c=Math.max(...e.map(i=>i.value)),d="#3b82f6";return t.jsx("div",{className:f("w-full",l),children:t.jsxs("div",{className:"relative bg-white dark:bg-gray-900 rounded-lg p-6",style:{height:`${s}px`},children:[n&&t.jsx("div",{className:"absolute inset-6 flex flex-col justify-between",children:[...Array(5)].map((i,h)=>t.jsx("div",{className:"border-t border-gray-200 dark:border-gray-700"},h))}),r==="vertical"?t.jsx("div",{className:"relative h-full flex items-end justify-around gap-2",children:e.map((i,h)=>{const u=i.value/c*100;return t.jsxs("div",{className:"flex flex-col items-center gap-2",style:{width:`${o}px`},children:[a&&t.jsx("span",{className:"text-xs text-gray-600 dark:text-gray-400",children:i.value}),t.jsx("div",{className:"w-full rounded-t transition-all hover:opacity-80",style:{height:`${u}%`,backgroundColor:i.color||d}}),t.jsx("span",{className:"text-xs text-gray-600 dark:text-gray-400",children:i.label})]},h)})}):t.jsx("div",{className:"relative h-full flex flex-col justify-around gap-2",children:e.map((i,h)=>{const u=i.value/c*100;return t.jsxs("div",{className:"flex items-center gap-4",children:[t.jsx("span",{className:"text-sm text-gray-600 dark:text-gray-400 w-16 text-right",children:i.label}),t.jsxs("div",{className:"flex-1 flex items-center gap-2",children:[t.jsx("div",{className:"h-8 rounded transition-all hover:opacity-80",style:{width:`${u}%`,backgroundColor:i.color||d}}),a&&t.jsx("span",{className:"text-xs text-gray-600 dark:text-gray-400",children:i.value})]})]},h)})})]})})},Yi=({series:e,showLegend:r=!0,showGrid:a=!0,showPoints:n=!0,height:o=300,xLabels:s,className:l})=>{const c=e.flatMap(m=>m.data),d=Math.max(...c.map(m=>m.y)),i=Math.min(...c.map(m=>m.y)),h=Math.max(...c.map(m=>m.x)),u=["#3b82f6","#10b981","#f59e0b","#ef4444","#8b5cf6"],y=m=>m.length===0?"":`M ${m.map(v=>{const k=v.x/h*100,S=100-(v.y-i)/(d-i)*100;return`${k},${S}`}).join(" L ")}`;return t.jsxs("div",{className:f("w-full",l),children:[r&&t.jsx("div",{className:"flex flex-wrap gap-4 mb-4",children:e.map((m,b)=>t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx("div",{className:"w-3 h-3 rounded-full",style:{backgroundColor:m.color||u[b%u.length]}}),t.jsx("span",{className:"text-sm text-gray-700 dark:text-gray-300",children:m.name})]},b))}),t.jsxs("div",{className:"bg-white dark:bg-gray-900 rounded-lg p-6",children:[t.jsxs("div",{className:"relative",style:{height:`${o}px`},children:[a&&t.jsx("div",{className:"absolute inset-0",children:[...Array(5)].map((m,b)=>t.jsx("div",{className:"absolute w-full border-t border-gray-200 dark:border-gray-700",style:{top:`${b*25}%`}},b))}),t.jsx("svg",{viewBox:"0 0 100 100",preserveAspectRatio:"none",className:"absolute inset-0 w-full h-full",children:e.map((m,b)=>{const v=m.color||u[b%u.length];return t.jsxs("g",{children:[t.jsx("path",{d:y(m.data),fill:"none",stroke:v,strokeWidth:"0.5",vectorEffect:"non-scaling-stroke"}),n&&m.data.map((k,S)=>{const x=k.x/h*100,N=100-(k.y-i)/(d-i)*100;return t.jsx("circle",{cx:x,cy:N,r:"1",fill:v,vectorEffect:"non-scaling-stroke"},S)})]},b)})})]}),s&&t.jsx("div",{className:"flex justify-between mt-2",children:s.map((m,b)=>t.jsx("span",{className:"text-xs text-gray-600 dark:text-gray-400",children:m},b))})]})]})},Ki=({data:e,variant:r="pie",showLegend:a=!0,showPercentages:n=!1,size:o=200,donutHoleSize:s=40,className:l})=>{const c=e.reduce((b,v)=>b+v.value,0),d=["#3b82f6","#10b981","#f59e0b","#ef4444","#8b5cf6","#ec4899"],i=e.reduce((b,v,k)=>{const S=v.value/c*100,x=S/100*360,N=b.length>0?b[b.length-1].endAngle:-90,w=N+x;return b.push({...v,percentage:S,startAngle:N,endAngle:w,color:v.color||d[k%d.length]}),b},[]),h=(b,v,k,S)=>{const x=(S-90)*Math.PI/180;return{x:b+k*Math.cos(x),y:v+k*Math.sin(x)}},u=(b,v,k,S,x)=>{const N=h(b,v,k,x),w=h(b,v,k,S),E=x-S<=180?"0":"1";if(r==="donut"){const A=k*s/100,C=h(b,v,A,x),I=h(b,v,A,S);return["M",N.x,N.y,"A",k,k,0,E,0,w.x,w.y,"L",I.x,I.y,"A",A,A,0,E,1,C.x,C.y,"Z"].join(" ")}return["M",b,v,"L",N.x,N.y,"A",k,k,0,E,0,w.x,w.y,"Z"].join(" ")},y=o/2,m=o/2-10;return t.jsxs("div",{className:f("flex flex-col items-center gap-4",l),children:[t.jsx("svg",{width:o,height:o,className:"transform rotate-0",children:i.map((b,v)=>t.jsx("path",{d:u(y,y,m,b.startAngle,b.endAngle),fill:b.color,className:"transition-opacity hover:opacity-80"},v))}),a&&t.jsx("div",{className:"flex flex-col gap-2",children:i.map((b,v)=>t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx("div",{className:"w-3 h-3 rounded-sm",style:{backgroundColor:b.color}}),t.jsxs("span",{className:"text-sm text-gray-700 dark:text-gray-300",children:[b.label,n&&t.jsxs("span",{className:"text-gray-500 dark:text-gray-400 ml-1",children:["(",Math.round(b.percentage),"%)"]})]})]},v))})]})},Xi=({series:e,showLegend:r=!0,showGrid:a=!0,fillOpacity:n=.2,height:o=300,xLabels:s,className:l})=>{const c=e.flatMap(b=>b.data),d=Math.max(...c.map(b=>b.y)),i=Math.min(...c.map(b=>b.y)),h=Math.max(...c.map(b=>b.x)),u=["#3b82f6","#10b981","#f59e0b","#ef4444","#8b5cf6"],y=b=>{if(b.length===0)return"";const v=b.map(x=>{const N=x.x/h*100,w=100-(x.y-i)/(d-i)*100;return`${N},${w}`}),k=b[0].x/h*100,S=b[b.length-1].x/h*100;return`M ${k},100 L ${v.join(" L ")} L ${S},100 Z`},m=b=>b.length===0?"":`M ${b.map(k=>{const S=k.x/h*100,x=100-(k.y-i)/(d-i)*100;return`${S},${x}`}).join(" L ")}`;return t.jsxs("div",{className:f("w-full",l),children:[r&&t.jsx("div",{className:"flex flex-wrap gap-4 mb-4",children:e.map((b,v)=>t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx("div",{className:"w-3 h-3 rounded-full",style:{backgroundColor:b.color||u[v%u.length]}}),t.jsx("span",{className:"text-sm text-gray-700 dark:text-gray-300",children:b.name})]},v))}),t.jsxs("div",{className:"bg-white dark:bg-gray-900 rounded-lg p-6",children:[t.jsxs("div",{className:"relative",style:{height:`${o}px`},children:[a&&t.jsx("div",{className:"absolute inset-0",children:[...Array(5)].map((b,v)=>t.jsx("div",{className:"absolute w-full border-t border-gray-200 dark:border-gray-700",style:{top:`${v*25}%`}},v))}),t.jsx("svg",{viewBox:"0 0 100 100",preserveAspectRatio:"none",className:"absolute inset-0 w-full h-full",children:e.map((b,v)=>{const k=b.color||u[v%u.length];return t.jsxs("g",{children:[t.jsx("path",{d:y(b.data),fill:k,fillOpacity:n}),t.jsx("path",{d:m(b.data),fill:"none",stroke:k,strokeWidth:"0.5",vectorEffect:"non-scaling-stroke"})]},v)})})]}),s&&t.jsx("div",{className:"flex justify-between mt-2",children:s.map((b,v)=>t.jsx("span",{className:"text-xs text-gray-600 dark:text-gray-400",children:b},v))})]})]})},Zi=({className:e,children:r,disabled:a=!1,onClick:n})=>t.jsx("div",{className:f("p-4 rounded-lg border transition-colors","bg-white dark:bg-gray-900","border-gray-200 dark:border-gray-700","text-gray-900 dark:text-white",a&&"opacity-50 cursor-not-allowed","hover:bg-gray-50 dark:hover:bg-gray-800",e),onClick:a?void 0:n,role:"region","aria-label":"UradarUchart",children:r||"UradarUchart Component"}),Ji=({className:e,children:r,disabled:a=!1,onClick:n})=>t.jsx("div",{className:f("p-4 rounded-lg border transition-colors","bg-white dark:bg-gray-900","border-gray-200 dark:border-gray-700","text-gray-900 dark:text-white",a&&"opacity-50 cursor-not-allowed","hover:bg-gray-50 dark:hover:bg-gray-800",e),onClick:a?void 0:n,role:"region","aria-label":"UbubbleUchart",children:r||"UbubbleUchart Component"}),Qi=({className:e,children:r,disabled:a=!1,onClick:n})=>t.jsx("div",{className:f("p-4 rounded-lg border transition-colors","bg-white dark:bg-gray-900","border-gray-200 dark:border-gray-700","text-gray-900 dark:text-white",a&&"opacity-50 cursor-not-allowed","hover:bg-gray-50 dark:hover:bg-gray-800",e),onClick:a?void 0:n,role:"region","aria-label":"UscatterUplot",children:r||"UscatterUplot Component"}),Ri=({className:e,children:r,disabled:a=!1,onClick:n})=>t.jsx("div",{className:f("p-4 rounded-lg border transition-colors","bg-white dark:bg-gray-900","border-gray-200 dark:border-gray-700","text-gray-900 dark:text-white",a&&"opacity-50 cursor-not-allowed","hover:bg-gray-50 dark:hover:bg-gray-800",e),onClick:a?void 0:n,role:"region","aria-label":"UtreeUmap",children:r||"UtreeUmap Component"}),ec=({className:e,children:r,disabled:a=!1,onClick:n})=>t.jsx("div",{className:f("p-4 rounded-lg border transition-colors","bg-white dark:bg-gray-900","border-gray-200 dark:border-gray-700","text-gray-900 dark:text-white",a&&"opacity-50 cursor-not-allowed","hover:bg-gray-50 dark:hover:bg-gray-800",e),onClick:a?void 0:n,role:"region","aria-label":"UsankeyUdiagram",children:r||"UsankeyUdiagram Component"}),rc=({data:e,width:r=100,height:a=30,color:n="#3b82f6",fill:o=!1,className:s})=>{if(e.length===0)return null;const l=Math.max(...e),c=Math.min(...e),d=l-c||1,i=e.map((h,u)=>{const y=u/(e.length-1)*r,m=a-(h-c)/d*a;return`${y},${m}`}).join(" ");return t.jsxs("svg",{width:r,height:a,className:f("inline-block",s),children:[o&&t.jsx("polygon",{points:`0,${a} ${i} ${r},${a}`,fill:n,opacity:"0.2"}),t.jsx("polyline",{points:i,fill:"none",stroke:n,strokeWidth:"2",strokeLinejoin:"round",strokeLinecap:"round"})]})},tc=({className:e,children:r,disabled:a=!1,onClick:n})=>t.jsx("div",{className:f("p-4 rounded-lg border transition-colors","bg-white dark:bg-gray-900","border-gray-200 dark:border-gray-700","text-gray-900 dark:text-white",a&&"opacity-50 cursor-not-allowed","hover:bg-gray-50 dark:hover:bg-gray-800",e),onClick:a?void 0:n,role:"region","aria-label":"Uheatmap",children:r||"Uheatmap Component"}),ac=({className:e,children:r,disabled:a=!1,onClick:n})=>t.jsx("div",{className:f("p-4 rounded-lg border transition-colors","bg-white dark:bg-gray-900","border-gray-200 dark:border-gray-700","text-gray-900 dark:text-white",a&&"opacity-50 cursor-not-allowed","hover:bg-gray-50 dark:hover:bg-gray-800",e),onClick:a?void 0:n,role:"region","aria-label":"UfunnelUchart",children:r||"UfunnelUchart Component"}),nc=({className:e,children:r,disabled:a})=>t.jsx("div",{className:f("p-4 rounded-lg border transition-colors","bg-white dark:bg-gray-900","border-gray-200 dark:border-gray-700","text-gray-900 dark:text-white",a&&"opacity-50 cursor-not-allowed",e),role:"region","aria-label":"BurndownChart",children:r||"BurndownChart Component"}),oc=({className:e,children:r,disabled:a=!1,onClick:n})=>t.jsx("div",{className:f("p-4 rounded-lg border transition-colors","bg-white dark:bg-gray-900","border-gray-200 dark:border-gray-700","text-gray-900 dark:text-white",a&&"opacity-50 cursor-not-allowed","hover:bg-gray-50 dark:hover:bg-gray-800",e),onClick:a?void 0:n,role:"region","aria-label":"UperformanceUchart",children:r||"UperformanceUchart Component"}),sc=({className:e,children:r,disabled:a=!1,onClick:n})=>t.jsx("div",{className:f("p-4 rounded-lg border transition-colors","bg-white dark:bg-gray-900","border-gray-200 dark:border-gray-700","text-gray-900 dark:text-white",a&&"opacity-50 cursor-not-allowed","hover:bg-gray-50 dark:hover:bg-gray-800",e),onClick:a?void 0:n,role:"region","aria-label":"UmetricUcomparison",children:r||"UmetricUcomparison Component"}),lc=({value:e,min:r=0,max:a=100,size:n=120,strokeWidth:o=10,showValue:s=!0,label:l,variant:c="primary",className:d})=>{const i=Math.min(a,Math.max(r,e)),h=(i-r)/(a-r)*100,u=n/2,y=(n-o)/2,m=Math.PI*y,b=m-h/100*m,v={primary:"stroke-blue-600 dark:stroke-blue-500",success:"stroke-green-600 dark:stroke-green-500",warning:"stroke-yellow-600 dark:stroke-yellow-500",danger:"stroke-red-600 dark:stroke-red-500"};return t.jsxs("div",{className:f("inline-flex flex-col items-center gap-2",d),children:[t.jsxs("svg",{width:n,height:n*.65,className:"transform rotate-180",children:[t.jsx("path",{d:`M ${o/2} ${u} A ${y} ${y} 0 0 1 ${n-o/2} ${u}`,fill:"none",className:"stroke-gray-200 dark:stroke-gray-700",strokeWidth:o,strokeLinecap:"round"}),t.jsx("path",{d:`M ${o/2} ${u} A ${y} ${y} 0 0 1 ${n-o/2} ${u}`,fill:"none",className:f(v[c],"transition-all duration-500"),strokeWidth:o,strokeDasharray:m,strokeDashoffset:b,strokeLinecap:"round"})]}),s&&t.jsxs("div",{className:"text-center -mt-8",children:[t.jsx("div",{className:"text-2xl font-bold text-gray-900 dark:text-white",children:Math.round(i)}),l&&t.jsx("div",{className:"text-xs text-gray-600 dark:text-gray-400",children:l})]})]})},ic=({value:e=0,max:r=100,variant:a="default",size:n="md",showLabel:o=!1,label:s,indeterminate:l=!1,striped:c=!1,animated:d=!1,className:i})=>{const h=Math.min(Math.max(e/r*100,0),100),u={default:"bg-blue-600 dark:bg-blue-500",success:"bg-green-600 dark:bg-green-500",warning:"bg-yellow-600 dark:bg-yellow-500",danger:"bg-red-600 dark:bg-red-500"},y={sm:"h-1",md:"h-2",lg:"h-4"};return t.jsxs("div",{className:f("w-full",i),children:[t.jsx("div",{className:f("w-full bg-gray-200 dark:bg-gray-700 rounded-full overflow-hidden",y[n]),role:"progressbar","aria-valuenow":l?void 0:h,"aria-valuemin":0,"aria-valuemax":100,children:l?t.jsx("div",{className:f("h-full rounded-full animate-pulse",u[a]),style:{width:"100%"}}):t.jsx("div",{className:f("h-full rounded-full transition-all duration-300",u[a],c&&"bg-stripe",c&&d&&"animate-stripe"),style:{width:`${h}%`}})}),(o||s)&&t.jsx("div",{className:"mt-1 text-xs text-gray-600 dark:text-gray-400 text-right",children:s||`${Math.round(h)}%`})]})},cc=({value:e,size:r=100,strokeWidth:a=8,showValue:n=!0,label:o,variant:s="primary",color:l,trackColor:c,className:d})=>{const i=Math.min(100,Math.max(0,e)),h=r/2,u=(r-a)/2,y=2*Math.PI*u,m=y-i/100*y,b={primary:"stroke-blue-600 dark:stroke-blue-500",success:"stroke-green-600 dark:stroke-green-500",warning:"stroke-yellow-600 dark:stroke-yellow-500",danger:"stroke-red-600 dark:stroke-red-500"},v=c||"stroke-gray-200 dark:stroke-gray-700";return t.jsx("div",{className:f("inline-flex items-center justify-center",d),children:t.jsxs("div",{className:"relative",style:{width:r,height:r},children:[t.jsxs("svg",{width:r,height:r,className:"transform -rotate-90",children:[t.jsx("circle",{cx:h,cy:h,r:u,className:v,strokeWidth:a,fill:"none"}),t.jsx("circle",{cx:h,cy:h,r:u,className:f(l?"":b[s],"transition-all duration-300 ease-in-out"),stroke:l,strokeWidth:a,strokeDasharray:y,strokeDashoffset:m,strokeLinecap:"round",fill:"none"})]}),(n||o)&&t.jsxs("div",{className:"absolute inset-0 flex flex-col items-center justify-center",children:[n&&!o&&t.jsxs("span",{className:"text-gray-900 dark:text-white font-bold",style:{fontSize:r*.2},children:[Math.round(i),"%"]}),o&&t.jsx("span",{className:"text-gray-900 dark:text-white font-medium text-center px-2",style:{fontSize:r*.15},children:o})]})]})})},dc=({className:e,children:r,disabled:a=!1,onClick:n})=>t.jsx("div",{className:f("p-4 rounded-lg border transition-colors","bg-white dark:bg-gray-900","border-gray-200 dark:border-gray-700","text-gray-900 dark:text-white",a&&"opacity-50 cursor-not-allowed","hover:bg-gray-50 dark:hover:bg-gray-800",e),onClick:a?void 0:n,role:"region","aria-label":"UprogressUtracker",children:r||"UprogressUtracker Component"}),gc=({src:e,alt:r,fallback:a,width:n,height:o,objectFit:s="cover",loading:l="lazy",showLoader:c=!0,rounded:d="none",border:i=!1,className:h,onLoad:u,onError:y})=>{const[m,b]=p.useState(!0),[v,k]=p.useState(!1),[S,x]=p.useState(e);p.useEffect(()=>{b(!0),k(!1),x(e)},[e]);const N=()=>{b(!1),u?.()},w=()=>{b(!1),k(!0),a&&S!==a&&(x(a),k(!1),b(!0)),y?.()},E={none:"",sm:"rounded-sm",md:"rounded-md",lg:"rounded-lg",full:"rounded-full"},A={contain:"object-contain",cover:"object-cover",fill:"object-fill",none:"object-none","scale-down":"object-scale-down"},C={width:typeof n=="number"?`${n}px`:n,height:typeof o=="number"?`${o}px`:o};return t.jsxs("div",{className:f("relative inline-block overflow-hidden bg-gray-100 dark:bg-gray-800",E[d],i&&"border border-gray-200 dark:border-gray-700",h),style:C,children:[c&&m&&t.jsx("div",{className:"absolute inset-0 flex items-center justify-center",children:t.jsx("div",{className:"animate-pulse",children:t.jsx(P.PhotoIcon,{className:"h-8 w-8 text-gray-400"})})}),v&&t.jsx("div",{className:"absolute inset-0 flex items-center justify-center",children:t.jsx(P.PhotoIcon,{className:"h-8 w-8 text-gray-400"})}),!v&&t.jsx("img",{src:S,alt:r,loading:l,onLoad:N,onError:w,className:f("w-full h-full",A[s],m&&c&&"opacity-0")})]})},uc=({images:e,columns:r=3,gap:a=16,lightbox:n=!0,className:o})=>{const[s,l]=p.useState(null),c=u=>{n&&l(u)},d=()=>{l(null)},i=()=>{if(!s)return;const u=e.findIndex(m=>m.id===s.id),y=u>0?u-1:e.length-1;l(e[y])},h=()=>{if(!s)return;const u=e.findIndex(m=>m.id===s.id),y=u<e.length-1?u+1:0;l(e[y])};return t.jsxs(t.Fragment,{children:[t.jsx("div",{className:f("grid",o),style:{gridTemplateColumns:`repeat(${r}, 1fr)`,gap:`${a}px`},children:e.map(u=>t.jsxs("div",{className:f("relative aspect-square overflow-hidden rounded-lg bg-gray-200 dark:bg-gray-700",n&&"cursor-pointer hover:opacity-90 transition-opacity"),onClick:()=>c(u),children:[t.jsx("img",{src:u.thumbnail||u.src,alt:u.alt||"",className:"w-full h-full object-cover"}),u.caption&&t.jsx("div",{className:"absolute bottom-0 left-0 right-0 bg-black/50 text-white text-sm p-2",children:u.caption})]},u.id))}),n&&s&&t.jsxs("div",{className:"fixed inset-0 z-50 bg-black/90 flex items-center justify-center p-4",onClick:d,children:[t.jsx("button",{onClick:d,className:"absolute top-4 right-4 text-white hover:text-gray-300 transition-colors",children:t.jsx("svg",{className:"w-8 h-8",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:t.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})}),t.jsx("button",{onClick:u=>{u.stopPropagation(),i()},className:"absolute left-4 text-white hover:text-gray-300 transition-colors",children:t.jsx("svg",{className:"w-8 h-8",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:t.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M15 19l-7-7 7-7"})})}),t.jsx("button",{onClick:u=>{u.stopPropagation(),h()},className:"absolute right-4 text-white hover:text-gray-300 transition-colors",children:t.jsx("svg",{className:"w-8 h-8",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:t.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 5l7 7-7 7"})})}),t.jsxs("div",{className:"max-w-4xl max-h-full",onClick:u=>u.stopPropagation(),children:[t.jsx("img",{src:s.src,alt:s.alt||"",className:"max-w-full max-h-[80vh] object-contain"}),s.caption&&t.jsx("p",{className:"text-white text-center mt-4",children:s.caption})]})]})]})},hc=({className:e,children:r,disabled:a=!1,onClick:n})=>t.jsx("div",{className:f("p-4 rounded-lg border transition-colors","bg-white dark:bg-gray-900","border-gray-200 dark:border-gray-700","text-gray-900 dark:text-white",a&&"opacity-50 cursor-not-allowed","hover:bg-gray-50 dark:hover:bg-gray-800",e),onClick:a?void 0:n,role:"region","aria-label":"UimageUcomparison",children:r||"UimageUcomparison Component"}),fc=({src:e,onCropComplete:r,initialCrop:a,className:n})=>{const[o,s]=p.useState(a||{x:50,y:50,width:200,height:200}),l=p.useRef(null),c=async()=>{if(!l.current||!r)return;const d=document.createElement("canvas"),i=d.getContext("2d");if(!i)return;const h=l.current,u=h.naturalWidth/h.width,y=h.naturalHeight/h.height;d.width=o.width*u,d.height=o.height*y,i.drawImage(h,o.x*u,o.y*y,o.width*u,o.height*y,0,0,d.width,d.height);const m=d.toDataURL("image/png");r(m,o)};return t.jsxs("div",{className:f("inline-flex flex-col gap-4",n),children:[t.jsxs("div",{className:"relative inline-block",children:[t.jsx("img",{ref:l,src:e,alt:"Crop preview",className:"max-w-full h-auto",crossOrigin:"anonymous"}),t.jsxs("div",{className:"absolute border-2 border-blue-500 bg-blue-500/20",style:{left:`${o.x}px`,top:`${o.y}px`,width:`${o.width}px`,height:`${o.height}px`,cursor:"move"},children:[t.jsx("div",{className:"absolute -top-1 -left-1 w-3 h-3 bg-blue-500 rounded-full cursor-nw-resize"}),t.jsx("div",{className:"absolute -top-1 -right-1 w-3 h-3 bg-blue-500 rounded-full cursor-ne-resize"}),t.jsx("div",{className:"absolute -bottom-1 -left-1 w-3 h-3 bg-blue-500 rounded-full cursor-sw-resize"}),t.jsx("div",{className:"absolute -bottom-1 -right-1 w-3 h-3 bg-blue-500 rounded-full cursor-se-resize"})]})]}),t.jsxs("div",{className:"flex gap-2",children:[t.jsx("button",{onClick:c,className:f("px-4 py-2 text-sm font-medium","bg-blue-600 dark:bg-blue-500 text-white","rounded-md","hover:bg-blue-700 dark:hover:bg-blue-600","transition-colors"),children:"Crop Image"}),t.jsx("button",{onClick:()=>s(a||{x:50,y:50,width:200,height:200}),className:f("px-4 py-2 text-sm font-medium","bg-gray-200 dark:bg-gray-700 text-gray-900 dark:text-white","rounded-md","hover:bg-gray-300 dark:hover:bg-gray-600","transition-colors"),children:"Reset"})]}),t.jsx("p",{className:"text-xs text-gray-600 dark:text-gray-400",children:'Drag to adjust crop area. Click "Crop Image" to export.'})]})},bc=({images:e,index:r,isOpen:a,onClose:n,onIndexChange:o,showThumbnails:s=!1,showDownload:l=!1,showZoom:c=!0,className:d})=>{const[i,h]=p.useState(1),u=e[r],y=r>0,m=r<e.length-1,b=p.useCallback(()=>{if(y){const w=r-1;o?.(w),h(1)}},[y,r,o]),v=p.useCallback(()=>{if(m){const w=r+1;o?.(w),h(1)}},[m,r,o]),k=()=>{h(w=>Math.min(w+.5,3))},S=()=>{h(w=>Math.max(w-.5,.5))},x=()=>{h(1)},N=()=>{const w=document.createElement("a");w.href=u.src,w.download=u.alt||"image",w.click()};return p.useEffect(()=>{if(!a)return;const w=E=>{switch(E.key){case"Escape":n();break;case"ArrowLeft":b();break;case"ArrowRight":v();break;case"+":case"=":k();break;case"-":case"_":S();break;case"0":x();break}};return document.addEventListener("keydown",w),()=>document.removeEventListener("keydown",w)},[a,r,e.length,n,b,v]),p.useEffect(()=>(a?document.body.style.overflow="hidden":document.body.style.overflow="",()=>{document.body.style.overflow=""}),[a]),p.useEffect(()=>{h(1)},[r]),!a||!u?null:t.jsx(be,{children:t.jsxs("div",{className:f("fixed inset-0 z-50 flex items-center justify-center","bg-black/95",d),children:[t.jsx("div",{className:"absolute inset-0",onClick:n,"aria-label":"Close lightbox"}),t.jsx("button",{onClick:n,className:"absolute top-4 right-4 z-10 p-2 text-white hover:text-gray-300 transition-colors","aria-label":"Close",children:t.jsx("svg",{className:"w-8 h-8",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:t.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})}),y&&t.jsx("button",{onClick:b,className:"absolute left-4 top-1/2 -translate-y-1/2 z-10 p-3 text-white hover:text-gray-300 bg-black/50 hover:bg-black/70 rounded-full transition-all","aria-label":"Previous image",children:t.jsx("svg",{className:"w-6 h-6",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:t.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M15 19l-7-7 7-7"})})}),m&&t.jsx("button",{onClick:v,className:"absolute right-4 top-1/2 -translate-y-1/2 z-10 p-3 text-white hover:text-gray-300 bg-black/50 hover:bg-black/70 rounded-full transition-all","aria-label":"Next image",children:t.jsx("svg",{className:"w-6 h-6",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:t.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 5l7 7-7 7"})})}),t.jsxs("div",{className:"absolute top-4 left-4 z-10 flex gap-2",children:[t.jsxs("div",{className:"px-3 py-1.5 bg-black/50 text-white text-sm rounded-md",children:[r+1," / ",e.length]}),c&&t.jsxs("div",{className:"flex gap-1 bg-black/50 rounded-md p-1",children:[t.jsx("button",{onClick:S,className:"p-1.5 text-white hover:text-gray-300 transition-colors","aria-label":"Zoom out",children:t.jsx("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:t.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0zM13 10H7"})})}),t.jsxs("button",{onClick:x,className:"px-2 text-white text-sm hover:text-gray-300 transition-colors","aria-label":"Reset zoom",children:[Math.round(i*100),"%"]}),t.jsx("button",{onClick:k,className:"p-1.5 text-white hover:text-gray-300 transition-colors","aria-label":"Zoom in",children:t.jsx("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:t.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0zM10 7v3m0 0v3m0-3h3m-3 0H7"})})})]}),l&&t.jsx("button",{onClick:N,className:"p-1.5 bg-black/50 text-white hover:text-gray-300 rounded-md transition-colors","aria-label":"Download image",children:t.jsx("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:t.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M4 16v1a3 3 0 003 3h10a3 3 0 003-3v-1m-4-4l-4 4m0 0l-4-4m4 4V4"})})})]}),t.jsx("div",{className:"relative z-0 flex items-center justify-center max-w-7xl max-h-screen p-20",children:t.jsx("img",{src:u.src,alt:u.alt||"",className:"max-w-full max-h-full object-contain transition-transform",style:{transform:`scale(${i})`}})}),u.caption&&t.jsx("div",{className:"absolute bottom-20 left-0 right-0 z-10 text-center",children:t.jsx("p",{className:"px-4 py-2 bg-black/50 text-white text-sm inline-block rounded-md max-w-2xl",children:u.caption})}),s&&e.length>1&&t.jsx("div",{className:"absolute bottom-4 left-0 right-0 z-10 flex justify-center gap-2 px-4 overflow-x-auto",children:e.map((w,E)=>t.jsx("button",{onClick:()=>{o?.(E),h(1)},className:f("flex-shrink-0 w-16 h-16 rounded-md overflow-hidden","border-2 transition-all",E===r?"border-white scale-110":"border-transparent opacity-60 hover:opacity-100 hover:border-gray-400"),children:t.jsx("img",{src:w.thumbnail||w.src,alt:w.alt||"",className:"w-full h-full object-cover"})},E))})]})})},mc=({src:e,alt:r,scale:a=2,className:n,containerClassName:o,onLoad:s,onError:l})=>{const[c,d]=p.useState(null),i=u=>{const y=u.currentTarget;d({width:Math.round(y.naturalWidth/a),height:Math.round(y.naturalHeight/a)}),s?.()},h=u=>{l?.()};return t.jsx("img",{src:e,alt:r,className:f("max-w-full h-auto",n),onLoad:i,onError:h,width:c?.width,height:c?.height,style:c?void 0:{visibility:"hidden"}})},yc=({src:e,poster:r,autoPlay:a=!1,loop:n=!1,muted:o=!1,controls:s=!0,className:l})=>{const c=p.useRef(null),[d,i]=p.useState(a),[h,u]=p.useState(1),[y,m]=p.useState(0),[b,v]=p.useState(0);p.useEffect(()=>{const E=c.current;if(!E)return;const A=()=>m(E.currentTime),C=()=>v(E.duration),I=()=>i(!0),L=()=>i(!1);return E.addEventListener("timeupdate",A),E.addEventListener("loadedmetadata",C),E.addEventListener("play",I),E.addEventListener("pause",L),()=>{E.removeEventListener("timeupdate",A),E.removeEventListener("loadedmetadata",C),E.removeEventListener("play",I),E.removeEventListener("pause",L)}},[]);const k=()=>{c.current&&(d?c.current.pause():c.current.play())},S=E=>{const A=parseFloat(E.target.value);u(A),c.current&&(c.current.volume=A)},x=E=>{const A=parseFloat(E.target.value);m(A),c.current&&(c.current.currentTime=A)},N=()=>{c.current&&(document.fullscreenElement?document.exitFullscreen():c.current.requestFullscreen())},w=E=>{const A=Math.floor(E/60),C=Math.floor(E%60);return`${A}:${C.toString().padStart(2,"0")}`};return t.jsxs("div",{className:f("relative group",l),children:[t.jsx("video",{ref:c,src:e,poster:r,autoPlay:a,loop:n,muted:o,className:"w-full rounded-lg",onClick:k}),s&&t.jsxs("div",{className:"absolute bottom-0 left-0 right-0 bg-gradient-to-t from-black/70 to-transparent p-4 opacity-0 group-hover:opacity-100 transition-opacity",children:[t.jsx("input",{type:"range",min:"0",max:b||0,value:y,onChange:x,className:"w-full mb-2 accent-white"}),t.jsxs("div",{className:"flex items-center justify-between gap-4",children:[t.jsxs("div",{className:"flex items-center gap-3",children:[t.jsx("button",{onClick:k,className:"text-white hover:text-gray-300 transition-colors",children:d?t.jsx("svg",{className:"w-6 h-6",fill:"currentColor",viewBox:"0 0 24 24",children:t.jsx("path",{d:"M6 4h4v16H6V4zm8 0h4v16h-4V4z"})}):t.jsx("svg",{className:"w-6 h-6",fill:"currentColor",viewBox:"0 0 24 24",children:t.jsx("path",{d:"M8 5v14l11-7z"})})}),t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx("svg",{className:"w-4 h-4 text-white",fill:"currentColor",viewBox:"0 0 24 24",children:t.jsx("path",{d:"M3 9v6h4l5 5V4L7 9H3zm13.5 3c0-1.77-1.02-3.29-2.5-4.03v8.05c1.48-.73 2.5-2.25 2.5-4.02z"})}),t.jsx("input",{type:"range",min:"0",max:"1",step:"0.1",value:h,onChange:S,className:"w-20 accent-white"})]}),t.jsxs("span",{className:"text-white text-sm",children:[w(y)," / ",w(b)]})]}),t.jsx("button",{onClick:N,className:"text-white hover:text-gray-300 transition-colors",children:t.jsx("svg",{className:"w-5 h-5",fill:"currentColor",viewBox:"0 0 24 24",children:t.jsx("path",{d:"M7 14H5v5h5v-2H7v-3zm-2-4h2V7h3V5H5v5zm12 7h-3v2h5v-5h-2v3zM14 5v2h3v3h2V5h-5z"})})})]})]})]})},pc=({className:e,children:r,disabled:a=!1,onClick:n})=>t.jsx("div",{className:f("p-4 rounded-lg border transition-colors","bg-white dark:bg-gray-900","border-gray-200 dark:border-gray-700","text-gray-900 dark:text-white",a&&"opacity-50 cursor-not-allowed","hover:bg-gray-50 dark:hover:bg-gray-800",e),onClick:a?void 0:n,role:"region","aria-label":"UvideoUthumbnail",children:r||"UvideoUthumbnail Component"}),vc=({className:e,children:r,disabled:a})=>t.jsx("div",{className:f("p-4 rounded-lg border transition-colors","bg-white dark:bg-gray-900","border-gray-200 dark:border-gray-700","text-gray-900 dark:text-white",a&&"opacity-50 cursor-not-allowed",e),role:"region","aria-label":"VideoEditor",children:r||"VideoEditor Component"}),kc=({className:e,children:r,disabled:a=!1,onClick:n})=>t.jsx("div",{className:f("p-4 rounded-lg border transition-colors","bg-white dark:bg-gray-900","border-gray-200 dark:border-gray-700","text-gray-900 dark:text-white",a&&"opacity-50 cursor-not-allowed","hover:bg-gray-50 dark:hover:bg-gray-800",e),onClick:a?void 0:n,role:"region","aria-label":"UvideoUcall",children:r||"UvideoUcall Component"}),xc=({className:e,children:r,disabled:a})=>t.jsx("div",{className:f("p-4 rounded-lg border transition-colors","bg-white dark:bg-gray-900","border-gray-200 dark:border-gray-700","text-gray-900 dark:text-white",a&&"opacity-50 cursor-not-allowed",e),role:"region","aria-label":"LiveStream",children:r||"LiveStream Component"}),wc=({src:e,title:r,artist:a,artwork:n,autoPlay:o=!1,loop:s=!1,className:l})=>{const c=p.useRef(null),[d,i]=p.useState(o),[h,u]=p.useState(0),[y,m]=p.useState(0),[b,v]=p.useState(1);p.useEffect(()=>{const E=c.current;if(!E)return;const A=()=>u(E.currentTime),C=()=>m(E.duration),I=()=>i(!0),L=()=>i(!1),O=()=>i(!1);return E.addEventListener("timeupdate",A),E.addEventListener("loadedmetadata",C),E.addEventListener("play",I),E.addEventListener("pause",L),E.addEventListener("ended",O),()=>{E.removeEventListener("timeupdate",A),E.removeEventListener("loadedmetadata",C),E.removeEventListener("play",I),E.removeEventListener("pause",L),E.removeEventListener("ended",O)}},[]);const k=()=>{c.current&&(d?c.current.pause():c.current.play())},S=E=>{const A=parseFloat(E.target.value);u(A),c.current&&(c.current.currentTime=A)},x=E=>{const A=parseFloat(E.target.value);v(A),c.current&&(c.current.volume=A)},N=E=>{const A=Math.floor(E/60),C=Math.floor(E%60);return`${A}:${C.toString().padStart(2,"0")}`},w=y>0?h/y*100:0;return t.jsxs("div",{className:f("bg-white dark:bg-gray-900 rounded-lg p-6 shadow-lg",l),children:[t.jsx("audio",{ref:c,src:e,autoPlay:o,loop:s}),t.jsxs("div",{className:"flex items-center gap-4 mb-4",children:[n&&t.jsx("div",{className:"w-16 h-16 rounded-lg overflow-hidden flex-shrink-0 bg-gray-200 dark:bg-gray-700",children:t.jsx("img",{src:n,alt:r||"Album artwork",className:"w-full h-full object-cover"})}),t.jsxs("div",{className:"flex-1 min-w-0",children:[r&&t.jsx("h4",{className:"font-semibold text-gray-900 dark:text-white truncate",children:r}),a&&t.jsx("p",{className:"text-sm text-gray-600 dark:text-gray-400 truncate",children:a})]})]}),t.jsxs("div",{className:"mb-4",children:[t.jsx("input",{type:"range",min:"0",max:y||0,value:h,onChange:S,className:"w-full accent-blue-500"}),t.jsxs("div",{className:"flex justify-between text-xs text-gray-600 dark:text-gray-400 mt-1",children:[t.jsx("span",{children:N(h)}),t.jsx("span",{children:N(y)})]})]}),t.jsxs("div",{className:"flex items-center justify-between",children:[t.jsxs("div",{className:"flex items-center gap-4",children:[t.jsx("button",{onClick:k,className:"w-10 h-10 rounded-full bg-blue-500 text-white flex items-center justify-center hover:bg-blue-600 transition-colors",children:d?t.jsx("svg",{className:"w-5 h-5",fill:"currentColor",viewBox:"0 0 24 24",children:t.jsx("path",{d:"M6 4h4v16H6V4zm8 0h4v16h-4V4z"})}):t.jsx("svg",{className:"w-5 h-5 ml-0.5",fill:"currentColor",viewBox:"0 0 24 24",children:t.jsx("path",{d:"M8 5v14l11-7z"})})}),t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx("svg",{className:"w-4 h-4 text-gray-600 dark:text-gray-400",fill:"currentColor",viewBox:"0 0 24 24",children:t.jsx("path",{d:"M3 9v6h4l5 5V4L7 9H3zm13.5 3c0-1.77-1.02-3.29-2.5-4.03v8.05c1.48-.73 2.5-2.25 2.5-4.02z"})}),t.jsx("input",{type:"range",min:"0",max:"1",step:"0.1",value:b,onChange:x,className:"w-24 accent-blue-500"})]})]}),t.jsxs("span",{className:"text-sm text-gray-600 dark:text-gray-400",children:[w.toFixed(0),"%"]})]})]})},Nc=({className:e,children:r,disabled:a=!1,onClick:n})=>t.jsx("div",{className:f("p-4 rounded-lg border transition-colors","bg-white dark:bg-gray-900","border-gray-200 dark:border-gray-700","text-gray-900 dark:text-white",a&&"opacity-50 cursor-not-allowed","hover:bg-gray-50 dark:hover:bg-gray-800",e),onClick:a?void 0:n,role:"region","aria-label":"UaudioUwaveform",children:r||"UaudioUwaveform Component"}),Cc=({data:e,width:r=200,height:a=40,color:n="#3b82f6",gap:o=2,className:s})=>{if(e.length===0)return null;const l=(r-(e.length-1)*o)/e.length;return t.jsx("svg",{width:r,height:a,className:f("inline-block",s),children:e.map((c,d)=>{const i=Math.max(2,c*a),h=d*(l+o),u=(a-i)/2;return t.jsx("rect",{x:h,y:u,width:l,height:i,fill:n,rx:l/2},d)})})},Sc=({className:e,children:r,disabled:a=!1,onClick:n})=>t.jsx("div",{className:f("p-4 rounded-lg border transition-colors","bg-white dark:bg-gray-900","border-gray-200 dark:border-gray-700","text-gray-900 dark:text-white",a&&"opacity-50 cursor-not-allowed","hover:bg-gray-50 dark:hover:bg-gray-800",e),onClick:a?void 0:n,role:"region","aria-label":"UvoiceUrecorder",children:r||"UvoiceUrecorder Component"}),Ec=({className:e,children:r,disabled:a})=>t.jsx("div",{className:f("p-4 rounded-lg border transition-colors","bg-white dark:bg-gray-900","border-gray-200 dark:border-gray-700","text-gray-900 dark:text-white",a&&"opacity-50 cursor-not-allowed",e),role:"region","aria-label":"PodcastPlayer",children:r||"PodcastPlayer Component"}),Ac=({accept:e=["image/*","video/*","audio/*"],maxSize:r=50*1024*1024,maxFiles:a=10,multiple:n=!0,onUpload:o,onRemove:s,className:l})=>{const[c,d]=p.useState([]),[i,h]=p.useState(!1),u=p.useRef(null),y=N=>{N.preventDefault(),h(!0)},m=N=>{N.preventDefault(),h(!1)},b=N=>{N.preventDefault(),h(!1);const w=Array.from(N.dataTransfer.files);k(w)},v=N=>{if(N.target.files){const w=Array.from(N.target.files);k(w)}},k=N=>{const w=N.filter(I=>{const L=e.some(M=>{if(M.endsWith("/*")){const D=M.split("/")[0];return I.type.startsWith(D)}return I.type===M}),O=I.size<=r;return L&&O}),E=a-c.length,A=w.slice(0,E),C=A.map(I=>({id:`${Date.now()}-${Math.random()}`,file:I,preview:I.type.startsWith("image/")?URL.createObjectURL(I):void 0,status:"pending"}));d(I=>[...I,...C]),o&&o(A)},S=N=>{d(w=>w.filter(E=>E.id!==N)),s&&s(N)},x=N=>N<1024?`${N} B`:N<1024*1024?`${(N/1024).toFixed(1)} KB`:`${(N/(1024*1024)).toFixed(1)} MB`;return t.jsxs("div",{className:f("space-y-4",l),children:[t.jsxs("div",{onDragEnter:y,onDragOver:N=>N.preventDefault(),onDragLeave:m,onDrop:b,onClick:()=>u.current?.click(),className:f("border-2 border-dashed rounded-lg p-8 text-center cursor-pointer transition-colors",i?"border-blue-500 bg-blue-50 dark:bg-blue-900/20":"border-gray-300 dark:border-gray-700 hover:border-gray-400 dark:hover:border-gray-600"),children:[t.jsx("svg",{className:"w-12 h-12 mx-auto mb-4 text-gray-400 dark:text-gray-600",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:t.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M7 16a4 4 0 01-.88-7.903A5 5 0 1115.9 6L16 6a5 5 0 011 9.9M15 13l-3-3m0 0l-3 3m3-3v12"})}),t.jsx("p",{className:"text-gray-700 dark:text-gray-300 mb-2",children:"Drag and drop files here, or click to browse"}),t.jsxs("p",{className:"text-sm text-gray-500 dark:text-gray-400",children:["Max ",a," files, ",x(r)," each"]}),t.jsx("input",{ref:u,type:"file",multiple:n,accept:e.join(","),onChange:v,className:"hidden"})]}),c.length>0&&t.jsx("div",{className:"grid grid-cols-2 md:grid-cols-3 lg:grid-cols-4 gap-4",children:c.map(N=>t.jsxs("div",{className:"relative aspect-square rounded-lg overflow-hidden bg-gray-100 dark:bg-gray-800",children:[N.preview?t.jsx("img",{src:N.preview,alt:N.file.name,className:"w-full h-full object-cover"}):t.jsx("div",{className:"w-full h-full flex items-center justify-center",children:t.jsx("svg",{className:"w-12 h-12 text-gray-400",fill:"currentColor",viewBox:"0 0 24 24",children:t.jsx("path",{d:"M14 2H6a2 2 0 00-2 2v16a2 2 0 002 2h12a2 2 0 002-2V8l-6-6zm4 18H6V4h7v5h5v11z"})})}),t.jsx("button",{onClick:()=>S(N.id),className:"absolute top-2 right-2 w-6 h-6 rounded-full bg-red-500 text-white flex items-center justify-center hover:bg-red-600 transition-colors",children:t.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:t.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})}),t.jsxs("div",{className:"absolute bottom-0 left-0 right-0 bg-black/70 text-white text-xs p-2",children:[t.jsx("p",{className:"truncate",children:N.file.name}),t.jsx("p",{className:"text-gray-300",children:x(N.file.size)})]})]},N.id))})]})},Tc=({className:e,children:r,disabled:a=!1,onClick:n})=>t.jsx("div",{className:f("p-4 rounded-lg border transition-colors","bg-white dark:bg-gray-900","border-gray-200 dark:border-gray-700","text-gray-900 dark:text-white",a&&"opacity-50 cursor-not-allowed","hover:bg-gray-50 dark:hover:bg-gray-800",e),onClick:a?void 0:n,role:"region","aria-label":"UmediaUplaylist",children:r||"UmediaUplaylist Component"}),Ic=({className:e,children:r,disabled:a})=>t.jsx("div",{className:f("p-4 rounded-lg border transition-colors","bg-white dark:bg-gray-900","border-gray-200 dark:border-gray-700","text-gray-900 dark:text-white",a&&"opacity-50 cursor-not-allowed",e),role:"region","aria-label":"PlaylistManager",children:r||"PlaylistManager Component"}),Lc=({value:e,size:r=200,fgColor:a="#000000",bgColor:n="#ffffff",showDownload:o=!1,className:s})=>{const l=p.useRef(null);p.useEffect(()=>{const d=l.current;if(!d)return;const i=d.getContext("2d");if(!i)return;i.fillStyle=n,i.fillRect(0,0,r,r),i.fillStyle=a;const h=8,u=r/h,y=e.split("").reduce((b,v)=>b+v.charCodeAt(0),0);for(let b=0;b<h;b++)for(let v=0;v<h;v++)(y+b*h+v)%3!==0&&i.fillRect(v*u,b*u,u,u);const m=u*3;[[0,0],[r-m,0],[0,r-m]].forEach(([b,v])=>{i.strokeStyle=a,i.lineWidth=u,i.strokeRect(b+u/2,v+u/2,m-u,m-u)})},[e,r,a,n]);const c=()=>{const d=l.current;if(!d)return;const i=d.toDataURL("image/png"),h=document.createElement("a");h.download="qrcode.png",h.href=i,h.click()};return t.jsxs("div",{className:f("inline-flex flex-col items-center gap-3",s),children:[t.jsx("canvas",{ref:l,width:r,height:r,className:"border-2 border-gray-200 dark:border-gray-700 rounded-lg"}),o&&t.jsx("button",{onClick:c,className:f("px-4 py-2 text-sm font-medium","bg-blue-600 dark:bg-blue-500 text-white","rounded-md","hover:bg-blue-700 dark:hover:bg-blue-600","transition-colors"),children:"Download QR Code"}),t.jsx("p",{className:"text-xs text-gray-600 dark:text-gray-400 max-w-[200px] text-center break-all",children:e})]})},Mr=({isOpen:e,onClose:r,title:a,size:n="medium",variant:o="default",overlay:s="default",showCloseButton:l=!0,closeOnOverlayClick:c=!0,closeOnEscape:d=!0,children:i,className:h,"aria-labelledby":u,"aria-describedby":y,closeAriaLabel:m="Close modal"})=>{const b=p.useRef(null),v=p.useRef(null);if(p.useEffect(()=>{if(!e||!d)return;const N=w=>{w.key==="Escape"&&r()};return document.addEventListener("keydown",N),()=>document.removeEventListener("keydown",N)},[e,d,r]),p.useEffect(()=>{if(e)return v.current=document.activeElement,b.current&&b.current.focus(),document.body.style.overflow="hidden",()=>{document.body.style.overflow="unset",v.current&&v.current.focus()}},[e]),!e)return null;const k=()=>{const N=j.overlays.modal.content(),w=j.overlays.modal[n]();return f(N,w)},S=N=>{c&&N.target===N.currentTarget&&r()},x=t.jsxs(t.Fragment,{children:[t.jsx("div",{className:j.overlays.modal.backdrop(),onClick:S}),t.jsx("div",{className:j.overlays.modal.container(),role:"dialog","aria-modal":"true","aria-labelledby":u,"aria-describedby":y,children:t.jsxs("div",{ref:b,"data-testid":"modal-content",className:f(k(),h),tabIndex:-1,onClick:N=>N.stopPropagation(),children:[a&&t.jsxs("div",{className:j.overlays.modal.header(),children:[t.jsx("h2",{id:u,className:j.overlays.modal.title(),children:a}),l&&t.jsx("button",{onClick:r,className:j.overlays.modal.closeButton(),"aria-label":m,children:t.jsx(P.XMarkIcon,{className:j.icon.variant.muted.md()})})]}),i]})})]});return hr.createPortal(x,document.body)},Mc=({children:e,variant:r="default",className:a})=>t.jsx("div",{"data-testid":"modal-header",className:f(j.overlays.modal.header(),a),children:e}),Pr=({children:e,variant:r="default",className:a})=>t.jsx("div",{"data-testid":"modal-body",className:f(j.overlays.modal.body(),a),children:e}),Or=({children:e,variant:r="default",className:a})=>t.jsx("div",{"data-testid":"modal-footer",className:f(j.overlays.modal.footer(),a),children:e}),Pc=({isOpen:e,onClose:r,children:a,side:n="right",size:o="md",showCloseButton:s=!0,title:l,footer:c,className:d})=>{if(p.useEffect(()=>{const y=m=>{m.key==="Escape"&&e&&r()};if(e)return document.addEventListener("keydown",y),()=>document.removeEventListener("keydown",y)},[e,r]),!e)return null;const i={left:{sm:"w-64",md:"w-80",lg:"w-96",full:"w-full"},right:{sm:"w-64",md:"w-80",lg:"w-96",full:"w-full"},top:{sm:"h-64",md:"h-80",lg:"h-96",full:"h-full"},bottom:{sm:"h-64",md:"h-80",lg:"h-96",full:"h-full"}},h={left:"left-0 top-0 h-full",right:"right-0 top-0 h-full",top:"top-0 left-0 w-full",bottom:"bottom-0 left-0 w-full"},u={left:e?"translate-x-0":"-translate-x-full",right:e?"translate-x-0":"translate-x-full",top:e?"translate-y-0":"-translate-y-full",bottom:e?"translate-y-0":"translate-y-full"};return t.jsxs(be,{children:[t.jsx(Ze,{isOpen:e,onClose:r,opacity:"medium"}),t.jsxs("div",{className:f("fixed z-50","bg-white dark:bg-gray-900","shadow-xl","transition-transform duration-300 ease-in-out",h[n],i[n][o],u[n],d),children:[(l||s)&&t.jsxs("div",{className:"flex items-center justify-between px-6 py-4 border-b border-gray-200 dark:border-gray-700",children:[l&&t.jsx("h2",{className:"text-lg font-semibold text-gray-900 dark:text-white",children:l}),s&&t.jsx("button",{onClick:r,className:"text-gray-500 hover:text-gray-700 dark:text-gray-400 dark:hover:text-gray-200 transition-colors","aria-label":"Close drawer",children:t.jsx("svg",{className:"w-6 h-6",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:t.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})})]}),t.jsx("div",{className:"flex-1 overflow-y-auto p-6",children:a}),c&&t.jsx("div",{className:"px-6 py-4 border-t border-gray-200 dark:border-gray-700",children:c})]})]})},Oc=({children:e,active:r=!0,initialFocus:a,returnFocus:n=!0,className:o})=>{const s=p.useRef(null),l=p.useRef(null);return p.useEffect(()=>{if(!r)return;n&&(l.current=document.activeElement);const c=()=>{if(!s.current)return[];const u=["a[href]","button:not([disabled])","textarea:not([disabled])","input:not([disabled])","select:not([disabled])",'[tabindex]:not([tabindex="-1"])'].join(",");return Array.from(s.current.querySelectorAll(u))},d=()=>{if(a){const y=s.current?.querySelector(a);if(y){y.focus();return}}const u=c();u.length>0&&u[0].focus()},i=u=>{if(u.key!=="Tab")return;const y=c();if(y.length===0){u.preventDefault();return}const m=y[0],b=y[y.length-1];u.shiftKey?document.activeElement===m&&(u.preventDefault(),b.focus()):document.activeElement===b&&(u.preventDefault(),m.focus())},h=setTimeout(d,0);return document.addEventListener("keydown",i),()=>{clearTimeout(h),document.removeEventListener("keydown",i),n&&l.current&&l.current.focus()}},[r,a,n]),r?t.jsx("div",{ref:s,className:f(o),children:e}):t.jsx(t.Fragment,{children:e})},Uc=({children:e,onLoadMore:r,loading:a=!1,hasMore:n=!0,threshold:o=100,loader:s,endMessage:l,height:c,scrollDirection:d="vertical",reverse:i=!1,className:h})=>{const u=p.useRef(null),[y,m]=p.useState(!1);p.useEffect(()=>{const S=u.current;if(!S||a||!n)return;const x=()=>{const{scrollTop:N,scrollHeight:w,clientHeight:E,scrollLeft:A,scrollWidth:C,clientWidth:I}=S;d==="vertical"&&m(N>300);let L;d==="vertical"?i?L=N:L=w-N-E:i?L=A:L=C-A-I,L<o&&r()};return S.addEventListener("scroll",x),()=>S.removeEventListener("scroll",x)},[a,n,o,r,d,i]);const b=()=>{u.current?.scrollTo({top:0,behavior:"smooth"})},v=t.jsxs("div",{className:"flex justify-center items-center py-4",children:[t.jsx("div",{className:"w-6 h-6 border-2 border-blue-600 dark:border-blue-400 border-t-transparent rounded-full animate-spin"}),t.jsx("span",{className:"ml-2 text-sm text-gray-600 dark:text-gray-400",children:"Loading..."})]}),k=t.jsx("div",{className:"flex justify-center items-center py-4",children:t.jsx("span",{className:"text-sm text-gray-600 dark:text-gray-400",children:"No more items to load"})});return t.jsxs("div",{className:f("relative",h),children:[t.jsxs("div",{ref:u,className:f(d==="vertical"?"overflow-y-auto":"overflow-x-auto","overflow-auto"),style:{height:d==="vertical"?c:void 0,width:d==="horizontal"?"100%":void 0,display:d==="horizontal"?"flex":void 0,flexDirection:i&&d==="vertical"?"column-reverse":void 0},children:[i&&a&&(s||v),i&&!a&&!n&&l,t.jsx("div",{className:f(d==="horizontal"&&"flex",d==="horizontal"&&i&&"flex-row-reverse"),children:e}),!i&&a&&(s||v),!i&&!a&&!n&&(l||k)]}),d==="vertical"&&!i&&y&&t.jsx("button",{onClick:b,className:f("absolute bottom-4 right-4","p-3 rounded-full","bg-blue-600 dark:bg-blue-500","text-white","shadow-lg","hover:bg-blue-700 dark:hover:bg-blue-600","transition-colors","focus:outline-none focus:ring-2 focus:ring-blue-500 dark:focus:ring-blue-400"),"aria-label":"Scroll to top",children:t.jsx("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:t.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M5 10l7-7m0 0l7 7m-7-7v18"})})})]})},Dc=({trigger:e,children:r,placement:a="bottom",isOpen:n,onOpenChange:o,trigger_action:s="click",showArrow:l=!0,className:c})=>{const[d,i]=p.useState(!1),h=n!==void 0?n:d,u=p.useCallback(E=>{n===void 0&&i(E),o?.(E)},[n,o]),y=p.useRef(null),m=p.useRef(null),[b,v]=p.useState({top:0,left:0});p.useEffect(()=>{if(!h||!y.current)return;const E=()=>{const A=y.current.getBoundingClientRect(),C=8;let I=0,L=0;switch(a){case"top":I=A.top-C,L=A.left+A.width/2;break;case"top-start":I=A.top-C,L=A.left;break;case"top-end":I=A.top-C,L=A.right;break;case"bottom":I=A.bottom+C,L=A.left+A.width/2;break;case"bottom-start":I=A.bottom+C,L=A.left;break;case"bottom-end":I=A.bottom+C,L=A.right;break;case"left":I=A.top+A.height/2,L=A.left-C;break;case"right":I=A.top+A.height/2,L=A.right+C;break}v({top:I,left:L})};return E(),window.addEventListener("scroll",E),window.addEventListener("resize",E),()=>{window.removeEventListener("scroll",E),window.removeEventListener("resize",E)}},[h,a]),p.useEffect(()=>{if(!h)return;const E=A=>{y.current&&!y.current.contains(A.target)&&m.current&&!m.current.contains(A.target)&&u(!1)};return document.addEventListener("mousedown",E),()=>document.removeEventListener("mousedown",E)},[h,u]),p.useEffect(()=>{if(!h)return;const E=A=>{A.key==="Escape"&&u(!1)};return document.addEventListener("keydown",E),()=>document.removeEventListener("keydown",E)},[h,u]);const k=()=>{s==="click"&&u(!h)},S=()=>{s==="hover"&&u(!0)},x=()=>{s==="hover"&&u(!1)},N={top:"origin-bottom","top-start":"origin-bottom-left","top-end":"origin-bottom-right",bottom:"origin-top","bottom-start":"origin-top-left","bottom-end":"origin-top-right",left:"origin-right",right:"origin-left"},w={top:"-translate-x-1/2 -translate-y-full","top-start":"-translate-y-full","top-end":"-translate-x-full -translate-y-full",bottom:"-translate-x-1/2","bottom-start":"","bottom-end":"-translate-x-full",left:"-translate-x-full -translate-y-1/2",right:"-translate-y-1/2"};return t.jsxs("div",{className:f("relative inline-block",c),children:[t.jsx("div",{ref:y,onClick:k,onMouseEnter:S,onMouseLeave:x,className:"inline-block",children:e}),h&&t.jsxs("div",{ref:m,className:f("fixed z-50","bg-white dark:bg-gray-800","border border-gray-200 dark:border-gray-700","rounded-lg shadow-lg","transition-all duration-200","animate-in fade-in zoom-in-95",N[a],w[a]),style:{position:"fixed",top:b.top+"px",left:b.left+"px"},onMouseEnter:s==="hover"?()=>u(!0):void 0,onMouseLeave:s==="hover"?()=>u(!1):void 0,children:[r,l&&t.jsx("div",{className:f("arrow absolute w-2 h-2 bg-white dark:bg-gray-800 border border-gray-200 dark:border-gray-700 transform rotate-45",a.startsWith("top")&&"bottom-[-5px] border-t-0 border-l-0",a.startsWith("bottom")&&"top-[-5px] border-b-0 border-r-0",a==="left"&&"right-[-5px] border-l-0 border-b-0",a==="right"&&"left-[-5px] border-r-0 border-t-0",(a==="top"||a==="bottom")&&"left-1/2 -translate-x-1/2",(a==="left"||a==="right")&&"top-1/2 -translate-y-1/2")})]})]})},zc=({sections:e,activeId:r,onActiveChange:a,offset:n=80,container:o,smoothScroll:s=!0,showSubsections:l=!0,className:c})=>{const[d,i]=p.useState(""),h=p.useRef(null),u=r!==void 0?r:d;p.useEffect(()=>{const b=o?document.querySelector(o):window;if(!b)return;const v=x=>x.flatMap(N=>[N.id,...N.subsections?v(N.subsections):[]]),S=v(e).map(x=>document.getElementById(x)).filter(Boolean);if(S.length!==0)return h.current=new IntersectionObserver(x=>{x.forEach(N=>{if(N.isIntersecting){const w=N.target.id;r!==void 0&&a?a(w):i(w)}})},{root:o?b:null,rootMargin:`-${n}px 0px -50% 0px`,threshold:0}),S.forEach(x=>{h.current?.observe(x)}),()=>{h.current?.disconnect()}},[e,o,n,r,a]);const y=b=>{const v=document.getElementById(b);if(!v)return;const k=o?document.querySelector(o):window;if(!k)return;const x=v.offsetTop-n;s?k===window?window.scrollTo({top:x,behavior:"smooth"}):k.scrollTo({top:x,behavior:"smooth"}):k===window?window.scrollTo(0,x):k.scrollTop=x},m=(b,v=0)=>{const k=u===b.id,S=b.subsections?.some(x=>u===x.id)||!1;return t.jsxs("div",{children:[t.jsx("button",{onClick:()=>y(b.id),className:f("w-full text-left px-3 py-1.5 text-sm rounded-md transition-colors",v===0?"font-medium":"pl-6 text-sm",k?"text-blue-700 dark:text-blue-300 bg-blue-50 dark:bg-blue-900/30":S?"text-gray-700 dark:text-gray-300":"text-gray-600 dark:text-gray-400 hover:text-gray-900 dark:hover:text-white hover:bg-gray-100 dark:hover:bg-gray-800"),style:{paddingLeft:`${v*.75+.75}rem`},children:b.label}),l&&b.subsections&&b.subsections.length>0&&t.jsx("div",{className:"ml-2 border-l-2 border-gray-200 dark:border-gray-700",children:b.subsections.map(x=>m(x,v+1))})]},b.id)};return t.jsx("nav",{className:f("space-y-1",c),children:e.map(b=>m(b,0))})},jc=({isOpen:e,onClose:r,children:a,title:n,description:o,footer:s,side:l="bottom",size:c="md",showHandle:d=!0,showCloseButton:i=!0,className:h})=>{if(p.useEffect(()=>{if(!e)return;const b=v=>{v.key==="Escape"&&r()};return document.addEventListener("keydown",b),()=>document.removeEventListener("keydown",b)},[e,r]),!e)return null;const u={bottom:{sm:"h-1/3",md:"h-1/2",lg:"h-2/3",full:"h-full"},top:{sm:"h-1/3",md:"h-1/2",lg:"h-2/3",full:"h-full"},left:{sm:"w-80",md:"w-96",lg:"w-[32rem]",full:"w-full"},right:{sm:"w-80",md:"w-96",lg:"w-[32rem]",full:"w-full"}},y={bottom:"bottom-0 left-0 right-0 rounded-t-2xl",top:"top-0 left-0 right-0 rounded-b-2xl",left:"left-0 top-0 bottom-0 rounded-r-2xl",right:"right-0 top-0 bottom-0 rounded-l-2xl"},m={bottom:"animate-in slide-in-from-bottom duration-300",top:"animate-in slide-in-from-top duration-300",left:"animate-in slide-in-from-left duration-300",right:"animate-in slide-in-from-right duration-300"};return t.jsxs(be,{children:[t.jsx(Ze,{isOpen:e,onClose:r,opacity:"dark"}),t.jsxs("div",{className:f("fixed z-50","bg-white dark:bg-gray-900","shadow-xl","flex flex-col",y[l],u[l][c],m[l],h),children:[d&&(l==="bottom"||l==="top")&&t.jsx("div",{className:f("flex items-center justify-center",l==="bottom"?"pt-3 pb-2":"pb-3 pt-2"),children:t.jsx("div",{className:"w-12 h-1.5 bg-gray-300 dark:bg-gray-700 rounded-full"})}),(n||o||i)&&t.jsx("div",{className:"px-6 py-4 border-b border-gray-200 dark:border-gray-700",children:t.jsxs("div",{className:"flex items-start justify-between",children:[t.jsxs("div",{className:"flex-1",children:[n&&t.jsx("h2",{className:"text-lg font-semibold text-gray-900 dark:text-white",children:n}),o&&t.jsx("p",{className:"mt-1 text-sm text-gray-600 dark:text-gray-400",children:o})]}),i&&t.jsx("button",{onClick:r,className:"ml-4 text-gray-400 hover:text-gray-600 dark:hover:text-gray-200 transition-colors","aria-label":"Close sheet",children:t.jsx("svg",{className:"w-6 h-6",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:t.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})})]})}),t.jsx("div",{className:"flex-1 overflow-y-auto px-6 py-4",children:a}),s&&t.jsx("div",{className:"px-6 py-4 border-t border-gray-200 dark:border-gray-700",children:s})]})]})},_c=({isOpen:e,onClose:r,onSubmit:a,title:n,description:o,placeholder:s="",initialValue:l="",cancelText:c="Cancel",confirmText:d="Confirm",isLoading:i=!1,loadingText:h="Processing...",maxLength:u,required:y=!0,validate:m})=>{const[b,v]=p.useState(l),[k,S]=p.useState(null);p.useEffect(()=>{e&&(v(l),S(null))},[e,l]);const x=async E=>{if(E.preventDefault(),S(null),y&&!b.trim()){S("This field is required");return}if(m){const A=m(b);if(A){S(A);return}}try{await a(b.trim())}catch(A){S(A instanceof Error?A.message:"An error occurred")}},N=()=>{v(l),S(null),r()},w=y?b.trim().length>0:!0;return t.jsx(Mr,{isOpen:e,onClose:N,size:"small","aria-labelledby":"text-input-modal-title","aria-describedby":"text-input-modal-description",closeOnEscape:!i,closeOnOverlayClick:!i,children:t.jsxs("form",{onSubmit:x,children:[t.jsxs(Pr,{variant:"padded",children:[t.jsx("h3",{id:"text-input-modal-title",className:U.heading.h4(),children:n}),t.jsx("p",{id:"text-input-modal-description",className:`${U.body.md()} mt-2 mb-4`,children:o}),t.jsx(Je,{type:"text",value:b,onChange:E=>v(E.target.value),placeholder:s,maxLength:u,disabled:i,autoFocus:!0,"aria-invalid":!!k,"aria-describedby":k?"text-input-error":void 0}),k&&t.jsx("p",{id:"text-input-error",className:`${U.body.sm()} text-red-600 dark:text-red-400 mt-2`,role:"alert",children:k})]}),t.jsxs(Or,{children:[t.jsx(ne,{type:"button",variant:"outline",onClick:N,disabled:i,children:c}),t.jsx(ne,{type:"submit",variant:"default",disabled:!w||i,children:i?h:d})]})]})})},Rt=({content:e,children:r,placement:a="top",delayShow:n=0,delayHide:o=0,className:s,disabled:l=!1,showArrow:c=!0,variant:d="default",trigger:i="hover",isOpen:h,onVisibilityChange:u})=>{const[y,m]=p.useState(!1),b=p.useRef(void 0),v=p.useRef(void 0),k=p.useRef(null),S=p.useRef(null),x=h!==void 0,N=x?h:y,w=p.useCallback(()=>{l||x||(v.current&&(clearTimeout(v.current),v.current=void 0),n>0?b.current=setTimeout(()=>{m(!0),u?.(!0)},n):(m(!0),u?.(!0)))},[l,x,n,u]),E=p.useCallback(()=>{x||(b.current&&(clearTimeout(b.current),b.current=void 0),o>0?v.current=setTimeout(()=>{m(!1),u?.(!1)},o):(m(!1),u?.(!1)))},[x,o,u]);p.useEffect(()=>()=>{b.current&&clearTimeout(b.current),v.current&&clearTimeout(v.current)},[]),p.useEffect(()=>{if(i!=="click"||!N)return;const F=V=>{k.current&&!k.current.contains(V.target)&&S.current&&!S.current.contains(V.target)&&E()};return document.addEventListener("mousedown",F),()=>{document.removeEventListener("mousedown",F)}},[i,N,E]);const A=()=>{i==="hover"&&w()},C=()=>{i==="hover"&&E()},I=()=>{i==="hover"&&w()},L=()=>{i==="hover"&&E()},O=()=>{i==="click"&&!x&&(N?(m(!1),u?.(!1)):(m(!0),u?.(!0)))},M={top:"bottom-full left-1/2 -translate-x-1/2 -translate-y-2",bottom:"top-full left-1/2 -translate-x-1/2 translate-y-2",left:"right-full top-1/2 -translate-x-2 -translate-y-1/2",right:"left-full top-1/2 translate-x-2 -translate-y-1/2"},D={top:"top-full left-1/2 -translate-x-1/2 border-l-transparent border-r-transparent border-b-transparent",bottom:"bottom-full left-1/2 -translate-x-1/2 border-l-transparent border-r-transparent border-t-transparent",left:"left-full top-1/2 -translate-y-1/2 border-t-transparent border-b-transparent border-r-transparent",right:"right-full top-1/2 -translate-y-1/2 border-t-transparent border-b-transparent border-l-transparent"},B={default:"bg-gray-900 dark:bg-gray-700 text-white",info:"bg-blue-600 dark:bg-blue-500 text-white",success:"bg-green-600 dark:bg-green-500 text-white",warning:"bg-yellow-600 dark:bg-yellow-500 text-white",error:"bg-red-600 dark:bg-red-500 text-white"},z={default:{top:"border-t-gray-900 dark:border-t-gray-700",bottom:"border-b-gray-900 dark:border-b-gray-700",left:"border-l-gray-900 dark:border-l-gray-700",right:"border-r-gray-900 dark:border-r-gray-700"},info:{top:"border-t-blue-600 dark:border-t-blue-500",bottom:"border-b-blue-600 dark:border-b-blue-500",left:"border-l-blue-600 dark:border-l-blue-500",right:"border-r-blue-600 dark:border-r-blue-500"},success:{top:"border-t-green-600 dark:border-t-green-500",bottom:"border-b-green-600 dark:border-b-green-500",left:"border-l-green-600 dark:border-l-green-500",right:"border-r-green-600 dark:border-r-green-500"},warning:{top:"border-t-yellow-600 dark:border-t-yellow-500",bottom:"border-b-yellow-600 dark:border-b-yellow-500",left:"border-l-yellow-600 dark:border-l-yellow-500",right:"border-r-yellow-600 dark:border-r-yellow-500"},error:{top:"border-t-red-600 dark:border-t-red-500",bottom:"border-b-red-600 dark:border-b-red-500",left:"border-l-red-600 dark:border-l-red-500",right:"border-r-red-600 dark:border-r-red-500"}};return t.jsxs("div",{ref:S,className:"relative inline-block",onMouseEnter:A,onMouseLeave:C,onFocus:I,onBlur:L,onClick:O,children:[r,N&&!l&&t.jsxs("div",{ref:k,className:f("absolute z-50 px-2 py-1 text-xs font-medium rounded shadow-lg whitespace-nowrap pointer-events-none",M[a],B[d],s),role:"tooltip",children:[e,c&&t.jsx("div",{className:f("absolute w-0 h-0 border-4 arrow",D[a],z[d][a])})]})]})},Bc={default:P.InformationCircleIcon,warning:P.ExclamationTriangleIcon,danger:P.XCircleIcon,success:P.CheckCircleIcon,info:P.InformationCircleIcon},Fc={default:()=>j.icon.variant.default.lg(),warning:()=>j.icon.variant.warning.lg(),danger:()=>j.icon.variant.error.lg(),success:()=>j.icon.variant.success.lg(),info:()=>j.icon.variant.default.lg()},Wc={default:"default",warning:"default",danger:"destructive",success:"default",info:"default"},Vc=({isOpen:e,onClose:r,onConfirm:a,title:n,message:o,confirmText:s="Confirm",cancelText:l="Cancel",loadingText:c="Processing...",variant:d="default",isLoading:i=!1})=>{const h=Bc[d],u=Fc[d],y=Wc[d];return t.jsxs(Mr,{isOpen:e,onClose:r,size:"small",variant:"web3confirmation","aria-labelledby":"confirmation-dialog-title","aria-describedby":"confirmation-dialog-description",children:[t.jsxs(Pr,{variant:"padded",children:[t.jsxs("div",{className:"flex items-center gap-3 mb-4",children:[t.jsx(h,{className:u()}),t.jsx("h3",{id:"confirmation-dialog-title",className:U.heading.h4(),children:n})]}),t.jsx("p",{id:"confirmation-dialog-description",className:U.body.md(),children:o})]}),t.jsxs(Or,{children:[t.jsx(ne,{variant:"outline",onClick:r,disabled:i,children:l}),t.jsx(ne,{variant:y,onClick:a,disabled:i,children:i?c:s})]})]})},$c=({trigger:e,children:r,placement:a="bottom",openDelay:n=200,closeDelay:o=300,className:s})=>{const[l,c]=p.useState(!1),[d,i]=p.useState({top:0,left:0}),h=p.useRef(null),u=p.useRef(null),y=p.useRef(void 0),m=p.useRef(void 0);p.useEffect(()=>{if(!l||!h.current)return;const x=()=>{const N=h.current.getBoundingClientRect(),w=8;let E=0,A=0;switch(a){case"top":E=N.top-w,A=N.left+N.width/2;break;case"bottom":E=N.bottom+w,A=N.left+N.width/2;break;case"left":E=N.top+N.height/2,A=N.left-w;break;case"right":E=N.top+N.height/2,A=N.right+w;break}i({top:E,left:A})};return x(),window.addEventListener("scroll",x),window.addEventListener("resize",x),()=>{window.removeEventListener("scroll",x),window.removeEventListener("resize",x)}},[l,a]);const b=()=>{m.current&&clearTimeout(m.current),y.current=setTimeout(()=>{c(!0)},n)},v=()=>{y.current&&clearTimeout(y.current),m.current=setTimeout(()=>{c(!1)},o)},k={top:"origin-bottom",bottom:"origin-top",left:"origin-right",right:"origin-left"},S={top:"-translate-x-1/2 -translate-y-full",bottom:"-translate-x-1/2",left:"-translate-x-full -translate-y-1/2",right:"-translate-y-1/2"};return t.jsxs(t.Fragment,{children:[t.jsx("div",{ref:h,onMouseEnter:b,onMouseLeave:v,className:"inline-block",children:e}),l&&t.jsx(be,{children:t.jsx("div",{ref:u,className:f("fixed z-50","bg-white dark:bg-gray-800","border border-gray-200 dark:border-gray-700","rounded-lg shadow-lg","transition-all duration-200","animate-in fade-in zoom-in-95",k[a],S[a],s),style:{top:d.top+"px",left:d.left+"px"},onMouseEnter:()=>{m.current&&clearTimeout(m.current)},onMouseLeave:v,children:r})})]})},Hc=({children:e,onDrop:r,onDragOver:a,accept:n,showIndicator:o=!0,indicator:s,disabled:l=!1,className:c})=>{const[d,i]=p.useState(!1),[h,u]=p.useState(0),y=S=>{S.preventDefault(),S.stopPropagation(),!l&&(u(x=>x+1),S.dataTransfer.items&&S.dataTransfer.items.length>0&&i(!0))},m=S=>{S.preventDefault(),S.stopPropagation(),!l&&u(x=>{const N=x-1;return N===0&&i(!1),N})},b=S=>{S.preventDefault(),S.stopPropagation(),!l&&a&&a(S)},v=S=>{if(S.preventDefault(),S.stopPropagation(),l)return;if(i(!1),u(0),S.dataTransfer.files&&S.dataTransfer.files.length>0){const N=Array.from(S.dataTransfer.files);let w=N;n&&n.length>0&&(w=N.filter(E=>n.some(A=>{if(A.endsWith("/*")){const C=A.split("/")[0];return E.type.startsWith(C)}return E.type===A}))),r(w);return}const x=S.dataTransfer.getData("text/plain");if(x)try{const N=JSON.parse(x);r(N)}catch{r(x)}},k=t.jsxs("div",{className:"absolute inset-0 flex flex-col items-center justify-center bg-blue-50 dark:bg-blue-900/30 border-2 border-dashed border-blue-500 dark:border-blue-400 rounded-lg z-10",children:[t.jsx("svg",{className:"w-12 h-12 text-blue-600 dark:text-blue-400 mb-3",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:t.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M7 16a4 4 0 01-.88-7.903A5 5 0 1115.9 6L16 6a5 5 0 011 9.9M15 13l-3-3m0 0l-3 3m3-3v12"})}),t.jsx("p",{className:"text-blue-700 dark:text-blue-300 font-medium",children:"Drop here"})]});return t.jsxs("div",{onDragEnter:y,onDragLeave:m,onDragOver:b,onDrop:v,className:f("relative",l&&"opacity-50 cursor-not-allowed",c),children:[e,o&&d&&!l&&(s||k)]})},qc=({className:e,children:r,disabled:a=!1,onClick:n})=>t.jsx("div",{className:f("p-4 rounded-lg border transition-colors","bg-white dark:bg-gray-900","border-gray-200 dark:border-gray-700","text-gray-900 dark:text-white",a&&"opacity-50 cursor-not-allowed","hover:bg-gray-50 dark:hover:bg-gray-800",e),onClick:a?void 0:n,role:"region","aria-label":"UdragUdropUlist",children:r||"UdragUdropUlist Component"}),Gc=({className:e,children:r,disabled:a=!1,onClick:n})=>t.jsx("div",{className:f("p-4 rounded-lg border transition-colors","bg-white dark:bg-gray-900","border-gray-200 dark:border-gray-700","text-gray-900 dark:text-white",a&&"opacity-50 cursor-not-allowed","hover:bg-gray-50 dark:hover:bg-gray-800",e),onClick:a?void 0:n,role:"region","aria-label":"UsortableUgrid",children:r||"UsortableUgrid Component"}),Yc=({className:e,children:r,disabled:a=!1,onClick:n})=>t.jsx("div",{className:f("p-4 rounded-lg border transition-colors","bg-white dark:bg-gray-900","border-gray-200 dark:border-gray-700","text-gray-900 dark:text-white",a&&"opacity-50 cursor-not-allowed","hover:bg-gray-50 dark:hover:bg-gray-800",e),onClick:a?void 0:n,role:"region","aria-label":"UnestedUdrag",children:r||"UnestedUdrag Component"}),Kc=({className:e,children:r,disabled:a=!1,onClick:n})=>t.jsx("div",{className:f("p-4 rounded-lg border transition-colors","bg-white dark:bg-gray-900","border-gray-200 dark:border-gray-700","text-gray-900 dark:text-white",a&&"opacity-50 cursor-not-allowed","hover:bg-gray-50 dark:hover:bg-gray-800",e),onClick:a?void 0:n,role:"region","aria-label":"UgestureUdetector",children:r||"UgestureUdetector Component"}),Xc=({className:e,children:r,disabled:a=!1,onClick:n})=>t.jsx("div",{className:f("p-4 rounded-lg border transition-colors","bg-white dark:bg-gray-900","border-gray-200 dark:border-gray-700","text-gray-900 dark:text-white",a&&"opacity-50 cursor-not-allowed","hover:bg-gray-50 dark:hover:bg-gray-800",e),onClick:a?void 0:n,role:"region","aria-label":"UswipeUactions",children:r||"UswipeUactions Component"}),Zc=({className:e,children:r,disabled:a=!1,onClick:n})=>t.jsx("div",{className:f("p-4 rounded-lg border transition-colors","bg-white dark:bg-gray-900","border-gray-200 dark:border-gray-700","text-gray-900 dark:text-white",a&&"opacity-50 cursor-not-allowed","hover:bg-gray-50 dark:hover:bg-gray-800",e),onClick:a?void 0:n,role:"region","aria-label":"UpinchUzoom",children:r||"UpinchUzoom Component"}),Jc=({className:e,children:r,disabled:a=!1,onClick:n})=>t.jsx("div",{className:f("p-4 rounded-lg border transition-colors","bg-white dark:bg-gray-900","border-gray-200 dark:border-gray-700","text-gray-900 dark:text-white",a&&"opacity-50 cursor-not-allowed","hover:bg-gray-50 dark:hover:bg-gray-800",e),onClick:a?void 0:n,role:"region","aria-label":"UdoubleUtap",children:r||"UdoubleUtap Component"}),Qc=({className:e,children:r,disabled:a=!1,onClick:n})=>t.jsx("div",{className:f("p-4 rounded-lg border transition-colors","bg-white dark:bg-gray-900","border-gray-200 dark:border-gray-700","text-gray-900 dark:text-white",a&&"opacity-50 cursor-not-allowed","hover:bg-gray-50 dark:hover:bg-gray-800",e),onClick:a?void 0:n,role:"region","aria-label":"UlongUpress",children:r||"UlongUpress Component"}),Rc=({className:e,children:r,disabled:a=!1,onClick:n})=>t.jsx("div",{className:f("p-4 rounded-lg border transition-colors","bg-white dark:bg-gray-900","border-gray-200 dark:border-gray-700","text-gray-900 dark:text-white",a&&"opacity-50 cursor-not-allowed","hover:bg-gray-50 dark:hover:bg-gray-800",e),onClick:a?void 0:n,role:"region","aria-label":"UradialUmenu",children:r||"UradialUmenu Component"}),ed=({children:e,onRefresh:r,disabled:a=!1,refreshingText:n="Refreshing...",pullDownText:o="Pull down to refresh",releaseText:s="Release to refresh",threshold:l=80,maxPullDistance:c=120,className:d=""})=>{const[i,h]=p.useState(0),[u,y]=p.useState(!1),[m,b]=p.useState(!1),v=p.useRef(0),k=p.useRef(null);p.useEffect(()=>{const E=k.current;if(!E)return;const A=L=>{if(a||u)return;E.scrollTop<=0&&(v.current=L.touches[0].clientY,b(!0))},C=L=>{if(!m)return;const M=L.touches[0].clientY-v.current;if(M>0&&E.scrollTop<=0){const D=Math.min(M/c,1),B=Math.min(M*(1-D*.5),c);h(B),M>10&&L.preventDefault()}},I=async()=>{if(m)if(b(!1),i>=l&&!u){y(!0);try{await r()}catch{}finally{y(!1),h(0)}}else h(0)};return E.addEventListener("touchstart",A,{passive:!0}),E.addEventListener("touchmove",C,{passive:!1}),E.addEventListener("touchend",I),()=>{E.removeEventListener("touchstart",A),E.removeEventListener("touchmove",C),E.removeEventListener("touchend",I)}},[a,u,m,i,l,c,r]);const S=Math.min(i/l,1),x=m||u,N=m?i:u?l:0,w=()=>u?n:i>=l?s:o;return t.jsxs("div",{ref:k,className:`relative ${d}`,style:{height:"100%",overflowY:"auto",WebkitOverflowScrolling:"touch"},children:[t.jsx("div",{className:"sticky top-0 left-0 right-0 flex items-center justify-center bg-gradient-to-b from-blue-50/90 to-transparent dark:from-blue-900/20 dark:to-transparent backdrop-blur-sm z-10 transition-all duration-300 ease-out",style:{height:`${N}px`,marginTop:m?0:`-${N}px`,opacity:x?1:0,pointerEvents:"none"},children:t.jsxs("div",{className:"flex flex-col items-center justify-center gap-2",children:[t.jsx(P.ArrowPathIcon,{className:`w-6 h-6 text-blue-600 dark:text-blue-400 transition-transform duration-200 ${u?"animate-spin":""}`,style:{transform:`rotate(${S*360}deg)`}}),i>20&&t.jsx("span",{className:"text-xs font-medium text-blue-600 dark:text-blue-400",children:w()})]})}),t.jsx("div",{style:{paddingTop:m?`${i}px`:0,transition:m?"none":"padding-top 200ms ease-out"},children:e})]})},ie={twitter:(e,r,a)=>{const n=a.length>0?`&hashtags=${a.join(",")}`:"";return`https://twitter.com/intent/tweet?url=${encodeURIComponent(e)}&text=${encodeURIComponent(r)}${n}`},facebook:e=>`https://www.facebook.com/sharer/sharer.php?u=${encodeURIComponent(e)}`,linkedin:(e,r,a)=>`https://www.linkedin.com/sharing/share-offsite/?url=${encodeURIComponent(e)}`,reddit:(e,r)=>`https://reddit.com/submit?url=${encodeURIComponent(e)}&title=${encodeURIComponent(r)}`,telegram:(e,r)=>`https://t.me/share/url?url=${encodeURIComponent(e)}&text=${encodeURIComponent(r)}`,whatsapp:(e,r)=>`https://wa.me/?text=${encodeURIComponent(r+" "+e)}`,email:(e,r,a)=>`mailto:?subject=${encodeURIComponent(r)}&body=${encodeURIComponent(a+`
56
56
 
57
57
  `+e)}`,discord:(e,r)=>`https://discord.com/channels/@me?message=${encodeURIComponent(r+`
58
58
  `+e)}`,messages:(e,r)=>`sms:?&body=${encodeURIComponent(r+" "+e)}`},rd=({shareConfig:e})=>{const[r,a]=p.useState(!1),[n,o]=p.useState(""),[s,l]=p.useState(!1),[c,d]=p.useState(!1),[i,h]=p.useState(!1);p.useEffect(()=>{const x=e.onBeforeShare;x&&!n&&(async()=>{l(!0);try{const w=typeof window<"u"?window.location.href:"",E=await x(w);o(E)}catch{const w=typeof window<"u"?window.location.href:"";o(w)}finally{l(!1)}})()},[e,n]);const u=n||(typeof window<"u"?window.location.href:""),y=typeof navigator<"u"&&navigator.share!==void 0,m=async()=>{if(!(!y||i)){h(!0);try{await navigator.share({title:e.title,text:e.description,url:u}),a(!1)}catch(x){x instanceof Error&&x.name!=="AbortError"&&(console.error("Share failed:",x),x.name!=="InvalidStateError"&&a(!0))}finally{h(!1)}}},b=async()=>{try{await navigator.clipboard.writeText(u),d(!0),setTimeout(()=>{d(!1),a(!1)},1500)}catch{}},v=()=>{a(!r)},k=x=>{window.open(x,"_blank","noopener,noreferrer,width=600,height=400"),a(!1)},S=[{name:"Twitter",url:ie.twitter(u,e.title,e.hashtags),color:"text-blue-400",svg:t.jsx("path",{d:"M8.29 20.251c7.547 0 11.675-6.253 11.675-11.675 0-.178 0-.355-.012-.53A8.348 8.348 0 0022 5.92a8.19 8.19 0 01-2.357.646 4.118 4.118 0 001.804-2.27 8.224 8.224 0 01-2.605.996 4.107 4.107 0 00-6.993 3.743 11.65 11.65 0 01-8.457-4.287 4.106 4.106 0 001.27 5.477A4.072 4.072 0 012.8 9.713v.052a4.105 4.105 0 003.292 4.022 4.095 4.095 0 01-1.853.07 4.108 4.108 0 003.834 2.85A8.233 8.233 0 012 18.407a11.616 11.616 0 006.29 1.84"})},{name:"Facebook",url:ie.facebook(u),color:"text-blue-600",svg:t.jsx("path",{d:"M24 12.073c0-6.627-5.373-12-12-12s-12 5.373-12 12c0 5.99 4.388 10.954 10.125 11.854v-8.385H7.078v-3.47h3.047V9.43c0-3.007 1.792-4.669 4.533-4.669 1.312 0 2.686.235 2.686.235v2.953H15.83c-1.491 0-1.956.925-1.956 1.874v2.25h3.328l-.532 3.47h-2.796v8.385C19.612 23.027 24 18.062 24 12.073z"})},{name:"LinkedIn",url:ie.linkedin(u,e.title,e.description),color:"text-blue-700",svg:t.jsx("path",{d:"M20.447 20.452h-3.554v-5.569c0-1.328-.027-3.037-1.852-3.037-1.853 0-2.136 1.445-2.136 2.939v5.667H9.351V9h3.414v1.561h.046c.477-.9 1.637-1.85 3.37-1.85 3.601 0 4.267 2.37 4.267 5.455v6.286zM5.337 7.433c-1.144 0-2.063-.926-2.063-2.065 0-1.138.92-2.063 2.063-2.063 1.14 0 2.064.925 2.064 2.063 0 1.139-.925 2.065-2.064 2.065zm1.782 13.019H3.555V9h3.564v11.452zM22.225 0H1.771C.792 0 0 .774 0 1.729v20.542C0 23.227.792 24 1.771 24h20.451C23.2 24 24 23.227 24 22.271V1.729C24 .774 23.2 0 22.222 0h.003z"})},{name:"Reddit",url:ie.reddit(u,e.title),color:"text-orange-600",svg:t.jsx("path",{d:"M12 0A12 12 0 0 0 0 12a12 12 0 0 0 12 12 12 12 0 0 0 12-12A12 12 0 0 0 12 0zm5.01 4.744c.688 0 1.25.561 1.25 1.249a1.25 1.25 0 0 1-2.498.056l-2.597-.547-.8 3.747c1.824.07 3.48.632 4.674 1.488.308-.309.73-.491 1.207-.491.968 0 1.754.786 1.754 1.754 0 .716-.435 1.333-1.01 1.614a3.111 3.111 0 0 1 .042.52c0 2.694-3.13 4.87-7.004 4.87-3.874 0-7.004-2.176-7.004-4.87 0-.183.015-.366.043-.534A1.748 1.748 0 0 1 4.028 12c0-.968.786-1.754 1.754-1.754.463 0 .898.196 1.207.49 1.207-.883 2.878-1.43 4.744-1.487l.885-4.182a.342.342 0 0 1 .14-.197.35.35 0 0 1 .238-.042l2.906.617a1.214 1.214 0 0 1 1.108-.701zM9.25 12C8.561 12 8 12.562 8 13.25c0 .687.561 1.248 1.25 1.248.687 0 1.248-.561 1.248-1.249 0-.688-.561-1.249-1.249-1.249zm5.5 0c-.687 0-1.248.561-1.248 1.25 0 .687.561 1.248 1.249 1.248.688 0 1.249-.561 1.249-1.249 0-.687-.562-1.249-1.25-1.249zm-5.466 3.99a.327.327 0 0 0-.231.094.33.33 0 0 0 0 .463c.842.842 2.484.913 2.961.913.477 0 2.105-.056 2.961-.913a.361.361 0 0 0 .029-.463.33.33 0 0 0-.464 0c-.547.533-1.684.73-2.512.73-.828 0-1.979-.196-2.512-.73a.326.326 0 0 0-.232-.095z"})},{name:"Telegram",url:ie.telegram(u,e.title),color:"text-blue-500",svg:t.jsx("path",{d:"M11.944 0A12 12 0 0 0 0 12a12 12 0 0 0 12 12 12 12 0 0 0 12-12A12 12 0 0 0 12 0a12 12 0 0 0-.056 0zm4.962 7.224c.1-.002.321.023.465.14a.506.506 0 0 1 .171.325c.016.093.036.306.02.472-.18 1.898-.962 6.502-1.36 8.627-.168.9-.499 1.201-.82 1.23-.696.065-1.225-.46-1.9-.902-1.056-.693-1.653-1.124-2.678-1.8-1.185-.78-.417-1.21.258-1.91.177-.184 3.247-2.977 3.307-3.23.007-.032.014-.15-.056-.212s-.174-.041-.249-.024c-.106.024-1.793 1.14-5.061 3.345-.48.33-.913.49-1.302.48-.428-.008-1.252-.241-1.865-.44-.752-.245-1.349-.374-1.297-.789.027-.216.325-.437.893-.663 3.498-1.524 5.83-2.529 6.998-3.014 3.332-1.386 4.025-1.627 4.476-1.635z"})},{name:"WhatsApp",url:ie.whatsapp(u,e.title),color:"text-green-600",svg:t.jsx("path",{d:"M17.472 14.382c-.297-.149-1.758-.867-2.03-.967-.273-.099-.471-.148-.67.15-.197.297-.767.966-.94 1.164-.173.199-.347.223-.644.075-.297-.15-1.255-.463-2.39-1.475-.883-.788-1.48-1.761-1.653-2.059-.173-.297-.018-.458.13-.606.134-.133.298-.347.446-.52.149-.174.198-.298.298-.497.099-.198.05-.371-.025-.52-.075-.149-.669-1.612-.916-2.207-.242-.579-.487-.5-.669-.51-.173-.008-.371-.01-.57-.01-.198 0-.52.074-.792.372-.272.297-1.04 1.016-1.04 2.479 0 1.462 1.065 2.875 1.213 3.074.149.198 2.096 3.2 5.077 4.487.709.306 1.262.489 1.694.625.712.227 1.36.195 1.871.118.571-.085 1.758-.719 2.006-1.413.248-.694.248-1.289.173-1.413-.074-.124-.272-.198-.57-.347m-5.421 7.403h-.004a9.87 9.87 0 01-5.031-1.378l-.361-.214-3.741.982.998-3.648-.235-.374a9.86 9.86 0 01-1.51-5.26c.001-5.45 4.436-9.884 9.888-9.884 2.64 0 5.122 1.03 6.988 2.898a9.825 9.825 0 012.893 6.994c-.003 5.45-4.437 9.884-9.885 9.884m8.413-18.297A11.815 11.815 0 0012.05 0C5.495 0 .16 5.335.157 11.892c0 2.096.547 4.142 1.588 5.945L.057 24l6.305-1.654a11.882 11.882 0 005.683 1.448h.005c6.554 0 11.89-5.335 11.893-11.893a11.821 11.821 0 00-3.48-8.413Z"})},{name:"Discord",url:ie.discord(u,e.title),color:"text-indigo-500",svg:t.jsx("path",{d:"M20.317 4.37a19.791 19.791 0 0 0-4.885-1.515.074.074 0 0 0-.079.037c-.21.375-.444.864-.608 1.25a18.27 18.27 0 0 0-5.487 0 12.64 12.64 0 0 0-.617-1.25.077.077 0 0 0-.079-.037A19.736 19.736 0 0 0 3.677 4.37a.07.07 0 0 0-.032.027C.533 9.046-.32 13.58.099 18.057a.082.082 0 0 0 .031.057 19.9 19.9 0 0 0 5.993 3.03.078.078 0 0 0 .084-.028 14.09 14.09 0 0 0 1.226-1.994.076.076 0 0 0-.041-.106 13.107 13.107 0 0 1-1.872-.892.077.077 0 0 1-.008-.128 10.2 10.2 0 0 0 .372-.292.074.074 0 0 1 .077-.01c3.928 1.793 8.18 1.793 12.062 0a.074.074 0 0 1 .078.01c.12.098.246.198.373.292a.077.077 0 0 1-.006.127 12.299 12.299 0 0 1-1.873.892.077.077 0 0 0-.041.107c.36.698.772 1.362 1.225 1.993a.076.076 0 0 0 .084.028 19.839 19.839 0 0 0 6.002-3.03.077.077 0 0 0 .032-.054c.5-5.177-.838-9.674-3.549-13.66a.061.061 0 0 0-.031-.03zM8.02 15.33c-1.183 0-2.157-1.085-2.157-2.419 0-1.333.956-2.419 2.157-2.419 1.21 0 2.176 1.096 2.157 2.42 0 1.333-.956 2.418-2.157 2.418zm7.975 0c-1.183 0-2.157-1.085-2.157-2.419 0-1.333.955-2.419 2.157-2.419 1.21 0 2.176 1.096 2.157 2.42 0 1.333-.946 2.418-2.157 2.418z"})},{name:"Messages",url:ie.messages(u,e.title),color:"text-green-500",svg:t.jsx("path",{d:"M.05 3.555A3 3 0 013 0h18a3 3 0 012.95 3.555L22 11v8a3 3 0 01-3 3H5a3 3 0 01-3-3v-8l-1.95-7.445zM2 10.938V19a1 1 0 001 1h18a1 1 0 001-1v-8.062L20 19H4l-2-8.062zM3.38 2L5 8h14l1.62-6H3.38z"})},{name:"Email",url:ie.email(u,e.title,e.description),color:"text-gray-600",svg:t.jsx("path",{d:"M2.003 5.884L10 9.882l7.997-3.998A2 2 0 0016 4H4a2 2 0 00-1.997 1.884z M18 8.118l-8 4-8-4V14a2 2 0 002 2h12a2 2 0 002-2V8.118z"})}];return t.jsxs("div",{className:"relative",children:[t.jsx("button",{onClick:v,disabled:s||i,className:"flex items-center justify-center w-8 h-8 bg-blue-50 hover:bg-blue-100 dark:bg-blue-900/30 dark:hover:bg-blue-900/50 text-blue-600 dark:text-blue-400 rounded-lg transition-colors disabled:opacity-50 disabled:cursor-not-allowed",title:"Share this page",children:s||i?t.jsx("div",{className:"w-4 h-4 border-2 border-blue-600 border-t-transparent rounded-full animate-spin"}):t.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:t.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M8.684 13.342C8.886 12.938 9 12.482 9 12c0-.482-.114-.938-.316-1.342m0 2.684a3 3 0 110-2.684m0 2.684l6.632 3.316m-6.632-6l6.632-3.316m0 0a3 3 0 105.367-2.684 3 3 0 00-5.367 2.684zm0 9.316a3 3 0 105.367 2.684 3 3 0 00-5.367-2.684z"})})}),r&&t.jsxs(t.Fragment,{children:[t.jsx("div",{className:"fixed inset-0 z-[999998]",onClick:()=>a(!1)}),t.jsxs("div",{className:"absolute right-0 top-10 z-[999999] w-40 bg-white dark:bg-gray-800 rounded-lg shadow-xl border border-gray-200 dark:border-gray-700 py-1",children:[S.map(x=>t.jsxs("button",{onClick:()=>k(x.url),className:"w-full flex items-center px-3 py-1.5 hover:bg-gray-50 dark:hover:bg-gray-700 cursor-pointer transition-colors",children:[t.jsx("svg",{className:`w-4 h-4 mr-2 ${x.color}`,fill:"currentColor",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:x.svg}),t.jsx("span",{className:"text-sm text-gray-700 dark:text-gray-300",children:x.name})]},x.name)),t.jsx("div",{className:"border-t border-gray-200 dark:border-gray-700 my-1"}),y&&t.jsxs("button",{onClick:()=>{a(!1),m()},disabled:i,className:"w-full flex items-center px-3 py-1.5 hover:bg-gray-50 dark:hover:bg-gray-700 cursor-pointer transition-colors disabled:opacity-50",children:[t.jsx("svg",{className:"w-4 h-4 mr-2 text-blue-600 dark:text-blue-400",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:t.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M8.684 13.342C8.886 12.938 9 12.482 9 12c0-.482-.114-.938-.316-1.342m0 2.684a3 3 0 110-2.684m0 2.684l6.632 3.316m-6.632-6l6.632-3.316m0 0a3 3 0 105.367-2.684 3 3 0 00-5.367 2.684zm0 9.316a3 3 0 105.367 2.684 3 3 0 00-5.367-2.684z"})}),t.jsx("span",{className:"text-sm text-gray-700 dark:text-gray-300",children:"More..."})]}),t.jsxs("button",{onClick:b,className:"w-full flex items-center px-3 py-1.5 hover:bg-gray-50 dark:hover:bg-gray-700 cursor-pointer transition-colors",children:[t.jsx("svg",{className:"w-4 h-4 mr-2 text-gray-600 dark:text-gray-400",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:t.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M13.828 10.172a4 4 0 00-5.656 0l-4 4a4 4 0 105.656 5.656l1.102-1.101m-.758-4.899a4 4 0 005.656 0l4-4a4 4 0 00-5.656-5.656l-1.1 1.1"})}),t.jsx("span",{className:"text-sm text-gray-700 dark:text-gray-300",children:c?"Copied!":"Copy Link"})]})]})]})]})},ea=({items:e,shareConfig:r,className:a,showHome:n})=>t.jsxs("div",{className:"flex items-center justify-between",children:[t.jsx("nav",{"aria-label":"Breadcrumb",children:t.jsx("ol",{className:"flex items-center text-sm space-x-2",children:e.map((o,s)=>t.jsxs(p.Fragment,{children:[t.jsx("li",{children:o.current?t.jsx("span",{className:"text-gray-700 dark:text-gray-300",children:o.label}):t.jsx(Z.Link,{to:o.href||"#",className:"text-blue-600 dark:text-blue-400 hover:text-blue-800 dark:hover:text-blue-300 transition-colors",children:o.label})}),s<e.length-1&&t.jsx("li",{children:t.jsx("span",{className:"text-gray-400 dark:text-gray-500",children:"/"})})]},s))})}),r&&t.jsx(rd,{shareConfig:r})]}),ra={standard:"max-w-7xl mx-auto px-4",wide:"max-w-[1920px] mx-auto px-4",full:"w-full px-4"},ta={standard:"max-w-7xl mx-auto",wide:"max-w-[1920px] mx-auto",full:"w-full"},aa="px-4",Ur=p.createContext(void 0),na=({mode:e="standard",children:r})=>{const a={mode:e,containerClass:ra[e],maxWidthClass:ta[e],paddingClass:aa};return t.jsx(Ur.Provider,{value:a,children:r})},ue=()=>{const e=p.useContext(Ur);return e||{mode:"standard",containerClass:ra.standard,maxWidthClass:ta.standard,paddingClass:aa}},td=({items:e,shareConfig:r})=>{const{containerClass:a}=ue();return t.jsx("div",{className:"bg-white dark:bg-gray-800 border-b border-gray-200 dark:border-gray-700 relative z-50",children:t.jsx("div",{className:`${a} py-3 relative`,children:t.jsx(ea,{items:e,shareConfig:r})})})},oa=e=>{const[r,a]=p.useState(""),[n,o]=p.useState(!0),[s,l]=p.useState(null);return p.useEffect(()=>{e&&(async()=>{try{o(!0),l(null);const d=await fetch(`/code/${e}`);if(!d.ok)throw new Error(`Failed to load code file: ${e}`);const i=await d.text();a(i)}catch(d){l(d instanceof Error?d.message:"Unknown error"),a("// Error loading code file")}finally{o(!1)}})()},[e]),{code:r,loading:n,error:s}},ad=({filename:e,code:r,language:a,title:n,className:o="",showCopy:s=!0,showHeader:l=!0})=>{const{t:c}=Xe.useTranslation("codeBlock"),{code:d,loading:i,error:h}=oa(e||""),[u,y]=p.useState(!1),m=r||d,v=a||(e?(S=>{switch(S.split(".").pop()?.toLowerCase()){case"sol":return"solidity";case"js":case"mjs":return"javascript";case"ts":return"typescript";case"sh":return"bash";case"graphql":return"graphql";case"json":return"json";case"css":return"css";case"html":return"html";case"jsx":return"jsx";case"tsx":return"tsx";case"py":return"python";case"java":return"java";case"cpp":case"c":return"cpp";case"go":return"go";case"rs":return"rust";case"php":return"php";case"rb":return"ruby";default:return"text"}})(e):"text"),k=async()=>{if(m)try{await navigator.clipboard.writeText(m),y(!0),setTimeout(()=>y(!1),2e3)}catch{}};return e&&i?t.jsx("div",{className:`bg-gray-900 text-green-400 rounded-lg p-4 font-mono text-sm ${o}`,children:t.jsx("div",{className:"animate-pulse text-gray-500",children:c("loadingCode","Loading code...")})}):e&&h?t.jsxs("div",{className:`bg-gray-900 text-red-400 rounded-lg p-4 font-mono text-sm ${o}`,children:[c("error","Error"),": ",h]}):m?t.jsxs("div",{className:`bg-gray-900 rounded-lg border border-green-500/20 shadow-lg shadow-green-500/10 ${o}`,children:[l&&t.jsxs("div",{className:"flex items-center justify-between px-4 py-2 border-b border-green-500/20 bg-gray-800/50",children:[t.jsx("span",{className:"text-sm text-green-400 font-mono",children:n||e||`${v} code`}),s&&t.jsx("button",{onClick:k,className:"p-2 text-gray-400 hover:text-green-400 hover:bg-gray-800 rounded-lg transition-all duration-200 group",title:c("copyCode","Copy code"),children:u?t.jsx(P.CheckIcon,{className:"h-4 w-4 text-green-400"}):t.jsx(P.ClipboardDocumentIcon,{className:"h-4 w-4 group-hover:scale-110 transition-transform"})})]}),t.jsx("div",{className:"p-4 overflow-x-auto text-left",children:t.jsx("pre",{className:`text-sm language-${v}`,children:t.jsx("code",{className:"text-gray-100",children:m})})})]}):t.jsx("div",{className:`bg-gray-900 text-gray-400 rounded-lg p-4 font-mono text-sm ${o}`,children:c("noCode","No code to display")})},nd=({subsections:e,isExpanded:r,selectedSubsection:a,parentSectionId:n,onSubsectionSelect:o})=>{const s=p.useRef(null),[l,c]=p.useState(void 0);return p.useLayoutEffect(()=>{if(s.current){const d=s.current.scrollHeight;c(r?d+16:0)}},[r,e]),t.jsx("div",{className:"overflow-hidden transition-all duration-300 ease-in-out",style:{height:l!==void 0?`${l}px`:"auto"},children:t.jsx("div",{ref:s,className:"ml-6 mt-1 mb-1 space-y-1",children:e.map(d=>t.jsxs("div",{className:"relative group",children:[a===d.id&&t.jsx("div",{className:"absolute top-0.5 bottom-0.5 left-1 right-12 bg-blue-500/20 dark:bg-blue-400/20 rounded-lg pointer-events-none"}),a!==d.id&&t.jsx("div",{className:"absolute top-0.5 bottom-0.5 left-1 right-12 bg-blue-500/0 group-hover:bg-blue-500/10 dark:group-hover:bg-blue-400/10 rounded-lg pointer-events-none transition-colors duration-200"}),t.jsx("button",{onClick:()=>o?.(d.id,n),className:`relative z-10 block w-full text-left pl-4 pr-3 py-2 rounded-md text-sm transition-all duration-200 ${a===d.id?"text-blue-700 dark:text-blue-300":"text-gray-600 dark:text-gray-400 hover:text-gray-800 dark:hover:text-gray-200"}`,children:d.title})]},d.id))})})},od=({id:e,title:r,content:a,subsections:n,isSelected:o=!1,selectedSubsection:s=null,onSectionSelect:l,onSubsectionSelect:c,className:d=""})=>{const[i,h]=p.useState(!1),u=()=>{h(!i)},y=()=>{l?.(e)},m=n&&n.length>0;return t.jsxs("div",{className:d,children:[t.jsxs("div",{className:"relative flex items-center group",children:[o&&!s&&t.jsx("div",{className:"absolute top-2 bottom-2 left-2 right-12 bg-blue-500/20 dark:bg-blue-400/20 rounded-lg pointer-events-none"}),!(o&&!s)&&t.jsx("div",{className:"absolute top-2 bottom-2 left-2 right-12 bg-blue-500/0 group-hover:bg-blue-500/10 dark:group-hover:bg-blue-400/10 rounded-lg pointer-events-none transition-colors duration-200"}),t.jsx("button",{onClick:y,className:`relative z-10 flex-1 text-left pl-5 pr-3 py-4 text-base font-medium transition-all duration-200 ${o&&!s?"text-blue-700 dark:text-blue-300":"text-gray-700 dark:text-gray-300 hover:text-gray-900 dark:hover:text-gray-100"}`,children:r}),m&&t.jsx("button",{onClick:u,className:"p-2 rounded-md hover:bg-gray-100 dark:hover:bg-gray-800 hover:scale-110 transition-all duration-200","aria-label":i?"Collapse section":"Expand section",children:t.jsx(P.ChevronRightIcon,{className:`h-5 w-5 text-gray-500 transition-transform duration-300 ease-in-out ${i?"rotate-90":"rotate-0"}`})})]}),m&&t.jsx(nd,{subsections:n,isExpanded:i,selectedSubsection:s,parentSectionId:e,onSubsectionSelect:c})]})},sd=({title:e,subtitle:r,buttonText:a,buttonIcon:n="envelope",variant:o="default",badgeText:s="FREE",prominentBadgeText:l="100% Free",onButtonClick:c,className:d=""})=>{const i=()=>n==="envelope"||n==="both"?t.jsx(P.EnvelopeIcon,{className:o==="prominent"?"h-5 w-5 mr-2":"h-4 w-4 mr-1"}):n==="none"?null:t.jsx("svg",{className:o==="prominent"?"h-5 w-5 mr-2":"h-4 w-4 mr-1",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:t.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M16 12a4 4 0 10-8 0 4 4 0 008 0zm0 0v1.5a2.5 2.5 0 005 0V12a9 9 0 10-9 9m4.5-1.206a8.959 8.959 0 01-4.5 1.207"})}),h=()=>n==="arrow"||n==="both"?t.jsx(P.ArrowRightIcon,{className:"h-4 w-4 ml-2"}):null,u=()=>o==="prominent"?"border-b-2 border-green-200 dark:border-green-700":"border-b border-green-200 dark:border-green-700",y=()=>{const k="bg-gradient-to-r from-green-600 to-blue-600 hover:from-green-700 hover:to-blue-700 text-white rounded-lg font-bold transition-all duration-300 transform hover:scale-105 shadow-lg hover:shadow-green-500/25 inline-flex items-center whitespace-nowrap cursor-pointer";return o==="prominent"?`${k} px-8 py-3 text-base`:`${k} px-6 py-2 text-sm`},m=()=>o==="prominent"?"text-green-800 dark:text-green-200 font-semibold text-lg":"text-green-800 dark:text-green-200 font-semibold",b=o==="prominent"?l:s,{containerClass:v}=ue();return t.jsx("div",{className:`bg-gradient-to-r from-green-100 to-blue-100 dark:from-green-900/20 dark:to-blue-900/20 ${u()} ${d}`,children:t.jsx("div",{className:`${v} py-4`,children:t.jsxs("div",{className:"flex flex-col sm:flex-row items-center justify-between gap-4",children:[t.jsxs("div",{className:`flex items-center ${o==="prominent"?"text-center sm:text-left":""}`,children:[t.jsx("div",{className:"bg-green-500 text-white text-xs font-bold px-3 py-1 rounded-full mr-3 animate-pulse",children:b}),t.jsxs("div",{children:[t.jsx("span",{className:m(),children:e}),r&&t.jsx("span",{className:"text-green-700 dark:text-green-300 text-sm block",children:r})]})]}),t.jsxs("button",{onClick:c,className:y(),children:[i(),a,h()]})]})})})},ld=({children:e,onClick:r,variant:a,size:n,disabled:o,className:s,type:l,trackingLabel:c,actionType:d,componentName:i,onTrack:h,trackingParams:u={},...y})=>{const m=b=>{if(h){const v=c||(typeof e=="string"?e:"")||"Unknown Button",S=a&&["default","primary","secondary","outline","ghost","destructive","link"].includes(a)?a:"default";h({button_text:v,button_type:S,component_name:i,action_type:d,...u})}r&&r(b)};return t.jsx(ne,{...y,variant:a,size:n,disabled:o,className:s,type:l,onClick:m,children:e})},id=({children:e,onClick:r,to:a,href:n,trackingLabel:o,componentName:s,onTrack:l,trackingParams:c={},LinkComponent:d,linkProps:i={},...h})=>{const u=m=>{if(l){const b=o||(typeof e=="string"?e:"")||"Unknown Link",v=a?typeof a=="string"?a:a.pathname||"":n||"";l({link_text:b,link_url:v,to_page:v,navigation_type:d?"router_link":"anchor_link",component_name:s,...c})}r&&r(m)};if(d&&a!==void 0)return t.jsx(d,{...i,to:a,onClick:u,...h,children:e});const y=a?typeof a=="string"?a:a.pathname||"#":n;return t.jsx("a",{...h,href:y,onClick:u,children:e})},sa={en:{name:"English",flag:"🇺🇸"},ar:{name:"العربية",flag:"🇸🇦"},de:{name:"Deutsch",flag:"🇩🇪"},es:{name:"Español",flag:"🇪🇸"},fr:{name:"Français",flag:"🇫🇷"},it:{name:"Italiano",flag:"🇮🇹"},ja:{name:"日本語",flag:"🇯🇵"},ko:{name:"한국어",flag:"🇰🇷"},pt:{name:"Português",flag:"🇵🇹"},ru:{name:"Русский",flag:"🇷🇺"},sv:{name:"Svenska",flag:"🇸🇪"},th:{name:"ไทย",flag:"🇹🇭"},uk:{name:"Українська",flag:"🇺🇦"},vi:{name:"Tiếng Việt",flag:"🇻🇳"},zh:{name:"简体中文",flag:"🇨🇳"}},cd=({variant:e="compact",className:r=""})=>{const{i18n:a,t:n}=Xe.useTranslation("languageSelector"),[o,s]=p.useState(a.language),l=p.useMemo(()=>a.options.supportedLngs?a.options.supportedLngs.filter(i=>i!=="cimode").map(i=>({code:i,name:sa[i]?.name||i.toUpperCase(),flag:sa[i]?.flag||"🌐"})).sort((i,h)=>i.name.localeCompare(h.name)):[],[a.options.supportedLngs]),c=l.find(i=>i.code===o||i.code.toLowerCase()===o.toLowerCase());p.useEffect(()=>{s(a.language)},[a.language]);const d=i=>{localStorage.setItem("language",i),a.changeLanguage(i).then(()=>{s(a.language),setTimeout(()=>{window.dispatchEvent(new Event("languagechange"))},100)}).catch(()=>{})};return e==="compact"?t.jsx("div",{className:`relative ${r}`,children:t.jsxs(Cr,{value:o,onValueChange:d,children:[t.jsx(Qe,{className:"h-10 w-auto px-3 border-0 bg-transparent hover:bg-gray-100 dark:hover:bg-gray-700 focus:ring-0 focus:ring-offset-0",children:t.jsxs("div",{className:"flex items-center space-x-2",children:[t.jsx("span",{className:"text-lg leading-none",children:c?.flag}),t.jsx("span",{className:"hidden sm:block text-sm font-medium text-gray-700 dark:text-gray-300",children:c?.name})]})}),t.jsx(Re,{children:l.map(i=>t.jsx(er,{value:i.code,className:"cursor-pointer",children:t.jsxs("div",{className:"flex items-center space-x-2",children:[t.jsx("span",{className:"text-lg leading-none",children:i.flag}),t.jsx("span",{className:"text-sm",children:i.name})]})},i.code))})]})}):t.jsxs("div",{className:`space-y-2 ${r}`,children:[t.jsxs("label",{className:"text-sm font-medium text-gray-700 dark:text-gray-300 flex items-center space-x-2",children:[t.jsx(P.LanguageIcon,{className:"h-4 w-4 text-gray-500 dark:text-gray-400"}),t.jsx("span",{children:n("language","Language")})]}),t.jsxs(Cr,{value:o,onValueChange:d,children:[t.jsx(Qe,{children:t.jsx(Bt,{placeholder:n("selectLanguage","Select language")})}),t.jsx(Re,{children:l.map(i=>t.jsx(er,{value:i.code,className:"cursor-pointer",children:t.jsxs("div",{className:"flex items-center space-x-2",children:[t.jsx("span",{className:"text-lg leading-none",children:i.flag}),t.jsx("span",{children:i.name})]})},i.code))})]}),t.jsx("p",{className:"text-xs text-gray-500 dark:text-gray-400",children:n("selectPreferredLanguage","Select your preferred language")})]})},dd=({items:e,type:r="ordered",variant:a="default",className:n,itemClassName:o})=>{const s=()=>{const i="space-y-2",h={ordered:r==="ordered"?"list-decimal":"",unordered:r==="unordered"?"list-disc":""},u={default:"list-inside",enhanced:"list-inside space-y-3",minimal:"list-none space-y-1"};return f(i,h[r],u[a])},l=i=>{const h="text-gray-600 dark:text-gray-400";return a==="enhanced"?f(h,"relative pl-8 pb-2 border-l-2 border-gray-200 dark:border-gray-700",i===e.length-1&&"border-l-transparent"):a==="minimal"?f(h,"flex items-start"):h},c=i=>a==="enhanced"&&r==="ordered"?t.jsx("div",{className:"absolute -left-4 -top-1 w-6 h-6 bg-blue-600 text-white rounded-full flex items-center justify-center text-sm font-medium",children:i+1}):null,d=(i,h)=>{const u=typeof i=="object",y=u?i.content:i,m=u?i.subItems:void 0;return t.jsxs("li",{className:f(l(h),o),children:[c(h),a==="minimal"&&r==="ordered"&&t.jsx("span",{className:"inline-block w-6 h-6 bg-blue-100 dark:bg-blue-900/20 text-blue-600 dark:text-blue-400 rounded-full text-sm font-medium text-center leading-6 mr-3 flex-shrink-0",children:h+1}),a==="minimal"&&r==="unordered"&&t.jsx("span",{className:"inline-block w-2 h-2 bg-blue-600 rounded-full mt-2 mr-3 flex-shrink-0"}),t.jsxs("div",{className:"flex-1",children:[t.jsx("div",{children:y}),m&&m.length>0&&t.jsx("ul",{className:"mt-2 ml-4 space-y-1 list-disc list-inside text-sm text-gray-500 dark:text-gray-500",children:m.map((b,v)=>t.jsx("li",{children:b},v))})]})]},h)};return t.jsx("ul",{className:f(s(),n),children:e.map(d)})};class gd extends p.Component{constructor(){super(...arguments),this.state={hasError:!1}}static getDerivedStateFromError(r){return{hasError:!0,error:r}}componentDidCatch(r,a){console.error("ErrorBoundary caught an error:",r,a),this.props.onError?.(r,a)}render(){return this.state.hasError?this.props.fallback?this.props.fallback:t.jsxs("div",{style:{padding:"20px",border:"1px solid red",margin:"10px"},children:[t.jsx("h2",{children:"Something went wrong"}),t.jsxs("p",{children:["Error: ",this.state.error?.message||"Unknown error"]}),t.jsx("button",{onClick:()=>this.setState({hasError:!1}),children:"Try again"})]}):this.props.children}}class sr extends p.Component{constructor(r){super(r),this.retryTimer=null,this.sendErrorToMonitoring=(a,n)=>{try{typeof window<"u"&&window.Sentry&&window.Sentry?.captureException(a,{contexts:{react:{componentStack:n.componentStack}},tags:{errorBoundary:!0,componentName:this.props.componentName||"unknown",lazyLoading:!0}}),typeof window<"u"&&window.gtag&&window.gtag?.("event","exception",{description:a.message,fatal:!1,custom_map:{component:this.props.componentName||"unknown"}})}catch{}},this.handleRetry=()=>{const{maxRetries:a=3,retryDelay:n=1e3}=this.props,{retryCount:o}=this.state;if(o>=a)return;this.setState({isRetrying:!0}),this.retryTimer&&clearTimeout(this.retryTimer);const s=n*Math.pow(2,o);this.retryTimer=setTimeout(()=>{this.setState({hasError:!1,error:null,errorInfo:null,retryCount:o+1,isRetrying:!1})},s)},this.handleReload=()=>{window.location.reload()},this.state={hasError:!1,error:null,errorInfo:null,retryCount:0,isRetrying:!1,lastErrorTime:0}}static getDerivedStateFromError(r){return{hasError:!0,error:r,lastErrorTime:Date.now()}}componentDidCatch(r,a){const{onError:n,componentName:o}=this.props;this.setState({error:r,errorInfo:a}),console.error(`LazyErrorBoundary caught an error in ${o||"Unknown Component"}:`,r,a),n?.(r,a),this.sendErrorToMonitoring(r,a)}componentWillUnmount(){this.retryTimer&&clearTimeout(this.retryTimer)}render(){const{children:r,fallback:a,componentName:n,showRetryButton:o=!0,maxRetries:s=3}=this.props,{hasError:l,error:c,isRetrying:d,retryCount:i}=this.state;return l&&c?a||t.jsx("div",{className:"lazy-error-boundary error-boundary-container",children:t.jsxs("div",{className:"error-content",children:[t.jsx("div",{className:"error-icon",children:"⚠️"}),t.jsxs("h3",{className:"error-title",children:["Something went wrong loading ",n||"this component"]}),t.jsxs("div",{className:"error-details",children:[t.jsx("p",{className:"error-message",children:c.message}),process.env.NODE_ENV==="development"&&t.jsxs("details",{className:"error-stack",children:[t.jsx("summary",{children:"Error Details (Development)"}),t.jsx("pre",{children:c.stack})]})]}),t.jsxs("div",{className:"error-actions",children:[o&&i<s&&t.jsx("button",{onClick:this.handleRetry,disabled:d,className:"retry-button",children:d?"Retrying...":`Retry (${i}/${s})`}),i>=s&&t.jsx("button",{onClick:this.handleReload,className:"reload-button",children:"Reload Page"})]}),t.jsxs("div",{className:"error-help",children:[t.jsx("p",{children:"This might be a temporary issue. Try refreshing the page."}),navigator.onLine===!1&&t.jsx("p",{className:"offline-notice",children:"You appear to be offline. Check your connection and try again."})]})]})}):r}}function ud(e,r){const a=n=>t.jsx(sr,{...r,children:t.jsx(e,{...n})});return a.displayName=`withLazyErrorBoundary(${e.displayName||e.name})`,a}class hd extends sr{static getDerivedStateFromError(r){return r.message.includes("Loading chunk")||r.message.includes("Loading CSS chunk")||r.message.includes("ChunkLoadError")||r.name==="ChunkLoadError"?{hasError:!0,error:new Error("Network error while loading component. Please check your connection and try again."),lastErrorTime:Date.now()}:super.getDerivedStateFromError(r)}}function fd(){const[e,r]=p.useState(0),a=p.useCallback(()=>{r(n=>n+1)},[]);return{errorRecoveryCount:e,triggerErrorRecovery:a}}function bd({children:e}){const r=(a,n)=>{console.error("Global lazy loading error:",a,n),typeof window<"u"&&window.Sentry&&window.Sentry?.captureException(a,{level:"error",tags:{globalErrorBoundary:!0,lazyLoading:!0}})};return t.jsx(sr,{onError:r,componentName:"Application",maxRetries:1,showRetryButton:!0,fallback:t.jsxs("div",{className:"global-error-fallback",children:[t.jsx("h1",{children:"Application Error"}),t.jsx("p",{children:"Something went wrong with the application. Please refresh the page."}),t.jsx("button",{onClick:()=>window.location.reload(),children:"Refresh Page"})]}),children:e})}const md=({children:e})=>t.jsx(t.Fragment,{children:e}),yd=({children:e})=>t.jsx(t.Fragment,{children:e}),pd=(e,r,a)=>{const n=p.memo(e,r);return a&&(n.displayName=`Memo(${a})`),process.env.NODE_ENV==="development"?o=>(p.useMemo(()=>{let l=0;return()=>++l},[])(),t.jsx(n,{...o})):n},vd=(e,r)=>p.memo(e,(a,n)=>r.every(o=>a[o]===n[o])),kd=p.memo(({children:e,compute:r,deps:a})=>{const n=p.useRef(a),o=p.useRef(r),s=p.useRef(void 0),l=p.useMemo(()=>{const c=a.length!==n.current.length||a.some((i,h)=>i!==n.current[h]),d=r!==o.current;if(c||d||s.current===void 0){let i;return process.env.NODE_ENV==="development"?(performance.now(),i=r(),performance.now()):i=r(),n.current=a,o.current=r,s.current=i,i}return s.current},[r,a]);return t.jsx(t.Fragment,{children:e(l)})}),xd=p.memo(({item:e,index:r,style:a,renderItem:n})=>t.jsx("div",{style:a,children:n(e,r)}),(e,r)=>e.index===r.index&&e.item===r.item&&e.style.height===r.style.height&&e.style.top===r.style.top),wd=p.memo(({condition:e,children:r,fallback:a=null})=>e?t.jsx(t.Fragment,{children:r}):t.jsx(t.Fragment,{children:a})),Nd=({children:e,threshold:r=.1,rootMargin:a="50px",fallback:n=null})=>{const[o,s]=p.useState(!1),l=p.useRef(null);return p.useEffect(()=>{const c=new IntersectionObserver(([d])=>{d.isIntersecting&&(s(!0),c.disconnect())},{threshold:r,rootMargin:a});return l.current&&c.observe(l.current),()=>c.disconnect()},[r,a]),t.jsx("div",{ref:l,children:o?e:n})},Cd=({children:e,maxRenderTime:r=16,onSlowRender:a})=>{const n=p.useRef(0);return p.useLayoutEffect(()=>{n.current=performance.now()}),p.useEffect(()=>{const o=performance.now()-n.current;o>r&&a?.(o)}),t.jsx(t.Fragment,{children:e})},Sd=({children:e,batchSize:r=5,delay:a=0})=>{const[n,o]=p.useState(r);return p.useEffect(()=>{if(n<e.length){const s=setTimeout(()=>{o(l=>Math.min(l+r,e.length))},a);return()=>clearTimeout(s)}},[n,e.length,r,a]),t.jsx(t.Fragment,{children:e.slice(0,n)})},Ed=({src:e,alt:r,placeholder:a,lowQualitySrc:n,aspectRatio:o="16/9",eager:s=!1,className:l="",...c})=>{const[d,i]=p.useState(!1),[h,u]=p.useState(s),[y,m]=p.useState(!1),b=p.useRef(null),v=p.useRef(null);p.useEffect(()=>{if(s){u(!0);return}return v.current=new IntersectionObserver(x=>{x.forEach(N=>{N.isIntersecting&&(u(!0),v.current&&b.current&&v.current.unobserve(b.current))})},{rootMargin:"50px",threshold:.01}),b.current&&v.current.observe(b.current),()=>{v.current&&v.current.disconnect()}},[s]);const k=()=>{i(!0)},S=()=>{m(!0)};return t.jsxs("div",{className:`relative overflow-hidden ${l}`,style:{aspectRatio:o},children:[n&&!d&&t.jsx("img",{src:n,alt:"",className:"absolute inset-0 w-full h-full object-cover blur-sm","aria-hidden":"true"}),!n&&!d&&t.jsx("div",{className:"absolute inset-0 bg-gray-200 dark:bg-gray-700 animate-pulse","aria-hidden":"true"}),h&&!y&&t.jsx("img",{ref:b,src:e,alt:r,onLoad:k,onError:S,className:`absolute inset-0 w-full h-full object-cover transition-opacity duration-500 ${d?"opacity-100":"opacity-0"}`,loading:s?"eager":"lazy",...c}),y&&t.jsx("div",{className:"absolute inset-0 flex items-center justify-center bg-gray-100 dark:bg-gray-800",children:t.jsxs("div",{className:"text-center text-gray-500 dark:text-gray-400",children:[t.jsx("svg",{className:"mx-auto h-12 w-12 mb-2",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:t.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M4 16l4.586-4.586a2 2 0 012.828 0L16 16m-2-2l1.586-1.586a2 2 0 012.828 0L20 14m-6-6h.01M6 20h12a2 2 0 002-2V6a2 2 0 00-2-2H6a2 2 0 00-2 2v12a2 2 0 002 2z"})}),t.jsx("p",{className:"text-sm",children:"Failed to load image"})]})})]})},Ad=e=>/^[a-z]{2}(-[a-z]+)?$/.test(e);function Td({to:e,language:r,children:a,isLanguageSupported:n=Ad,defaultLanguage:o="en",...s}){const{lang:l}=Z.useParams(),c=l&&n(l)?l:o,d=r||c,i=e.startsWith(`/${d}`)?e:`/${d}${e.startsWith("/")?e:`/${e}`}`;return t.jsx(Z.Link,{to:i,...s,children:a})}function Id({isLanguageSupported:e,defaultLanguage:r="en",storageKey:a="language",fallback:n=null}){const{lang:o}=Z.useParams(),s=Z.useNavigate(),{i18n:l}=Xe.useTranslation();return p.useEffect(()=>{if(!o||!e(o)){s(`/${r}`,{replace:!0});return}l.language!==o&&l.changeLanguage(o);try{localStorage.setItem(a,o)}catch{}},[o,l,s,e,r,a]),!o||!e(o)?t.jsx(t.Fragment,{children:n}):t.jsx(Z.Outlet,{})}function Dr(e,r){const a=zr(e);return`/${r}${a.startsWith("/")?a:`/${a}`}`}function zr(e,r){const a=e.split("/").filter(Boolean);if(a.length>0){const n=a[0];if(/^[a-z]{2}(-[a-z]+)?$/.test(n)&&(!r||r(n)))return"/"+a.slice(1).join("/")}return e}function Ld(e={}){const{isLanguageSupported:r=h=>/^[a-z]{2}(-[a-z]+)?$/.test(h),defaultLanguage:a="en",storageKey:n="language"}=e,o=Z.useNavigate(),{lang:s}=Z.useParams(),{i18n:l}=Xe.useTranslation(),c=s&&r(s)?s:l.language||a,d=p.useCallback((h,u)=>{if(typeof h=="number"){o(h);return}const y=Dr(h,c);o(y,u)},[o,c]),i=p.useCallback((h,u)=>{l.changeLanguage(h);const y=zr(u||(typeof window<"u"?window.location.pathname:"/"),r),m=Dr(y,h);o(m,{replace:!0});try{localStorage.setItem(n,h)}catch{}},[o,l,r,n]);return{navigate:d,switchLanguage:i,currentLanguage:c}}function Md(){return t.jsx("div",{className:"min-h-screen flex items-center justify-center bg-theme-bg-primary",children:t.jsx("div",{className:"animate-spin rounded-full h-8 w-8 border-b-2 border-blue-600"})})}function Pd({children:e,isAuthenticated:r,isLoading:a=!1,redirectPath:n,loadingComponent:o,fallback:s=null}){const l=Z.useNavigate(),{lang:c}=Z.useParams();return p.useEffect(()=>{if(!a&&!r){const d=n?n.replace(":lang",c||"en"):`/${c||"en"}`;l(d,{replace:!0})}},[r,a,l,c,n]),a?t.jsx(t.Fragment,{children:o??t.jsx(Md,{})}):r?t.jsx(t.Fragment,{children:e}):t.jsx(t.Fragment,{children:s})}function Od(){return t.jsx("svg",{className:"w-8 h-8 text-red-600 dark:text-red-400",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:t.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-3L13.732 4c-.77-1.333-2.694-1.333-3.464 0L3.34 16c-.77 1.333.192 3 1.732 3z"})})}function Ud({spinning:e=!1}){return t.jsx("svg",{className:`w-4 h-4 ${e?"animate-spin":""}`,fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:t.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M4 4v5h.582m15.356 2A8.001 8.001 0 004.582 9m0 0H9m11 11v-5h-.581m0 0a8.003 8.003 0 01-15.357-2m15.357 2H15"})})}function Dd({title:e="Something went wrong",message:r="An unexpected error occurred. Please try again.",onRetry:a,isRetrying:n=!1,retryText:o="Retry",loadingText:s="Loading...",icon:l,className:c=""}){return t.jsx("div",{className:`flex flex-col items-center justify-center py-12 px-4 ${c}`,children:t.jsxs("div",{className:"flex flex-col items-center max-w-md text-center",children:[t.jsx("div",{className:"w-16 h-16 rounded-full bg-red-100 dark:bg-red-900/30 flex items-center justify-center mb-4",children:l??t.jsx(Od,{})}),t.jsx("h3",{className:"text-lg font-semibold text-theme-text-primary mb-2",children:e}),t.jsx("p",{className:"text-sm text-theme-text-secondary mb-6",children:r}),a&&t.jsxs("button",{onClick:a,disabled:n,className:"inline-flex items-center gap-2 px-4 py-2 bg-blue-600 text-white font-medium rounded-lg hover:bg-blue-700 transition-colors disabled:opacity-50",children:[t.jsx(Ud,{spinning:n}),n?s:o]})]})})}var re=(e=>(e.LIGHT="light",e.DARK="dark",e.SYSTEM="system",e))(re||{}),jr=(e=>(e.SMALL="small",e.MEDIUM="medium",e.LARGE="large",e))(jr||{});const lr={getItem:e=>{try{return localStorage.getItem(e)}catch{return null}},setItem:(e,r)=>{try{localStorage.setItem(e,r)}catch{}}},_r=p.createContext(void 0);function zd(){const e=p.useContext(_r);if(e===void 0)throw new Error("useTheme must be used within a ThemeProvider");return e}function jd({children:e,themeStorageKey:r="theme",fontSizeStorageKey:a="font-size",defaultTheme:n=re.LIGHT,defaultFontSize:o=jr.MEDIUM}){const[s,l]=p.useState(()=>lr.getItem(r)||n),[c,d]=p.useState(()=>lr.getItem(a)||o),[i,h]=p.useState(()=>s===re.SYSTEM?typeof window<"u"&&window.matchMedia("(prefers-color-scheme: dark)").matches?re.DARK:re.LIGHT:s),u=p.useCallback(b=>{l(b),lr.setItem(r,b)},[r]),y=p.useCallback(b=>{d(b),lr.setItem(a,b)},[a]);p.useEffect(()=>{const b=document.documentElement;let v=s;s===re.SYSTEM&&(v=window.matchMedia("(prefers-color-scheme: dark)").matches?re.DARK:re.LIGHT),h(v),b.classList.remove("light","dark"),b.classList.add(v),b.classList.remove("font-small","font-medium","font-large"),b.classList.add(`font-${c}`)},[s,c]),p.useEffect(()=>{if(s===re.SYSTEM){const b=window.matchMedia("(prefers-color-scheme: dark)"),v=k=>{const S=document.documentElement,x=k.matches?re.DARK:re.LIGHT;h(x),S.classList.remove("light","dark"),S.classList.add(x)};return b.addEventListener("change",v),()=>{b.removeEventListener("change",v)}}},[s]);const m=p.useMemo(()=>({theme:s,fontSize:c,setTheme:u,setFontSize:y,resolvedTheme:i}),[s,c,u,y,i]);return t.jsx(_r.Provider,{value:m,children:e})}const _d=({icon:e,title:r,description:a,benefits:n,metrics:o,color:s="blue",isHighlight:l=!1,learnMoreUrl:c,cta:d,onClick:i,interactive:h=!1,borderColor:u=!1,className:y})=>{const m={blue:"text-blue-600 dark:text-blue-400",green:"text-green-600 dark:text-green-400",purple:"text-purple-600 dark:text-purple-400",orange:"text-orange-600 dark:text-orange-400",pink:"text-pink-600 dark:text-pink-400",gray:"text-gray-600 dark:text-gray-400",red:"text-red-600 dark:text-red-400",indigo:"text-indigo-600 dark:text-indigo-400",cyan:"text-cyan-600 dark:text-cyan-400",emerald:"text-emerald-600 dark:text-emerald-400"},b={green:"border-l-4 border-green-500",blue:"border-l-4 border-blue-500",purple:"border-l-4 border-purple-500",orange:"border-l-4 border-orange-500",red:"border-l-4 border-red-500",indigo:"border-l-4 border-indigo-500",cyan:"border-l-4 border-cyan-500",emerald:"border-l-4 border-emerald-500",pink:"border-l-4 border-pink-500",gray:"border-l-4 border-gray-500"},v={green:"bg-green-100 dark:bg-green-900/20",blue:"bg-blue-100 dark:bg-blue-900/20",purple:"bg-purple-100 dark:bg-purple-900/20",orange:"bg-orange-100 dark:bg-orange-900/20",red:"bg-red-100 dark:bg-red-900/20",indigo:"bg-indigo-100 dark:bg-indigo-900/20",cyan:"bg-cyan-100 dark:bg-cyan-900/20",emerald:"bg-emerald-100 dark:bg-emerald-900/20",pink:"bg-pink-100 dark:bg-pink-900/20",gray:"bg-gray-100 dark:bg-gray-900/20"},k=m[s],S=typeof e=="string",x=()=>t.jsxs(t.Fragment,{children:[S?t.jsx("div",{className:"text-4xl mb-4",children:e}):u?t.jsx("div",{className:f("w-12 h-12","rounded-lg","flex items-center justify-center","mb-4",v[s],k),children:e}):t.jsx("div",{className:f("flex-shrink-0 mb-4",k),children:e}),t.jsxs("div",{className:"flex-1",children:[t.jsx("h3",{className:"text-xl font-semibold text-gray-900 dark:text-white mb-3",children:r}),t.jsx("p",{className:"text-gray-600 dark:text-gray-300 mb-4 leading-relaxed",children:a}),d&&t.jsx("div",{className:"mt-3 mb-4",children:d}),n&&n.length>0&&t.jsx("ul",{className:"space-y-2 mb-4",children:n.map((E,A)=>t.jsxs("li",{className:"flex items-start",children:[t.jsx("div",{className:f("w-2 h-2 rounded-full mt-2 mr-3 flex-shrink-0",`bg-${s}-500`)}),t.jsx("span",{className:"text-sm text-gray-600 dark:text-gray-400",children:E})]},A))}),o&&Object.keys(o).length>0&&t.jsx("div",{className:"grid grid-cols-2 gap-4 mt-4",children:Object.entries(o).map(([E,A],C)=>t.jsxs("div",{className:"text-center p-3 bg-gray-50 dark:bg-gray-700/50 rounded-lg",children:[t.jsx("div",{className:f("text-lg font-bold",k),children:A}),t.jsx("div",{className:"text-xs text-gray-500 dark:text-gray-400 mt-1",children:E})]},C))})]})]}),N=f("p-6 rounded-xl shadow-lg hover:shadow-xl transition-all duration-200",u&&b[s],(h||i)&&"cursor-pointer hover:scale-[1.02]",l?"bg-gradient-to-br from-blue-50 to-indigo-50 dark:from-blue-900/20 dark:to-indigo-900/20 border-blue-200 dark:border-blue-800 border":"bg-white dark:bg-gray-800 border-gray-200 dark:border-gray-700 border",y),w=E=>{i&&("key"in E?(E.key==="Enter"||E.key===" ")&&(E.preventDefault(),i()):i())};return c?t.jsx("a",{href:c,className:f(N,"block group"),onClick:i?E=>{E.preventDefault(),w(E)}:void 0,children:t.jsx(x,{})}):i?t.jsx("div",{className:N,onClick:w,onKeyDown:w,role:"button",tabIndex:0,"aria-label":r,children:t.jsx(x,{})}):t.jsx("div",{className:N,children:t.jsx(x,{})})},Bd=X.cva("grid gap-8",{variants:{columns:{1:"grid-cols-1",2:"grid-cols-1 md:grid-cols-2",3:"grid-cols-1 md:grid-cols-2 lg:grid-cols-3",4:"grid-cols-1 md:grid-cols-2 lg:grid-cols-4"},spacing:{sm:"gap-4",md:"gap-8",lg:"gap-12"}},defaultVariants:{columns:3,spacing:"md"}}),Fd=X.cva("group transition-all duration-300",{variants:{variant:{default:"text-center",left:"text-left",hoverable:"text-center hover:transform hover:scale-105 cursor-pointer",card:"bg-white dark:bg-gray-800 rounded-2xl p-8 shadow-lg hover:shadow-xl text-center",minimal:"text-center space-y-4"},animation:{none:"",hover:"hover:transform hover:scale-105",float:"hover:-translate-y-2"}},defaultVariants:{variant:"default",animation:"hover"}}),Wd=X.cva("flex items-center justify-center rounded-2xl mb-6 transition-all duration-300",{variants:{size:{sm:"w-16 h-16",md:"w-20 h-20",lg:"w-24 h-24"},style:{gradient:"bg-gradient-to-br from-blue-100 to-blue-200 dark:from-blue-900/30 dark:to-blue-800/30 group-hover:from-blue-200 group-hover:to-blue-300 dark:group-hover:from-blue-800/40 dark:group-hover:to-blue-700/40",solid:"bg-blue-100 dark:bg-blue-900/30 group-hover:bg-blue-200 dark:group-hover:bg-blue-800/40",outline:"border-2 border-blue-200 dark:border-blue-800 group-hover:border-blue-300 dark:group-hover:border-blue-700",colorful:"group-hover:scale-110"},position:{center:"mx-auto",left:"",right:"ml-auto"}},defaultVariants:{size:"md",style:"gradient",position:"center"}}),Vd={success:"bg-green-100 text-green-800 dark:bg-green-900/30 dark:text-green-300",info:"bg-blue-100 text-blue-800 dark:bg-blue-900/30 dark:text-blue-300",warning:"bg-amber-100 text-amber-800 dark:bg-amber-900/30 dark:text-amber-300",default:"bg-gray-100 text-gray-800 dark:bg-gray-800 dark:text-gray-300"},$d=({className:e,features:r,columns:a=3,spacing:n="md",cardVariant:o="default",cardAnimation:s="hover",iconSize:l="md",iconStyle:c="gradient",iconPosition:d="center",titleClass:i,descriptionClass:h,animate:u=!0,animationDelay:y=0,staggerDelay:m=100,onFeatureClick:b,defaultLinkText:v="Learn more"})=>{const k=(x,N)=>{if(c==="colorful"&&x.gradient)return{background:`linear-gradient(135deg, ${x.gradient.from}, ${x.gradient.to})`};if(c==="colorful"){const w=[{from:"#3B82F6",to:"#1D4ED8"},{from:"#10B981",to:"#059669"},{from:"#8B5CF6",to:"#7C3AED"},{from:"#F59E0B",to:"#D97706"},{from:"#EF4444",to:"#DC2626"},{from:"#06B6D4",to:"#0891B2"}],E=w[N%w.length];return{background:`linear-gradient(135deg, ${E.from}, ${E.to})`}}},S=(x,N)=>{const w=t.jsxs("div",{className:f(Fd({variant:o,animation:s})),onClick:()=>b?.(x),role:b?"button":void 0,tabIndex:b?0:void 0,children:[x.badge&&t.jsx("div",{className:"mb-4",children:t.jsx("span",{className:f("inline-flex items-center px-2.5 py-0.5 rounded-full text-xs font-medium",Vd[x.badge.variant||"default"]),children:x.badge.text})}),t.jsx("div",{className:f(Wd({size:l,style:c,position:d})),style:k(x,N),children:t.jsx("div",{className:f("flex items-center justify-center",c==="colorful"?"text-white":"text-blue-600 dark:text-blue-400"),children:x.icon})}),t.jsx("h3",{className:f("text-xl font-bold text-gray-900 dark:text-white mb-4",i),children:x.title}),t.jsx("div",{className:f("text-gray-600 dark:text-gray-300 leading-relaxed",h),children:x.description}),x.link&&t.jsx("div",{className:"mt-6",children:t.jsxs("a",{href:x.link.href,className:"inline-flex items-center text-blue-600 dark:text-blue-400 hover:text-blue-700 dark:hover:text-blue-300 font-medium transition-colors duration-200",children:[x.link.text||v,t.jsx("svg",{className:"w-4 h-4 ml-1",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:t.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 5l7 7-7 7"})})]})})]});return t.jsx("div",{children:w},x.id||N)};return t.jsx("div",{className:f(Bd({columns:a,spacing:n}),e),children:r.map(S)})},Br=(e,r,a,n)=>({icon:e,title:r,description:a,...n}),Hd=e=>[Br(t.jsx("svg",{className:"w-8 h-8",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:t.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 15v2m-6 4h12a2 2 0 002-2v-6a2 2 0 00-2-2H6a2 2 0 00-2 2v6a2 2 0 002 2zm10-10V7a4 4 0 00-8 0v4h8z"})}),e?.passwordlessTitle||"Passwordless Security",e?.passwordlessDescription||"Authenticate using your Web3 wallet - no passwords to remember or lose."),Br(t.jsx("svg",{className:"w-8 h-8",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:t.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 12l2 2 4-4m5.618-4.016A11.955 11.955 0 0112 2.944a11.955 11.955 0 01-8.618 3.40A12.02 12.02 0 003 9c0 5.591 3.824 10.29 9 11.622 5.176-1.332 9-6.03 9-11.622 0-1.042-.133-2.052-.382-3.016z"})}),e?.encryptionTitle||"End-to-End Encryption",e?.encryptionDescription||"Your emails are encrypted and only you can read them.")],qd=({title:e,description:r,primaryButton:a,secondaryButton:n,gradient:o={from:"blue-600",to:"purple-600"},textColor:s="light",className:l="",size:c="lg"})=>{const{paddingClass:d}=ue(),h=(()=>{const k=o.via?`${o.from}-${o.via}-${o.to}`:`${o.from}-${o.to}`;return{"blue-600-purple-600":"bg-gradient-to-r from-blue-600 to-purple-600 dark:from-blue-700 dark:to-purple-700","orange-900-red-900":"bg-gradient-to-r from-orange-600 to-red-600 dark:from-orange-700 dark:to-red-700","green-600-blue-600":"bg-gradient-to-r from-green-600 to-blue-600 dark:from-green-700 dark:to-blue-700","purple-600-pink-600":"bg-gradient-to-r from-purple-600 to-pink-600 dark:from-purple-700 dark:to-pink-700"}[k]||"bg-gradient-to-r from-blue-600 to-purple-600 dark:from-blue-700 dark:to-purple-700"})(),u=s==="light"?"text-white":"text-gray-900 dark:text-gray-100",y={sm:"py-12",md:"py-16",lg:"py-20"},m={sm:"text-2xl md:text-3xl",md:"text-3xl md:text-4xl",lg:"text-4xl md:text-5xl"},b={sm:"text-base md:text-lg",md:"text-lg md:text-xl",lg:"text-xl md:text-2xl"},v=(k,S=!1)=>{const x=()=>k.variant==="primary"||S?"gradient":(k.variant==="secondary","outline"),N=t.jsx(ne,{variant:x(),size:"lg",className:S?"":"bg-white/10 hover:bg-white/20 backdrop-blur-sm border-white/30",children:k.label});return k.external?t.jsx("a",{href:k.href,target:"_blank",rel:"noopener noreferrer",children:N}):t.jsx(Z.Link,{to:k.href,children:N})};return t.jsxs("section",{className:`${h} ${y[c]} relative overflow-hidden ${l}`,children:[t.jsx("div",{className:"absolute inset-0 bg-black/20"}),t.jsxs("div",{className:"absolute top-0 left-1/2 transform -translate-x-1/2 w-full h-full",children:[t.jsx("div",{className:"absolute top-10 left-10 w-72 h-72 bg-white/10 rounded-full blur-3xl"}),t.jsx("div",{className:"absolute bottom-10 right-10 w-72 h-72 bg-white/10 rounded-full blur-3xl"})]}),t.jsxs("div",{className:`relative z-10 max-w-4xl mx-auto ${d} text-center`,children:[t.jsx("h2",{className:`${m[c]} font-bold ${u} mb-6`,children:e}),t.jsx("p",{className:`${b[c]} ${u}/90 mb-8 max-w-2xl mx-auto`,children:r}),t.jsxs("div",{className:"flex flex-col sm:flex-row gap-4 justify-center",children:[v(a,!0),n&&v(n,!1)]})]})]})},Gd={pending:{label:"Pending",color:"bg-gray-500",textColor:"text-white"},in_progress:{label:"In Progress",color:"bg-blue-500",textColor:"text-white"},verified:{label:"Verified",color:"bg-green-500",textColor:"text-white"},rejected:{label:"Rejected",color:"bg-red-500",textColor:"text-white"}},Yd={basic:"Basic KYC",enhanced:"Enhanced KYC",accredited:"Accredited Investor"},Kd=({status:e,level:r,className:a=""})=>{const n=Gd[e],o=Yd[r];return t.jsx("div",{className:`inline-flex items-center gap-2 ${a}`,children:t.jsxs("span",{className:`px-3 py-1 rounded-full text-sm font-medium ${n.color} ${n.textColor}`,children:[o,": ",n.label]})})},Xd=({accessToken:e,onComplete:r,onError:a,className:n=""})=>{const o=p.useRef(null),s=p.useRef(null);return p.useEffect(()=>{if(!e)return;const l=document.createElement("script");return l.src="https://static.sumsub.com/idensic/static/sns-websdk-builder.js",l.async=!0,l.onload=()=>{if(o.current&&window.snsWebSdk)try{const c=window.snsWebSdk.init(e,()=>e).withConf({lang:"en"}).withOptions({addViewportTag:!1,adaptIframeHeight:!0}).on("idCheck.onStepCompleted",d=>{}).on("idCheck.onApplicantSubmitted",d=>{r?.()}).on("idCheck.onError",d=>{console.error("SumsubWebSDK: Error",d),a?.(d)}).build();s.current=c,c.launch("#sumsub-websdk-container")}catch(c){console.error("Failed to initialize Sumsub SDK:",c),a?.(c)}else console.error("SumsubWebSDK: Missing requirements - containerRef:",!!o.current,"snsWebSdk:",!!window.snsWebSdk)},l.onerror=()=>{const c=new Error("Failed to load Sumsub Web SDK script");console.error(c),a?.(c)},document.body.appendChild(l),()=>{document.body.contains(l)&&document.body.removeChild(l),s.current&&typeof s.current.destroy=="function"&&s.current.destroy()}},[e,r,a]),t.jsx("div",{className:`sumsub-sdk-container ${n}`,children:t.jsx("div",{ref:o,id:"sumsub-websdk-container"})})},Zd={basic:{title:"Basic KYC",description:"Age & Identity Verification",color:"border-blue-200",activeColor:"border-blue-500 bg-blue-50"},enhanced:{title:"Enhanced KYC",description:"Basic + Country & Compliance",color:"border-purple-200",activeColor:"border-purple-500 bg-purple-50"},accredited:{title:"Accredited Investor",description:"Enhanced + Financial Verification",color:"border-gold-200",activeColor:"border-gold-500 bg-gold-50"}},Jd=({level:e,price:r,features:a,isActive:n=!1,isVerified:o=!1,onSelect:s,className:l=""})=>{const c=Zd[e];return t.jsxs("div",{className:`
@@ -62,13 +62,13 @@ Nonce: ${u}`}function a(i,h=24){const u=new Date(i.getTime()+h*60*60*1e3);return
62
62
  `,children:[o&&t.jsx("div",{className:"absolute top-4 right-4",children:t.jsx("span",{className:"inline-flex items-center px-2 py-1 rounded-full text-xs font-medium bg-green-100 text-green-800",children:"✓ Verified"})}),t.jsx("h3",{className:"text-xl font-bold mb-2",children:c.title}),t.jsx("p",{className:"text-gray-600 mb-4",children:c.description}),t.jsxs("p",{className:"text-3xl font-bold mb-4",children:[r,t.jsx("span",{className:"text-sm font-normal text-gray-600",children:"/year"})]}),t.jsx("ul",{className:"space-y-2 mb-6",children:a.map((d,i)=>t.jsxs("li",{className:"flex items-start gap-2",children:[t.jsx("span",{className:"text-green-500 mt-0.5",children:"✓"}),t.jsx("span",{className:"text-sm",children:d})]},i))}),s&&t.jsx("button",{onClick:s,disabled:o,className:`
63
63
  w-full py-2 px-4 rounded font-medium transition-colors
64
64
  ${o?"bg-gray-200 text-gray-500 cursor-not-allowed":n?"bg-blue-600 text-white hover:bg-blue-700":"bg-gray-200 text-gray-700 hover:bg-gray-300"}
65
- `,children:o?"Verified":n?"Current Plan":"Select Plan"})]})},Qd=({children:e,backgroundClassName:r="",contentClassName:a=""})=>t.jsx("div",{className:r,children:t.jsx("div",{className:a,children:e})}),Rd=({title:e,description:r})=>t.jsxs("div",{className:"mb-8",children:[t.jsx("h1",{className:"text-3xl font-bold text-gray-900 dark:text-white",children:e}),r&&t.jsx("p",{className:"mt-2 text-gray-600 dark:text-gray-400",children:r})]}),e0=({children:e,mode:r,className:a,as:n="div",withPadding:o=!0})=>{const s=ue(),l=r?r0(r,o):o?s.containerClass:s.maxWidthClass;return t.jsx(n,{className:f(l,a),children:e})};function r0(e,r){const a={standard:"max-w-7xl mx-auto",wide:"max-w-[1920px] mx-auto",full:"w-full"};return r?`${a[e]} px-4`:a[e]}const t0=({variant:e="full",sticky:r=!1,className:a,children:n})=>{const{containerClass:o}=ue(),s=e==="compact";return t.jsx("footer",{className:f("bg-gray-900 text-white transition-all duration-300 ease-in-out",s?"py-4":"py-12",r?"sticky bottom-0 z-50 border-t border-gray-700":"relative z-10","pointer-events-auto",a),children:t.jsx("div",{className:o,children:n})})},a0=({children:e,className:r})=>t.jsx("div",{className:f("grid md:grid-cols-5 gap-8",r),children:e}),n0=({children:e,description:r,className:a})=>t.jsxs("div",{className:a,children:[t.jsx("div",{className:"mb-4",children:e}),r&&t.jsx("p",{className:U.body.sm(),children:r})]}),o0=({title:e,children:r,className:a})=>t.jsxs("div",{className:a,children:[t.jsx("h3",{className:f(U.heading.h5(),"mb-4 text-white"),children:e}),t.jsx("ul",{className:f("space-y-2",U.body.sm()),children:r})]}),s0=({children:e,className:r})=>t.jsx("li",{className:f("hover:text-white transition-colors",r),children:e}),l0=({children:e,className:r})=>t.jsx("div",{className:f("border-t mt-8 pt-8 text-center space-y-4",Mn.border.default,r),children:e}),i0=({children:e,className:r})=>p.Children.toArray(e).filter(Boolean).length===0?null:t.jsx("div",{className:f("flex items-center justify-center gap-3 text-gray-400 text-sm",r),children:e}),c0=({children:e,className:r})=>t.jsx("div",{className:f("flex flex-col sm:flex-row justify-between items-center space-y-2 sm:space-y-0",r),children:e}),d0=({children:e,className:r})=>t.jsx("div",{className:f("flex items-center gap-3 text-gray-400 text-sm",r),children:e}),g0=({children:e,className:r})=>t.jsx("div",{className:f("flex space-x-6 text-sm",r),children:e}),u0=({version:e,className:r})=>t.jsxs("span",{className:f("text-gray-500",r),children:["v",e]}),h0=({year:e,companyName:r,rightsText:a,companyLink:n,className:o})=>t.jsxs("span",{className:o,children:["© ",e," ",n||t.jsx("span",{className:"text-blue-400",children:r}),a&&`. ${a}`]}),ve=({href:e,label:r,children:a})=>t.jsx(Rt,{content:r,children:t.jsx("a",{href:e,target:"_blank",rel:"noopener noreferrer",className:"text-gray-400 hover:text-white transition-colors","aria-label":r,children:a})}),f0=({twitterUrl:e,redditUrl:r,discordUrl:a,linkedinUrl:n,farcasterUrl:o,telegramUrl:s,githubUrl:l,className:c})=>e||r||a||n||o||s||l?t.jsxs("div",{className:f("flex items-center gap-4",c),children:[e&&t.jsx(ve,{href:e,label:"Twitter / X",children:t.jsx("svg",{className:"w-5 h-5",fill:"currentColor",viewBox:"0 0 24 24","aria-hidden":"true",children:t.jsx("path",{d:"M18.244 2.25h3.308l-7.227 8.26 8.502 11.24H16.17l-5.214-6.817L4.99 21.75H1.68l7.73-8.835L1.254 2.25H8.08l4.713 6.231zm-1.161 17.52h1.833L7.084 4.126H5.117z"})})}),r&&t.jsx(ve,{href:r,label:"Reddit",children:t.jsx("svg",{className:"w-5 h-5",fill:"currentColor",viewBox:"0 0 24 24","aria-hidden":"true",children:t.jsx("path",{d:"M12 0A12 12 0 0 0 0 12a12 12 0 0 0 12 12 12 12 0 0 0 12-12A12 12 0 0 0 12 0zm5.01 4.744c.688 0 1.25.561 1.25 1.249a1.25 1.25 0 0 1-2.498.056l-2.597-.547-.8 3.747c1.824.07 3.48.632 4.674 1.488.308-.309.73-.491 1.207-.491.968 0 1.754.786 1.754 1.754 0 .716-.435 1.333-1.01 1.614a3.111 3.111 0 0 1 .042.52c0 2.694-3.13 4.87-7.004 4.87-3.874 0-7.004-2.176-7.004-4.87 0-.183.015-.366.043-.534A1.748 1.748 0 0 1 4.028 12c0-.968.786-1.754 1.754-1.754.463 0 .898.196 1.207.49 1.207-.883 2.878-1.43 4.744-1.487l.885-4.182a.342.342 0 0 1 .14-.197.35.35 0 0 1 .238-.042l2.906.617a1.214 1.214 0 0 1 1.108-.701zM9.25 12C8.561 12 8 12.562 8 13.25c0 .687.561 1.248 1.25 1.248.687 0 1.248-.561 1.248-1.249 0-.688-.561-1.249-1.249-1.249zm5.5 0c-.687 0-1.248.561-1.248 1.25 0 .687.561 1.248 1.249 1.248.688 0 1.249-.561 1.249-1.249 0-.687-.562-1.249-1.25-1.249zm-5.466 3.99a.327.327 0 0 0-.231.094.33.33 0 0 0 0 .463c.842.842 2.484.913 2.961.913.477 0 2.105-.056 2.961-.913a.361.361 0 0 0 .029-.463.33.33 0 0 0-.464 0c-.547.533-1.684.73-2.512.73-.828 0-1.979-.196-2.512-.73a.326.326 0 0 0-.232-.095z"})})}),a&&t.jsx(ve,{href:a,label:"Discord",children:t.jsx("svg",{className:"w-5 h-5",fill:"currentColor",viewBox:"0 0 24 24","aria-hidden":"true",children:t.jsx("path",{d:"M20.317 4.37a19.791 19.791 0 0 0-4.885-1.515.074.074 0 0 0-.079.037c-.21.375-.444.864-.608 1.25a18.27 18.27 0 0 0-5.487 0 12.64 12.64 0 0 0-.617-1.25.077.077 0 0 0-.079-.037A19.736 19.736 0 0 0 3.677 4.37a.07.07 0 0 0-.032.027C.533 9.046-.32 13.58.099 18.057a.082.082 0 0 0 .031.057 19.9 19.9 0 0 0 5.993 3.03.078.078 0 0 0 .084-.028 14.09 14.09 0 0 0 1.226-1.994.076.076 0 0 0-.041-.106 13.107 13.107 0 0 1-1.872-.892.077.077 0 0 1-.008-.128 10.2 10.2 0 0 0 .372-.292.074.074 0 0 1 .077-.01c3.928 1.793 8.18 1.793 12.062 0a.074.074 0 0 1 .078.01c.12.098.246.198.373.292a.077.077 0 0 1-.006.127 12.299 12.299 0 0 1-1.873.892.077.077 0 0 0-.041.107c.36.698.772 1.362 1.225 1.993a.076.076 0 0 0 .084.028 19.839 19.839 0 0 0 6.002-3.03.077.077 0 0 0 .032-.054c.5-5.177-.838-9.674-3.549-13.66a.061.061 0 0 0-.031-.03zM8.02 15.33c-1.183 0-2.157-1.085-2.157-2.419 0-1.333.956-2.419 2.157-2.419 1.21 0 2.176 1.096 2.157 2.42 0 1.333-.956 2.418-2.157 2.418zm7.975 0c-1.183 0-2.157-1.085-2.157-2.419 0-1.333.955-2.419 2.157-2.419 1.21 0 2.176 1.096 2.157 2.42 0 1.333-.946 2.418-2.157 2.418z"})})}),n&&t.jsx(ve,{href:n,label:"LinkedIn",children:t.jsx("svg",{className:"w-5 h-5",fill:"currentColor",viewBox:"0 0 24 24","aria-hidden":"true",children:t.jsx("path",{d:"M20.447 20.452h-3.554v-5.569c0-1.328-.027-3.037-1.852-3.037-1.853 0-2.136 1.445-2.136 2.939v5.667H9.351V9h3.414v1.561h.046c.477-.9 1.637-1.85 3.37-1.85 3.601 0 4.267 2.37 4.267 5.455v6.286zM5.337 7.433c-1.144 0-2.063-.926-2.063-2.065 0-1.138.92-2.063 2.063-2.063 1.14 0 2.064.925 2.064 2.063 0 1.139-.925 2.065-2.064 2.065zm1.782 13.019H3.555V9h3.564v11.452zM22.225 0H1.771C.792 0 0 .774 0 1.729v20.542C0 23.227.792 24 1.771 24h20.451C23.2 24 24 23.227 24 22.271V1.729C24 .774 23.2 0 22.222 0h.003z"})})}),o&&t.jsx(ve,{href:o,label:"Farcaster",children:t.jsx("svg",{className:"w-5 h-5",fill:"currentColor",viewBox:"0 0 24 24","aria-hidden":"true",children:t.jsx("path",{d:"M18.24 2.4H5.76a3.36 3.36 0 0 0-3.36 3.36v12.48a3.36 3.36 0 0 0 3.36 3.36h12.48a3.36 3.36 0 0 0 3.36-3.36V5.76a3.36 3.36 0 0 0-3.36-3.36zm-2.16 13.2h-1.2v-4.8h-5.76v4.8H7.92V8.4h1.2v3.6h5.76V8.4h1.2v7.2z"})})}),s&&t.jsx(ve,{href:s,label:"Telegram",children:t.jsx("svg",{className:"w-5 h-5",fill:"currentColor",viewBox:"0 0 24 24","aria-hidden":"true",children:t.jsx("path",{d:"M11.944 0A12 12 0 0 0 0 12a12 12 0 0 0 12 12 12 12 0 0 0 12-12A12 12 0 0 0 12 0a12 12 0 0 0-.056 0zm4.962 7.224c.1-.002.321.023.465.14a.506.506 0 0 1 .171.325c.016.093.036.306.02.472-.18 1.898-.962 6.502-1.36 8.627-.168.9-.499 1.201-.82 1.23-.696.065-1.225-.46-1.9-.902-1.056-.693-1.653-1.124-2.678-1.8-1.185-.78-.417-1.21.258-1.91.177-.184 3.247-2.977 3.307-3.23.007-.032.014-.15-.056-.212s-.174-.041-.249-.024c-.106.024-1.793 1.14-5.061 3.345-.48.33-.913.49-1.302.48-.428-.008-1.252-.241-1.865-.44-.752-.245-1.349-.374-1.297-.789.027-.216.325-.437.893-.663 3.498-1.524 5.83-2.529 6.998-3.014 3.332-1.386 4.025-1.627 4.476-1.635z"})})}),l&&t.jsx(ve,{href:l,label:"GitHub",children:t.jsx("svg",{className:"w-5 h-5",fill:"currentColor",viewBox:"0 0 24 24","aria-hidden":"true",children:t.jsx("path",{fillRule:"evenodd",d:"M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-1.703-2.782.605-3.369-1.343-3.369-1.343-.454-1.158-1.11-1.466-1.11-1.466-.908-.62.069-.608.069-.608 1.003.07 1.531 1.032 1.531 1.032.892 1.53 2.341 1.088 2.91.832.092-.647.35-1.088.636-1.338-2.22-.253-4.555-1.113-4.555-4.951 0-1.093.39-1.988 1.029-2.688-.103-.253-.446-1.272.098-2.65 0 0 .84-.27 2.75 1.026A9.564 9.564 0 0 1 12 6.844c.85.004 1.705.115 2.504.337 1.909-1.296 2.747-1.027 2.747-1.027.546 1.379.202 2.398.1 2.651.64.7 1.028 1.595 1.028 2.688 0 3.848-2.339 4.695-4.566 4.943.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0 0 22 12.017C22 6.484 17.522 2 12 2z",clipRule:"evenodd"})})})]}):null,b0=({isSelected:e,onClick:r,icon:a,label:n,description:o,className:s=""})=>t.jsxs("div",{onClick:r,className:`relative flex items-start p-4 cursor-pointer transition-all border-b border-gray-200 dark:border-gray-700 last:border-b-0 group ${s}`,children:[e&&t.jsx("div",{className:"absolute inset-1 bg-blue-500/10 dark:bg-blue-400/10 rounded-lg pointer-events-none"}),t.jsxs("div",{className:"relative z-10 flex items-start w-full",children:[a&&t.jsx(a,{className:`h-5 w-5 mt-0.5 mr-3 flex-shrink-0 transition-colors ${e?"text-blue-600 dark:text-blue-400":"text-gray-500 dark:text-gray-400 group-hover:text-gray-700 dark:group-hover:text-gray-300"}`}),t.jsxs("div",{className:"flex-1 min-w-0",children:[t.jsx("div",{className:`font-medium transition-colors ${e?"text-blue-600 dark:text-blue-400":"text-gray-900 dark:text-gray-100 group-hover:text-gray-700 dark:group-hover:text-gray-300"}`,children:n}),o&&t.jsx("div",{className:`text-xs mt-0.5 transition-colors ${e?"text-blue-500 dark:text-blue-300":"text-gray-500 dark:text-gray-400"}`,children:o})]})]})]}),m0=({masterTitle:e,masterSubtitle:r,backButtonText:a,masterContent:n,detailContent:o,detailTitle:s,mobileView:l="navigation",onBackToNavigation:c,masterClassName:d="",detailClassName:i="",detailTitleClassName:h="",masterWidth:u=320,stickyMaster:y=!0,stickyTopOffset:m=96,desktopGap:b=32,showMasterBackground:v=!0,enableAnimations:k=!0,animationDuration:S=300,animationRef:x})=>{const{containerClass:N}=ue(),w=`gap-${Math.round(b/4)}`||"gap-8",E=V=>V?V.split("-")[0].trim():"Back",A=a?E(a):e?E(e):"Back",[C,I]=p.useState(!1),[L,O]=p.useState("auto"),M=p.useRef(null),D=p.useRef(null);p.useEffect(()=>(x&&(x.current={triggerTransition:V=>{if(!k){V();return}if(M.current){const R=M.current.scrollHeight;O(R)}I(!0),D.current&&clearTimeout(D.current),D.current=setTimeout(()=>{V(),setTimeout(()=>{if(M.current){const R=M.current.scrollHeight;O(R),setTimeout(()=>{O("auto"),I(!1)},S)}},50)},S/2)}}),()=>{D.current&&clearTimeout(D.current)}),[k,S,x]);const B=k?{height:L==="auto"?"auto":`${L}px`,transition:`height ${S}ms cubic-bezier(0.4, 0, 0.2, 1)`,width:"100%",maxWidth:"100%"}:{width:"100%",maxWidth:"100%"},z=k?`${C?"opacity-0 transform translate-y-2":"opacity-100 transform translate-y-0"}`:"",F=k?{transition:`opacity ${S}ms ease-in-out, transform ${S}ms ease-in-out`}:{};return t.jsxs(t.Fragment,{children:[t.jsx("div",{className:`md:hidden ${l==="navigation"?"block":"hidden"} flex-1`,children:t.jsxs("div",{className:v?"bg-white dark:bg-gray-800 p-6":"p-6",children:[e&&t.jsxs("div",{className:N,children:[t.jsx("h2",{className:"text-xl font-semibold text-gray-900 dark:text-white mb-4",children:e}),r&&t.jsx("p",{className:"text-sm text-gray-600 dark:text-gray-400 mb-6 break-all",children:r})]}),t.jsx("div",{className:d,children:n})]})}),t.jsxs("div",{className:`${N} py-8`,children:[t.jsxs("div",{className:`md:hidden ${l==="content"?"block":"hidden"}`,children:[l==="content"&&c&&t.jsxs("button",{onClick:c,className:"mb-4 px-4 py-2 border border-gray-300 dark:border-gray-600 rounded-md text-sm font-medium text-gray-700 dark:text-gray-300 bg-white dark:bg-gray-800 hover:bg-gray-50 dark:hover:bg-gray-700 transition-colors",children:["← ",A]}),t.jsx("div",{ref:M,className:`bg-white dark:bg-gray-800 rounded-lg border border-gray-200 dark:border-gray-700 p-8 overflow-hidden ${i}`,style:B,children:t.jsxs("div",{className:z,style:F,children:[s&&t.jsx("h1",{className:`text-4xl font-bold text-gray-900 dark:text-white mb-6 ${h}`,children:s}),o]})})]}),t.jsxs("div",{className:`hidden md:flex min-h-full ${w}`,style:{width:"100%"},children:[t.jsx("aside",{className:"flex-shrink-0",style:{width:`${u}px`,minWidth:`${u}px`},children:t.jsxs("div",{className:y?"sticky":"",style:y?{top:`${m}px`}:void 0,children:[e&&t.jsx("h2",{className:"text-lg font-semibold text-gray-900 dark:text-white mb-4",children:e}),r&&t.jsx("p",{className:"text-sm text-gray-600 dark:text-gray-400 mb-6 break-all",children:r}),t.jsx("div",{className:`bg-white dark:bg-gray-800 rounded-lg border border-gray-200 dark:border-gray-700 ${y?"max-h-[calc(100vh-200px)] overflow-y-auto":""} ${d}`,children:n})]})}),t.jsx("div",{className:"flex-1 min-w-0",style:{width:`calc(100% - ${u+b}px)`},children:t.jsx("div",{ref:M,className:`bg-white dark:bg-gray-800 rounded-lg border border-gray-200 dark:border-gray-700 p-8 overflow-hidden ${i}`,style:B,children:t.jsxs("div",{className:z,style:F,children:[s&&t.jsx("h1",{className:`text-4xl font-bold text-gray-900 dark:text-white mb-6 ${h}`,children:s}),o]})})})]})]})]})},y0=({children:e,topBar:r,footer:a,breadcrumbSection:n,stickyHeader:o=!0,layoutMode:s="standard",className:l,contentClassName:c,headerZIndex:d=40})=>{const i=r||n;return t.jsx(na,{mode:s,children:t.jsxs("div",{className:f("min-h-screen bg-gray-50 dark:bg-gray-900 flex flex-col",l),children:[i&&t.jsxs("div",{className:o?"sticky top-0":"",style:o?{zIndex:d}:void 0,children:[r,n]}),t.jsx("div",{className:f("flex-1",c),children:e}),a]})})},Fr=p.createContext(null),la=({children:e,variant:r="default",sticky:a=!0})=>{const[n,o]=p.useState(!1),s=p.useCallback(()=>{o(l=>!l)},[]);return t.jsx(Fr.Provider,{value:{variant:r,sticky:a,mobileMenuOpen:n,setMobileMenuOpen:o,toggleMobileMenu:s},children:e})},Wr=()=>{const e=p.useContext(Fr);if(!e)throw new Error("useTopbar must be used within a TopbarProvider");return e},ia={sm:"min-h-12",md:"min-h-14",lg:"min-h-16"},p0={default:"bg-white dark:bg-gray-900 border-b border-gray-200 dark:border-gray-700",app:"bg-white dark:bg-gray-900 border-b border-gray-200 dark:border-gray-700 shadow-sm",minimal:"bg-transparent",transparent:"bg-white/80 dark:bg-gray-900/80 border-b border-gray-200/50 dark:border-gray-700/50"},v0={default:"z-40",high:"z-50",highest:"z-[60]"},k0=({children:e,variant:r="default",sticky:a=!0,className:n,height:o="md",blur:s=!1,zIndex:l="high","aria-label":c="Main navigation"})=>{const{containerClass:d}=ue();return t.jsx(la,{variant:r,sticky:a,children:t.jsxs("header",{role:"banner","aria-label":c,className:f("w-full",ia[o],p0[r],v0[l],a&&"sticky top-0",s&&"backdrop-blur-md","transition-colors duration-200",n),children:[t.jsx("a",{href:"#main-content",className:"sr-only focus:not-sr-only focus:absolute focus:top-2 focus:left-2 bg-blue-600 text-white px-4 py-2 rounded-md z-50 focus:outline-none focus:ring-2 focus:ring-blue-500 focus:ring-offset-2",children:"Skip to main content"}),t.jsx("div",{className:f(d,ia[o],"flex flex-wrap items-center justify-between"),children:e})]})})},x0=({children:e,className:r})=>t.jsx("div",{className:f("flex items-center gap-2 shrink-0",r),children:e}),w0=({children:e,className:r})=>t.jsx("div",{className:f("flex-1 flex items-center justify-center px-4",r),children:e}),N0=({children:e,className:r})=>t.jsx("div",{className:f("flex items-center gap-2 shrink-0",r),children:e}),C0=({children:e,className:r})=>t.jsx("div",{className:f("md:hidden w-full basis-full pt-2 pb-3",r),children:e}),S0=({className:e})=>t.jsx("div",{className:f("hidden md:block h-6 w-px bg-gray-200 dark:bg-gray-700 mx-2",e),role:"separator","aria-orientation":"vertical"}),E0={sm:"h-6",md:"h-8",lg:"h-10"},A0=({children:e,src:r,alt:a="Logo",onClick:n,href:o,className:s,size:l="md"})=>{const c=e||r&&t.jsx("img",{src:r,alt:a,className:f(E0[l],"w-auto object-contain")}),d=f("flex items-center","hover:opacity-80 transition-opacity duration-200","focus:outline-none focus:ring-2 focus:ring-blue-500 focus:ring-offset-2 rounded-md",s);return o?t.jsx("a",{href:o,className:d,title:a,children:c}):n?t.jsx("button",{type:"button",onClick:n,className:d,title:a,"aria-label":`Go to ${a||"home"}`,children:c}):t.jsx("div",{className:d,children:c})},T0={sm:"sm:hidden",md:"md:hidden",lg:"lg:hidden",xl:"xl:hidden"},I0=({className:e,isOpen:r})=>t.jsx("svg",{className:e,fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,"aria-hidden":"true",children:r?t.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 18L18 6M6 6l12 12"}):t.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M4 6h16M4 12h16M4 18h16"})}),ca=({icon:e,"aria-label":r="Toggle navigation menu",className:a,onClick:n,hideAbove:o="lg",menuItems:s,LinkComponent:l})=>{const{mobileMenuOpen:c,toggleMobileMenu:d,setMobileMenuOpen:i}=Wr(),[h,u]=p.useState(!1),y=p.useRef(null);rr(y,()=>{u(!1)});const m=s?h:c,b=()=>{n?n():s?u(!h):d()},v=()=>{u(!1),i(!1)};return t.jsxs("div",{className:f("relative",T0[o]),ref:y,children:[t.jsx("button",{type:"button",onClick:b,className:f("p-2 rounded-lg","text-gray-600 dark:text-gray-400","hover:bg-gray-100 dark:hover:bg-gray-700","hover:text-gray-900 dark:hover:text-gray-100","focus:outline-none focus:ring-2 focus:ring-blue-500 focus:ring-offset-2","transition-colors duration-200",a),"aria-label":r,"aria-expanded":m,"aria-haspopup":s?"menu":void 0,"aria-controls":s?"topbar-dropdown-menu":"mobile-menu",children:e?t.jsx(e,{className:"h-6 w-6"}):t.jsx(I0,{className:"h-6 w-6",isOpen:m})}),s&&h&&t.jsx("div",{id:"topbar-dropdown-menu",role:"menu",className:f("absolute left-0 top-full mt-2","min-w-[200px] py-2 rounded-lg","bg-white dark:bg-gray-800","border border-gray-200 dark:border-gray-700","shadow-lg","z-50"),children:s.map(k=>{const S=k.icon,x=t.jsxs(t.Fragment,{children:[S&&t.jsx(S,{className:"h-5 w-5 mr-3 flex-shrink-0"}),t.jsx("span",{children:k.label})]}),N=f("flex items-center w-full px-4 py-2.5 text-sm font-medium","text-gray-700 dark:text-gray-300","hover:bg-gray-100 dark:hover:bg-gray-700","hover:text-gray-900 dark:hover:text-gray-100","transition-colors duration-150",k.active&&"bg-blue-50 dark:bg-blue-900/20 text-blue-600 dark:text-blue-400",k.disabled&&"opacity-50 cursor-not-allowed");return k.href&&l?t.jsx(l,{href:k.href,className:N,children:t.jsx("div",{className:"flex items-center",onClick:v,children:x})},k.id):k.href?t.jsx("a",{href:k.href,role:"menuitem",className:N,onClick:v,children:x},k.id):t.jsx("button",{type:"button",role:"menuitem",className:N,onClick:()=>{v(),k.onClick?.()},disabled:k.disabled,children:x},k.id)})})]})},L0={sm:{show:"hidden sm:flex",hide:"sm:hidden"},md:{show:"hidden md:flex",hide:"md:hidden"},lg:{show:"hidden lg:flex",hide:"lg:hidden"},xl:{show:"hidden xl:flex",hide:"xl:hidden"}},M0={left:"justify-start",center:"justify-center",right:"justify-end"},da=({items:e,className:r,collapseBelow:a="lg",LinkComponent:n,align:o="center"})=>{const[s,l]=p.useState(null),c=p.useRef(null);rr(c,()=>l(null));const d=(i,h=!1)=>{const u=i.children&&i.children.length>0,y=s===i.id,m=f("px-3 py-2 rounded-md text-sm font-medium","transition-colors duration-200",i.active?"text-blue-600 dark:text-blue-400 bg-blue-50 dark:bg-blue-900/20":"text-gray-600 dark:text-gray-400 hover:text-gray-900 dark:hover:text-gray-100 hover:bg-gray-100 dark:hover:bg-gray-700",i.disabled&&"opacity-50 cursor-not-allowed pointer-events-none",h&&"w-full text-left",i.className);return u?t.jsxs("div",{className:"relative",ref:c,children:[t.jsxs("button",{type:"button",onClick:()=>l(y?null:i.id),className:f(m,"flex items-center gap-1"),"aria-expanded":y,"aria-haspopup":"true",disabled:i.disabled,children:[i.icon&&t.jsx(i.icon,{className:"h-4 w-4 mr-1"}),i.label,t.jsx("svg",{className:f("h-4 w-4 transition-transform duration-200",y&&"rotate-180"),fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:t.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 9l-7 7-7-7"})})]}),y&&t.jsx("div",{className:f("absolute top-full left-0 mt-1 py-1","min-w-[200px] rounded-md shadow-lg","bg-white dark:bg-gray-800","border border-gray-200 dark:border-gray-700","z-50"),children:i.children?.map(b=>t.jsx(Vr,{item:b,LinkComponent:n,className:f("block px-4 py-2 text-sm","text-gray-700 dark:text-gray-300","hover:bg-gray-100 dark:hover:bg-gray-700",b.active&&"bg-blue-50 dark:bg-blue-900/20 text-blue-600 dark:text-blue-400"),onClick:()=>l(null)},b.id))})]},i.id):t.jsx(Vr,{item:i,LinkComponent:n,className:m},i.id)};return t.jsx("nav",{className:f("flex items-center gap-1",L0[a].show,M0[o],r),"aria-label":"Main navigation",children:e.map(i=>d(i))})},Vr=({item:e,LinkComponent:r,className:a,onClick:n})=>{const o=()=>{n?.(),e.onClick?.()},s=t.jsxs(t.Fragment,{children:[e.icon&&t.jsx(e.icon,{className:"h-4 w-4 mr-2"}),e.label]});return e.href&&r?t.jsx(r,{href:e.href,className:f(a,"flex items-center"),children:s}):e.href?t.jsx("a",{href:e.href,className:f(a,"flex items-center"),onClick:o,children:s}):t.jsx("button",{type:"button",onClick:o,className:f(a,"flex items-center"),disabled:e.disabled,children:s})},P0=({items:e,isOpen:r,className:a,LinkComponent:n})=>{const{mobileMenuOpen:o,setMobileMenuOpen:s}=Wr();return r??o?t.jsx("div",{id:"mobile-menu",className:f("lg:hidden","border-t border-gray-200 dark:border-gray-700","bg-white dark:bg-gray-900","shadow-lg",a),children:t.jsx("nav",{className:"px-4 py-2 space-y-1","aria-label":"Mobile navigation",children:e.map(c=>t.jsx(Vr,{item:c,LinkComponent:n,className:f("flex items-center w-full px-3 py-2 rounded-md text-base font-medium","transition-colors duration-200",c.active?"text-blue-600 dark:text-blue-400 bg-blue-50 dark:bg-blue-900/20":"text-gray-600 dark:text-gray-400 hover:text-gray-900 dark:hover:text-gray-100 hover:bg-gray-100 dark:hover:bg-gray-700",c.className),onClick:()=>s(!1)},c.id))})}):null},O0=({items:e,LinkComponent:r,collapseBelow:a="lg",align:n="center",className:o,mobileMenuLabel:s="Toggle navigation menu",children:l})=>t.jsxs(t.Fragment,{children:[t.jsx(ca,{hideAbove:a,menuItems:e,LinkComponent:r,"aria-label":s,className:o}),l,t.jsx(da,{items:e,collapseBelow:a,LinkComponent:r,align:n,className:o})]}),U0={sm:"gap-1",md:"gap-2",lg:"gap-3"},D0={left:"justify-start",center:"justify-center",right:"justify-end"},z0=({children:e,className:r,gap:a="md",align:n="right"})=>t.jsx("div",{className:f("flex items-center",U0[a],D0[n],r),children:e}),j0={sm:"h-4 w-4",md:"h-5 w-5",lg:"h-6 w-6"},_0={sm:"p-1.5",md:"p-2",lg:"p-2.5"},B0=({icon:e,onClick:r,"aria-label":a,className:n,disabled:o=!1,badge:s,size:l="md"})=>t.jsxs("button",{type:"button",onClick:r,className:f("relative rounded-lg",_0[l],"text-gray-500 dark:text-gray-400","hover:bg-gray-100 dark:hover:bg-gray-700","hover:text-gray-700 dark:hover:text-gray-200","focus:outline-none focus:ring-2 focus:ring-blue-500 focus:ring-offset-2","transition-colors duration-200",o&&"opacity-50 cursor-not-allowed",n),"aria-label":a,disabled:o,children:[t.jsx(e,{className:j0[l]}),s!==void 0&&s>0&&t.jsx("span",{className:f("absolute -top-1 -right-1","min-w-[18px] h-[18px] px-1","flex items-center justify-center","text-xs font-medium","bg-red-500 text-white rounded-full","ring-2 ring-white dark:ring-gray-900"),"aria-label":`${s} notifications`,children:s>99?"99+":s})]}),F0={sm:"w-48",md:"w-64",lg:"w-96",full:"w-full"},W0=({placeholder:e="Search...",value:r,onChange:a,onSubmit:n,className:o,width:s="md",showOnMobile:l=!1})=>{const[c,d]=p.useState(r||""),i=u=>{const y=u.target.value;d(y),a?.(y)},h=u=>{u.preventDefault(),n?.(c)};return t.jsx("form",{onSubmit:h,className:f(!l&&"hidden md:block",o),role:"search",children:t.jsxs("div",{className:"relative",children:[t.jsx("svg",{className:"absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-gray-400",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor","aria-hidden":"true",children:t.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z"})}),t.jsx("input",{type:"search",value:c,onChange:i,placeholder:e,"aria-label":e,className:f(F0[s],"pl-10 pr-4 py-2","text-sm","bg-gray-100 dark:bg-gray-800","border border-transparent","rounded-lg","text-gray-900 dark:text-gray-100","placeholder:text-gray-500 dark:placeholder:text-gray-400","focus:outline-none focus:ring-2 focus:ring-blue-500 focus:bg-white dark:focus:bg-gray-700 focus:border-transparent","transition-colors duration-200")})]})})},V0=({children:e,appName:r,appUrl:a,apiUrl:n})=>(p.useEffect(()=>{const o=()=>{[].forEach(b=>{const v=document.createElement("link");v.rel="preload",v.href=b.href,v.as=b.as,b.type&&(v.type=b.type),b.crossorigin&&(v.crossOrigin=""),document.head.appendChild(v)})},s=()=>{document.querySelectorAll('img[data-priority="high"]').forEach(v=>{v.fetchPriority="high"});const b=document.querySelector("[data-hero]");if(b){const v=b.getAttribute("data-bg-image");if(v){const k=document.createElement("link");k.rel="preload",k.href=v,k.as="image",document.head.appendChild(k)}}},l=()=>{document.querySelectorAll("img:not([width]):not([height])").forEach(v=>{const k=v;k.naturalWidth&&k.naturalHeight&&(k.width=k.naturalWidth,k.height=k.naturalHeight)}),document.querySelectorAll("[data-dynamic]").forEach(v=>{v.getAttribute("style")?.includes("min-height")||(v.style.minHeight="200px")})},c=()=>{const m=()=>{document.querySelectorAll("script[data-defer]").forEach(k=>{k.setAttribute("defer","")})};"requestIdleCallback"in window?requestIdleCallback(()=>{m()}):setTimeout(m,1),(()=>{["scroll","touchstart","touchmove","wheel"].forEach(k=>{document.addEventListener(k,()=>{},{passive:!0})})})()},d=()=>{},i=()=>{[{rel:"dns-prefetch",href:"//fonts.googleapis.com"},...n?[{rel:"dns-prefetch",href:`//${n.replace(/^https?:\/\//,"")}`}]:[],{rel:"preconnect",href:"https://fonts.gstatic.com",crossorigin:!0},...n?[{rel:"preconnect",href:n}]:[]].forEach(b=>{const v=document.createElement("link");v.rel=b.rel,v.href=b.href,b.crossorigin&&(v.crossOrigin=""),document.head.appendChild(v)})},h=()=>{if(document.querySelectorAll("img[data-lazy]").forEach(b=>{b.loading="lazy"}),"IntersectionObserver"in window){const b=new IntersectionObserver(k=>{k.forEach(S=>{if(S.isIntersecting){const x=S.target;x.dataset.src&&(x.src=x.dataset.src,x.removeAttribute("data-src")),b.unobserve(x)}})},{rootMargin:"50px 0px"});document.querySelectorAll("img[data-src]").forEach(k=>b.observe(k))}},u=()=>{[{name:"ai-content-type",content:"web3-email-platform"},{name:"ai-primary-function",content:"wallet-based-email"},{name:"ai-supported-chains",content:"ethereum,solana,polygon,arbitrum,optimism"},{name:"ai-complexity-level",content:"beginner-to-advanced"},{name:"ai-target-users",content:"web3-users,crypto-enthusiasts,developers"},{name:"machine-readable",content:"true"},{name:"structured-data",content:"json-ld"},{name:"content-category",content:"technology,blockchain,communication"},{name:"interaction-model",content:"wallet-authentication"}].forEach(({name:k,content:S})=>{if(!document.querySelector(`meta[name="${k}"]`)){const x=document.createElement("meta");x.name=k,x.content=S,document.head.appendChild(x)}});const b={"@context":"https://schema.org","@type":"WebApplication",name:r,description:"Web3 email platform using blockchain wallet authentication",url:a,applicationCategory:"CommunicationApplication",operatingSystem:"Web Browser",offers:{"@type":"Offer",price:"0",priceCurrency:"USD"},featureList:["Wallet-based authentication","ENS domain email support","SNS domain email support","Multi-chain compatibility","Smart contract integration","Web2/Web3 bridge"],audience:{"@type":"Audience",audienceType:"Web3 Users"}},v=document.createElement("script");v.type="application/ld+json",v.textContent=JSON.stringify(b),document.head.appendChild(v)},y=()=>{document.querySelectorAll('link[rel="stylesheet"][data-non-critical]').forEach(b=>{const v=b.cloneNode(!0);v.rel="preload",v.as="style",v.onload=()=>{v.onload=null,v.rel="stylesheet"},document.head.appendChild(v),b.remove()})};return o(),s(),l(),c(),i(),h(),u(),y(),setTimeout(d,2e3),()=>{}},[n,r,a]),t.jsx(t.Fragment,{children:e})),$0=()=>(p.useEffect(()=>{if(typeof window>"u"||typeof document>"u"||!document.documentElement)return;const e=()=>{if("IntersectionObserver"in window){const c=new IntersectionObserver(d=>{d.forEach(i=>{if(i.isIntersecting){const h=i.target;h.dataset.src&&(h.src=h.dataset.src,h.removeAttribute("data-src"),c.unobserve(h))}})},{rootMargin:"50px 0px"});document.querySelectorAll("img[data-src]").forEach(d=>{c.observe(d)})}const o=()=>{["/connect","/mail","/settings"].forEach(d=>{const i=document.createElement("link");i.rel="prefetch",i.href=d,document.head.appendChild(i)})},s=()=>{if(!document.querySelector("script[data-wallet-detection]")){const c=document.createElement("script");c.dataset.walletDetection="true",c.innerHTML='(function() { window.walletPreload = { hasMetaMask: typeof window.ethereum !== "undefined", hasPhantom: typeof window.solana !== "undefined", hasWalletConnect: true }; })();',document.head.appendChild(c)}},l=()=>{document.querySelectorAll("img[data-hero]").forEach(c=>{const d=c;d.loading="eager","fetchPriority"in d&&(d.fetchPriority="high")}),document.querySelectorAll('img[data-priority="low"]').forEach(c=>{const d=c;d.loading="lazy","fetchPriority"in d&&(d.fetchPriority="low")})};requestIdleCallback(()=>{o(),s(),l()},{timeout:2e3})},r=()=>{if("PerformanceObserver"in window){const o=new PerformanceObserver(l=>{const c=l.getEntries(),d=c[c.length-1];d&&d.startTime>2500&&(document.documentElement.style.setProperty("--animation-duration","0s"),localStorage.setItem("reduce-image-quality","true"))});try{o.observe({entryTypes:["largest-contentful-paint"]})}catch{}const s=new PerformanceObserver(l=>{let c=0;for(const d of l.getEntries())d.hadRecentInput||(c+=d.value);c>.1&&document.querySelectorAll("img:not([width]):not([height])").forEach(d=>{const i=d;i.style.aspectRatio="16/9"})});try{s.observe({entryTypes:["layout-shift"]})}catch{}}},a=()=>{if("connection"in navigator&&typeof document<"u"&&document.documentElement){const o=navigator.connection;if(o){const s=o.effectiveType;s==="slow-2g"||s==="2g"?(document.documentElement.classList.add("slow-connection"),document.querySelectorAll('link[rel="prefetch"]').forEach(l=>{l.getAttribute("data-critical")||l.remove()}),localStorage.setItem("use-low-quality-images","true")):s==="3g"?document.documentElement.classList.add("moderate-connection"):document.documentElement.classList.add("fast-connection")}}};return(()=>{e(),r(),a()})(),()=>{if("PerformanceObserver"in window)try{PerformanceObserver.supportedEntryTypes.forEach(()=>{})}catch{}}},[]),null),H0=({children:e})=>t.jsx(t.Fragment,{children:e}),ga={user:{duration:300*1e3,maxSize:100,staleWhileRevalidate:!0},mailboxes:{duration:120*1e3,maxSize:50,staleWhileRevalidate:!0},addresses:{duration:600*1e3,maxSize:50,staleWhileRevalidate:!0},messages:{duration:30*1e3,maxSize:200,staleWhileRevalidate:!0},messageDetails:{duration:120*1e3,maxSize:100,staleWhileRevalidate:!1},messageCount:{duration:10*1e3,maxSize:20,staleWhileRevalidate:!0}};class q0{constructor(){this.cache=new Map}set(r,a,n){if(this.cache.size>=n.maxSize){const o=this.cache.keys().next().value;o&&this.cache.delete(o)}this.cache.set(r,{data:a,timestamp:Date.now(),isStale:!1})}get(r,a){const n=this.cache.get(r);if(!n)return null;const s=Date.now()-n.timestamp>a.duration;return s&&!a.staleWhileRevalidate?(this.cache.delete(r),null):{data:n.data,isStale:s}}invalidate(r){for(const a of this.cache.keys())a.includes(r)&&this.cache.delete(a)}clear(){this.cache.clear()}getStats(){return{size:this.cache.size,keys:Array.from(this.cache.keys()),memory:this.estimateMemoryUsage()}}estimateMemoryUsage(){return Array.from(this.cache.values()).reduce((r,a)=>r+JSON.stringify(a).length*2,0)}}const Ae=new q0,ke=new Map,ua=async(e,r,a="messages")=>{const n=ga[a],o=Ae.get(e,n);if(o&&!o.isStale)return o.data;const s=ke.get(e);if(s)return s;if(o&&o.isStale&&n.staleWhileRevalidate){const c=r().then(d=>(Ae.set(e,d,n),ke.delete(e),d)).catch(d=>{throw ke.delete(e),d});return ke.set(e,c),o.data}const l=r().then(c=>(Ae.set(e,c,n),ke.delete(e),c)).catch(c=>{throw ke.delete(e),c});return ke.set(e,l),l};class G0{constructor(){this.queue=[],this.timer=null,this.batchDelay=10}add(r,a){return new Promise((n,o)=>{this.queue.push({key:r,fetcher:a,resolve:n,reject:o}),this.timer&&clearTimeout(this.timer),this.timer=setTimeout(()=>{this.processBatch()},this.batchDelay)})}async processBatch(){const r=[...this.queue];this.queue.length=0,this.timer=null;const a=this.groupRequests(r);for(const n of a)await Promise.allSettled(n.map(async o=>{try{const s=await o.fetcher();o.resolve(s)}catch(s){o.reject(s)}}))}groupRequests(r){const a=[];for(let o=0;o<r.length;o+=5)a.push(r.slice(o,o+5));return a}}const Y0=new G0;class K0{constructor(r,a={}){this.requestInterceptors=[],this.responseInterceptors=[],this.baseURL=r,this.defaultHeaders=a}addRequestInterceptor(r){this.requestInterceptors.push(r)}addResponseInterceptor(r){this.responseInterceptors.push(r)}async request(r,a={},n,o="messages"){const s=`${this.baseURL}${r}`,l=n||`${a.method||"GET"}:${s}`,c=async()=>{let d={...a,headers:{...this.defaultHeaders,...a.headers}};for(const h of this.requestInterceptors)d=h(d);let i=await fetch(s,d);for(const h of this.responseInterceptors)i=await h(i);if(!i.ok)throw new Error(`API Error: ${i.status} ${i.statusText}`);return i.json()};return a.method==="GET"&&this.shouldBatch(r)?Y0.add(l,c):ua(l,c,o)}shouldBatch(r){return r.includes("/messages/")&&!r.includes("/messages?")}async get(r,a){return this.request(r,{method:"GET"},void 0,a)}async post(r,a){return this.request(r,{method:"POST",body:JSON.stringify(a)})}async put(r,a){return this.request(r,{method:"PUT",body:JSON.stringify(a)})}async delete(r){return this.request(r,{method:"DELETE"})}}const X0=async(e,r=3,a=1e3)=>{let n;for(let o=0;o<=r;o++)try{return await e()}catch(s){if(n=s,o===r)throw n;const l=a*Math.pow(2,o)+Math.random()*1e3;await new Promise(c=>setTimeout(c,l))}throw n};class Z0{constructor(){this.abortController=new AbortController}async request(r,a={}){const n=await fetch(r,{...a,signal:this.abortController.signal});if(!n.ok)throw new Error(`HTTP ${n.status}: ${n.statusText}`);return n.json()}cancel(){this.abortController.abort()}}const J0={invalidate:e=>Ae.invalidate(e),clear:()=>Ae.clear(),getStats:()=>Ae.getStats(),warmUp:async e=>{await Promise.allSettled(e.map(r=>r()))},prefetch:async e=>{"requestIdleCallback"in window?window.requestIdleCallback(async()=>{await Promise.allSettled(e.map(r=>r()))}):setTimeout(async()=>{await Promise.allSettled(e.map(r=>r()))},100)}};function ha(){if(typeof window>"u")return!1;const e=window.navigator.userAgent.toLowerCase();return["metamask","trustwallet","coinbase","rainbow","phantom","solflare","exodus","ledger","binance","okx"].some(a=>e.includes(a))}function fa(){return typeof window>"u"?!1:window.location.hostname==="localhost"||window.location.hostname==="127.0.0.1"}function ba(){if(typeof window>"u")return!1;const e=window.location.hostname;return/^\d+\.\d+\.\d+\.\d+$/.test(e)}function ma(){return fa()?"localhost":ha()?"wallet-browser":ba()?"network":"production"}function Q0(){const e=ma();return e==="localhost"||e==="wallet-browser"}function R0(e){}function ya(){return typeof window<"u"}function eg(){return typeof window<"u"}function rg(e,r){if(ya())e();else return r}const $r=e=>({"default-src":["'self'"],"script-src":["'self'","'unsafe-inline'","'unsafe-eval'","https://fonts.googleapis.com","https://www.googletagmanager.com","https://www.google-analytics.com"],"style-src":["'self'","'unsafe-inline'","https://fonts.googleapis.com","https://fonts.gstatic.com"],"font-src":["'self'","https://fonts.gstatic.com","data:"],"img-src":["'self'","data:","https:","blob:"],"connect-src":["'self'",...e?.apiUrls||[],...e?.appUrls||[],"https://*.walletconnect.com","https://*.walletconnect.org","https://registry.walletconnect.com","https://relay.walletconnect.com","wss://*.walletconnect.com","wss://*.walletconnect.org","https://keys.coinbase.com","https://api.coinbase.com","https://www.walletlink.org","https://mainnet.infura.io","https://polygon-rpc.com","https://rpc.ankr.com","https://cloudflare-eth.com","https://eth-mainnet.alchemyapi.io","https://api.phantom.app","https://solana-api.projectserum.com","https://api.mainnet-beta.solana.com","https://api.devnet.solana.com","wss://api.phantom.app","wss://api.devnet.solana.com","wss://api.mainnet-beta.solana.com","https://bridge.arbitrum.io","https://polygon-mainnet.infura.io","https://optimism-mainnet.infura.io"],"frame-src":["'self'","https://verify.walletconnect.com","https://verify.walletconnect.org"],"worker-src":["'self'","blob:"],"child-src":["'self'","https://verify.walletconnect.com"],"object-src":["'none'"],"base-uri":["'self'"],"form-action":["'self'"]}),tg=$r(),pa=e=>{const r=$r(e);return Object.entries(r).map(([a,n])=>`${a} ${n.join(" ")}`).join("; ")},va=e=>({"X-Frame-Options":"DENY","X-Content-Type-Options":"nosniff","X-XSS-Protection":"1; mode=block","Referrer-Policy":"strict-origin-when-cross-origin","Permissions-Policy":"camera=(), microphone=(), geolocation=(), interest-cohort=()","Strict-Transport-Security":"max-age=31536000; includeSubDomains; preload","Cross-Origin-Embedder-Policy":"credentialless","Cross-Origin-Opener-Policy":"same-origin-allow-popups","Cross-Origin-Resource-Policy":"cross-origin","Content-Security-Policy":pa(e)}),ag=va(),ng={fonts:"public, max-age=31536000, immutable",images:"public, max-age=31536000, immutable",js:"public, max-age=31536000, immutable",css:"public, max-age=31536000, immutable",serviceWorker:"public, max-age=0, must-revalidate",manifest:"public, max-age=86400",api:"no-cache, no-store, must-revalidate"},og=()=>{typeof window<"u"&&document.addEventListener("securitypolicyviolation",()=>{})},sg={walletConnections:"Always verify wallet signatures and never trust client-side data",rpcEndpoints:"Use reputable RPC providers and consider rate limiting",contractInteractions:"Validate all smart contract interactions on the backend",userInput:"Sanitize all user inputs, especially wallet addresses and transaction data",privateKeys:"Never log, store, or transmit private keys - they should remain in wallets only",phishing:"Implement strict CSP to prevent injection of malicious scripts that could steal wallet access"},ce=new Map,Fe=new Map,ir=new Set;let We="medium",Hr=!1;function lg(){if("connection"in navigator){const a=navigator.connection;a&&(We=a.effectiveType==="4g"?"fast":a.effectiveType==="3g"?"medium":"slow")}const e=navigator.deviceMemory,r=navigator.hardwareConcurrency;Hr=e&&e<4||r&&r<4}lg();function ig(e,r,a={}){const{retries:n=3,timeout:o=1e4,fallback:s,preloadCondition:l,cacheStrategy:c="memory",priority:d="medium",onLoad:i,onError:h}=a;if(ce.has(r))return ce.get(r).component;const u=p.lazy(async()=>{const m=performance.now();if(Fe.has(r))return Fe.get(r).then(v=>({default:v}));const b=cg(e,n,o);Fe.set(r,b.then(v=>v.default));try{const v=await b,k=performance.now()-m;if(c!=="none"){const S={component:v.default,timestamp:Date.now(),loadTime:k};if(ce.set(r,S),c==="session")try{sessionStorage.setItem(`lazy_${r}`,JSON.stringify({timestamp:S.timestamp,loadTime:k}))}catch{}}return Fe.delete(r),i?.(v.default),v}catch(v){throw Fe.delete(r),h?.(v),v}}),y=m=>{const[b,v]=p.useState(!0);p.useEffect(()=>{if(l&&!ce.has(r)&&l()&&!ir.has(r)){ir.add(r);const x=dg(d,We);setTimeout(()=>{e().catch(()=>{})},x)}},[]);const k=s||t.jsxs("div",{className:"flex items-center justify-center p-4",children:[t.jsx("div",{className:"animate-spin rounded-full h-6 w-6 border-b-2 border-blue-500"}),t.jsxs("span",{className:"ml-2 text-sm text-gray-600",children:["Loading ",r.replace(/([A-Z])/g," $1").trim(),"..."]})]});return!b&&Hr&&We==="slow"?t.jsx("div",{className:"lazy-placeholder",children:t.jsxs("button",{onClick:()=>v(!0),className:"load-component-btn",children:["Load ",r]})}):t.jsx(p.Suspense,{fallback:k,children:t.jsx(u,{...m})})};return y.displayName=`AdvancedLazy(${r})`,y}async function cg(e,r,a){let n;for(let o=0;o<r;o++)try{const s=new Promise((c,d)=>{setTimeout(()=>d(new Error("Load timeout")),a)});return await Promise.race([e(),s])}catch(s){if(n=s,o<r-1){const l=Math.pow(2,o)*1e3,c=Math.random()*1e3;await new Promise(d=>setTimeout(d,l+c))}}throw n}function dg(e,r){const a={critical:0,high:500,medium:2e3,low:5e3},n={fast:.5,medium:1,slow:2},o=a[e]||2e3,s=n[r]||1;return o*s}const Ye=class Ye{static registerRoute(r,a){this.routeMap.set(r,a),this.routeUsageStats.set(r,0)}static setCurrentRoute(r){this.currentRoute=r;const a=this.routeUsageStats.get(r)||0;this.routeUsageStats.set(r,a+1),this.preloadLikelyRoutes(r)}static preloadLikelyRoutes(r){this.getRouteTransitionProbability(r).forEach(({route:n,probability:o})=>{o>.3&&!ce.has(n)&&setTimeout(()=>{this.routeMap.get(n)},We==="fast"?1e3:3e3)})}static getRouteTransitionProbability(r){const a=[];switch(r){case"/":a.push({route:"/connect",probability:.7},{route:"/about",probability:.2},{route:"/document",probability:.1});break;case"/connect":a.push({route:"/mail",probability:.8},{route:"/settings",probability:.1});break;case"/mail":a.push({route:"/compose",probability:.4},{route:"/settings",probability:.2});break;default:a.push({route:"/",probability:.1})}return a}static getStats(){return{routeCount:this.routeMap.size,cacheSize:ce.size,currentRoute:this.currentRoute,usageStats:Object.fromEntries(this.routeUsageStats)}}};Ye.routeMap=new Map,Ye.routeUsageStats=new Map,Ye.currentRoute="";let qr=Ye;const gg=({src:e,alt:r,className:a,placeholder:n,priority:o="medium"})=>{const[s,l]=p.useState(!1),[c,d]=p.useState(!1),i=p.useRef(null);p.useEffect(()=>{if(!i.current)return;if(o==="high"){d(!0);return}const u=new IntersectionObserver(([y])=>{y.isIntersecting&&(d(!0),u.unobserve(y.target))},{rootMargin:o==="low"?"100px":"200px",threshold:.1});return u.observe(i.current),()=>u.disconnect()},[o]);const h=()=>{l(!0)};return t.jsxs("div",{className:`lazy-image-container ${a}`,children:[t.jsx("img",{ref:i,src:c?e:n||"data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB2aWV3Qm94PSIwIDAgMSAxIiBmaWxsPSJub25lIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjxyZWN0IHdpZHRoPSIxIiBoZWlnaHQ9IjEiIGZpbGw9IiNGM0Y0RjYiLz48L3N2Zz4=",alt:r,className:`transition-opacity duration-300 ${s?"opacity-100":"opacity-0"}`,onLoad:h,loading:o==="high"?"eager":"lazy",fetchPriority:o==="high"?"high":"low"}),!s&&c&&t.jsx("div",{className:"absolute inset-0 bg-gray-200 animate-pulse rounded"})]})};function ug(){ce.clear(),ir.clear()}function hg(){return{cachedComponents:ce.size,preloadQueue:ir.size,networkSpeed:We,isLowEndDevice:Hr,cacheEntries:Array.from(ce.entries()).map(([e,r])=>({name:e,loadTime:r.loadTime,age:Date.now()-r.timestamp}))}}const fg=({message:e})=>t.jsxs("div",{className:"flex items-center justify-center p-4",children:[t.jsx("div",{className:"animate-spin rounded-full h-6 w-6 border-b-2 border-blue-500"}),t.jsx("span",{className:"ml-2 text-sm text-gray-600",children:e})]}),bg=e=>{if(typeof e=="function"||typeof e=="object")return e;switch(e){case"minimal":return()=>t.jsx("div",{className:"flex justify-center items-center p-4",children:"Loading..."});case"skeleton":return()=>t.jsxs("div",{className:"animate-pulse",children:[t.jsx("div",{className:"h-4 bg-gray-200 rounded w-3/4 mb-2"}),t.jsx("div",{className:"h-4 bg-gray-200 rounded w-1/2"})]});case"default":default:return()=>t.jsx(fg,{message:"Loading component..."})}},ka=(e,r="default",a=3)=>{const n=p.lazy(async()=>{let s=null;for(let l=0;l<a;l++)try{return await e()}catch(c){s=c,l<a-1&&await new Promise(d=>setTimeout(d,Math.pow(2,l)*1e3))}throw s}),o=bg(r);return s=>t.jsx(p.Suspense,{fallback:t.jsx(o,{}),children:t.jsx(n,{...s})})},mg=async e=>{try{await e()}catch{}},yg=e=>{const r={};return Object.entries(e).forEach(([a,n])=>{r[a]=ka(n,"skeleton")}),r},pg=e=>e,xa={critical:["/","/connect","/mail"],secondary:["/settings","/compose","/points"],optional:["/document","/about","/terms","/privacy"]},Ke=class Ke{static add(r,a){this.preloadedComponents.has(r)||(this.preloadQueue.push({name:r,loader:a}),this.processQueue())}static async processQueue(){this.isPreloading||this.preloadQueue.length===0||(this.isPreloading=!0,"requestIdleCallback"in window?window.requestIdleCallback(async()=>{const r=this.preloadQueue.shift();if(r)try{await r.loader(),this.preloadedComponents.add(r.name)}catch{}this.isPreloading=!1,this.processQueue()}):setTimeout(async()=>{const r=this.preloadQueue.shift();if(r)try{await r.loader(),this.preloadedComponents.add(r.name)}catch{}this.isPreloading=!1,this.processQueue()},100))}static isPreloaded(r){return this.preloadedComponents.has(r)}static clear(){this.preloadedComponents.clear(),this.preloadQueue=[],this.isPreloading=!1}};Ke.preloadedComponents=new Set,Ke.preloadQueue=[],Ke.isPreloading=!1;let Gr=Ke;const vg=()=>{"requestIdleCallback"in window&&window.requestIdleCallback(()=>{xa.secondary.forEach(e=>{})})},wa=({message:e})=>t.jsxs("div",{className:"flex items-center justify-center p-4",children:[t.jsx("div",{className:"animate-spin rounded-full h-6 w-6 border-b-2 border-blue-500"}),t.jsx("span",{className:"ml-2 text-sm text-gray-600",children:e})]}),Ve=new Map;function kg(e,r){const{condition:a,fallback:n,retries:o=3,timeout:s=1e4,priority:l="medium",cacheKey:c=`conditional-${Math.random()}`}=r,d=i=>{const[h,u]=p.useState(!1),[y,m]=p.useState(null);return p.useEffect(()=>{const k=setTimeout(async()=>{const S=Ve.get(c);if(S&&S.isValid&&Date.now()-S.lastCheck<3e5)try{if(await S.condition()){m(()=>S.component),u(!0);return}}catch{}try{if(await a()){const N=await Ng(e,o,s);Ve.set(c,{component:N.default,condition:a,lastCheck:Date.now(),isValid:!0}),m(()=>N.default),u(!0)}}catch{}},l==="high"?0:l==="medium"?100:500);return()=>clearTimeout(k)},[]),h?y?t.jsx(p.Suspense,{fallback:n||t.jsx(wa,{message:"Loading component..."}),children:t.jsx(y,{...i})}):null:n||t.jsx(wa,{message:"Checking conditions..."})};return d.displayName=`ConditionalLazy(${c})`,d}const xg={},wg={};async function Ng(e,r,a){let n;for(let o=0;o<r;o++)try{const s=new Promise((l,c)=>{setTimeout(()=>c(new Error("Import timeout")),a)});return await Promise.race([e(),s])}catch(s){if(n=s,o<r-1){const l=Math.pow(2,o)*1e3;await new Promise(c=>setTimeout(c,l))}}throw n}function Cg(){Ve.clear()}function Sg(){return{cachedComponents:Ve.size,cacheEntries:Array.from(Ve.entries()).map(([e,r])=>({key:e,lastCheck:r.lastCheck,isValid:r.isValid,age:Date.now()-r.lastCheck}))}}const Na=[{name:"react-router",path:"/assets/react-router-*.js",size:12,config:{priority:"critical",condition:()=>!0}},{name:"app-core",path:"/assets/app-core-*.js",size:25,config:{priority:"high",condition:()=>window.location.pathname==="/",delay:1e3,onIdle:!0}},{name:"wagmi",path:"/assets/wagmi-*.js",size:15,config:{priority:"high",condition:()=>!!(window.ethereum||localStorage.getItem("walletconnect")),onIdle:!0}},{name:"wc-ethereum",path:"/assets/wc-ethereum-*.js",size:273,config:{priority:"medium",condition:()=>!!window.ethereum,delay:2e3,onHover:!0}},{name:"solana-core",path:"/assets/solana-core-*.js",size:29,config:{priority:"medium",condition:()=>!!(window.solana||window.phantom),delay:1500}},{name:"mail-features",path:"/assets/mail-features-*.js",size:10,config:{priority:"medium",condition:()=>window.location.pathname.includes("/connect")||localStorage.getItem("wallet-connected")==="true",onScroll:20}},{name:"coinbase",path:"/assets/coinbase-*.js",size:75,config:{priority:"low",condition:()=>!!window.ethereum,delay:5e3,onIdle:!0}},{name:"design-system",path:"/assets/design-system-*.js",size:112,config:{priority:"low",condition:()=>window.location.pathname.includes("/internal"),delay:3e3}}];class Eg{constructor(){this.preloaded=new Set,this.networkSpeedEstimate="medium",this.isLowEndDevice=!1,this.userActivityScore=0,this.detectNetworkSpeed(),this.detectDeviceCapability(),this.startUserActivityTracking()}detectNetworkSpeed(){if("connection"in navigator){const a=navigator.connection;if(a){const n=a.effectiveType;n==="4g"?this.networkSpeedEstimate="fast":n==="3g"?this.networkSpeedEstimate="medium":this.networkSpeedEstimate="slow"}}const r=performance.now();fetch("/favicon.ico",{method:"HEAD"}).then(()=>{const a=performance.now()-r;a<100?this.networkSpeedEstimate="fast":a<300?this.networkSpeedEstimate="medium":this.networkSpeedEstimate="slow"}).catch(()=>{this.networkSpeedEstimate="slow"})}detectDeviceCapability(){const r=navigator.deviceMemory,a=navigator.hardwareConcurrency;r&&r<4&&(this.isLowEndDevice=!0),a&&a<4&&(this.isLowEndDevice=!0),"getBattery"in navigator&&navigator.getBattery?.().then(n=>{n.level&&n.level<.2&&(this.isLowEndDevice=!0)})}startUserActivityTracking(){let r;const a=()=>{this.userActivityScore=Math.min(this.userActivityScore+1,100),clearTimeout(r),r=setTimeout(()=>{this.userActivityScore=Math.max(this.userActivityScore-1,0)},5e3)};["click","scroll","keydown","mousemove"].forEach(n=>{document.addEventListener(n,a,{passive:!0})})}shouldPreload(r){return this.networkSpeedEstimate==="slow"&&r.size>50||this.isLowEndDevice&&r.size>30?!1:r.config.condition()}async preloadChunk(r){if(!this.preloaded.has(r.name))try{if(document.querySelectorAll('script[src*="'+r.name+'"]').length===0&&document.querySelectorAll('link[href*="'+r.name+'"]').length>0)return;const n=document.createElement("link");n.rel="modulepreload",n.href=r.path.replace("*",this.getChunkHash(r.name)),n.crossOrigin="","fetchPriority"in n&&(n.fetchPriority=r.config.priority==="critical"?"high":"low"),document.head.appendChild(n),this.preloaded.add(r.name)}catch{}}getChunkHash(r){const a=Array.from(document.querySelectorAll("script[src]"));for(const n of a){const o=n.src;if(o.includes(r)){const s=o.match(new RegExp(`${r}-([A-Za-z0-9_-]+)\\.js`));if(s)return s[1]}}return"unknown"}async schedulePreload(r){const a=r.config;return a.delay&&await new Promise(n=>setTimeout(n,a.delay)),a.onIdle&&"requestIdleCallback"in window?new Promise(n=>{window.requestIdleCallback(()=>{this.preloadChunk(r).then(n)})}):this.preloadChunk(r)}initializePreloading(){Na.sort((a,n)=>{const o={critical:0,high:1,medium:2,low:3};return o[a.config.priority]-o[n.config.priority]}).forEach(a=>{this.shouldPreload(a)&&(a.config.priority==="critical"?this.preloadChunk(a):this.schedulePreload(a),a.config.onHover&&this.setupHoverPreloading(a),a.config.onScroll&&this.setupScrollPreloading(a,a.config.onScroll))}),this.startIntelligentPreloading()}setupHoverPreloading(r){document.querySelectorAll("[data-preload-on-hover]").forEach(n=>{let o=!1;n.addEventListener("mouseenter",()=>{!o&&this.userActivityScore>30&&(this.preloadChunk(r),o=!0)},{passive:!0})})}setupScrollPreloading(r,a){let n=!1;const o=()=>{if(n)return;window.scrollY/(document.body.scrollHeight-window.innerHeight)*100>=a&&(this.preloadChunk(r),n=!0,window.removeEventListener("scroll",o))};window.addEventListener("scroll",o,{passive:!0})}startIntelligentPreloading(){setTimeout(()=>{this.userActivityScore>50&&this.networkSpeedEstimate!=="slow"&&Na.filter(a=>a.config.priority==="medium"&&this.shouldPreload(a)).forEach(a=>{Math.random()>.5&&this.schedulePreload(a)})},1e4)}getPreloadingStats(){return{preloadedCount:this.preloaded.size,networkSpeed:this.networkSpeedEstimate,isLowEndDevice:this.isLowEndDevice,userActivity:this.userActivityScore}}}let $e=null;function Ag(){$e||($e=new Eg,document.readyState==="loading"?document.addEventListener("DOMContentLoaded",()=>{$e?.initializePreloading()}):$e.initializePreloading())}function Tg(){return $e?.getPreloadingStats()}function Ig(e){const r={"ai-content-type":e.contentType,"ai-primary-topic":e.primaryTopic,"ai-complexity-level":e.complexityLevel,"ai-content-purpose":e.contentPurpose,"ai-industry-vertical":e.industryVertical,"ai-semantic-keywords":e.semanticKeywords.join(","),"ai-target-audience":e.targetAudience.join(","),"ai-technical-tags":e.technicalTags.join(","),"ai-user-intent":e.userIntent.join(","),"ai-conversion-goals":e.conversionGoals.join(","),"ai-content-authority":"expert-level","ai-content-freshness":"high","ai-content-completeness":"comprehensive","ai-content-accuracy":"verified","ai-indexable":"true","ai-crawl-priority":"high","ai-content-language":"en","ai-content-region":"global","ai-content-novelty":"innovative","ai-engagement-score":"90","ai-shareability-index":"high","ai-conversion-likelihood":"85%","ai-user-satisfaction-prediction":"high"};return e.contentType==="governance-page"&&(r["ai-governance-features"]="voting-notifications,multi-sig-coordination,proposal-tracking",r["ai-dao-platforms"]="snapshot,tally,aragon,safe,decentdao",r["ai-participation-boost"]="85%",r["ai-treasury-management"]="enabled"),r}function Ca(e){const r={"@context":"https://schema.org","@type":Pg(e.contentType),name:e.primaryTopic,description:`Comprehensive ${e.primaryTopic} resource for ${e.targetAudience.join(", ")}`,about:e.semanticKeywords.map(a=>({"@type":"Thing",name:a})),audience:{"@type":"Audience",audienceType:e.targetAudience.join(", ")},educationalLevel:e.complexityLevel,inLanguage:"en",isAccessibleForFree:!0};return e.contentType==="governance-page"?{...r,"@type":"SoftwareApplication",applicationCategory:"GovernanceApplication",operatingSystem:"Web Browser",featureList:["Smart voting notifications","Multi-signature wallet coordination","Automated proposal tracking","Cross-platform DAO integration","Treasury management tools"],isRelatedTo:[{"@type":"SoftwareApplication",name:"Snapshot"},{"@type":"SoftwareApplication",name:"Tally"},{"@type":"SoftwareApplication",name:"Aragon"},{"@type":"SoftwareApplication",name:"Safe"}]}:r}function Lg(e,r){return r.map(a=>({type:"related-content",target:a.url,strength:a.relevance}))}function Sa(e){const r=["Web3 Email Platform","Web3","blockchain","email","wallet","cryptocurrency"],a=["DAO","governance","voting","multi-sig","Snapshot","Tally","Aragon","Safe","proposal","community"];return e.contentType==="governance-page"?[...r,...a]:r}function Ea(e){const r=["web3-infrastructure","email-technology","blockchain-applications"],a=["dao-governance-tools","voting-notification-systems","community-management-platforms","multi-signature-coordination","treasury-management-solutions"];return e.contentType==="governance-page"?[...r,...a]:r}function Mg(e,r){return{contentClassification:{type:e.contentType,topic:e.primaryTopic,audience:e.targetAudience.join(","),complexity:e.complexityLevel,purpose:e.contentPurpose,vertical:e.industryVertical},semanticMarkup:Ca(e),entityRecognition:Sa(e),topicClustering:Ea(e),contentRelationships:r?.contentRelationships||[],...r}}function Pg(e){return{article:"Article","landing-page":"WebPage","product-page":"Product","governance-page":"SoftwareApplication",documentation:"TechArticle"}[e]||"WebPage"}function Og(e){return{"@context":"https://schema.org","@type":"MonitorAction",name:`AI Performance Tracking - ${e}`,instrument:{"@type":"SoftwareApplication",name:"AI Analytics Platform"},measurementTechnique:["User Engagement Metrics","AI Content Understanding Score","Semantic Relevance Analysis","Conversion Optimization Tracking"],result:{"@type":"Dataset",name:`${e} Performance Data`,description:"AI-optimized performance metrics and user interaction data"}}}const Ug={governancePage:{contentType:"governance-page",primaryTopic:"DAO Governance Communication Platform",semanticKeywords:["DAO governance","voting notifications","multi-sig coordination","proposal tracking","community engagement","treasury management"],targetAudience:["DAO members","governance participants","multi-sig signers","protocol teams","community managers"],complexityLevel:"intermediate",contentPurpose:"commercial",industryVertical:"blockchain-governance",technicalTags:["snapshot","tally","aragon","safe","multi-sig","voting","proposals","treasury"],userIntent:["improve-governance","increase-participation","coordinate-multi-sig","track-proposals","engage-community"],conversionGoals:["dao-integration","governance-setup","multi-sig-connection","notification-activation"]},landingPage:{contentType:"landing-page",primaryTopic:"Web3 Email Platform",semanticKeywords:["Web3 email","wallet authentication","ENS email","SNS email","blockchain email","decentralized communication"],targetAudience:["Web3 users","crypto enthusiasts","blockchain developers","DeFi users"],complexityLevel:"beginner",contentPurpose:"commercial",industryVertical:"web3-communication",technicalTags:["ethereum","solana","ens","sns","wallet-connect","metamask","phantom"],userIntent:["create-web3-email","connect-wallet","secure-communication","eliminate-passwords"],conversionGoals:["wallet-connection","email-creation","first-email-sent","premium-upgrade"]}},Dg=({message:e,className:r})=>t.jsxs("div",{className:`flex items-center justify-center p-4 ${r||""}`,children:[t.jsx("div",{className:"animate-spin rounded-full h-6 w-6 border-b-2 border-blue-500"}),t.jsx("span",{className:"ml-2 text-sm text-gray-600",children:e})]}),Yr=new Map,He=new Set;function Kr(){const e=[];return!!window.ethereum?.isMetaMask&&(He.add("metamask"),e.push({name:"MetaMask",detected:!0,priority:1})),!!window.ethereum?.isCoinbaseWallet&&(He.add("coinbase"),e.push({name:"Coinbase Wallet",detected:!0,priority:2})),!!window.solana?.isPhantom&&(He.add("phantom"),e.push({name:"Phantom",detected:!0,priority:3})),e.push({name:"WalletConnect",detected:!0,priority:4}),e.sort((o,s)=>o.priority-s.priority)}function Xr(e){const r=`wallet-${e.toLowerCase()}`;if(Yr.has(r))return Yr.get(r);const a=()=>Promise.resolve({default:()=>p.createElement("div",{},`${e} Provider Placeholder`)}),n=p.lazy(a),o=s=>t.jsx(p.Suspense,{fallback:t.jsx(Dg,{message:`Loading ${e} wallet...`,className:"wallet-loading"}),children:t.jsx(n,{...s})});return o.displayName=`Lazy${e}Provider`,Yr.set(r,o),o}function zg({children:e}){const r=Kr();return r.filter(a=>a.priority<=2&&a.detected).forEach(a=>{setTimeout(()=>{},1e3)}),t.jsxs(t.Fragment,{children:[r.map(a=>{const n=Xr(a.name);return t.jsx(n,{},a.name)}),e]})}const Rr=class Rr{static preloadWallet(r){const a=r.toLowerCase();this.preloadedWallets.has(a)||(this.preloadedWallets.add(a),setTimeout(()=>{Xr(r)},500))}static preloadCommonWallets(){["metamask","walletconnect","coinbase"].forEach((a,n)=>{setTimeout(()=>{this.preloadWallet(a)},n*1e3)})}static getPreloadedWallets(){return Array.from(this.preloadedWallets)}};Rr.preloadedWallets=new Set;let qe=Rr;function jg(){return{availableWallets:Kr(),preloadWallet:n=>{qe.preloadWallet(n)},getDetectedWallets:()=>Array.from(He),hasWallet:n=>He.has(n.toLowerCase())}}function _g({walletName:e,onConnect:r,disabled:a=!1}){const n=()=>{qe.preloadWallet(e),setTimeout(r,100)};return t.jsxs("button",{onClick:n,disabled:a,className:"wallet-connect-btn","data-wallet":e.toLowerCase(),children:["Connect ",e]})}class Bg{constructor(){this.criticalResources=[],this.observedMetrics={fcp:0,lcp:0,fid:0,cls:0,ttfb:0},this.defineCriticalResources(),this.startPerformanceObservation()}defineCriticalResources(){this.criticalResources=[{url:"/assets/index-*.css",type:"style",priority:"critical",preload:!0},{url:"/assets/index-*.js",type:"script",priority:"critical"},{url:"/assets/react-core-*.js",type:"script",priority:"high",preload:!0},{url:"https://fonts.gstatic.com/s/inter/v12/UcCO3FwrK3iLTeHuS_fvQtMwCp50KnMw2boKoduKmMEVuLyfAZ9hiJ-Ek-_EeA.woff2",type:"font",priority:"critical",preload:!0},{url:"/logo.png",type:"image",priority:"high",preload:!0}]}startPerformanceObservation(){if("PerformanceObserver"in window)try{new PerformanceObserver(s=>{for(const l of s.getEntries())l.name==="first-contentful-paint"&&(this.observedMetrics.fcp=l.startTime,this.optimizeBasedOnFCP(l.startTime))}).observe({entryTypes:["paint"]}),new PerformanceObserver(s=>{for(const l of s.getEntries())this.observedMetrics.lcp=l.startTime,this.optimizeBasedOnLCP(l.startTime)}).observe({entryTypes:["largest-contentful-paint"]});let n=0;new PerformanceObserver(s=>{for(const l of s.getEntries())l.hadRecentInput||(n+=l.value);this.observedMetrics.cls=n}).observe({entryTypes:["layout-shift"]})}catch{}window.addEventListener("load",()=>{setTimeout(()=>{const r=performance.getEntriesByType("navigation")[0];r&&(this.observedMetrics.ttfb=r.responseStart-r.requestStart,this.optimizeBasedOnTTFB(this.observedMetrics.ttfb))},0)})}optimizeBasedOnFCP(r){r>2e3?this.applyEmergencyOptimizations():r>1500&&this.applyMediumOptimizations()}optimizeBasedOnLCP(r){r>2500&&this.optimizeLCPElements()}optimizeBasedOnTTFB(r){r>600&&this.enableAggressiveCaching()}applyEmergencyOptimizations(){document.querySelectorAll('img[data-priority="low"]').forEach(n=>{n.loading="lazy",n.style.display="none",setTimeout(()=>{n.style.display=""},3e3)}),document.querySelectorAll('script[data-priority="low"]').forEach(n=>{n.setAttribute("defer","")})}applyMediumOptimizations(){["/assets/app-core-*.js","/assets/react-router-*.js"].forEach(a=>{this.preloadResource(a,"script")})}optimizeLCPElements(){document.querySelectorAll("img[data-hero], [data-lcp-element]").forEach(n=>{n instanceof HTMLImageElement&&(n.fetchPriority="high",n.loading="eager")});const a=document.querySelector("img[data-hero]")?.getAttribute("src");a&&this.preloadResource(a,"image")}enableAggressiveCaching(){const r=document.createElement("meta");r.httpEquiv="Cache-Control",r.content="public, max-age=31536000, immutable",document.head.appendChild(r)}preloadResource(r,a){if(document.querySelector(`link[href*="${r}"]`))return;const o=document.createElement("link");switch(o.rel="preload",o.href=r,a){case"script":o.as="script";break;case"style":o.as="style";break;case"font":o.as="font",o.type="font/woff2",o.crossOrigin="";break;case"image":o.as="image";break}document.head.appendChild(o)}optimizeCriticalPath(){this.criticalResources.filter(r=>r.priority==="critical"&&r.preload).forEach(r=>{this.preloadResource(r.url,r.type)}),this.inlineCriticalCSS(),this.optimizeFontLoading(),this.removeRenderBlocking(),this.setupProgressiveLoading()}inlineCriticalCSS(){const r=document.querySelector('link[rel="stylesheet"][data-critical]');r&&this.isSmallResource(r.getAttribute("href")||"")&&fetch(r.getAttribute("href")||"").then(a=>a.text()).then(a=>{if(a.length<1e4){const n=document.createElement("style");n.textContent=a,document.head.appendChild(n),r.remove()}}).catch(()=>{})}optimizeFontLoading(){document.querySelectorAll('link[href*="fonts.googleapis.com"]').forEach(a=>{const n=a.getAttribute("href")||"";if(!n.includes("display=swap")){const o=n.includes("?")?"&":"?";a.setAttribute("href",`${n}${o}display=swap`)}})}removeRenderBlocking(){document.querySelectorAll('link[rel="stylesheet"]:not([data-critical])').forEach(a=>{const n=a.cloneNode(!0);n.rel="preload",n.as="style",n.onload=()=>{n.onload=null,n.rel="stylesheet"};const o=document.createElement("noscript"),s=a.cloneNode(!0);o.appendChild(s),document.head.appendChild(n),document.head.appendChild(o),a.remove()})}setupProgressiveLoading(){const r=document.querySelectorAll("img[data-src]");if("IntersectionObserver"in window){const a=new IntersectionObserver(n=>{n.forEach(o=>{if(o.isIntersecting){const s=o.target;s.src=s.dataset.src||"",s.removeAttribute("data-src"),a.unobserve(s)}})},{rootMargin:"50px 0px",threshold:.01});r.forEach(n=>a.observe(n))}else r.forEach(a=>{const n=a;n.src=n.dataset.src||""})}isSmallResource(r){return r.includes("critical")||r.includes("inline")}getPerformanceMetrics(){return{...this.observedMetrics,score:this.calculatePerformanceScore()}}calculatePerformanceScore(){let r=100;return this.observedMetrics.fcp>2e3?r-=20:this.observedMetrics.fcp>1500&&(r-=10),this.observedMetrics.lcp>2500?r-=25:this.observedMetrics.lcp>2e3&&(r-=15),this.observedMetrics.cls>.1?r-=15:this.observedMetrics.cls>.05&&(r-=8),this.observedMetrics.ttfb>600?r-=10:this.observedMetrics.ttfb>400&&(r-=5),Math.max(r,0)}}const cr={mark:e=>{typeof performance<"u"&&performance.mark&&performance.mark(e)},measure:(e,r,a)=>{if(typeof performance<"u"&&performance.measure)try{performance.measure(e,r,a);const n=performance.getEntriesByName(e);return n[n.length-1]?.duration||0}catch{return 0}return 0},getEntries:e=>typeof performance<"u"&&performance.getEntriesByName?e?performance.getEntriesByName(e):performance.getEntries():[],clearEntries:e=>{typeof performance<"u"&&(e?(performance.clearMeasures?.(e),performance.clearMarks?.(e)):(performance.clearMeasures?.(),performance.clearMarks?.()))}},Fg=(e,r=[])=>{p.useEffect(()=>(cr.mark(`${e}-start`),()=>{cr.mark(`${e}-end`),cr.measure(e,`${e}-start`,`${e}-end`)}),[e,r])},Wg=e=>{const r=p.useRef(e);return r.current=e,p.useCallback((...a)=>r.current(...a),[])},Vg=(e,r,a)=>{const n=p.useRef(r),o=p.useRef(void 0);return p.useMemo(()=>(a&&process.env.NODE_ENV==="development"&&r.some((s,l)=>s!==n.current[l]),n.current=r,o.current=e(),o.current),[e,a,r])},dr=new Map,$g=e=>{const r=dr.get(e)||0;dr.set(e,r+1),p.useEffect(()=>{process.env.NODE_ENV})},Hg=()=>Object.fromEntries(dr),qg=()=>dr.clear(),Gg=e=>p.lazy(e),Yg=(e=.1)=>{const[r,a]=p.useState(new Set),n=p.useRef(null);p.useEffect(()=>(n.current=new IntersectionObserver(s=>{s.forEach(l=>{if(l.isIntersecting){const c=l.target,d=c.dataset.src;d&&(c.src=d,c.onload=()=>{a(i=>new Set(i).add(d))},n.current?.unobserve(c))}})},{threshold:e}),()=>n.current?.disconnect()),[e]);const o=p.useCallback(s=>{s&&n.current&&n.current.observe(s)},[]);return{loadedImages:r,observeImage:o}},Kg=e=>{typeof window<"u"&&"requestIdleCallback"in window?window.requestIdleCallback(()=>{e().catch(()=>{})}):setTimeout(()=>{e().catch(()=>{})},100)},Aa={},Xg=e=>{Aa[e.name]=e.value,process.env.NODE_ENV},Zg=()=>Aa,Jg=(e,r="script")=>{if(typeof document<"u"){const a=document.createElement("link");a.rel="prefetch",a.href=e,a.as=r,document.head.appendChild(a)}},Qg=(e,r="script",a)=>{if(typeof document<"u"){const n=document.createElement("link");n.rel="preload",n.href=e,n.as=r,a&&(n.crossOrigin="anonymous"),document.head.appendChild(n)}},Rg=e=>{const r=p.useRef(new Set),a=p.useRef(new Set),n=p.useCallback((s,l)=>{const c=setTimeout(()=>{r.current.delete(c),s()},l);return r.current.add(c),c},[]),o=p.useCallback((s,l)=>{const c=setInterval(s,l);return a.current.add(c),c},[]);return p.useEffect(()=>{const s=r.current,l=a.current;return()=>{s.forEach(c=>clearTimeout(c)),l.forEach(c=>clearInterval(c)),process.env.NODE_ENV}},[e]),{createTimer:n,createInterval:o}},de={maxBundleSize:500,maxChunkSize:200,maxImageSize:100,maxFCP:1800,maxLCP:2500,maxFID:100,maxCLS:.1,check:e=>{const r=[];return e.FCP&&e.FCP>de.maxFCP&&r.push(`FCP (${e.FCP}ms) exceeds budget (${de.maxFCP}ms)`),e.LCP&&e.LCP>de.maxLCP&&r.push(`LCP (${e.LCP}ms) exceeds budget (${de.maxLCP}ms)`),e.FID&&e.FID>de.maxFID&&r.push(`FID (${e.FID}ms) exceeds budget (${de.maxFID}ms)`),e.CLS&&e.CLS>de.maxCLS&&r.push(`CLS (${e.CLS}) exceeds budget (${de.maxCLS})`),r}};class eu{constructor(r){this.metrics={timestamp:Date.now()},this.observers=[],this.performanceMarks=new Map,this.reportCallback=r,this.initializeWebVitals(),this.initializeCustomObservers(),this.collectDeviceInfo()}initializeWebVitals(){Oe.onCLS(r=>{this.metrics.CLS=r.value,this.reportMetric("CLS",r.value)}),Oe.onINP(r=>{this.metrics.INP=r.value,this.reportMetric("INP",r.value)}),Oe.onFCP(r=>{this.metrics.FCP=r.value,this.reportMetric("FCP",r.value)}),Oe.onLCP(r=>{this.metrics.LCP=r.value,this.reportMetric("LCP",r.value)}),Oe.onTTFB(r=>{this.metrics.TTFB=r.value,this.reportMetric("TTFB",r.value)})}initializeCustomObservers(){if("PerformanceObserver"in window){const r=new PerformanceObserver(n=>{n.getEntries().forEach(s=>{if(s.entryType==="navigation"){const l=s;this.metrics.bundleLoadTime=l.loadEventEnd-l.fetchStart}})});try{r.observe({entryTypes:["navigation"]}),this.observers.push(r)}catch{}const a=new PerformanceObserver(n=>{n.getEntries().forEach(s=>{(s.name.includes(".js")||s.name.includes(".css"))&&this.trackResourceLoad(s.name,s.duration)})});try{a.observe({entryTypes:["resource"]}),this.observers.push(a)}catch{}}}collectDeviceInfo(){if(typeof window<"u"){const r=navigator;r.connection&&(this.metrics.connection=r.connection.effectiveType||r.connection.type),r.deviceMemory&&(this.metrics.deviceMemory=r.deviceMemory),r.hardwareConcurrency&&(this.metrics.hardwareConcurrency=r.hardwareConcurrency),this.metrics.viewport={width:window.innerWidth,height:window.innerHeight}}}reportMetric(r,a){this.reportCallback&&this.reportCallback({...this.metrics,timestamp:Date.now()}),process.env.NODE_ENV}trackResourceLoad(r,a){const n=r.includes(".js"),o=r.includes(".css");if(n||o){const s=n?"JavaScript":"CSS";this.reportMetric(`${s} Load`,a)}}measureComponentRender(r,a){this.metrics.componentRenderTime=a,this.reportMetric(`Component Render (${r})`,a)}measureAPICall(r,a){this.metrics.apiResponseTime=a,this.reportMetric(`API Call (${r})`,a)}measureRouteChange(r,a){this.metrics.routeChangeTime=a,this.reportMetric(`Route Change (${r})`,a)}markStart(r){this.performanceMarks.set(r,performance.now())}markEnd(r){const a=this.performanceMarks.get(r);if(a){const n=performance.now()-a;this.reportMetric(`Mark (${r})`,n),this.performanceMarks.delete(r)}}trackRouteChange(r,a,n){typeof a=="string"?this.measureRouteChange(a,n||performance.now()):this.measureRouteChange(r,a)}getSummary(){return{coreWebVitals:{score:this.calculateScore(),LCP:this.metrics.LCP,INP:this.metrics.INP,CLS:this.metrics.CLS},loadingPerformance:{FCP:this.metrics.FCP,TTFB:this.metrics.TTFB,bundleLoadTime:this.metrics.bundleLoadTime},runtime:{routeChangeTime:this.metrics.routeChangeTime,apiResponseTime:this.metrics.apiResponseTime,componentRenderTime:this.metrics.componentRenderTime},device:{connection:this.metrics.connection,deviceMemory:this.metrics.deviceMemory,hardwareConcurrency:this.metrics.hardwareConcurrency}}}calculateScore(){let r=100;return this.metrics.LCP&&this.metrics.LCP>2500?r-=25:this.metrics.LCP&&this.metrics.LCP>2e3&&(r-=15),this.metrics.INP&&this.metrics.INP>200?r-=20:this.metrics.INP&&this.metrics.INP>100&&(r-=10),this.metrics.CLS&&this.metrics.CLS>.1?r-=15:this.metrics.CLS&&this.metrics.CLS>.05&&(r-=8),Math.max(r,0)}getMetrics(){return{...this.metrics}}cleanup(){this.observers.forEach(r=>r.disconnect()),this.observers=[]}}let gr=null;const ru=e=>(gr||(gr=new eu(e)),gr),ur=()=>gr,Ta=e=>{const r=p.useRef(performance.now());p.useEffect(()=>{const a=performance.now()-r.current,n=ur();n&&n.measureComponentRender(e,a)},[e])},tu=(e,r)=>p.forwardRef((a,n)=>(Ta(r),p.createElement(e,{...a,ref:n}))),au=async(e,r)=>{const a=performance.now(),n=await e(),o=performance.now()-a,s=ur();return s&&s.measureAPICall(r,o),n},Ia={LCP:2500,INP:200,CLS:.1,FCP:1800,TTFB:800,bundleSize:17e4},nu=(e,r=Ia)=>{const a=[];return r.LCP&&e.LCP&&e.LCP>r.LCP&&a.push(`LCP: ${e.LCP.toFixed(0)}ms (budget: ${r.LCP}ms)`),r.INP&&e.INP&&e.INP>r.INP&&a.push(`INP: ${e.INP.toFixed(0)}ms (budget: ${r.INP}ms)`),r.CLS&&e.CLS&&e.CLS>r.CLS&&a.push(`CLS: ${e.CLS.toFixed(3)} (budget: ${r.CLS})`),r.FCP&&e.FCP&&e.FCP>r.FCP&&a.push(`FCP: ${e.FCP.toFixed(0)}ms (budget: ${r.FCP}ms)`),r.TTFB&&e.TTFB&&e.TTFB>r.TTFB&&a.push(`TTFB: ${e.TTFB.toFixed(0)}ms (budget: ${r.TTFB}ms)`),{passed:a.length===0,violations:a}},ou=e=>{const r=e||ur()?.getMetrics()||{timestamp:Date.now()},a={timestamp:new Date().toISOString(),metrics:r,environment:{userAgent:typeof window<"u"?window.navigator.userAgent:"unknown",url:typeof window<"u"?window.location.href:"unknown",referrer:typeof document<"u"?document.referrer:"unknown",viewport:r.viewport,connection:r.connection,deviceMemory:r.deviceMemory,hardwareConcurrency:r.hardwareConcurrency}};return JSON.stringify(a,null,2)},su={CLS:[.1,.25],FCP:[1800,3e3],FID:[100,300],LCP:[2500,4e3],TTFB:[800,1800],INP:[200,500]};function Te(e,r){const[a,n]=su[e];return r<=a?"good":r<=n?"needs-improvement":"poor"}function Ge(e,r){try{if(PerformanceObserver.supportedEntryTypes?.includes(e)){const a=new PerformanceObserver(n=>{r(n.getEntries())});return a.observe({type:e,buffered:!0}),a}}catch{}}function La(e){let r=0;Ge("layout-shift",a=>{for(const n of a){const o=n;o.hadRecentInput||(r+=o.value)}}),document.addEventListener("visibilitychange",()=>{document.visibilityState==="hidden"&&e({name:"CLS",value:r,rating:Te("CLS",r)})})}function Ma(e){Ge("paint",r=>{for(const a of r)a.name==="first-contentful-paint"&&e({name:"FCP",value:a.startTime,rating:Te("FCP",a.startTime)})})}function Pa(e){let r=0;Ge("largest-contentful-paint",n=>{const o=n[n.length-1];o&&(r=o.startTime)});const a=()=>{r>0&&e({name:"LCP",value:r,rating:Te("LCP",r)})};document.addEventListener("visibilitychange",()=>{document.visibilityState==="hidden"&&a()}),["keydown","click"].forEach(n=>{document.addEventListener(n,a,{once:!0,capture:!0})})}function Oa(e){Ge("first-input",r=>{const a=r[0];if(a){const n=a.processingStart-a.startTime;e({name:"FID",value:n,rating:Te("FID",n)})}})}function Ua(e){const r=performance.getEntriesByType("navigation")[0];if(r){const a=r.responseStart-r.requestStart;e({name:"TTFB",value:a,rating:Te("TTFB",a)})}}function Da(e){const r=[];Ge("event",a=>{for(const n of a){const o=n;if(o.interactionId){const s=o.processingEnd-o.processingStart;r.push(s)}}}),document.addEventListener("visibilitychange",()=>{if(document.visibilityState==="hidden"&&r.length>0){r.sort((o,s)=>o-s);const a=Math.min(r.length-1,Math.ceil(r.length*.98)-1),n=r[a];e({name:"INP",value:n,rating:Te("INP",n)})}})}function lu(e){const r=e||(a=>{if(typeof window<"u"&&window.__DEV__){const n=a.rating==="good"?"\x1B[32m":a.rating==="needs-improvement"?"\x1B[33m":"\x1B[31m";console.log(`${n}[WebVitals] ${a.name}: ${a.value.toFixed(2)} (${a.rating})\x1B[0m`)}});La(r),Ma(r),Pa(r),Oa(r),Ua(r),Da(r)}function za(e,r,a){if(typeof window<"u"&&window.__DEV__){const n=a<100?"good":a<300?"needs-improvement":"poor";console.log(`${n==="good"?"\x1B[32m":n==="needs-improvement"?"\x1B[33m":"\x1B[31m"}[RouteChange] ${e} -> ${r}: ${a}ms (${n})\x1B[0m`)}}function iu(e,r,a){typeof window<"u"&&window.__DEV__&&console.log(`[CustomMetric] ${e}: ${r}`,a||"")}function cu(e,r,a,n="GET"){if(typeof window<"u"&&window.__DEV__){const o=r<200?"good":r<500?"needs-improvement":"poor";console.log(`${o==="good"?"\x1B[32m":o==="needs-improvement"?"\x1B[33m":"\x1B[31m"}[API] ${n} ${e}: ${r}ms (${a})\x1B[0m`)}}const du=({direction:e,className:r})=>t.jsx("svg",{className:f("w-4 h-4",r),fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:t.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:e==="up"?"M5 15l7-7 7 7":"M19 9l-7 7-7-7"})}),gu=({className:e})=>t.jsx("svg",{className:f("w-4 h-4",e),fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:t.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 18L18 6M6 6l12 12"})}),ja=({title:e="Performance Monitor",isCollapsed:r,onToggleCollapse:a,onClose:n,onMouseDown:o,isDragging:s,className:l})=>t.jsxs("div",{className:f("bg-gray-900 text-white rounded-t-lg px-3 py-2","flex items-center justify-between","shadow-lg border border-gray-700","select-none",o&&"cursor-grab",s&&"cursor-grabbing",l),onMouseDown:o,children:[t.jsxs("span",{className:"font-semibold text-sm flex items-center gap-2",children:[t.jsx("span",{children:"🚀"}),e]}),t.jsxs("div",{className:"flex gap-1",children:[t.jsx("button",{onClick:a,className:"hover:bg-gray-700 rounded p-1 transition-colors","aria-label":r?"Expand":"Collapse",type:"button",children:t.jsx(du,{direction:r?"up":"down"})}),n&&t.jsx("button",{onClick:n,className:"hover:bg-gray-700 rounded p-1 transition-colors","aria-label":"Close",type:"button",children:t.jsx(gu,{})})]})]}),uu={sm:"w-2 h-2",md:"w-3 h-3",lg:"w-4 h-4"},hu={good:"bg-green-500","needs-improvement":"bg-yellow-500",poor:"bg-red-500",unknown:"bg-gray-400",neutral:"bg-gray-500"},fu={good:"Good","needs-improvement":"Needs Improvement",poor:"Poor",unknown:"Unknown",neutral:"Neutral"},bu=({rating:e,size:r="sm",showLabel:a=!1,className:n})=>t.jsxs("div",{className:f("flex items-center gap-1",n),children:[t.jsx("span",{className:f("rounded-full",uu[r],hu[e])}),a&&t.jsx("span",{className:"text-xs text-gray-400",children:fu[e]})]}),_a=({className:e})=>t.jsxs("div",{className:f("flex gap-3 text-[10px] text-gray-400",e),children:[t.jsxs("span",{className:"flex items-center gap-1",children:[t.jsx("span",{className:"w-2 h-2 rounded-full bg-green-500"}),"Good"]}),t.jsxs("span",{className:"flex items-center gap-1",children:[t.jsx("span",{className:"w-2 h-2 rounded-full bg-yellow-500"}),"Needs Improvement"]}),t.jsxs("span",{className:"flex items-center gap-1",children:[t.jsx("span",{className:"w-2 h-2 rounded-full bg-red-500"}),"Poor"]})]}),mu={good:"text-green-500","needs-improvement":"text-yellow-500",poor:"text-red-500",unknown:"text-gray-400",neutral:"text-gray-300"},H=({label:e,value:r,unit:a="",rating:n="neutral",description:o,className:s})=>{const l=typeof r=="number"?Number.isInteger(r)?r.toString():r.toFixed(r<1?3:0):r;return t.jsxs("div",{className:f("flex justify-between items-center",s),children:[t.jsxs("div",{className:"flex flex-col",children:[t.jsx("span",{className:"text-gray-300",children:e}),o&&t.jsx("span",{className:"text-[10px] text-gray-500",children:o})]}),t.jsxs("span",{className:f("font-medium",mu[n]),children:[l,a]})]})},yu=(e,r="ms",a=0)=>e===void 0?"N/A":`${e.toFixed(a)}${r}`,Ba=(e={})=>{const{enabled:r=!0,onUpdate:a}=e,[n,o]=p.useState({}),[s,l]=p.useState(!0),c=p.useRef(a);p.useEffect(()=>{c.current=a},[a]);const d=p.useCallback(i=>{o(h=>{const u={...h,...i};return c.current?.(u),u})},[]);return p.useEffect(()=>{if(!r)return;if(typeof PerformanceObserver>"u"){l(!1);return}const i=[];try{const h=new PerformanceObserver(u=>{const y=u.getEntries(),m=y[y.length-1];d({lcp:m.renderTime||m.loadTime})});h.observe({type:"largest-contentful-paint",buffered:!0}),i.push(h)}catch{}try{const h=new PerformanceObserver(u=>{u.getEntries().forEach(m=>{m.processingStart&&d({fid:m.processingStart-m.startTime})})});h.observe({type:"first-input",buffered:!0}),i.push(h)}catch{}try{let h=0;const u=new PerformanceObserver(y=>{for(const m of y.getEntries())!m.hadRecentInput&&m.value&&(h+=m.value,d({cls:h}))});u.observe({type:"layout-shift",buffered:!0}),i.push(u)}catch{}try{const h=new PerformanceObserver(u=>{u.getEntries().forEach(m=>{m.name==="first-contentful-paint"&&d({fcp:m.startTime})})});h.observe({type:"paint",buffered:!0}),i.push(h)}catch{}try{const h=new PerformanceObserver(u=>{u.getEntries().forEach(m=>{m.duration&&d({inp:m.duration})})});h.observe({type:"event",buffered:!0}),i.push(h)}catch{}try{const h=performance.getEntriesByType("navigation")[0];h&&d({ttfb:h.responseStart-h.requestStart})}catch{}return()=>{i.forEach(h=>h.disconnect())}},[r,d]),{metrics:n,isSupported:s}},xe=(e,r)=>{if(r===void 0)return"unknown";const n={lcp:{good:2500,poor:4e3},fid:{good:100,poor:300},cls:{good:.1,poor:.25},fcp:{good:1800,poor:3e3},ttfb:{good:800,poor:1800},inp:{good:200,poor:500}}[e];return n?r<=n.good?"good":r<=n.poor?"needs-improvement":"poor":"unknown"},Fa=({metrics:e,className:r})=>{const a=(n,o=0)=>n===void 0?"N/A":n.toFixed(o);return t.jsxs("div",{className:f("space-y-1",r),children:[t.jsx("h3",{className:"font-semibold text-yellow-400 mb-2 text-xs",children:"Web Vitals"}),t.jsxs("div",{className:"space-y-1.5",children:[t.jsx(H,{label:"LCP",value:a(e.lcp),unit:"ms",rating:xe("lcp",e.lcp),description:"Largest Contentful Paint"}),t.jsx(H,{label:"FID",value:a(e.fid),unit:"ms",rating:xe("fid",e.fid),description:"First Input Delay"}),t.jsx(H,{label:"CLS",value:a(e.cls,3),rating:xe("cls",e.cls),description:"Cumulative Layout Shift"}),t.jsx(H,{label:"FCP",value:a(e.fcp),unit:"ms",rating:xe("fcp",e.fcp),description:"First Contentful Paint"}),t.jsx(H,{label:"TTFB",value:a(e.ttfb),unit:"ms",rating:xe("ttfb",e.ttfb),description:"Time to First Byte"}),e.inp!==void 0&&t.jsx(H,{label:"INP",value:a(e.inp),unit:"ms",rating:xe("inp",e.inp),description:"Interaction to Next Paint"})]})]})},Wa=(e={})=>{const{enabled:r=!0,refreshInterval:a=5e3,onUpdate:n}=e,[o,s]=p.useState({}),l=p.useRef(n);p.useEffect(()=>{l.current=n},[n]);const c=p.useCallback(()=>{if(!(typeof performance>"u"))try{const i=performance.getEntriesByType("resource"),h=i.filter(k=>k.name.endsWith(".js")||k.initiatorType==="script"),u=h.reduce((k,S)=>k+S.duration,0),y=i.filter(k=>k.name.endsWith(".css")||k.initiatorType==="link"),m=y.reduce((k,S)=>k+S.duration,0),b=i.reduce((k,S)=>k+(S.transferSize||0),0),v={jsLoadTime:u,cssLoadTime:m,jsCount:h.length,cssCount:y.length,totalTransferSize:b};s(v),l.current?.(v)}catch{}},[]),d=p.useCallback(()=>{c()},[c]);return p.useEffect(()=>{if(!r)return;c();const i=setInterval(c,a);return()=>clearInterval(i)},[r,a,c]),{metrics:o,refresh:d}},Va=e=>e===void 0?"N/A":e<1024?`${e}B`:e<1024*1024?`${(e/1024).toFixed(1)}KB`:`${(e/(1024*1024)).toFixed(1)}MB`,$a=({metrics:e,className:r})=>{const a=n=>n===void 0?"N/A":n.toFixed(0);return t.jsxs("div",{className:f("space-y-1",r),children:[t.jsx("h3",{className:"font-semibold text-blue-400 mb-2 text-xs",children:"Bundle Performance"}),t.jsxs("div",{className:"space-y-1.5",children:[t.jsx(H,{label:"JS Load",value:a(e.jsLoadTime),unit:"ms",rating:"neutral"}),t.jsx(H,{label:"CSS Load",value:a(e.cssLoadTime),unit:"ms",rating:"neutral"}),t.jsx(H,{label:"JS Files",value:e.jsCount??"N/A",rating:"neutral"}),t.jsx(H,{label:"Transfer Size",value:Va(e.totalTransferSize),rating:"neutral"})]})]})},pu=e=>e===void 0?"unknown":e<=200?"good":e<=500?"needs-improvement":"poor",Ha=({metrics:e,className:r})=>{const a=n=>n===void 0||isNaN(n)?"N/A":n.toFixed(0);return e.callCount===0?null:t.jsxs("div",{className:f("space-y-1",r),children:[t.jsx("h3",{className:"font-semibold text-purple-400 mb-2 text-xs",children:"API Calls"}),t.jsxs("div",{className:"space-y-1.5",children:[t.jsx(H,{label:"Count",value:e.callCount,rating:"neutral"}),t.jsx(H,{label:"Total Time",value:a(e.totalTime),unit:"ms",rating:"neutral"}),t.jsx(H,{label:"Avg Time",value:a(e.averageTime),unit:"ms",rating:pu(e.averageTime)}),e.slowestCall!==void 0&&t.jsx(H,{label:"Slowest",value:a(e.slowestCall),unit:"ms",rating:e.slowestCall>1e3?"poor":"neutral"}),e.failedCalls>0&&t.jsx(H,{label:"Failed",value:e.failedCalls,rating:"poor"})]})]})},qa=e=>e===void 0?"N/A":(e/(1024*1024)).toFixed(1),Ga=(e,r)=>{if(e===void 0||r===void 0)return"unknown";const a=e/r;return a<=.5?"good":a<=.75?"needs-improvement":"poor"},Ya=({refreshInterval:e=2e3,className:r})=>{const[a,n]=p.useState({}),[o,s]=p.useState(!0);if(p.useEffect(()=>{const c=performance;if(!c.memory){s(!1);return}const d=()=>{c.memory&&n({usedJSHeapSize:c.memory.usedJSHeapSize,totalJSHeapSize:c.memory.totalJSHeapSize,jsHeapSizeLimit:c.memory.jsHeapSizeLimit})};d();const i=setInterval(d,e);return()=>clearInterval(i)},[e]),!o)return null;const l=a.usedJSHeapSize&&a.jsHeapSizeLimit?(a.usedJSHeapSize/a.jsHeapSizeLimit*100).toFixed(0):"N/A";return t.jsxs("div",{className:f("space-y-1",r),children:[t.jsx("h3",{className:"font-semibold text-cyan-400 mb-2 text-xs",children:"Memory"}),t.jsxs("div",{className:"space-y-1.5",children:[t.jsx(H,{label:"Used Heap",value:qa(a.usedJSHeapSize),unit:"MB",rating:Ga(a.usedJSHeapSize,a.jsHeapSizeLimit)}),t.jsx(H,{label:"Total Heap",value:qa(a.totalJSHeapSize),unit:"MB",rating:"neutral"}),t.jsx(H,{label:"Usage",value:l,unit:"%",rating:Ga(a.usedJSHeapSize,a.jsHeapSizeLimit)})]})]})},vu=e=>{if(e.rating)return e.rating;if(typeof e.value=="number"&&e.thresholds){const{good:r,poor:a}=e.thresholds;return e.value<=r?"good":e.value<=a?"needs-improvement":"poor"}return"neutral"},Ka=({title:e="Custom Metrics",titleColor:r="text-orange-400",metrics:a,className:n})=>a.length===0?null:t.jsxs("div",{className:f("space-y-1",n),children:[t.jsx("h3",{className:f("font-semibold mb-2 text-xs",r),children:e}),t.jsx("div",{className:"space-y-1.5",children:a.map(o=>t.jsx(H,{label:o.label,value:o.value,unit:o.unit,rating:vu(o),description:o.description},o.id))})]}),ku=["/api/","graphql",".json"],Xa=(e={})=>{const{enabled:r=!0,patterns:a=ku,refreshInterval:n=5e3,onUpdate:o}=e,[s,l]=p.useState({callCount:0,totalTime:0,averageTime:0,failedCalls:0}),c=p.useRef(a),d=p.useRef(o);p.useEffect(()=>{c.current=a},[a]),p.useEffect(()=>{d.current=o},[o]);const i=p.useCallback(()=>{if(!(typeof performance>"u"))try{const u=performance.getEntriesByType("resource"),y=c.current,m=u.filter(x=>y.some(N=>x.name.includes(N)));if(m.length===0)return;const b=m.reduce((x,N)=>x+N.duration,0),v=Math.max(...m.map(x=>x.duration)),k=m.filter(x=>{const N=x.responseStatus;return N!==void 0&&N>=400}).length,S={callCount:m.length,totalTime:b,averageTime:b/m.length,slowestCall:v,failedCalls:k};l(S),d.current?.(S)}catch{}},[]),h=p.useCallback(()=>{i()},[i]);return p.useEffect(()=>{if(!r)return;i();const u=setInterval(i,n);return()=>clearInterval(u)},[r,n,i]),{metrics:s,refresh:h}},Za=(e={})=>{const{enabled:r=!0,constrainToViewport:a=!0,horizontalOnly:n=!1,verticalOnly:o=!1,initialPosition:s}=e,l=p.useRef(null),[c,d]=p.useState({x:s?.x??null,y:s?.y??null}),[i,h]=p.useState(!1),[u,y]=p.useState({x:0,y:0}),m=p.useCallback(v=>{if(!r||!l.current)return;const k=l.current.getBoundingClientRect();h(!0),y({x:v.clientX-k.left,y:v.clientY-k.top}),(c.x===null||c.y===null)&&d({x:n?k.left:c.x??k.left,y:o?k.top:c.y??k.top}),v.preventDefault()},[r,c,n,o]),b=p.useCallback(()=>{d({x:s?.x??null,y:s?.y??null})},[s]);return p.useEffect(()=>{if(!i)return;const v=S=>{if(!l.current)return;let x=S.clientX-u.x,N=S.clientY-u.y;if(a){const w=window.innerWidth-l.current.offsetWidth,E=window.innerHeight-l.current.offsetHeight;x=Math.max(0,Math.min(x,w)),N=Math.max(0,Math.min(N,E))}d({x:n?x:o?c.x:x,y:o?N:n?c.y:N})},k=()=>{h(!1)};return document.addEventListener("mousemove",v),document.addEventListener("mouseup",k),()=>{document.removeEventListener("mousemove",v),document.removeEventListener("mouseup",k)}},[i,u,a,n,o,c.x,c.y]),{position:c,isDragging:i,handleMouseDown:m,resetPosition:b,ref:l}},Ja={"bottom-right":"bottom-4 right-4","bottom-left":"bottom-4 left-4","top-right":"top-4 right-4","top-left":"top-4 left-4"},xu=["webVitals","bundle","api","memory"],wu=({enabled:e,defaultCollapsed:r=!0,defaultVisible:a=!0,position:n="bottom-right",draggable:o=!0,sections:s=xu,customMetrics:l=[],customSectionTitle:c="Custom Metrics",apiPatterns:d,onMetricsUpdate:i,className:h})=>{const u=e??(typeof process<"u"&&process.env?.NODE_ENV!=="production"),[y,m]=p.useState(r),[b,v]=p.useState(a),k=p.useMemo(()=>d,[JSON.stringify(d)]),S=p.useRef(i);p.useEffect(()=>{S.current=i},[i]);const{metrics:x}=Ba({enabled:u&&s.includes("webVitals")}),{metrics:N}=Wa({enabled:u&&s.includes("bundle")}),{metrics:w}=Xa({enabled:u&&s.includes("api"),patterns:k});p.useEffect(()=>{S.current&&S.current({webVitals:x,bundle:N,api:w})},[x,N,w]);const{position:E,isDragging:A,handleMouseDown:C,ref:I}=Za({enabled:o,horizontalOnly:n.includes("bottom")||n.includes("top")}),L=p.useCallback(()=>{m(z=>!z)},[]),O=p.useCallback(()=>{v(!1)},[]),M=p.useCallback(()=>{v(!0)},[]);if(!u)return null;if(!b)return t.jsx("button",{onClick:M,className:f("fixed z-[9999]",Ja[n],"bg-gray-900 text-white px-3 py-2 rounded-lg","shadow-lg border border-gray-700","hover:bg-gray-800 transition-colors","text-xs font-mono"),type:"button",children:"🚀 Performance"});const D=E.x!==null?{left:`${E.x}px`,bottom:n.includes("bottom")?"1rem":void 0,top:n.includes("top")?"1rem":void 0,position:"fixed",transition:A?"none":"height 0.2s ease-in-out"}:{transition:"height 0.2s ease-in-out"},B=l.length>0||s.includes("custom");return t.jsxs("div",{ref:I,className:f(E.x!==null?"":`fixed ${Ja[n]}`,"z-[9999] font-mono text-xs",A&&"cursor-grabbing",h),style:{maxWidth:"320px",...D},children:[t.jsx(ja,{isCollapsed:y,onToggleCollapse:L,onClose:O,onMouseDown:o?C:void 0,isDragging:A}),t.jsx("div",{className:f("bg-gray-800 text-gray-100 rounded-b-lg","shadow-lg border-x border-b border-gray-700","overflow-hidden transition-all duration-300 ease-in-out",y?"max-h-0 opacity-0":"max-h-[70vh] opacity-100 py-2 px-3"),children:t.jsxs("div",{className:"overflow-y-auto max-h-full space-y-3",children:[s.includes("webVitals")&&t.jsx(Fa,{metrics:x}),s.includes("bundle")&&t.jsx("div",{className:"pt-3 border-t border-gray-700",children:t.jsx($a,{metrics:N})}),s.includes("api")&&w.callCount>0&&t.jsx("div",{className:"pt-3 border-t border-gray-700",children:t.jsx(Ha,{metrics:w})}),s.includes("memory")&&t.jsx("div",{className:"pt-3 border-t border-gray-700",children:t.jsx(Ya,{})}),B&&l.length>0&&t.jsx("div",{className:"pt-3 border-t border-gray-700",children:t.jsx(Ka,{title:c,metrics:l})}),t.jsx("div",{className:"pt-3 border-t border-gray-700",children:t.jsx(_a,{})})]})})]})},Nu=(e={})=>{const{successMessage:r="",successDuration:a=3e3,errorPrefix:n="",onSuccess:o,onError:s}=e,[l,c]=p.useState(!1),[d,i]=p.useState(""),[h,u]=p.useState(""),y=p.useCallback(()=>{i(""),u("")},[]),m=p.useCallback(()=>{i("")},[]),b=p.useCallback(()=>{u("")},[]),v=p.useCallback(async k=>{c(!0),y();try{await k(),r&&(i(r),a>0&&setTimeout(()=>{i("")},a)),o&&o()}catch(S){const x=S instanceof Error?S.message:"An error occurred";throw u(n?`${n}: ${x}`:x),s&&S instanceof Error&&s(S),S}finally{c(!1)}},[r,a,n,o,s,y]);return{isSubmitting:l,successMessage:d,errorMessage:h,submit:v,clearMessages:y,clearSuccess:m,clearError:b}},Cu=(e=!1)=>{const[r,a]=p.useState(e),n=p.useCallback(()=>a(!0),[]),o=p.useCallback(()=>a(!1),[]),s=p.useCallback(()=>a(l=>!l),[]);return{value:r,setTrue:n,setFalse:o,toggle:s,setValue:a}},Su=(e={})=>{const{successDuration:r=2e3,onSuccess:a,onError:n}=e,[o,s]=p.useState(null),l=p.useCallback(async i=>{try{if(navigator.clipboard&&window.isSecureContext)await navigator.clipboard.writeText(i);else{const h=document.createElement("textarea");h.value=i,h.style.position="fixed",h.style.left="-999999px",h.style.top="-999999px",document.body.appendChild(h),h.focus(),h.select();const u=document.execCommand("copy");if(document.body.removeChild(h),!u)throw new Error("Copy command was unsuccessful")}return s(i),a?.(i),setTimeout(()=>{s(null)},r),!0}catch(h){const u=h instanceof Error?h:new Error("Copy failed");return n?.(u),!1}},[r,a,n]),c=p.useCallback(i=>o===i,[o]),d=p.useCallback(()=>{s(null)},[]);return{copiedValue:o,copyToClipboard:l,isCopied:c,resetCopiedState:d}},Eu=(e={})=>{const{successDuration:r=2e3,onSuccess:a,onError:n}=e,[o,s]=p.useState({}),l=p.useCallback(async(i,h)=>{try{if(navigator.clipboard&&window.isSecureContext)await navigator.clipboard.writeText(i);else{const u=document.createElement("textarea");u.value=i,u.style.position="fixed",u.style.left="-999999px",u.style.top="-999999px",document.body.appendChild(u),u.focus(),u.select();const y=document.execCommand("copy");if(document.body.removeChild(u),!y)throw new Error("Copy command was unsuccessful")}return s(u=>({...u,[h]:!0})),a?.(i),setTimeout(()=>{s(u=>({...u,[h]:!1}))},r),!0}catch(u){const y=u instanceof Error?u:new Error("Copy failed");return n?.(y),!1}},[r,a,n]),c=p.useCallback(i=>o[i]||!1,[o]),d=p.useCallback(i=>{s(i?h=>({...h,[i]:!1}):{})},[]);return{copiedStates:o,copyToClipboard:l,isCopied:c,resetCopiedState:d}};function Au(){const e=Z.useLocation(),r=p.useRef(null),a=p.useRef(0);p.useEffect(()=>{const n=e.pathname;if(!r.current){r.current=n,a.current=Date.now();return}const o=Date.now()-a.current;r.current!==n&&(za(r.current,n,o),r.current=n,a.current=Date.now())},[e])}function Tu({fields:e,validateOnChange:r=!1,validateOnBlur:a=!0}){const n=p.useMemo(()=>{const C={};for(const I in e)C[I]=e[I].initialValue;return C},[e]),[o,s]=p.useState(n),[l,c]=p.useState({}),[d,i]=p.useState({}),[h,u]=p.useState({}),y=p.useCallback(C=>{const I=e[C],L=o[C];if(I.required&&(L===""||L===null||L===void 0||Array.isArray(L)&&L.length===0))return I.requiredMessage||"This field is required";if(I.validate)for(const O of I.validate){const M=O(L);if(M)return M}},[e,o]),m=p.useCallback((C,I)=>{if(s(L=>({...L,[C]:I})),u(L=>({...L,[C]:!0})),r&&d[C]){const L=y(C);c(O=>({...O,[C]:L}))}},[r,d,y]),b=p.useCallback(C=>{s(L=>({...L,...C}));const I={};for(const L in C)I[L]=!0;u(L=>({...L,...I}))},[]),v=p.useCallback(C=>{if(i(I=>({...I,[C]:!0})),a){const I=y(C);c(L=>({...L,[C]:I}))}},[a,y]),k=p.useCallback(()=>{const C={},I={};let L=!0;for(const O in e){I[O]=!0;const M=y(O);M&&(C[O]=M,L=!1)}return i(I),c(C),L},[e,y]),S=p.useCallback(()=>{s(n),c({}),i({}),u({})},[n]),x=p.useCallback(C=>{s(I=>({...I,[C]:e[C].initialValue})),c(I=>{const L={...I};return delete L[C],L}),i(I=>{const L={...I};return delete L[C],L}),u(I=>{const L={...I};return delete L[C],L})},[e]),N=p.useCallback(C=>({value:o[C],onChange:I=>{m(C,I.target.value)},onBlur:()=>v(C),name:String(C),"aria-invalid":!!(d[C]&&l[C])}),[o,m,v,d,l]),w=p.useCallback(C=>d[C]?l[C]:void 0,[d,l]),E=p.useMemo(()=>{for(const C in e)if(y(C))return!1;return!0},[e,y]),A=p.useMemo(()=>Object.values(h).some(Boolean),[h]);return{values:o,errors:l,touched:d,dirty:h,isValid:E,isDirty:A,setValue:m,setValues:b,setTouched:v,validateField:y,validateAll:k,reset:S,resetField:x,getFieldProps:N,getFieldError:w}}const Iu=e=>{if(e===0)return"0 Bytes";const r=1024,a=["Bytes","KB","MB","GB","TB"],n=Math.floor(Math.log(e)/Math.log(r)),o=Math.min(n,a.length-1);return parseFloat((e/Math.pow(r,o)).toFixed(2))+" "+a[o]},Lu=(e,r,a)=>{const n={bytes:0,kb:1,mb:2,gb:3,tb:4},o=1024,l=e*Math.pow(o,n[r])/Math.pow(o,n[a]);return Math.round(l*100)/100},Mu=e=>{const r=e.match(/^(\d+(?:\.\d+)?)\s*(bytes?|kb|mb|gb|tb)$/i);if(!r)return null;const a=parseFloat(r[1]),n=r[2].toLowerCase(),s={bytes:1,byte:1,kb:1024,mb:1024*1024,gb:1024*1024*1024,tb:1024*1024*1024*1024}[n];return s?Math.round(a*s):null},Pu=e=>e,Ou=e=>{if(typeof document>"u")return;const r=document.createElement("style");r.textContent=e,r.setAttribute("data-critical","true"),document.head.appendChild(r)},Uu=e=>{if(typeof document>"u")return;const r=document.createElement("link");r.rel="preload",r.as="style",r.href=e,r.onload=()=>{r.rel="stylesheet"},document.head.appendChild(r);const a=document.createElement("noscript");a.innerHTML=`<link rel="stylesheet" href="${e}">`,document.head.appendChild(a)},Du=e=>{const r={};return Object.entries(e).forEach(([a,n])=>{r[`--${a}`]=typeof n=="number"?`${n}px`:n}),r},zu={xs:475,sm:640,md:768,lg:1024,xl:1280,"2xl":1536},ju=(e,r=zu)=>{const[a,n]=p.useState("base");return p.useEffect(()=>{const o=()=>{const s=window.innerWidth;s>=r["2xl"]?n("2xl"):s>=r.xl?n("xl"):s>=r.lg?n("lg"):s>=r.md?n("md"):s>=r.sm?n("sm"):s>=r.xs?n("xs"):n("base")};return o(),window.addEventListener("resize",o),()=>window.removeEventListener("resize",o)},[r]),e[a]||e.base||{}},Qa=()=>typeof window>"u"?!1:window.matchMedia("(prefers-reduced-motion: reduce)").matches,_u=()=>{const[e,r]=p.useState(Qa);return p.useEffect(()=>{const a=window.matchMedia("(prefers-reduced-motion: reduce)"),n=()=>{r(a.matches)};return a.addEventListener?a.addEventListener("change",n):a.addListener(n),()=>{a.removeEventListener?a.removeEventListener("change",n):a.removeListener(n)}},[]),e},Bu=(e,r=["layout","paint"])=>{e&&(e.style.contain=r.join(" "))},Fu=(e,r)=>e?(e.style.willChange=r.join(", "),()=>{e.style.willChange="auto"}):void 0,Wu=e=>{typeof window>"u"||requestAnimationFrame(()=>{e.forEach(r=>r())})},Vu=(...e)=>e.filter(Boolean).join(" "),$u=e=>{const r={},a=["display","position","width","height","margin","padding","fontSize","fontFamily","color","backgroundColor"];return Object.entries(e).forEach(([n,o])=>{a.includes(n)&&(r[n]=o)}),r},Hu=(e,r=[])=>{const[a,n]=p.useState(null),[o,s]=p.useState(!0);return p.useEffect(()=>{let l=!0;return e().then(c=>{l&&(n(c.default),s(!1))}),()=>{l=!1}},[e,...r]),{styles:a,loading:o}},qu=(e,r="1rem")=>({display:"grid",gridTemplateColumns:`repeat(${e}, minmax(0, 1fr))`,gap:r,contain:"layout",willChange:"transform"}),Gu=(e="row",r="center",a="flex-start")=>({display:"flex",flexDirection:e,alignItems:r,justifyContent:a,contain:"layout"}),Yu=e=>{const[r,a]=p.useState(!1);return p.useEffect(()=>{const n=window.matchMedia(e);a(n.matches);const o=()=>a(n.matches);return n.addEventListener?n.addEventListener("change",o):n.addListener(o),()=>{n.removeEventListener?n.removeEventListener("change",o):n.removeListener(o)}},[e]),r},Ku=(e,r)=>{const[a,n]=p.useState("light");return p.useEffect(()=>{const o=window.matchMedia("(prefers-color-scheme: dark)");n(o.matches?"dark":"light");const s=()=>{n(o.matches?"dark":"light")};return o.addEventListener?o.addEventListener("change",s):o.addListener(s),()=>{o.removeEventListener?o.removeEventListener("change",s):o.removeListener(s)}},[]),a==="dark"?r:e},Xu=e=>{const r={src:e.src,alt:e.alt,loading:e.loading||"lazy"};return e.title&&(r.title=e.title),e.width&&(r.width=e.width),e.height&&(r.height=e.height),e.sizes&&(r.sizes=e.sizes),e.srcSet&&(r.srcSet=e.srcSet),r.itemProp="image",r},Zu=(e,r=[320,640,768,1024,1280,1920])=>r.map(a=>`${e.replace(/\{width\}/g,a.toString())} ${a}w`).join(", "),Ju=e=>e.map(r=>r.maxWidth?`(max-width: ${r.maxWidth}px) ${r.size}`:r.size).join(", "),Qu=(e,r="openGraph")=>{const a={};return r==="openGraph"?(a["og:image"]=e.url,e.width&&(a["og:image:width"]=e.width.toString()),e.height&&(a["og:image:height"]=e.height.toString()),e.alt&&(a["og:image:alt"]=e.alt),e.type&&(a["og:image:type"]=e.type)):(a["twitter:image"]=e.url,e.alt&&(a["twitter:image:alt"]=e.alt)),a},Ru=(e='img[loading="lazy"]')=>{if(typeof window>"u"||!("IntersectionObserver"in window))return;const r=document.querySelectorAll(e);if("loading"in HTMLImageElement.prototype){r.forEach(n=>{n.dataset.src&&(n.src=n.dataset.src)});return}const a=new IntersectionObserver(n=>{n.forEach(o=>{if(o.isIntersecting){const s=o.target;s.dataset.src&&(s.src=s.dataset.src,s.removeAttribute("data-src")),s.dataset.srcset&&(s.srcset=s.dataset.srcset,s.removeAttribute("data-srcset")),a.unobserve(s)}})},{rootMargin:"50px 0px",threshold:.01});return r.forEach(n=>a.observe(n)),()=>{r.forEach(n=>a.unobserve(n))}},Ra=()=>typeof window>"u"?Promise.resolve(!1):new Promise(e=>{const r=new Image;r.onload=r.onerror=function(){e(r.height===2)},r.src="data:image/webp;base64,UklGRjoAAABXRUJQVlA4IC4AAACyAgCdASoCAAIALmk0mk0iIiIiIgBoSygABc6WWgAA/veff/0PP8bA//LwYAAA"}),en=()=>typeof window>"u"?Promise.resolve(!1):new Promise(e=>{const r=new Image;r.onload=()=>e(!0),r.onerror=()=>e(!1),r.src="data:image/avif;base64,AAAAIGZ0eXBhdmlmAAAAAGF2aWZtaWYxbWlhZk1BMUIAAADybWV0YQAAAAAAAAAoaGRscgAAAAAAAAAAcGljdAAAAAAAAAAAAAAAAGxpYmF2aWYAAAAADnBpdG0AAAAAAAEAAAAeaWxvYwAAAABEAAABAAEAAAABAAABGgAAAB0AAAAoaWluZgAAAAAAAQAAABppbmZlAgAAAAABAABhdjAxQ29sb3IAAAAAamlwcnAAAABLaXBjbwAAABRpc3BlAAAAAAAAAAIAAAACAAAAEHBpeGkAAAAAAwgICAAAAAxhdjFDgQ0MAAAAABNjb2xybmNseAACAAIAAYAAAAAXaXBtYQAAAAAAAAABAAEEAQKDBAAAACVtZGF0EgAKCBgANogQEAwgMg8f8D///8WfhwB8+ErK42A="}),eh=async(e="jpg")=>{const[r,a]=await Promise.all([Ra(),en()]);return a?"avif":r?"webp":e},rh=(e,r,a,n)=>`
65
+ `,children:o?"Verified":n?"Current Plan":"Select Plan"})]})},Qd=({children:e,backgroundClassName:r="",contentClassName:a=""})=>t.jsx("div",{className:r,children:t.jsx("div",{className:a,children:e})}),Rd=({title:e,description:r})=>t.jsxs("div",{className:"mb-8",children:[t.jsx("h1",{className:"text-3xl font-bold text-gray-900 dark:text-white",children:e}),r&&t.jsx("p",{className:"mt-2 text-gray-600 dark:text-gray-400",children:r})]}),e0=({children:e,mode:r,className:a,as:n="div",withPadding:o=!0})=>{const s=ue(),l=r?r0(r,o):o?s.containerClass:s.maxWidthClass;return t.jsx(n,{className:f(l,a),children:e})};function r0(e,r){const a={standard:"max-w-7xl mx-auto",wide:"max-w-[1920px] mx-auto",full:"w-full"};return r?`${a[e]} px-4`:a[e]}const t0=({variant:e="full",sticky:r=!1,className:a,children:n})=>{const{containerClass:o}=ue(),s=e==="compact";return t.jsx("footer",{className:f("bg-gray-900 text-white transition-all duration-300 ease-in-out",s?"py-4":"py-12",r?"sticky bottom-0 z-50 border-t border-gray-700":"relative z-10","pointer-events-auto",a),children:t.jsx("div",{className:o,children:n})})},a0=({children:e,className:r})=>t.jsx("div",{className:f("grid md:grid-cols-5 gap-8",r),children:e}),n0=({children:e,description:r,className:a})=>t.jsxs("div",{className:a,children:[t.jsx("div",{className:"mb-4",children:e}),r&&t.jsx("p",{className:U.body.sm(),children:r})]}),o0=({title:e,children:r,className:a})=>t.jsxs("div",{className:a,children:[t.jsx("h3",{className:f(U.heading.h5(),"mb-4 text-white"),children:e}),t.jsx("ul",{className:f("space-y-2",U.body.sm()),children:r})]}),s0=({children:e,className:r})=>t.jsx("li",{className:f("hover:text-white transition-colors",r),children:e}),l0=({children:e,className:r})=>t.jsx("div",{className:f("border-t mt-8 pt-8 text-center space-y-4",Mn.border.default,r),children:e}),i0=({children:e,className:r})=>p.Children.toArray(e).filter(Boolean).length===0?null:t.jsx("div",{className:f("flex items-center justify-center gap-3 text-gray-400 text-sm",r),children:e}),c0=({children:e,className:r})=>t.jsx("div",{className:f("flex flex-col sm:flex-row justify-between items-center space-y-2 sm:space-y-0",r),children:e}),d0=({children:e,className:r})=>t.jsx("div",{className:f("flex items-center gap-3 text-gray-400 text-sm",r),children:e}),g0=({children:e,className:r})=>t.jsx("div",{className:f("flex space-x-6 text-sm",r),children:e}),u0=({version:e,className:r})=>t.jsxs("span",{className:f("text-gray-500",r),children:["v",e]}),h0=({year:e,companyName:r,rightsText:a,companyLink:n,className:o})=>t.jsxs("span",{className:o,children:["© ",e," ",n||t.jsx("span",{className:"text-blue-400",children:r}),a&&`. ${a}`]}),ve=({href:e,label:r,children:a})=>t.jsx(Rt,{content:r,children:t.jsx("a",{href:e,target:"_blank",rel:"noopener noreferrer",className:"text-gray-400 hover:text-white transition-colors","aria-label":r,children:a})}),f0=({twitterUrl:e,redditUrl:r,discordUrl:a,linkedinUrl:n,farcasterUrl:o,telegramUrl:s,githubUrl:l,className:c})=>e||r||a||n||o||s||l?t.jsxs("div",{className:f("flex items-center gap-4",c),children:[e&&t.jsx(ve,{href:e,label:"Twitter / X",children:t.jsx("svg",{className:"w-5 h-5",fill:"currentColor",viewBox:"0 0 24 24","aria-hidden":"true",children:t.jsx("path",{d:"M18.244 2.25h3.308l-7.227 8.26 8.502 11.24H16.17l-5.214-6.817L4.99 21.75H1.68l7.73-8.835L1.254 2.25H8.08l4.713 6.231zm-1.161 17.52h1.833L7.084 4.126H5.117z"})})}),r&&t.jsx(ve,{href:r,label:"Reddit",children:t.jsx("svg",{className:"w-5 h-5",fill:"currentColor",viewBox:"0 0 24 24","aria-hidden":"true",children:t.jsx("path",{d:"M12 0A12 12 0 0 0 0 12a12 12 0 0 0 12 12 12 12 0 0 0 12-12A12 12 0 0 0 12 0zm5.01 4.744c.688 0 1.25.561 1.25 1.249a1.25 1.25 0 0 1-2.498.056l-2.597-.547-.8 3.747c1.824.07 3.48.632 4.674 1.488.308-.309.73-.491 1.207-.491.968 0 1.754.786 1.754 1.754 0 .716-.435 1.333-1.01 1.614a3.111 3.111 0 0 1 .042.52c0 2.694-3.13 4.87-7.004 4.87-3.874 0-7.004-2.176-7.004-4.87 0-.183.015-.366.043-.534A1.748 1.748 0 0 1 4.028 12c0-.968.786-1.754 1.754-1.754.463 0 .898.196 1.207.49 1.207-.883 2.878-1.43 4.744-1.487l.885-4.182a.342.342 0 0 1 .14-.197.35.35 0 0 1 .238-.042l2.906.617a1.214 1.214 0 0 1 1.108-.701zM9.25 12C8.561 12 8 12.562 8 13.25c0 .687.561 1.248 1.25 1.248.687 0 1.248-.561 1.248-1.249 0-.688-.561-1.249-1.249-1.249zm5.5 0c-.687 0-1.248.561-1.248 1.25 0 .687.561 1.248 1.249 1.248.688 0 1.249-.561 1.249-1.249 0-.687-.562-1.249-1.25-1.249zm-5.466 3.99a.327.327 0 0 0-.231.094.33.33 0 0 0 0 .463c.842.842 2.484.913 2.961.913.477 0 2.105-.056 2.961-.913a.361.361 0 0 0 .029-.463.33.33 0 0 0-.464 0c-.547.533-1.684.73-2.512.73-.828 0-1.979-.196-2.512-.73a.326.326 0 0 0-.232-.095z"})})}),a&&t.jsx(ve,{href:a,label:"Discord",children:t.jsx("svg",{className:"w-5 h-5",fill:"currentColor",viewBox:"0 0 24 24","aria-hidden":"true",children:t.jsx("path",{d:"M20.317 4.37a19.791 19.791 0 0 0-4.885-1.515.074.074 0 0 0-.079.037c-.21.375-.444.864-.608 1.25a18.27 18.27 0 0 0-5.487 0 12.64 12.64 0 0 0-.617-1.25.077.077 0 0 0-.079-.037A19.736 19.736 0 0 0 3.677 4.37a.07.07 0 0 0-.032.027C.533 9.046-.32 13.58.099 18.057a.082.082 0 0 0 .031.057 19.9 19.9 0 0 0 5.993 3.03.078.078 0 0 0 .084-.028 14.09 14.09 0 0 0 1.226-1.994.076.076 0 0 0-.041-.106 13.107 13.107 0 0 1-1.872-.892.077.077 0 0 1-.008-.128 10.2 10.2 0 0 0 .372-.292.074.074 0 0 1 .077-.01c3.928 1.793 8.18 1.793 12.062 0a.074.074 0 0 1 .078.01c.12.098.246.198.373.292a.077.077 0 0 1-.006.127 12.299 12.299 0 0 1-1.873.892.077.077 0 0 0-.041.107c.36.698.772 1.362 1.225 1.993a.076.076 0 0 0 .084.028 19.839 19.839 0 0 0 6.002-3.03.077.077 0 0 0 .032-.054c.5-5.177-.838-9.674-3.549-13.66a.061.061 0 0 0-.031-.03zM8.02 15.33c-1.183 0-2.157-1.085-2.157-2.419 0-1.333.956-2.419 2.157-2.419 1.21 0 2.176 1.096 2.157 2.42 0 1.333-.956 2.418-2.157 2.418zm7.975 0c-1.183 0-2.157-1.085-2.157-2.419 0-1.333.955-2.419 2.157-2.419 1.21 0 2.176 1.096 2.157 2.42 0 1.333-.946 2.418-2.157 2.418z"})})}),n&&t.jsx(ve,{href:n,label:"LinkedIn",children:t.jsx("svg",{className:"w-5 h-5",fill:"currentColor",viewBox:"0 0 24 24","aria-hidden":"true",children:t.jsx("path",{d:"M20.447 20.452h-3.554v-5.569c0-1.328-.027-3.037-1.852-3.037-1.853 0-2.136 1.445-2.136 2.939v5.667H9.351V9h3.414v1.561h.046c.477-.9 1.637-1.85 3.37-1.85 3.601 0 4.267 2.37 4.267 5.455v6.286zM5.337 7.433c-1.144 0-2.063-.926-2.063-2.065 0-1.138.92-2.063 2.063-2.063 1.14 0 2.064.925 2.064 2.063 0 1.139-.925 2.065-2.064 2.065zm1.782 13.019H3.555V9h3.564v11.452zM22.225 0H1.771C.792 0 0 .774 0 1.729v20.542C0 23.227.792 24 1.771 24h20.451C23.2 24 24 23.227 24 22.271V1.729C24 .774 23.2 0 22.222 0h.003z"})})}),o&&t.jsx(ve,{href:o,label:"Farcaster",children:t.jsx("svg",{className:"w-5 h-5",fill:"currentColor",viewBox:"0 0 24 24","aria-hidden":"true",children:t.jsx("path",{d:"M18.24 2.4H5.76a3.36 3.36 0 0 0-3.36 3.36v12.48a3.36 3.36 0 0 0 3.36 3.36h12.48a3.36 3.36 0 0 0 3.36-3.36V5.76a3.36 3.36 0 0 0-3.36-3.36zm-2.16 13.2h-1.2v-4.8h-5.76v4.8H7.92V8.4h1.2v3.6h5.76V8.4h1.2v7.2z"})})}),s&&t.jsx(ve,{href:s,label:"Telegram",children:t.jsx("svg",{className:"w-5 h-5",fill:"currentColor",viewBox:"0 0 24 24","aria-hidden":"true",children:t.jsx("path",{d:"M11.944 0A12 12 0 0 0 0 12a12 12 0 0 0 12 12 12 12 0 0 0 12-12A12 12 0 0 0 12 0a12 12 0 0 0-.056 0zm4.962 7.224c.1-.002.321.023.465.14a.506.506 0 0 1 .171.325c.016.093.036.306.02.472-.18 1.898-.962 6.502-1.36 8.627-.168.9-.499 1.201-.82 1.23-.696.065-1.225-.46-1.9-.902-1.056-.693-1.653-1.124-2.678-1.8-1.185-.78-.417-1.21.258-1.91.177-.184 3.247-2.977 3.307-3.23.007-.032.014-.15-.056-.212s-.174-.041-.249-.024c-.106.024-1.793 1.14-5.061 3.345-.48.33-.913.49-1.302.48-.428-.008-1.252-.241-1.865-.44-.752-.245-1.349-.374-1.297-.789.027-.216.325-.437.893-.663 3.498-1.524 5.83-2.529 6.998-3.014 3.332-1.386 4.025-1.627 4.476-1.635z"})})}),l&&t.jsx(ve,{href:l,label:"GitHub",children:t.jsx("svg",{className:"w-5 h-5",fill:"currentColor",viewBox:"0 0 24 24","aria-hidden":"true",children:t.jsx("path",{fillRule:"evenodd",d:"M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-1.703-2.782.605-3.369-1.343-3.369-1.343-.454-1.158-1.11-1.466-1.11-1.466-.908-.62.069-.608.069-.608 1.003.07 1.531 1.032 1.531 1.032.892 1.53 2.341 1.088 2.91.832.092-.647.35-1.088.636-1.338-2.22-.253-4.555-1.113-4.555-4.951 0-1.093.39-1.988 1.029-2.688-.103-.253-.446-1.272.098-2.65 0 0 .84-.27 2.75 1.026A9.564 9.564 0 0 1 12 6.844c.85.004 1.705.115 2.504.337 1.909-1.296 2.747-1.027 2.747-1.027.546 1.379.202 2.398.1 2.651.64.7 1.028 1.595 1.028 2.688 0 3.848-2.339 4.695-4.566 4.943.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0 0 22 12.017C22 6.484 17.522 2 12 2z",clipRule:"evenodd"})})})]}):null,b0=({isSelected:e,onClick:r,icon:a,label:n,description:o,className:s=""})=>t.jsxs("div",{onClick:r,className:`relative flex items-start p-4 cursor-pointer transition-all border-b border-gray-200 dark:border-gray-700 last:border-b-0 group ${s}`,children:[e&&t.jsx("div",{className:"absolute inset-1 bg-blue-500/10 dark:bg-blue-400/10 rounded-lg pointer-events-none"}),t.jsxs("div",{className:"relative z-10 flex items-start w-full",children:[a&&t.jsx(a,{className:`h-5 w-5 mt-0.5 mr-3 flex-shrink-0 transition-colors ${e?"text-blue-600 dark:text-blue-400":"text-gray-500 dark:text-gray-400 group-hover:text-gray-700 dark:group-hover:text-gray-300"}`}),t.jsxs("div",{className:"flex-1 min-w-0",children:[t.jsx("div",{className:`font-medium transition-colors ${e?"text-blue-600 dark:text-blue-400":"text-gray-900 dark:text-gray-100 group-hover:text-gray-700 dark:group-hover:text-gray-300"}`,children:n}),o&&t.jsx("div",{className:`text-xs mt-0.5 transition-colors ${e?"text-blue-500 dark:text-blue-300":"text-gray-500 dark:text-gray-400"}`,children:o})]})]})]}),m0=({masterTitle:e,masterSubtitle:r,backButtonText:a,masterContent:n,detailContent:o,detailTitle:s,mobileView:l="navigation",onBackToNavigation:c,masterClassName:d="",detailClassName:i="",detailTitleClassName:h="",masterWidth:u=320,stickyMaster:y=!0,stickyTopOffset:m=96,desktopGap:b=32,showMasterBackground:v=!0,enableAnimations:k=!0,animationDuration:S=300,animationRef:x})=>{const{containerClass:N}=ue(),w=`gap-${Math.round(b/4)}`||"gap-8",E=V=>V?V.split("-")[0].trim():"Back",A=a?E(a):e?E(e):"Back",[C,I]=p.useState(!1),[L,O]=p.useState("auto"),M=p.useRef(null),D=p.useRef(null);p.useEffect(()=>(x&&(x.current={triggerTransition:V=>{if(!k){V();return}if(M.current){const R=M.current.scrollHeight;O(R)}I(!0),D.current&&clearTimeout(D.current),D.current=setTimeout(()=>{V(),setTimeout(()=>{if(M.current){const R=M.current.scrollHeight;O(R),setTimeout(()=>{O("auto"),I(!1)},S)}},50)},S/2)}}),()=>{D.current&&clearTimeout(D.current)}),[k,S,x]);const B=k?{height:L==="auto"?"auto":`${L}px`,transition:`height ${S}ms cubic-bezier(0.4, 0, 0.2, 1)`,width:"100%",maxWidth:"100%"}:{width:"100%",maxWidth:"100%"},z=k?`${C?"opacity-0 transform translate-y-2":"opacity-100 transform translate-y-0"}`:"",F=k?{transition:`opacity ${S}ms ease-in-out, transform ${S}ms ease-in-out`}:{};return t.jsxs(t.Fragment,{children:[t.jsx("div",{className:`md:hidden ${l==="navigation"?"block":"hidden"} flex-1`,children:t.jsxs("div",{className:v?"bg-white dark:bg-gray-800 p-6":"p-6",children:[e&&t.jsxs("div",{className:N,children:[t.jsx("h2",{className:"text-xl font-semibold text-gray-900 dark:text-white mb-4",children:e}),r&&t.jsx("p",{className:"text-sm text-gray-600 dark:text-gray-400 mb-6 break-all",children:r})]}),t.jsx("div",{className:d,children:n})]})}),t.jsxs("div",{className:`${N} py-8`,children:[t.jsxs("div",{className:`md:hidden ${l==="content"?"block":"hidden"}`,children:[l==="content"&&c&&t.jsxs("button",{onClick:c,className:"mb-4 px-4 py-2 border border-gray-300 dark:border-gray-600 rounded-md text-sm font-medium text-gray-700 dark:text-gray-300 bg-white dark:bg-gray-800 hover:bg-gray-50 dark:hover:bg-gray-700 transition-colors",children:["← ",A]}),t.jsx("div",{ref:M,className:`bg-white dark:bg-gray-800 rounded-lg border border-gray-200 dark:border-gray-700 p-8 overflow-hidden ${i}`,style:B,children:t.jsxs("div",{className:z,style:F,children:[s&&t.jsx("h1",{className:`text-4xl font-bold text-gray-900 dark:text-white mb-6 ${h}`,children:s}),o]})})]}),t.jsxs("div",{className:`hidden md:flex min-h-full ${w}`,style:{width:"100%"},children:[t.jsx("aside",{className:"flex-shrink-0",style:{width:`${u}px`,minWidth:`${u}px`},children:t.jsxs("div",{className:y?"sticky":"",style:y?{top:`${m}px`}:void 0,children:[e&&t.jsx("h2",{className:"text-lg font-semibold text-gray-900 dark:text-white mb-4",children:e}),r&&t.jsx("p",{className:"text-sm text-gray-600 dark:text-gray-400 mb-6 break-all",children:r}),t.jsx("div",{className:`bg-white dark:bg-gray-800 rounded-lg border border-gray-200 dark:border-gray-700 ${y?"max-h-[calc(100vh-200px)] overflow-y-auto":""} ${d}`,children:n})]})}),t.jsx("div",{className:"flex-1 min-w-0",style:{width:`calc(100% - ${u+b}px)`},children:t.jsx("div",{ref:M,className:`bg-white dark:bg-gray-800 rounded-lg border border-gray-200 dark:border-gray-700 p-8 overflow-hidden ${i}`,style:B,children:t.jsxs("div",{className:z,style:F,children:[s&&t.jsx("h1",{className:`text-4xl font-bold text-gray-900 dark:text-white mb-6 ${h}`,children:s}),o]})})})]})]})]})},y0=({children:e,topBar:r,footer:a,breadcrumbSection:n,stickyHeader:o=!0,layoutMode:s="standard",className:l,contentClassName:c,headerZIndex:d=40})=>{const i=r||n;return t.jsx(na,{mode:s,children:t.jsxs("div",{className:f("min-h-screen bg-gray-50 dark:bg-gray-900 flex flex-col",l),children:[i&&t.jsxs("div",{className:o?"sticky top-0":"",style:o?{zIndex:d}:void 0,children:[r,n]}),t.jsx("div",{className:f("flex-1",c),children:e}),a]})})},p0=({aspectRatio:e,children:r,className:a,innerClassName:n})=>t.jsx("div",{className:f("h-full w-full",a),children:t.jsx("div",{className:f("mx-auto max-h-full max-w-full overflow-auto",n),style:{aspectRatio:e},children:r})}),Fr=p.createContext(null),la=({children:e,variant:r="default",sticky:a=!0})=>{const[n,o]=p.useState(!1),s=p.useCallback(()=>{o(l=>!l)},[]);return t.jsx(Fr.Provider,{value:{variant:r,sticky:a,mobileMenuOpen:n,setMobileMenuOpen:o,toggleMobileMenu:s},children:e})},Wr=()=>{const e=p.useContext(Fr);if(!e)throw new Error("useTopbar must be used within a TopbarProvider");return e},ia={sm:"min-h-12",md:"min-h-14",lg:"min-h-16"},v0={default:"bg-white dark:bg-gray-900 border-b border-gray-200 dark:border-gray-700",app:"bg-white dark:bg-gray-900 border-b border-gray-200 dark:border-gray-700 shadow-sm",minimal:"bg-transparent",transparent:"bg-white/80 dark:bg-gray-900/80 border-b border-gray-200/50 dark:border-gray-700/50"},k0={default:"z-40",high:"z-50",highest:"z-[60]"},x0=({children:e,variant:r="default",sticky:a=!0,className:n,height:o="md",blur:s=!1,zIndex:l="high","aria-label":c="Main navigation"})=>{const{containerClass:d}=ue();return t.jsx(la,{variant:r,sticky:a,children:t.jsxs("header",{role:"banner","aria-label":c,className:f("w-full",ia[o],v0[r],k0[l],a&&"sticky top-0",s&&"backdrop-blur-md","transition-colors duration-200",n),children:[t.jsx("a",{href:"#main-content",className:"sr-only focus:not-sr-only focus:absolute focus:top-2 focus:left-2 bg-blue-600 text-white px-4 py-2 rounded-md z-50 focus:outline-none focus:ring-2 focus:ring-blue-500 focus:ring-offset-2",children:"Skip to main content"}),t.jsx("div",{className:f(d,ia[o],"flex flex-wrap items-center justify-between"),children:e})]})})},w0=({children:e,className:r})=>t.jsx("div",{className:f("flex items-center gap-2 shrink-0",r),children:e}),N0=({children:e,className:r})=>t.jsx("div",{className:f("flex-1 flex items-center justify-center px-4",r),children:e}),C0=({children:e,className:r})=>t.jsx("div",{className:f("flex items-center gap-2 shrink-0",r),children:e}),S0=({children:e,className:r})=>t.jsx("div",{className:f("md:hidden w-full basis-full pt-2 pb-3",r),children:e}),E0=({className:e})=>t.jsx("div",{className:f("hidden md:block h-6 w-px bg-gray-200 dark:bg-gray-700 mx-2",e),role:"separator","aria-orientation":"vertical"}),A0={sm:"h-6",md:"h-8",lg:"h-10"},T0=({children:e,src:r,alt:a="Logo",onClick:n,href:o,className:s,size:l="md"})=>{const c=e||r&&t.jsx("img",{src:r,alt:a,className:f(A0[l],"w-auto object-contain")}),d=f("flex items-center","hover:opacity-80 transition-opacity duration-200","focus:outline-none focus:ring-2 focus:ring-blue-500 focus:ring-offset-2 rounded-md",s);return o?t.jsx("a",{href:o,className:d,title:a,children:c}):n?t.jsx("button",{type:"button",onClick:n,className:d,title:a,"aria-label":`Go to ${a||"home"}`,children:c}):t.jsx("div",{className:d,children:c})},I0={sm:"sm:hidden",md:"md:hidden",lg:"lg:hidden",xl:"xl:hidden"},L0=({className:e,isOpen:r})=>t.jsx("svg",{className:e,fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,"aria-hidden":"true",children:r?t.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 18L18 6M6 6l12 12"}):t.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M4 6h16M4 12h16M4 18h16"})}),ca=({icon:e,"aria-label":r="Toggle navigation menu",className:a,onClick:n,hideAbove:o="lg",menuItems:s,LinkComponent:l})=>{const{mobileMenuOpen:c,toggleMobileMenu:d,setMobileMenuOpen:i}=Wr(),[h,u]=p.useState(!1),y=p.useRef(null);rr(y,()=>{u(!1)});const m=s?h:c,b=()=>{n?n():s?u(!h):d()},v=()=>{u(!1),i(!1)};return t.jsxs("div",{className:f("relative",I0[o]),ref:y,children:[t.jsx("button",{type:"button",onClick:b,className:f("p-2 rounded-lg","text-gray-600 dark:text-gray-400","hover:bg-gray-100 dark:hover:bg-gray-700","hover:text-gray-900 dark:hover:text-gray-100","focus:outline-none focus:ring-2 focus:ring-blue-500 focus:ring-offset-2","transition-colors duration-200",a),"aria-label":r,"aria-expanded":m,"aria-haspopup":s?"menu":void 0,"aria-controls":s?"topbar-dropdown-menu":"mobile-menu",children:e?t.jsx(e,{className:"h-6 w-6"}):t.jsx(L0,{className:"h-6 w-6",isOpen:m})}),s&&h&&t.jsx("div",{id:"topbar-dropdown-menu",role:"menu",className:f("absolute left-0 top-full mt-2","min-w-[200px] py-2 rounded-lg","bg-white dark:bg-gray-800","border border-gray-200 dark:border-gray-700","shadow-lg","z-50"),children:s.map(k=>{const S=k.icon,x=t.jsxs(t.Fragment,{children:[S&&t.jsx(S,{className:"h-5 w-5 mr-3 flex-shrink-0"}),t.jsx("span",{children:k.label})]}),N=f("flex items-center w-full px-4 py-2.5 text-sm font-medium","text-gray-700 dark:text-gray-300","hover:bg-gray-100 dark:hover:bg-gray-700","hover:text-gray-900 dark:hover:text-gray-100","transition-colors duration-150",k.active&&"bg-blue-50 dark:bg-blue-900/20 text-blue-600 dark:text-blue-400",k.disabled&&"opacity-50 cursor-not-allowed");return k.href&&l?t.jsx(l,{href:k.href,className:N,children:t.jsx("div",{className:"flex items-center",onClick:v,children:x})},k.id):k.href?t.jsx("a",{href:k.href,role:"menuitem",className:N,onClick:v,children:x},k.id):t.jsx("button",{type:"button",role:"menuitem",className:N,onClick:()=>{v(),k.onClick?.()},disabled:k.disabled,children:x},k.id)})})]})},M0={sm:{show:"hidden sm:flex",hide:"sm:hidden"},md:{show:"hidden md:flex",hide:"md:hidden"},lg:{show:"hidden lg:flex",hide:"lg:hidden"},xl:{show:"hidden xl:flex",hide:"xl:hidden"}},P0={left:"justify-start",center:"justify-center",right:"justify-end"},da=({items:e,className:r,collapseBelow:a="lg",LinkComponent:n,align:o="center"})=>{const[s,l]=p.useState(null),c=p.useRef(null);rr(c,()=>l(null));const d=(i,h=!1)=>{const u=i.children&&i.children.length>0,y=s===i.id,m=f("px-3 py-2 rounded-md text-sm font-medium","transition-colors duration-200",i.active?"text-blue-600 dark:text-blue-400 bg-blue-50 dark:bg-blue-900/20":"text-gray-600 dark:text-gray-400 hover:text-gray-900 dark:hover:text-gray-100 hover:bg-gray-100 dark:hover:bg-gray-700",i.disabled&&"opacity-50 cursor-not-allowed pointer-events-none",h&&"w-full text-left",i.className);return u?t.jsxs("div",{className:"relative",ref:c,children:[t.jsxs("button",{type:"button",onClick:()=>l(y?null:i.id),className:f(m,"flex items-center gap-1"),"aria-expanded":y,"aria-haspopup":"true",disabled:i.disabled,children:[i.icon&&t.jsx(i.icon,{className:"h-4 w-4 mr-1"}),i.label,t.jsx("svg",{className:f("h-4 w-4 transition-transform duration-200",y&&"rotate-180"),fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:t.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 9l-7 7-7-7"})})]}),y&&t.jsx("div",{className:f("absolute top-full left-0 mt-1 py-1","min-w-[200px] rounded-md shadow-lg","bg-white dark:bg-gray-800","border border-gray-200 dark:border-gray-700","z-50"),children:i.children?.map(b=>t.jsx(Vr,{item:b,LinkComponent:n,className:f("block px-4 py-2 text-sm","text-gray-700 dark:text-gray-300","hover:bg-gray-100 dark:hover:bg-gray-700",b.active&&"bg-blue-50 dark:bg-blue-900/20 text-blue-600 dark:text-blue-400"),onClick:()=>l(null)},b.id))})]},i.id):t.jsx(Vr,{item:i,LinkComponent:n,className:m},i.id)};return t.jsx("nav",{className:f("flex items-center gap-1",M0[a].show,P0[o],r),"aria-label":"Main navigation",children:e.map(i=>d(i))})},Vr=({item:e,LinkComponent:r,className:a,onClick:n})=>{const o=()=>{n?.(),e.onClick?.()},s=t.jsxs(t.Fragment,{children:[e.icon&&t.jsx(e.icon,{className:"h-4 w-4 mr-2"}),e.label]});return e.href&&r?t.jsx(r,{href:e.href,className:f(a,"flex items-center"),children:s}):e.href?t.jsx("a",{href:e.href,className:f(a,"flex items-center"),onClick:o,children:s}):t.jsx("button",{type:"button",onClick:o,className:f(a,"flex items-center"),disabled:e.disabled,children:s})},O0=({items:e,isOpen:r,className:a,LinkComponent:n})=>{const{mobileMenuOpen:o,setMobileMenuOpen:s}=Wr();return r??o?t.jsx("div",{id:"mobile-menu",className:f("lg:hidden","border-t border-gray-200 dark:border-gray-700","bg-white dark:bg-gray-900","shadow-lg",a),children:t.jsx("nav",{className:"px-4 py-2 space-y-1","aria-label":"Mobile navigation",children:e.map(c=>t.jsx(Vr,{item:c,LinkComponent:n,className:f("flex items-center w-full px-3 py-2 rounded-md text-base font-medium","transition-colors duration-200",c.active?"text-blue-600 dark:text-blue-400 bg-blue-50 dark:bg-blue-900/20":"text-gray-600 dark:text-gray-400 hover:text-gray-900 dark:hover:text-gray-100 hover:bg-gray-100 dark:hover:bg-gray-700",c.className),onClick:()=>s(!1)},c.id))})}):null},U0=({items:e,LinkComponent:r,collapseBelow:a="lg",align:n="center",className:o,mobileMenuLabel:s="Toggle navigation menu",children:l})=>t.jsxs(t.Fragment,{children:[t.jsx(ca,{hideAbove:a,menuItems:e,LinkComponent:r,"aria-label":s,className:o}),l,t.jsx(da,{items:e,collapseBelow:a,LinkComponent:r,align:n,className:o})]}),D0={sm:"gap-1",md:"gap-2",lg:"gap-3"},z0={left:"justify-start",center:"justify-center",right:"justify-end"},j0=({children:e,className:r,gap:a="md",align:n="right"})=>t.jsx("div",{className:f("flex items-center",D0[a],z0[n],r),children:e}),_0={sm:"h-4 w-4",md:"h-5 w-5",lg:"h-6 w-6"},B0={sm:"p-1.5",md:"p-2",lg:"p-2.5"},F0=({icon:e,onClick:r,"aria-label":a,className:n,disabled:o=!1,badge:s,size:l="md"})=>t.jsxs("button",{type:"button",onClick:r,className:f("relative rounded-lg",B0[l],"text-gray-500 dark:text-gray-400","hover:bg-gray-100 dark:hover:bg-gray-700","hover:text-gray-700 dark:hover:text-gray-200","focus:outline-none focus:ring-2 focus:ring-blue-500 focus:ring-offset-2","transition-colors duration-200",o&&"opacity-50 cursor-not-allowed",n),"aria-label":a,disabled:o,children:[t.jsx(e,{className:_0[l]}),s!==void 0&&s>0&&t.jsx("span",{className:f("absolute -top-1 -right-1","min-w-[18px] h-[18px] px-1","flex items-center justify-center","text-xs font-medium","bg-red-500 text-white rounded-full","ring-2 ring-white dark:ring-gray-900"),"aria-label":`${s} notifications`,children:s>99?"99+":s})]}),W0={sm:"w-48",md:"w-64",lg:"w-96",full:"w-full"},V0=({placeholder:e="Search...",value:r,onChange:a,onSubmit:n,className:o,width:s="md",showOnMobile:l=!1})=>{const[c,d]=p.useState(r||""),i=u=>{const y=u.target.value;d(y),a?.(y)},h=u=>{u.preventDefault(),n?.(c)};return t.jsx("form",{onSubmit:h,className:f(!l&&"hidden md:block",o),role:"search",children:t.jsxs("div",{className:"relative",children:[t.jsx("svg",{className:"absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-gray-400",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor","aria-hidden":"true",children:t.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z"})}),t.jsx("input",{type:"search",value:c,onChange:i,placeholder:e,"aria-label":e,className:f(W0[s],"pl-10 pr-4 py-2","text-sm","bg-gray-100 dark:bg-gray-800","border border-transparent","rounded-lg","text-gray-900 dark:text-gray-100","placeholder:text-gray-500 dark:placeholder:text-gray-400","focus:outline-none focus:ring-2 focus:ring-blue-500 focus:bg-white dark:focus:bg-gray-700 focus:border-transparent","transition-colors duration-200")})]})})},$0=({children:e,appName:r,appUrl:a,apiUrl:n})=>(p.useEffect(()=>{const o=()=>{[].forEach(b=>{const v=document.createElement("link");v.rel="preload",v.href=b.href,v.as=b.as,b.type&&(v.type=b.type),b.crossorigin&&(v.crossOrigin=""),document.head.appendChild(v)})},s=()=>{document.querySelectorAll('img[data-priority="high"]').forEach(v=>{v.fetchPriority="high"});const b=document.querySelector("[data-hero]");if(b){const v=b.getAttribute("data-bg-image");if(v){const k=document.createElement("link");k.rel="preload",k.href=v,k.as="image",document.head.appendChild(k)}}},l=()=>{document.querySelectorAll("img:not([width]):not([height])").forEach(v=>{const k=v;k.naturalWidth&&k.naturalHeight&&(k.width=k.naturalWidth,k.height=k.naturalHeight)}),document.querySelectorAll("[data-dynamic]").forEach(v=>{v.getAttribute("style")?.includes("min-height")||(v.style.minHeight="200px")})},c=()=>{const m=()=>{document.querySelectorAll("script[data-defer]").forEach(k=>{k.setAttribute("defer","")})};"requestIdleCallback"in window?requestIdleCallback(()=>{m()}):setTimeout(m,1),(()=>{["scroll","touchstart","touchmove","wheel"].forEach(k=>{document.addEventListener(k,()=>{},{passive:!0})})})()},d=()=>{},i=()=>{[{rel:"dns-prefetch",href:"//fonts.googleapis.com"},...n?[{rel:"dns-prefetch",href:`//${n.replace(/^https?:\/\//,"")}`}]:[],{rel:"preconnect",href:"https://fonts.gstatic.com",crossorigin:!0},...n?[{rel:"preconnect",href:n}]:[]].forEach(b=>{const v=document.createElement("link");v.rel=b.rel,v.href=b.href,b.crossorigin&&(v.crossOrigin=""),document.head.appendChild(v)})},h=()=>{if(document.querySelectorAll("img[data-lazy]").forEach(b=>{b.loading="lazy"}),"IntersectionObserver"in window){const b=new IntersectionObserver(k=>{k.forEach(S=>{if(S.isIntersecting){const x=S.target;x.dataset.src&&(x.src=x.dataset.src,x.removeAttribute("data-src")),b.unobserve(x)}})},{rootMargin:"50px 0px"});document.querySelectorAll("img[data-src]").forEach(k=>b.observe(k))}},u=()=>{[{name:"ai-content-type",content:"web3-email-platform"},{name:"ai-primary-function",content:"wallet-based-email"},{name:"ai-supported-chains",content:"ethereum,solana,polygon,arbitrum,optimism"},{name:"ai-complexity-level",content:"beginner-to-advanced"},{name:"ai-target-users",content:"web3-users,crypto-enthusiasts,developers"},{name:"machine-readable",content:"true"},{name:"structured-data",content:"json-ld"},{name:"content-category",content:"technology,blockchain,communication"},{name:"interaction-model",content:"wallet-authentication"}].forEach(({name:k,content:S})=>{if(!document.querySelector(`meta[name="${k}"]`)){const x=document.createElement("meta");x.name=k,x.content=S,document.head.appendChild(x)}});const b={"@context":"https://schema.org","@type":"WebApplication",name:r,description:"Web3 email platform using blockchain wallet authentication",url:a,applicationCategory:"CommunicationApplication",operatingSystem:"Web Browser",offers:{"@type":"Offer",price:"0",priceCurrency:"USD"},featureList:["Wallet-based authentication","ENS domain email support","SNS domain email support","Multi-chain compatibility","Smart contract integration","Web2/Web3 bridge"],audience:{"@type":"Audience",audienceType:"Web3 Users"}},v=document.createElement("script");v.type="application/ld+json",v.textContent=JSON.stringify(b),document.head.appendChild(v)},y=()=>{document.querySelectorAll('link[rel="stylesheet"][data-non-critical]').forEach(b=>{const v=b.cloneNode(!0);v.rel="preload",v.as="style",v.onload=()=>{v.onload=null,v.rel="stylesheet"},document.head.appendChild(v),b.remove()})};return o(),s(),l(),c(),i(),h(),u(),y(),setTimeout(d,2e3),()=>{}},[n,r,a]),t.jsx(t.Fragment,{children:e})),H0=()=>(p.useEffect(()=>{if(typeof window>"u"||typeof document>"u"||!document.documentElement)return;const e=()=>{if("IntersectionObserver"in window){const c=new IntersectionObserver(d=>{d.forEach(i=>{if(i.isIntersecting){const h=i.target;h.dataset.src&&(h.src=h.dataset.src,h.removeAttribute("data-src"),c.unobserve(h))}})},{rootMargin:"50px 0px"});document.querySelectorAll("img[data-src]").forEach(d=>{c.observe(d)})}const o=()=>{["/connect","/mail","/settings"].forEach(d=>{const i=document.createElement("link");i.rel="prefetch",i.href=d,document.head.appendChild(i)})},s=()=>{if(!document.querySelector("script[data-wallet-detection]")){const c=document.createElement("script");c.dataset.walletDetection="true",c.innerHTML='(function() { window.walletPreload = { hasMetaMask: typeof window.ethereum !== "undefined", hasPhantom: typeof window.solana !== "undefined", hasWalletConnect: true }; })();',document.head.appendChild(c)}},l=()=>{document.querySelectorAll("img[data-hero]").forEach(c=>{const d=c;d.loading="eager","fetchPriority"in d&&(d.fetchPriority="high")}),document.querySelectorAll('img[data-priority="low"]').forEach(c=>{const d=c;d.loading="lazy","fetchPriority"in d&&(d.fetchPriority="low")})};requestIdleCallback(()=>{o(),s(),l()},{timeout:2e3})},r=()=>{if("PerformanceObserver"in window){const o=new PerformanceObserver(l=>{const c=l.getEntries(),d=c[c.length-1];d&&d.startTime>2500&&(document.documentElement.style.setProperty("--animation-duration","0s"),localStorage.setItem("reduce-image-quality","true"))});try{o.observe({entryTypes:["largest-contentful-paint"]})}catch{}const s=new PerformanceObserver(l=>{let c=0;for(const d of l.getEntries())d.hadRecentInput||(c+=d.value);c>.1&&document.querySelectorAll("img:not([width]):not([height])").forEach(d=>{const i=d;i.style.aspectRatio="16/9"})});try{s.observe({entryTypes:["layout-shift"]})}catch{}}},a=()=>{if("connection"in navigator&&typeof document<"u"&&document.documentElement){const o=navigator.connection;if(o){const s=o.effectiveType;s==="slow-2g"||s==="2g"?(document.documentElement.classList.add("slow-connection"),document.querySelectorAll('link[rel="prefetch"]').forEach(l=>{l.getAttribute("data-critical")||l.remove()}),localStorage.setItem("use-low-quality-images","true")):s==="3g"?document.documentElement.classList.add("moderate-connection"):document.documentElement.classList.add("fast-connection")}}};return(()=>{e(),r(),a()})(),()=>{if("PerformanceObserver"in window)try{PerformanceObserver.supportedEntryTypes.forEach(()=>{})}catch{}}},[]),null),q0=({children:e})=>t.jsx(t.Fragment,{children:e}),ga={user:{duration:300*1e3,maxSize:100,staleWhileRevalidate:!0},mailboxes:{duration:120*1e3,maxSize:50,staleWhileRevalidate:!0},addresses:{duration:600*1e3,maxSize:50,staleWhileRevalidate:!0},messages:{duration:30*1e3,maxSize:200,staleWhileRevalidate:!0},messageDetails:{duration:120*1e3,maxSize:100,staleWhileRevalidate:!1},messageCount:{duration:10*1e3,maxSize:20,staleWhileRevalidate:!0}};class G0{constructor(){this.cache=new Map}set(r,a,n){if(this.cache.size>=n.maxSize){const o=this.cache.keys().next().value;o&&this.cache.delete(o)}this.cache.set(r,{data:a,timestamp:Date.now(),isStale:!1})}get(r,a){const n=this.cache.get(r);if(!n)return null;const s=Date.now()-n.timestamp>a.duration;return s&&!a.staleWhileRevalidate?(this.cache.delete(r),null):{data:n.data,isStale:s}}invalidate(r){for(const a of this.cache.keys())a.includes(r)&&this.cache.delete(a)}clear(){this.cache.clear()}getStats(){return{size:this.cache.size,keys:Array.from(this.cache.keys()),memory:this.estimateMemoryUsage()}}estimateMemoryUsage(){return Array.from(this.cache.values()).reduce((r,a)=>r+JSON.stringify(a).length*2,0)}}const Ae=new G0,ke=new Map,ua=async(e,r,a="messages")=>{const n=ga[a],o=Ae.get(e,n);if(o&&!o.isStale)return o.data;const s=ke.get(e);if(s)return s;if(o&&o.isStale&&n.staleWhileRevalidate){const c=r().then(d=>(Ae.set(e,d,n),ke.delete(e),d)).catch(d=>{throw ke.delete(e),d});return ke.set(e,c),o.data}const l=r().then(c=>(Ae.set(e,c,n),ke.delete(e),c)).catch(c=>{throw ke.delete(e),c});return ke.set(e,l),l};class Y0{constructor(){this.queue=[],this.timer=null,this.batchDelay=10}add(r,a){return new Promise((n,o)=>{this.queue.push({key:r,fetcher:a,resolve:n,reject:o}),this.timer&&clearTimeout(this.timer),this.timer=setTimeout(()=>{this.processBatch()},this.batchDelay)})}async processBatch(){const r=[...this.queue];this.queue.length=0,this.timer=null;const a=this.groupRequests(r);for(const n of a)await Promise.allSettled(n.map(async o=>{try{const s=await o.fetcher();o.resolve(s)}catch(s){o.reject(s)}}))}groupRequests(r){const a=[];for(let o=0;o<r.length;o+=5)a.push(r.slice(o,o+5));return a}}const K0=new Y0;class X0{constructor(r,a={}){this.requestInterceptors=[],this.responseInterceptors=[],this.baseURL=r,this.defaultHeaders=a}addRequestInterceptor(r){this.requestInterceptors.push(r)}addResponseInterceptor(r){this.responseInterceptors.push(r)}async request(r,a={},n,o="messages"){const s=`${this.baseURL}${r}`,l=n||`${a.method||"GET"}:${s}`,c=async()=>{let d={...a,headers:{...this.defaultHeaders,...a.headers}};for(const h of this.requestInterceptors)d=h(d);let i=await fetch(s,d);for(const h of this.responseInterceptors)i=await h(i);if(!i.ok)throw new Error(`API Error: ${i.status} ${i.statusText}`);return i.json()};return a.method==="GET"&&this.shouldBatch(r)?K0.add(l,c):ua(l,c,o)}shouldBatch(r){return r.includes("/messages/")&&!r.includes("/messages?")}async get(r,a){return this.request(r,{method:"GET"},void 0,a)}async post(r,a){return this.request(r,{method:"POST",body:JSON.stringify(a)})}async put(r,a){return this.request(r,{method:"PUT",body:JSON.stringify(a)})}async delete(r){return this.request(r,{method:"DELETE"})}}const Z0=async(e,r=3,a=1e3)=>{let n;for(let o=0;o<=r;o++)try{return await e()}catch(s){if(n=s,o===r)throw n;const l=a*Math.pow(2,o)+Math.random()*1e3;await new Promise(c=>setTimeout(c,l))}throw n};class J0{constructor(){this.abortController=new AbortController}async request(r,a={}){const n=await fetch(r,{...a,signal:this.abortController.signal});if(!n.ok)throw new Error(`HTTP ${n.status}: ${n.statusText}`);return n.json()}cancel(){this.abortController.abort()}}const Q0={invalidate:e=>Ae.invalidate(e),clear:()=>Ae.clear(),getStats:()=>Ae.getStats(),warmUp:async e=>{await Promise.allSettled(e.map(r=>r()))},prefetch:async e=>{"requestIdleCallback"in window?window.requestIdleCallback(async()=>{await Promise.allSettled(e.map(r=>r()))}):setTimeout(async()=>{await Promise.allSettled(e.map(r=>r()))},100)}};function ha(){if(typeof window>"u")return!1;const e=window.navigator.userAgent.toLowerCase();return["metamask","trustwallet","coinbase","rainbow","phantom","solflare","exodus","ledger","binance","okx"].some(a=>e.includes(a))}function fa(){return typeof window>"u"?!1:window.location.hostname==="localhost"||window.location.hostname==="127.0.0.1"}function ba(){if(typeof window>"u")return!1;const e=window.location.hostname;return/^\d+\.\d+\.\d+\.\d+$/.test(e)}function ma(){return fa()?"localhost":ha()?"wallet-browser":ba()?"network":"production"}function R0(){const e=ma();return e==="localhost"||e==="wallet-browser"}function eg(e){}function ya(){return typeof window<"u"}function rg(){return typeof window<"u"}function tg(e,r){if(ya())e();else return r}const $r=e=>({"default-src":["'self'"],"script-src":["'self'","'unsafe-inline'","'unsafe-eval'","https://fonts.googleapis.com","https://www.googletagmanager.com","https://www.google-analytics.com"],"style-src":["'self'","'unsafe-inline'","https://fonts.googleapis.com","https://fonts.gstatic.com"],"font-src":["'self'","https://fonts.gstatic.com","data:"],"img-src":["'self'","data:","https:","blob:"],"connect-src":["'self'",...e?.apiUrls||[],...e?.appUrls||[],"https://*.walletconnect.com","https://*.walletconnect.org","https://registry.walletconnect.com","https://relay.walletconnect.com","wss://*.walletconnect.com","wss://*.walletconnect.org","https://keys.coinbase.com","https://api.coinbase.com","https://www.walletlink.org","https://mainnet.infura.io","https://polygon-rpc.com","https://rpc.ankr.com","https://cloudflare-eth.com","https://eth-mainnet.alchemyapi.io","https://api.phantom.app","https://solana-api.projectserum.com","https://api.mainnet-beta.solana.com","https://api.devnet.solana.com","wss://api.phantom.app","wss://api.devnet.solana.com","wss://api.mainnet-beta.solana.com","https://bridge.arbitrum.io","https://polygon-mainnet.infura.io","https://optimism-mainnet.infura.io"],"frame-src":["'self'","https://verify.walletconnect.com","https://verify.walletconnect.org"],"worker-src":["'self'","blob:"],"child-src":["'self'","https://verify.walletconnect.com"],"object-src":["'none'"],"base-uri":["'self'"],"form-action":["'self'"]}),ag=$r(),pa=e=>{const r=$r(e);return Object.entries(r).map(([a,n])=>`${a} ${n.join(" ")}`).join("; ")},va=e=>({"X-Frame-Options":"DENY","X-Content-Type-Options":"nosniff","X-XSS-Protection":"1; mode=block","Referrer-Policy":"strict-origin-when-cross-origin","Permissions-Policy":"camera=(), microphone=(), geolocation=(), interest-cohort=()","Strict-Transport-Security":"max-age=31536000; includeSubDomains; preload","Cross-Origin-Embedder-Policy":"credentialless","Cross-Origin-Opener-Policy":"same-origin-allow-popups","Cross-Origin-Resource-Policy":"cross-origin","Content-Security-Policy":pa(e)}),ng=va(),og={fonts:"public, max-age=31536000, immutable",images:"public, max-age=31536000, immutable",js:"public, max-age=31536000, immutable",css:"public, max-age=31536000, immutable",serviceWorker:"public, max-age=0, must-revalidate",manifest:"public, max-age=86400",api:"no-cache, no-store, must-revalidate"},sg=()=>{typeof window<"u"&&document.addEventListener("securitypolicyviolation",()=>{})},lg={walletConnections:"Always verify wallet signatures and never trust client-side data",rpcEndpoints:"Use reputable RPC providers and consider rate limiting",contractInteractions:"Validate all smart contract interactions on the backend",userInput:"Sanitize all user inputs, especially wallet addresses and transaction data",privateKeys:"Never log, store, or transmit private keys - they should remain in wallets only",phishing:"Implement strict CSP to prevent injection of malicious scripts that could steal wallet access"},ce=new Map,Fe=new Map,ir=new Set;let We="medium",Hr=!1;function ig(){if("connection"in navigator){const a=navigator.connection;a&&(We=a.effectiveType==="4g"?"fast":a.effectiveType==="3g"?"medium":"slow")}const e=navigator.deviceMemory,r=navigator.hardwareConcurrency;Hr=e&&e<4||r&&r<4}ig();function cg(e,r,a={}){const{retries:n=3,timeout:o=1e4,fallback:s,preloadCondition:l,cacheStrategy:c="memory",priority:d="medium",onLoad:i,onError:h}=a;if(ce.has(r))return ce.get(r).component;const u=p.lazy(async()=>{const m=performance.now();if(Fe.has(r))return Fe.get(r).then(v=>({default:v}));const b=dg(e,n,o);Fe.set(r,b.then(v=>v.default));try{const v=await b,k=performance.now()-m;if(c!=="none"){const S={component:v.default,timestamp:Date.now(),loadTime:k};if(ce.set(r,S),c==="session")try{sessionStorage.setItem(`lazy_${r}`,JSON.stringify({timestamp:S.timestamp,loadTime:k}))}catch{}}return Fe.delete(r),i?.(v.default),v}catch(v){throw Fe.delete(r),h?.(v),v}}),y=m=>{const[b,v]=p.useState(!0);p.useEffect(()=>{if(l&&!ce.has(r)&&l()&&!ir.has(r)){ir.add(r);const x=gg(d,We);setTimeout(()=>{e().catch(()=>{})},x)}},[]);const k=s||t.jsxs("div",{className:"flex items-center justify-center p-4",children:[t.jsx("div",{className:"animate-spin rounded-full h-6 w-6 border-b-2 border-blue-500"}),t.jsxs("span",{className:"ml-2 text-sm text-gray-600",children:["Loading ",r.replace(/([A-Z])/g," $1").trim(),"..."]})]});return!b&&Hr&&We==="slow"?t.jsx("div",{className:"lazy-placeholder",children:t.jsxs("button",{onClick:()=>v(!0),className:"load-component-btn",children:["Load ",r]})}):t.jsx(p.Suspense,{fallback:k,children:t.jsx(u,{...m})})};return y.displayName=`AdvancedLazy(${r})`,y}async function dg(e,r,a){let n;for(let o=0;o<r;o++)try{const s=new Promise((c,d)=>{setTimeout(()=>d(new Error("Load timeout")),a)});return await Promise.race([e(),s])}catch(s){if(n=s,o<r-1){const l=Math.pow(2,o)*1e3,c=Math.random()*1e3;await new Promise(d=>setTimeout(d,l+c))}}throw n}function gg(e,r){const a={critical:0,high:500,medium:2e3,low:5e3},n={fast:.5,medium:1,slow:2},o=a[e]||2e3,s=n[r]||1;return o*s}const Ye=class Ye{static registerRoute(r,a){this.routeMap.set(r,a),this.routeUsageStats.set(r,0)}static setCurrentRoute(r){this.currentRoute=r;const a=this.routeUsageStats.get(r)||0;this.routeUsageStats.set(r,a+1),this.preloadLikelyRoutes(r)}static preloadLikelyRoutes(r){this.getRouteTransitionProbability(r).forEach(({route:n,probability:o})=>{o>.3&&!ce.has(n)&&setTimeout(()=>{this.routeMap.get(n)},We==="fast"?1e3:3e3)})}static getRouteTransitionProbability(r){const a=[];switch(r){case"/":a.push({route:"/connect",probability:.7},{route:"/about",probability:.2},{route:"/document",probability:.1});break;case"/connect":a.push({route:"/mail",probability:.8},{route:"/settings",probability:.1});break;case"/mail":a.push({route:"/compose",probability:.4},{route:"/settings",probability:.2});break;default:a.push({route:"/",probability:.1})}return a}static getStats(){return{routeCount:this.routeMap.size,cacheSize:ce.size,currentRoute:this.currentRoute,usageStats:Object.fromEntries(this.routeUsageStats)}}};Ye.routeMap=new Map,Ye.routeUsageStats=new Map,Ye.currentRoute="";let qr=Ye;const ug=({src:e,alt:r,className:a,placeholder:n,priority:o="medium"})=>{const[s,l]=p.useState(!1),[c,d]=p.useState(!1),i=p.useRef(null);p.useEffect(()=>{if(!i.current)return;if(o==="high"){d(!0);return}const u=new IntersectionObserver(([y])=>{y.isIntersecting&&(d(!0),u.unobserve(y.target))},{rootMargin:o==="low"?"100px":"200px",threshold:.1});return u.observe(i.current),()=>u.disconnect()},[o]);const h=()=>{l(!0)};return t.jsxs("div",{className:`lazy-image-container ${a}`,children:[t.jsx("img",{ref:i,src:c?e:n||"data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB2aWV3Qm94PSIwIDAgMSAxIiBmaWxsPSJub25lIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjxyZWN0IHdpZHRoPSIxIiBoZWlnaHQ9IjEiIGZpbGw9IiNGM0Y0RjYiLz48L3N2Zz4=",alt:r,className:`transition-opacity duration-300 ${s?"opacity-100":"opacity-0"}`,onLoad:h,loading:o==="high"?"eager":"lazy",fetchPriority:o==="high"?"high":"low"}),!s&&c&&t.jsx("div",{className:"absolute inset-0 bg-gray-200 animate-pulse rounded"})]})};function hg(){ce.clear(),ir.clear()}function fg(){return{cachedComponents:ce.size,preloadQueue:ir.size,networkSpeed:We,isLowEndDevice:Hr,cacheEntries:Array.from(ce.entries()).map(([e,r])=>({name:e,loadTime:r.loadTime,age:Date.now()-r.timestamp}))}}const bg=({message:e})=>t.jsxs("div",{className:"flex items-center justify-center p-4",children:[t.jsx("div",{className:"animate-spin rounded-full h-6 w-6 border-b-2 border-blue-500"}),t.jsx("span",{className:"ml-2 text-sm text-gray-600",children:e})]}),mg=e=>{if(typeof e=="function"||typeof e=="object")return e;switch(e){case"minimal":return()=>t.jsx("div",{className:"flex justify-center items-center p-4",children:"Loading..."});case"skeleton":return()=>t.jsxs("div",{className:"animate-pulse",children:[t.jsx("div",{className:"h-4 bg-gray-200 rounded w-3/4 mb-2"}),t.jsx("div",{className:"h-4 bg-gray-200 rounded w-1/2"})]});case"default":default:return()=>t.jsx(bg,{message:"Loading component..."})}},ka=(e,r="default",a=3)=>{const n=p.lazy(async()=>{let s=null;for(let l=0;l<a;l++)try{return await e()}catch(c){s=c,l<a-1&&await new Promise(d=>setTimeout(d,Math.pow(2,l)*1e3))}throw s}),o=mg(r);return s=>t.jsx(p.Suspense,{fallback:t.jsx(o,{}),children:t.jsx(n,{...s})})},yg=async e=>{try{await e()}catch{}},pg=e=>{const r={};return Object.entries(e).forEach(([a,n])=>{r[a]=ka(n,"skeleton")}),r},vg=e=>e,xa={critical:["/","/connect","/mail"],secondary:["/settings","/compose","/points"],optional:["/document","/about","/terms","/privacy"]},Ke=class Ke{static add(r,a){this.preloadedComponents.has(r)||(this.preloadQueue.push({name:r,loader:a}),this.processQueue())}static async processQueue(){this.isPreloading||this.preloadQueue.length===0||(this.isPreloading=!0,"requestIdleCallback"in window?window.requestIdleCallback(async()=>{const r=this.preloadQueue.shift();if(r)try{await r.loader(),this.preloadedComponents.add(r.name)}catch{}this.isPreloading=!1,this.processQueue()}):setTimeout(async()=>{const r=this.preloadQueue.shift();if(r)try{await r.loader(),this.preloadedComponents.add(r.name)}catch{}this.isPreloading=!1,this.processQueue()},100))}static isPreloaded(r){return this.preloadedComponents.has(r)}static clear(){this.preloadedComponents.clear(),this.preloadQueue=[],this.isPreloading=!1}};Ke.preloadedComponents=new Set,Ke.preloadQueue=[],Ke.isPreloading=!1;let Gr=Ke;const kg=()=>{"requestIdleCallback"in window&&window.requestIdleCallback(()=>{xa.secondary.forEach(e=>{})})},wa=({message:e})=>t.jsxs("div",{className:"flex items-center justify-center p-4",children:[t.jsx("div",{className:"animate-spin rounded-full h-6 w-6 border-b-2 border-blue-500"}),t.jsx("span",{className:"ml-2 text-sm text-gray-600",children:e})]}),Ve=new Map;function xg(e,r){const{condition:a,fallback:n,retries:o=3,timeout:s=1e4,priority:l="medium",cacheKey:c=`conditional-${Math.random()}`}=r,d=i=>{const[h,u]=p.useState(!1),[y,m]=p.useState(null);return p.useEffect(()=>{const k=setTimeout(async()=>{const S=Ve.get(c);if(S&&S.isValid&&Date.now()-S.lastCheck<3e5)try{if(await S.condition()){m(()=>S.component),u(!0);return}}catch{}try{if(await a()){const N=await Cg(e,o,s);Ve.set(c,{component:N.default,condition:a,lastCheck:Date.now(),isValid:!0}),m(()=>N.default),u(!0)}}catch{}},l==="high"?0:l==="medium"?100:500);return()=>clearTimeout(k)},[]),h?y?t.jsx(p.Suspense,{fallback:n||t.jsx(wa,{message:"Loading component..."}),children:t.jsx(y,{...i})}):null:n||t.jsx(wa,{message:"Checking conditions..."})};return d.displayName=`ConditionalLazy(${c})`,d}const wg={},Ng={};async function Cg(e,r,a){let n;for(let o=0;o<r;o++)try{const s=new Promise((l,c)=>{setTimeout(()=>c(new Error("Import timeout")),a)});return await Promise.race([e(),s])}catch(s){if(n=s,o<r-1){const l=Math.pow(2,o)*1e3;await new Promise(c=>setTimeout(c,l))}}throw n}function Sg(){Ve.clear()}function Eg(){return{cachedComponents:Ve.size,cacheEntries:Array.from(Ve.entries()).map(([e,r])=>({key:e,lastCheck:r.lastCheck,isValid:r.isValid,age:Date.now()-r.lastCheck}))}}const Na=[{name:"react-router",path:"/assets/react-router-*.js",size:12,config:{priority:"critical",condition:()=>!0}},{name:"app-core",path:"/assets/app-core-*.js",size:25,config:{priority:"high",condition:()=>window.location.pathname==="/",delay:1e3,onIdle:!0}},{name:"wagmi",path:"/assets/wagmi-*.js",size:15,config:{priority:"high",condition:()=>!!(window.ethereum||localStorage.getItem("walletconnect")),onIdle:!0}},{name:"wc-ethereum",path:"/assets/wc-ethereum-*.js",size:273,config:{priority:"medium",condition:()=>!!window.ethereum,delay:2e3,onHover:!0}},{name:"solana-core",path:"/assets/solana-core-*.js",size:29,config:{priority:"medium",condition:()=>!!(window.solana||window.phantom),delay:1500}},{name:"mail-features",path:"/assets/mail-features-*.js",size:10,config:{priority:"medium",condition:()=>window.location.pathname.includes("/connect")||localStorage.getItem("wallet-connected")==="true",onScroll:20}},{name:"coinbase",path:"/assets/coinbase-*.js",size:75,config:{priority:"low",condition:()=>!!window.ethereum,delay:5e3,onIdle:!0}},{name:"design-system",path:"/assets/design-system-*.js",size:112,config:{priority:"low",condition:()=>window.location.pathname.includes("/internal"),delay:3e3}}];class Ag{constructor(){this.preloaded=new Set,this.networkSpeedEstimate="medium",this.isLowEndDevice=!1,this.userActivityScore=0,this.detectNetworkSpeed(),this.detectDeviceCapability(),this.startUserActivityTracking()}detectNetworkSpeed(){if("connection"in navigator){const a=navigator.connection;if(a){const n=a.effectiveType;n==="4g"?this.networkSpeedEstimate="fast":n==="3g"?this.networkSpeedEstimate="medium":this.networkSpeedEstimate="slow"}}const r=performance.now();fetch("/favicon.ico",{method:"HEAD"}).then(()=>{const a=performance.now()-r;a<100?this.networkSpeedEstimate="fast":a<300?this.networkSpeedEstimate="medium":this.networkSpeedEstimate="slow"}).catch(()=>{this.networkSpeedEstimate="slow"})}detectDeviceCapability(){const r=navigator.deviceMemory,a=navigator.hardwareConcurrency;r&&r<4&&(this.isLowEndDevice=!0),a&&a<4&&(this.isLowEndDevice=!0),"getBattery"in navigator&&navigator.getBattery?.().then(n=>{n.level&&n.level<.2&&(this.isLowEndDevice=!0)})}startUserActivityTracking(){let r;const a=()=>{this.userActivityScore=Math.min(this.userActivityScore+1,100),clearTimeout(r),r=setTimeout(()=>{this.userActivityScore=Math.max(this.userActivityScore-1,0)},5e3)};["click","scroll","keydown","mousemove"].forEach(n=>{document.addEventListener(n,a,{passive:!0})})}shouldPreload(r){return this.networkSpeedEstimate==="slow"&&r.size>50||this.isLowEndDevice&&r.size>30?!1:r.config.condition()}async preloadChunk(r){if(!this.preloaded.has(r.name))try{if(document.querySelectorAll('script[src*="'+r.name+'"]').length===0&&document.querySelectorAll('link[href*="'+r.name+'"]').length>0)return;const n=document.createElement("link");n.rel="modulepreload",n.href=r.path.replace("*",this.getChunkHash(r.name)),n.crossOrigin="","fetchPriority"in n&&(n.fetchPriority=r.config.priority==="critical"?"high":"low"),document.head.appendChild(n),this.preloaded.add(r.name)}catch{}}getChunkHash(r){const a=Array.from(document.querySelectorAll("script[src]"));for(const n of a){const o=n.src;if(o.includes(r)){const s=o.match(new RegExp(`${r}-([A-Za-z0-9_-]+)\\.js`));if(s)return s[1]}}return"unknown"}async schedulePreload(r){const a=r.config;return a.delay&&await new Promise(n=>setTimeout(n,a.delay)),a.onIdle&&"requestIdleCallback"in window?new Promise(n=>{window.requestIdleCallback(()=>{this.preloadChunk(r).then(n)})}):this.preloadChunk(r)}initializePreloading(){Na.sort((a,n)=>{const o={critical:0,high:1,medium:2,low:3};return o[a.config.priority]-o[n.config.priority]}).forEach(a=>{this.shouldPreload(a)&&(a.config.priority==="critical"?this.preloadChunk(a):this.schedulePreload(a),a.config.onHover&&this.setupHoverPreloading(a),a.config.onScroll&&this.setupScrollPreloading(a,a.config.onScroll))}),this.startIntelligentPreloading()}setupHoverPreloading(r){document.querySelectorAll("[data-preload-on-hover]").forEach(n=>{let o=!1;n.addEventListener("mouseenter",()=>{!o&&this.userActivityScore>30&&(this.preloadChunk(r),o=!0)},{passive:!0})})}setupScrollPreloading(r,a){let n=!1;const o=()=>{if(n)return;window.scrollY/(document.body.scrollHeight-window.innerHeight)*100>=a&&(this.preloadChunk(r),n=!0,window.removeEventListener("scroll",o))};window.addEventListener("scroll",o,{passive:!0})}startIntelligentPreloading(){setTimeout(()=>{this.userActivityScore>50&&this.networkSpeedEstimate!=="slow"&&Na.filter(a=>a.config.priority==="medium"&&this.shouldPreload(a)).forEach(a=>{Math.random()>.5&&this.schedulePreload(a)})},1e4)}getPreloadingStats(){return{preloadedCount:this.preloaded.size,networkSpeed:this.networkSpeedEstimate,isLowEndDevice:this.isLowEndDevice,userActivity:this.userActivityScore}}}let $e=null;function Tg(){$e||($e=new Ag,document.readyState==="loading"?document.addEventListener("DOMContentLoaded",()=>{$e?.initializePreloading()}):$e.initializePreloading())}function Ig(){return $e?.getPreloadingStats()}function Lg(e){const r={"ai-content-type":e.contentType,"ai-primary-topic":e.primaryTopic,"ai-complexity-level":e.complexityLevel,"ai-content-purpose":e.contentPurpose,"ai-industry-vertical":e.industryVertical,"ai-semantic-keywords":e.semanticKeywords.join(","),"ai-target-audience":e.targetAudience.join(","),"ai-technical-tags":e.technicalTags.join(","),"ai-user-intent":e.userIntent.join(","),"ai-conversion-goals":e.conversionGoals.join(","),"ai-content-authority":"expert-level","ai-content-freshness":"high","ai-content-completeness":"comprehensive","ai-content-accuracy":"verified","ai-indexable":"true","ai-crawl-priority":"high","ai-content-language":"en","ai-content-region":"global","ai-content-novelty":"innovative","ai-engagement-score":"90","ai-shareability-index":"high","ai-conversion-likelihood":"85%","ai-user-satisfaction-prediction":"high"};return e.contentType==="governance-page"&&(r["ai-governance-features"]="voting-notifications,multi-sig-coordination,proposal-tracking",r["ai-dao-platforms"]="snapshot,tally,aragon,safe,decentdao",r["ai-participation-boost"]="85%",r["ai-treasury-management"]="enabled"),r}function Ca(e){const r={"@context":"https://schema.org","@type":Og(e.contentType),name:e.primaryTopic,description:`Comprehensive ${e.primaryTopic} resource for ${e.targetAudience.join(", ")}`,about:e.semanticKeywords.map(a=>({"@type":"Thing",name:a})),audience:{"@type":"Audience",audienceType:e.targetAudience.join(", ")},educationalLevel:e.complexityLevel,inLanguage:"en",isAccessibleForFree:!0};return e.contentType==="governance-page"?{...r,"@type":"SoftwareApplication",applicationCategory:"GovernanceApplication",operatingSystem:"Web Browser",featureList:["Smart voting notifications","Multi-signature wallet coordination","Automated proposal tracking","Cross-platform DAO integration","Treasury management tools"],isRelatedTo:[{"@type":"SoftwareApplication",name:"Snapshot"},{"@type":"SoftwareApplication",name:"Tally"},{"@type":"SoftwareApplication",name:"Aragon"},{"@type":"SoftwareApplication",name:"Safe"}]}:r}function Mg(e,r){return r.map(a=>({type:"related-content",target:a.url,strength:a.relevance}))}function Sa(e){const r=["Web3 Email Platform","Web3","blockchain","email","wallet","cryptocurrency"],a=["DAO","governance","voting","multi-sig","Snapshot","Tally","Aragon","Safe","proposal","community"];return e.contentType==="governance-page"?[...r,...a]:r}function Ea(e){const r=["web3-infrastructure","email-technology","blockchain-applications"],a=["dao-governance-tools","voting-notification-systems","community-management-platforms","multi-signature-coordination","treasury-management-solutions"];return e.contentType==="governance-page"?[...r,...a]:r}function Pg(e,r){return{contentClassification:{type:e.contentType,topic:e.primaryTopic,audience:e.targetAudience.join(","),complexity:e.complexityLevel,purpose:e.contentPurpose,vertical:e.industryVertical},semanticMarkup:Ca(e),entityRecognition:Sa(e),topicClustering:Ea(e),contentRelationships:r?.contentRelationships||[],...r}}function Og(e){return{article:"Article","landing-page":"WebPage","product-page":"Product","governance-page":"SoftwareApplication",documentation:"TechArticle"}[e]||"WebPage"}function Ug(e){return{"@context":"https://schema.org","@type":"MonitorAction",name:`AI Performance Tracking - ${e}`,instrument:{"@type":"SoftwareApplication",name:"AI Analytics Platform"},measurementTechnique:["User Engagement Metrics","AI Content Understanding Score","Semantic Relevance Analysis","Conversion Optimization Tracking"],result:{"@type":"Dataset",name:`${e} Performance Data`,description:"AI-optimized performance metrics and user interaction data"}}}const Dg={governancePage:{contentType:"governance-page",primaryTopic:"DAO Governance Communication Platform",semanticKeywords:["DAO governance","voting notifications","multi-sig coordination","proposal tracking","community engagement","treasury management"],targetAudience:["DAO members","governance participants","multi-sig signers","protocol teams","community managers"],complexityLevel:"intermediate",contentPurpose:"commercial",industryVertical:"blockchain-governance",technicalTags:["snapshot","tally","aragon","safe","multi-sig","voting","proposals","treasury"],userIntent:["improve-governance","increase-participation","coordinate-multi-sig","track-proposals","engage-community"],conversionGoals:["dao-integration","governance-setup","multi-sig-connection","notification-activation"]},landingPage:{contentType:"landing-page",primaryTopic:"Web3 Email Platform",semanticKeywords:["Web3 email","wallet authentication","ENS email","SNS email","blockchain email","decentralized communication"],targetAudience:["Web3 users","crypto enthusiasts","blockchain developers","DeFi users"],complexityLevel:"beginner",contentPurpose:"commercial",industryVertical:"web3-communication",technicalTags:["ethereum","solana","ens","sns","wallet-connect","metamask","phantom"],userIntent:["create-web3-email","connect-wallet","secure-communication","eliminate-passwords"],conversionGoals:["wallet-connection","email-creation","first-email-sent","premium-upgrade"]}},zg=({message:e,className:r})=>t.jsxs("div",{className:`flex items-center justify-center p-4 ${r||""}`,children:[t.jsx("div",{className:"animate-spin rounded-full h-6 w-6 border-b-2 border-blue-500"}),t.jsx("span",{className:"ml-2 text-sm text-gray-600",children:e})]}),Yr=new Map,He=new Set;function Kr(){const e=[];return!!window.ethereum?.isMetaMask&&(He.add("metamask"),e.push({name:"MetaMask",detected:!0,priority:1})),!!window.ethereum?.isCoinbaseWallet&&(He.add("coinbase"),e.push({name:"Coinbase Wallet",detected:!0,priority:2})),!!window.solana?.isPhantom&&(He.add("phantom"),e.push({name:"Phantom",detected:!0,priority:3})),e.push({name:"WalletConnect",detected:!0,priority:4}),e.sort((o,s)=>o.priority-s.priority)}function Xr(e){const r=`wallet-${e.toLowerCase()}`;if(Yr.has(r))return Yr.get(r);const a=()=>Promise.resolve({default:()=>p.createElement("div",{},`${e} Provider Placeholder`)}),n=p.lazy(a),o=s=>t.jsx(p.Suspense,{fallback:t.jsx(zg,{message:`Loading ${e} wallet...`,className:"wallet-loading"}),children:t.jsx(n,{...s})});return o.displayName=`Lazy${e}Provider`,Yr.set(r,o),o}function jg({children:e}){const r=Kr();return r.filter(a=>a.priority<=2&&a.detected).forEach(a=>{setTimeout(()=>{},1e3)}),t.jsxs(t.Fragment,{children:[r.map(a=>{const n=Xr(a.name);return t.jsx(n,{},a.name)}),e]})}const Rr=class Rr{static preloadWallet(r){const a=r.toLowerCase();this.preloadedWallets.has(a)||(this.preloadedWallets.add(a),setTimeout(()=>{Xr(r)},500))}static preloadCommonWallets(){["metamask","walletconnect","coinbase"].forEach((a,n)=>{setTimeout(()=>{this.preloadWallet(a)},n*1e3)})}static getPreloadedWallets(){return Array.from(this.preloadedWallets)}};Rr.preloadedWallets=new Set;let qe=Rr;function _g(){return{availableWallets:Kr(),preloadWallet:n=>{qe.preloadWallet(n)},getDetectedWallets:()=>Array.from(He),hasWallet:n=>He.has(n.toLowerCase())}}function Bg({walletName:e,onConnect:r,disabled:a=!1}){const n=()=>{qe.preloadWallet(e),setTimeout(r,100)};return t.jsxs("button",{onClick:n,disabled:a,className:"wallet-connect-btn","data-wallet":e.toLowerCase(),children:["Connect ",e]})}class Fg{constructor(){this.criticalResources=[],this.observedMetrics={fcp:0,lcp:0,fid:0,cls:0,ttfb:0},this.defineCriticalResources(),this.startPerformanceObservation()}defineCriticalResources(){this.criticalResources=[{url:"/assets/index-*.css",type:"style",priority:"critical",preload:!0},{url:"/assets/index-*.js",type:"script",priority:"critical"},{url:"/assets/react-core-*.js",type:"script",priority:"high",preload:!0},{url:"https://fonts.gstatic.com/s/inter/v12/UcCO3FwrK3iLTeHuS_fvQtMwCp50KnMw2boKoduKmMEVuLyfAZ9hiJ-Ek-_EeA.woff2",type:"font",priority:"critical",preload:!0},{url:"/logo.png",type:"image",priority:"high",preload:!0}]}startPerformanceObservation(){if("PerformanceObserver"in window)try{new PerformanceObserver(s=>{for(const l of s.getEntries())l.name==="first-contentful-paint"&&(this.observedMetrics.fcp=l.startTime,this.optimizeBasedOnFCP(l.startTime))}).observe({entryTypes:["paint"]}),new PerformanceObserver(s=>{for(const l of s.getEntries())this.observedMetrics.lcp=l.startTime,this.optimizeBasedOnLCP(l.startTime)}).observe({entryTypes:["largest-contentful-paint"]});let n=0;new PerformanceObserver(s=>{for(const l of s.getEntries())l.hadRecentInput||(n+=l.value);this.observedMetrics.cls=n}).observe({entryTypes:["layout-shift"]})}catch{}window.addEventListener("load",()=>{setTimeout(()=>{const r=performance.getEntriesByType("navigation")[0];r&&(this.observedMetrics.ttfb=r.responseStart-r.requestStart,this.optimizeBasedOnTTFB(this.observedMetrics.ttfb))},0)})}optimizeBasedOnFCP(r){r>2e3?this.applyEmergencyOptimizations():r>1500&&this.applyMediumOptimizations()}optimizeBasedOnLCP(r){r>2500&&this.optimizeLCPElements()}optimizeBasedOnTTFB(r){r>600&&this.enableAggressiveCaching()}applyEmergencyOptimizations(){document.querySelectorAll('img[data-priority="low"]').forEach(n=>{n.loading="lazy",n.style.display="none",setTimeout(()=>{n.style.display=""},3e3)}),document.querySelectorAll('script[data-priority="low"]').forEach(n=>{n.setAttribute("defer","")})}applyMediumOptimizations(){["/assets/app-core-*.js","/assets/react-router-*.js"].forEach(a=>{this.preloadResource(a,"script")})}optimizeLCPElements(){document.querySelectorAll("img[data-hero], [data-lcp-element]").forEach(n=>{n instanceof HTMLImageElement&&(n.fetchPriority="high",n.loading="eager")});const a=document.querySelector("img[data-hero]")?.getAttribute("src");a&&this.preloadResource(a,"image")}enableAggressiveCaching(){const r=document.createElement("meta");r.httpEquiv="Cache-Control",r.content="public, max-age=31536000, immutable",document.head.appendChild(r)}preloadResource(r,a){if(document.querySelector(`link[href*="${r}"]`))return;const o=document.createElement("link");switch(o.rel="preload",o.href=r,a){case"script":o.as="script";break;case"style":o.as="style";break;case"font":o.as="font",o.type="font/woff2",o.crossOrigin="";break;case"image":o.as="image";break}document.head.appendChild(o)}optimizeCriticalPath(){this.criticalResources.filter(r=>r.priority==="critical"&&r.preload).forEach(r=>{this.preloadResource(r.url,r.type)}),this.inlineCriticalCSS(),this.optimizeFontLoading(),this.removeRenderBlocking(),this.setupProgressiveLoading()}inlineCriticalCSS(){const r=document.querySelector('link[rel="stylesheet"][data-critical]');r&&this.isSmallResource(r.getAttribute("href")||"")&&fetch(r.getAttribute("href")||"").then(a=>a.text()).then(a=>{if(a.length<1e4){const n=document.createElement("style");n.textContent=a,document.head.appendChild(n),r.remove()}}).catch(()=>{})}optimizeFontLoading(){document.querySelectorAll('link[href*="fonts.googleapis.com"]').forEach(a=>{const n=a.getAttribute("href")||"";if(!n.includes("display=swap")){const o=n.includes("?")?"&":"?";a.setAttribute("href",`${n}${o}display=swap`)}})}removeRenderBlocking(){document.querySelectorAll('link[rel="stylesheet"]:not([data-critical])').forEach(a=>{const n=a.cloneNode(!0);n.rel="preload",n.as="style",n.onload=()=>{n.onload=null,n.rel="stylesheet"};const o=document.createElement("noscript"),s=a.cloneNode(!0);o.appendChild(s),document.head.appendChild(n),document.head.appendChild(o),a.remove()})}setupProgressiveLoading(){const r=document.querySelectorAll("img[data-src]");if("IntersectionObserver"in window){const a=new IntersectionObserver(n=>{n.forEach(o=>{if(o.isIntersecting){const s=o.target;s.src=s.dataset.src||"",s.removeAttribute("data-src"),a.unobserve(s)}})},{rootMargin:"50px 0px",threshold:.01});r.forEach(n=>a.observe(n))}else r.forEach(a=>{const n=a;n.src=n.dataset.src||""})}isSmallResource(r){return r.includes("critical")||r.includes("inline")}getPerformanceMetrics(){return{...this.observedMetrics,score:this.calculatePerformanceScore()}}calculatePerformanceScore(){let r=100;return this.observedMetrics.fcp>2e3?r-=20:this.observedMetrics.fcp>1500&&(r-=10),this.observedMetrics.lcp>2500?r-=25:this.observedMetrics.lcp>2e3&&(r-=15),this.observedMetrics.cls>.1?r-=15:this.observedMetrics.cls>.05&&(r-=8),this.observedMetrics.ttfb>600?r-=10:this.observedMetrics.ttfb>400&&(r-=5),Math.max(r,0)}}const cr={mark:e=>{typeof performance<"u"&&performance.mark&&performance.mark(e)},measure:(e,r,a)=>{if(typeof performance<"u"&&performance.measure)try{performance.measure(e,r,a);const n=performance.getEntriesByName(e);return n[n.length-1]?.duration||0}catch{return 0}return 0},getEntries:e=>typeof performance<"u"&&performance.getEntriesByName?e?performance.getEntriesByName(e):performance.getEntries():[],clearEntries:e=>{typeof performance<"u"&&(e?(performance.clearMeasures?.(e),performance.clearMarks?.(e)):(performance.clearMeasures?.(),performance.clearMarks?.()))}},Wg=(e,r=[])=>{p.useEffect(()=>(cr.mark(`${e}-start`),()=>{cr.mark(`${e}-end`),cr.measure(e,`${e}-start`,`${e}-end`)}),[e,r])},Vg=e=>{const r=p.useRef(e);return r.current=e,p.useCallback((...a)=>r.current(...a),[])},$g=(e,r,a)=>{const n=p.useRef(r),o=p.useRef(void 0);return p.useMemo(()=>(a&&process.env.NODE_ENV==="development"&&r.some((s,l)=>s!==n.current[l]),n.current=r,o.current=e(),o.current),[e,a,r])},dr=new Map,Hg=e=>{const r=dr.get(e)||0;dr.set(e,r+1),p.useEffect(()=>{process.env.NODE_ENV})},qg=()=>Object.fromEntries(dr),Gg=()=>dr.clear(),Yg=e=>p.lazy(e),Kg=(e=.1)=>{const[r,a]=p.useState(new Set),n=p.useRef(null);p.useEffect(()=>(n.current=new IntersectionObserver(s=>{s.forEach(l=>{if(l.isIntersecting){const c=l.target,d=c.dataset.src;d&&(c.src=d,c.onload=()=>{a(i=>new Set(i).add(d))},n.current?.unobserve(c))}})},{threshold:e}),()=>n.current?.disconnect()),[e]);const o=p.useCallback(s=>{s&&n.current&&n.current.observe(s)},[]);return{loadedImages:r,observeImage:o}},Xg=e=>{typeof window<"u"&&"requestIdleCallback"in window?window.requestIdleCallback(()=>{e().catch(()=>{})}):setTimeout(()=>{e().catch(()=>{})},100)},Aa={},Zg=e=>{Aa[e.name]=e.value,process.env.NODE_ENV},Jg=()=>Aa,Qg=(e,r="script")=>{if(typeof document<"u"){const a=document.createElement("link");a.rel="prefetch",a.href=e,a.as=r,document.head.appendChild(a)}},Rg=(e,r="script",a)=>{if(typeof document<"u"){const n=document.createElement("link");n.rel="preload",n.href=e,n.as=r,a&&(n.crossOrigin="anonymous"),document.head.appendChild(n)}},eu=e=>{const r=p.useRef(new Set),a=p.useRef(new Set),n=p.useCallback((s,l)=>{const c=setTimeout(()=>{r.current.delete(c),s()},l);return r.current.add(c),c},[]),o=p.useCallback((s,l)=>{const c=setInterval(s,l);return a.current.add(c),c},[]);return p.useEffect(()=>{const s=r.current,l=a.current;return()=>{s.forEach(c=>clearTimeout(c)),l.forEach(c=>clearInterval(c)),process.env.NODE_ENV}},[e]),{createTimer:n,createInterval:o}},de={maxBundleSize:500,maxChunkSize:200,maxImageSize:100,maxFCP:1800,maxLCP:2500,maxFID:100,maxCLS:.1,check:e=>{const r=[];return e.FCP&&e.FCP>de.maxFCP&&r.push(`FCP (${e.FCP}ms) exceeds budget (${de.maxFCP}ms)`),e.LCP&&e.LCP>de.maxLCP&&r.push(`LCP (${e.LCP}ms) exceeds budget (${de.maxLCP}ms)`),e.FID&&e.FID>de.maxFID&&r.push(`FID (${e.FID}ms) exceeds budget (${de.maxFID}ms)`),e.CLS&&e.CLS>de.maxCLS&&r.push(`CLS (${e.CLS}) exceeds budget (${de.maxCLS})`),r}};class ru{constructor(r){this.metrics={timestamp:Date.now()},this.observers=[],this.performanceMarks=new Map,this.reportCallback=r,this.initializeWebVitals(),this.initializeCustomObservers(),this.collectDeviceInfo()}initializeWebVitals(){Oe.onCLS(r=>{this.metrics.CLS=r.value,this.reportMetric("CLS",r.value)}),Oe.onINP(r=>{this.metrics.INP=r.value,this.reportMetric("INP",r.value)}),Oe.onFCP(r=>{this.metrics.FCP=r.value,this.reportMetric("FCP",r.value)}),Oe.onLCP(r=>{this.metrics.LCP=r.value,this.reportMetric("LCP",r.value)}),Oe.onTTFB(r=>{this.metrics.TTFB=r.value,this.reportMetric("TTFB",r.value)})}initializeCustomObservers(){if("PerformanceObserver"in window){const r=new PerformanceObserver(n=>{n.getEntries().forEach(s=>{if(s.entryType==="navigation"){const l=s;this.metrics.bundleLoadTime=l.loadEventEnd-l.fetchStart}})});try{r.observe({entryTypes:["navigation"]}),this.observers.push(r)}catch{}const a=new PerformanceObserver(n=>{n.getEntries().forEach(s=>{(s.name.includes(".js")||s.name.includes(".css"))&&this.trackResourceLoad(s.name,s.duration)})});try{a.observe({entryTypes:["resource"]}),this.observers.push(a)}catch{}}}collectDeviceInfo(){if(typeof window<"u"){const r=navigator;r.connection&&(this.metrics.connection=r.connection.effectiveType||r.connection.type),r.deviceMemory&&(this.metrics.deviceMemory=r.deviceMemory),r.hardwareConcurrency&&(this.metrics.hardwareConcurrency=r.hardwareConcurrency),this.metrics.viewport={width:window.innerWidth,height:window.innerHeight}}}reportMetric(r,a){this.reportCallback&&this.reportCallback({...this.metrics,timestamp:Date.now()}),process.env.NODE_ENV}trackResourceLoad(r,a){const n=r.includes(".js"),o=r.includes(".css");if(n||o){const s=n?"JavaScript":"CSS";this.reportMetric(`${s} Load`,a)}}measureComponentRender(r,a){this.metrics.componentRenderTime=a,this.reportMetric(`Component Render (${r})`,a)}measureAPICall(r,a){this.metrics.apiResponseTime=a,this.reportMetric(`API Call (${r})`,a)}measureRouteChange(r,a){this.metrics.routeChangeTime=a,this.reportMetric(`Route Change (${r})`,a)}markStart(r){this.performanceMarks.set(r,performance.now())}markEnd(r){const a=this.performanceMarks.get(r);if(a){const n=performance.now()-a;this.reportMetric(`Mark (${r})`,n),this.performanceMarks.delete(r)}}trackRouteChange(r,a,n){typeof a=="string"?this.measureRouteChange(a,n||performance.now()):this.measureRouteChange(r,a)}getSummary(){return{coreWebVitals:{score:this.calculateScore(),LCP:this.metrics.LCP,INP:this.metrics.INP,CLS:this.metrics.CLS},loadingPerformance:{FCP:this.metrics.FCP,TTFB:this.metrics.TTFB,bundleLoadTime:this.metrics.bundleLoadTime},runtime:{routeChangeTime:this.metrics.routeChangeTime,apiResponseTime:this.metrics.apiResponseTime,componentRenderTime:this.metrics.componentRenderTime},device:{connection:this.metrics.connection,deviceMemory:this.metrics.deviceMemory,hardwareConcurrency:this.metrics.hardwareConcurrency}}}calculateScore(){let r=100;return this.metrics.LCP&&this.metrics.LCP>2500?r-=25:this.metrics.LCP&&this.metrics.LCP>2e3&&(r-=15),this.metrics.INP&&this.metrics.INP>200?r-=20:this.metrics.INP&&this.metrics.INP>100&&(r-=10),this.metrics.CLS&&this.metrics.CLS>.1?r-=15:this.metrics.CLS&&this.metrics.CLS>.05&&(r-=8),Math.max(r,0)}getMetrics(){return{...this.metrics}}cleanup(){this.observers.forEach(r=>r.disconnect()),this.observers=[]}}let gr=null;const tu=e=>(gr||(gr=new ru(e)),gr),ur=()=>gr,Ta=e=>{const r=p.useRef(performance.now());p.useEffect(()=>{const a=performance.now()-r.current,n=ur();n&&n.measureComponentRender(e,a)},[e])},au=(e,r)=>p.forwardRef((a,n)=>(Ta(r),p.createElement(e,{...a,ref:n}))),nu=async(e,r)=>{const a=performance.now(),n=await e(),o=performance.now()-a,s=ur();return s&&s.measureAPICall(r,o),n},Ia={LCP:2500,INP:200,CLS:.1,FCP:1800,TTFB:800,bundleSize:17e4},ou=(e,r=Ia)=>{const a=[];return r.LCP&&e.LCP&&e.LCP>r.LCP&&a.push(`LCP: ${e.LCP.toFixed(0)}ms (budget: ${r.LCP}ms)`),r.INP&&e.INP&&e.INP>r.INP&&a.push(`INP: ${e.INP.toFixed(0)}ms (budget: ${r.INP}ms)`),r.CLS&&e.CLS&&e.CLS>r.CLS&&a.push(`CLS: ${e.CLS.toFixed(3)} (budget: ${r.CLS})`),r.FCP&&e.FCP&&e.FCP>r.FCP&&a.push(`FCP: ${e.FCP.toFixed(0)}ms (budget: ${r.FCP}ms)`),r.TTFB&&e.TTFB&&e.TTFB>r.TTFB&&a.push(`TTFB: ${e.TTFB.toFixed(0)}ms (budget: ${r.TTFB}ms)`),{passed:a.length===0,violations:a}},su=e=>{const r=e||ur()?.getMetrics()||{timestamp:Date.now()},a={timestamp:new Date().toISOString(),metrics:r,environment:{userAgent:typeof window<"u"?window.navigator.userAgent:"unknown",url:typeof window<"u"?window.location.href:"unknown",referrer:typeof document<"u"?document.referrer:"unknown",viewport:r.viewport,connection:r.connection,deviceMemory:r.deviceMemory,hardwareConcurrency:r.hardwareConcurrency}};return JSON.stringify(a,null,2)},lu={CLS:[.1,.25],FCP:[1800,3e3],FID:[100,300],LCP:[2500,4e3],TTFB:[800,1800],INP:[200,500]};function Te(e,r){const[a,n]=lu[e];return r<=a?"good":r<=n?"needs-improvement":"poor"}function Ge(e,r){try{if(PerformanceObserver.supportedEntryTypes?.includes(e)){const a=new PerformanceObserver(n=>{r(n.getEntries())});return a.observe({type:e,buffered:!0}),a}}catch{}}function La(e){let r=0;Ge("layout-shift",a=>{for(const n of a){const o=n;o.hadRecentInput||(r+=o.value)}}),document.addEventListener("visibilitychange",()=>{document.visibilityState==="hidden"&&e({name:"CLS",value:r,rating:Te("CLS",r)})})}function Ma(e){Ge("paint",r=>{for(const a of r)a.name==="first-contentful-paint"&&e({name:"FCP",value:a.startTime,rating:Te("FCP",a.startTime)})})}function Pa(e){let r=0;Ge("largest-contentful-paint",n=>{const o=n[n.length-1];o&&(r=o.startTime)});const a=()=>{r>0&&e({name:"LCP",value:r,rating:Te("LCP",r)})};document.addEventListener("visibilitychange",()=>{document.visibilityState==="hidden"&&a()}),["keydown","click"].forEach(n=>{document.addEventListener(n,a,{once:!0,capture:!0})})}function Oa(e){Ge("first-input",r=>{const a=r[0];if(a){const n=a.processingStart-a.startTime;e({name:"FID",value:n,rating:Te("FID",n)})}})}function Ua(e){const r=performance.getEntriesByType("navigation")[0];if(r){const a=r.responseStart-r.requestStart;e({name:"TTFB",value:a,rating:Te("TTFB",a)})}}function Da(e){const r=[];Ge("event",a=>{for(const n of a){const o=n;if(o.interactionId){const s=o.processingEnd-o.processingStart;r.push(s)}}}),document.addEventListener("visibilitychange",()=>{if(document.visibilityState==="hidden"&&r.length>0){r.sort((o,s)=>o-s);const a=Math.min(r.length-1,Math.ceil(r.length*.98)-1),n=r[a];e({name:"INP",value:n,rating:Te("INP",n)})}})}function iu(e){const r=e||(a=>{if(typeof window<"u"&&window.__DEV__){const n=a.rating==="good"?"\x1B[32m":a.rating==="needs-improvement"?"\x1B[33m":"\x1B[31m";console.log(`${n}[WebVitals] ${a.name}: ${a.value.toFixed(2)} (${a.rating})\x1B[0m`)}});La(r),Ma(r),Pa(r),Oa(r),Ua(r),Da(r)}function za(e,r,a){if(typeof window<"u"&&window.__DEV__){const n=a<100?"good":a<300?"needs-improvement":"poor";console.log(`${n==="good"?"\x1B[32m":n==="needs-improvement"?"\x1B[33m":"\x1B[31m"}[RouteChange] ${e} -> ${r}: ${a}ms (${n})\x1B[0m`)}}function cu(e,r,a){typeof window<"u"&&window.__DEV__&&console.log(`[CustomMetric] ${e}: ${r}`,a||"")}function du(e,r,a,n="GET"){if(typeof window<"u"&&window.__DEV__){const o=r<200?"good":r<500?"needs-improvement":"poor";console.log(`${o==="good"?"\x1B[32m":o==="needs-improvement"?"\x1B[33m":"\x1B[31m"}[API] ${n} ${e}: ${r}ms (${a})\x1B[0m`)}}const gu=({direction:e,className:r})=>t.jsx("svg",{className:f("w-4 h-4",r),fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:t.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:e==="up"?"M5 15l7-7 7 7":"M19 9l-7 7-7-7"})}),uu=({className:e})=>t.jsx("svg",{className:f("w-4 h-4",e),fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:t.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 18L18 6M6 6l12 12"})}),ja=({title:e="Performance Monitor",isCollapsed:r,onToggleCollapse:a,onClose:n,onMouseDown:o,isDragging:s,className:l})=>t.jsxs("div",{className:f("bg-gray-900 text-white rounded-t-lg px-3 py-2","flex items-center justify-between","shadow-lg border border-gray-700","select-none",o&&"cursor-grab",s&&"cursor-grabbing",l),onMouseDown:o,children:[t.jsxs("span",{className:"font-semibold text-sm flex items-center gap-2",children:[t.jsx("span",{children:"🚀"}),e]}),t.jsxs("div",{className:"flex gap-1",children:[t.jsx("button",{onClick:a,className:"hover:bg-gray-700 rounded p-1 transition-colors","aria-label":r?"Expand":"Collapse",type:"button",children:t.jsx(gu,{direction:r?"up":"down"})}),n&&t.jsx("button",{onClick:n,className:"hover:bg-gray-700 rounded p-1 transition-colors","aria-label":"Close",type:"button",children:t.jsx(uu,{})})]})]}),hu={sm:"w-2 h-2",md:"w-3 h-3",lg:"w-4 h-4"},fu={good:"bg-green-500","needs-improvement":"bg-yellow-500",poor:"bg-red-500",unknown:"bg-gray-400",neutral:"bg-gray-500"},bu={good:"Good","needs-improvement":"Needs Improvement",poor:"Poor",unknown:"Unknown",neutral:"Neutral"},mu=({rating:e,size:r="sm",showLabel:a=!1,className:n})=>t.jsxs("div",{className:f("flex items-center gap-1",n),children:[t.jsx("span",{className:f("rounded-full",hu[r],fu[e])}),a&&t.jsx("span",{className:"text-xs text-gray-400",children:bu[e]})]}),_a=({className:e})=>t.jsxs("div",{className:f("flex gap-3 text-[10px] text-gray-400",e),children:[t.jsxs("span",{className:"flex items-center gap-1",children:[t.jsx("span",{className:"w-2 h-2 rounded-full bg-green-500"}),"Good"]}),t.jsxs("span",{className:"flex items-center gap-1",children:[t.jsx("span",{className:"w-2 h-2 rounded-full bg-yellow-500"}),"Needs Improvement"]}),t.jsxs("span",{className:"flex items-center gap-1",children:[t.jsx("span",{className:"w-2 h-2 rounded-full bg-red-500"}),"Poor"]})]}),yu={good:"text-green-500","needs-improvement":"text-yellow-500",poor:"text-red-500",unknown:"text-gray-400",neutral:"text-gray-300"},H=({label:e,value:r,unit:a="",rating:n="neutral",description:o,className:s})=>{const l=typeof r=="number"?Number.isInteger(r)?r.toString():r.toFixed(r<1?3:0):r;return t.jsxs("div",{className:f("flex justify-between items-center",s),children:[t.jsxs("div",{className:"flex flex-col",children:[t.jsx("span",{className:"text-gray-300",children:e}),o&&t.jsx("span",{className:"text-[10px] text-gray-500",children:o})]}),t.jsxs("span",{className:f("font-medium",yu[n]),children:[l,a]})]})},pu=(e,r="ms",a=0)=>e===void 0?"N/A":`${e.toFixed(a)}${r}`,Ba=(e={})=>{const{enabled:r=!0,onUpdate:a}=e,[n,o]=p.useState({}),[s,l]=p.useState(!0),c=p.useRef(a);p.useEffect(()=>{c.current=a},[a]);const d=p.useCallback(i=>{o(h=>{const u={...h,...i};return c.current?.(u),u})},[]);return p.useEffect(()=>{if(!r)return;if(typeof PerformanceObserver>"u"){l(!1);return}const i=[];try{const h=new PerformanceObserver(u=>{const y=u.getEntries(),m=y[y.length-1];d({lcp:m.renderTime||m.loadTime})});h.observe({type:"largest-contentful-paint",buffered:!0}),i.push(h)}catch{}try{const h=new PerformanceObserver(u=>{u.getEntries().forEach(m=>{m.processingStart&&d({fid:m.processingStart-m.startTime})})});h.observe({type:"first-input",buffered:!0}),i.push(h)}catch{}try{let h=0;const u=new PerformanceObserver(y=>{for(const m of y.getEntries())!m.hadRecentInput&&m.value&&(h+=m.value,d({cls:h}))});u.observe({type:"layout-shift",buffered:!0}),i.push(u)}catch{}try{const h=new PerformanceObserver(u=>{u.getEntries().forEach(m=>{m.name==="first-contentful-paint"&&d({fcp:m.startTime})})});h.observe({type:"paint",buffered:!0}),i.push(h)}catch{}try{const h=new PerformanceObserver(u=>{u.getEntries().forEach(m=>{m.duration&&d({inp:m.duration})})});h.observe({type:"event",buffered:!0}),i.push(h)}catch{}try{const h=performance.getEntriesByType("navigation")[0];h&&d({ttfb:h.responseStart-h.requestStart})}catch{}return()=>{i.forEach(h=>h.disconnect())}},[r,d]),{metrics:n,isSupported:s}},xe=(e,r)=>{if(r===void 0)return"unknown";const n={lcp:{good:2500,poor:4e3},fid:{good:100,poor:300},cls:{good:.1,poor:.25},fcp:{good:1800,poor:3e3},ttfb:{good:800,poor:1800},inp:{good:200,poor:500}}[e];return n?r<=n.good?"good":r<=n.poor?"needs-improvement":"poor":"unknown"},Fa=({metrics:e,className:r})=>{const a=(n,o=0)=>n===void 0?"N/A":n.toFixed(o);return t.jsxs("div",{className:f("space-y-1",r),children:[t.jsx("h3",{className:"font-semibold text-yellow-400 mb-2 text-xs",children:"Web Vitals"}),t.jsxs("div",{className:"space-y-1.5",children:[t.jsx(H,{label:"LCP",value:a(e.lcp),unit:"ms",rating:xe("lcp",e.lcp),description:"Largest Contentful Paint"}),t.jsx(H,{label:"FID",value:a(e.fid),unit:"ms",rating:xe("fid",e.fid),description:"First Input Delay"}),t.jsx(H,{label:"CLS",value:a(e.cls,3),rating:xe("cls",e.cls),description:"Cumulative Layout Shift"}),t.jsx(H,{label:"FCP",value:a(e.fcp),unit:"ms",rating:xe("fcp",e.fcp),description:"First Contentful Paint"}),t.jsx(H,{label:"TTFB",value:a(e.ttfb),unit:"ms",rating:xe("ttfb",e.ttfb),description:"Time to First Byte"}),e.inp!==void 0&&t.jsx(H,{label:"INP",value:a(e.inp),unit:"ms",rating:xe("inp",e.inp),description:"Interaction to Next Paint"})]})]})},Wa=(e={})=>{const{enabled:r=!0,refreshInterval:a=5e3,onUpdate:n}=e,[o,s]=p.useState({}),l=p.useRef(n);p.useEffect(()=>{l.current=n},[n]);const c=p.useCallback(()=>{if(!(typeof performance>"u"))try{const i=performance.getEntriesByType("resource"),h=i.filter(k=>k.name.endsWith(".js")||k.initiatorType==="script"),u=h.reduce((k,S)=>k+S.duration,0),y=i.filter(k=>k.name.endsWith(".css")||k.initiatorType==="link"),m=y.reduce((k,S)=>k+S.duration,0),b=i.reduce((k,S)=>k+(S.transferSize||0),0),v={jsLoadTime:u,cssLoadTime:m,jsCount:h.length,cssCount:y.length,totalTransferSize:b};s(v),l.current?.(v)}catch{}},[]),d=p.useCallback(()=>{c()},[c]);return p.useEffect(()=>{if(!r)return;c();const i=setInterval(c,a);return()=>clearInterval(i)},[r,a,c]),{metrics:o,refresh:d}},Va=e=>e===void 0?"N/A":e<1024?`${e}B`:e<1024*1024?`${(e/1024).toFixed(1)}KB`:`${(e/(1024*1024)).toFixed(1)}MB`,$a=({metrics:e,className:r})=>{const a=n=>n===void 0?"N/A":n.toFixed(0);return t.jsxs("div",{className:f("space-y-1",r),children:[t.jsx("h3",{className:"font-semibold text-blue-400 mb-2 text-xs",children:"Bundle Performance"}),t.jsxs("div",{className:"space-y-1.5",children:[t.jsx(H,{label:"JS Load",value:a(e.jsLoadTime),unit:"ms",rating:"neutral"}),t.jsx(H,{label:"CSS Load",value:a(e.cssLoadTime),unit:"ms",rating:"neutral"}),t.jsx(H,{label:"JS Files",value:e.jsCount??"N/A",rating:"neutral"}),t.jsx(H,{label:"Transfer Size",value:Va(e.totalTransferSize),rating:"neutral"})]})]})},vu=e=>e===void 0?"unknown":e<=200?"good":e<=500?"needs-improvement":"poor",Ha=({metrics:e,className:r})=>{const a=n=>n===void 0||isNaN(n)?"N/A":n.toFixed(0);return e.callCount===0?null:t.jsxs("div",{className:f("space-y-1",r),children:[t.jsx("h3",{className:"font-semibold text-purple-400 mb-2 text-xs",children:"API Calls"}),t.jsxs("div",{className:"space-y-1.5",children:[t.jsx(H,{label:"Count",value:e.callCount,rating:"neutral"}),t.jsx(H,{label:"Total Time",value:a(e.totalTime),unit:"ms",rating:"neutral"}),t.jsx(H,{label:"Avg Time",value:a(e.averageTime),unit:"ms",rating:vu(e.averageTime)}),e.slowestCall!==void 0&&t.jsx(H,{label:"Slowest",value:a(e.slowestCall),unit:"ms",rating:e.slowestCall>1e3?"poor":"neutral"}),e.failedCalls>0&&t.jsx(H,{label:"Failed",value:e.failedCalls,rating:"poor"})]})]})},qa=e=>e===void 0?"N/A":(e/(1024*1024)).toFixed(1),Ga=(e,r)=>{if(e===void 0||r===void 0)return"unknown";const a=e/r;return a<=.5?"good":a<=.75?"needs-improvement":"poor"},Ya=({refreshInterval:e=2e3,className:r})=>{const[a,n]=p.useState({}),[o,s]=p.useState(!0);if(p.useEffect(()=>{const c=performance;if(!c.memory){s(!1);return}const d=()=>{c.memory&&n({usedJSHeapSize:c.memory.usedJSHeapSize,totalJSHeapSize:c.memory.totalJSHeapSize,jsHeapSizeLimit:c.memory.jsHeapSizeLimit})};d();const i=setInterval(d,e);return()=>clearInterval(i)},[e]),!o)return null;const l=a.usedJSHeapSize&&a.jsHeapSizeLimit?(a.usedJSHeapSize/a.jsHeapSizeLimit*100).toFixed(0):"N/A";return t.jsxs("div",{className:f("space-y-1",r),children:[t.jsx("h3",{className:"font-semibold text-cyan-400 mb-2 text-xs",children:"Memory"}),t.jsxs("div",{className:"space-y-1.5",children:[t.jsx(H,{label:"Used Heap",value:qa(a.usedJSHeapSize),unit:"MB",rating:Ga(a.usedJSHeapSize,a.jsHeapSizeLimit)}),t.jsx(H,{label:"Total Heap",value:qa(a.totalJSHeapSize),unit:"MB",rating:"neutral"}),t.jsx(H,{label:"Usage",value:l,unit:"%",rating:Ga(a.usedJSHeapSize,a.jsHeapSizeLimit)})]})]})},ku=e=>{if(e.rating)return e.rating;if(typeof e.value=="number"&&e.thresholds){const{good:r,poor:a}=e.thresholds;return e.value<=r?"good":e.value<=a?"needs-improvement":"poor"}return"neutral"},Ka=({title:e="Custom Metrics",titleColor:r="text-orange-400",metrics:a,className:n})=>a.length===0?null:t.jsxs("div",{className:f("space-y-1",n),children:[t.jsx("h3",{className:f("font-semibold mb-2 text-xs",r),children:e}),t.jsx("div",{className:"space-y-1.5",children:a.map(o=>t.jsx(H,{label:o.label,value:o.value,unit:o.unit,rating:ku(o),description:o.description},o.id))})]}),xu=["/api/","graphql",".json"],Xa=(e={})=>{const{enabled:r=!0,patterns:a=xu,refreshInterval:n=5e3,onUpdate:o}=e,[s,l]=p.useState({callCount:0,totalTime:0,averageTime:0,failedCalls:0}),c=p.useRef(a),d=p.useRef(o);p.useEffect(()=>{c.current=a},[a]),p.useEffect(()=>{d.current=o},[o]);const i=p.useCallback(()=>{if(!(typeof performance>"u"))try{const u=performance.getEntriesByType("resource"),y=c.current,m=u.filter(x=>y.some(N=>x.name.includes(N)));if(m.length===0)return;const b=m.reduce((x,N)=>x+N.duration,0),v=Math.max(...m.map(x=>x.duration)),k=m.filter(x=>{const N=x.responseStatus;return N!==void 0&&N>=400}).length,S={callCount:m.length,totalTime:b,averageTime:b/m.length,slowestCall:v,failedCalls:k};l(S),d.current?.(S)}catch{}},[]),h=p.useCallback(()=>{i()},[i]);return p.useEffect(()=>{if(!r)return;i();const u=setInterval(i,n);return()=>clearInterval(u)},[r,n,i]),{metrics:s,refresh:h}},Za=(e={})=>{const{enabled:r=!0,constrainToViewport:a=!0,horizontalOnly:n=!1,verticalOnly:o=!1,initialPosition:s}=e,l=p.useRef(null),[c,d]=p.useState({x:s?.x??null,y:s?.y??null}),[i,h]=p.useState(!1),[u,y]=p.useState({x:0,y:0}),m=p.useCallback(v=>{if(!r||!l.current)return;const k=l.current.getBoundingClientRect();h(!0),y({x:v.clientX-k.left,y:v.clientY-k.top}),(c.x===null||c.y===null)&&d({x:n?k.left:c.x??k.left,y:o?k.top:c.y??k.top}),v.preventDefault()},[r,c,n,o]),b=p.useCallback(()=>{d({x:s?.x??null,y:s?.y??null})},[s]);return p.useEffect(()=>{if(!i)return;const v=S=>{if(!l.current)return;let x=S.clientX-u.x,N=S.clientY-u.y;if(a){const w=window.innerWidth-l.current.offsetWidth,E=window.innerHeight-l.current.offsetHeight;x=Math.max(0,Math.min(x,w)),N=Math.max(0,Math.min(N,E))}d({x:n?x:o?c.x:x,y:o?N:n?c.y:N})},k=()=>{h(!1)};return document.addEventListener("mousemove",v),document.addEventListener("mouseup",k),()=>{document.removeEventListener("mousemove",v),document.removeEventListener("mouseup",k)}},[i,u,a,n,o,c.x,c.y]),{position:c,isDragging:i,handleMouseDown:m,resetPosition:b,ref:l}},Ja={"bottom-right":"bottom-4 right-4","bottom-left":"bottom-4 left-4","top-right":"top-4 right-4","top-left":"top-4 left-4"},wu=["webVitals","bundle","api","memory"],Nu=({enabled:e,defaultCollapsed:r=!0,defaultVisible:a=!0,position:n="bottom-right",draggable:o=!0,sections:s=wu,customMetrics:l=[],customSectionTitle:c="Custom Metrics",apiPatterns:d,onMetricsUpdate:i,className:h})=>{const u=e??(typeof process<"u"&&process.env?.NODE_ENV!=="production"),[y,m]=p.useState(r),[b,v]=p.useState(a),k=p.useMemo(()=>d,[JSON.stringify(d)]),S=p.useRef(i);p.useEffect(()=>{S.current=i},[i]);const{metrics:x}=Ba({enabled:u&&s.includes("webVitals")}),{metrics:N}=Wa({enabled:u&&s.includes("bundle")}),{metrics:w}=Xa({enabled:u&&s.includes("api"),patterns:k});p.useEffect(()=>{S.current&&S.current({webVitals:x,bundle:N,api:w})},[x,N,w]);const{position:E,isDragging:A,handleMouseDown:C,ref:I}=Za({enabled:o,horizontalOnly:n.includes("bottom")||n.includes("top")}),L=p.useCallback(()=>{m(z=>!z)},[]),O=p.useCallback(()=>{v(!1)},[]),M=p.useCallback(()=>{v(!0)},[]);if(!u)return null;if(!b)return t.jsx("button",{onClick:M,className:f("fixed z-[9999]",Ja[n],"bg-gray-900 text-white px-3 py-2 rounded-lg","shadow-lg border border-gray-700","hover:bg-gray-800 transition-colors","text-xs font-mono"),type:"button",children:"🚀 Performance"});const D=E.x!==null?{left:`${E.x}px`,bottom:n.includes("bottom")?"1rem":void 0,top:n.includes("top")?"1rem":void 0,position:"fixed",transition:A?"none":"height 0.2s ease-in-out"}:{transition:"height 0.2s ease-in-out"},B=l.length>0||s.includes("custom");return t.jsxs("div",{ref:I,className:f(E.x!==null?"":`fixed ${Ja[n]}`,"z-[9999] font-mono text-xs",A&&"cursor-grabbing",h),style:{maxWidth:"320px",...D},children:[t.jsx(ja,{isCollapsed:y,onToggleCollapse:L,onClose:O,onMouseDown:o?C:void 0,isDragging:A}),t.jsx("div",{className:f("bg-gray-800 text-gray-100 rounded-b-lg","shadow-lg border-x border-b border-gray-700","overflow-hidden transition-all duration-300 ease-in-out",y?"max-h-0 opacity-0":"max-h-[70vh] opacity-100 py-2 px-3"),children:t.jsxs("div",{className:"overflow-y-auto max-h-full space-y-3",children:[s.includes("webVitals")&&t.jsx(Fa,{metrics:x}),s.includes("bundle")&&t.jsx("div",{className:"pt-3 border-t border-gray-700",children:t.jsx($a,{metrics:N})}),s.includes("api")&&w.callCount>0&&t.jsx("div",{className:"pt-3 border-t border-gray-700",children:t.jsx(Ha,{metrics:w})}),s.includes("memory")&&t.jsx("div",{className:"pt-3 border-t border-gray-700",children:t.jsx(Ya,{})}),B&&l.length>0&&t.jsx("div",{className:"pt-3 border-t border-gray-700",children:t.jsx(Ka,{title:c,metrics:l})}),t.jsx("div",{className:"pt-3 border-t border-gray-700",children:t.jsx(_a,{})})]})})]})},Cu=(e={})=>{const{successMessage:r="",successDuration:a=3e3,errorPrefix:n="",onSuccess:o,onError:s}=e,[l,c]=p.useState(!1),[d,i]=p.useState(""),[h,u]=p.useState(""),y=p.useCallback(()=>{i(""),u("")},[]),m=p.useCallback(()=>{i("")},[]),b=p.useCallback(()=>{u("")},[]),v=p.useCallback(async k=>{c(!0),y();try{await k(),r&&(i(r),a>0&&setTimeout(()=>{i("")},a)),o&&o()}catch(S){const x=S instanceof Error?S.message:"An error occurred";throw u(n?`${n}: ${x}`:x),s&&S instanceof Error&&s(S),S}finally{c(!1)}},[r,a,n,o,s,y]);return{isSubmitting:l,successMessage:d,errorMessage:h,submit:v,clearMessages:y,clearSuccess:m,clearError:b}},Su=(e=!1)=>{const[r,a]=p.useState(e),n=p.useCallback(()=>a(!0),[]),o=p.useCallback(()=>a(!1),[]),s=p.useCallback(()=>a(l=>!l),[]);return{value:r,setTrue:n,setFalse:o,toggle:s,setValue:a}},Eu=(e={})=>{const{successDuration:r=2e3,onSuccess:a,onError:n}=e,[o,s]=p.useState(null),l=p.useCallback(async i=>{try{if(navigator.clipboard&&window.isSecureContext)await navigator.clipboard.writeText(i);else{const h=document.createElement("textarea");h.value=i,h.style.position="fixed",h.style.left="-999999px",h.style.top="-999999px",document.body.appendChild(h),h.focus(),h.select();const u=document.execCommand("copy");if(document.body.removeChild(h),!u)throw new Error("Copy command was unsuccessful")}return s(i),a?.(i),setTimeout(()=>{s(null)},r),!0}catch(h){const u=h instanceof Error?h:new Error("Copy failed");return n?.(u),!1}},[r,a,n]),c=p.useCallback(i=>o===i,[o]),d=p.useCallback(()=>{s(null)},[]);return{copiedValue:o,copyToClipboard:l,isCopied:c,resetCopiedState:d}},Au=(e={})=>{const{successDuration:r=2e3,onSuccess:a,onError:n}=e,[o,s]=p.useState({}),l=p.useCallback(async(i,h)=>{try{if(navigator.clipboard&&window.isSecureContext)await navigator.clipboard.writeText(i);else{const u=document.createElement("textarea");u.value=i,u.style.position="fixed",u.style.left="-999999px",u.style.top="-999999px",document.body.appendChild(u),u.focus(),u.select();const y=document.execCommand("copy");if(document.body.removeChild(u),!y)throw new Error("Copy command was unsuccessful")}return s(u=>({...u,[h]:!0})),a?.(i),setTimeout(()=>{s(u=>({...u,[h]:!1}))},r),!0}catch(u){const y=u instanceof Error?u:new Error("Copy failed");return n?.(y),!1}},[r,a,n]),c=p.useCallback(i=>o[i]||!1,[o]),d=p.useCallback(i=>{s(i?h=>({...h,[i]:!1}):{})},[]);return{copiedStates:o,copyToClipboard:l,isCopied:c,resetCopiedState:d}};function Tu(){const e=Z.useLocation(),r=p.useRef(null),a=p.useRef(0);p.useEffect(()=>{const n=e.pathname;if(!r.current){r.current=n,a.current=Date.now();return}const o=Date.now()-a.current;r.current!==n&&(za(r.current,n,o),r.current=n,a.current=Date.now())},[e])}function Iu({fields:e,validateOnChange:r=!1,validateOnBlur:a=!0}){const n=p.useMemo(()=>{const C={};for(const I in e)C[I]=e[I].initialValue;return C},[e]),[o,s]=p.useState(n),[l,c]=p.useState({}),[d,i]=p.useState({}),[h,u]=p.useState({}),y=p.useCallback(C=>{const I=e[C],L=o[C];if(I.required&&(L===""||L===null||L===void 0||Array.isArray(L)&&L.length===0))return I.requiredMessage||"This field is required";if(I.validate)for(const O of I.validate){const M=O(L);if(M)return M}},[e,o]),m=p.useCallback((C,I)=>{if(s(L=>({...L,[C]:I})),u(L=>({...L,[C]:!0})),r&&d[C]){const L=y(C);c(O=>({...O,[C]:L}))}},[r,d,y]),b=p.useCallback(C=>{s(L=>({...L,...C}));const I={};for(const L in C)I[L]=!0;u(L=>({...L,...I}))},[]),v=p.useCallback(C=>{if(i(I=>({...I,[C]:!0})),a){const I=y(C);c(L=>({...L,[C]:I}))}},[a,y]),k=p.useCallback(()=>{const C={},I={};let L=!0;for(const O in e){I[O]=!0;const M=y(O);M&&(C[O]=M,L=!1)}return i(I),c(C),L},[e,y]),S=p.useCallback(()=>{s(n),c({}),i({}),u({})},[n]),x=p.useCallback(C=>{s(I=>({...I,[C]:e[C].initialValue})),c(I=>{const L={...I};return delete L[C],L}),i(I=>{const L={...I};return delete L[C],L}),u(I=>{const L={...I};return delete L[C],L})},[e]),N=p.useCallback(C=>({value:o[C],onChange:I=>{m(C,I.target.value)},onBlur:()=>v(C),name:String(C),"aria-invalid":!!(d[C]&&l[C])}),[o,m,v,d,l]),w=p.useCallback(C=>d[C]?l[C]:void 0,[d,l]),E=p.useMemo(()=>{for(const C in e)if(y(C))return!1;return!0},[e,y]),A=p.useMemo(()=>Object.values(h).some(Boolean),[h]);return{values:o,errors:l,touched:d,dirty:h,isValid:E,isDirty:A,setValue:m,setValues:b,setTouched:v,validateField:y,validateAll:k,reset:S,resetField:x,getFieldProps:N,getFieldError:w}}const Lu=e=>{if(e===0)return"0 Bytes";const r=1024,a=["Bytes","KB","MB","GB","TB"],n=Math.floor(Math.log(e)/Math.log(r)),o=Math.min(n,a.length-1);return parseFloat((e/Math.pow(r,o)).toFixed(2))+" "+a[o]},Mu=(e,r,a)=>{const n={bytes:0,kb:1,mb:2,gb:3,tb:4},o=1024,l=e*Math.pow(o,n[r])/Math.pow(o,n[a]);return Math.round(l*100)/100},Pu=e=>{const r=e.match(/^(\d+(?:\.\d+)?)\s*(bytes?|kb|mb|gb|tb)$/i);if(!r)return null;const a=parseFloat(r[1]),n=r[2].toLowerCase(),s={bytes:1,byte:1,kb:1024,mb:1024*1024,gb:1024*1024*1024,tb:1024*1024*1024*1024}[n];return s?Math.round(a*s):null},Ou=e=>e,Uu=e=>{if(typeof document>"u")return;const r=document.createElement("style");r.textContent=e,r.setAttribute("data-critical","true"),document.head.appendChild(r)},Du=e=>{if(typeof document>"u")return;const r=document.createElement("link");r.rel="preload",r.as="style",r.href=e,r.onload=()=>{r.rel="stylesheet"},document.head.appendChild(r);const a=document.createElement("noscript");a.innerHTML=`<link rel="stylesheet" href="${e}">`,document.head.appendChild(a)},zu=e=>{const r={};return Object.entries(e).forEach(([a,n])=>{r[`--${a}`]=typeof n=="number"?`${n}px`:n}),r},ju={xs:475,sm:640,md:768,lg:1024,xl:1280,"2xl":1536},_u=(e,r=ju)=>{const[a,n]=p.useState("base");return p.useEffect(()=>{const o=()=>{const s=window.innerWidth;s>=r["2xl"]?n("2xl"):s>=r.xl?n("xl"):s>=r.lg?n("lg"):s>=r.md?n("md"):s>=r.sm?n("sm"):s>=r.xs?n("xs"):n("base")};return o(),window.addEventListener("resize",o),()=>window.removeEventListener("resize",o)},[r]),e[a]||e.base||{}},Qa=()=>typeof window>"u"?!1:window.matchMedia("(prefers-reduced-motion: reduce)").matches,Bu=()=>{const[e,r]=p.useState(Qa);return p.useEffect(()=>{const a=window.matchMedia("(prefers-reduced-motion: reduce)"),n=()=>{r(a.matches)};return a.addEventListener?a.addEventListener("change",n):a.addListener(n),()=>{a.removeEventListener?a.removeEventListener("change",n):a.removeListener(n)}},[]),e},Fu=(e,r=["layout","paint"])=>{e&&(e.style.contain=r.join(" "))},Wu=(e,r)=>e?(e.style.willChange=r.join(", "),()=>{e.style.willChange="auto"}):void 0,Vu=e=>{typeof window>"u"||requestAnimationFrame(()=>{e.forEach(r=>r())})},$u=(...e)=>e.filter(Boolean).join(" "),Hu=e=>{const r={},a=["display","position","width","height","margin","padding","fontSize","fontFamily","color","backgroundColor"];return Object.entries(e).forEach(([n,o])=>{a.includes(n)&&(r[n]=o)}),r},qu=(e,r=[])=>{const[a,n]=p.useState(null),[o,s]=p.useState(!0);return p.useEffect(()=>{let l=!0;return e().then(c=>{l&&(n(c.default),s(!1))}),()=>{l=!1}},[e,...r]),{styles:a,loading:o}},Gu=(e,r="1rem")=>({display:"grid",gridTemplateColumns:`repeat(${e}, minmax(0, 1fr))`,gap:r,contain:"layout",willChange:"transform"}),Yu=(e="row",r="center",a="flex-start")=>({display:"flex",flexDirection:e,alignItems:r,justifyContent:a,contain:"layout"}),Ku=e=>{const[r,a]=p.useState(!1);return p.useEffect(()=>{const n=window.matchMedia(e);a(n.matches);const o=()=>a(n.matches);return n.addEventListener?n.addEventListener("change",o):n.addListener(o),()=>{n.removeEventListener?n.removeEventListener("change",o):n.removeListener(o)}},[e]),r},Xu=(e,r)=>{const[a,n]=p.useState("light");return p.useEffect(()=>{const o=window.matchMedia("(prefers-color-scheme: dark)");n(o.matches?"dark":"light");const s=()=>{n(o.matches?"dark":"light")};return o.addEventListener?o.addEventListener("change",s):o.addListener(s),()=>{o.removeEventListener?o.removeEventListener("change",s):o.removeListener(s)}},[]),a==="dark"?r:e},Zu=e=>{const r={src:e.src,alt:e.alt,loading:e.loading||"lazy"};return e.title&&(r.title=e.title),e.width&&(r.width=e.width),e.height&&(r.height=e.height),e.sizes&&(r.sizes=e.sizes),e.srcSet&&(r.srcSet=e.srcSet),r.itemProp="image",r},Ju=(e,r=[320,640,768,1024,1280,1920])=>r.map(a=>`${e.replace(/\{width\}/g,a.toString())} ${a}w`).join(", "),Qu=e=>e.map(r=>r.maxWidth?`(max-width: ${r.maxWidth}px) ${r.size}`:r.size).join(", "),Ru=(e,r="openGraph")=>{const a={};return r==="openGraph"?(a["og:image"]=e.url,e.width&&(a["og:image:width"]=e.width.toString()),e.height&&(a["og:image:height"]=e.height.toString()),e.alt&&(a["og:image:alt"]=e.alt),e.type&&(a["og:image:type"]=e.type)):(a["twitter:image"]=e.url,e.alt&&(a["twitter:image:alt"]=e.alt)),a},eh=(e='img[loading="lazy"]')=>{if(typeof window>"u"||!("IntersectionObserver"in window))return;const r=document.querySelectorAll(e);if("loading"in HTMLImageElement.prototype){r.forEach(n=>{n.dataset.src&&(n.src=n.dataset.src)});return}const a=new IntersectionObserver(n=>{n.forEach(o=>{if(o.isIntersecting){const s=o.target;s.dataset.src&&(s.src=s.dataset.src,s.removeAttribute("data-src")),s.dataset.srcset&&(s.srcset=s.dataset.srcset,s.removeAttribute("data-srcset")),a.unobserve(s)}})},{rootMargin:"50px 0px",threshold:.01});return r.forEach(n=>a.observe(n)),()=>{r.forEach(n=>a.unobserve(n))}},Ra=()=>typeof window>"u"?Promise.resolve(!1):new Promise(e=>{const r=new Image;r.onload=r.onerror=function(){e(r.height===2)},r.src="data:image/webp;base64,UklGRjoAAABXRUJQVlA4IC4AAACyAgCdASoCAAIALmk0mk0iIiIiIgBoSygABc6WWgAA/veff/0PP8bA//LwYAAA"}),en=()=>typeof window>"u"?Promise.resolve(!1):new Promise(e=>{const r=new Image;r.onload=()=>e(!0),r.onerror=()=>e(!1),r.src="data:image/avif;base64,AAAAIGZ0eXBhdmlmAAAAAGF2aWZtaWYxbWlhZk1BMUIAAADybWV0YQAAAAAAAAAoaGRscgAAAAAAAAAAcGljdAAAAAAAAAAAAAAAAGxpYmF2aWYAAAAADnBpdG0AAAAAAAEAAAAeaWxvYwAAAABEAAABAAEAAAABAAABGgAAAB0AAAAoaWluZgAAAAAAAQAAABppbmZlAgAAAAABAABhdjAxQ29sb3IAAAAAamlwcnAAAABLaXBjbwAAABRpc3BlAAAAAAAAAAIAAAACAAAAEHBpeGkAAAAAAwgICAAAAAxhdjFDgQ0MAAAAABNjb2xybmNseAACAAIAAYAAAAAXaXBtYQAAAAAAAAABAAEEAQKDBAAAACVtZGF0EgAKCBgANogQEAwgMg8f8D///8WfhwB8+ErK42A="}),rh=async(e="jpg")=>{const[r,a]=await Promise.all([Ra(),en()]);return a?"avif":r?"webp":e},th=(e,r,a,n)=>`
66
66
  <picture>
67
67
  ${e.map(s=>{const l=[`srcset="${s.srcSet}"`];return s.type&&l.push(`type="${s.type}"`),s.media&&l.push(`media="${s.media}"`),s.sizes&&l.push(`sizes="${s.sizes}"`),`<source ${l.join(" ")}>`}).join(`
68
68
  `)}
69
69
  <img src="${r}" alt="${a}"${n?` class="${n}"`:""} loading="lazy">
70
- </picture>`.trim(),th=(e,r="image")=>{if(typeof document>"u")return;const a=document.createElement("link");a.rel="preload",a.as=r,a.href=e,e.includes(".webp")?a.type="image/webp":e.includes(".avif")&&(a.type="image/avif"),document.head.appendChild(a)},ah=(e,r,a)=>{if(typeof window>"u")return;const n=new Image;n.src=e,n.classList.add("progressive-image-placeholder"),a.appendChild(n);const o=new Image;o.src=r,o.classList.add("progressive-image-main"),o.style.opacity="0",o.onload=()=>{a.appendChild(o),requestAnimationFrame(()=>{o.style.transition="opacity 0.3s",o.style.opacity="1",setTimeout(()=>{n.remove()},300)})}},nh=e=>new Promise(r=>{const a=performance.now();e.complete?r({loadTime:0,size:0,format:e.src.split(".").pop()||"unknown",dimensions:{width:e.naturalWidth,height:e.naturalHeight},isLazyLoaded:e.loading==="lazy",isOptimized:e.srcset!==""||e.sizes!==""}):e.addEventListener("load",()=>{const n=performance.now()-a;r({loadTime:n,size:0,format:e.src.split(".").pop()||"unknown",dimensions:{width:e.naturalWidth,height:e.naturalHeight},isLazyLoaded:e.loading==="lazy",isOptimized:e.srcset!==""||e.sizes!==""})})}),oh=(e,r,a="#e0e0e0")=>{const n=`
70
+ </picture>`.trim(),ah=(e,r="image")=>{if(typeof document>"u")return;const a=document.createElement("link");a.rel="preload",a.as=r,a.href=e,e.includes(".webp")?a.type="image/webp":e.includes(".avif")&&(a.type="image/avif"),document.head.appendChild(a)},nh=(e,r,a)=>{if(typeof window>"u")return;const n=new Image;n.src=e,n.classList.add("progressive-image-placeholder"),a.appendChild(n);const o=new Image;o.src=r,o.classList.add("progressive-image-main"),o.style.opacity="0",o.onload=()=>{a.appendChild(o),requestAnimationFrame(()=>{o.style.transition="opacity 0.3s",o.style.opacity="1",setTimeout(()=>{n.remove()},300)})}},oh=e=>new Promise(r=>{const a=performance.now();e.complete?r({loadTime:0,size:0,format:e.src.split(".").pop()||"unknown",dimensions:{width:e.naturalWidth,height:e.naturalHeight},isLazyLoaded:e.loading==="lazy",isOptimized:e.srcset!==""||e.sizes!==""}):e.addEventListener("load",()=>{const n=performance.now()-a;r({loadTime:n,size:0,format:e.src.split(".").pop()||"unknown",dimensions:{width:e.naturalWidth,height:e.naturalHeight},isLazyLoaded:e.loading==="lazy",isOptimized:e.srcset!==""||e.sizes!==""})})}),sh=(e,r,a="#e0e0e0")=>{const n=`
71
71
  <svg width="${e}" height="${r}" xmlns="http://www.w3.org/2000/svg">
72
72
  <rect width="100%" height="100%" fill="${a}"/>
73
73
  </svg>
74
- `;return`data:image/svg+xml;base64,${btoa(n)}`},sh=(e,r)=>{const a=1/r*100;e.style.position="relative",e.style.paddingTop=`${a}%`;const n=e.querySelector("img");n&&(n.style.position="absolute",n.style.top="0",n.style.left="0",n.style.width="100%",n.style.height="100%",n.style.objectFit="cover")},Ie={createPureFunction:e=>e,isDevelopment:process.env.NODE_ENV==="development",isProduction:process.env.NODE_ENV==="production",isTest:process.env.NODE_ENV==="test",createFeatureFlags:(e={})=>({enableAnalytics:process.env.VITE_ENABLE_ANALYTICS==="true",enableDebugTools:process.env.NODE_ENV==="development",enablePerformanceMonitoring:process.env.VITE_ENABLE_PERF_MONITORING!=="false",...e})},lh=e=>{const r={};return Object.entries(e).forEach(([a,n])=>{r[a]=()=>{try{return n()}catch{return Promise.resolve({default:null})}}}),r},rn={createDebounce:e=>r=>{let a;return((...n)=>{clearTimeout(a),a=setTimeout(()=>r(...n),e)})},memoize:e=>{const r=new Map;return((...a)=>{const n=JSON.stringify(a);if(r.has(n))return r.get(n);const o=e(...a);return r.set(n,o),o})},isDeepEqual:(e,r)=>{if(e===r)return!0;if(e==null||r==null||typeof e!="object"||typeof r!="object")return!1;const a=Object.keys(e),n=Object.keys(r);if(a.length!==n.length)return!1;for(const o of a)if(!n.includes(o)||!rn.isDeepEqual(e[o],r[o]))return!1;return!0},createThrottle:e=>r=>{let a=0;return((...n)=>{const o=Date.now();if(o-a>=e)return a=o,r(...n)})}},ih=e=>{const r={};return Object.entries(e).forEach(([a,n])=>{r[a]={},Object.entries(n).forEach(([o,s])=>{r[a][o]=()=>import(s).then(l=>({[o]:l[o]}))})}),r},Le={getModuleSize:e=>new Promise(r=>{if(typeof window<"u"&&"performance"in window){const n=performance.getEntriesByType("resource").find(o=>o.name.includes(e));r(n?.transferSize||0)}else r(0)}),usageTracker:new Set,trackUsage:e=>{Ie.isDevelopment&&Le.usageTracker.add(e)},getUsageReport:()=>Ie.isDevelopment?Array.from(Le.usageTracker).sort():[],estimateImpact:e=>{const r=e.map(a=>Le.getModuleSize(a).then(n=>[a,n]));return Promise.all(r).then(a=>{const n={};let o=0;return a.forEach(([s,l])=>{n[s]=l,o+=l}),{total:o,modules:n}})}},tn={inlineCriticalCSS:e=>{if(typeof document<"u"){const r=document.createElement("style");r.textContent=e,document.head.appendChild(r)}},loadAsyncCSS:e=>{if(typeof document<"u"){const r=document.createElement("link");r.rel="stylesheet",r.href=e,r.media="print",r.onload=()=>{r.media="all"},document.head.appendChild(r)}},removeUnusedCSS:e=>{if(typeof document>"u")return;const r=new Set;return e.forEach(a=>{try{document.querySelector(a)&&r.add(a)}catch{}}),{used:Array.from(r),unused:e.filter(a=>!r.has(a))}}},ch=(e={})=>{const{features:r={},criticalCSS:a="",enableUsageTracking:n=Ie.isDevelopment}=e;return{features:Ie.createFeatureFlags(r),initialize:()=>{a&&typeof document<"u"&&tn.inlineCriticalCSS(a)},cleanup:()=>{Le.usageTracker.clear()},getReport:()=>({usage:Le.getUsageReport(),features:Ie.createFeatureFlags(r)})}};let Zr;function dh(e){throw typeof window<"u"?new Error("Web navigation service not implemented in shared library"):new Error("React Native navigation service not implemented in shared library")}function oe(e){return Zr||(Zr=dh()),Zr}function gh(){const e=oe(),r=e.getCurrentState();return{navigate:(a,n)=>{e.navigate(a,n)},goBack:a=>{e.goBack(a)},replace:(a,n)=>{e.replace(a,n)},currentPath:r.currentPath,searchParams:r.searchParams,params:r.params,canGoBack:e.canGoBack(),isSupported:e.isSupported()}}function uh(){const r=oe().getCurrentState(),a=Object.keys(r.searchParams).length>0?"?"+new URLSearchParams(r.searchParams).toString():"";return{pathname:r.currentPath,search:a,searchParams:r.searchParams,hash:"",state:{},key:r.currentPath}}function hh(){const e=oe(),r=e.getCurrentState();return[new URLSearchParams(r.searchParams),o=>{const s=o instanceof URLSearchParams?Object.fromEntries(o.entries()):o,l=new URLSearchParams(s).toString(),c=r.currentPath+(l?`?${l}`:"");e.replace(c)}]}const we={navigate:(e,r)=>{oe().navigate(e,r)},goBack:e=>{oe().goBack(e)},replace:(e,r)=>{oe().replace(e,r)},getCurrentPath:()=>oe().getCurrentPath(),getSearchParams:()=>oe().getSearchParams(),goToMail:()=>{we.navigate("/mail")},goToPreferences:()=>{we.navigate("/preferences")},goToCompose:(e,r)=>{const a=new URLSearchParams;e&&a.set("type",e),r&&Object.entries(r).forEach(([o,s])=>{a.set(o,s)});const n=a.toString();we.navigate(`/mail/compose${n?`?${n}`:""}`)},goToConnect:()=>{we.navigate("/connect")},goToDelegate:()=>{we.navigate("/admin/delegate")},goToHome:()=>{we.navigate("/")},canGoBack:()=>oe().canGoBack()};function fh(e,r=3,a=1e3){return p.lazy(()=>new Promise((n,o)=>{const s=l=>{e().then(n).catch(c=>{l>0?setTimeout(()=>{s(l-1)},a):o(c)})};s(r)}))}function bh(e){let r=null;const a=()=>(r||(r=e()),r.then(()=>{}));return{Component:p.lazy(()=>r||e()),preload:a}}function mh(e,r={}){const{fallback:a=t.jsx("div",{children:"Loading..."}),errorFallback:n=t.jsx("div",{children:"Failed to load component"}),loadingDelay:o=200,minimumLoadingTime:s=500}=r,l=p.lazy(async()=>{const d=Date.now();try{const i=await e(),h=Date.now()-d;return h<s&&await new Promise(u=>setTimeout(u,s-h)),i}catch{return{default:(()=>n)}}}),c=()=>{const[d,i]=p.useState(!1);return p.useEffect(()=>{const h=setTimeout(()=>{i(!0)},o);return()=>clearTimeout(h)},[]),d?t.jsx(t.Fragment,{children:a}):null};return p.forwardRef((d,i)=>t.jsx(p.Suspense,{fallback:t.jsx(c,{}),children:t.jsx(l,{...d,ref:i})}))}function an(e,r={}){const[a,n]=p.useState(!1),[o,s]=p.useState(!1);return p.useEffect(()=>{const l=e.current;if(!l||o)return;const c=new IntersectionObserver(([d])=>{d.isIntersecting&&(n(!0),s(!0),c.disconnect())},{rootMargin:"50px",threshold:.01,...r});return c.observe(l),()=>{c.disconnect()}},[e,r,o]),a}const yh=({children:e,fallback:r=t.jsx("div",{children:"Loading..."}),threshold:a=.01,rootMargin:n="50px",placeholder:o})=>{const s=p.useRef(null),l=an(s,{threshold:a,rootMargin:n});return t.jsx("div",{ref:s,children:l?e:o||r})};function ph(e){const{importFn:r,preloadOnHover:a=!0,preloadOnFocus:n=!0,prefetchDelay:o=50}=e;let s=null,l=null;const c=()=>(l||(l=r()),l),d=()=>{s&&clearTimeout(s),s=setTimeout(()=>{c()},o)};return{Component:p.lazy(()=>l||r()),preload:c,linkProps:{...a&&{onMouseEnter:d,onMouseLeave:()=>{s&&clearTimeout(s)}},...n&&{onFocus:d}}}}function vh(e,r=[]){const[a,n]=p.useState(null),[o,s]=p.useState(!0),[l,c]=p.useState(null);return p.useEffect(()=>{let d=!0;return s(!0),c(null),e().then(i=>{d&&(n(i),s(!1))}).catch(i=>{d&&(c(i),s(!1))}),()=>{d=!1}},[e,...r]),{module:a,loading:o,error:l}}class nn{constructor(r=3,a=100){this.queue=new Set,this.isProcessing=!1,this.batchSize=r,this.delay=a}add(r){this.queue.add(r),this.process()}async process(){if(this.isProcessing||this.queue.size===0)return;this.isProcessing=!0;const r=Array.from(this.queue).slice(0,this.batchSize);r.forEach(a=>this.queue.delete(a)),await Promise.all(r.map(a=>a().catch(()=>{}))),this.queue.size>0&&await new Promise(a=>setTimeout(a,this.delay)),this.isProcessing=!1,this.queue.size>0&&this.process()}}function kh(e,r,a){if(typeof document>"u")return;const n=document.createElement("link");n.rel=r,n.href=e,a&&(r==="preload"||r==="prefetch")&&(n.as=a),document.head.appendChild(n)}var Jr=(e=>(e[e.HIGH=0]="HIGH",e[e.MEDIUM=1]="MEDIUM",e[e.LOW=2]="LOW",e[e.IDLE=3]="IDLE",e))(Jr||{});class on{constructor(){this.queues=new Map,this.isProcessing=!1,Object.values(Jr).filter(r=>typeof r=="number").forEach(r=>{this.queues.set(r,[])})}load(r,a=1){const n=this.queues.get(a);n&&n.push(r),this.process()}async process(){if(!this.isProcessing){this.isProcessing=!0;for(const[r,a]of this.queues)for(;a.length>0;){const n=a.shift();if(n)try{await n()}catch{}r>=2&&await new Promise(o=>setTimeout(o,50))}this.isProcessing=!1}}}const xh=new nn,wh=new on;class Qr{constructor(r={}){this.prefix=r.prefix||"mailbox",this.defaultTTL=r.ttl,this.platformStorage=r.platformStorage||this.createFallbackStorage()}createFallbackStorage(){const r=new Map;return{getItem:a=>r.get(a)||null,setItem:(a,n)=>{r.set(a,n)},removeItem:a=>{r.delete(a)},clear:()=>{r.clear()},getAllKeys:()=>Array.from(r.keys())}}getKey(r){return`${this.prefix}-${r}`}isExpired(r){return r.ttl?Date.now()-r.timestamp>r.ttl:!1}set(r,a,n){try{const o={value:a,timestamp:Date.now(),ttl:n||this.defaultTTL};this.platformStorage.setItem(this.getKey(r),JSON.stringify(o))}catch{}}get(r,a){try{const n=this.platformStorage.getItem(this.getKey(r));if(!n)return a;const o=JSON.parse(n);return this.isExpired(o)?(this.remove(r),a):o.value}catch{return a}}remove(r){try{this.platformStorage.removeItem(this.getKey(r))}catch{}}clear(r){try{if(this.platformStorage.getAllKeys){const a=this.platformStorage.getAllKeys(),n=this.getKey(r||""),o=a.filter(s=>s.startsWith(n));for(const s of o)this.platformStorage.removeItem(s)}else this.platformStorage.clear?.()}catch(a){console.error("Failed to clear storage:",a)}}has(r){try{return this.platformStorage.getItem(this.getKey(r))!==null}catch(a){return console.error(`Failed to check item ${r}:`,a),!1}}getAllKeys(){try{if(this.platformStorage.getAllKeys){const r=this.platformStorage.getAllKeys(),a=`${this.prefix}-`;return r.filter(n=>n.startsWith(a)).map(n=>n.substring(a.length))}return[]}catch(r){return console.error("Failed to get all keys:",r),[]}}}const Nh=new Qr,Ch=new Qr({prefix:"mailbox-theme"}),Sh=new Qr({prefix:"walletUser",ttl:10080*60*1e3}),Eh=e=>{if(!e)throw new Error("PlatformStorage must be provided to createSimpleStorage");return{setItem:(r,a)=>{try{e.setItem(r,a)}catch{}},getItem:r=>{try{return e.getItem(r)}catch{return null}},removeItem:r=>{try{e.removeItem(r)}catch{}}}};function sn(){const e={isWalletBrowser:!1,walletType:"unknown",hasEthereum:!1,hasSolana:!1,provider:null};if(typeof window>"u")return e;try{const r=navigator.userAgent.toLowerCase();let a="unknown",n=!1;r.includes("metamask")?(a="metamask",n=!0):r.includes("trustwallet")?(a="trustwallet",n=!0):r.includes("coinbase")?(a="coinbase",n=!0):r.includes("rainbow")?(a="rainbow",n=!0):r.includes("phantom")?(a="phantom",n=!0):r.includes("solflare")?(a="solflare",n=!0):r.includes("exodus")&&(a="exodus",n=!0);const o=!!window.ethereum,s=!!window.solana||!!window.phantom?.solana;(o||s)&&!n&&(n=!0,window.ethereum?.isMetaMask?a="metamask":window.ethereum?.isCoinbaseWallet?a="coinbase":window.ethereum?.isRainbow?a="rainbow":window.phantom?a="phantom":window.solflare&&(a="solflare"));const l=o?window.ethereum:s?window.solana||window.phantom?.solana:null;return{isWalletBrowser:n,walletType:a,hasEthereum:o,hasSolana:s,provider:l}}catch{return e}}async function Ah(){const e=sn();if(!e.isWalletBrowser)return{success:!1,error:"Not running in a wallet browser"};try{if(e.hasEthereum&&e.provider)try{const r=await e.provider.request({method:"eth_requestAccounts"});if(r&&r.length>0)return{success:!0,address:r[0]}}catch{}if(e.hasSolana&&e.provider)try{const r=await e.provider.connect();if(r.publicKey)return{success:!0,address:r.publicKey.toString()}}catch{}return{success:!1,error:"Failed to connect to wallet provider"}}catch(r){return{success:!1,error:r instanceof Error?r.message:"Unknown connection error"}}}function Th(e){if(!e)return!1;if(e instanceof Error){const r=e.message.toLowerCase();if(r.includes("network")||r.includes("fetch")||r.includes("failed to fetch")||r.includes("connection")||r.includes("timeout")||r.includes("net::err"))return!0}if(typeof e=="string"){const r=e.toLowerCase();if(r.includes("network")||r.includes("fetch")||r.includes("failed to fetch")||r.includes("connection")||r.includes("timeout")||r.includes("server error")||r.includes("500")||r.includes("502")||r.includes("503")||r.includes("504"))return!0}if(typeof e=="object"&&e!==null&&"status"in e){const r=e.status;if(typeof r=="number"&&r>=500&&r<600)return!0}return!1}function Ih(e){if(!e)return!1;if(typeof e=="string"){const r=e.toLowerCase();return r.includes("429")||r.includes("rate limit")||r.includes("too many requests")||r.includes("rate_limit")}if(e instanceof Error){const r=e.message.toLowerCase();return r.includes("429")||r.includes("rate limit")||r.includes("too many requests")||r.includes("rate_limit")}return typeof e=="object"&&e!==null&&"status"in e?e.status===429:!1}function Lh(e){if(!e)return!1;if(typeof e=="string"){const r=e.toLowerCase();return r.includes("401")||r.includes("unauthorized")||r.includes("unauthenticated")}if(e instanceof Error){const r=e.message.toLowerCase();return r.includes("401")||r.includes("unauthorized")||r.includes("unauthenticated")}return typeof e=="object"&&e!==null&&"status"in e?e.status===401:!1}function Mh(e){if(!e)return!1;if(typeof e=="string"){const r=e.toLowerCase();return r.includes("403")||r.includes("forbidden")}if(e instanceof Error){const r=e.message.toLowerCase();return r.includes("403")||r.includes("forbidden")}return typeof e=="object"&&e!==null&&"status"in e?e.status===403:!1}function Ph(e){if(!e)return!1;if(typeof e=="string"){const r=e.toLowerCase();return r.includes("404")||r.includes("not found")}if(e instanceof Error){const r=e.message.toLowerCase();return r.includes("404")||r.includes("not found")}return typeof e=="object"&&e!==null&&"status"in e?e.status===404:!1}function Oh(e,r="An unexpected error occurred"){return e?typeof e=="string"?e:e instanceof Error||typeof e=="object"&&e!==null&&"message"in e&&typeof e.message=="string"?e.message:r:r}async function ln(e){const a=new TextEncoder().encode(e.toLowerCase()),n=await crypto.subtle.digest("SHA-256",a);return Array.from(new Uint8Array(n)).map(s=>s.toString(16).padStart(2,"0")).join("")}const Uh=ln;function cn(e){return e.replace(/^\/[a-z]{2}(-[a-z]+)?(?=\/|$)/,"")}function Dh(e,r){const a=cn(e);return r?.[a]?r[a]:a.replace(/\//g,"_").replace(/^_/,"")||"home"}const zh={USER_LOGIN:"login",USER_LOGOUT:"logout",USER_SIGNUP:"sign_up",PAGE_VIEW:"page_view",BUTTON_CLICK:"button_click",LINK_CLICK:"link_click",ERROR_OCCURRED:"error_occurred",ERROR_API_CALL:"error_api_call",SCROLL_DEPTH:"scroll_depth",TIME_ON_PAGE:"time_on_page",FORM_SUBMIT:"form_submit",SEARCH:"search"};function jh(e,r){return{event:e,parameters:{...r,timestamp:r?.timestamp??Date.now()}}}const _h={utils:{cn:f}};Object.defineProperty(g,"ArrowLeftIcon",{enumerable:!0,get:()=>P.ArrowLeftIcon}),Object.defineProperty(g,"ArrowRightIcon",{enumerable:!0,get:()=>P.ArrowRightIcon}),Object.defineProperty(g,"Bars3Icon",{enumerable:!0,get:()=>P.Bars3Icon}),Object.defineProperty(g,"BellIcon",{enumerable:!0,get:()=>P.BellIcon}),Object.defineProperty(g,"BellSlashIcon",{enumerable:!0,get:()=>P.BellSlashIcon}),Object.defineProperty(g,"ChartBarIcon",{enumerable:!0,get:()=>P.ChartBarIcon}),Object.defineProperty(g,"CheckCircleIcon",{enumerable:!0,get:()=>P.CheckCircleIcon}),Object.defineProperty(g,"CheckIcon",{enumerable:!0,get:()=>P.CheckIcon}),Object.defineProperty(g,"ChevronDownIcon",{enumerable:!0,get:()=>P.ChevronDownIcon}),Object.defineProperty(g,"ChevronLeftIcon",{enumerable:!0,get:()=>P.ChevronLeftIcon}),Object.defineProperty(g,"ChevronRightIcon",{enumerable:!0,get:()=>P.ChevronRightIcon}),Object.defineProperty(g,"ChevronUpIcon",{enumerable:!0,get:()=>P.ChevronUpIcon}),Object.defineProperty(g,"ClockIcon",{enumerable:!0,get:()=>P.ClockIcon}),Object.defineProperty(g,"CodeBracketIcon",{enumerable:!0,get:()=>P.CodeBracketIcon}),Object.defineProperty(g,"Cog6ToothIcon",{enumerable:!0,get:()=>P.Cog6ToothIcon}),Object.defineProperty(g,"CreditCardIcon",{enumerable:!0,get:()=>P.CreditCardIcon}),Object.defineProperty(g,"DocumentTextIcon",{enumerable:!0,get:()=>P.DocumentTextIcon}),Object.defineProperty(g,"EnvelopeIcon",{enumerable:!0,get:()=>P.EnvelopeIcon}),Object.defineProperty(g,"ExclamationTriangleIcon",{enumerable:!0,get:()=>P.ExclamationTriangleIcon}),Object.defineProperty(g,"EyeSlashIcon",{enumerable:!0,get:()=>P.EyeSlashIcon}),Object.defineProperty(g,"GlobeAltIcon",{enumerable:!0,get:()=>P.GlobeAltIcon}),Object.defineProperty(g,"HomeIcon",{enumerable:!0,get:()=>P.HomeIcon}),Object.defineProperty(g,"InboxIcon",{enumerable:!0,get:()=>P.InboxIcon}),Object.defineProperty(g,"InformationCircleIcon",{enumerable:!0,get:()=>P.InformationCircleIcon}),Object.defineProperty(g,"KeyIcon",{enumerable:!0,get:()=>P.KeyIcon}),Object.defineProperty(g,"MegaphoneIcon",{enumerable:!0,get:()=>P.MegaphoneIcon}),Object.defineProperty(g,"MinusIcon",{enumerable:!0,get:()=>P.MinusIcon}),Object.defineProperty(g,"PaperAirplaneIcon",{enumerable:!0,get:()=>P.PaperAirplaneIcon}),Object.defineProperty(g,"PaperClipIcon",{enumerable:!0,get:()=>P.PaperClipIcon}),Object.defineProperty(g,"PlusIcon",{enumerable:!0,get:()=>P.PlusIcon}),Object.defineProperty(g,"RocketLaunchIcon",{enumerable:!0,get:()=>P.RocketLaunchIcon}),Object.defineProperty(g,"ShieldCheckIcon",{enumerable:!0,get:()=>P.ShieldCheckIcon}),Object.defineProperty(g,"SparklesIcon",{enumerable:!0,get:()=>P.SparklesIcon}),Object.defineProperty(g,"StarIcon",{enumerable:!0,get:()=>P.StarIcon}),Object.defineProperty(g,"TrashIcon",{enumerable:!0,get:()=>P.TrashIcon}),Object.defineProperty(g,"UserGroupIcon",{enumerable:!0,get:()=>P.UserGroupIcon}),Object.defineProperty(g,"XMarkIcon",{enumerable:!0,get:()=>P.XMarkIcon}),Object.defineProperty(g,"CheckCircleIconSolid",{enumerable:!0,get:()=>he.CheckCircleIcon}),Object.defineProperty(g,"CheckIconSolid",{enumerable:!0,get:()=>he.CheckIcon}),Object.defineProperty(g,"ExclamationTriangleIconSolid",{enumerable:!0,get:()=>he.ExclamationTriangleIcon}),Object.defineProperty(g,"StarIconSolid",{enumerable:!0,get:()=>he.StarIcon}),g.ActionBanner=bo,g.ActionButton=Ps,g.AddressLink=al,g.Alert=mr,g.AlertBanner=ho,g.AlertDescription=uo,g.AlertTitle=go,g.AnimatedSection=ar,g.ApiSection=Ha,g.AreaChart=Xi,g.AspectRatio=Sn,g.AudioPlayer=wc,g.Avatar=Fi,g.Backdrop=dl,g.Badge=To,g.Banner=ul,g.BarChart=Gi,g.BatchRender=Sd,g.Blockquote=Rn,g.BodyText=Yn,g.BorderAccent=Un,g.Box=at,g.Breadcrumb=ea,g.BreadcrumbNav=si,g.BreadcrumbSection=td,g.BundleSection=$a,g.BurndownChart=nc,g.Button=ne,g.CACHE_CONFIGS=ga,g.CTASection=qd,g.Calendar=Ht,g.CalloutBox=_i,g.CancellableRequest=Z0,g.Card=Lr,g.CardContent=Di,g.CardFooter=zi,g.CardHeader=Ui,g.Center=pn,g.ChainBadge=rs,g.Checkbox=us,g.Code=Zn,g.CodeBlock=ad,g.CodeDisplay=Jn,g.CollapsibleDocumentationTopic=od,g.ColorPicker=zs,g.ColorPickerAdvanced=js,g.ColorSwatch=_s,g.Combobox=ms,g.Command=fl,g.CommonAnalyticsEvents=zh,g.ComponentPreloader=Gr,g.ConditionalRender=wd,g.Confetti=Zl,g.ConfirmationDialog=Vc,g.Container=fn,g.ContentContainer=e0,g.CreditCardInput=Hs,g.CriticalPathOptimizer=Bg,g.CurrencyInput=qs,g.CustomSection=Ka,g.DashboardStatCard=Bi,g.DataSkeleton=yo,g.DataTable=yi,g.DateInput=is,g.DateRangePicker=Us,g.DateTimePicker=Os,g.DetailErrorState=Dd,g.Dialog=Yt,g.Divider=Pn,g.DragDrop=Hc,g.Drawer=Pc,g.Dropdown=ps,g.EditableSelector=ys,g.EmptyState=Qt,g.ErrorBoundary=gd,g.ExpensiveComponent=kd,g.ExternalLink=ri,g.FadeInScale=il,g.FadeInUp=ll,g.FeatureBlock=kl,g.FeatureCard=_d,g.FeatureGrid=$d,g.FileInput=ws,g.Flex=hn,g.FloatingElement=cl,g.FloatingPanel=Dn,g.FocusTrap=Oc,g.FontSize=jr,g.Footer=t0,g.FooterBottom=l0,g.FooterBottomRow=i0,g.FooterBrand=n0,g.FooterCompact=c0,g.FooterCompactLeft=d0,g.FooterCompactRight=g0,g.FooterCopyright=h0,g.FooterGrid=a0,g.FooterLink=s0,g.FooterLinkSection=o0,g.FooterSocialLinks=f0,g.FooterVersion=u0,g.FormAlerts=Ls,g.FormField=Es,g.FormFieldGroup=tr,g.FormSection=pl,g.FormattedNumber=ao,g.FullPageSpinner=mo,g.Gauge=lc,g.GlobalLazyErrorBoundary=bd,g.GradientIconContainer=wl,g.Grid=bn,g.HStack=yn,g.Heading=Wn,g.HelperText=eo,g.HoverCard=$c,g.IconContainer=Tl,g.IconText=Il,g.Image=gc,g.ImageCropper=fc,g.ImageGallery=uc,g.InfiniteScroll=Uc,g.InfoBox=Ml,g.InfoCard=ji,g.Input=Je,g.ItemList=Ll,g.KYCLevelCard=Jd,g.KYCStatusBadge=Kd,g.Kbd=Qn,g.KeyValuePair=$i,g.Label=Tr,g.LanguageSelector=cd,g.LanguageValidator=Id,g.LayoutContext=Ur,g.LayoutProvider=na,g.LazyComponent=Nd,g.LazyErrorBoundary=sr,g.LazyImage=gg,g.LazyLoadQueue=nn,g.LazyWalletButton=_g,g.LazyWrapper=yh,g.Lightbox=bc,g.LineChart=Yi,g.Link=ei,g.List=Ci,g.ListItem=Si,g.ListItemWithAction=Ei,g.LiveStream=xc,g.LoadPriority=Jr,g.LoadingDots=so,g.LoadingOptimizer=$0,g.LoadingOverlay=oo,g.LoadingState=lo,g.LocalizedLink=Td,g.Logo=Ol,g.Masonry=Fn,g.MasterDetailLayout=m0,g.MasterListItem=b0,g.MediaUploader=Ac,g.MemorySection=Ya,g.MentionInput=Cs,g.MetricRow=H,g.Modal=Mr,g.ModalContent=Pr,g.ModalFooter=Or,g.ModalHeader=Mc,g.MultiSelect=bs,g.NavigationList=ii,g.NavigationMenu=li,g.NetworkErrorBoundary=hd,g.NoContent=qi,g.NotificationBadge=Eo,g.NotificationPanel=Ao,g.NumberInput=ss,g.OptimizedAPIClient=K0,g.OptimizedImage=Ed,g.OptimizedRoutePreloader=H0,g.Overlay=Ze,g.PageContainer=Cn,g.PageHeader=Rd,g.PageSectionHeader=Dl,g.PageTitle=$n,g.Pagination=di,g.PaginationNav=gi,g.PanelHeader=ja,g.PerformanceBoundary=Cd,g.PerformanceOptimizer=V0,g.PerformancePanel=wu,g.PhoneDirectory=Ms,g.PhoneInput=gs,g.PieChart=Ki,g.PlatformSpecificComponents=wg,g.PlaylistManager=Ic,g.PodcastPlayer=Ec,g.Popover=Dc,g.Portal=be,g.PreloadLink=oi,g.PriorityLoader=on,g.Progress=ic,g.ProgressCircle=cc,g.PromotionalBanner=sd,g.ProtectedRoute=Pd,g.PullToRefresh=ed,g.QRCodeDisplay=Lc,g.QuickActions=jl,g.QuizBuilder=el,g.RadioGroup=hs,g.RelativeTime=no,g.Resizable=jn,g.RetinaImage=mc,g.RouteBasedLazyLoader=qr,g.SafeAppWrapper=md,g.ScoreIndicator=bu,g.ScoreLegend=_a,g.ScreenContainer=y0,g.ScrollArea=Bn,g.ScrollSpy=zc,g.SearchInput=ls,g.Section=wn,g.SectionBadge=Fl,g.SectionHeader=Wl,g.SectionTitle=qn,g.SecurityProvider=yd,g.Select=Cr,g.SelectContent=Re,g.SelectField=Is,g.SelectGroup=fs,g.SelectItem=er,g.SelectLabel=Ft,g.SelectScrollDownButton=Er,g.SelectScrollUpButton=Sr,g.SelectSeparator=Wt,g.SelectTrigger=Qe,g.SelectValue=Bt,g.Separator=On,g.SettingsList=$l,g.Sheet=jc,g.SideNav=ci,g.SignaturePad=Bs,g.SignatureRequest=Fs,g.SkeletonLoader=io,g.Slider=ks,g.SliderInput=xs,g.SmartContent=Rl,g.SmartLink=Ir,g.SmartWalletProviders=zg,g.Spacer=vn,g.Sparkline=rc,g.Spinner=Ce,g.SplitPane=zn,g.Stack=br,g.StandardPageLayout=Qd,g.StatCard=ml,g.StatDisplay=Hi,g.StatusBadge=es,g.StatusIndicator=as,g.StepList=dd,g.Stepper=ui,g.StepperNav=hi,g.SubscriptionGatedComponents=xg,g.SumsubWebSDK=Xd,g.Switch=_t,g.Table=mi,g.TableOfContents=bi,g.Tabs=Kt,g.TabsContent=Jt,g.TabsList=Xt,g.TabsTrigger=Zt,g.TagInput=Ns,g.Text=nt,g.TextArea=os,g.TextAreaField=Ts,g.TextField=As,g.TextInputModal=_c,g.TextLink=Xn,g.Theme=re,g.ThemeContext=_r,g.ThemeProvider=jd,g.TimePicker=jt,g.TimerDisplay=Kl,g.Toast=ot,g.ToastContainer=No,g.ToastContext=yr,g.ToastNotification=So,g.ToastProvider=vo,g.ToggleGroup=vs,g.Tooltip=Rt,g.Topbar=k0,g.TopbarActions=z0,g.TopbarCenter=w0,g.TopbarContext=Fr,g.TopbarDivider=S0,g.TopbarIconButton=B0,g.TopbarLeft=x0,g.TopbarLogo=A0,g.TopbarMenuToggle=ca,g.TopbarMobileContent=C0,g.TopbarMobileNav=P0,g.TopbarNav=da,g.TopbarNavigation=O0,g.TopbarProvider=la,g.TopbarRight=N0,g.TopbarSearch=W0,g.TrackedButton=ld,g.TrackedLink=id,g.TransferList=Ti,g.TreeView=Li,g.TruncatedText=to,g.UaudioUwaveform=Nc,g.UavatarUgroup=Wi,g.UbadgeUdesigner=Io,g.UbubbleUchart=Ji,g.UcellUeditor=wi,g.UcodeUhighlighter=$s,g.UcolumnUresize=xi,g.UcurrencyUconverter=Gs,g.UcurrencyUrates=Ys,g.UdataUgrid=pi,g.UdoubleUtap=Jc,g.UdragUdropUlist=qc,g.UfieldUmapper=Qs,g.UfocusUindicator=xl,g.UformUbuilder=Ks,g.UformUtemplate=Zs,g.UformUvalidator=Xs,g.UfunnelUchart=ac,g.UgestureUdetector=Kc,g.Uheatmap=tc,g.UimageUcomparison=hc,g.UkeyboardUshortcut=Pl,g.UlistingUform=Mi,g.UlongUpress=Qc,g.UmarkdownUrenderer=Vs,g.UmediaUplaylist=Tc,g.UmetricUcomparison=sc,g.UmorphUtransition=Ul,g.UnestedUdrag=Yc,g.UparallaxUscroll=zl,g.UperformanceUchart=oc,g.UpinchUzoom=Zc,g.UpivotUtable=vi,g.UprofileUheader=Vi,g.UprogressUtracker=dc,g.UradarUchart=Zi,g.UradialUmenu=Rc,g.UresizableUpanels=_n,g.UrevealUonUscroll=_l,g.UsankeyUdiagram=ec,g.UscatterUplot=Qi,g.UschemaUvalidator=Js,g.UscreenUreaderUtext=ro,g.UskipUnavigation=Hl,g.UsortUdropdown=ql,g.UsortableUgrid=Gc,g.UspreadsheetUgrid=ki,g.UstatusUpipeline=ns,g.UsurveyUbuilder=Rs,g.UswipeUactions=Xc,g.UtableUreservation=Ni,g.UtimeUslotUpicker=Ds,g.UtreeUmap=Ri,g.UuserUtable=Ai,g.UversionUbadge=Gl,g.UvideoUcall=kc,g.UvideoUthumbnail=pc,g.UvoiceUrecorder=Sc,g.VStack=mn,g.VideoEditor=vc,g.VideoPlayer=yc,g.VirtualList=Ii,g.VirtualListItem=xd,g.VisuallyHidden=Yl,g.WalletPreloader=qe,g.WaveForm=Cc,g.WebVitalsSection=Fa,g.WysiwygEditor=Ws,g.addLanguageToPath=Dr,g.addResourceHint=kh,g.aiOptimizationPresets=Ug,g.appStorage=Nh,g.autoConnectWalletBrowser=Ah,g.batchDOMUpdates=Wu,g.bundleAnalysis=Le,g.buttonVariants=$t,g.cacheHeaders=ng,g.cacheUtils=J0,g.checkPerformanceBudget=nu,g.clearComponentCache=ug,g.clearConditionalCache=Cg,g.clearPreloadCache=ti,g.clearRenderCounts=qg,g.cn=f,g.conditionalCSS=rg,g.convertFileSize=Lu,g.createAdvancedLazyComponent=ig,g.createAnalyticsEvent=jh,g.createCSSVariables=Du,g.createConditionalImports=lh,g.createConditionalLazyComponent=kg,g.createFeature=Br,g.createLazyComponent=ka,g.createLazyComponentFactory=Gg,g.createLazyRoute=ph,g.createLazyWalletProvider=Xr,g.createLibraryImports=pg,g.createMemoComponent=pd,g.createOptimizedStyles=Pu,g.createProgressiveComponent=mh,g.createSecurityFeatures=Hd,g.createSelectiveExports=ih,g.createSelectiveMemoComponent=vd,g.createSimpleStorage=Eh,g.createTreeShakingConfig=ch,g.createUIComponents=yg,g.cspDirectives=tg,g.cssOptimization=tn,g.deadCodeElimination=Ie,g.default=_h,g.defaultPerformanceBudget=Ia,g.detectAvailableWallets=Kr,g.detectWalletBrowser=sn,g.exportPerformanceData=ou,g.formatBytes=Va,g.formatFileSize=Iu,g.formatMetricValue=yu,g.generateAIMetaTags=Ig,g.generateAIStructuredData=Mg,g.generateCSP=pa,g.generateCSPDirectives=$r,g.generateContentRelationships=Lg,g.generateEntityRecognition=Sa,g.generateImageSEO=Xu,g.generatePerformanceTrackingSchema=Og,g.generatePictureElement=rh,g.generatePlaceholder=oh,g.generateSemanticMarkup=Ca,g.generateSizes=Ju,g.generateSocialImageMeta=Qu,g.generateSrcSet=Zu,g.generateTopicClustering=Ea,g.getConditionalStats=Sg,g.getEnvironmentType=ma,g.getErrorMessage=Oh,g.getLazyLoadingStats=hg,g.getOptimalImageFormat=eh,g.getPageName=Dh,g.getPerformanceMonitor=ur,g.getPreloadingStats=Tg,g.getRenderCounts=Hg,g.getSecurityHeaders=va,g.getUINavigationService=oe,g.getWebVitalRating=xe,g.getWebVitals=Zg,g.hashString=ln,g.hashUserId=Uh,g.initWebVitals=lu,g.initializeAdvancedPreloading=Ag,g.initializePerformanceMonitoring=ru,g.initializePreloading=vg,g.inlineCriticalStyles=$u,g.isAuthError=Lh,g.isForbiddenError=Mh,g.isLocalhost=fa,g.isNetworkAccess=ba,g.isNotFoundError=Ph,g.isPreloaded=ai,g.isRateLimitError=Ih,g.isServerError=Th,g.isWalletBrowser=ha,g.isWebEnvironment=ya,g.lazyLoadQueue=xh,g.lazyWithPreload=bh,g.lazyWithRetry=fh,g.loadCSS=R0,g.loadCriticalCSS=Ou,g.loadNonCriticalCSS=Uu,g.measureAsyncOperation=au,g.measureCLS=La,g.measureFCP=Ma,g.measureFID=Oa,g.measureINP=Da,g.measureImagePerformance=nh,g.measureLCP=Pa,g.measureTTFB=Ua,g.navigationHelper=we,g.optimizeClassNames=Vu,g.optimizeContainment=Bu,g.optimizeFlex=Gu,g.optimizeGrid=qu,g.optimizeWillChange=Fu,g.optimizedFetch=ua,g.parseFileSize=Mu,g.performanceBudget=de,g.performanceUtils=cr,g.prefersReducedMotion=Qa,g.prefetchResource=Jg,g.preloadComponent=mg,g.preloadImage=th,g.preloadResource=Qg,g.preloadRoute=Kg,g.preserveAspectRatio=sh,g.priorityLoader=wh,g.removeLanguageFromPath=zr,g.reportApiCall=cu,g.reportCustomMetric=iu,g.reportRouteChange=za,g.reportWebVitals=Xg,g.routeConfig=xa,g.securityHeaders=ag,g.setupCSPReporting=og,g.setupLazyLoading=Ru,g.setupProgressiveLoading=ah,g.shouldEnableWallet=Q0,g.smartLinkVariants=nr,g.stripLanguagePrefix=cn,g.supportsAVIF=en,g.supportsCSSImports=eg,g.supportsWebP=Ra,g.themeStorage=Ch,g.useApiMetrics=Xa,g.useBanner=hl,g.useBundleMetrics=Wa,g.useClickOutside=rr,g.useCodeLoader=oa,g.useComponentPerformance=Ta,g.useCopyToClipboard=Su,g.useDebugMemo=Vg,g.useDraggable=Za,g.useDynamicImport=vh,g.useErrorRecovery=fd,g.useFormSubmission=Nu,g.useFormValidation=Tu,g.useImageLazyLoading=Yg,g.useLayout=ue,g.useLazyLoad=an,g.useLazyStyles=Hu,g.useLocalizedNavigate=Ld,g.useLocation=uh,g.useMediaQuery=Yu,g.useMemoryLeakDetection=Rg,g.useMultipleCopyToClipboard=Eu,g.useNavigation=gh,g.useOptimizedTheme=Ku,g.useOptimizedWallets=jg,g.usePerformanceMark=Fg,g.useReducedMotion=_u,g.useRenderCount=$g,g.useResponsiveStyles=ju,g.useRoutePerformance=Au,g.useSearchParams=hh,g.useSmartLinks=Jl,g.useStableCallback=Wg,g.useTheme=zd,g.useToast=Co,g.useToggle=Cu,g.useTopbar=Wr,g.useWebVitals=Ba,g.utils=rn,g.walletStorage=Sh,g.web3SecurityNotes=sg,g.withLazyErrorBoundary=ud,g.withPerformanceTracking=tu,g.withRetry=X0,Object.defineProperties(g,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})}));
74
+ `;return`data:image/svg+xml;base64,${btoa(n)}`},lh=(e,r)=>{const a=1/r*100;e.style.position="relative",e.style.paddingTop=`${a}%`;const n=e.querySelector("img");n&&(n.style.position="absolute",n.style.top="0",n.style.left="0",n.style.width="100%",n.style.height="100%",n.style.objectFit="cover")},Ie={createPureFunction:e=>e,isDevelopment:process.env.NODE_ENV==="development",isProduction:process.env.NODE_ENV==="production",isTest:process.env.NODE_ENV==="test",createFeatureFlags:(e={})=>({enableAnalytics:process.env.VITE_ENABLE_ANALYTICS==="true",enableDebugTools:process.env.NODE_ENV==="development",enablePerformanceMonitoring:process.env.VITE_ENABLE_PERF_MONITORING!=="false",...e})},ih=e=>{const r={};return Object.entries(e).forEach(([a,n])=>{r[a]=()=>{try{return n()}catch{return Promise.resolve({default:null})}}}),r},rn={createDebounce:e=>r=>{let a;return((...n)=>{clearTimeout(a),a=setTimeout(()=>r(...n),e)})},memoize:e=>{const r=new Map;return((...a)=>{const n=JSON.stringify(a);if(r.has(n))return r.get(n);const o=e(...a);return r.set(n,o),o})},isDeepEqual:(e,r)=>{if(e===r)return!0;if(e==null||r==null||typeof e!="object"||typeof r!="object")return!1;const a=Object.keys(e),n=Object.keys(r);if(a.length!==n.length)return!1;for(const o of a)if(!n.includes(o)||!rn.isDeepEqual(e[o],r[o]))return!1;return!0},createThrottle:e=>r=>{let a=0;return((...n)=>{const o=Date.now();if(o-a>=e)return a=o,r(...n)})}},ch=e=>{const r={};return Object.entries(e).forEach(([a,n])=>{r[a]={},Object.entries(n).forEach(([o,s])=>{r[a][o]=()=>import(s).then(l=>({[o]:l[o]}))})}),r},Le={getModuleSize:e=>new Promise(r=>{if(typeof window<"u"&&"performance"in window){const n=performance.getEntriesByType("resource").find(o=>o.name.includes(e));r(n?.transferSize||0)}else r(0)}),usageTracker:new Set,trackUsage:e=>{Ie.isDevelopment&&Le.usageTracker.add(e)},getUsageReport:()=>Ie.isDevelopment?Array.from(Le.usageTracker).sort():[],estimateImpact:e=>{const r=e.map(a=>Le.getModuleSize(a).then(n=>[a,n]));return Promise.all(r).then(a=>{const n={};let o=0;return a.forEach(([s,l])=>{n[s]=l,o+=l}),{total:o,modules:n}})}},tn={inlineCriticalCSS:e=>{if(typeof document<"u"){const r=document.createElement("style");r.textContent=e,document.head.appendChild(r)}},loadAsyncCSS:e=>{if(typeof document<"u"){const r=document.createElement("link");r.rel="stylesheet",r.href=e,r.media="print",r.onload=()=>{r.media="all"},document.head.appendChild(r)}},removeUnusedCSS:e=>{if(typeof document>"u")return;const r=new Set;return e.forEach(a=>{try{document.querySelector(a)&&r.add(a)}catch{}}),{used:Array.from(r),unused:e.filter(a=>!r.has(a))}}},dh=(e={})=>{const{features:r={},criticalCSS:a="",enableUsageTracking:n=Ie.isDevelopment}=e;return{features:Ie.createFeatureFlags(r),initialize:()=>{a&&typeof document<"u"&&tn.inlineCriticalCSS(a)},cleanup:()=>{Le.usageTracker.clear()},getReport:()=>({usage:Le.getUsageReport(),features:Ie.createFeatureFlags(r)})}};let Zr;function gh(e){throw typeof window<"u"?new Error("Web navigation service not implemented in shared library"):new Error("React Native navigation service not implemented in shared library")}function oe(e){return Zr||(Zr=gh()),Zr}function uh(){const e=oe(),r=e.getCurrentState();return{navigate:(a,n)=>{e.navigate(a,n)},goBack:a=>{e.goBack(a)},replace:(a,n)=>{e.replace(a,n)},currentPath:r.currentPath,searchParams:r.searchParams,params:r.params,canGoBack:e.canGoBack(),isSupported:e.isSupported()}}function hh(){const r=oe().getCurrentState(),a=Object.keys(r.searchParams).length>0?"?"+new URLSearchParams(r.searchParams).toString():"";return{pathname:r.currentPath,search:a,searchParams:r.searchParams,hash:"",state:{},key:r.currentPath}}function fh(){const e=oe(),r=e.getCurrentState();return[new URLSearchParams(r.searchParams),o=>{const s=o instanceof URLSearchParams?Object.fromEntries(o.entries()):o,l=new URLSearchParams(s).toString(),c=r.currentPath+(l?`?${l}`:"");e.replace(c)}]}const we={navigate:(e,r)=>{oe().navigate(e,r)},goBack:e=>{oe().goBack(e)},replace:(e,r)=>{oe().replace(e,r)},getCurrentPath:()=>oe().getCurrentPath(),getSearchParams:()=>oe().getSearchParams(),goToMail:()=>{we.navigate("/mail")},goToPreferences:()=>{we.navigate("/preferences")},goToCompose:(e,r)=>{const a=new URLSearchParams;e&&a.set("type",e),r&&Object.entries(r).forEach(([o,s])=>{a.set(o,s)});const n=a.toString();we.navigate(`/mail/compose${n?`?${n}`:""}`)},goToConnect:()=>{we.navigate("/connect")},goToDelegate:()=>{we.navigate("/admin/delegate")},goToHome:()=>{we.navigate("/")},canGoBack:()=>oe().canGoBack()};function bh(e,r=3,a=1e3){return p.lazy(()=>new Promise((n,o)=>{const s=l=>{e().then(n).catch(c=>{l>0?setTimeout(()=>{s(l-1)},a):o(c)})};s(r)}))}function mh(e){let r=null;const a=()=>(r||(r=e()),r.then(()=>{}));return{Component:p.lazy(()=>r||e()),preload:a}}function yh(e,r={}){const{fallback:a=t.jsx("div",{children:"Loading..."}),errorFallback:n=t.jsx("div",{children:"Failed to load component"}),loadingDelay:o=200,minimumLoadingTime:s=500}=r,l=p.lazy(async()=>{const d=Date.now();try{const i=await e(),h=Date.now()-d;return h<s&&await new Promise(u=>setTimeout(u,s-h)),i}catch{return{default:(()=>n)}}}),c=()=>{const[d,i]=p.useState(!1);return p.useEffect(()=>{const h=setTimeout(()=>{i(!0)},o);return()=>clearTimeout(h)},[]),d?t.jsx(t.Fragment,{children:a}):null};return p.forwardRef((d,i)=>t.jsx(p.Suspense,{fallback:t.jsx(c,{}),children:t.jsx(l,{...d,ref:i})}))}function an(e,r={}){const[a,n]=p.useState(!1),[o,s]=p.useState(!1);return p.useEffect(()=>{const l=e.current;if(!l||o)return;const c=new IntersectionObserver(([d])=>{d.isIntersecting&&(n(!0),s(!0),c.disconnect())},{rootMargin:"50px",threshold:.01,...r});return c.observe(l),()=>{c.disconnect()}},[e,r,o]),a}const ph=({children:e,fallback:r=t.jsx("div",{children:"Loading..."}),threshold:a=.01,rootMargin:n="50px",placeholder:o})=>{const s=p.useRef(null),l=an(s,{threshold:a,rootMargin:n});return t.jsx("div",{ref:s,children:l?e:o||r})};function vh(e){const{importFn:r,preloadOnHover:a=!0,preloadOnFocus:n=!0,prefetchDelay:o=50}=e;let s=null,l=null;const c=()=>(l||(l=r()),l),d=()=>{s&&clearTimeout(s),s=setTimeout(()=>{c()},o)};return{Component:p.lazy(()=>l||r()),preload:c,linkProps:{...a&&{onMouseEnter:d,onMouseLeave:()=>{s&&clearTimeout(s)}},...n&&{onFocus:d}}}}function kh(e,r=[]){const[a,n]=p.useState(null),[o,s]=p.useState(!0),[l,c]=p.useState(null);return p.useEffect(()=>{let d=!0;return s(!0),c(null),e().then(i=>{d&&(n(i),s(!1))}).catch(i=>{d&&(c(i),s(!1))}),()=>{d=!1}},[e,...r]),{module:a,loading:o,error:l}}class nn{constructor(r=3,a=100){this.queue=new Set,this.isProcessing=!1,this.batchSize=r,this.delay=a}add(r){this.queue.add(r),this.process()}async process(){if(this.isProcessing||this.queue.size===0)return;this.isProcessing=!0;const r=Array.from(this.queue).slice(0,this.batchSize);r.forEach(a=>this.queue.delete(a)),await Promise.all(r.map(a=>a().catch(()=>{}))),this.queue.size>0&&await new Promise(a=>setTimeout(a,this.delay)),this.isProcessing=!1,this.queue.size>0&&this.process()}}function xh(e,r,a){if(typeof document>"u")return;const n=document.createElement("link");n.rel=r,n.href=e,a&&(r==="preload"||r==="prefetch")&&(n.as=a),document.head.appendChild(n)}var Jr=(e=>(e[e.HIGH=0]="HIGH",e[e.MEDIUM=1]="MEDIUM",e[e.LOW=2]="LOW",e[e.IDLE=3]="IDLE",e))(Jr||{});class on{constructor(){this.queues=new Map,this.isProcessing=!1,Object.values(Jr).filter(r=>typeof r=="number").forEach(r=>{this.queues.set(r,[])})}load(r,a=1){const n=this.queues.get(a);n&&n.push(r),this.process()}async process(){if(!this.isProcessing){this.isProcessing=!0;for(const[r,a]of this.queues)for(;a.length>0;){const n=a.shift();if(n)try{await n()}catch{}r>=2&&await new Promise(o=>setTimeout(o,50))}this.isProcessing=!1}}}const wh=new nn,Nh=new on;class Qr{constructor(r={}){this.prefix=r.prefix||"mailbox",this.defaultTTL=r.ttl,this.platformStorage=r.platformStorage||this.createFallbackStorage()}createFallbackStorage(){const r=new Map;return{getItem:a=>r.get(a)||null,setItem:(a,n)=>{r.set(a,n)},removeItem:a=>{r.delete(a)},clear:()=>{r.clear()},getAllKeys:()=>Array.from(r.keys())}}getKey(r){return`${this.prefix}-${r}`}isExpired(r){return r.ttl?Date.now()-r.timestamp>r.ttl:!1}set(r,a,n){try{const o={value:a,timestamp:Date.now(),ttl:n||this.defaultTTL};this.platformStorage.setItem(this.getKey(r),JSON.stringify(o))}catch{}}get(r,a){try{const n=this.platformStorage.getItem(this.getKey(r));if(!n)return a;const o=JSON.parse(n);return this.isExpired(o)?(this.remove(r),a):o.value}catch{return a}}remove(r){try{this.platformStorage.removeItem(this.getKey(r))}catch{}}clear(r){try{if(this.platformStorage.getAllKeys){const a=this.platformStorage.getAllKeys(),n=this.getKey(r||""),o=a.filter(s=>s.startsWith(n));for(const s of o)this.platformStorage.removeItem(s)}else this.platformStorage.clear?.()}catch(a){console.error("Failed to clear storage:",a)}}has(r){try{return this.platformStorage.getItem(this.getKey(r))!==null}catch(a){return console.error(`Failed to check item ${r}:`,a),!1}}getAllKeys(){try{if(this.platformStorage.getAllKeys){const r=this.platformStorage.getAllKeys(),a=`${this.prefix}-`;return r.filter(n=>n.startsWith(a)).map(n=>n.substring(a.length))}return[]}catch(r){return console.error("Failed to get all keys:",r),[]}}}const Ch=new Qr,Sh=new Qr({prefix:"mailbox-theme"}),Eh=new Qr({prefix:"walletUser",ttl:10080*60*1e3}),Ah=e=>{if(!e)throw new Error("PlatformStorage must be provided to createSimpleStorage");return{setItem:(r,a)=>{try{e.setItem(r,a)}catch{}},getItem:r=>{try{return e.getItem(r)}catch{return null}},removeItem:r=>{try{e.removeItem(r)}catch{}}}};function sn(){const e={isWalletBrowser:!1,walletType:"unknown",hasEthereum:!1,hasSolana:!1,provider:null};if(typeof window>"u")return e;try{const r=navigator.userAgent.toLowerCase();let a="unknown",n=!1;r.includes("metamask")?(a="metamask",n=!0):r.includes("trustwallet")?(a="trustwallet",n=!0):r.includes("coinbase")?(a="coinbase",n=!0):r.includes("rainbow")?(a="rainbow",n=!0):r.includes("phantom")?(a="phantom",n=!0):r.includes("solflare")?(a="solflare",n=!0):r.includes("exodus")&&(a="exodus",n=!0);const o=!!window.ethereum,s=!!window.solana||!!window.phantom?.solana;(o||s)&&!n&&(n=!0,window.ethereum?.isMetaMask?a="metamask":window.ethereum?.isCoinbaseWallet?a="coinbase":window.ethereum?.isRainbow?a="rainbow":window.phantom?a="phantom":window.solflare&&(a="solflare"));const l=o?window.ethereum:s?window.solana||window.phantom?.solana:null;return{isWalletBrowser:n,walletType:a,hasEthereum:o,hasSolana:s,provider:l}}catch{return e}}async function Th(){const e=sn();if(!e.isWalletBrowser)return{success:!1,error:"Not running in a wallet browser"};try{if(e.hasEthereum&&e.provider)try{const r=await e.provider.request({method:"eth_requestAccounts"});if(r&&r.length>0)return{success:!0,address:r[0]}}catch{}if(e.hasSolana&&e.provider)try{const r=await e.provider.connect();if(r.publicKey)return{success:!0,address:r.publicKey.toString()}}catch{}return{success:!1,error:"Failed to connect to wallet provider"}}catch(r){return{success:!1,error:r instanceof Error?r.message:"Unknown connection error"}}}function Ih(e){if(!e)return!1;if(e instanceof Error){const r=e.message.toLowerCase();if(r.includes("network")||r.includes("fetch")||r.includes("failed to fetch")||r.includes("connection")||r.includes("timeout")||r.includes("net::err"))return!0}if(typeof e=="string"){const r=e.toLowerCase();if(r.includes("network")||r.includes("fetch")||r.includes("failed to fetch")||r.includes("connection")||r.includes("timeout")||r.includes("server error")||r.includes("500")||r.includes("502")||r.includes("503")||r.includes("504"))return!0}if(typeof e=="object"&&e!==null&&"status"in e){const r=e.status;if(typeof r=="number"&&r>=500&&r<600)return!0}return!1}function Lh(e){if(!e)return!1;if(typeof e=="string"){const r=e.toLowerCase();return r.includes("429")||r.includes("rate limit")||r.includes("too many requests")||r.includes("rate_limit")}if(e instanceof Error){const r=e.message.toLowerCase();return r.includes("429")||r.includes("rate limit")||r.includes("too many requests")||r.includes("rate_limit")}return typeof e=="object"&&e!==null&&"status"in e?e.status===429:!1}function Mh(e){if(!e)return!1;if(typeof e=="string"){const r=e.toLowerCase();return r.includes("401")||r.includes("unauthorized")||r.includes("unauthenticated")}if(e instanceof Error){const r=e.message.toLowerCase();return r.includes("401")||r.includes("unauthorized")||r.includes("unauthenticated")}return typeof e=="object"&&e!==null&&"status"in e?e.status===401:!1}function Ph(e){if(!e)return!1;if(typeof e=="string"){const r=e.toLowerCase();return r.includes("403")||r.includes("forbidden")}if(e instanceof Error){const r=e.message.toLowerCase();return r.includes("403")||r.includes("forbidden")}return typeof e=="object"&&e!==null&&"status"in e?e.status===403:!1}function Oh(e){if(!e)return!1;if(typeof e=="string"){const r=e.toLowerCase();return r.includes("404")||r.includes("not found")}if(e instanceof Error){const r=e.message.toLowerCase();return r.includes("404")||r.includes("not found")}return typeof e=="object"&&e!==null&&"status"in e?e.status===404:!1}function Uh(e,r="An unexpected error occurred"){return e?typeof e=="string"?e:e instanceof Error||typeof e=="object"&&e!==null&&"message"in e&&typeof e.message=="string"?e.message:r:r}async function ln(e){const a=new TextEncoder().encode(e.toLowerCase()),n=await crypto.subtle.digest("SHA-256",a);return Array.from(new Uint8Array(n)).map(s=>s.toString(16).padStart(2,"0")).join("")}const Dh=ln;function cn(e){return e.replace(/^\/[a-z]{2}(-[a-z]+)?(?=\/|$)/,"")}function zh(e,r){const a=cn(e);return r?.[a]?r[a]:a.replace(/\//g,"_").replace(/^_/,"")||"home"}const jh={USER_LOGIN:"login",USER_LOGOUT:"logout",USER_SIGNUP:"sign_up",PAGE_VIEW:"page_view",BUTTON_CLICK:"button_click",LINK_CLICK:"link_click",ERROR_OCCURRED:"error_occurred",ERROR_API_CALL:"error_api_call",SCROLL_DEPTH:"scroll_depth",TIME_ON_PAGE:"time_on_page",FORM_SUBMIT:"form_submit",SEARCH:"search"};function _h(e,r){return{event:e,parameters:{...r,timestamp:r?.timestamp??Date.now()}}}const Bh={utils:{cn:f}};Object.defineProperty(g,"ArrowLeftIcon",{enumerable:!0,get:()=>P.ArrowLeftIcon}),Object.defineProperty(g,"ArrowRightIcon",{enumerable:!0,get:()=>P.ArrowRightIcon}),Object.defineProperty(g,"Bars3Icon",{enumerable:!0,get:()=>P.Bars3Icon}),Object.defineProperty(g,"BellIcon",{enumerable:!0,get:()=>P.BellIcon}),Object.defineProperty(g,"BellSlashIcon",{enumerable:!0,get:()=>P.BellSlashIcon}),Object.defineProperty(g,"ChartBarIcon",{enumerable:!0,get:()=>P.ChartBarIcon}),Object.defineProperty(g,"CheckCircleIcon",{enumerable:!0,get:()=>P.CheckCircleIcon}),Object.defineProperty(g,"CheckIcon",{enumerable:!0,get:()=>P.CheckIcon}),Object.defineProperty(g,"ChevronDownIcon",{enumerable:!0,get:()=>P.ChevronDownIcon}),Object.defineProperty(g,"ChevronLeftIcon",{enumerable:!0,get:()=>P.ChevronLeftIcon}),Object.defineProperty(g,"ChevronRightIcon",{enumerable:!0,get:()=>P.ChevronRightIcon}),Object.defineProperty(g,"ChevronUpIcon",{enumerable:!0,get:()=>P.ChevronUpIcon}),Object.defineProperty(g,"ClockIcon",{enumerable:!0,get:()=>P.ClockIcon}),Object.defineProperty(g,"CodeBracketIcon",{enumerable:!0,get:()=>P.CodeBracketIcon}),Object.defineProperty(g,"Cog6ToothIcon",{enumerable:!0,get:()=>P.Cog6ToothIcon}),Object.defineProperty(g,"CreditCardIcon",{enumerable:!0,get:()=>P.CreditCardIcon}),Object.defineProperty(g,"DocumentTextIcon",{enumerable:!0,get:()=>P.DocumentTextIcon}),Object.defineProperty(g,"EnvelopeIcon",{enumerable:!0,get:()=>P.EnvelopeIcon}),Object.defineProperty(g,"ExclamationTriangleIcon",{enumerable:!0,get:()=>P.ExclamationTriangleIcon}),Object.defineProperty(g,"EyeSlashIcon",{enumerable:!0,get:()=>P.EyeSlashIcon}),Object.defineProperty(g,"GlobeAltIcon",{enumerable:!0,get:()=>P.GlobeAltIcon}),Object.defineProperty(g,"HomeIcon",{enumerable:!0,get:()=>P.HomeIcon}),Object.defineProperty(g,"InboxIcon",{enumerable:!0,get:()=>P.InboxIcon}),Object.defineProperty(g,"InformationCircleIcon",{enumerable:!0,get:()=>P.InformationCircleIcon}),Object.defineProperty(g,"KeyIcon",{enumerable:!0,get:()=>P.KeyIcon}),Object.defineProperty(g,"MegaphoneIcon",{enumerable:!0,get:()=>P.MegaphoneIcon}),Object.defineProperty(g,"MinusIcon",{enumerable:!0,get:()=>P.MinusIcon}),Object.defineProperty(g,"PaperAirplaneIcon",{enumerable:!0,get:()=>P.PaperAirplaneIcon}),Object.defineProperty(g,"PaperClipIcon",{enumerable:!0,get:()=>P.PaperClipIcon}),Object.defineProperty(g,"PlusIcon",{enumerable:!0,get:()=>P.PlusIcon}),Object.defineProperty(g,"RocketLaunchIcon",{enumerable:!0,get:()=>P.RocketLaunchIcon}),Object.defineProperty(g,"ShieldCheckIcon",{enumerable:!0,get:()=>P.ShieldCheckIcon}),Object.defineProperty(g,"SparklesIcon",{enumerable:!0,get:()=>P.SparklesIcon}),Object.defineProperty(g,"StarIcon",{enumerable:!0,get:()=>P.StarIcon}),Object.defineProperty(g,"TrashIcon",{enumerable:!0,get:()=>P.TrashIcon}),Object.defineProperty(g,"UserGroupIcon",{enumerable:!0,get:()=>P.UserGroupIcon}),Object.defineProperty(g,"XMarkIcon",{enumerable:!0,get:()=>P.XMarkIcon}),Object.defineProperty(g,"CheckCircleIconSolid",{enumerable:!0,get:()=>he.CheckCircleIcon}),Object.defineProperty(g,"CheckIconSolid",{enumerable:!0,get:()=>he.CheckIcon}),Object.defineProperty(g,"ExclamationTriangleIconSolid",{enumerable:!0,get:()=>he.ExclamationTriangleIcon}),Object.defineProperty(g,"StarIconSolid",{enumerable:!0,get:()=>he.StarIcon}),g.ActionBanner=bo,g.ActionButton=Ps,g.AddressLink=al,g.Alert=mr,g.AlertBanner=ho,g.AlertDescription=uo,g.AlertTitle=go,g.AnimatedSection=ar,g.ApiSection=Ha,g.AreaChart=Xi,g.AspectFitView=p0,g.AspectRatio=Sn,g.AudioPlayer=wc,g.Avatar=Fi,g.Backdrop=dl,g.Badge=To,g.Banner=ul,g.BarChart=Gi,g.BatchRender=Sd,g.Blockquote=Rn,g.BodyText=Yn,g.BorderAccent=Un,g.Box=at,g.Breadcrumb=ea,g.BreadcrumbNav=si,g.BreadcrumbSection=td,g.BundleSection=$a,g.BurndownChart=nc,g.Button=ne,g.CACHE_CONFIGS=ga,g.CTASection=qd,g.Calendar=Ht,g.CalloutBox=_i,g.CancellableRequest=J0,g.Card=Lr,g.CardContent=Di,g.CardFooter=zi,g.CardHeader=Ui,g.Center=pn,g.ChainBadge=rs,g.Checkbox=us,g.Code=Zn,g.CodeBlock=ad,g.CodeDisplay=Jn,g.CollapsibleDocumentationTopic=od,g.ColorPicker=zs,g.ColorPickerAdvanced=js,g.ColorSwatch=_s,g.Combobox=ms,g.Command=fl,g.CommonAnalyticsEvents=jh,g.ComponentPreloader=Gr,g.ConditionalRender=wd,g.Confetti=Zl,g.ConfirmationDialog=Vc,g.Container=fn,g.ContentContainer=e0,g.CreditCardInput=Hs,g.CriticalPathOptimizer=Fg,g.CurrencyInput=qs,g.CustomSection=Ka,g.DashboardStatCard=Bi,g.DataSkeleton=yo,g.DataTable=yi,g.DateInput=is,g.DateRangePicker=Us,g.DateTimePicker=Os,g.DetailErrorState=Dd,g.Dialog=Yt,g.Divider=Pn,g.DragDrop=Hc,g.Drawer=Pc,g.Dropdown=ps,g.EditableSelector=ys,g.EmptyState=Qt,g.ErrorBoundary=gd,g.ExpensiveComponent=kd,g.ExternalLink=ri,g.FadeInScale=il,g.FadeInUp=ll,g.FeatureBlock=kl,g.FeatureCard=_d,g.FeatureGrid=$d,g.FileInput=ws,g.Flex=hn,g.FloatingElement=cl,g.FloatingPanel=Dn,g.FocusTrap=Oc,g.FontSize=jr,g.Footer=t0,g.FooterBottom=l0,g.FooterBottomRow=i0,g.FooterBrand=n0,g.FooterCompact=c0,g.FooterCompactLeft=d0,g.FooterCompactRight=g0,g.FooterCopyright=h0,g.FooterGrid=a0,g.FooterLink=s0,g.FooterLinkSection=o0,g.FooterSocialLinks=f0,g.FooterVersion=u0,g.FormAlerts=Ls,g.FormField=Es,g.FormFieldGroup=tr,g.FormSection=pl,g.FormattedNumber=ao,g.FullPageSpinner=mo,g.Gauge=lc,g.GlobalLazyErrorBoundary=bd,g.GradientIconContainer=wl,g.Grid=bn,g.HStack=yn,g.Heading=Wn,g.HelperText=eo,g.HoverCard=$c,g.IconContainer=Tl,g.IconText=Il,g.Image=gc,g.ImageCropper=fc,g.ImageGallery=uc,g.InfiniteScroll=Uc,g.InfoBox=Ml,g.InfoCard=ji,g.Input=Je,g.ItemList=Ll,g.KYCLevelCard=Jd,g.KYCStatusBadge=Kd,g.Kbd=Qn,g.KeyValuePair=$i,g.Label=Tr,g.LanguageSelector=cd,g.LanguageValidator=Id,g.LayoutContext=Ur,g.LayoutProvider=na,g.LazyComponent=Nd,g.LazyErrorBoundary=sr,g.LazyImage=ug,g.LazyLoadQueue=nn,g.LazyWalletButton=Bg,g.LazyWrapper=ph,g.Lightbox=bc,g.LineChart=Yi,g.Link=ei,g.List=Ci,g.ListItem=Si,g.ListItemWithAction=Ei,g.LiveStream=xc,g.LoadPriority=Jr,g.LoadingDots=so,g.LoadingOptimizer=H0,g.LoadingOverlay=oo,g.LoadingState=lo,g.LocalizedLink=Td,g.Logo=Ol,g.Masonry=Fn,g.MasterDetailLayout=m0,g.MasterListItem=b0,g.MediaUploader=Ac,g.MemorySection=Ya,g.MentionInput=Cs,g.MetricRow=H,g.Modal=Mr,g.ModalContent=Pr,g.ModalFooter=Or,g.ModalHeader=Mc,g.MultiSelect=bs,g.NavigationList=ii,g.NavigationMenu=li,g.NetworkErrorBoundary=hd,g.NoContent=qi,g.NotificationBadge=Eo,g.NotificationPanel=Ao,g.NumberInput=ss,g.OptimizedAPIClient=X0,g.OptimizedImage=Ed,g.OptimizedRoutePreloader=q0,g.Overlay=Ze,g.PageContainer=Cn,g.PageHeader=Rd,g.PageSectionHeader=Dl,g.PageTitle=$n,g.Pagination=di,g.PaginationNav=gi,g.PanelHeader=ja,g.PerformanceBoundary=Cd,g.PerformanceOptimizer=$0,g.PerformancePanel=Nu,g.PhoneDirectory=Ms,g.PhoneInput=gs,g.PieChart=Ki,g.PlatformSpecificComponents=Ng,g.PlaylistManager=Ic,g.PodcastPlayer=Ec,g.Popover=Dc,g.Portal=be,g.PreloadLink=oi,g.PriorityLoader=on,g.Progress=ic,g.ProgressCircle=cc,g.PromotionalBanner=sd,g.ProtectedRoute=Pd,g.PullToRefresh=ed,g.QRCodeDisplay=Lc,g.QuickActions=jl,g.QuizBuilder=el,g.RadioGroup=hs,g.RelativeTime=no,g.Resizable=jn,g.RetinaImage=mc,g.RouteBasedLazyLoader=qr,g.SafeAppWrapper=md,g.ScoreIndicator=mu,g.ScoreLegend=_a,g.ScreenContainer=y0,g.ScrollArea=Bn,g.ScrollSpy=zc,g.SearchInput=ls,g.Section=wn,g.SectionBadge=Fl,g.SectionHeader=Wl,g.SectionTitle=qn,g.SecurityProvider=yd,g.Select=Cr,g.SelectContent=Re,g.SelectField=Is,g.SelectGroup=fs,g.SelectItem=er,g.SelectLabel=Ft,g.SelectScrollDownButton=Er,g.SelectScrollUpButton=Sr,g.SelectSeparator=Wt,g.SelectTrigger=Qe,g.SelectValue=Bt,g.Separator=On,g.SettingsList=$l,g.Sheet=jc,g.SideNav=ci,g.SignaturePad=Bs,g.SignatureRequest=Fs,g.SkeletonLoader=io,g.Slider=ks,g.SliderInput=xs,g.SmartContent=Rl,g.SmartLink=Ir,g.SmartWalletProviders=jg,g.Spacer=vn,g.Sparkline=rc,g.Spinner=Ce,g.SplitPane=zn,g.Stack=br,g.StandardPageLayout=Qd,g.StatCard=ml,g.StatDisplay=Hi,g.StatusBadge=es,g.StatusIndicator=as,g.StepList=dd,g.Stepper=ui,g.StepperNav=hi,g.SubscriptionGatedComponents=wg,g.SumsubWebSDK=Xd,g.Switch=_t,g.Table=mi,g.TableOfContents=bi,g.Tabs=Kt,g.TabsContent=Jt,g.TabsList=Xt,g.TabsTrigger=Zt,g.TagInput=Ns,g.Text=nt,g.TextArea=os,g.TextAreaField=Ts,g.TextField=As,g.TextInputModal=_c,g.TextLink=Xn,g.Theme=re,g.ThemeContext=_r,g.ThemeProvider=jd,g.TimePicker=jt,g.TimerDisplay=Kl,g.Toast=ot,g.ToastContainer=No,g.ToastContext=yr,g.ToastNotification=So,g.ToastProvider=vo,g.ToggleGroup=vs,g.Tooltip=Rt,g.Topbar=x0,g.TopbarActions=j0,g.TopbarCenter=N0,g.TopbarContext=Fr,g.TopbarDivider=E0,g.TopbarIconButton=F0,g.TopbarLeft=w0,g.TopbarLogo=T0,g.TopbarMenuToggle=ca,g.TopbarMobileContent=S0,g.TopbarMobileNav=O0,g.TopbarNav=da,g.TopbarNavigation=U0,g.TopbarProvider=la,g.TopbarRight=C0,g.TopbarSearch=V0,g.TrackedButton=ld,g.TrackedLink=id,g.TransferList=Ti,g.TreeView=Li,g.TruncatedText=to,g.UaudioUwaveform=Nc,g.UavatarUgroup=Wi,g.UbadgeUdesigner=Io,g.UbubbleUchart=Ji,g.UcellUeditor=wi,g.UcodeUhighlighter=$s,g.UcolumnUresize=xi,g.UcurrencyUconverter=Gs,g.UcurrencyUrates=Ys,g.UdataUgrid=pi,g.UdoubleUtap=Jc,g.UdragUdropUlist=qc,g.UfieldUmapper=Qs,g.UfocusUindicator=xl,g.UformUbuilder=Ks,g.UformUtemplate=Zs,g.UformUvalidator=Xs,g.UfunnelUchart=ac,g.UgestureUdetector=Kc,g.Uheatmap=tc,g.UimageUcomparison=hc,g.UkeyboardUshortcut=Pl,g.UlistingUform=Mi,g.UlongUpress=Qc,g.UmarkdownUrenderer=Vs,g.UmediaUplaylist=Tc,g.UmetricUcomparison=sc,g.UmorphUtransition=Ul,g.UnestedUdrag=Yc,g.UparallaxUscroll=zl,g.UperformanceUchart=oc,g.UpinchUzoom=Zc,g.UpivotUtable=vi,g.UprofileUheader=Vi,g.UprogressUtracker=dc,g.UradarUchart=Zi,g.UradialUmenu=Rc,g.UresizableUpanels=_n,g.UrevealUonUscroll=_l,g.UsankeyUdiagram=ec,g.UscatterUplot=Qi,g.UschemaUvalidator=Js,g.UscreenUreaderUtext=ro,g.UskipUnavigation=Hl,g.UsortUdropdown=ql,g.UsortableUgrid=Gc,g.UspreadsheetUgrid=ki,g.UstatusUpipeline=ns,g.UsurveyUbuilder=Rs,g.UswipeUactions=Xc,g.UtableUreservation=Ni,g.UtimeUslotUpicker=Ds,g.UtreeUmap=Ri,g.UuserUtable=Ai,g.UversionUbadge=Gl,g.UvideoUcall=kc,g.UvideoUthumbnail=pc,g.UvoiceUrecorder=Sc,g.VStack=mn,g.VideoEditor=vc,g.VideoPlayer=yc,g.VirtualList=Ii,g.VirtualListItem=xd,g.VisuallyHidden=Yl,g.WalletPreloader=qe,g.WaveForm=Cc,g.WebVitalsSection=Fa,g.WysiwygEditor=Ws,g.addLanguageToPath=Dr,g.addResourceHint=xh,g.aiOptimizationPresets=Dg,g.appStorage=Ch,g.autoConnectWalletBrowser=Th,g.batchDOMUpdates=Vu,g.bundleAnalysis=Le,g.buttonVariants=$t,g.cacheHeaders=og,g.cacheUtils=Q0,g.checkPerformanceBudget=ou,g.clearComponentCache=hg,g.clearConditionalCache=Sg,g.clearPreloadCache=ti,g.clearRenderCounts=Gg,g.cn=f,g.conditionalCSS=tg,g.convertFileSize=Mu,g.createAdvancedLazyComponent=cg,g.createAnalyticsEvent=_h,g.createCSSVariables=zu,g.createConditionalImports=ih,g.createConditionalLazyComponent=xg,g.createFeature=Br,g.createLazyComponent=ka,g.createLazyComponentFactory=Yg,g.createLazyRoute=vh,g.createLazyWalletProvider=Xr,g.createLibraryImports=vg,g.createMemoComponent=pd,g.createOptimizedStyles=Ou,g.createProgressiveComponent=yh,g.createSecurityFeatures=Hd,g.createSelectiveExports=ch,g.createSelectiveMemoComponent=vd,g.createSimpleStorage=Ah,g.createTreeShakingConfig=dh,g.createUIComponents=pg,g.cspDirectives=ag,g.cssOptimization=tn,g.deadCodeElimination=Ie,g.default=Bh,g.defaultPerformanceBudget=Ia,g.detectAvailableWallets=Kr,g.detectWalletBrowser=sn,g.exportPerformanceData=su,g.formatBytes=Va,g.formatFileSize=Lu,g.formatMetricValue=pu,g.generateAIMetaTags=Lg,g.generateAIStructuredData=Pg,g.generateCSP=pa,g.generateCSPDirectives=$r,g.generateContentRelationships=Mg,g.generateEntityRecognition=Sa,g.generateImageSEO=Zu,g.generatePerformanceTrackingSchema=Ug,g.generatePictureElement=th,g.generatePlaceholder=sh,g.generateSemanticMarkup=Ca,g.generateSizes=Qu,g.generateSocialImageMeta=Ru,g.generateSrcSet=Ju,g.generateTopicClustering=Ea,g.getConditionalStats=Eg,g.getEnvironmentType=ma,g.getErrorMessage=Uh,g.getLazyLoadingStats=fg,g.getOptimalImageFormat=rh,g.getPageName=zh,g.getPerformanceMonitor=ur,g.getPreloadingStats=Ig,g.getRenderCounts=qg,g.getSecurityHeaders=va,g.getUINavigationService=oe,g.getWebVitalRating=xe,g.getWebVitals=Jg,g.hashString=ln,g.hashUserId=Dh,g.initWebVitals=iu,g.initializeAdvancedPreloading=Tg,g.initializePerformanceMonitoring=tu,g.initializePreloading=kg,g.inlineCriticalStyles=Hu,g.isAuthError=Mh,g.isForbiddenError=Ph,g.isLocalhost=fa,g.isNetworkAccess=ba,g.isNotFoundError=Oh,g.isPreloaded=ai,g.isRateLimitError=Lh,g.isServerError=Ih,g.isWalletBrowser=ha,g.isWebEnvironment=ya,g.lazyLoadQueue=wh,g.lazyWithPreload=mh,g.lazyWithRetry=bh,g.loadCSS=eg,g.loadCriticalCSS=Uu,g.loadNonCriticalCSS=Du,g.measureAsyncOperation=nu,g.measureCLS=La,g.measureFCP=Ma,g.measureFID=Oa,g.measureINP=Da,g.measureImagePerformance=oh,g.measureLCP=Pa,g.measureTTFB=Ua,g.navigationHelper=we,g.optimizeClassNames=$u,g.optimizeContainment=Fu,g.optimizeFlex=Yu,g.optimizeGrid=Gu,g.optimizeWillChange=Wu,g.optimizedFetch=ua,g.parseFileSize=Pu,g.performanceBudget=de,g.performanceUtils=cr,g.prefersReducedMotion=Qa,g.prefetchResource=Qg,g.preloadComponent=yg,g.preloadImage=ah,g.preloadResource=Rg,g.preloadRoute=Xg,g.preserveAspectRatio=lh,g.priorityLoader=Nh,g.removeLanguageFromPath=zr,g.reportApiCall=du,g.reportCustomMetric=cu,g.reportRouteChange=za,g.reportWebVitals=Zg,g.routeConfig=xa,g.securityHeaders=ng,g.setupCSPReporting=sg,g.setupLazyLoading=eh,g.setupProgressiveLoading=nh,g.shouldEnableWallet=R0,g.smartLinkVariants=nr,g.stripLanguagePrefix=cn,g.supportsAVIF=en,g.supportsCSSImports=rg,g.supportsWebP=Ra,g.themeStorage=Sh,g.useApiMetrics=Xa,g.useBanner=hl,g.useBundleMetrics=Wa,g.useClickOutside=rr,g.useCodeLoader=oa,g.useComponentPerformance=Ta,g.useCopyToClipboard=Eu,g.useDebugMemo=$g,g.useDraggable=Za,g.useDynamicImport=kh,g.useErrorRecovery=fd,g.useFormSubmission=Cu,g.useFormValidation=Iu,g.useImageLazyLoading=Kg,g.useLayout=ue,g.useLazyLoad=an,g.useLazyStyles=qu,g.useLocalizedNavigate=Ld,g.useLocation=hh,g.useMediaQuery=Ku,g.useMemoryLeakDetection=eu,g.useMultipleCopyToClipboard=Au,g.useNavigation=uh,g.useOptimizedTheme=Xu,g.useOptimizedWallets=_g,g.usePerformanceMark=Wg,g.useReducedMotion=Bu,g.useRenderCount=Hg,g.useResponsiveStyles=_u,g.useRoutePerformance=Tu,g.useSearchParams=fh,g.useSmartLinks=Jl,g.useStableCallback=Vg,g.useTheme=zd,g.useToast=Co,g.useToggle=Su,g.useTopbar=Wr,g.useWebVitals=Ba,g.utils=rn,g.walletStorage=Eh,g.web3SecurityNotes=lg,g.withLazyErrorBoundary=ud,g.withPerformanceTracking=au,g.withRetry=Z0,Object.defineProperties(g,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})}));