@sudobility/components 5.0.14 → 5.0.16

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
@@ -1,4 +1,4 @@
1
- (function(g,Pe){typeof exports=="object"&&typeof module<"u"?Pe(exports,require("clsx"),require("tailwind-merge"),require("react/jsx-runtime"),require("react"),require("class-variance-authority"),require("react-dom"),require("@heroicons/react/24/outline"),require("@heroicons/react/24/solid"),require("@radix-ui/react-switch"),require("@radix-ui/react-select"),require("@heroicons/react/20/solid"),require("@radix-ui/react-label"),require("@radix-ui/react-slot"),require("react-router-dom"),require("@radix-ui/react-tabs"),require("react-i18next"),require("web-vitals")):typeof define=="function"&&define.amd?define(["exports","clsx","tailwind-merge","react/jsx-runtime","react","class-variance-authority","react-dom","@heroicons/react/24/outline","@heroicons/react/24/solid","@radix-ui/react-switch","@radix-ui/react-select","@heroicons/react/20/solid","@radix-ui/react-label","@radix-ui/react-slot","react-router-dom","@radix-ui/react-tabs","react-i18next","web-vitals"],Pe):(g=typeof globalThis<"u"?globalThis:g||self,Pe(g.MailBoxComponents={},g.clsx,g.tailwindMerge,g.ReactJSXRuntime,g.React,g.cva,g.ReactDOM,g.HeroiconsOutline,g.HeroiconsSolid,g.RadixSwitch,g.RadixSelect,g.HeroiconsSolid20,g.RadixLabel,g.RadixSlot,g.ReactRouterDOM,g.RadixTabs,g.ReactI18next,g.WebVitals))})(this,(function(g,Pe,fn,t,p,X,br,P,he,mr,bn,Oe,at,mn,Z,fe,Je,Ue){"use strict";function nt(e){const r=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const a in e)if(a!=="default"){const n=Object.getOwnPropertyDescriptor(e,a);Object.defineProperty(r,a,n.get?n:{enumerable:!0,get:()=>e[a]})}}return r.default=e,Object.freeze(r)}const G=nt(p),$=nt(bn);function f(...e){return fn.twMerge(Pe.clsx(e))}const ot=({children:e,as:r="div",p:a,px:n,py:o,m:s,mx:l,my:c,bg:d,border:i=!1,rounded:h,shadow:u,w:y,h:m,className:b})=>{const v={none:"0",xs:"1",sm:"2",md:"4",lg:"6",xl:"8","2xl":"12",auto:"auto"},k=d?{transparent:"bg-transparent",white:"bg-white dark:bg-gray-900",gray:"bg-gray-100 dark:bg-gray-800",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"}[d]:"",S=h?{none:"rounded-none",sm:"rounded-sm",md:"rounded-md",lg:"rounded-lg",xl:"rounded-xl",full:"rounded-full"}[h]:"",w=u?{none:"shadow-none",sm:"shadow-sm",md:"shadow-md",lg:"shadow-lg",xl:"shadow-xl"}[u]:"",N=y?{auto:"w-auto",full:"w-full",screen:"w-screen",min:"w-min",max:"w-max"}[y]:"",C=m?{auto:"h-auto",full:"h-full",screen:"h-screen",min:"h-min",max:"h-max"}[m]:"",E=[];a&&E.push("p-"+v[a]),n&&E.push("px-"+v[n]),o&&E.push("py-"+v[o]);const I=[];return s&&I.push("m-"+v[s]),l&&I.push("mx-"+v[l]),c&&I.push("my-"+v[c]),t.jsx(r,{className:f(...E,...I,k,i&&"border border-gray-200 dark:border-gray-700",S,w,N,C,b),children:e})},yn=({direction:e="row",align:r,justify:a,wrap:n="nowrap",gap:o,inline:s=!1,className:l,...c})=>{const d={row:"flex-row","row-reverse":"flex-row-reverse",col:"flex-col","col-reverse":"flex-col-reverse"},i=r?{start:"items-start",center:"items-center",end:"items-end",stretch:"items-stretch",baseline:"items-baseline"}[r]:"",h=a?{start:"justify-start",center:"justify-center",end:"justify-end",between:"justify-between",around:"justify-around",evenly:"justify-evenly"}[a]:"",u={nowrap:"flex-nowrap",wrap:"flex-wrap","wrap-reverse":"flex-wrap-reverse"},y=o?{none:"gap-0",xs:"gap-1",sm:"gap-2",md:"gap-4",lg:"gap-6",xl:"gap-8","2xl":"gap-12"}[o]:"";return t.jsx(ot,{...c,className:f(s?"inline-flex":"flex",d[e],i,h,u[n],y,l)})},pn=({children:e,size:r="xl",center:a=!0,padding:n="md",className:o})=>{const s={sm:"max-w-screen-sm",md:"max-w-screen-md",lg:"max-w-screen-lg",xl:"max-w-screen-xl","2xl":"max-w-screen-2xl",full:"max-w-full"},l={none:"",sm:"px-4 py-2",md:"px-6 py-4",lg:"px-8 py-6"};return t.jsx("div",{className:f("w-full",s[r],a&&"mx-auto",l[n],o),children:e})},vn=({children:e,cols:r=1,gap:a="md",autoFit:n,autoFill:o,alignItems:s="stretch",justifyItems:l="stretch",className:c})=>{const d={none:"gap-0",xs:"gap-1",sm:"gap-2",md:"gap-4",lg:"gap-6",xl:"gap-8","2xl":"gap-12"},i={start:"items-start",center:"items-center",end:"items-end",stretch:"items-stretch"},h={start:"justify-items-start",center:"justify-items-center",end:"justify-items-end",stretch:"justify-items-stretch"},u=()=>{if(n||o)return"";if(typeof r=="number")return{1:"grid-cols-1",2:"grid-cols-2",3:"grid-cols-3",4:"grid-cols-4",5:"grid-cols-5",6:"grid-cols-6",7:"grid-cols-7",8:"grid-cols-8",9:"grid-cols-9",10:"grid-cols-10",11:"grid-cols-11",12:"grid-cols-12"}[r]||"grid-cols-1";const m=[];return r.sm&&m.push("grid-cols-"+r.sm),r.md&&m.push("md:grid-cols-"+r.md),r.lg&&m.push("lg:grid-cols-"+r.lg),r.xl&&m.push("xl:grid-cols-"+r.xl),m.join(" ")};let y;return n?y="repeat(auto-fit, minmax("+n+", 1fr))":o&&(y="repeat(auto-fill, minmax("+o+", 1fr))"),t.jsx("div",{className:f("grid",u(),d[a],i[s],h[l],c),style:y?{gridTemplateColumns:y}:void 0,children:e})},yr=({children:e,direction:r="vertical",spacing:a="md",align:n="stretch",justify:o="start",wrap:s=!1,full:l=!1,divider:c=!1,className:d})=>{const i=r==="vertical",h={vertical:{none:"",xs:"space-y-1",sm:"space-y-2",md:"space-y-4",lg:"space-y-6",xl:"space-y-8","2xl":"space-y-12"},horizontal:{none:"",xs:"space-x-1",sm:"space-x-2",md:"space-x-4",lg:"space-x-6",xl:"space-x-8","2xl":"space-x-12"}},u={vertical:{none:"",xs:"gap-1",sm:"gap-2",md:"gap-4",lg:"gap-6",xl:"gap-8","2xl":"gap-12"},horizontal:{none:"",xs:"gap-1",sm:"gap-2",md:"gap-4",lg:"gap-6",xl:"gap-8","2xl":"gap-12"}},y={start:"items-start",center:"items-center",end:"items-end",stretch:"items-stretch",baseline:"items-baseline"},m={start:"justify-start",center:"justify-center",end:"justify-end",between:"justify-between",around:"justify-around",evenly:"justify-evenly"};return t.jsx("div",{className:f("flex",i?"flex-col":"flex-row",c?u[r][a]:h[r][a],y[n],m[o],s&&"flex-wrap",l&&(i?"h-full":"w-full"),d),children:c?p.Children.map(e,(b,v)=>t.jsxs(p.Fragment,{children:[b,v<p.Children.count(e)-1&&t.jsx("div",{className:f("bg-gray-200 dark:bg-gray-700",i?"h-px w-full":"w-px h-full")})]},v)):e})},kn=e=>t.jsx(yr,{direction:"vertical",...e}),wn=e=>t.jsx(yr,{direction:"horizontal",...e}),xn=({children:e,axis:r="both",inline:a=!1,className:n})=>{const o=()=>{switch(r){case"horizontal":return"justify-center";case"vertical":return"items-center";case"both":default:return"justify-center items-center"}};return t.jsx("div",{className:f(a?"inline-flex":"flex",o(),n),children:e})},Nn=({size:e="md",axis:r="vertical",flex:a=!1,className:n})=>{const o={vertical:{xs:"h-1",sm:"h-2",md:"h-4",lg:"h-6",xl:"h-8","2xl":"h-12"},horizontal:{xs:"w-1",sm:"w-2",md:"w-4",lg:"w-6",xl:"w-8","2xl":"w-12"}},s=typeof e=="number"?r==="vertical"?{height:`${e}px`}:{width:`${e}px`}:void 0,l=typeof e=="string"?o[r][e]:"";return t.jsx("div",{className:f(a&&"flex-1",!a&&l,n),style:s,"aria-hidden":"true"})},Cn=X.cva("",{variants:{variant:{default:"",hero:"relative overflow-hidden",feature:"bg-white dark:bg-gray-800",cta:"relative overflow-hidden",testimonial:"bg-gray-50 dark:bg-gray-900",footer:"bg-white dark:bg-gray-800 border-gray-200 dark:border-gray-700 border-t"},spacing:{none:"",xs:"py-2",sm:"py-3",md:"py-4",lg:"py-6",xl:"py-8","2xl":"py-12","3xl":"py-16","4xl":"py-20","5xl":"py-24"},background:{none:"bg-transparent",default:"bg-gray-50 dark:bg-gray-900",surface:"bg-white dark:bg-gray-800",gradient:"bg-gradient-to-br from-gray-50 via-blue-50 to-purple-50 dark:from-gray-900 dark:via-blue-900/50 dark:to-purple-900/50","gradient-primary":"bg-gradient-to-br from-blue-50 to-indigo-100 dark:from-blue-900/50 dark:to-indigo-900/50","gradient-secondary":"bg-gradient-to-br from-green-50 to-blue-100 dark:from-green-900/50 dark:to-blue-900/50","gradient-tertiary":"bg-gradient-to-r from-emerald-50 to-teal-50 dark:from-gray-800 dark:to-gray-900","gradient-vibrant":"bg-gradient-to-br from-blue-800 to-purple-800 dark:from-blue-900 dark:to-purple-900"}},defaultVariants:{variant:"default",spacing:"3xl",background:"none"}}),Sn={sm:"max-w-sm",md:"max-w-md",lg:"max-w-lg",xl:"max-w-xl","2xl":"max-w-2xl","3xl":"max-w-3xl","4xl":"max-w-4xl","5xl":"max-w-5xl","6xl":"max-w-6xl","7xl":"max-w-7xl",full:"max-w-full"},En=({children:e,variant:r="default",spacing:a="3xl",background:n="none",maxWidth:o="7xl",className:s,containerClassName:l,as:c="section",id:d,fullWidth:i=!1})=>{const h=i?e:t.jsx("div",{className:f(Sn[o],"mx-auto px-4 sm:px-6 lg:px-8",l),children:e});return p.createElement(c,{id:d,className:f(Cn({variant:r,spacing:a,background:n}),s)},h)},An=X.cva("min-h-screen flex flex-col",{variants:{background:{default:"bg-gray-50 dark:bg-gray-900",surface:"bg-white dark:bg-gray-800",transparent:"bg-transparent",gradient:"bg-gradient-to-br from-gray-50 via-blue-50 to-purple-50 dark:from-gray-900 dark:via-blue-900/20 dark:to-purple-900/20"},overflow:{visible:"overflow-visible",hidden:"overflow-hidden",scroll:"overflow-auto"}},defaultVariants:{background:"default",overflow:"visible"}}),Tn=({children:e,background:r="default",overflow:a="visible",className:n})=>t.jsx("div",{className:f(An({background:r,overflow:a}),n),children:e}),In=({children:e,ratio:r="16/9",className:a})=>{const s=`${1/(typeof r=="string"?{"16/9":1.7777777777777777,"4/3":1.3333333333333333,"1/1":1,"21/9":2.3333333333333335,"3/2":1.5}[r]:r)*100}%`;return t.jsx("div",{className:f("relative w-full",a),style:{paddingBottom:s},children:t.jsx("div",{className:"absolute inset-0",children:e})})},T={typography:{family:{sans:"font-sans",display:"font-sans",body:"font-sans"},semantic:{caption:"text-xs",small:"text-sm",body:"text-base",bodyLarge:"text-lg",h6:"text-base",h5:"text-lg",h4:"text-xl",h3:"text-2xl",h2:"text-3xl",h1:"text-4xl",hero:"text-8xl"},weight:{semibold:"font-semibold",bold:"font-bold",body:"font-normal",emphasis:"font-medium",strong:"font-semibold",heading:"font-bold",display:"font-extrabold"},decoration:{none:"no-underline",underline:"underline"},underlineOffset:{medium:"underline-offset-2"},leading:{tight:"leading-tight",heading:"leading-tight",body:"leading-relaxed",caption:"leading-normal",display:"leading-none"},tracking:{heading:"tracking-tight",body:"tracking-normal",caption:"tracking-normal",uppercase:"tracking-wider"},transform:{uppercase:"uppercase"}}},D={heading:{display:{hero:()=>`${T.typography.family.display} ${T.typography.semantic.hero} ${T.typography.weight.display} ${T.typography.leading.display} ${T.typography.tracking.heading} text-gray-900 dark:text-white`,xl:()=>`${T.typography.family.display} text-7xl ${T.typography.weight.display} ${T.typography.leading.display} ${T.typography.tracking.heading} text-gray-900 dark:text-white`,lg:()=>`${T.typography.family.display} text-6xl ${T.typography.weight.bold} ${T.typography.leading.display} ${T.typography.tracking.heading} text-gray-900 dark:text-white`,md:()=>`${T.typography.family.display} text-5xl ${T.typography.weight.bold} ${T.typography.leading.tight} ${T.typography.tracking.heading} text-gray-900 dark:text-white`,sm:()=>`${T.typography.family.display} text-4xl ${T.typography.weight.bold} ${T.typography.leading.tight} ${T.typography.tracking.heading} text-gray-900 dark:text-white`},h1:()=>`${T.typography.family.sans} ${T.typography.semantic.h1} ${T.typography.weight.heading} ${T.typography.leading.heading} ${T.typography.tracking.heading} text-gray-900 dark:text-white`,h2:()=>`${T.typography.family.sans} ${T.typography.semantic.h2} ${T.typography.weight.heading} ${T.typography.leading.heading} ${T.typography.tracking.heading} text-gray-900 dark:text-white`,h3:()=>`${T.typography.family.sans} ${T.typography.semantic.h3} ${T.typography.weight.heading} ${T.typography.leading.heading} ${T.typography.tracking.heading} text-gray-900 dark:text-white`,h4:()=>`${T.typography.family.sans} ${T.typography.semantic.h4} ${T.typography.weight.semibold} ${T.typography.leading.heading} ${T.typography.tracking.heading} text-gray-900 dark:text-white`,h5:()=>`${T.typography.family.sans} ${T.typography.semantic.h5} ${T.typography.weight.semibold} ${T.typography.leading.heading} ${T.typography.tracking.heading} text-gray-900 dark:text-white`,h6:()=>`${T.typography.family.sans} ${T.typography.semantic.h6} ${T.typography.weight.semibold} ${T.typography.leading.heading} ${T.typography.tracking.heading} text-gray-900 dark:text-white`,responsive:{h1:()=>`${T.typography.family.sans} text-2xl sm:text-3xl md:text-4xl lg:text-5xl ${T.typography.weight.heading} ${T.typography.leading.heading} ${T.typography.tracking.heading} text-gray-900 dark:text-white`,h2:()=>`${T.typography.family.sans} text-xl sm:text-2xl md:text-3xl lg:text-4xl ${T.typography.weight.heading} ${T.typography.leading.heading} ${T.typography.tracking.heading} text-gray-900 dark:text-white`,h3:()=>`${T.typography.family.sans} text-lg sm:text-xl md:text-2xl lg:text-3xl ${T.typography.weight.semibold} ${T.typography.leading.heading} ${T.typography.tracking.heading} text-gray-900 dark:text-white`,display:()=>`${T.typography.family.display} text-4xl sm:text-5xl md:text-6xl lg:text-7xl xl:text-8xl ${T.typography.weight.display} ${T.typography.leading.display} ${T.typography.tracking.heading} text-gray-900 dark:text-white`}},body:{xl:()=>`${T.typography.family.body} ${T.typography.semantic.bodyLarge} ${T.typography.weight.body} ${T.typography.leading.body} ${T.typography.tracking.body} text-gray-700 dark:text-gray-300`,lg:()=>`${T.typography.family.body} ${T.typography.semantic.body} ${T.typography.weight.body} ${T.typography.leading.body} ${T.typography.tracking.body} text-gray-700 dark:text-gray-300`,md:()=>`${T.typography.family.body} ${T.typography.semantic.body} ${T.typography.weight.body} ${T.typography.leading.body} ${T.typography.tracking.body} text-gray-700 dark:text-gray-300`,sm:()=>`${T.typography.family.body} ${T.typography.semantic.small} ${T.typography.weight.body} ${T.typography.leading.body} ${T.typography.tracking.body} text-gray-600 dark:text-gray-400`,xs:()=>`${T.typography.family.body} ${T.typography.semantic.caption} ${T.typography.weight.body} ${T.typography.leading.body} ${T.typography.tracking.body} text-gray-600 dark:text-gray-400`,strong:{xl:()=>`${T.typography.family.body} ${T.typography.semantic.bodyLarge} ${T.typography.weight.strong} ${T.typography.leading.body} ${T.typography.tracking.body} text-gray-900 dark:text-white`,lg:()=>`${T.typography.family.body} ${T.typography.semantic.body} ${T.typography.weight.strong} ${T.typography.leading.body} ${T.typography.tracking.body} text-gray-900 dark:text-white`,md:()=>`${T.typography.family.body} ${T.typography.semantic.body} ${T.typography.weight.strong} ${T.typography.leading.body} ${T.typography.tracking.body} text-gray-900 dark:text-white`,sm:()=>`${T.typography.family.body} ${T.typography.semantic.small} ${T.typography.weight.strong} ${T.typography.leading.body} ${T.typography.tracking.body} text-gray-900 dark:text-white`},emphasis:{xl:()=>`${T.typography.family.body} ${T.typography.semantic.bodyLarge} ${T.typography.weight.emphasis} ${T.typography.leading.body} ${T.typography.tracking.body} text-gray-900 dark:text-white`,lg:()=>`${T.typography.family.body} ${T.typography.semantic.body} ${T.typography.weight.emphasis} ${T.typography.leading.body} ${T.typography.tracking.body} text-gray-900 dark:text-white`,md:()=>`${T.typography.family.body} ${T.typography.semantic.body} ${T.typography.weight.emphasis} ${T.typography.leading.body} ${T.typography.tracking.body} text-gray-900 dark:text-white`,sm:()=>`${T.typography.family.body} ${T.typography.semantic.small} ${T.typography.weight.emphasis} ${T.typography.leading.body} ${T.typography.tracking.body} text-gray-900 dark:text-white`},muted:{xl:()=>`${T.typography.family.body} ${T.typography.semantic.bodyLarge} ${T.typography.weight.body} ${T.typography.leading.body} ${T.typography.tracking.body} text-gray-600 dark:text-gray-400`,lg:()=>`${T.typography.family.body} ${T.typography.semantic.body} ${T.typography.weight.body} ${T.typography.leading.body} ${T.typography.tracking.body} text-gray-600 dark:text-gray-400`,md:()=>`${T.typography.family.body} ${T.typography.semantic.body} ${T.typography.weight.body} ${T.typography.leading.body} ${T.typography.tracking.body} text-gray-600 dark:text-gray-400`,sm:()=>`${T.typography.family.body} ${T.typography.semantic.small} ${T.typography.weight.body} ${T.typography.leading.body} ${T.typography.tracking.body} text-gray-600 dark:text-gray-400`}},caption:{default:()=>`${T.typography.family.body} ${T.typography.semantic.caption} ${T.typography.weight.body} ${T.typography.leading.caption} ${T.typography.tracking.caption} text-gray-500 dark:text-gray-500`,emphasis:()=>`${T.typography.family.body} ${T.typography.semantic.caption} ${T.typography.weight.emphasis} ${T.typography.leading.caption} ${T.typography.tracking.caption} text-gray-600 dark:text-gray-400`,uppercase:()=>`${T.typography.family.body} ${T.typography.semantic.caption} ${T.typography.weight.emphasis} ${T.typography.leading.caption} ${T.typography.tracking.uppercase} ${T.typography.transform.uppercase} text-gray-500 dark:text-gray-500`},link:{default:()=>`${T.typography.decoration.underline} ${T.typography.underlineOffset.medium} text-blue-600 dark:text-blue-400 hover:text-blue-700 dark:hover:text-blue-300 transition-colors duration-150`,subtle:()=>`${T.typography.decoration.none} text-blue-600 dark:text-blue-400 hover:text-blue-700 dark:hover:text-blue-300 hover:${T.typography.decoration.underline} hover:${T.typography.underlineOffset.medium} transition-all duration-150`,muted:()=>`${T.typography.decoration.underline} ${T.typography.underlineOffset.medium} text-gray-600 dark:text-gray-400 hover:text-gray-900 dark:hover:text-gray-100 transition-colors duration-150`,external:()=>`${T.typography.decoration.underline} ${T.typography.underlineOffset.medium} text-blue-600 dark:text-blue-400 hover:text-blue-700 dark:hover:text-blue-300 transition-colors duration-150 inline-flex items-center gap-1`},label:{default:()=>`${T.typography.family.body} text-sm ${T.typography.weight.emphasis} text-gray-900 dark:text-white`,required:()=>`${T.typography.family.body} text-sm ${T.typography.weight.emphasis} text-gray-900 dark:text-white after:content-['*'] after:ml-0.5 after:text-red-500`,optional:()=>`${T.typography.family.body} text-sm ${T.typography.weight.body} text-gray-600 dark:text-gray-400`,helper:()=>`${T.typography.family.body} text-sm ${T.typography.weight.body} text-gray-500 dark:text-gray-500`,error:()=>`${T.typography.family.body} text-sm ${T.typography.weight.body} text-red-600 dark:text-red-400`,success:()=>`${T.typography.family.body} text-sm ${T.typography.weight.body} text-green-600 dark:text-green-400`}},j={button:{primary:{default:()=>"bg-blue-600 text-white hover:bg-blue-700 active:bg-blue-800 border-transparent focus-visible:ring-2 focus-visible:ring-blue-500 focus-visible:ring-offset-2 disabled:opacity-50 disabled:cursor-not-allowed dark:bg-blue-600 dark:hover:bg-blue-700 dark:active:bg-blue-800 dark:text-white dark:focus-visible:ring-blue-400 inline-flex items-center justify-center rounded-md px-4 py-2 text-sm font-medium transition-colors duration-200",small:()=>"bg-blue-600 text-white hover:bg-blue-700 active:bg-blue-800 border border-transparent focus-visible:ring-2 focus-visible:ring-blue-500 focus-visible:ring-offset-2 disabled:opacity-50 disabled:cursor-not-allowed dark:bg-blue-600 dark:hover:bg-blue-700 dark:active:bg-blue-800 dark:text-white dark:focus-visible:ring-blue-400 inline-flex items-center justify-center rounded-md px-3 py-1.5 text-xs font-medium transition-colors duration-200 h-8",large:()=>"bg-blue-600 text-white hover:bg-blue-700 active:bg-blue-800 border-transparent focus-visible:ring-2 focus-visible:ring-blue-500 focus-visible:ring-offset-2 disabled:opacity-50 disabled:cursor-not-allowed dark:bg-blue-600 dark:hover:bg-blue-700 dark:active:bg-blue-800 dark:text-white dark:focus-visible:ring-blue-400 inline-flex items-center justify-center rounded-md px-6 py-3 text-base font-medium transition-colors duration-200 h-12",withIcon:()=>"bg-blue-600 text-white hover:bg-blue-700 active:bg-blue-800 border-transparent focus-visible:ring-2 focus-visible:ring-blue-500 focus-visible:ring-offset-2 disabled:opacity-50 disabled:cursor-not-allowed dark:bg-blue-600 dark:hover:bg-blue-700 dark:active:bg-blue-800 dark:text-white dark:focus-visible:ring-blue-400 inline-flex items-center justify-center gap-2 rounded-md px-4 py-2 text-sm font-medium transition-colors duration-200",fullWidth:()=>"bg-blue-600 text-white hover:bg-blue-700 active:bg-blue-800 border-transparent focus-visible:ring-2 focus-visible:ring-blue-500 focus-visible:ring-offset-2 disabled:opacity-50 disabled:cursor-not-allowed dark:bg-blue-600 dark:hover:bg-blue-700 dark:active:bg-blue-800 dark:text-white dark:focus-visible:ring-blue-400 flex items-center justify-center w-full rounded-md px-4 py-2 text-sm font-medium transition-colors duration-200"},secondary:{default:()=>"bg-gray-100 text-gray-900 hover:bg-gray-200 active:bg-gray-300 border-transparent focus-visible:ring-2 focus-visible:ring-gray-500 focus-visible:ring-offset-2 disabled:opacity-50 disabled:cursor-not-allowed dark:bg-gray-800 dark:text-gray-50 dark:hover:bg-gray-700 dark:active:bg-gray-600 inline-flex items-center justify-center rounded-md px-4 py-2 text-sm font-medium transition-colors duration-200",small:()=>"bg-gray-100 text-gray-900 hover:bg-gray-200 active:bg-gray-300 border-transparent focus-visible:ring-2 focus-visible:ring-gray-500 focus-visible:ring-offset-2 disabled:opacity-50 disabled:cursor-not-allowed dark:bg-gray-800 dark:text-gray-50 dark:hover:bg-gray-700 dark:active:bg-gray-600 inline-flex items-center justify-center rounded-md px-3 py-1.5 text-xs font-medium transition-colors duration-200 h-8",large:()=>"bg-gray-100 text-gray-900 hover:bg-gray-200 active:bg-gray-300 border-transparent focus-visible:ring-2 focus-visible:ring-gray-500 focus-visible:ring-offset-2 disabled:opacity-50 disabled:cursor-not-allowed dark:bg-gray-800 dark:text-gray-50 dark:hover:bg-gray-700 dark:active:bg-gray-600 inline-flex items-center justify-center rounded-md px-6 py-3 text-base font-medium transition-colors duration-200 h-12",withIcon:()=>"bg-gray-100 text-gray-900 hover:bg-gray-200 active:bg-gray-300 border-transparent focus-visible:ring-2 focus-visible:ring-gray-500 focus-visible:ring-offset-2 disabled:opacity-50 disabled:cursor-not-allowed dark:bg-gray-800 dark:text-gray-50 dark:hover:bg-gray-700 dark:active:bg-gray-600 inline-flex items-center justify-center gap-2 rounded-md px-4 py-2 text-sm font-medium transition-colors duration-200"},outline:{default:()=>"bg-transparent hover:bg-gray-50 active:bg-gray-100 text-gray-900 border border-gray-300 focus-visible:ring-2 focus-visible:ring-blue-500 focus-visible:ring-offset-2 disabled:opacity-50 disabled:cursor-not-allowed dark:bg-transparent dark:hover:bg-gray-800 dark:active:bg-gray-700 dark:text-gray-50 dark:border-gray-600 inline-flex items-center justify-center rounded-md px-4 py-2 text-sm font-medium transition-colors duration-200",small:()=>"bg-transparent hover:bg-gray-50 active:bg-gray-100 text-gray-900 border border-gray-300 focus-visible:ring-2 focus-visible:ring-blue-500 focus-visible:ring-offset-2 disabled:opacity-50 disabled:cursor-not-allowed dark:bg-transparent dark:hover:bg-gray-800 dark:active:bg-gray-700 dark:text-gray-50 dark:border-gray-600 inline-flex items-center justify-center rounded-md px-3 py-1.5 text-xs font-medium transition-colors duration-200 h-8",large:()=>"bg-transparent hover:bg-gray-50 active:bg-gray-100 text-gray-900 border border-gray-300 focus-visible:ring-2 focus-visible:ring-blue-500 focus-visible:ring-offset-2 disabled:opacity-50 disabled:cursor-not-allowed dark:bg-transparent dark:hover:bg-gray-800 dark:active:bg-gray-700 dark:text-gray-50 dark:border-gray-600 inline-flex items-center justify-center rounded-md px-6 py-3 text-base font-medium transition-colors duration-200 h-12",withIcon:()=>"bg-transparent hover:bg-gray-50 active:bg-gray-100 text-gray-900 border border-gray-300 focus-visible:ring-2 focus-visible:ring-blue-500 focus-visible:ring-offset-2 disabled:opacity-50 disabled:cursor-not-allowed dark:bg-transparent dark:hover:bg-gray-800 dark:active:bg-gray-700 dark:text-gray-50 dark:border-gray-600 inline-flex items-center justify-center gap-2 rounded-md px-4 py-2 text-sm font-medium transition-colors duration-200"},destructive:{default:()=>"bg-red-600 text-white hover:bg-red-700 active:bg-red-800 border-transparent focus-visible:ring-2 focus-visible:ring-red-500 focus-visible:ring-offset-2 disabled:opacity-50 disabled:cursor-not-allowed dark:bg-red-600 dark:hover:bg-red-700 dark:active:bg-red-800 dark:text-white inline-flex items-center justify-center rounded-md px-4 py-2 text-sm font-medium transition-colors duration-200",outline:()=>"bg-transparent hover:bg-red-50 active:bg-red-100 text-red-600 border border-red-300 focus-visible:ring-2 focus-visible:ring-red-500 focus-visible:ring-offset-2 disabled:opacity-50 disabled:cursor-not-allowed dark:hover:bg-red-900/20 dark:text-red-400 dark:border-red-800 inline-flex items-center justify-center rounded-md px-4 py-2 text-sm font-medium transition-colors duration-200",small:()=>"bg-red-600 text-white hover:bg-red-700 active:bg-red-800 border-transparent focus-visible:ring-2 focus-visible:ring-red-500 focus-visible:ring-offset-2 disabled:opacity-50 disabled:cursor-not-allowed dark:bg-red-600 dark:hover:bg-red-700 dark:active:bg-red-800 dark:text-white inline-flex items-center justify-center rounded-md px-3 py-1.5 text-xs font-medium transition-colors duration-200 h-8"},ghost:{default:()=>"bg-transparent hover:bg-gray-100 active:bg-gray-200 text-gray-700 border-transparent focus-visible:ring-2 focus-visible:ring-gray-500 focus-visible:ring-offset-2 disabled:opacity-50 disabled:cursor-not-allowed dark:bg-transparent dark:hover:bg-gray-800 dark:active:bg-gray-700 dark:text-gray-300 inline-flex items-center justify-center rounded-md px-4 py-2 text-sm font-medium transition-colors duration-200",small:()=>"bg-transparent hover:bg-gray-100 active:bg-gray-200 text-gray-700 border-transparent focus-visible:ring-2 focus-visible:ring-gray-500 focus-visible:ring-offset-2 disabled:opacity-50 disabled:cursor-not-allowed dark:bg-transparent dark:hover:bg-gray-800 dark:active:bg-gray-700 dark:text-gray-300 inline-flex items-center justify-center rounded-md px-2 py-1 text-xs font-medium transition-colors duration-200 h-8",icon:()=>"bg-transparent hover:bg-gray-100 active:bg-gray-200 text-gray-700 border-transparent focus-visible:ring-2 focus-visible:ring-gray-500 focus-visible:ring-offset-2 disabled:opacity-50 disabled:cursor-not-allowed dark:bg-transparent dark:hover:bg-gray-800 dark:active:bg-gray-700 dark:text-gray-300 inline-flex items-center justify-center rounded-md p-2 transition-colors duration-200 h-10 w-10"},link:{default:()=>"bg-transparent hover:bg-transparent active:bg-transparent text-blue-600 border-transparent underline-offset-4 hover:underline focus-visible:ring-2 focus-visible:ring-blue-500 focus-visible:ring-offset-2 disabled:opacity-50 disabled:cursor-not-allowed disabled:no-underline dark:text-blue-400 inline-flex items-center justify-center rounded-md px-0 py-0 text-sm font-medium transition-colors duration-200",muted:()=>"bg-transparent hover:bg-transparent active:bg-transparent text-gray-600 dark:text-gray-400 hover:text-gray-700 dark:hover:text-gray-300 border-transparent underline-offset-4 hover:underline focus-visible:ring-2 focus-visible:ring-gray-500 focus-visible:ring-offset-2 disabled:opacity-50 disabled:cursor-not-allowed disabled:no-underline inline-flex items-center justify-center rounded-md px-0 py-0 text-sm font-medium transition-colors duration-200"},gradient:{primary:()=>"bg-gradient-to-r from-blue-600 to-purple-600 hover:from-blue-700 hover:to-purple-700 text-white border-transparent shadow-lg hover:shadow-xl focus-visible:ring-2 focus-visible:ring-blue-500 focus-visible:ring-offset-2 disabled:opacity-50 disabled:cursor-not-allowed inline-flex items-center justify-center rounded-md px-4 py-2 text-sm font-medium transition-all duration-200",secondary:()=>"bg-gradient-to-r from-gray-100 to-gray-200 hover:from-gray-200 hover:to-gray-300 text-gray-900 border-transparent focus-visible:ring-2 focus-visible:ring-gray-500 focus-visible:ring-offset-2 disabled:opacity-50 disabled:cursor-not-allowed inline-flex items-center justify-center rounded-md px-4 py-2 text-sm font-medium transition-all duration-200",success:()=>"bg-gradient-to-r from-green-500 to-emerald-600 hover:from-green-600 hover:to-emerald-700 text-white border-transparent shadow-lg hover:shadow-xl focus-visible:ring-2 focus-visible:ring-green-500 focus-visible:ring-offset-2 disabled:opacity-50 disabled:cursor-not-allowed inline-flex items-center justify-center rounded-md px-4 py-2 text-sm font-medium transition-all duration-200"},web3:{wallet:()=>"bg-white dark:bg-gray-800 border border-gray-300 dark:border-gray-600 hover:bg-gray-50 dark:hover:bg-gray-700 text-gray-900 dark:text-gray-100 focus-visible:ring-2 focus-visible:ring-blue-500 focus-visible:ring-offset-2 disabled:opacity-50 disabled:cursor-not-allowed inline-flex items-center justify-center gap-2 rounded-md px-4 py-2 text-sm font-medium transition-colors duration-200",connect:()=>"bg-gradient-to-r from-blue-600 to-purple-600 hover:from-blue-700 hover:to-purple-700 text-white border-transparent shadow-lg hover:shadow-xl focus-visible:ring-2 focus-visible:ring-blue-500 focus-visible:ring-offset-2 disabled:opacity-50 disabled:cursor-not-allowed inline-flex items-center justify-center gap-2 rounded-md px-4 py-2 text-sm font-medium transition-all duration-200",disconnect:()=>"bg-transparent hover:bg-red-50 active:bg-red-100 text-red-600 border border-red-300 focus-visible:ring-2 focus-visible:ring-red-500 focus-visible:ring-offset-2 disabled:opacity-50 disabled:cursor-not-allowed dark:hover:bg-red-900/20 dark:text-red-400 dark:border-red-800 inline-flex items-center justify-center gap-2 rounded-md px-4 py-2 text-sm font-medium transition-colors duration-200"}},badge:{default:()=>"bg-gray-100 text-gray-800 dark:bg-gray-800 dark:text-gray-300 inline-flex items-center px-2.5 py-0.5 rounded-full text-xs font-medium",primary:()=>"bg-blue-100 text-blue-800 dark:bg-blue-900/30 dark:text-blue-300 inline-flex items-center px-2.5 py-0.5 rounded-full text-xs font-medium",success:()=>"bg-green-100 text-green-800 dark:bg-green-900/30 dark:text-green-300 inline-flex items-center px-2.5 py-0.5 rounded-full text-xs font-medium",warning:()=>"bg-amber-100 text-amber-800 dark:bg-amber-900/30 dark:text-amber-300 inline-flex items-center px-2.5 py-0.5 rounded-full text-xs font-medium",error:()=>"bg-red-100 text-red-800 dark:bg-red-900/30 dark:text-red-300 inline-flex items-center px-2.5 py-0.5 rounded-full text-xs font-medium",ethereum:()=>"bg-blue-100 text-blue-800 dark:bg-blue-900/30 dark:text-blue-300 inline-flex items-center px-2.5 py-0.5 rounded-full text-xs font-medium",solana:()=>"bg-purple-100 text-purple-800 dark:bg-purple-900/30 dark:text-purple-300 inline-flex items-center px-2.5 py-0.5 rounded-full text-xs font-medium",small:(e="default")=>{const r={default:"bg-gray-100 text-gray-800 dark:bg-gray-800 dark:text-gray-300",primary:"bg-blue-100 text-blue-800 dark:bg-blue-900/30 dark:text-blue-300",success:"bg-green-100 text-green-800 dark:bg-green-900/30 dark:text-green-300",warning:"bg-amber-100 text-amber-800 dark:bg-amber-900/30 dark:text-amber-300",error:"bg-red-100 text-red-800 dark:bg-red-900/30 dark:text-red-300"};return`${r[e]||r.default} inline-flex items-center px-2 py-0.5 rounded-full text-xs font-medium`},large:(e="default")=>{const r={default:"bg-gray-100 text-gray-800 dark:bg-gray-800 dark:text-gray-300",primary:"bg-blue-100 text-blue-800 dark:bg-blue-900/30 dark:text-blue-300",success:"bg-green-100 text-green-800 dark:bg-green-900/30 dark:text-green-300",warning:"bg-amber-100 text-amber-800 dark:bg-amber-900/30 dark:text-amber-300",error:"bg-red-100 text-red-800 dark:bg-red-900/30 dark:text-red-300"};return`${r[e]||r.default} inline-flex items-center px-3 py-1 rounded-full text-sm font-medium`}},input:{default:()=>"bg-gray-50 dark:bg-gray-800 border-gray-300 dark:border-gray-600 text-gray-900 dark:text-gray-100 focus:border-blue-500 focus:ring-blue-500 dark:focus:border-blue-400 dark:focus:ring-blue-400 block w-full rounded-md px-3 py-2 text-sm placeholder:text-gray-500 dark:placeholder:text-gray-400 transition-colors duration-200 focus:outline-none focus:ring-2 focus:ring-offset-2",search:()=>"bg-gray-50 dark:bg-gray-800 border-gray-300 dark:border-gray-600 text-gray-900 dark:text-gray-100 focus:border-blue-500 focus:ring-blue-500 dark:focus:border-blue-400 dark:focus:ring-blue-400 block w-full rounded-md px-3 py-2 text-sm placeholder:text-gray-500 dark:placeholder:text-gray-400 transition-colors duration-200 focus:outline-none focus:ring-2 focus:ring-offset-2",error:()=>"bg-gray-50 dark:bg-gray-800 border-red-300 dark:border-red-700 text-gray-900 dark:text-gray-100 focus:border-red-500 focus:ring-red-500 block w-full rounded-md px-3 py-2 text-sm placeholder:text-gray-500 dark:placeholder:text-gray-400 transition-colors duration-200 focus:outline-none focus:ring-2 focus:ring-offset-2",small:()=>"bg-gray-50 dark:bg-gray-800 border-gray-300 dark:border-gray-600 text-gray-900 dark:text-gray-100 focus:border-blue-500 focus:ring-blue-500 dark:focus:border-blue-400 dark:focus:ring-blue-400 block w-full rounded-md px-2 py-1.5 text-xs placeholder:text-gray-500 dark:placeholder:text-gray-400 transition-colors duration-200 focus:outline-none focus:ring-2 focus:ring-offset-2",large:()=>"bg-gray-50 dark:bg-gray-800 border-gray-300 dark:border-gray-600 text-gray-900 dark:text-gray-100 focus:border-blue-500 focus:ring-blue-500 dark:focus:border-blue-400 dark:focus:ring-blue-400 block w-full rounded-md px-4 py-3 text-base placeholder:text-gray-500 dark:placeholder:text-gray-400 transition-colors duration-200 focus:outline-none focus:ring-2 focus:ring-offset-2",withIcon:()=>"bg-gray-50 dark:bg-gray-800 border-gray-300 dark:border-gray-600 text-gray-900 dark:text-gray-100 focus:border-blue-500 focus:ring-blue-500 dark:focus:border-blue-400 dark:focus:ring-blue-400 block w-full rounded-md pl-10 pr-3 py-2 text-sm placeholder:text-gray-500 dark:placeholder:text-gray-400 transition-colors duration-200 focus:outline-none focus:ring-2 focus:ring-offset-2"},alert:{info:()=>"bg-blue-50 border-blue-200 dark:bg-blue-900/20 dark:border-blue-800 text-blue-800 dark:text-blue-200 rounded-md border p-4 flex items-start gap-3",success:()=>"bg-green-50 border-green-200 dark:bg-green-900/20 dark:border-green-800 text-green-800 dark:text-green-200 rounded-md border p-4 flex items-start gap-3",warning:()=>"bg-amber-50 border-amber-200 dark:bg-amber-900/20 dark:border-amber-800 text-amber-800 dark:text-amber-200 rounded-md border p-4 flex items-start gap-3",attention:()=>"bg-amber-50 border-amber-200 dark:bg-amber-900/20 dark:border-amber-800 text-amber-800 dark:text-amber-200 rounded-md border p-4 flex items-start gap-3",error:()=>"bg-red-50 border-red-200 dark:bg-red-900/20 dark:border-red-800 text-red-800 dark:text-red-200 rounded-md border p-4 flex items-start gap-3",compact:{info:()=>"bg-blue-50 border-blue-200 dark:bg-blue-900/20 dark:border-blue-800 text-blue-800 dark:text-blue-200 rounded border px-3 py-2 text-sm",success:()=>"bg-green-50 border-green-200 dark:bg-green-900/20 dark:border-green-800 text-green-800 dark:text-green-200 rounded border px-3 py-2 text-sm",warning:()=>"bg-amber-50 border-amber-200 dark:bg-amber-900/20 dark:border-amber-800 text-amber-800 dark:text-amber-200 rounded border px-3 py-2 text-sm",attention:()=>"bg-amber-50 border-amber-200 dark:bg-amber-900/20 dark:border-amber-800 text-amber-800 dark:text-amber-200 rounded border px-3 py-2 text-sm",error:()=>"bg-red-50 border-red-200 dark:bg-red-900/20 dark:border-red-800 text-red-800 dark:text-red-200 rounded border px-3 py-2 text-sm"}},navigation:{tabs:{root:()=>"",list:()=>"inline-flex h-10 items-center justify-center rounded-md bg-gray-100 dark:bg-gray-800 p-1 text-gray-500 dark:text-gray-400",listUnderlined:()=>"flex border-b border-gray-200 dark:border-gray-700",listPills:()=>"flex space-x-1 bg-gray-100 dark:bg-gray-800 rounded-lg p-1",trigger:()=>"inline-flex items-center justify-center whitespace-nowrap rounded-sm px-3 py-1.5 text-sm font-medium ring-offset-white transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-blue-500 focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:bg-white data-[state=active]:text-gray-950 data-[state=active]:shadow-sm dark:ring-offset-gray-950 dark:focus-visible:ring-blue-400 dark:data-[state=active]:bg-gray-950 dark:data-[state=active]:text-gray-50",triggerUnderlined:()=>"inline-flex items-center justify-center whitespace-nowrap px-4 py-2 text-sm font-medium text-gray-500 dark:text-gray-400 border-b-2 border-transparent hover:text-gray-700 dark:hover:text-gray-300 hover:border-gray-300 dark:hover:border-gray-600 focus:outline-none focus:text-blue-600 focus:border-blue-600 dark:focus:text-blue-400 dark:focus:border-blue-400 data-[state=active]:text-blue-600 data-[state=active]:border-blue-600 dark:data-[state=active]:text-blue-400 dark:data-[state=active]:border-blue-400 transition-colors",triggerPills:()=>"inline-flex items-center justify-center whitespace-nowrap rounded-md px-3 py-1.5 text-sm font-medium text-gray-600 dark:text-gray-400 hover:text-gray-900 dark:hover:text-gray-100 hover:bg-white dark:hover:bg-gray-700 focus:outline-none focus:ring-2 focus:ring-blue-500 data-[state=active]:bg-white data-[state=active]:text-gray-900 data-[state=active]:shadow-sm dark:data-[state=active]:bg-gray-700 dark:data-[state=active]:text-gray-100 transition-all",content:()=>"mt-2 ring-offset-white focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-blue-500 focus-visible:ring-offset-2 dark:ring-offset-gray-950 dark:focus-visible:ring-blue-400"}},icon:{variant:{default:{xs:()=>"h-3 w-3 text-gray-500 dark:text-gray-400",sm:()=>"h-4 w-4 text-gray-500 dark:text-gray-400",md:()=>"h-5 w-5 text-gray-500 dark:text-gray-400",lg:()=>"h-6 w-6 text-gray-500 dark:text-gray-400",xl:()=>"h-8 w-8 text-gray-500 dark:text-gray-400"},success:{xs:()=>"h-3 w-3 text-green-600 dark:text-green-400",sm:()=>"h-4 w-4 text-green-600 dark:text-green-400",md:()=>"h-5 w-5 text-green-600 dark:text-green-400",lg:()=>"h-6 w-6 text-green-600 dark:text-green-400",xl:()=>"h-8 w-8 text-green-600 dark:text-green-400"},warning:{xs:()=>"h-3 w-3 text-amber-600 dark:text-amber-400",sm:()=>"h-4 w-4 text-amber-600 dark:text-amber-400",md:()=>"h-5 w-5 text-amber-600 dark:text-amber-400",lg:()=>"h-6 w-6 text-amber-600 dark:text-amber-400",xl:()=>"h-8 w-8 text-amber-600 dark:text-amber-400"},error:{xs:()=>"h-3 w-3 text-red-600 dark:text-red-400",sm:()=>"h-4 w-4 text-red-600 dark:text-red-400",md:()=>"h-5 w-5 text-red-600 dark:text-red-400",lg:()=>"h-6 w-6 text-red-600 dark:text-red-400",xl:()=>"h-8 w-8 text-red-600 dark:text-red-400"},muted:{xs:()=>"h-3 w-3 text-gray-400 dark:text-gray-500",sm:()=>"h-4 w-4 text-gray-400 dark:text-gray-500",md:()=>"h-5 w-5 text-gray-400 dark:text-gray-500",lg:()=>"h-6 w-6 text-gray-400 dark:text-gray-500",xl:()=>"h-8 w-8 text-gray-400 dark:text-gray-500"}}},overlays:{modal:{backdrop:()=>"fixed inset-0 z-40 bg-black/50 dark:bg-black/70 backdrop-blur-sm transition-all duration-300 ease-out",backdropEntering:()=>"opacity-0",backdropEntered:()=>"opacity-100",backdropExiting:()=>"opacity-0",container:()=>"fixed inset-0 z-50 flex items-center justify-center p-4 transition-all duration-300 ease-out",containerEntering:()=>"opacity-0 scale-95",containerEntered:()=>"opacity-100 scale-100",containerExiting:()=>"opacity-0 scale-95",content:()=>"relative w-full max-w-lg bg-white dark:bg-gray-900 rounded-lg shadow-xl border border-gray-200 dark:border-gray-700 max-h-[80vh] overflow-hidden",small:()=>"max-w-sm",medium:()=>"max-w-lg",large:()=>"max-w-2xl",extraLarge:()=>"max-w-4xl",fullWidth:()=>"max-w-[95vw]",header:()=>"flex items-center justify-between p-4 sm:p-6 border-b border-gray-200 dark:border-gray-700",title:()=>"text-lg font-semibold text-gray-900 dark:text-gray-100",closeButton:()=>"p-1 hover:bg-gray-100 dark:hover:bg-gray-700 rounded-md transition-colors",body:()=>"p-4 sm:p-6 overflow-y-auto",footer:()=>"flex items-center justify-end space-x-3 p-4 sm:p-6 border-t border-gray-200 dark:border-gray-700 bg-gray-50 dark:bg-gray-800/50"},dropdown:{container:()=>"relative inline-block",trigger:()=>"inline-flex justify-center items-center bg-transparent border-0 text-gray-900 dark:text-gray-100 focus:outline-none transition-colors",triggerBordered:()=>"inline-flex justify-center items-center bg-white dark:bg-gray-800 border border-gray-300 dark:border-gray-600 text-gray-900 dark:text-gray-100 hover:bg-gray-50 dark:hover:bg-gray-700 focus:outline-none focus:ring-2 focus:ring-blue-500 focus:ring-offset-2 dark:ring-offset-gray-950 transition-colors",menu:()=>"absolute z-50 w-56 bg-white dark:bg-gray-800 rounded-md shadow-lg focus:outline-none transition-all duration-200",menuSmall:()=>"w-40",menuLarge:()=>"w-72",menuAuto:()=>"w-auto min-w-40",menuTop:()=>"bottom-full mb-1",menuBottom:()=>"top-full mt-1",menuLeft:()=>"right-0",menuRight:()=>"left-0",menuEntering:()=>"opacity-0 scale-95 transform origin-top",menuEntered:()=>"opacity-100 scale-100 transform origin-top",menuExiting:()=>"opacity-0 scale-95 transform origin-top",itemContainer:()=>"py-1 px-1",item:()=>"flex items-center w-full text-left px-4 py-2 text-sm text-gray-700 dark:text-gray-300 hover:bg-blue-50 dark:hover:bg-blue-900/20 hover:text-blue-700 dark:hover:text-blue-300 transition-all duration-200 cursor-pointer hover:shadow-sm rounded-sm",itemActive:()=>"bg-blue-100 dark:bg-blue-900/30 text-blue-700 dark:text-blue-300 shadow-sm",itemDisabled:()=>"text-gray-400 dark:text-gray-600 cursor-not-allowed hover:bg-transparent hover:text-gray-400 dark:hover:text-gray-600",divider:()=>"my-1 border-t border-gray-200 dark:border-gray-700",header:()=>"px-4 py-2 text-xs font-medium text-gray-500 dark:text-gray-400 uppercase tracking-wide",itemIcon:()=>"mr-3 h-4 w-4 flex-shrink-0",itemIconRight:()=>"ml-auto h-4 w-4 flex-shrink-0"}}},Ln={success:"bg-green-500",error:"bg-red-500",warning:"bg-orange-500",attention:"bg-amber-500",info:"bg-blue-500",neutral:"bg-gray-500"};function Ce(e){return Ln[e]}const Mn={default:"bg-white dark:bg-gray-800",bordered:"bg-white dark:bg-gray-800 border border-gray-200 dark:border-gray-700",elevated:"bg-white dark:bg-gray-800 shadow-md",info:"bg-blue-50 dark:bg-blue-900/20 border border-blue-200 dark:border-blue-800 text-blue-900 dark:text-blue-300",success:"bg-green-50 dark:bg-green-900/20 border border-green-200 dark:border-green-800 text-green-900 dark:text-green-300",warning:"bg-orange-50 dark:bg-orange-900/20 border border-orange-200 dark:border-orange-800 text-orange-900 dark:text-orange-300",attention:"bg-amber-50 dark:bg-amber-900/20 border border-amber-200 dark:border-amber-800 text-amber-900 dark:text-amber-300",error:"bg-red-50 dark:bg-red-900/20 border border-red-200 dark:border-red-800 text-red-900 dark:text-red-300"};function Pn(e){return Mn[e]}const On={default:{container:"bg-gradient-to-r from-blue-600/10 to-purple-600/10 border border-blue-200 text-blue-600 backdrop-blur-sm",icon:"text-blue-600"},premium:{container:"bg-gradient-to-r from-blue-600/10 to-purple-600/10 border border-blue-200 text-blue-600 backdrop-blur-sm",icon:"text-blue-600"},primary:{container:"bg-gradient-to-r from-blue-600/10 to-purple-600/10 border border-blue-200 text-blue-600 backdrop-blur-sm",icon:"text-blue-600"},light:{container:"bg-white/20 border border-white/30 text-white backdrop-blur-sm",icon:"text-white"}};function Un(e){return On[e]}const Dn={border:{default:"border-gray-200 dark:border-gray-700"}},zn=({label:e,labelPosition:r="center",orientation:a="horizontal",spacing:n="md",thickness:o="thin",variant:s="light",className:l,lineClassName:c})=>{const d={horizontal:{none:"my-0",sm:"my-2",md:"my-4",lg:"my-6",xl:"my-8"},vertical:{none:"mx-0",sm:"mx-2",md:"mx-4",lg:"mx-6",xl:"mx-8"}},i={horizontal:{thin:"border-t",medium:"border-t-2",thick:"border-t-4"},vertical:{thin:"border-l",medium:"border-l-2",thick:"border-l-4"}},h={light:"border-gray-200 dark:border-gray-700",medium:"border-gray-300 dark:border-gray-600",dark:"border-gray-400 dark:border-gray-500"};if(a==="vertical")return t.jsx("div",{className:f("self-stretch",i.vertical[o],h[s],d.vertical[n],l),role:"separator","aria-orientation":"vertical"});if(!e)return t.jsx("hr",{className:f(i.horizontal[o],h[s],d.horizontal[n],c,l),role:"separator","aria-orientation":"horizontal"});const u={left:"justify-start",center:"justify-center",right:"justify-end"};return t.jsxs("div",{className:f("flex items-center",d.horizontal[n],u[r],l),role:"separator","aria-orientation":"horizontal",children:[r!=="left"&&t.jsx("div",{className:f("flex-1",i.horizontal[o],h[s],c)}),t.jsx("span",{className:f(D.body.sm(),"px-3 text-gray-500 dark:text-gray-400 whitespace-nowrap"),children:e}),r!=="right"&&t.jsx("div",{className:f("flex-1",i.horizontal[o],h[s],c)})]})},jn=({orientation:e="horizontal",spacing:r="md",thickness:a="thin",className:n})=>{const o={horizontal:{none:"",sm:"my-1",md:"my-2",lg:"my-4"},vertical:{none:"",sm:"mx-1",md:"mx-2",lg:"mx-4"}},s={horizontal:{thin:"h-px",medium:"h-0.5",thick:"h-1"},vertical:{thin:"w-px",medium:"w-0.5",thick:"w-1"}},l=e==="horizontal";return t.jsx("div",{role:"separator","aria-orientation":e,className:f("bg-gray-200 dark:bg-gray-700",l?"w-full":"h-full",s[e][a],o[e][r],n)})},_n=({children:e,variant:r="blue",position:a="left",width:n="thick",padding:o="md",className:s})=>{const l={blue:"border-blue-500 dark:border-blue-400",green:"border-green-500 dark:border-green-400",purple:"border-purple-500 dark:border-purple-400",indigo:"border-indigo-500 dark:border-indigo-400",emerald:"border-emerald-500 dark:border-emerald-400",orange:"border-orange-500 dark:border-orange-400",red:"border-red-500 dark:border-red-400",gray:"border-gray-400 dark:border-gray-500"},c={left:"border-l",right:"border-r",top:"border-t",bottom:"border-b"},d={thin:"2",medium:"3",thick:"4"},i={left:{sm:"pl-3",md:"pl-4",lg:"pl-6"},right:{sm:"pr-3",md:"pr-4",lg:"pr-6"},top:{sm:"pt-3",md:"pt-4",lg:"pt-6"},bottom:{sm:"pb-3",md:"pb-4",lg:"pb-6"}},h=`${c[a]}-${d[n]}`;return t.jsx("div",{className:f(h,l[r],i[a][o],s),children:e})},Bn=({children:e,title:r,position:a="bottom-right",collapsible:n=!0,defaultCollapsed:o=!1,closeable:s=!1,onClose:l,className:c})=>{const[d,i]=p.useState(o),h={"bottom-right":"bottom-4 right-4","bottom-left":"bottom-4 left-4","top-right":"top-4 right-4","top-left":"top-4 left-4"};return t.jsxs("div",{className:f("fixed z-50 w-80","bg-white dark:bg-gray-900","border border-gray-300 dark:border-gray-700","rounded-lg shadow-2xl",h[a],c),children:[(r||n||s)&&t.jsxs("div",{className:"flex items-center justify-between p-4 border-b border-gray-200 dark:border-gray-700",children:[r&&t.jsx("h3",{className:"font-semibold text-gray-900 dark:text-white",children:r}),t.jsxs("div",{className:"flex items-center gap-2",children:[n&&t.jsx("button",{onClick:()=>i(!d),className:"p-1 hover:bg-gray-100 dark:hover:bg-gray-800 rounded transition-colors","aria-label":d?"Expand":"Collapse",children:t.jsx("svg",{className:f("w-4 h-4 text-gray-600 dark:text-gray-400 transition-transform",d&&"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"})})}),s&&t.jsx("button",{onClick:l,className:"p-1 hover:bg-gray-100 dark:hover:bg-gray-800 rounded transition-colors","aria-label":"Close",children:t.jsx("svg",{className:"w-4 h-4 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:"M6 18L18 6M6 6l12 12"})})})]})]}),!d&&t.jsx("div",{className:"p-4",children:e})]})},Fn=({left:e,right:r,direction:a="horizontal",initialSplit:n=.5,split:o,onSplitChange:s,minLeftSize:l=100,minRightSize:c=100,dividerSize:d=8,resizable:i=!0,className:h})=>{const[u,y]=p.useState(n),[m,b]=p.useState(!1),v=p.useRef(null),k=o!==void 0?o:u,S=N=>{i&&(N.preventDefault(),b(!0))};p.useEffect(()=>{if(!m)return;const N=E=>{const I=v.current;if(!I)return;const x=I.getBoundingClientRect();let A;a==="horizontal"?A=(E.clientX-x.left)/x.width:A=(E.clientY-x.top)/x.height,A=Math.max(0,Math.min(1,A));const L=a==="horizontal"?x.width:x.height,O=typeof l=="string"?parseFloat(l)/100*L:l,M=typeof c=="string"?parseFloat(c)/100*L:c,U=O/L,B=1-M/L;A=Math.max(U,Math.min(B,A)),o!==void 0&&s?s(A):y(A)},C=()=>{b(!1)};return document.addEventListener("mousemove",N),document.addEventListener("mouseup",C),()=>{document.removeEventListener("mousemove",N),document.removeEventListener("mouseup",C)}},[m,a,l,c,o,s]),p.useEffect(()=>(m?(document.body.style.userSelect="none",document.body.style.cursor=a==="horizontal"?"col-resize":"row-resize"):(document.body.style.userSelect="",document.body.style.cursor=""),()=>{document.body.style.userSelect="",document.body.style.cursor=""}),[m,a]);const w=a==="horizontal";return t.jsxs("div",{ref:v,className:f("w-full h-full flex",w?"flex-row":"flex-col",h),children:[t.jsx("div",{className:"overflow-auto",style:{[w?"width":"height"]:`${k*100}%`},children:e}),t.jsx("div",{onMouseDown:S,className:f("flex-shrink-0 group","bg-gray-300 dark:bg-gray-700",i&&"hover:bg-blue-500 dark:hover:bg-blue-400","transition-colors",m&&"bg-blue-500 dark:bg-blue-400",w?"cursor-col-resize":"cursor-row-resize",!i&&"cursor-default"),style:{[w?"width":"height"]:`${d}px`},children:i&&t.jsx("div",{className:f("flex items-center justify-center w-full h-full","text-gray-600 dark:text-gray-400","group-hover:text-white",m&&"text-white"),children:w?t.jsxs("svg",{className:"w-4 h-4",fill:"currentColor",viewBox:"0 0 24 24",children:[t.jsx("circle",{cx:"10",cy:"6",r:"1.5"}),t.jsx("circle",{cx:"10",cy:"12",r:"1.5"}),t.jsx("circle",{cx:"10",cy:"18",r:"1.5"}),t.jsx("circle",{cx:"14",cy:"6",r:"1.5"}),t.jsx("circle",{cx:"14",cy:"12",r:"1.5"}),t.jsx("circle",{cx:"14",cy:"18",r:"1.5"})]}):t.jsxs("svg",{className:"w-4 h-4",fill:"currentColor",viewBox:"0 0 24 24",children:[t.jsx("circle",{cx:"6",cy:"10",r:"1.5"}),t.jsx("circle",{cx:"12",cy:"10",r:"1.5"}),t.jsx("circle",{cx:"18",cy:"10",r:"1.5"}),t.jsx("circle",{cx:"6",cy:"14",r:"1.5"}),t.jsx("circle",{cx:"12",cy:"14",r:"1.5"}),t.jsx("circle",{cx:"18",cy:"14",r:"1.5"})]})})}),t.jsx("div",{className:"overflow-auto flex-1",style:{[w?"width":"height"]:`${(1-k)*100}%`},children:r})]})},Wn=({children:e,defaultWidth:r=300,defaultHeight:a=200,minWidth:n=100,minHeight:o=100,maxWidth:s,maxHeight:l,directions:c=["right","bottom","bottom-right"],onResize:d,onResizeEnd:i,showHandles:h=!0,className:u})=>{const[y,m]=p.useState(r),[b,v]=p.useState(a),[k,S]=p.useState(!1),[w,N]=p.useState(null),C=p.useRef(null),E=p.useRef({x:0,y:0,width:0,height:0}),I=L=>O=>{O.preventDefault(),O.stopPropagation(),S(!0),N(L),E.current={x:O.clientX,y:O.clientY,width:y,height:b}};p.useEffect(()=>{if(!k||!w)return;const L=M=>{const U=M.clientX-E.current.x,B=M.clientY-E.current.y;let z=E.current.width,F=E.current.height;w.includes("right")?z=E.current.width+U:w.includes("left")&&(z=E.current.width-U),w.includes("bottom")?F=E.current.height+B:w.includes("top")&&(F=E.current.height-B),z=Math.max(n,z),F=Math.max(o,F),s&&(z=Math.min(s,z)),l&&(F=Math.min(l,F)),m(z),v(F),d&&d(z,F)},O=()=>{S(!1),N(null),i&&i(y,b)};return document.addEventListener("mousemove",L),document.addEventListener("mouseup",O),()=>{document.removeEventListener("mousemove",L),document.removeEventListener("mouseup",O)}},[k,w,y,b,n,o,s,l,d,i]);const x=p.useCallback(L=>({top:"ns-resize",right:"ew-resize",bottom:"ns-resize",left:"ew-resize","top-left":"nwse-resize","top-right":"nesw-resize","bottom-left":"nesw-resize","bottom-right":"nwse-resize"})[L],[]);p.useEffect(()=>(k?(document.body.style.userSelect="none",document.body.style.cursor=x(w)):(document.body.style.userSelect="",document.body.style.cursor=""),()=>{document.body.style.userSelect="",document.body.style.cursor=""}),[k,w,x]);const A=L=>{if(!c.includes(L))return null;const O={top:"top-0 left-0 right-0 h-1 cursor-ns-resize",right:"top-0 right-0 bottom-0 w-1 cursor-ew-resize",bottom:"bottom-0 left-0 right-0 h-1 cursor-ns-resize",left:"top-0 left-0 bottom-0 w-1 cursor-ew-resize","top-left":"top-0 left-0 w-3 h-3 cursor-nwse-resize","top-right":"top-0 right-0 w-3 h-3 cursor-nesw-resize","bottom-left":"bottom-0 left-0 w-3 h-3 cursor-nesw-resize","bottom-right":"bottom-0 right-0 w-3 h-3 cursor-nwse-resize"};return t.jsx("div",{className:f("absolute z-10",h&&"bg-blue-500 dark:bg-blue-400 opacity-0 hover:opacity-50",O[L]),onMouseDown:I(L)},L)};return t.jsxs("div",{ref:C,className:f("relative",u),style:{width:`${y}px`,height:`${b}px`},children:[e,["top","right","bottom","left","top-left","top-right","bottom-left","bottom-right"].map(A)]})},Vn=({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":"UresizableUpanels",children:r||"UresizableUpanels Component"}),$n=({children:e,maxHeight:r,hideScrollbar:a=!1,direction:n="vertical",className:o})=>{const s={vertical:"overflow-y-auto overflow-x-hidden",horizontal:"overflow-x-auto overflow-y-hidden",both:"overflow-auto"},l=a?"scrollbar-hide":f("scrollbar-thin","scrollbar-thumb-gray-300 dark:scrollbar-thumb-gray-600","scrollbar-track-gray-100 dark:scrollbar-track-gray-800","hover:scrollbar-thumb-gray-400 dark:hover:scrollbar-thumb-gray-500"),c=typeof r=="number"?`${r}px`:r;return t.jsx("div",{className:f("relative",s[n],l,o),style:c?{maxHeight:c}:void 0,children:e})},Hn=({children:e,columns:r=3,gap:a=16,breakpoints:n,className:o})=>{const[s,l]=p.useState(r),c=p.useRef(null);p.useEffect(()=>{if(!n)return;const h=()=>{const u=window.innerWidth,y=Object.keys(n).map(Number).sort((m,b)=>b-m);for(const m of y)if(u>=m){l(n[m]);return}l(r)};return h(),window.addEventListener("resize",h),()=>window.removeEventListener("resize",h)},[n,r]);const d=p.Children.toArray(e),i=Array.from({length:s},()=>[]);return d.forEach((h,u)=>{i[u%s].push(h)}),t.jsx("div",{ref:c,className:f("flex",o),style:{gap:`${a}px`},children:i.map((h,u)=>t.jsx("div",{className:"flex-1 flex flex-col",style:{gap:`${a}px`},children:h},u))})},be=({children:e,container:r})=>{const[a,n]=p.useState(!1);if(p.useEffect(()=>(n(!0),()=>n(!1)),[]),!a)return null;const o=r||document.body;return br.createPortal(e,o)},Qe=({isOpen:e,onClose:r,children:a,blur:n=!1,opacity:o="medium",zIndex:s=40,lockScroll:l=!0,className:c})=>{if(p.useEffect(()=>{if(l){if(e){const i=window.innerWidth-document.documentElement.clientWidth;document.body.style.overflow="hidden",document.body.style.paddingRight=`${i}px`}else document.body.style.overflow="",document.body.style.paddingRight="";return()=>{document.body.style.overflow="",document.body.style.paddingRight=""}}},[e,l]),!e)return null;const d={light:"bg-black/20 dark:bg-black/30",medium:"bg-black/50 dark:bg-black/60",dark:"bg-black/75 dark:bg-black/85"};return t.jsx(be,{children:t.jsx("div",{className:f("fixed inset-0","transition-opacity duration-300",n&&"backdrop-blur-sm",d[o],c),style:{zIndex:s},onClick:r,"aria-hidden":"true",children:a&&t.jsx("div",{className:"relative h-full w-full",onClick:i=>i.stopPropagation(),children:a})})})},st=({children:e,as:r="p",size:a="base",weight:n="normal",color:o="default",align:s,transform:l="none",truncate:c=!1,lineClamp:d,className:i})=>{const h={xs:"text-xs",sm:"text-sm",base:"text-base",lg:"text-lg",xl:"text-xl","2xl":"text-2xl","3xl":"text-3xl","4xl":"text-4xl"},u={light:"font-light",normal:"font-normal",medium:"font-medium",semibold:"font-semibold",bold:"font-bold"},y={default:"text-gray-900 dark:text-gray-100",muted:"text-gray-600 dark:text-gray-400",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"},m=s?{left:"text-left",center:"text-center",right:"text-right",justify:"text-justify"}[s]:"",b={none:"",uppercase:"uppercase",lowercase:"lowercase",capitalize:"capitalize"},v=d?{display:"-webkit-box",WebkitLineClamp:d,WebkitBoxOrient:"vertical",overflow:"hidden"}:void 0;return t.jsx(r,{className:f(h[a],u[n],y[o],m,b[l],c&&"truncate",d&&"overflow-hidden",i),style:v,children:e})},qn=({children:e,level:r=2,size:a,weight:n="bold",color:o="default",align:s,className:l})=>{const d=a||{1:"4xl",2:"3xl",3:"2xl",4:"xl",5:"lg",6:"base"}[r],i={"4xl":"text-4xl","3xl":"text-3xl","2xl":"text-2xl",xl:"text-xl",lg:"text-lg",base:"text-base"},h={normal:"font-normal",medium:"font-medium",semibold:"font-semibold",bold:"font-bold",extrabold:"font-extrabold"},u={default:"text-gray-900 dark:text-gray-100",muted:"text-gray-700 dark:text-gray-300",primary:"text-blue-600 dark:text-blue-400"},y=s?{left:"text-left",center:"text-center",right:"text-right"}[s]:"",m=`h${r}`;return p.createElement(m,{className:f(i[d],h[n],u[o],y,l)},e)},Gn=X.cva("",{variants:{variant:{hero:D.heading.display.hero(),display:D.heading.display.lg(),h1:D.heading.h1(),h2:D.heading.h2(),h3:D.heading.h3()},responsive:{true:"",false:""},align:{left:"text-left",center:"text-center",right:"text-right"},color:{default:"text-gray-900 dark:text-white",muted:"text-gray-600 dark:text-gray-400",vibrant:"text-white",brand:"bg-gradient-to-r from-blue-600 to-purple-600 bg-clip-text text-transparent"}},defaultVariants:{variant:"h1",responsive:!0,align:"left",color:"default"}}),Yn=({children:e,variant:r="h1",responsive:a=!0,align:n="left",color:o="default",className:s,as:l})=>{const c=l||(r==="hero"||r==="display"||r==="h1"?"h1":r==="h2"?"h2":"h3");return t.jsx(c,{className:f(Gn({variant:r,responsive:a,align:n,color:o}),s),children:e})},Kn=X.cva("",{variants:{variant:{h2:D.heading.h2(),h3:D.heading.h3(),h4:D.heading.h4(),h5:D.heading.h5(),h6:D.heading.h6()},spacing:{none:"",sm:"mb-2",md:"mb-4",lg:"mb-6",xl:"mb-8"},align:{left:"text-left",center:"text-center",right:"text-right"}},defaultVariants:{variant:"h2",spacing:"md",align:"left"}}),Xn=({children:e,variant:r="h2",spacing:a="md",align:n="left",className:o,as:s})=>{const l=s||r;return p.createElement(l,{className:f(Kn({variant:r,spacing:a,align:n}),o)},e)},Zn=X.cva("",{variants:{variant:{body:D.body.md(),lead:D.body.lg(),large:D.body.lg(),small:D.body.sm(),caption:D.body.xs()},color:{default:"text-gray-700 dark:text-gray-300",muted:"text-gray-500 dark:text-gray-500",primary:"text-gray-900 dark:text-white"},align:{left:"text-left",center:"text-center",right:"text-right",justify:"text-justify"}},defaultVariants:{variant:"body",color:"default",align:"left"}}),Jn=({children:e,variant:r="body",color:a="default",align:n="left",className:o,as:s="p"})=>p.createElement(s,{className:f(Zn({variant:r,color:a,align:n}),o)},e),Qn=X.cva(D.link.default(),{variants:{variant:{default:D.link.default(),subtle:D.link.subtle(),muted:D.link.muted(),button:"inline-flex items-center justify-center px-4 py-2 rounded-md bg-blue-600 text-white hover:bg-blue-700 transition-colors"},external:{true:"inline-flex items-center gap-1",false:""}},defaultVariants:{variant:"default",external:!1}}),Rn=({children:e,href:r,variant:a="default",external:n=!1,className:o,target:s,rel:l})=>t.jsxs("a",{href:r,target:s||(n?"_blank":void 0),rel:l||(n?"noopener noreferrer":void 0),className:f(Qn({variant:a,external:n}),o),children:[e,n&&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:"M10 6H6a2 2 0 00-2 2v10a2 2 0 002 2h10a2 2 0 002-2v-4M14 4h6m0 0v6m0-6L10 14"})})]}),eo=({children:e,size:r="md",variant:a="default",className:n})=>{const o={sm:"text-xs px-1 py-0.5",md:"text-sm px-1.5 py-0.5",lg:"text-base px-2 py-1"},s={default:"bg-gray-100 dark:bg-gray-800 text-gray-900 dark:text-gray-100",primary:"bg-blue-50 dark:bg-blue-900/30 text-blue-700 dark:text-blue-300",success:"bg-green-50 dark:bg-green-900/30 text-green-700 dark:text-green-300",warning:"bg-yellow-50 dark:bg-yellow-900/30 text-yellow-700 dark:text-yellow-300",danger:"bg-red-50 dark:bg-red-900/30 text-red-700 dark:text-red-300"};return t.jsx("code",{className:f("inline-block font-mono font-medium rounded",o[r],s[a],n),children:e})},ro=({children:e,variant:r="primary",size:a="md",inline:n=!1,align:o="left",className:s,wrap:l=!1})=>{const c={primary:"text-blue-600 dark:text-blue-400 bg-blue-50 dark:bg-blue-900/30",secondary:"text-purple-600 dark:text-purple-400 bg-purple-50 dark:bg-purple-900/30",success:"text-green-600 dark:text-green-400 bg-green-50 dark:bg-green-900/30",warning:"text-yellow-700 dark:text-yellow-400 bg-yellow-50 dark:bg-yellow-900/30",neutral:"text-gray-700 dark:text-gray-300 bg-gray-100 dark:bg-gray-800"},d={xs:{text:"text-xs",padding:n?"px-1.5 py-0.5":"px-2 py-1"},sm:{text:"text-sm",padding:n?"px-2 py-0.5":"px-3 py-1.5"},md:{text:"text-base",padding:n?"px-2.5 py-1":"px-4 py-2"},lg:{text:"text-lg",padding:n?"px-3 py-1":"px-4 py-2"}},i={left:"text-left",center:"text-center",right:"text-right"},h=d[a],u=n?"code":"div";return t.jsx(u,{className:f("font-mono rounded-lg",c[r],h.text,h.padding,!n&&i[o],n?"inline-block":"block",!l&&"overflow-x-auto whitespace-nowrap",l&&"break-all",s),children:e})},to=({children:e,size:r="md",className:a})=>{const n={sm:"text-xs px-1.5 py-0.5",md:"text-sm px-2 py-1",lg:"text-base px-2.5 py-1.5"};return t.jsx("kbd",{className:f("inline-flex items-center justify-center","font-mono font-semibold","bg-gray-100 dark:bg-gray-800","text-gray-900 dark:text-gray-100","border border-gray-300 dark:border-gray-600","rounded shadow-sm",n[r],a),children:e})},ao=({children:e,cite:r,variant:a="default",size:n="md",className:o})=>{const s={sm:"text-sm p-3",md:"text-base p-4",lg:"text-lg p-6"},l={sm:"text-xs",md:"text-sm",lg:"text-base"},c={default:"border-l-4 border-gray-300 dark:border-gray-600 bg-gray-50 dark:bg-gray-800/50",bordered:"border border-gray-300 dark:border-gray-600 bg-white dark:bg-gray-800",accent:"border-l-4 border-blue-500 dark:border-blue-400 bg-blue-50 dark:bg-blue-900/20"};return t.jsxs("blockquote",{className:f("rounded-r-lg",s[n],c[a],o),children:[t.jsx("p",{className:"text-gray-800 dark:text-gray-200 italic",children:e}),r&&t.jsxs("footer",{className:f("mt-2 text-gray-600 dark:text-gray-400",l[n]),children:["— ",t.jsx("cite",{className:"not-italic font-medium",children:r})]})]})},no=({children:e,variant:r="default",showIcon:a=!1,size:n="sm",className:o})=>{const s={sm:"text-sm",base:"text-base"},l={sm:"h-4 w-4",base:"h-5 w-5"},d={default:{text:"text-gray-600 dark:text-gray-400",icon:P.InformationCircleIcon},error:{text:"text-red-600 dark:text-red-400",icon:P.ExclamationCircleIcon},success:{text:"text-green-600 dark:text-green-400",icon:P.CheckCircleIcon},warning:{text:"text-yellow-600 dark:text-yellow-400",icon:P.ExclamationCircleIcon}}[r],i=d.icon;return t.jsxs("div",{className:f("flex items-start gap-1.5",o),children:[a&&t.jsx(i,{className:f(l[n],d.text,"flex-shrink-0 mt-0.5")}),t.jsx("p",{className:f(s[n],d.text),children:e})]})},oo=({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":"UscreenUreaderUtext",children:r||"UscreenUreaderUtext Component"}),so=({children:e,maxLength:r=50,position:a="end",ellipsis:n="...",showTooltip:o=!0,className:s})=>{const l=e||"";if(l.length<=r)return t.jsx("span",{className:s,children:l});const d=(()=>{const i=n.length,h=r-i;switch(a){case"start":return n+l.slice(l.length-h);case"middle":{const u=Math.floor(h/2),y=l.slice(0,u),m=l.slice(l.length-(h-u));return y+n+m}case"end":default:return l.slice(0,h)+n}})();return t.jsx("span",{className:f("inline-block",s),title:o?l:void 0,children:d})},lo=({value:e,style:r="decimal",currency:a="USD",unit:n,minimumFractionDigits:o,maximumFractionDigits:s,locale:l="en-US",notation:c="standard",className:d})=>{const i=()=>{try{const h={style:r,notation:c,minimumFractionDigits:o,maximumFractionDigits:s};return r==="currency"&&(h.currency=a),r==="unit"&&n&&(h.unit=n),new Intl.NumberFormat(l,h).format(e)}catch(h){return console.error("Number formatting error:",h),e.toLocaleString(l)}};return t.jsx("span",{className:f(d),children:i()})},io=({date:e,showTooltip:r=!0,updateInterval:a=0,className:n})=>{const[,o]=p.useState(0),s=p.useMemo(()=>e instanceof Date?e:new Date(e),[e]);p.useEffect(()=>{if(a===0)return;const i=setInterval(()=>{o(h=>h+1)},a*1e3);return()=>clearInterval(i)},[a]);const c=(()=>{const h=new Date().getTime()-s.getTime(),u=Math.floor(h/1e3),y=Math.floor(u/60),m=Math.floor(y/60),b=Math.floor(m/24),v=Math.floor(b/7),k=Math.floor(b/30),S=Math.floor(b/365);return u<60?"just now":y<60?`${y} ${y===1?"minute":"minutes"} ago`:m<24?`${m} ${m===1?"hour":"hours"} ago`:b<7?`${b} ${b===1?"day":"days"} ago`:v<4?`${v} ${v===1?"week":"weeks"} ago`:k<12?`${k} ${k===1?"month":"months"} ago`:`${S} ${S===1?"year":"years"} ago`})(),d=s.toLocaleString();return t.jsx("time",{dateTime:s.toISOString(),title:r?d:void 0,className:f(n),children:c})},Se=({size:e="default",variant:r="default",className:a,ariaLabel:n="Loading",loadingText:o="Loading..."})=>{const s=()=>{const l={small:"w-4 h-4",default:"w-6 h-6",large:"w-8 h-8",extraLarge:"w-16 h-16 border-4"},c={default:"border-gray-300 border-t-blue-600",white:"border-white/30 border-t-white",success:"border-gray-300 border-t-green-600",warning:"border-gray-300 border-t-orange-600",error:"border-gray-300 border-t-red-600"};return`animate-spin rounded-full border-2 ${l[e]} ${c[r]}`};return t.jsx("div",{className:f(s(),a),role:"status","aria-label":n,children:t.jsx("span",{className:"sr-only",children:o})})},co=({isLoading:e,message:r,mode:a="fullscreen",blur:n=!1,spinnerSize:o="large",className:s})=>e?t.jsxs("div",{className:f(a==="fullscreen"?"fixed":"absolute","inset-0 z-50","flex flex-col items-center justify-center","bg-white/80 dark:bg-gray-900/80",n&&"backdrop-blur-sm",s),role:"alert","aria-live":"polite","aria-busy":"true",children:[t.jsx(Se,{size:o}),r&&t.jsx("p",{className:f(D.body.md(),"text-gray-700 dark:text-gray-300 mt-4"),children:r})]}):null,go=({size:e="md",variant:r="primary",color:a,className:n})=>{const o={sm:"w-1.5 h-1.5",md:"w-2 h-2",lg:"w-3 h-3"},s={primary:"bg-blue-600 dark:bg-blue-500",secondary:"bg-gray-600 dark:bg-gray-400",white:"bg-white"},l=f("rounded-full",o[e],a?"":s[r]);return t.jsxs("div",{className:f("flex items-center gap-1",n),children:[t.jsx("div",{className:l,style:{backgroundColor:a,animation:"loading-dot-bounce 1.4s infinite ease-in-out both",animationDelay:"-0.32s"}}),t.jsx("div",{className:l,style:{backgroundColor:a,animation:"loading-dot-bounce 1.4s infinite ease-in-out both",animationDelay:"-0.16s"}}),t.jsx("div",{className:l,style:{backgroundColor:a,animation:"loading-dot-bounce 1.4s infinite ease-in-out both"}}),t.jsx("style",{children:`
1
+ (function(d,ue){typeof exports=="object"&&typeof module<"u"?ue(exports,require("clsx"),require("tailwind-merge"),require("react/jsx-runtime"),require("react"),require("class-variance-authority"),require("@sudobility/design"),require("react-dom"),require("@heroicons/react/24/outline"),require("@heroicons/react/24/solid"),require("@sudobility/types"),require("@radix-ui/react-switch"),require("@radix-ui/react-select"),require("@heroicons/react/20/solid"),require("@radix-ui/react-label"),require("@radix-ui/react-slot"),require("react-router-dom"),require("@radix-ui/react-tabs"),require("react-i18next"),require("web-vitals")):typeof define=="function"&&define.amd?define(["exports","clsx","tailwind-merge","react/jsx-runtime","react","class-variance-authority","@sudobility/design","react-dom","@heroicons/react/24/outline","@heroicons/react/24/solid","@sudobility/types","@radix-ui/react-switch","@radix-ui/react-select","@heroicons/react/20/solid","@radix-ui/react-label","@radix-ui/react-slot","react-router-dom","@radix-ui/react-tabs","react-i18next","web-vitals"],ue):(d=typeof globalThis<"u"?globalThis:d||self,ue(d.MailBoxComponents={},d.clsx,d.tailwindMerge,d.ReactJSXRuntime,d.React,d.cva,d.SudobilityDesign,d.ReactDOM,d.HeroiconsOutline,d.HeroiconsSolid,d.SudobilityTypes,d.RadixSwitch,d.RadixSelect,d.HeroiconsSolid20,d.RadixLabel,d.RadixSlot,d.ReactRouterDOM,d.RadixTabs,d.ReactI18next,d.WebVitals))})(this,(function(d,ue,ra,e,b,W,T,We,z,ee,Z,He,ta,he,Sr,aa,H,re,Ne,fe){"use strict";function Lr(t){const r=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const a in t)if(a!=="default"){const o=Object.getOwnPropertyDescriptor(t,a);Object.defineProperty(r,a,o.get?o:{enumerable:!0,get:()=>t[a]})}}return r.default=t,Object.freeze(r)}const V=Lr(b),F=Lr(ta);function u(...t){return ra.twMerge(ue.clsx(t))}const Er=({children:t,as:r="div",p:a,px:o,py:s,m:n,mx:l,my:i,bg:g,border:c=!1,rounded:h,shadow:f,w:v,h:p,className:m})=>{const y={none:"0",xs:"1",sm:"2",md:"4",lg:"6",xl:"8","2xl":"12",auto:"auto"},x=g?{transparent:"bg-transparent",white:"bg-white dark:bg-gray-900",gray:"bg-gray-100 dark:bg-gray-800",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"}[g]:"",N=h?{none:"rounded-none",sm:"rounded-sm",md:"rounded-md",lg:"rounded-lg",xl:"rounded-xl",full:"rounded-full"}[h]:"",k=f?{none:"shadow-none",sm:"shadow-sm",md:"shadow-md",lg:"shadow-lg",xl:"shadow-xl"}[f]:"",S=v?{auto:"w-auto",full:"w-full",screen:"w-screen",min:"w-min",max:"w-max"}[v]:"",w=p?{auto:"h-auto",full:"h-full",screen:"h-screen",min:"h-min",max:"h-max"}[p]:"",C=[];a&&C.push("p-"+y[a]),o&&C.push("px-"+y[o]),s&&C.push("py-"+y[s]);const E=[];return n&&E.push("m-"+y[n]),l&&E.push("mx-"+y[l]),i&&E.push("my-"+y[i]),e.jsx(r,{className:u(...C,...E,x,c&&"border border-gray-200 dark:border-gray-700",N,k,S,w,m),children:t})},oa=({direction:t="row",align:r,justify:a,wrap:o="nowrap",gap:s,inline:n=!1,className:l,...i})=>{const g={row:"flex-row","row-reverse":"flex-row-reverse",col:"flex-col","col-reverse":"flex-col-reverse"},c=r?{start:"items-start",center:"items-center",end:"items-end",stretch:"items-stretch",baseline:"items-baseline"}[r]:"",h=a?{start:"justify-start",center:"justify-center",end:"justify-end",between:"justify-between",around:"justify-around",evenly:"justify-evenly"}[a]:"",f={nowrap:"flex-nowrap",wrap:"flex-wrap","wrap-reverse":"flex-wrap-reverse"},v=s?{none:"gap-0",xs:"gap-1",sm:"gap-2",md:"gap-4",lg:"gap-6",xl:"gap-8","2xl":"gap-12"}[s]:"";return e.jsx(Er,{...i,className:u(n?"inline-flex":"flex",g[t],c,h,f[o],v,l)})},sa=({children:t,size:r="xl",center:a=!0,padding:o="md",className:s})=>{const n={sm:"max-w-screen-sm",md:"max-w-screen-md",lg:"max-w-screen-lg",xl:"max-w-screen-xl","2xl":"max-w-screen-2xl",full:"max-w-full"},l={none:"",sm:"px-4 py-2",md:"px-6 py-4",lg:"px-8 py-6"};return e.jsx("div",{className:u("w-full",n[r],a&&"mx-auto",l[o],s),children:t})},na=({children:t,cols:r=1,gap:a="md",autoFit:o,autoFill:s,alignItems:n="stretch",justifyItems:l="stretch",className:i})=>{const g={none:"gap-0",xs:"gap-1",sm:"gap-2",md:"gap-4",lg:"gap-6",xl:"gap-8","2xl":"gap-12"},c={start:"items-start",center:"items-center",end:"items-end",stretch:"items-stretch"},h={start:"justify-items-start",center:"justify-items-center",end:"justify-items-end",stretch:"justify-items-stretch"},f=()=>{if(o||s)return"";if(typeof r=="number")return{1:"grid-cols-1",2:"grid-cols-2",3:"grid-cols-3",4:"grid-cols-4",5:"grid-cols-5",6:"grid-cols-6",7:"grid-cols-7",8:"grid-cols-8",9:"grid-cols-9",10:"grid-cols-10",11:"grid-cols-11",12:"grid-cols-12"}[r]||"grid-cols-1";const p=[];return r.sm&&p.push("grid-cols-"+r.sm),r.md&&p.push("md:grid-cols-"+r.md),r.lg&&p.push("lg:grid-cols-"+r.lg),r.xl&&p.push("xl:grid-cols-"+r.xl),p.join(" ")};let v;return o?v="repeat(auto-fit, minmax("+o+", 1fr))":s&&(v="repeat(auto-fill, minmax("+s+", 1fr))"),e.jsx("div",{className:u("grid",f(),g[a],c[n],h[l],i),style:v?{gridTemplateColumns:v}:void 0,children:t})},_e=({children:t,direction:r="vertical",spacing:a="md",align:o="stretch",justify:s="start",wrap:n=!1,full:l=!1,divider:i=!1,className:g})=>{const c=r==="vertical",h={vertical:{none:"",xs:"space-y-1",sm:"space-y-2",md:"space-y-4",lg:"space-y-6",xl:"space-y-8","2xl":"space-y-12"},horizontal:{none:"",xs:"space-x-1",sm:"space-x-2",md:"space-x-4",lg:"space-x-6",xl:"space-x-8","2xl":"space-x-12"}},f={vertical:{none:"",xs:"gap-1",sm:"gap-2",md:"gap-4",lg:"gap-6",xl:"gap-8","2xl":"gap-12"},horizontal:{none:"",xs:"gap-1",sm:"gap-2",md:"gap-4",lg:"gap-6",xl:"gap-8","2xl":"gap-12"}},v={start:"items-start",center:"items-center",end:"items-end",stretch:"items-stretch",baseline:"items-baseline"},p={start:"justify-start",center:"justify-center",end:"justify-end",between:"justify-between",around:"justify-around",evenly:"justify-evenly"};return e.jsx("div",{className:u("flex",c?"flex-col":"flex-row",i?f[r][a]:h[r][a],v[o],p[s],n&&"flex-wrap",l&&(c?"h-full":"w-full"),g),children:i?b.Children.map(t,(m,y)=>e.jsxs(b.Fragment,{children:[m,y<b.Children.count(t)-1&&e.jsx("div",{className:u("bg-gray-200 dark:bg-gray-700",c?"h-px w-full":"w-px h-full")})]},y)):t})},la=t=>e.jsx(_e,{direction:"vertical",...t}),ia=t=>e.jsx(_e,{direction:"horizontal",...t}),ca=({children:t,axis:r="both",inline:a=!1,className:o})=>{const s=()=>{switch(r){case"horizontal":return"justify-center";case"vertical":return"items-center";case"both":default:return"justify-center items-center"}};return e.jsx("div",{className:u(a?"inline-flex":"flex",s(),o),children:t})},da=({size:t="md",axis:r="vertical",flex:a=!1,className:o})=>{const s={vertical:{xs:"h-1",sm:"h-2",md:"h-4",lg:"h-6",xl:"h-8","2xl":"h-12"},horizontal:{xs:"w-1",sm:"w-2",md:"w-4",lg:"w-6",xl:"w-8","2xl":"w-12"}},n=typeof t=="number"?r==="vertical"?{height:`${t}px`}:{width:`${t}px`}:void 0,l=typeof t=="string"?s[r][t]:"";return e.jsx("div",{className:u(a&&"flex-1",!a&&l,o),style:n,"aria-hidden":"true"})},ga=W.cva("",{variants:{variant:{default:"",hero:"relative overflow-hidden",feature:"bg-white dark:bg-gray-800",cta:"relative overflow-hidden",testimonial:"bg-gray-50 dark:bg-gray-900",footer:"bg-white dark:bg-gray-800 border-gray-200 dark:border-gray-700 border-t"},spacing:{none:"",xs:"py-2",sm:"py-3",md:"py-4",lg:"py-6",xl:"py-8","2xl":"py-12","3xl":"py-16","4xl":"py-20","5xl":"py-24"},background:{none:"bg-transparent",default:"bg-gray-50 dark:bg-gray-900",surface:"bg-white dark:bg-gray-800",gradient:"bg-gradient-to-br from-gray-50 via-blue-50 to-purple-50 dark:from-gray-900 dark:via-blue-900/50 dark:to-purple-900/50","gradient-primary":"bg-gradient-to-br from-blue-50 to-indigo-100 dark:from-blue-900/50 dark:to-indigo-900/50","gradient-secondary":"bg-gradient-to-br from-green-50 to-blue-100 dark:from-green-900/50 dark:to-blue-900/50","gradient-tertiary":"bg-gradient-to-r from-emerald-50 to-teal-50 dark:from-gray-800 dark:to-gray-900","gradient-vibrant":"bg-gradient-to-br from-blue-800 to-purple-800 dark:from-blue-900 dark:to-purple-900"}},defaultVariants:{variant:"default",spacing:"3xl",background:"none"}}),ua={sm:"max-w-sm",md:"max-w-md",lg:"max-w-lg",xl:"max-w-xl","2xl":"max-w-2xl","3xl":"max-w-3xl","4xl":"max-w-4xl","5xl":"max-w-5xl","6xl":"max-w-6xl","7xl":"max-w-7xl",full:"max-w-full"},ha=({children:t,variant:r="default",spacing:a="3xl",background:o="none",maxWidth:s="7xl",className:n,containerClassName:l,as:i="section",id:g,fullWidth:c=!1})=>{const h=c?t:e.jsx("div",{className:u(ua[s],"mx-auto px-4 sm:px-6 lg:px-8",l),children:t});return b.createElement(i,{id:g,className:u(ga({variant:r,spacing:a,background:o}),n)},h)},fa=W.cva("min-h-screen flex flex-col",{variants:{background:{default:"bg-gray-50 dark:bg-gray-900",surface:"bg-white dark:bg-gray-800",transparent:"bg-transparent",gradient:"bg-gradient-to-br from-gray-50 via-blue-50 to-purple-50 dark:from-gray-900 dark:via-blue-900/20 dark:to-purple-900/20"},overflow:{visible:"overflow-visible",hidden:"overflow-hidden",scroll:"overflow-auto"}},defaultVariants:{background:"default",overflow:"visible"}}),ba=({children:t,background:r="default",overflow:a="visible",className:o})=>e.jsx("div",{className:u(fa({background:r,overflow:a}),o),children:t}),ma=({children:t,ratio:r="16/9",className:a})=>{const n=`${1/(typeof r=="string"?{"16/9":1.7777777777777777,"4/3":1.3333333333333333,"1/1":1,"21/9":2.3333333333333335,"3/2":1.5}[r]:r)*100}%`;return e.jsx("div",{className:u("relative w-full",a),style:{paddingBottom:n},children:e.jsx("div",{className:"absolute inset-0",children:t})})},pa=({label:t,labelPosition:r="center",orientation:a="horizontal",spacing:o="md",thickness:s="thin",variant:n="light",className:l,lineClassName:i})=>{const g={horizontal:{none:"my-0",sm:"my-2",md:"my-4",lg:"my-6",xl:"my-8"},vertical:{none:"mx-0",sm:"mx-2",md:"mx-4",lg:"mx-6",xl:"mx-8"}},c={horizontal:{thin:"border-t",medium:"border-t-2",thick:"border-t-4"},vertical:{thin:"border-l",medium:"border-l-2",thick:"border-l-4"}},h={light:"border-gray-200 dark:border-gray-700",medium:"border-gray-300 dark:border-gray-600",dark:"border-gray-400 dark:border-gray-500"};if(a==="vertical")return e.jsx("div",{className:u("self-stretch",c.vertical[s],h[n],g.vertical[o],l),role:"separator","aria-orientation":"vertical"});if(!t)return e.jsx("hr",{className:u(c.horizontal[s],h[n],g.horizontal[o],i,l),role:"separator","aria-orientation":"horizontal"});const f={left:"justify-start",center:"justify-center",right:"justify-end"};return e.jsxs("div",{className:u("flex items-center",g.horizontal[o],f[r],l),role:"separator","aria-orientation":"horizontal",children:[r!=="left"&&e.jsx("div",{className:u("flex-1",c.horizontal[s],h[n],i)}),e.jsx("span",{className:u(T.textVariants.body.sm(),"px-3 text-gray-500 dark:text-gray-400 whitespace-nowrap"),children:t}),r!=="right"&&e.jsx("div",{className:u("flex-1",c.horizontal[s],h[n],i)})]})},ya=({orientation:t="horizontal",spacing:r="md",thickness:a="thin",className:o})=>{const s={horizontal:{none:"",sm:"my-1",md:"my-2",lg:"my-4"},vertical:{none:"",sm:"mx-1",md:"mx-2",lg:"mx-4"}},n={horizontal:{thin:"h-px",medium:"h-0.5",thick:"h-1"},vertical:{thin:"w-px",medium:"w-0.5",thick:"w-1"}},l=t==="horizontal";return e.jsx("div",{role:"separator","aria-orientation":t,className:u("bg-gray-200 dark:bg-gray-700",l?"w-full":"h-full",n[t][a],s[t][r],o)})},va=({children:t,variant:r="blue",position:a="left",width:o="thick",padding:s="md",className:n})=>{const l={blue:"border-blue-500 dark:border-blue-400",green:"border-green-500 dark:border-green-400",purple:"border-purple-500 dark:border-purple-400",indigo:"border-indigo-500 dark:border-indigo-400",emerald:"border-emerald-500 dark:border-emerald-400",orange:"border-orange-500 dark:border-orange-400",red:"border-red-500 dark:border-red-400",gray:"border-gray-400 dark:border-gray-500"},i={left:"border-l",right:"border-r",top:"border-t",bottom:"border-b"},g={thin:"2",medium:"3",thick:"4"},c={left:{sm:"pl-3",md:"pl-4",lg:"pl-6"},right:{sm:"pr-3",md:"pr-4",lg:"pr-6"},top:{sm:"pt-3",md:"pt-4",lg:"pt-6"},bottom:{sm:"pb-3",md:"pb-4",lg:"pb-6"}},h=`${i[a]}-${g[o]}`;return e.jsx("div",{className:u(h,l[r],c[a][s],n),children:t})},xa=({children:t,title:r,position:a="bottom-right",collapsible:o=!0,defaultCollapsed:s=!1,closeable:n=!1,onClose:l,className:i})=>{const[g,c]=b.useState(s),h={"bottom-right":"bottom-4 right-4","bottom-left":"bottom-4 left-4","top-right":"top-4 right-4","top-left":"top-4 left-4"};return e.jsxs("div",{className:u("fixed z-50 w-80","bg-white dark:bg-gray-900","border border-gray-300 dark:border-gray-700","rounded-lg shadow-2xl",h[a],i),children:[(r||o||n)&&e.jsxs("div",{className:"flex items-center justify-between p-4 border-b border-gray-200 dark:border-gray-700",children:[r&&e.jsx("h3",{className:"font-semibold text-gray-900 dark:text-white",children:r}),e.jsxs("div",{className:"flex items-center gap-2",children:[o&&e.jsx("button",{onClick:()=>c(!g),className:"p-1 hover:bg-gray-100 dark:hover:bg-gray-800 rounded transition-colors","aria-label":g?"Expand":"Collapse",children:e.jsx("svg",{className:u("w-4 h-4 text-gray-600 dark:text-gray-400 transition-transform",g&&"rotate-180"),fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 9l-7 7-7-7"})})}),n&&e.jsx("button",{onClick:l,className:"p-1 hover:bg-gray-100 dark:hover:bg-gray-800 rounded transition-colors","aria-label":"Close",children:e.jsx("svg",{className:"w-4 h-4 text-gray-600 dark:text-gray-400",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})})]})]}),!g&&e.jsx("div",{className:"p-4",children:t})]})},ka=({left:t,right:r,direction:a="horizontal",initialSplit:o=.5,split:s,onSplitChange:n,minLeftSize:l=100,minRightSize:i=100,dividerSize:g=8,resizable:c=!0,className:h})=>{const[f,v]=b.useState(o),[p,m]=b.useState(!1),y=b.useRef(null),x=s!==void 0?s:f,N=S=>{c&&(S.preventDefault(),m(!0))};b.useEffect(()=>{if(!p)return;const S=C=>{const E=y.current;if(!E)return;const M=E.getBoundingClientRect();let L;a==="horizontal"?L=(C.clientX-M.left)/M.width:L=(C.clientY-M.top)/M.height,L=Math.max(0,Math.min(1,L));const I=a==="horizontal"?M.width:M.height,U=typeof l=="string"?parseFloat(l)/100*I:l,P=typeof i=="string"?parseFloat(i)/100*I:i,A=U/I,D=1-P/I;L=Math.max(A,Math.min(D,L)),s!==void 0&&n?n(L):v(L)},w=()=>{m(!1)};return document.addEventListener("mousemove",S),document.addEventListener("mouseup",w),()=>{document.removeEventListener("mousemove",S),document.removeEventListener("mouseup",w)}},[p,a,l,i,s,n]),b.useEffect(()=>(p?(document.body.style.userSelect="none",document.body.style.cursor=a==="horizontal"?"col-resize":"row-resize"):(document.body.style.userSelect="",document.body.style.cursor=""),()=>{document.body.style.userSelect="",document.body.style.cursor=""}),[p,a]);const k=a==="horizontal";return e.jsxs("div",{ref:y,className:u("w-full h-full flex",k?"flex-row":"flex-col",h),children:[e.jsx("div",{className:"overflow-auto",style:{[k?"width":"height"]:`${x*100}%`},children:t}),e.jsx("div",{onMouseDown:N,className:u("flex-shrink-0 group","bg-gray-300 dark:bg-gray-700",c&&"hover:bg-blue-500 dark:hover:bg-blue-400","transition-colors",p&&"bg-blue-500 dark:bg-blue-400",k?"cursor-col-resize":"cursor-row-resize",!c&&"cursor-default"),style:{[k?"width":"height"]:`${g}px`},children:c&&e.jsx("div",{className:u("flex items-center justify-center w-full h-full","text-gray-600 dark:text-gray-400","group-hover:text-white",p&&"text-white"),children:k?e.jsxs("svg",{className:"w-4 h-4",fill:"currentColor",viewBox:"0 0 24 24",children:[e.jsx("circle",{cx:"10",cy:"6",r:"1.5"}),e.jsx("circle",{cx:"10",cy:"12",r:"1.5"}),e.jsx("circle",{cx:"10",cy:"18",r:"1.5"}),e.jsx("circle",{cx:"14",cy:"6",r:"1.5"}),e.jsx("circle",{cx:"14",cy:"12",r:"1.5"}),e.jsx("circle",{cx:"14",cy:"18",r:"1.5"})]}):e.jsxs("svg",{className:"w-4 h-4",fill:"currentColor",viewBox:"0 0 24 24",children:[e.jsx("circle",{cx:"6",cy:"10",r:"1.5"}),e.jsx("circle",{cx:"12",cy:"10",r:"1.5"}),e.jsx("circle",{cx:"18",cy:"10",r:"1.5"}),e.jsx("circle",{cx:"6",cy:"14",r:"1.5"}),e.jsx("circle",{cx:"12",cy:"14",r:"1.5"}),e.jsx("circle",{cx:"18",cy:"14",r:"1.5"})]})})}),e.jsx("div",{className:"overflow-auto flex-1",style:{[k?"width":"height"]:`${(1-x)*100}%`},children:r})]})},wa=({children:t,defaultWidth:r=300,defaultHeight:a=200,minWidth:o=100,minHeight:s=100,maxWidth:n,maxHeight:l,directions:i=["right","bottom","bottom-right"],onResize:g,onResizeEnd:c,showHandles:h=!0,className:f})=>{const[v,p]=b.useState(r),[m,y]=b.useState(a),[x,N]=b.useState(!1),[k,S]=b.useState(null),w=b.useRef(null),C=b.useRef({x:0,y:0,width:0,height:0}),E=I=>U=>{U.preventDefault(),U.stopPropagation(),N(!0),S(I),C.current={x:U.clientX,y:U.clientY,width:v,height:m}};b.useEffect(()=>{if(!x||!k)return;const I=P=>{const A=P.clientX-C.current.x,D=P.clientY-C.current.y;let $=C.current.width,B=C.current.height;k.includes("right")?$=C.current.width+A:k.includes("left")&&($=C.current.width-A),k.includes("bottom")?B=C.current.height+D:k.includes("top")&&(B=C.current.height-D),$=Math.max(o,$),B=Math.max(s,B),n&&($=Math.min(n,$)),l&&(B=Math.min(l,B)),p($),y(B),g&&g($,B)},U=()=>{N(!1),S(null),c&&c(v,m)};return document.addEventListener("mousemove",I),document.addEventListener("mouseup",U),()=>{document.removeEventListener("mousemove",I),document.removeEventListener("mouseup",U)}},[x,k,v,m,o,s,n,l,g,c]);const M=b.useCallback(I=>({top:"ns-resize",right:"ew-resize",bottom:"ns-resize",left:"ew-resize","top-left":"nwse-resize","top-right":"nesw-resize","bottom-left":"nesw-resize","bottom-right":"nwse-resize"})[I],[]);b.useEffect(()=>(x?(document.body.style.userSelect="none",document.body.style.cursor=M(k)):(document.body.style.userSelect="",document.body.style.cursor=""),()=>{document.body.style.userSelect="",document.body.style.cursor=""}),[x,k,M]);const L=I=>{if(!i.includes(I))return null;const U={top:"top-0 left-0 right-0 h-1 cursor-ns-resize",right:"top-0 right-0 bottom-0 w-1 cursor-ew-resize",bottom:"bottom-0 left-0 right-0 h-1 cursor-ns-resize",left:"top-0 left-0 bottom-0 w-1 cursor-ew-resize","top-left":"top-0 left-0 w-3 h-3 cursor-nwse-resize","top-right":"top-0 right-0 w-3 h-3 cursor-nesw-resize","bottom-left":"bottom-0 left-0 w-3 h-3 cursor-nesw-resize","bottom-right":"bottom-0 right-0 w-3 h-3 cursor-nwse-resize"};return e.jsx("div",{className:u("absolute z-10",h&&"bg-blue-500 dark:bg-blue-400 opacity-0 hover:opacity-50",U[I]),onMouseDown:E(I)},I)};return e.jsxs("div",{ref:w,className:u("relative",f),style:{width:`${v}px`,height:`${m}px`},children:[t,["top","right","bottom","left","top-left","top-right","bottom-left","bottom-right"].map(L)]})},Ca=({className:t,children:r,disabled:a=!1,onClick:o})=>e.jsx("div",{className:u("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",t),onClick:a?void 0:o,role:"region","aria-label":"UresizableUpanels",children:r||"UresizableUpanels Component"}),Na=({children:t,maxHeight:r,hideScrollbar:a=!1,direction:o="vertical",className:s})=>{const n={vertical:"overflow-y-auto overflow-x-hidden",horizontal:"overflow-x-auto overflow-y-hidden",both:"overflow-auto"},l=a?"scrollbar-hide":u("scrollbar-thin","scrollbar-thumb-gray-300 dark:scrollbar-thumb-gray-600","scrollbar-track-gray-100 dark:scrollbar-track-gray-800","hover:scrollbar-thumb-gray-400 dark:hover:scrollbar-thumb-gray-500"),i=typeof r=="number"?`${r}px`:r;return e.jsx("div",{className:u("relative",n[o],l,s),style:i?{maxHeight:i}:void 0,children:t})},Sa=({children:t,columns:r=3,gap:a=16,breakpoints:o,className:s})=>{const[n,l]=b.useState(r),i=b.useRef(null);b.useEffect(()=>{if(!o)return;const h=()=>{const f=window.innerWidth,v=Object.keys(o).map(Number).sort((p,m)=>m-p);for(const p of v)if(f>=p){l(o[p]);return}l(r)};return h(),window.addEventListener("resize",h),()=>window.removeEventListener("resize",h)},[o,r]);const g=b.Children.toArray(t),c=Array.from({length:n},()=>[]);return g.forEach((h,f)=>{c[f%n].push(h)}),e.jsx("div",{ref:i,className:u("flex",s),style:{gap:`${a}px`},children:c.map((h,f)=>e.jsx("div",{className:"flex-1 flex flex-col",style:{gap:`${a}px`},children:h},f))})},te=({children:t,container:r})=>{const[a,o]=b.useState(!1);if(b.useEffect(()=>(o(!0),()=>o(!1)),[]),!a)return null;const s=r||document.body;return We.createPortal(t,s)},Se=({isOpen:t,onClose:r,children:a,blur:o=!1,opacity:s="medium",zIndex:n=40,lockScroll:l=!0,className:i})=>{if(b.useEffect(()=>{if(l){if(t){const c=window.innerWidth-document.documentElement.clientWidth;document.body.style.overflow="hidden",document.body.style.paddingRight=`${c}px`}else document.body.style.overflow="",document.body.style.paddingRight="";return()=>{document.body.style.overflow="",document.body.style.paddingRight=""}}},[t,l]),!t)return null;const g={light:"bg-black/20 dark:bg-black/30",medium:"bg-black/50 dark:bg-black/60",dark:"bg-black/75 dark:bg-black/85"};return e.jsx(te,{children:e.jsx("div",{className:u("fixed inset-0","transition-opacity duration-300",o&&"backdrop-blur-sm",g[s],i),style:{zIndex:n},onClick:r,"aria-hidden":"true",children:a&&e.jsx("div",{className:"relative h-full w-full",onClick:c=>c.stopPropagation(),children:a})})})},Mr=({children:t,as:r="p",size:a="base",weight:o="normal",color:s="default",align:n,transform:l="none",truncate:i=!1,lineClamp:g,className:c})=>{const h={xs:"text-xs",sm:"text-sm",base:"text-base",lg:"text-lg",xl:"text-xl","2xl":"text-2xl","3xl":"text-3xl","4xl":"text-4xl"},f={light:"font-light",normal:"font-normal",medium:"font-medium",semibold:"font-semibold",bold:"font-bold"},v={default:"text-gray-900 dark:text-gray-100",muted:"text-gray-600 dark:text-gray-400",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"},p=n?{left:"text-left",center:"text-center",right:"text-right",justify:"text-justify"}[n]:"",m={none:"",uppercase:"uppercase",lowercase:"lowercase",capitalize:"capitalize"},y=g?{display:"-webkit-box",WebkitLineClamp:g,WebkitBoxOrient:"vertical",overflow:"hidden"}:void 0;return e.jsx(r,{className:u(h[a],f[o],v[s],p,m[l],i&&"truncate",g&&"overflow-hidden",c),style:y,children:t})},La=({children:t,level:r=2,size:a,weight:o="bold",color:s="default",align:n,className:l})=>{const g=a||{1:"4xl",2:"3xl",3:"2xl",4:"xl",5:"lg",6:"base"}[r],c={"4xl":"text-4xl","3xl":"text-3xl","2xl":"text-2xl",xl:"text-xl",lg:"text-lg",base:"text-base"},h={normal:"font-normal",medium:"font-medium",semibold:"font-semibold",bold:"font-bold",extrabold:"font-extrabold"},f={default:"text-gray-900 dark:text-gray-100",muted:"text-gray-700 dark:text-gray-300",primary:"text-blue-600 dark:text-blue-400"},v=n?{left:"text-left",center:"text-center",right:"text-right"}[n]:"",p=`h${r}`;return b.createElement(p,{className:u(c[g],h[o],f[s],v,l)},t)},Ea=W.cva("",{variants:{variant:{hero:T.textVariants.heading.display.hero(),display:T.textVariants.heading.display.lg(),h1:T.textVariants.heading.h1(),h2:T.textVariants.heading.h2(),h3:T.textVariants.heading.h3()},responsive:{true:"",false:""},align:{left:"text-left",center:"text-center",right:"text-right"},color:{default:"text-gray-900 dark:text-white",muted:"text-gray-600 dark:text-gray-400",vibrant:"text-white",brand:"bg-gradient-to-r from-blue-600 to-purple-600 bg-clip-text text-transparent"}},defaultVariants:{variant:"h1",responsive:!0,align:"left",color:"default"}}),Ma=({children:t,variant:r="h1",responsive:a=!0,align:o="left",color:s="default",className:n,as:l})=>{const i=l||(r==="hero"||r==="display"||r==="h1"?"h1":r==="h2"?"h2":"h3");return e.jsx(i,{className:u(Ea({variant:r,responsive:a,align:o,color:s}),n),children:t})},Ia=W.cva("",{variants:{variant:{h2:T.textVariants.heading.h2(),h3:T.textVariants.heading.h3(),h4:T.textVariants.heading.h4(),h5:T.textVariants.heading.h5(),h6:T.textVariants.heading.h6()},spacing:{none:"",sm:"mb-2",md:"mb-4",lg:"mb-6",xl:"mb-8"},align:{left:"text-left",center:"text-center",right:"text-right"}},defaultVariants:{variant:"h2",spacing:"md",align:"left"}}),Ta=({children:t,variant:r="h2",spacing:a="md",align:o="left",className:s,as:n})=>{const l=n||r;return b.createElement(l,{className:u(Ia({variant:r,spacing:a,align:o}),s)},t)},Pa=W.cva("",{variants:{variant:{body:T.textVariants.body.md(),lead:T.textVariants.body.lg(),large:T.textVariants.body.lg(),small:T.textVariants.body.sm(),caption:T.textVariants.body.xs()},color:{default:"text-gray-700 dark:text-gray-300",muted:"text-gray-500 dark:text-gray-500",primary:"text-gray-900 dark:text-white"},align:{left:"text-left",center:"text-center",right:"text-right",justify:"text-justify"}},defaultVariants:{variant:"body",color:"default",align:"left"}}),za=({children:t,variant:r="body",color:a="default",align:o="left",className:s,as:n="p"})=>b.createElement(n,{className:u(Pa({variant:r,color:a,align:o}),s)},t),Ua=W.cva(T.textVariants.link.default(),{variants:{variant:{default:T.textVariants.link.default(),subtle:T.textVariants.link.subtle(),muted:T.textVariants.link.muted(),button:"inline-flex items-center justify-center px-4 py-2 rounded-md bg-blue-600 text-white hover:bg-blue-700 transition-colors"},external:{true:"inline-flex items-center gap-1",false:""}},defaultVariants:{variant:"default",external:!1}}),Aa=({children:t,href:r,variant:a="default",external:o=!1,className:s,target:n,rel:l})=>e.jsxs("a",{href:r,target:n||(o?"_blank":void 0),rel:l||(o?"noopener noreferrer":void 0),className:u(Ua({variant:a,external:o}),s),children:[t,o&&e.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M10 6H6a2 2 0 00-2 2v10a2 2 0 002 2h10a2 2 0 002-2v-4M14 4h6m0 0v6m0-6L10 14"})})]}),$a=({children:t,size:r="md",variant:a="default",className:o})=>{const s={sm:"text-xs px-1 py-0.5",md:"text-sm px-1.5 py-0.5",lg:"text-base px-2 py-1"},n={default:"bg-gray-100 dark:bg-gray-800 text-gray-900 dark:text-gray-100",primary:"bg-blue-50 dark:bg-blue-900/30 text-blue-700 dark:text-blue-300",success:"bg-green-50 dark:bg-green-900/30 text-green-700 dark:text-green-300",warning:"bg-yellow-50 dark:bg-yellow-900/30 text-yellow-700 dark:text-yellow-300",danger:"bg-red-50 dark:bg-red-900/30 text-red-700 dark:text-red-300"};return e.jsx("code",{className:u("inline-block font-mono font-medium rounded",s[r],n[a],o),children:t})},Da=({children:t,variant:r="primary",size:a="md",inline:o=!1,align:s="left",className:n,wrap:l=!1})=>{const i={primary:"text-blue-600 dark:text-blue-400 bg-blue-50 dark:bg-blue-900/30",secondary:"text-purple-600 dark:text-purple-400 bg-purple-50 dark:bg-purple-900/30",success:"text-green-600 dark:text-green-400 bg-green-50 dark:bg-green-900/30",warning:"text-yellow-700 dark:text-yellow-400 bg-yellow-50 dark:bg-yellow-900/30",neutral:"text-gray-700 dark:text-gray-300 bg-gray-100 dark:bg-gray-800"},g={xs:{text:"text-xs",padding:o?"px-1.5 py-0.5":"px-2 py-1"},sm:{text:"text-sm",padding:o?"px-2 py-0.5":"px-3 py-1.5"},md:{text:"text-base",padding:o?"px-2.5 py-1":"px-4 py-2"},lg:{text:"text-lg",padding:o?"px-3 py-1":"px-4 py-2"}},c={left:"text-left",center:"text-center",right:"text-right"},h=g[a],f=o?"code":"div";return e.jsx(f,{className:u("font-mono rounded-lg",i[r],h.text,h.padding,!o&&c[s],o?"inline-block":"block",!l&&"overflow-x-auto whitespace-nowrap",l&&"break-all",n),children:t})},Ba=({children:t,size:r="md",className:a})=>{const o={sm:"text-xs px-1.5 py-0.5",md:"text-sm px-2 py-1",lg:"text-base px-2.5 py-1.5"};return e.jsx("kbd",{className:u("inline-flex items-center justify-center","font-mono font-semibold","bg-gray-100 dark:bg-gray-800","text-gray-900 dark:text-gray-100","border border-gray-300 dark:border-gray-600","rounded shadow-sm",o[r],a),children:t})},ja=({children:t,cite:r,variant:a="default",size:o="md",className:s})=>{const n={sm:"text-sm p-3",md:"text-base p-4",lg:"text-lg p-6"},l={sm:"text-xs",md:"text-sm",lg:"text-base"},i={default:"border-l-4 border-gray-300 dark:border-gray-600 bg-gray-50 dark:bg-gray-800/50",bordered:"border border-gray-300 dark:border-gray-600 bg-white dark:bg-gray-800",accent:"border-l-4 border-blue-500 dark:border-blue-400 bg-blue-50 dark:bg-blue-900/20"};return e.jsxs("blockquote",{className:u("rounded-r-lg",n[o],i[a],s),children:[e.jsx("p",{className:"text-gray-800 dark:text-gray-200 italic",children:t}),r&&e.jsxs("footer",{className:u("mt-2 text-gray-600 dark:text-gray-400",l[o]),children:["— ",e.jsx("cite",{className:"not-italic font-medium",children:r})]})]})},Fa=({children:t,variant:r="default",showIcon:a=!1,size:o="sm",className:s})=>{const n={sm:"text-sm",base:"text-base"},l={sm:"h-4 w-4",base:"h-5 w-5"},g={default:{text:"text-gray-600 dark:text-gray-400",icon:z.InformationCircleIcon},error:{text:"text-red-600 dark:text-red-400",icon:z.ExclamationCircleIcon},success:{text:"text-green-600 dark:text-green-400",icon:z.CheckCircleIcon},warning:{text:"text-yellow-600 dark:text-yellow-400",icon:z.ExclamationCircleIcon}}[r],c=g.icon;return e.jsxs("div",{className:u("flex items-start gap-1.5",s),children:[a&&e.jsx(c,{className:u(l[o],g.text,"flex-shrink-0 mt-0.5")}),e.jsx("p",{className:u(n[o],g.text),children:t})]})},Oa=({className:t,children:r,disabled:a=!1,onClick:o})=>e.jsx("div",{className:u("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",t),onClick:a?void 0:o,role:"region","aria-label":"UscreenUreaderUtext",children:r||"UscreenUreaderUtext Component"}),Va=({children:t,maxLength:r=50,position:a="end",ellipsis:o="...",showTooltip:s=!0,className:n})=>{const l=t||"";if(l.length<=r)return e.jsx("span",{className:n,children:l});const g=(()=>{const c=o.length,h=r-c;switch(a){case"start":return o+l.slice(l.length-h);case"middle":{const f=Math.floor(h/2),v=l.slice(0,f),p=l.slice(l.length-(h-f));return v+o+p}case"end":default:return l.slice(0,h)+o}})();return e.jsx("span",{className:u("inline-block",n),title:s?l:void 0,children:g})},Wa=({value:t,style:r="decimal",currency:a="USD",unit:o,minimumFractionDigits:s,maximumFractionDigits:n,locale:l="en-US",notation:i="standard",className:g})=>{const c=()=>{try{const h={style:r,notation:i,minimumFractionDigits:s,maximumFractionDigits:n};return r==="currency"&&(h.currency=a),r==="unit"&&o&&(h.unit=o),new Intl.NumberFormat(l,h).format(t)}catch(h){return console.error("Number formatting error:",h),t.toLocaleString(l)}};return e.jsx("span",{className:u(g),children:c()})},Ha=({date:t,showTooltip:r=!0,updateInterval:a=0,className:o})=>{const[,s]=b.useState(0),n=b.useMemo(()=>t instanceof Date?t:new Date(t),[t]);b.useEffect(()=>{if(a===0)return;const c=setInterval(()=>{s(h=>h+1)},a*1e3);return()=>clearInterval(c)},[a]);const i=(()=>{const h=new Date().getTime()-n.getTime(),f=Math.floor(h/1e3),v=Math.floor(f/60),p=Math.floor(v/60),m=Math.floor(p/24),y=Math.floor(m/7),x=Math.floor(m/30),N=Math.floor(m/365);return f<60?"just now":v<60?`${v} ${v===1?"minute":"minutes"} ago`:p<24?`${p} ${p===1?"hour":"hours"} ago`:m<7?`${m} ${m===1?"day":"days"} ago`:y<4?`${y} ${y===1?"week":"weeks"} ago`:x<12?`${x} ${x===1?"month":"months"} ago`:`${N} ${N===1?"year":"years"} ago`})(),g=n.toLocaleString();return e.jsx("time",{dateTime:n.toISOString(),title:r?g:void 0,className:u(o),children:i})},le=({size:t="default",variant:r="default",className:a,ariaLabel:o="Loading",loadingText:s="Loading..."})=>{const n=()=>{const l={small:"w-4 h-4",default:"w-6 h-6",large:"w-8 h-8",extraLarge:"w-16 h-16 border-4"},i={default:"border-gray-300 border-t-blue-600",white:"border-white/30 border-t-white",success:"border-gray-300 border-t-green-600",warning:"border-gray-300 border-t-orange-600",error:"border-gray-300 border-t-red-600"};return`animate-spin rounded-full border-2 ${l[t]} ${i[r]}`};return e.jsx("div",{className:u(n(),a),role:"status","aria-label":o,children:e.jsx("span",{className:"sr-only",children:s})})},_a=({isLoading:t,message:r,mode:a="fullscreen",blur:o=!1,spinnerSize:s="large",className:n})=>t?e.jsxs("div",{className:u(a==="fullscreen"?"fixed":"absolute","inset-0 z-50","flex flex-col items-center justify-center","bg-white/80 dark:bg-gray-900/80",o&&"backdrop-blur-sm",n),role:"alert","aria-live":"polite","aria-busy":"true",children:[e.jsx(le,{size:s}),r&&e.jsx("p",{className:u(T.textVariants.body.md(),"text-gray-700 dark:text-gray-300 mt-4"),children:r})]}):null,qa=({size:t="md",variant:r="primary",color:a,className:o})=>{const s={sm:"w-1.5 h-1.5",md:"w-2 h-2",lg:"w-3 h-3"},n={primary:"bg-blue-600 dark:bg-blue-500",secondary:"bg-gray-600 dark:bg-gray-400",white:"bg-white"},l=u("rounded-full",s[t],a?"":n[r]);return e.jsxs("div",{className:u("flex items-center gap-1",o),children:[e.jsx("div",{className:l,style:{backgroundColor:a,animation:"loading-dot-bounce 1.4s infinite ease-in-out both",animationDelay:"-0.32s"}}),e.jsx("div",{className:l,style:{backgroundColor:a,animation:"loading-dot-bounce 1.4s infinite ease-in-out both",animationDelay:"-0.16s"}}),e.jsx("div",{className:l,style:{backgroundColor:a,animation:"loading-dot-bounce 1.4s infinite ease-in-out both"}}),e.jsx("style",{children:`
2
2
  @keyframes loading-dot-bounce {
3
3
  0%, 80%, 100% {
4
4
  transform: scale(0);
@@ -9,35 +9,34 @@
9
9
  opacity: 1;
10
10
  }
11
11
  }
12
- `})]})},uo=({message:e="Loading...",size:r="default",fullScreen:a=!1,variant:n="default",className:o})=>{const l={small:{spinner:"small",text:"text-sm"},default:{spinner:"default",text:"text-base"},large:{spinner:"large",text:"text-lg"}}[r],c=a?"fixed inset-0 z-50 flex items-center justify-center bg-white/80 dark:bg-gray-900/80":"flex flex-col items-center justify-center p-8",d=t.jsxs("div",{className:f(c,o),children:[t.jsx(Se,{size:l.spinner,variant:n,className:"mb-4"}),e&&t.jsx("p",{className:f(l.text,"text-gray-600 dark:text-gray-400 text-center max-w-sm"),children:e})]});return a?t.jsx("div",{className:"fixed inset-0 z-50 bg-white/80 dark:bg-gray-900/80 backdrop-blur-sm",children:t.jsxs("div",{className:"flex items-center justify-center min-h-full p-4",children:[t.jsx(Se,{size:l.spinner,variant:n,className:"mb-4"}),e&&t.jsx("p",{className:"text-center text-gray-600 dark:text-gray-400 max-w-sm",children:e})]})}):d},ho=({variant:e="text",width:r,height:a,className:n,count:o,lines:s=1,animate:l=!0,borderRadius:c,theme:d,spacing:i,gap:h="md"})=>{const u={text:"h-4 rounded",circle:"rounded-full",rectangle:"rounded-lg",avatar:"w-10 h-10 rounded-full",button:"h-10 rounded-lg"},y={light:"bg-gray-200",dark:"bg-gray-700"},m={sm:"space-y-1",md:"space-y-2",lg:"space-y-3"},b=o??s,v=k=>{const S={};return r&&(S.width=typeof r=="number"?`${r}px`:r),a&&(S.height=typeof a=="number"?`${a}px`:a),c&&(S.borderRadius=c),t.jsx("div",{className:f(l&&"animate-pulse",d?y[d]:"bg-gray-200 dark:bg-gray-700",u[e],n),style:S},k)};if(b>1){const k=i!==void 0?`space-y-${i}`:m[h];return t.jsx("div",{className:f(k),children:Array.from({length:b}).map((S,w)=>v(w))})}return v()},fo={info:P.InformationCircleIcon,success:P.CheckCircleIcon,warning:P.ExclamationTriangleIcon,attention:P.BellAlertIcon,error:P.XCircleIcon},bo=({children:e,className:r})=>t.jsx("div",{className:f("font-medium mb-1",r),children:e}),mo=({children:e,className:r})=>t.jsx("div",{className:f("text-sm break-words",r),children:e}),pr=({variant:e="info",title:r,description:a,icon:n,children:o,className:s})=>{const l=fo[e],c=n||t.jsx(l,{className:"h-5 w-5"}),d=typeof j.alert[e]=="function"?j.alert[e]():"";return t.jsxs("div",{role:"alert",className:f(d,s),children:[c&&t.jsx("div",{className:"flex-shrink-0",children:c}),t.jsxs("div",{className:"flex-1 min-w-0",children:[r&&t.jsx("div",{className:"font-medium mb-1 break-words",children:r}),a&&t.jsx("div",{className:"text-sm break-words",children:a}),o]})]})},yo=({message:e,variant:r="info",dismissible:a=!1,onDismiss:n,className:o})=>{const s={info:"bg-blue-100 dark:bg-blue-900/20 text-blue-800 dark:text-blue-300 border-blue-300 dark:border-blue-700",success:"bg-green-100 dark:bg-green-900/20 text-green-800 dark:text-green-300 border-green-300 dark:border-green-700",warning:"bg-yellow-100 dark:bg-yellow-900/20 text-yellow-800 dark:text-yellow-300 border-yellow-300 dark:border-yellow-700",error:"bg-red-100 dark:bg-red-900/20 text-red-800 dark:text-red-300 border-red-300 dark:border-red-700"};return t.jsxs("div",{className:f("p-4 border rounded-lg flex items-center justify-between",s[r],o),children:[t.jsx("span",{children:e}),a&&t.jsx("button",{onClick:n,className:"ml-4 font-bold",children:"×"})]})},po={info:{container:"bg-blue-50 dark:bg-blue-900/20 border-blue-200 dark:border-blue-800",icon:"text-blue-600 dark:text-blue-400",title:"text-blue-800 dark:text-blue-200",description:"text-blue-700 dark:text-blue-300",button:"bg-blue-600 hover:bg-blue-700 text-white",secondaryButton:"text-blue-700 dark:text-blue-300 hover:text-blue-800 dark:hover:text-blue-200"},success:{container:"bg-green-50 dark:bg-green-900/20 border-green-200 dark:border-green-800",icon:"text-green-600 dark:text-green-400",title:"text-green-800 dark:text-green-200",description:"text-green-700 dark:text-green-300",button:"bg-green-600 hover:bg-green-700 text-white",secondaryButton:"text-green-700 dark:text-green-300 hover:text-green-800 dark:hover:text-green-200"},warning:{container:"bg-amber-50 dark:bg-amber-900/20 border-amber-200 dark:border-amber-800",icon:"text-amber-600 dark:text-amber-400",title:"text-amber-800 dark:text-amber-200",description:"text-amber-700 dark:text-amber-300",button:"bg-amber-600 hover:bg-amber-700 text-white",secondaryButton:"text-amber-700 dark:text-amber-300 hover:text-amber-800 dark:hover:text-amber-200"},error:{container:"bg-red-50 dark:bg-red-900/20 border-red-200 dark:border-red-800",icon:"text-red-600 dark:text-red-400",title:"text-red-800 dark:text-red-200",description:"text-red-700 dark:text-red-300",button:"bg-red-600 hover:bg-red-700 text-white",secondaryButton:"text-red-700 dark:text-red-300 hover:text-red-800 dark:hover:text-red-200"}},vo=({title:e,description:r,variant:a="info",icon:n,action:o,secondaryAction:s,dismissible:l=!1,onDismiss:c,className:d})=>{const i=po[a];return t.jsx("div",{className:f("p-4 border rounded-lg",i.container,d),role:"alert",children:t.jsxs("div",{className:"flex items-start gap-3",children:[n&&t.jsx("div",{className:f("flex-shrink-0",i.icon),children:n}),t.jsxs("div",{className:"flex-1 min-w-0",children:[t.jsx("h4",{className:f("text-sm font-semibold mb-1",i.title),children:e}),r&&t.jsx("p",{className:f("text-sm mb-3",i.description),children:r}),(o||s)&&t.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[o&&t.jsxs("button",{onClick:o.onClick,className:f("inline-flex items-center gap-1.5 px-3 py-1.5 text-sm font-medium rounded-md transition-colors",i.button),children:[o.label,o.icon]}),s&&t.jsx("button",{onClick:s.onClick,className:f("inline-flex items-center gap-1.5 px-3 py-1.5 text-sm font-medium rounded-md transition-colors",i.secondaryButton),children:s.label})]})]}),l&&c&&t.jsx("button",{onClick:c,className:f("flex-shrink-0 p-1 rounded hover:bg-black/5 dark:hover:bg-white/5 transition-colors",i.icon),"aria-label":"Dismiss",children:t.jsx("svg",{className:"w-4 h-4",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"})})})]})})},ko=({size:e="large",variant:r="default",loadingText:a="Loading...",showText:n=!1,background:o="themed",className:s})=>{const l={transparent:"bg-transparent",themed:"bg-white dark:bg-gray-900",blur:"bg-white/80 dark:bg-gray-900/80 backdrop-blur-sm"};return t.jsxs("div",{className:f("min-h-screen flex flex-col items-center justify-center",l[o],s),role:"status","aria-live":"polite",children:[t.jsx(Se,{size:e,variant:r,ariaLabel:a,loadingText:a}),n&&t.jsx("p",{className:"mt-4 text-sm text-gray-600 dark:text-gray-400",children:a})]})},wo=({variant:e="chart",height:r=256,width:a="100%",count:n=5,columns:o=4,animate:s=!0,className:l})=>{const c=f("bg-gray-200 dark:bg-gray-700 rounded",s&&"animate-pulse"),d=typeof r=="number"?`${r}px`:r,i=typeof a=="number"?`${a}px`:a;return e==="chart"?t.jsx("div",{className:f("flex items-center justify-center",l),style:{height:d,width:i},children:t.jsx("div",{className:f(c,"w-full h-full")})}):e==="table"?t.jsxs("div",{className:f("space-y-3",l),style:{width:i},children:[t.jsx("div",{className:"flex gap-4",children:Array.from({length:o}).map((h,u)=>t.jsx("div",{className:f(c,"h-4 flex-1")},`header-${u}`))}),Array.from({length:n}).map((h,u)=>t.jsx("div",{className:"flex gap-4",children:Array.from({length:o}).map((y,m)=>t.jsx("div",{className:f(c,"h-8 flex-1")},`cell-${u}-${m}`))},`row-${u}`))]}):e==="card"?t.jsxs("div",{className:f("p-4 border border-gray-200 dark:border-gray-700 rounded-lg space-y-4",l),style:{width:i},children:[t.jsx("div",{className:f(c,"h-4 w-1/3")}),t.jsxs("div",{className:"space-y-2",children:[t.jsx("div",{className:f(c,"h-3 w-full")}),t.jsx("div",{className:f(c,"h-3 w-5/6")}),t.jsx("div",{className:f(c,"h-3 w-4/6")})]}),t.jsxs("div",{className:"flex gap-2 pt-2",children:[t.jsx("div",{className:f(c,"h-8 w-20")}),t.jsx("div",{className:f(c,"h-8 w-20")})]})]}):e==="list"?t.jsx("div",{className:f("space-y-3",l),style:{width:i},children:Array.from({length:n}).map((h,u)=>t.jsxs("div",{className:"flex items-center gap-3",children:[t.jsx("div",{className:f(c,"h-10 w-10 rounded-full")}),t.jsxs("div",{className:"flex-1 space-y-2",children:[t.jsx("div",{className:f(c,"h-4 w-3/4")}),t.jsx("div",{className:f(c,"h-3 w-1/2")})]})]},u))}):e==="stat"?t.jsxs("div",{className:f("p-4 border border-gray-200 dark:border-gray-700 rounded-lg space-y-3",l),style:{width:i},children:[t.jsx("div",{className:f(c,"h-3 w-1/2")}),t.jsx("div",{className:f(c,"h-8 w-2/3")}),t.jsx("div",{className:f(c,"h-3 w-1/3")})]}):null},vr=p.createContext(null);function xo(){return`toast-${Date.now()}-${Math.random().toString(36).substr(2,9)}`}function No({children:e,defaultDuration:r=5e3,maxToasts:a=5}){const[n,o]=p.useState([]),s=p.useCallback(y=>{o(m=>m.filter(b=>b.id!==y))},[]),l=p.useCallback((y,m,b)=>{const v=xo(),k={id:v,type:y,message:m,duration:b??r};o(S=>{const w=[...S,k];return w.length>a?w.slice(-a):w}),k.duration&&k.duration>0&&setTimeout(()=>{s(v)},k.duration)},[r,a,s]),c=p.useCallback((y,m)=>l("success",y,m),[l]),d=p.useCallback((y,m)=>l("error",y,m),[l]),i=p.useCallback((y,m)=>l("warning",y,m),[l]),h=p.useCallback((y,m)=>l("info",y,m),[l]),u=p.useMemo(()=>({toasts:n,addToast:l,removeToast:s,success:c,error:d,warning:i,info:h}),[n,l,s,c,d,i,h]);return t.jsx(vr.Provider,{value:u,children:e})}const Co={success:t.jsx("svg",{className:"h-5 w-5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:t.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M5 13l4 4L19 7"})}),error:t.jsx("svg",{className:"h-5 w-5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:t.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})}),warning:t.jsx("svg",{className:"h-5 w-5",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"})}),info:t.jsx("svg",{className:"h-5 w-5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:t.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"})})},So={success:{container:"bg-green-50 border-green-200 dark:bg-green-900/30 dark:border-green-800",icon:"text-green-500 dark:text-green-400",text:"text-green-800 dark:text-green-200"},error:{container:"bg-red-50 border-red-200 dark:bg-red-900/30 dark:border-red-800",icon:"text-red-500 dark:text-red-400",text:"text-red-800 dark:text-red-200"},warning:{container:"bg-yellow-50 border-yellow-200 dark:bg-yellow-900/30 dark:border-yellow-800",icon:"text-yellow-500 dark:text-yellow-400",text:"text-yellow-800 dark:text-yellow-200"},info:{container:"bg-blue-50 border-blue-200 dark:bg-blue-900/30 dark:border-blue-800",icon:"text-blue-500 dark:text-blue-400",text:"text-blue-800 dark:text-blue-200"}};function lt({toast:e,onDismiss:r}){const[a,n]=p.useState(!1),[o,s]=p.useState(!1),{type:l,message:c,id:d}=e,i=So[l];p.useEffect(()=>{const u=setTimeout(()=>n(!0),10);return()=>clearTimeout(u)},[]);const h=()=>{s(!0),setTimeout(()=>{r(d)},200)};return t.jsxs("div",{className:`
12
+ `})]})},Ga=({message:t="Loading...",size:r="default",fullScreen:a=!1,variant:o="default",className:s})=>{const l={small:{spinner:"small",text:"text-sm"},default:{spinner:"default",text:"text-base"},large:{spinner:"large",text:"text-lg"}}[r],i=a?"fixed inset-0 z-50 flex items-center justify-center bg-white/80 dark:bg-gray-900/80":"flex flex-col items-center justify-center p-8",g=e.jsxs("div",{className:u(i,s),children:[e.jsx(le,{size:l.spinner,variant:o,className:"mb-4"}),t&&e.jsx("p",{className:u(l.text,"text-gray-600 dark:text-gray-400 text-center max-w-sm"),children:t})]});return a?e.jsx("div",{className:"fixed inset-0 z-50 bg-white/80 dark:bg-gray-900/80 backdrop-blur-sm",children:e.jsxs("div",{className:"flex items-center justify-center min-h-full p-4",children:[e.jsx(le,{size:l.spinner,variant:o,className:"mb-4"}),t&&e.jsx("p",{className:"text-center text-gray-600 dark:text-gray-400 max-w-sm",children:t})]})}):g},Ka=({variant:t="text",width:r,height:a,className:o,count:s,lines:n=1,animate:l=!0,borderRadius:i,theme:g,spacing:c,gap:h="md"})=>{const f={text:"h-4 rounded",circle:"rounded-full",rectangle:"rounded-lg",avatar:"w-10 h-10 rounded-full",button:"h-10 rounded-lg"},v={light:"bg-gray-200",dark:"bg-gray-700"},p={sm:"space-y-1",md:"space-y-2",lg:"space-y-3"},m=s??n,y=x=>{const N={};return r&&(N.width=typeof r=="number"?`${r}px`:r),a&&(N.height=typeof a=="number"?`${a}px`:a),i&&(N.borderRadius=i),e.jsx("div",{className:u(l&&"animate-pulse",g?v[g]:"bg-gray-200 dark:bg-gray-700",f[t],o),style:N},x)};if(m>1){const x=c!==void 0?`space-y-${c}`:p[h];return e.jsx("div",{className:u(x),children:Array.from({length:m}).map((N,k)=>y(k))})}return y()},Ya={info:z.InformationCircleIcon,success:z.CheckCircleIcon,warning:z.ExclamationTriangleIcon,attention:z.BellAlertIcon,error:z.XCircleIcon},Qa=({children:t,className:r})=>e.jsx("div",{className:u("font-medium mb-1",r),children:t}),Xa=({children:t,className:r})=>e.jsx("div",{className:u("text-sm break-words",r),children:t}),qe=({variant:t="info",title:r,description:a,icon:o,children:s,className:n})=>{const l=Ya[t],i=o||e.jsx(l,{className:"h-5 w-5"}),g=typeof T.variants.alert[t]=="function"?T.variants.alert[t]():"";return e.jsxs("div",{role:"alert",className:u(g,n),children:[i&&e.jsx("div",{className:"flex-shrink-0",children:i}),e.jsxs("div",{className:"flex-1 min-w-0",children:[r&&e.jsx("div",{className:"font-medium mb-1 break-words",children:r}),a&&e.jsx("div",{className:"text-sm break-words",children:a}),s]})]})},Ja=({message:t,variant:r="info",dismissible:a=!1,onDismiss:o,className:s})=>{const n={info:"bg-blue-100 dark:bg-blue-900/20 text-blue-800 dark:text-blue-300 border-blue-300 dark:border-blue-700",success:"bg-green-100 dark:bg-green-900/20 text-green-800 dark:text-green-300 border-green-300 dark:border-green-700",warning:"bg-yellow-100 dark:bg-yellow-900/20 text-yellow-800 dark:text-yellow-300 border-yellow-300 dark:border-yellow-700",error:"bg-red-100 dark:bg-red-900/20 text-red-800 dark:text-red-300 border-red-300 dark:border-red-700"};return e.jsxs("div",{className:u("p-4 border rounded-lg flex items-center justify-between",n[r],s),children:[e.jsx("span",{children:t}),a&&e.jsx("button",{onClick:o,className:"ml-4 font-bold",children:"×"})]})},Za={info:{container:"bg-blue-50 dark:bg-blue-900/20 border-blue-200 dark:border-blue-800",icon:"text-blue-600 dark:text-blue-400",title:"text-blue-800 dark:text-blue-200",description:"text-blue-700 dark:text-blue-300",button:"bg-blue-600 hover:bg-blue-700 text-white",secondaryButton:"text-blue-700 dark:text-blue-300 hover:text-blue-800 dark:hover:text-blue-200"},success:{container:"bg-green-50 dark:bg-green-900/20 border-green-200 dark:border-green-800",icon:"text-green-600 dark:text-green-400",title:"text-green-800 dark:text-green-200",description:"text-green-700 dark:text-green-300",button:"bg-green-600 hover:bg-green-700 text-white",secondaryButton:"text-green-700 dark:text-green-300 hover:text-green-800 dark:hover:text-green-200"},warning:{container:"bg-amber-50 dark:bg-amber-900/20 border-amber-200 dark:border-amber-800",icon:"text-amber-600 dark:text-amber-400",title:"text-amber-800 dark:text-amber-200",description:"text-amber-700 dark:text-amber-300",button:"bg-amber-600 hover:bg-amber-700 text-white",secondaryButton:"text-amber-700 dark:text-amber-300 hover:text-amber-800 dark:hover:text-amber-200"},error:{container:"bg-red-50 dark:bg-red-900/20 border-red-200 dark:border-red-800",icon:"text-red-600 dark:text-red-400",title:"text-red-800 dark:text-red-200",description:"text-red-700 dark:text-red-300",button:"bg-red-600 hover:bg-red-700 text-white",secondaryButton:"text-red-700 dark:text-red-300 hover:text-red-800 dark:hover:text-red-200"}},Ra=({title:t,description:r,variant:a="info",icon:o,action:s,secondaryAction:n,dismissible:l=!1,onDismiss:i,className:g})=>{const c=Za[a];return e.jsx("div",{className:u("p-4 border rounded-lg",c.container,g),role:"alert",children:e.jsxs("div",{className:"flex items-start gap-3",children:[o&&e.jsx("div",{className:u("flex-shrink-0",c.icon),children:o}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("h4",{className:u("text-sm font-semibold mb-1",c.title),children:t}),r&&e.jsx("p",{className:u("text-sm mb-3",c.description),children:r}),(s||n)&&e.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[s&&e.jsxs("button",{onClick:s.onClick,className:u("inline-flex items-center gap-1.5 px-3 py-1.5 text-sm font-medium rounded-md transition-colors",c.button),children:[s.label,s.icon]}),n&&e.jsx("button",{onClick:n.onClick,className:u("inline-flex items-center gap-1.5 px-3 py-1.5 text-sm font-medium rounded-md transition-colors",c.secondaryButton),children:n.label})]})]}),l&&i&&e.jsx("button",{onClick:i,className:u("flex-shrink-0 p-1 rounded hover:bg-black/5 dark:hover:bg-white/5 transition-colors",c.icon),"aria-label":"Dismiss",children:e.jsx("svg",{className:"w-4 h-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 18L18 6M6 6l12 12"})})})]})})},eo=({size:t="large",variant:r="default",loadingText:a="Loading...",showText:o=!1,background:s="themed",className:n})=>{const l={transparent:"bg-transparent",themed:"bg-white dark:bg-gray-900",blur:"bg-white/80 dark:bg-gray-900/80 backdrop-blur-sm"};return e.jsxs("div",{className:u("min-h-screen flex flex-col items-center justify-center",l[s],n),role:"status","aria-live":"polite",children:[e.jsx(le,{size:t,variant:r,ariaLabel:a,loadingText:a}),o&&e.jsx("p",{className:"mt-4 text-sm text-gray-600 dark:text-gray-400",children:a})]})},ro=({variant:t="chart",height:r=256,width:a="100%",count:o=5,columns:s=4,animate:n=!0,className:l})=>{const i=u("bg-gray-200 dark:bg-gray-700 rounded",n&&"animate-pulse"),g=typeof r=="number"?`${r}px`:r,c=typeof a=="number"?`${a}px`:a;return t==="chart"?e.jsx("div",{className:u("flex items-center justify-center",l),style:{height:g,width:c},children:e.jsx("div",{className:u(i,"w-full h-full")})}):t==="table"?e.jsxs("div",{className:u("space-y-3",l),style:{width:c},children:[e.jsx("div",{className:"flex gap-4",children:Array.from({length:s}).map((h,f)=>e.jsx("div",{className:u(i,"h-4 flex-1")},`header-${f}`))}),Array.from({length:o}).map((h,f)=>e.jsx("div",{className:"flex gap-4",children:Array.from({length:s}).map((v,p)=>e.jsx("div",{className:u(i,"h-8 flex-1")},`cell-${f}-${p}`))},`row-${f}`))]}):t==="card"?e.jsxs("div",{className:u("p-4 border border-gray-200 dark:border-gray-700 rounded-lg space-y-4",l),style:{width:c},children:[e.jsx("div",{className:u(i,"h-4 w-1/3")}),e.jsxs("div",{className:"space-y-2",children:[e.jsx("div",{className:u(i,"h-3 w-full")}),e.jsx("div",{className:u(i,"h-3 w-5/6")}),e.jsx("div",{className:u(i,"h-3 w-4/6")})]}),e.jsxs("div",{className:"flex gap-2 pt-2",children:[e.jsx("div",{className:u(i,"h-8 w-20")}),e.jsx("div",{className:u(i,"h-8 w-20")})]})]}):t==="list"?e.jsx("div",{className:u("space-y-3",l),style:{width:c},children:Array.from({length:o}).map((h,f)=>e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:u(i,"h-10 w-10 rounded-full")}),e.jsxs("div",{className:"flex-1 space-y-2",children:[e.jsx("div",{className:u(i,"h-4 w-3/4")}),e.jsx("div",{className:u(i,"h-3 w-1/2")})]})]},f))}):t==="stat"?e.jsxs("div",{className:u("p-4 border border-gray-200 dark:border-gray-700 rounded-lg space-y-3",l),style:{width:c},children:[e.jsx("div",{className:u(i,"h-3 w-1/2")}),e.jsx("div",{className:u(i,"h-8 w-2/3")}),e.jsx("div",{className:u(i,"h-3 w-1/3")})]}):null},Ge=b.createContext(null);function to(){return`toast-${Date.now()}-${Math.random().toString(36).substr(2,9)}`}function ao({children:t,defaultDuration:r=5e3,maxToasts:a=5}){const[o,s]=b.useState([]),n=b.useCallback(v=>{s(p=>p.filter(m=>m.id!==v))},[]),l=b.useCallback((v,p,m)=>{const y=to(),x={id:y,type:v,message:p,duration:m??r};s(N=>{const k=[...N,x];return k.length>a?k.slice(-a):k}),x.duration&&x.duration>0&&setTimeout(()=>{n(y)},x.duration)},[r,a,n]),i=b.useCallback((v,p)=>l("success",v,p),[l]),g=b.useCallback((v,p)=>l("error",v,p),[l]),c=b.useCallback((v,p)=>l("warning",v,p),[l]),h=b.useCallback((v,p)=>l("info",v,p),[l]),f=b.useMemo(()=>({toasts:o,addToast:l,removeToast:n,success:i,error:g,warning:c,info:h}),[o,l,n,i,g,c,h]);return e.jsx(Ge.Provider,{value:f,children:t})}const oo={success:e.jsx("svg",{className:"h-5 w-5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M5 13l4 4L19 7"})}),error:e.jsx("svg",{className:"h-5 w-5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})}),warning:e.jsx("svg",{className:"h-5 w-5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:e.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"})}),info:e.jsx("svg",{className:"h-5 w-5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"})})},so={success:{container:"bg-green-50 border-green-200 dark:bg-green-900/30 dark:border-green-800",icon:"text-green-500 dark:text-green-400",text:"text-green-800 dark:text-green-200"},error:{container:"bg-red-50 border-red-200 dark:bg-red-900/30 dark:border-red-800",icon:"text-red-500 dark:text-red-400",text:"text-red-800 dark:text-red-200"},warning:{container:"bg-yellow-50 border-yellow-200 dark:bg-yellow-900/30 dark:border-yellow-800",icon:"text-yellow-500 dark:text-yellow-400",text:"text-yellow-800 dark:text-yellow-200"},info:{container:"bg-blue-50 border-blue-200 dark:bg-blue-900/30 dark:border-blue-800",icon:"text-blue-500 dark:text-blue-400",text:"text-blue-800 dark:text-blue-200"}};function Ir({toast:t,onDismiss:r}){const[a,o]=b.useState(!1),[s,n]=b.useState(!1),{type:l,message:i,id:g}=t,c=so[l];b.useEffect(()=>{const f=setTimeout(()=>o(!0),10);return()=>clearTimeout(f)},[]);const h=()=>{n(!0),setTimeout(()=>{r(g)},200)};return e.jsxs("div",{className:`
13
13
  flex items-center gap-3 px-4 py-3 rounded-lg border shadow-lg
14
14
  transition-all duration-200 ease-out
15
- ${i.container}
16
- ${a&&!o?"opacity-100 translate-x-0":"opacity-0 translate-x-4"}
17
- `,role:"alert","aria-live":"polite",children:[t.jsx("span",{className:i.icon,children:Co[l]}),t.jsx("span",{className:`flex-1 text-sm font-medium ${i.text}`,children:c}),t.jsx("button",{onClick:h,className:`
15
+ ${c.container}
16
+ ${a&&!s?"opacity-100 translate-x-0":"opacity-0 translate-x-4"}
17
+ `,role:"alert","aria-live":"polite",children:[e.jsx("span",{className:c.icon,children:oo[l]}),e.jsx("span",{className:`flex-1 text-sm font-medium ${c.text}`,children:i}),e.jsx("button",{onClick:h,className:`
18
18
  p-1 rounded-md transition-colors
19
19
  hover:bg-black/10 dark:hover:bg-white/10
20
- ${i.text}
21
- `,"aria-label":"Dismiss notification",children:t.jsx("svg",{className:"h-4 w-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:t.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})})]})}const Eo={"top-right":"top-4 right-4","top-left":"top-4 left-4","bottom-right":"bottom-4 right-4","bottom-left":"bottom-4 left-4","top-center":"top-4 left-1/2 -translate-x-1/2","bottom-center":"bottom-4 left-1/2 -translate-x-1/2"};function Ao({toasts:e,onDismiss:r,position:a="bottom-right"}){return e.length===0?null:t.jsx("div",{className:`fixed z-50 flex flex-col gap-2 max-w-sm w-full ${Eo[a]}`,"aria-label":"Notifications",children:e.map(n=>t.jsx(lt,{toast:n,onDismiss:r},n.id))})}function To(){const e=p.useContext(vr);if(!e)throw new Error("useToast must be used within a ToastProvider");return e}const Io=({message:e,variant:r="info",onClose:a,className:n})=>{const o={info:"bg-blue-500",success:"bg-green-500",warning:"bg-yellow-500",error:"bg-red-500"};return t.jsxs("div",{className:f("fixed bottom-4 right-4 p-4 rounded-lg text-white shadow-lg flex items-center gap-3",o[r],n),children:[t.jsx("span",{children:e}),a&&t.jsx("button",{onClick:a,className:"ml-4",children:"×"})]})},Lo=({count:e,maxCount:r=99,variant:a="danger",className:n})=>{const o=e>r?`${r}+`:e,s={default:"bg-gray-500",primary:"bg-blue-500",danger:"bg-red-500"};return t.jsx("span",{className:f("inline-flex items-center justify-center px-2 py-1 text-xs font-bold text-white rounded-full",s[a],n),children:o})},Mo=({notifications:e,onMarkAsRead:r,className:a})=>t.jsx("div",{className:f("bg-white dark:bg-gray-900 rounded-lg border border-gray-200 dark:border-gray-700 p-4 max-h-96 overflow-y-auto",a),children:e.map(n=>t.jsxs("div",{className:f("p-3 rounded mb-2",n.read?"bg-transparent":"bg-blue-50 dark:bg-blue-900/20"),onClick:()=>r?.(n.id),children:[t.jsx("h4",{className:"font-semibold text-gray-900 dark:text-white",children:n.title}),t.jsx("p",{className:"text-sm text-gray-600 dark:text-gray-400",children:n.message}),t.jsx("span",{className:"text-xs text-gray-500 dark:text-gray-500",children:n.timestamp})]},n.id))}),Po=({children:e,variant:r="default",size:a="sm",icon:n,dot:o=!1,pill:s=!1,outline:l=!1,onClick:c,dismissible:d=!1,onDismiss:i,count:h,maxCount:u,className:y})=>{const m={default:"bg-gray-100 text-gray-800 dark:bg-gray-700 dark:text-gray-300",primary:"bg-blue-100 text-blue-800 dark:bg-blue-900/30 dark:text-blue-400",success:"bg-green-100 text-green-800 dark:bg-green-900/30 dark:text-green-400",warning:"bg-yellow-100 text-yellow-800 dark:bg-yellow-900/30 dark:text-yellow-400",danger:"bg-red-100 text-red-800 dark:bg-red-900/30 dark:text-red-400",info:"bg-blue-100 text-blue-800 dark:bg-blue-900/30 dark:text-blue-400",purple:"bg-purple-100 text-purple-800 dark:bg-purple-900/30 dark:text-purple-400"},b={default:"border border-gray-300 text-gray-700 dark:border-gray-600 dark:text-gray-300",primary:"border border-blue-600 text-blue-600 dark:border-blue-400 dark:text-blue-400",success:"border border-green-600 text-green-600 dark:border-green-400 dark:text-green-400",warning:"border border-yellow-600 text-yellow-600 dark:border-yellow-400 dark:text-yellow-400",danger:"border border-red-600 text-red-600 dark:border-red-400 dark:text-red-400",info:"border border-blue-600 text-blue-600 dark:border-blue-400 dark:text-blue-400",purple:"border border-purple-600 text-purple-600 dark:border-purple-400 dark:text-purple-400"},v={sm:"px-2 py-0.5 text-xs",md:"px-2.5 py-1 text-sm",lg:"px-3 py-1.5 text-base"},k={sm:"h-3 w-3",md:"h-3.5 w-3.5",lg:"h-4 w-4"},S={default:"bg-gray-600 dark:bg-gray-400",primary:"bg-blue-600 dark:bg-blue-400",success:"bg-green-600 dark:bg-green-400",warning:"bg-yellow-600 dark:bg-yellow-400",danger:"bg-red-600 dark:bg-red-400",info:"bg-blue-600 dark:bg-blue-400",purple:"bg-purple-600 dark:bg-purple-400"},w=h!==void 0?u!==void 0&&h>u?`${u}+`:h.toString():null,N=t.jsxs(t.Fragment,{children:[o&&t.jsx("span",{className:f("h-2 w-2 rounded-full mr-1.5",S[r])}),n&&t.jsx("span",{className:f(k[a],"mr-1"),children:n}),e,w&&t.jsx("span",{className:"ml-1",children:w}),d&&i&&t.jsx("button",{onClick:E=>{E.stopPropagation(),i()},className:"ml-1 hover:bg-black/10 dark:hover:bg-white/10 rounded-full p-0.5","aria-label":"Dismiss",children:t.jsx(he.XMarkIcon,{className:f(k[a])})})]}),C=c?"button":"span";return t.jsx(C,{onClick:c,className:f("inline-flex items-center font-medium",l?b[r]:m[r],v[a],s?"rounded-full":"rounded",c&&"cursor-pointer hover:opacity-80",y),children:N})},Oo=({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":"UbadgeUdesigner",children:r||"UbadgeUdesigner Component"});var kr={},_={},it;function Ee(){if(it)return _;it=1,Object.defineProperty(_,"__esModule",{value:!0}),_.Currency=_.ErrorType=_.FeatureFlag=_.EmailValidationState=_.PlatformType=_.ConnectionState=_.ConnectionType=_.EmailSortCriteria=_.SortOrder=_.EmailAddressType=_.InfoType=_.NotificationType=_.RequestStatus=_.SubscriptionAction=_.EmailAction=_.MediumView=_.MobileView=_.EmailComposeType=_.FontSize=_.Theme=_.Chain=_.ChainType=_.AuthStatus=void 0;var e;(function(x){x.CONNECTED="connected",x.DISCONNECTED="disconnected",x.VERIFIED="verified"})(e||(_.AuthStatus=e={}));var r;(function(x){x.EVM="evm",x.SOLANA="solana"})(r||(_.ChainType=r={}));var a;(function(x){x.ETH_MAINNET="eth-mainnet",x.ETH_SEPOLIA="eth-sepolia",x.ETH_GOERLI="eth-goerli",x.POLYGON_MAINNET="polygon-mainnet",x.POLYGON_MUMBAI="polygon-mumbai",x.POLYGON_AMOY="polygon-amoy",x.OPTIMISM_MAINNET="optimism-mainnet",x.OPTIMISM_SEPOLIA="optimism-sepolia",x.OPTIMISM_GOERLI="optimism-goerli",x.ARBITRUM_MAINNET="arbitrum-mainnet",x.ARBITRUM_SEPOLIA="arbitrum-sepolia",x.ARBITRUM_GOERLI="arbitrum-goerli",x.BASE_MAINNET="base-mainnet",x.BASE_SEPOLIA="base-sepolia",x.BASE_GOERLI="base-goerli",x.AVALANCHE_MAINNET="avalanche-mainnet",x.AVALANCHE_FUJI="avalanche-fuji",x.BNB_MAINNET="bnb-mainnet",x.BNB_TESTNET="bnb-testnet",x.GNOSIS_MAINNET="gnosis-mainnet",x.GNOSIS_CHIADO="gnosis-chiado",x.CELO_MAINNET="celo-mainnet",x.CELO_ALFAJORES="celo-alfajores",x.ZKSYNC_MAINNET="zksync-mainnet",x.ZKSYNC_SEPOLIA="zksync-sepolia",x.LINEA_MAINNET="linea-mainnet",x.LINEA_SEPOLIA="linea-sepolia",x.SCROLL_MAINNET="scroll-mainnet",x.SCROLL_SEPOLIA="scroll-sepolia",x.MONAD_MAINNET="monad-mainnet",x.MONAD_TESTNET="monad-testnet",x.STORY_MAINNET="story-mainnet",x.STORY_TESTNET="story-testnet",x.PLUME_MAINNET="plume-mainnet",x.PLUME_TESTNET="plume-testnet",x.NEXUS_MAINNET="nexus-mainnet",x.NEXUS_TESTNET="nexus-testnet",x.HYPEREVM_MAINNET="hyperevm-mainnet",x.HYPEREVM_TESTNET="hyperevm-testnet",x.SONIC_MAINNET="sonic-mainnet",x.SONIC_TESTNET="sonic-testnet",x.SONIC_BLAZE="sonic-blaze",x.UNICHAIN_MAINNET="unichain-mainnet",x.UNICHAIN_SEPOLIA="unichain-sepolia",x.WORLD_MAINNET="world-mainnet",x.XDC_MAINNET="xdc-mainnet",x.INK_TESTNET="ink-testnet",x.FETCH_MAINNET="fetch-mainnet",x.FETCH_TESTNET="fetch-testnet",x.GENSYN_MAINNET="gensyn-mainnet",x.GENSYN_TESTNET="gensyn-testnet",x.RITUAL_MAINNET="ritual-mainnet",x.RITUAL_TESTNET="ritual-testnet",x.SOLANA_MAINNET="solana-mainnet",x.SOLANA_DEVNET="solana-devnet",x.SOLANA_TESTNET="solana-testnet",x.EVM_LOCAL="evm-local",x.SOLANA_LOCAL="solana-local"})(a||(_.Chain=a={}));var n;(function(x){x.LIGHT="light",x.DARK="dark",x.SYSTEM="system"})(n||(_.Theme=n={}));var o;(function(x){x.SMALL="small",x.MEDIUM="medium",x.LARGE="large"})(o||(_.FontSize=o={}));var s;(function(x){x.NEW="new",x.REPLY="reply",x.REPLY_ALL="replyAll",x.FORWARD="forward"})(s||(_.EmailComposeType=s={}));var l;(function(x){x.EMAIL_ADDRESSES="emailAddresses",x.FOLDERS="folders",x.EMAILS="emails",x.EMAIL_BODY="emailBody"})(l||(_.MobileView=l={}));var c;(function(x){x.LEFT="left",x.RIGHT="right"})(c||(_.MediumView=c={}));var d;(function(x){x.OPEN="open",x.REPLY="reply",x.FORWARD="forward",x.DELETE="delete",x.STAR="star",x.UNSTAR="unstar",x.MARK_READ="mark_read",x.MARK_UNREAD="mark_unread"})(d||(_.EmailAction=d={}));var i;(function(x){x.VIEW="view",x.PURCHASE="purchase",x.CANCEL="cancel",x.RESTORE="restore"})(i||(_.SubscriptionAction=i={}));var h;(function(x){x.IDLE="idle",x.LOADING="loading",x.SUCCESS="success",x.ERROR="error"})(h||(_.RequestStatus=h={}));var u;(function(x){x.INFO="info",x.SUCCESS="success",x.WARNING="warning",x.ERROR="error"})(u||(_.NotificationType=u={}));var y;(function(x){x.INFO="info",x.SUCCESS="success",x.WARNING="warning",x.ERROR="error"})(y||(_.InfoType=y={}));var m;(function(x){x.DIRECT="direct",x.ENS="ens",x.SNS="sns",x.CUSTOM="custom"})(m||(_.EmailAddressType=m={}));var b;(function(x){x.ASC="asc",x.DESC="desc"})(b||(_.SortOrder=b={}));var v;(function(x){x.DATE="date",x.SUBJECT="subject",x.FROM="from",x.SIZE="size"})(v||(_.EmailSortCriteria=v={}));var k;(function(x){x.UNKNOWN="unknown",x.NONE="none",x.WIFI="wifi",x.CELLULAR_2G="2g",x.CELLULAR_3G="3g",x.CELLULAR_4G="4g",x.CELLULAR_5G="5g",x.ETHERNET="ethernet"})(k||(_.ConnectionType=k={}));var S;(function(x){x.UNKNOWN="unknown",x.DISCONNECTED="disconnected",x.CONNECTING="connecting",x.CONNECTED="connected",x.RECONNECTING="reconnecting",x.VERIFIED="verified",x.LIMITED="limited",x.ERROR="error"})(S||(_.ConnectionState=S={}));var w;(function(x){x.WEB="web",x.REACT_NATIVE="react_native",x.DESKTOP="desktop"})(w||(_.PlatformType=w={}));var N;(function(x){x.VALID="valid",x.INVALID="invalid",x.PENDING="pending",x.UNKNOWN="unknown"})(N||(_.EmailValidationState=N={}));var C;(function(x){x.AI_SEARCH="ai_search",x.SMART_COMPOSE="smart_compose",x.ADVANCED_FILTERS="advanced_filters",x.DARK_MODE="dark_mode",x.NOTIFICATIONS="notifications",x.ANALYTICS="analytics"})(C||(_.FeatureFlag=C={}));var E;(function(x){x.NETWORK="network",x.AUTH="auth",x.VALIDATION="validation",x.PERMISSION="permission",x.UNKNOWN="unknown"})(E||(_.ErrorType=E={}));var I;return(function(x){x.USD="USD",x.EUR="EUR",x.GBP="GBP",x.CAD="CAD",x.AUD="AUD"})(I||(_.Currency=I={})),_}var wr={},ct;function Uo(){return ct||(ct=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.getWalletConnectionState=e.isWalletVerified=e.isWalletConnected=void 0;const r=Ee(),a=s=>s!=null&&!!s.walletAddress;e.isWalletConnected=a;const n=s=>(0,e.isWalletConnected)(s)&&!!s.message&&!!s.signature;e.isWalletVerified=n;const o=s=>(0,e.isWalletConnected)(s)?(0,e.isWalletVerified)(s)?r.ConnectionState.VERIFIED:r.ConnectionState.CONNECTED:r.ConnectionState.DISCONNECTED;e.getWalletConnectionState=o})(wr)),wr}var J={},dt;function gt(){if(dt)return J;dt=1,Object.defineProperty(J,"__esModule",{value:!0}),J.PROTOCOL_CONSTANTS=J.TransactionStatus=J.MessageType=void 0,J.isSolanaAddress=a,J.isEvmAddress=n,J.isSolanaRecipient=o,J.isEvmRecipient=s;var e;(function(l){l.STANDARD="standard",l.PRIORITY="priority",l.PREPARED_STANDARD="prepared_standard",l.PREPARED_PRIORITY="prepared_priority"})(e||(J.MessageType=e={}));var r;(function(l){l.SUCCESS="success",l.FAILED="failed",l.PENDING="pending"})(r||(J.TransactionStatus=r={}));function a(l){try{if(l.length<32||l.length>44||!/^[1-9A-HJ-NP-Za-km-z]+$/.test(l))return!1;try{return require("bs58").decode(l).length===32}catch{return!0}}catch{return!1}}function n(l){return/^0x[a-fA-F0-9]{40}$/.test(l)}function o(l){return a(l)}function s(l){return n(l)}return J.PROTOCOL_CONSTANTS={SEND_FEE:100000n,CLAIM_PERIOD:1440*60*60,REVENUE_SHARES:{SENDER:90,OWNER:10},USDC_DECIMALS:6,MAX_LENGTHS:{SUBJECT:200,BODY:2e3,MAIL_ID:100}},J}var me={},Q={},ut;function ht(){if(ut)return Q;ut=1,Object.defineProperty(Q,"__esModule",{value:!0}),Q.AddressType=void 0,Q.isENSName=n,Q.isSNSName=o,Q.getAddressType=s,Q.isValidWalletAddress=l,Q.isValidSignature=c,Q.parseEmailAddress=d,Q.formatWalletAddress=i,Q.getChainDisplayName=h;const e=Ee(),r=gt();var a;(function(u){u.EVMAddress="EVMAddress",u.SolanaAddress="SolanaAddress",u.ENSName="ENSName",u.SNSName="SNSName"})(a||(Q.AddressType=a={}));function n(u){const y=u.toLowerCase();if(!y.endsWith(".eth")&&!y.endsWith(".box"))return!1;const m=(y.endsWith(".eth"),y.slice(0,-4));if(m.length===0)return!1;const b=m.split("."),v=/^[a-z0-9]([a-z0-9-]*[a-z0-9])?$/;for(const k of b)if(k.length===0||!v.test(k)||k.includes("--"))return!1;return!0}function o(u){const y=u.toLowerCase(),b=[".sol",".abc",".bonk",".poor",".gm",".dao",".defi",".web3"].find(w=>y.endsWith(w));if(!b)return!1;const v=y.slice(0,-b.length);if(v.length===0)return!1;const k=v.split("."),S=/^[a-z0-9]([a-z0-9-]*[a-z0-9])?$/;for(const w of k)if(w.length===0||!S.test(w)||w.includes("--"))return!1;return!0}function s(u,y=void 0){if((0,r.isEvmAddress)(u))return a.EVMAddress;if((0,r.isSolanaAddress)(u))return a.SolanaAddress;if(y&&u.includes(".")){if(y===a.EVMAddress)return a.ENSName;if(y===a.SolanaAddress)return a.SNSName}}function l(u,y){if(!u||typeof u!="string")return!1;const m=s(u);switch(y){case e.ChainType.EVM:return m===a.EVMAddress||m===a.ENSName;case e.ChainType.SOLANA:return m===a.SolanaAddress||m===a.SNSName;default:return!!m}}function c(u,y){if(!u||typeof u!="string")return!1;switch(y){case e.ChainType.EVM:return/^0x[a-fA-F0-9]{130}$/.test(u);case e.ChainType.SOLANA:return/^[1-9A-HJ-NP-Za-km-z]{87,88}$/.test(u);default:return u.length>50}}function d(u){if(!u||typeof u!="string")return;const y=u.split("@");if(y.length!==2)return;const[m,b]=y;if(!m||!b)return;const v=s(m);return{address:m,domain:b,type:v}}function i(u){if(!u||u.length<10)return u;const y=s(u);return(y===a.ENSName||y===a.SNSName)&&u.length<=20?u:`${u.slice(0,6)}...${u.slice(-4)}`}function h(u){if(!u)return"Unknown Chain";switch(u){case e.ChainType.EVM:return"EVM Chain";case e.ChainType.SOLANA:return"Solana";default:return"Blockchain"}}return Q}var ft;function Do(){if(ft)return me;ft=1,Object.defineProperty(me,"__esModule",{value:!0}),me.validateDomain=r,me.validateMessage=a,me.validateAddress=n,me.validateAmount=o;const e=ht();function r(s){if(!s||s.length===0)throw new Error("Domain cannot be empty");if(s.length>100)throw new Error("Domain cannot exceed 100 characters");if(!/^[a-zA-Z0-9]([a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(\.[a-zA-Z0-9]([a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/.test(s))throw new Error("Invalid domain format");return!0}function a(s,l){if(!s||s.length===0)throw new Error("Message subject cannot be empty");if(s.length>200)throw new Error("Message subject cannot exceed 200 characters");if(!l||l.length===0)throw new Error("Message body cannot be empty");if(l.length>1e4)throw new Error("Message body cannot exceed 10000 characters");return!0}function n(s,l){if(!s||s.length===0)throw new Error("Address cannot be empty");if(!(0,e.isValidWalletAddress)(s,l))throw new Error(`Invalid ${l} address format`);return!0}function o(s){if(s==null||s===""||typeof s=="string"&&s.trim()==="")throw new Error("Invalid amount format");let l;try{if(typeof s=="string"){if(!/^-?\d+$/.test(s.trim()))throw new Error("Invalid amount format");l=BigInt(s)}else if(typeof s=="number"){if(!Number.isFinite(s))throw new Error("Invalid amount format");l=BigInt(Math.floor(s))}else if(typeof s=="bigint")l=s;else throw new Error("Invalid amount format")}catch{throw new Error("Invalid amount format")}if(l<0n)throw new Error("Amount cannot be negative");return l}return me}var De={},bt;function zo(){if(bt)return De;bt=1,Object.defineProperty(De,"__esModule",{value:!0}),De.StorageType=void 0;var e;return(function(r){r.LOCAL_STORAGE="localStorage",r.SESSION_STORAGE="sessionStorage",r.ASYNC_STORAGE="asyncStorage",r.MEMORY="memory"})(e||(De.StorageType=e={})),De}var ye={},mt;function jo(){if(mt)return ye;mt=1,Object.defineProperty(ye,"__esModule",{value:!0}),ye.AnalyticsEventBuilder=ye.AnalyticsEvent=void 0;var e;(function(a){a.USER_LOGIN="user_login",a.USER_LOGOUT="user_logout",a.USER_SIGNUP="user_signup",a.EMAIL_SENT="email_sent",a.EMAIL_RECEIVED="email_received",a.EMAIL_OPENED="email_opened",a.EMAIL_REPLY="email_reply",a.EMAIL_FORWARD="email_forward",a.EMAIL_DELETE="email_delete",a.EMAIL_STAR="email_star",a.EMAIL_COMPOSE="email_compose",a.EMAIL_CLICKED="email_clicked",a.PAGE_VIEW="page_view",a.SCREEN_VIEW="screen_view",a.FOLDER_SWITCH="folder_switch",a.SUBSCRIPTION_VIEW="subscription_view",a.SUBSCRIPTION_PURCHASE="subscription_purchase",a.SUBSCRIPTION_CANCEL="subscription_cancel",a.SEARCH_PERFORMED="search_performed",a.SETTINGS_CHANGED="settings_changed",a.ERROR_OCCURRED="error_occurred",a.AB_TEST_VIEWED="ab_test_viewed",a.AB_TEST_CONVERTED="ab_test_converted",a.CUSTOM_EVENT="custom_event"})(e||(ye.AnalyticsEvent=e={}));class r{static emailAction(n,o,s){return{action:n,email_id:o,folder:s,timestamp:Date.now()}}static pageView(n,o){return{page_name:n,page_path:o,timestamp:Date.now()}}static error(n,o,s){return{error_type:n,error_message:o,page_name:s,timestamp:Date.now()}}static subscription(n,o,s,l){return{action:n,plan_type:o,amount:s,currency:l,timestamp:Date.now()}}static engagement(n,o,s){return{feature:n,interaction:o,duration:s,timestamp:Date.now()}}static performance(n,o,s){return{metric:n,value:o,context:s,timestamp:Date.now()}}}return ye.AnalyticsEventBuilder=r,ye}var xr={},yt;function _o(){return yt||(yt=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.ProcessedEventName=e.ContractType=e.ChainType=void 0;var r=Ee();Object.defineProperty(e,"ChainType",{enumerable:!0,get:function(){return r.ChainType}});var a;(function(o){o.Mailer="Mailer",o.MailService="MailService"})(a||(e.ContractType=a={}));var n;(function(o){o.MailSent="MailSent",o.PreparedMailSent="PreparedMailSent",o.DelegationSet="DelegationSet",o.DelegationCleared="DelegationCleared",o.DomainRegistered="DomainRegistered",o.DomainExtended="DomainExtended",o.DomainReleased="DomainReleased",o.FeeUpdated="FeeUpdated",o.SharesRecorded="SharesRecorded",o.RecipientClaimed="RecipientClaimed",o.OwnerClaimed="OwnerClaimed",o.ExpiredSharesClaimed="ExpiredSharesClaimed"})(n||(e.ProcessedEventName=n={}))})(xr)),xr}var ze={},pt;function Bo(){if(pt)return ze;pt=1,Object.defineProperty(ze,"__esModule",{value:!0}),ze.NetworkError=void 0;class e extends Error{constructor(a,n,o,s){super(a),this.name="NetworkError",this.status=n,this.statusText=o,this.response=s}}return ze.NetworkError=e,ze}var je={},vt;function Fo(){if(vt)return je;vt=1,Object.defineProperty(je,"__esModule",{value:!0}),je.WalletType=void 0;var e;return(function(r){r.METAMASK="metamask",r.PHANTOM="phantom",r.COINBASE="coinbase",r.WALLETCONNECT="walletconnect",r.INJECTED="injected"})(e||(je.WalletType=e={})),je}var _e={},kt;function Wo(){if(kt)return _e;kt=1,Object.defineProperty(_e,"__esModule",{value:!0}),_e.RateLimitPeriodType=void 0;var e;return(function(r){r.HOUR="hour",r.DAY="day",r.MONTH="month"})(e||(_e.RateLimitPeriodType=e={})),_e}var pe={},wt;function Vo(){return wt||(wt=1,Object.defineProperty(pe,"__esModule",{value:!0}),pe.ALL_PERIODS=pe.PERIOD_RANKS=void 0,pe.PERIOD_RANKS={weekly:1,monthly:2,quarterly:3,yearly:4,lifetime:5},pe.ALL_PERIODS=["weekly","monthly","quarterly","yearly","lifetime"]),pe}var Be={},xt;function $o(){return xt||(xt=1,Object.defineProperty(Be,"__esModule",{value:!0}),Be.NONE_ENTITLEMENT=void 0,Be.NONE_ENTITLEMENT="none"),Be}var le={},Nt;function Ct(){if(Nt)return le;Nt=1,Object.defineProperty(le,"__esModule",{value:!0}),le.InvitationStatus=le.EntityRole=le.EntityType=void 0;var e;(function(n){n.PERSONAL="personal",n.ORGANIZATION="organization"})(e||(le.EntityType=e={}));var r;(function(n){n.OWNER="owner",n.MANAGER="manager",n.MEMBER="member"})(r||(le.EntityRole=r={}));var a;return(function(n){n.PENDING="pending",n.ACCEPTED="accepted",n.DECLINED="declined",n.EXPIRED="expired"})(a||(le.InvitationStatus=a={})),le}var Nr={},St;function Ho(){return St||(St=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.ROLE_PERMISSIONS=e.MEMBER_PERMISSIONS=e.MANAGER_PERMISSIONS=e.OWNER_PERMISSIONS=void 0,e.getPermissionsForRole=a,e.hasPermission=n;const r=Ct();e.OWNER_PERMISSIONS={canViewEntity:!0,canEditEntity:!0,canDeleteEntity:!0,canManageMembers:!0,canInviteMembers:!0,canManageProjects:!0,canCreateProjects:!0,canViewProjects:!0,canManageApiKeys:!0,canViewApiKeys:!0},e.MANAGER_PERMISSIONS={canViewEntity:!0,canEditEntity:!0,canDeleteEntity:!1,canManageMembers:!1,canInviteMembers:!1,canManageProjects:!0,canCreateProjects:!0,canViewProjects:!0,canManageApiKeys:!0,canViewApiKeys:!0},e.MEMBER_PERMISSIONS={canViewEntity:!0,canEditEntity:!1,canDeleteEntity:!1,canManageMembers:!1,canInviteMembers:!1,canManageProjects:!1,canCreateProjects:!1,canViewProjects:!0,canManageApiKeys:!1,canViewApiKeys:!0},e.ROLE_PERMISSIONS={[r.EntityRole.OWNER]:e.OWNER_PERMISSIONS,[r.EntityRole.MANAGER]:e.MANAGER_PERMISSIONS,[r.EntityRole.MEMBER]:e.MEMBER_PERMISSIONS};function a(o){return e.ROLE_PERMISSIONS[o]}function n(o,s){return e.ROLE_PERMISSIONS[o][s]}})(Nr)),Nr}var Fe={},Et;function qo(){if(Et)return Fe;Et=1,Object.defineProperty(Fe,"__esModule",{value:!0}),Fe.Web3UsernameValidator=void 0;const e=Ee();class r{static validate(n){if(n){if(this.EVM_REGEX.test(n))return{name:null,address:n.toLowerCase(),chainType:e.ChainType.EVM};if(!n.startsWith("0x")&&n.length>=32&&n.length<=44&&this.BASE58_REGEX.test(n))return{name:null,address:n,chainType:e.ChainType.SOLANA};if((n.toLowerCase().endsWith(".eth")||n.toLowerCase().endsWith(".box"))&&n.length>=5&&this.ENS_REGEX.test(n))return{name:n.toLowerCase(),address:null,chainType:e.ChainType.EVM};if(n.toLowerCase().includes(".")){const o=n.toLowerCase().split(".");if(o.length===2){const[s,l]=o;if(this.VALID_SNS_TLDS.includes(l)&&this.SNS_NAME_REGEX.test(s)&&s.length>=1)return{name:n.toLowerCase(),address:null,chainType:e.ChainType.SOLANA}}}}}static isValidEVMAddress(n){return this.EVM_REGEX.test(n)}static isValidSolanaAddress(n){return!n.startsWith("0x")&&n.length>=32&&n.length<=44&&this.BASE58_REGEX.test(n)}static isValidENSName(n){return(n.toLowerCase().endsWith(".eth")||n.toLowerCase().endsWith(".box"))&&n.length>=5&&this.ENS_REGEX.test(n)}static isValidSNSName(n){if(!n.toLowerCase().includes("."))return!1;const o=n.toLowerCase().split(".");if(o.length!==2)return!1;const[s,l]=o;return this.VALID_SNS_TLDS.includes(l)&&this.SNS_NAME_REGEX.test(s)&&s.length>=1}}return Fe.Web3UsernameValidator=r,r.EVM_REGEX=/^0x[a-fA-F0-9]{40}$/,r.BASE58_REGEX=/^[1-9A-HJ-NP-Za-km-z]+$/,r.ENS_REGEX=/^[a-zA-Z0-9]([a-zA-Z0-9]|(-[a-zA-Z0-9]))*\.(eth|box)$/i,r.SNS_NAME_REGEX=/^[a-zA-Z0-9]([a-zA-Z0-9]|(-[a-zA-Z0-9]))*$/,r.VALID_SNS_TLDS=["sol","abc","backpack","bonk","coin","dao","defi","gm","poor","pump","shdw","stepn","web3"],Fe}var Cr={},At;function Go(){return At||(At=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.parseJson=e.createAssertion=e.isUrl=e.isEmail=e.isValidDate=e.isErrorResponse=e.isSuccessResponse=e.isApiResponse=e.optional=e.validateArray=e.hasRequiredProperties=e.isNullish=e.isArray=e.isObject=e.isBoolean=e.isNumber=e.isString=e.createValidator=void 0;const r=(N,C)=>E=>{try{return N(E)?{isValid:!0,data:E}:{isValid:!1,error:`Invalid ${C}`,data:null}}catch(I){return{isValid:!1,error:`Validation error for ${C}: ${I instanceof Error?I.message:"Unknown error"}`,data:null}}};e.createValidator=r;const a=N=>typeof N=="string";e.isString=a;const n=N=>typeof N=="number"&&!isNaN(N);e.isNumber=n;const o=N=>typeof N=="boolean";e.isBoolean=o;const s=N=>typeof N=="object"&&N!==null&&!Array.isArray(N);e.isObject=s;const l=N=>Array.isArray(N);e.isArray=l;const c=N=>N==null;e.isNullish=c;const d=(N,C)=>(0,e.isObject)(N)?C.every(E=>E in N):!1;e.hasRequiredProperties=d;const i=(N,C)=>(0,e.isArray)(N)?N.every(C):!1;e.validateArray=i;const h=N=>C=>C===void 0||N(C);e.optional=h;const u=N=>(0,e.isObject)(N)&&(0,e.isBoolean)(N.success);e.isApiResponse=u;const y=(N,C)=>!(0,e.isApiResponse)(N)||!N.success?!1:C&&"data"in N?C(N.data):!0;e.isSuccessResponse=y;const m=N=>(0,e.isApiResponse)(N)&&!N.success&&"error"in N&&(0,e.isString)(N.error);e.isErrorResponse=m;const b=N=>{if(!(0,e.isString)(N))return!1;const C=new Date(N);return!isNaN(C.getTime())};e.isValidDate=b;const v=N=>(0,e.isString)(N)?/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(N):!1;e.isEmail=v;const k=N=>{if(!(0,e.isString)(N))return!1;try{return new URL(N),!0}catch{return!1}};e.isUrl=k;const S=(N,C)=>(E,I=C)=>{if(!N(E))throw new TypeError(`Invalid ${I}: expected ${C}`)};e.createAssertion=S;const w=(N,C)=>{try{const E=JSON.parse(N);return C?C(E)?{isValid:!0,data:E}:{isValid:!1,error:"Parsed JSON does not match expected type",data:null}:{isValid:!0,data:E}}catch(E){return{isValid:!1,error:`JSON parse error: ${E instanceof Error?E.message:"Unknown error"}`,data:null}}};e.parseJson=w})(Cr)),Cr}var ee={},Tt;function Yo(){if(Tt)return ee;Tt=1,Object.defineProperty(ee,"__esModule",{value:!0}),ee.createMultiChainId=e,ee.createUserMultiChainId=r,ee.createChainStatsId=a,ee.createDelegationId=n,ee.normalizeAddress=o,ee.formatBigInt=s,ee.isZeroAddress=l,ee.isTestNet=c,ee.validateEventArgs=d;function e(i,h,u){return`${i}-${h}-${u}`}function r(i,h){return`${i}-${h.toLowerCase()}`}function a(i){return`${i}-global`}function n(i,h){return`${i.toLowerCase()}-${h}`}function o(i){return i.toLowerCase()}function s(i,h=18){const u=BigInt(10**h),y=i/u,m=i%u;return m===0n?y.toString():`${y}.${m.toString().padStart(h,"0").replace(/0+$/,"")}`}function l(i){return i.toLowerCase()==="0x0000000000000000000000000000000000000000"}function c(i){const h=new Set([31337,11155111,80001,80002,421614,11155420,84532,43113]),u=new Set([-102,-103,-104]);return h.has(i)||u.has(i)}function d(i,h){for(const u of h)if(i[u]===void 0||i[u]===null)return console.error(`❌ Missing required field: ${String(u)}`),!1;return!0}return ee}var te={},It;function Ko(){if(It)return te;It=1,Object.defineProperty(te,"__esModule",{value:!0}),te.generateAuthMessage=r,te.isAuthExpired=a,te.getAuthStatusText=n,te.canAccessProtectedFeatures=o,te.isAuthStatusConnected=s,te.generateNonce=l,te.extractNonceFromMessage=c,te.isValidNonce=d;const e=Ee();function r(i,h){const u=h||`${Date.now()}-${Math.random().toString(36).substr(2,9)}`;return`Authenticate with ${i}
22
- Nonce: ${u}`}function a(i,h=24){const u=new Date(i.getTime()+h*60*60*1e3);return new Date>u}function n(i){switch(i){case e.AuthStatus.DISCONNECTED:return"Not connected";case e.AuthStatus.CONNECTED:return"Connected - Please verify";case e.AuthStatus.VERIFIED:return"Authenticated";default:return"Unknown status"}}function o(i){return i===e.AuthStatus.VERIFIED}function s(i){return i===e.AuthStatus.CONNECTED||i===e.AuthStatus.VERIFIED}function l(){return`${Date.now()}-${Math.random().toString(36).substr(2,9)}`}function c(i){const h=i.match(/Nonce:\s*(.+)$/m);return h?h[1].trim():void 0}function d(i){if(!i||typeof i!="string"||i.length<10)return!1;const h=i.split("-");if(h.length>=2){const u=parseInt(h[0],10);if(!isNaN(u)){const y=Date.now()-864e5;if(u<y)return!1}}return!0}return te}var Ae={},Lt;function Xo(){if(Lt)return Ae;Lt=1,Object.defineProperty(Ae,"__esModule",{value:!0}),Ae.parseAdminEmails=e,Ae.isAdminEmail=r,Ae.createAdminChecker=a;function e(n){return n?n.split(",").map(o=>o.trim().toLowerCase()).filter(o=>o.length>0&&o.includes("@")):[]}function r(n,o){return n?o.includes(n.toLowerCase()):!1}function a(n){const o=e(n);return s=>r(s,o)}return Ae}var Sr={},Mt;function Zo(){return Mt||(Mt=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.CLAIM_PERIOD_DAYS=e.USDC_DECIMALS=void 0,e.formatUSDC=r,e.parseUSDC=a,e.USDC_DECIMALS=6,e.CLAIM_PERIOD_DAYS=60;function r(n){return(n/Math.pow(10,e.USDC_DECIMALS)).toFixed(2)}function a(n){return Math.floor(parseFloat(n)*Math.pow(10,e.USDC_DECIMALS))}})(Sr)),Sr}var ae={},Pt;function Jo(){if(Pt)return ae;Pt=1,Object.defineProperty(ae,"__esModule",{value:!0}),ae.formatEmailDate=e,ae.formatTimestamp=r,ae.formatRelativeTime=a,ae.parseDate=n,ae.isDateInRange=o,ae.addDays=s,ae.addHours=l;function e(c){const d=typeof c=="string"?new Date(c):c;if(isNaN(d.getTime()))return"Invalid date";const i=new Date,h=i.getTime()-d.getTime(),u=Math.floor(h/(1e3*60*60*24));return u===0?d.toLocaleTimeString("en-US",{hour:"numeric",minute:"2-digit",hour12:!0}):u===1?"Yesterday":u<7?d.toLocaleDateString("en-US",{weekday:"long"}):d.getFullYear()===i.getFullYear()?d.toLocaleDateString("en-US",{month:"short",day:"numeric"}):d.toLocaleDateString("en-US",{year:"numeric",month:"short",day:"numeric"})}function r(c){return new Date(c).toISOString()}function a(c){const d=typeof c=="string"||typeof c=="number"?new Date(c):c;if(isNaN(d.getTime()))return"Invalid date";const h=new Date().getTime()-d.getTime(),u=Math.floor(h/1e3),y=Math.floor(u/60),m=Math.floor(y/60),b=Math.floor(m/24),v=Math.floor(b/7),k=Math.floor(b/30),S=Math.floor(b/365);return u<60?"just now":y<60?y===1?"1 minute ago":`${y} minutes ago`:m<24?m===1?"1 hour ago":`${m} hours ago`:b<7?b===1?"1 day ago":`${b} days ago`:v<4?v===1?"1 week ago":`${v} weeks ago`:k<12?k===1?"1 month ago":`${k} months ago`:S===1?"1 year ago":`${S} years ago`}function n(c){try{const d=new Date(c);return isNaN(d.getTime())?null:d}catch{return null}}function o(c,d,i){return c>=d&&c<=i}function s(c,d){const i=new Date(c);return i.setDate(i.getDate()+d),i}function l(c,d){const i=new Date(c);return i.setHours(i.getHours()+d),i}return ae}var q={},Ot;function Qo(){if(Ot)return q;Ot=1,Object.defineProperty(q,"__esModule",{value:!0}),q.truncate=e,q.capitalize=r,q.toTitleCase=a,q.toKebabCase=n,q.toCamelCase=o,q.toSnakeCase=s,q.normalizeWhitespace=l,q.isBlank=c,q.isNotBlank=d,q.escapeHtml=i,q.stripHtml=h,q.getInitials=u,q.formatBytes=y,q.randomString=m,q.pluralize=b,q.formatNumber=v;function e(k,S,w="..."){return!k||k.length<=S?k:k.slice(0,S-w.length)+w}function r(k){return k&&k.charAt(0).toUpperCase()+k.slice(1)}function a(k){return k&&k.toLowerCase().split(" ").map(S=>r(S)).join(" ")}function n(k){return k&&k.replace(/([a-z])([A-Z])/g,"$1-$2").replace(/[\s_]+/g,"-").toLowerCase()}function o(k){return k&&k.replace(/[-_\s]+(.)?/g,(S,w)=>w?w.toUpperCase():"").replace(/^./,S=>S.toLowerCase())}function s(k){return k&&k.replace(/([a-z])([A-Z])/g,"$1_$2").replace(/[\s-]+/g,"_").toLowerCase()}function l(k){return k&&k.replace(/\s+/g," ").trim()}function c(k){return!k||k.trim().length===0}function d(k){return!c(k)}function i(k){if(!k)return k;const S={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"};return k.replace(/[&<>"']/g,w=>S[w])}function h(k){return k&&k.replace(/<[^>]*>/g,"")}function u(k,S=2){return k?k.trim().split(/\s+/).slice(0,S).map(C=>C.charAt(0).toUpperCase()).join(""):""}function y(k,S=2){if(k===0)return"0 Bytes";const w=1024,N=S<0?0:S,C=["Bytes","KB","MB","GB","TB","PB"],E=Math.floor(Math.log(k)/Math.log(w));return parseFloat((k/Math.pow(w,E)).toFixed(N))+" "+C[E]}function m(k,S="alphanumeric"){let w;switch(S){case"alpha":w="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";break;case"numeric":w="0123456789";break;case"alphanumeric":w="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789";break;case"hex":w="0123456789abcdef";break;default:w=S}let N="";for(let C=0;C<k;C++)N+=w.charAt(Math.floor(Math.random()*w.length));return N}function b(k,S,w){return k===1?S:w||`${S}s`}function v(k){return k.toString().replace(/\B(?=(\d{3})+(?!\d))/g,",")}return q}var W={},Ut;function Ro(){if(Ut)return W;Ut=1,Object.defineProperty(W,"__esModule",{value:!0}),W.Z_INDEX=W.ANIMATION=W.NETWORK_IDS=W.WALLET_NAMES=W.CONTACT_INFO=W.ROUTES=W.SUCCESS_MESSAGES=W.ERROR_MESSAGES=W.TIME_FORMAT=W.SUBSCRIPTION_TIERS=W.EMAIL_CONFIG=W.STORAGE_KEYS=W.CHAIN_TYPE=W.AUTH_STATUS=W.API_RETRY_DELAY=W.API_RETRY_ATTEMPTS=W.API_TIMEOUT=void 0;const e=3e4;W.API_TIMEOUT=e;const r=3;W.API_RETRY_ATTEMPTS=r;const a=1e3;W.API_RETRY_DELAY=a;const n={DISCONNECTED:"disconnected",CONNECTED:"connected",VERIFIED:"verified"};W.AUTH_STATUS=n;const o={EVM:"evm",SOLANA:"solana",UNKNOWN:"unknown"};W.CHAIN_TYPE=o;const s={AUTH_TOKEN:"authToken",USER_DATA:"userData",THEME:"theme",EMAIL_CACHE:"emailCache",WALLET_ADDRESS:"walletAddress",CHAIN_TYPE:"chainType"};W.STORAGE_KEYS=s;const l={MAX_ATTACHMENT_SIZE:25*1024*1024,MAX_RECIPIENTS:100,ITEMS_PER_PAGE:50,REFRESH_INTERVAL:6e4,NOTIFICATION_COOLDOWN:3e5};W.EMAIL_CONFIG=l;const c={FREE:"free",BASIC:"basic",PRO:"pro",ENTERPRISE:"enterprise"};W.SUBSCRIPTION_TIERS=c;const d={SHORT_DATE:"MMM d",FULL_DATE:"MMM d, yyyy",DATE_TIME:"MMM d, yyyy h:mm a",RELATIVE:"relative"};W.TIME_FORMAT=d;const i={WALLET_NOT_CONNECTED:"Please connect your wallet first",INVALID_ADDRESS:"Please enter a valid address",NETWORK_ERROR:"Network error. Please try again.",AUTHENTICATION_FAILED:"Authentication failed. Please sign in again.",TRANSACTION_FAILED:"Transaction failed. Please try again.",INSUFFICIENT_FUNDS:"Insufficient funds for this operation",RATE_LIMITED:"Too many requests. Please wait a moment.",SESSION_EXPIRED:"Your session has expired. Please sign in again.",PERMISSION_DENIED:"You do not have permission to perform this action"};W.ERROR_MESSAGES=i;const h={EMAIL_SENT:"Email sent successfully",EMAIL_DELETED:"Email deleted successfully",PREFERENCES_SAVED:"Preferences saved successfully",WALLET_CONNECTED:"Wallet connected successfully",AUTHENTICATION_SUCCESS:"Authentication successful",DELEGATION_SUCCESS:"Delegation successful",SUBSCRIPTION_ACTIVATED:"Subscription activated successfully"};W.SUCCESS_MESSAGES=h;const u={HOME:"/",ABOUT:"/about",CONNECT:"/connect",MAIL:"/mail",COMPOSE:"/mail/compose",PREFERENCES:"/preferences",TERMS:"/terms",PRIVACY:"/privacy",DOCUMENTATION:"/document",WEB3_USERS:"/web3-users",WEB3_PROJECTS:"/web3-projects"};W.ROUTES=u;const y={SUPPORT_EMAIL:"support@sudobility.com",CONTACT_EMAIL:"info@sudobility.com"};W.CONTACT_INFO=y;const m={METAMASK:"MetaMask",WALLETCONNECT:"WalletConnect",COINBASE:"Coinbase Wallet",PHANTOM:"Phantom",SAFE:"Safe",ARGENT:"Argent",RAINBOW:"Rainbow",TRUST:"Trust Wallet",LEDGER:"Ledger",TREZOR:"Trezor"};W.WALLET_NAMES=m;const b={ETHEREUM_MAINNET:1,POLYGON:137,ARBITRUM:42161,OPTIMISM:10,BASE:8453,SOLANA_MAINNET:"mainnet-beta",SOLANA_DEVNET:"devnet"};W.NETWORK_IDS=b;const v={FAST:150,NORMAL:300,SLOW:500,VERY_SLOW:1e3};W.ANIMATION=v;const k={DROPDOWN:10,OVERLAY:20,MODAL:30,POPOVER:40,TOOLTIP:50,TOAST:60};return W.Z_INDEX=k,W}var We={},Dt;function es(){return Dt||(Dt=1,Object.defineProperty(We,"__esModule",{value:!0}),We.STATUS_VALUES=void 0,We.STATUS_VALUES={SUCCESS:"success",PENDING:"pending",FAILED:"failed",ERROR:"error"}),We}var Y={},zt;function jt(){if(zt)return Y;zt=1,Object.defineProperty(Y,"__esModule",{value:!0}),Y.storageLogger=Y.ensLogger=Y.contractLogger=Y.apiLogger=Y.authLogger=Y.logger=Y.LogLevel=void 0;var e;(function(d){d.ERROR="error",d.WARN="warn",d.INFO="info",d.DEBUG="debug"})(e||(Y.LogLevel=e={}));class r{constructor(){this.isDevelopment=process.env.NODE_ENV==="development"}formatTimestamp(){return new Date().toISOString()}formatMessage(i,h,u){const y=this.formatTimestamp(),m=u?` [${u}]`:"";return`[${y}]${m} ${h}`}shouldLog(i){return this.isDevelopment?!0:i===e.ERROR||i===e.WARN}error(i,h,u){this.shouldLog(e.ERROR)&&(console.error(this.formatMessage(e.ERROR,i,h)),u&&console.error(u))}warn(i,h,u){this.shouldLog(e.WARN)&&(console.warn(this.formatMessage(e.WARN,i,h)),u&&console.warn(u))}info(i,h,u){this.shouldLog(e.INFO)&&(console.log(this.formatMessage(e.INFO,i,h)),u&&console.log(u))}debug(i,h,u){this.shouldLog(e.DEBUG)&&(console.log(this.formatMessage(e.DEBUG,i,h)),u&&console.log(u))}withContext(i){return{error:(h,u)=>this.error(h,i,u),warn:(h,u)=>this.warn(h,i,u),info:(h,u)=>this.info(h,i,u),debug:(h,u)=>this.debug(h,i,u)}}}const a=new r;Y.logger=a;const n=a.withContext("AUTH");Y.authLogger=n;const o=a.withContext("API");Y.apiLogger=o;const s=a.withContext("CONTRACT");Y.contractLogger=s;const l=a.withContext("ENS");Y.ensLogger=l;const c=a.withContext("STORAGE");return Y.storageLogger=c,Y}var ve={},_t;function rs(){if(_t)return ve;_t=1,Object.defineProperty(ve,"__esModule",{value:!0}),ve.createURLSearchParams=r,ve.createSearchParams=a,ve.searchParamsToString=n,ve.parseSearchParams=o;class e{constructor(l){if(this.params=new Map,l)if(typeof l=="string")this.parseString(l);else if(Array.isArray(l))for(const[c,d]of l)this.append(c,d);else for(const[c,d]of Object.entries(l))d!==void 0&&this.append(c,d)}parseString(l){const c=l.startsWith("?")?l.slice(1):l;if(c)for(const d of c.split("&")){const[i,h=""]=d.split("=");i&&this.append(decodeURIComponent(i),decodeURIComponent(h))}}append(l,c){this.params.has(l)||this.params.set(l,[]);const d=this.params.get(l);d&&d.push(c)}delete(l){this.params.delete(l)}get(l){const c=this.params.get(l);return c&&c.length>0?c[0]:null}getAll(l){return this.params.get(l)||[]}has(l){return this.params.has(l)}set(l,c){this.params.set(l,[c])}toString(){const l=[];return this.params.forEach((c,d)=>{for(const i of c)l.push(`${encodeURIComponent(d)}=${encodeURIComponent(i)}`)}),l.join("&")}forEach(l){this.params.forEach((c,d)=>{for(const i of c)l(i,d)})}}function r(s){return typeof URLSearchParams<"u"?new URLSearchParams(s):new e(s)}function a(s){const l=r(void 0);for(const[c,d]of Object.entries(s))d!=null&&l.append(c,String(d));return l}function n(s){return s.toString()}function o(s){const l=r(s),c={};return l.forEach((d,i)=>{c[i]=d}),c}return ve}var K={},Bt;function ts(){if(Bt)return K;Bt=1,Object.defineProperty(K,"__esModule",{value:!0}),K.debounceAsync=K.clearExpiredCache=K.withCache=K.withTimeout=K.safeParallel=K.withLoadingState=K.safeAsync=void 0;const e=jt(),r=async(h,u)=>{try{return{data:await h(),success:!0}}catch(y){const m=y instanceof Error?y:new Error(String(y));return e.logger.error(`Async operation failed: ${m.message}`,u,y),{error:m,success:!1}}};K.safeAsync=r;const a=async(h,u,y,m)=>{u(!0),y(null);try{return await h()}catch(b){const v=b instanceof Error?b.message:String(b);y(v),e.logger.error(`Operation failed: ${v}`,m,b);return}finally{u(!1)}};K.withLoadingState=a;const n=async(h,u)=>{try{return{data:await Promise.all(h.map(m=>m())),success:!0}}catch(y){const m=y instanceof Error?y:new Error(String(y));return e.logger.error(`Parallel operations failed: ${m.message}`,u,y),{error:m,success:!1}}};K.safeParallel=n;const o=async(h,u,y)=>{const m=new Promise((b,v)=>setTimeout(()=>v(new Error(`Operation timed out after ${u}ms`)),u));try{return await Promise.race([h(),m])}catch(b){throw e.logger.error("Timeout operation failed",y,b),b}};K.withTimeout=o;const s=new Map,l=async(h,u,y=300*1e3)=>{const m=s.get(h),b=Date.now();if(m&&b-m.timestamp<m.ttl)return m.data;const v=await u();return s.set(h,{data:v,timestamp:b,ttl:y}),v};K.withCache=l;const c=()=>{const h=Date.now();for(const[u,y]of s.entries())h-y.timestamp>=y.ttl&&s.delete(u)};K.clearExpiredCache=c;const d=new Map,i=(h,u,y)=>(...m)=>new Promise(b=>{const v=d.get(y);v&&clearTimeout(v);const k=setTimeout(async()=>{d.delete(y);try{const S=await h(...m);b(S)}catch(S){e.logger.error("Debounced operation failed",y,S),b(void 0)}},u);d.set(y,k)});return K.debounceAsync=i,K}var Ft;function as(){return Ft||(Ft=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.EntityRole=e.EntityType=e.NONE_ENTITLEMENT=e.ALL_PERIODS=e.PERIOD_RANKS=e.RateLimitPeriodType=e.WalletType=e.NetworkError=e.ProcessedEventName=e.ContractType=e.AnalyticsEventBuilder=e.AnalyticsEvent=e.StorageType=e.validateMessage=e.validateDomain=e.validateAmount=e.validateAddress=e.isSolanaRecipient=e.isSolanaAddress=e.isEvmRecipient=e.isEvmAddress=e.TransactionStatus=e.PROTOCOL_CONSTANTS=e.MessageType=e.isWalletVerified=e.isWalletConnected=e.getWalletConnectionState=e.Theme=e.SubscriptionAction=e.SortOrder=e.RequestStatus=e.PlatformType=e.NotificationType=e.MobileView=e.MediumView=e.InfoType=e.FontSize=e.FeatureFlag=e.ErrorType=e.EmailValidationState=e.EmailSortCriteria=e.EmailComposeType=e.EmailAddressType=e.EmailAction=e.Currency=e.ConnectionType=e.ConnectionState=e.ChainType=e.Chain=e.AuthStatus=void 0,e.isAuthStatusConnected=e.isAuthExpired=e.getAuthStatusText=e.generateNonce=e.generateAuthMessage=e.extractNonceFromMessage=e.canAccessProtectedFeatures=e.validateEventArgs=e.normalizeAddress=e.isZeroAddress=e.isTestNet=e.formatBigInt=e.createUserMultiChainId=e.createMultiChainId=e.createDelegationId=e.createChainStatsId=e.parseEmailAddress=e.isValidWalletAddress=e.isValidSignature=e.isSNSName=e.isENSName=e.getChainDisplayName=e.getAddressType=e.formatWalletAddress=e.AddressType=e.validateArray=e.parseJson=e.optional=e.isValidDate=e.isUrl=e.isSuccessResponse=e.isString=e.isObject=e.isNumber=e.isNullish=e.isErrorResponse=e.isEmail=e.isBoolean=e.isArray=e.isApiResponse=e.hasRequiredProperties=e.createValidator=e.createAssertion=e.Web3UsernameValidator=e.hasPermission=e.getPermissionsForRole=e.MEMBER_PERMISSIONS=e.MANAGER_PERMISSIONS=e.OWNER_PERMISSIONS=e.InvitationStatus=void 0,e.LogLevel=e.STATUS_VALUES=e.Z_INDEX=e.ANIMATION=e.NETWORK_IDS=e.WALLET_NAMES=e.CONTACT_INFO=e.ROUTES=e.SUCCESS_MESSAGES=e.ERROR_MESSAGES=e.TIME_FORMAT=e.SUBSCRIPTION_TIERS=e.EMAIL_CONFIG=e.STORAGE_KEYS=e.CHAIN_TYPE=e.AUTH_STATUS=e.API_RETRY_DELAY=e.API_RETRY_ATTEMPTS=e.API_TIMEOUT=e.truncate=e.toTitleCase=e.toSnakeCase=e.toKebabCase=e.toCamelCase=e.stripHtml=e.randomString=e.pluralize=e.normalizeWhitespace=e.isNotBlank=e.isBlank=e.getInitials=e.formatNumber=e.formatBytes=e.escapeHtml=e.capitalize=e.parseDate=e.isDateInRange=e.formatTimestamp=e.formatRelativeTime=e.formatEmailDate=e.addHours=e.addDays=e.parseUSDC=e.formatUSDC=e.USDC_DECIMALS=e.CLAIM_PERIOD_DAYS=e.createAdminChecker=e.isAdminEmail=e.parseAdminEmails=e.isValidNonce=void 0,e.debounceAsync=e.clearExpiredCache=e.withCache=e.withTimeout=e.safeParallel=e.withLoadingState=e.safeAsync=e.parseSearchParams=e.searchParamsToString=e.createSearchParams=e.createURLSearchParams=e.storageLogger=e.ensLogger=e.contractLogger=e.apiLogger=e.authLogger=e.logger=void 0;var r=Ee();Object.defineProperty(e,"AuthStatus",{enumerable:!0,get:function(){return r.AuthStatus}}),Object.defineProperty(e,"Chain",{enumerable:!0,get:function(){return r.Chain}}),Object.defineProperty(e,"ChainType",{enumerable:!0,get:function(){return r.ChainType}}),Object.defineProperty(e,"ConnectionState",{enumerable:!0,get:function(){return r.ConnectionState}}),Object.defineProperty(e,"ConnectionType",{enumerable:!0,get:function(){return r.ConnectionType}}),Object.defineProperty(e,"Currency",{enumerable:!0,get:function(){return r.Currency}}),Object.defineProperty(e,"EmailAction",{enumerable:!0,get:function(){return r.EmailAction}}),Object.defineProperty(e,"EmailAddressType",{enumerable:!0,get:function(){return r.EmailAddressType}}),Object.defineProperty(e,"EmailComposeType",{enumerable:!0,get:function(){return r.EmailComposeType}}),Object.defineProperty(e,"EmailSortCriteria",{enumerable:!0,get:function(){return r.EmailSortCriteria}}),Object.defineProperty(e,"EmailValidationState",{enumerable:!0,get:function(){return r.EmailValidationState}}),Object.defineProperty(e,"ErrorType",{enumerable:!0,get:function(){return r.ErrorType}}),Object.defineProperty(e,"FeatureFlag",{enumerable:!0,get:function(){return r.FeatureFlag}}),Object.defineProperty(e,"FontSize",{enumerable:!0,get:function(){return r.FontSize}}),Object.defineProperty(e,"InfoType",{enumerable:!0,get:function(){return r.InfoType}}),Object.defineProperty(e,"MediumView",{enumerable:!0,get:function(){return r.MediumView}}),Object.defineProperty(e,"MobileView",{enumerable:!0,get:function(){return r.MobileView}}),Object.defineProperty(e,"NotificationType",{enumerable:!0,get:function(){return r.NotificationType}}),Object.defineProperty(e,"PlatformType",{enumerable:!0,get:function(){return r.PlatformType}}),Object.defineProperty(e,"RequestStatus",{enumerable:!0,get:function(){return r.RequestStatus}}),Object.defineProperty(e,"SortOrder",{enumerable:!0,get:function(){return r.SortOrder}}),Object.defineProperty(e,"SubscriptionAction",{enumerable:!0,get:function(){return r.SubscriptionAction}}),Object.defineProperty(e,"Theme",{enumerable:!0,get:function(){return r.Theme}});var a=Uo();Object.defineProperty(e,"getWalletConnectionState",{enumerable:!0,get:function(){return a.getWalletConnectionState}}),Object.defineProperty(e,"isWalletConnected",{enumerable:!0,get:function(){return a.isWalletConnected}}),Object.defineProperty(e,"isWalletVerified",{enumerable:!0,get:function(){return a.isWalletVerified}});var n=gt();Object.defineProperty(e,"MessageType",{enumerable:!0,get:function(){return n.MessageType}}),Object.defineProperty(e,"PROTOCOL_CONSTANTS",{enumerable:!0,get:function(){return n.PROTOCOL_CONSTANTS}}),Object.defineProperty(e,"TransactionStatus",{enumerable:!0,get:function(){return n.TransactionStatus}}),Object.defineProperty(e,"isEvmAddress",{enumerable:!0,get:function(){return n.isEvmAddress}}),Object.defineProperty(e,"isEvmRecipient",{enumerable:!0,get:function(){return n.isEvmRecipient}}),Object.defineProperty(e,"isSolanaAddress",{enumerable:!0,get:function(){return n.isSolanaAddress}}),Object.defineProperty(e,"isSolanaRecipient",{enumerable:!0,get:function(){return n.isSolanaRecipient}});var o=Do();Object.defineProperty(e,"validateAddress",{enumerable:!0,get:function(){return o.validateAddress}}),Object.defineProperty(e,"validateAmount",{enumerable:!0,get:function(){return o.validateAmount}}),Object.defineProperty(e,"validateDomain",{enumerable:!0,get:function(){return o.validateDomain}}),Object.defineProperty(e,"validateMessage",{enumerable:!0,get:function(){return o.validateMessage}});var s=zo();Object.defineProperty(e,"StorageType",{enumerable:!0,get:function(){return s.StorageType}});var l=jo();Object.defineProperty(e,"AnalyticsEvent",{enumerable:!0,get:function(){return l.AnalyticsEvent}}),Object.defineProperty(e,"AnalyticsEventBuilder",{enumerable:!0,get:function(){return l.AnalyticsEventBuilder}});var c=_o();Object.defineProperty(e,"ContractType",{enumerable:!0,get:function(){return c.ContractType}}),Object.defineProperty(e,"ProcessedEventName",{enumerable:!0,get:function(){return c.ProcessedEventName}});var d=Bo();Object.defineProperty(e,"NetworkError",{enumerable:!0,get:function(){return d.NetworkError}});var i=Fo();Object.defineProperty(e,"WalletType",{enumerable:!0,get:function(){return i.WalletType}});var h=Wo();Object.defineProperty(e,"RateLimitPeriodType",{enumerable:!0,get:function(){return h.RateLimitPeriodType}});var u=Vo();Object.defineProperty(e,"PERIOD_RANKS",{enumerable:!0,get:function(){return u.PERIOD_RANKS}}),Object.defineProperty(e,"ALL_PERIODS",{enumerable:!0,get:function(){return u.ALL_PERIODS}});var y=$o();Object.defineProperty(e,"NONE_ENTITLEMENT",{enumerable:!0,get:function(){return y.NONE_ENTITLEMENT}});var m=Ct();Object.defineProperty(e,"EntityType",{enumerable:!0,get:function(){return m.EntityType}}),Object.defineProperty(e,"EntityRole",{enumerable:!0,get:function(){return m.EntityRole}}),Object.defineProperty(e,"InvitationStatus",{enumerable:!0,get:function(){return m.InvitationStatus}});var b=Ho();Object.defineProperty(e,"OWNER_PERMISSIONS",{enumerable:!0,get:function(){return b.OWNER_PERMISSIONS}}),Object.defineProperty(e,"MANAGER_PERMISSIONS",{enumerable:!0,get:function(){return b.MANAGER_PERMISSIONS}}),Object.defineProperty(e,"MEMBER_PERMISSIONS",{enumerable:!0,get:function(){return b.MEMBER_PERMISSIONS}}),Object.defineProperty(e,"getPermissionsForRole",{enumerable:!0,get:function(){return b.getPermissionsForRole}}),Object.defineProperty(e,"hasPermission",{enumerable:!0,get:function(){return b.hasPermission}});var v=qo();Object.defineProperty(e,"Web3UsernameValidator",{enumerable:!0,get:function(){return v.Web3UsernameValidator}});var k=Go();Object.defineProperty(e,"createAssertion",{enumerable:!0,get:function(){return k.createAssertion}}),Object.defineProperty(e,"createValidator",{enumerable:!0,get:function(){return k.createValidator}}),Object.defineProperty(e,"hasRequiredProperties",{enumerable:!0,get:function(){return k.hasRequiredProperties}}),Object.defineProperty(e,"isApiResponse",{enumerable:!0,get:function(){return k.isApiResponse}}),Object.defineProperty(e,"isArray",{enumerable:!0,get:function(){return k.isArray}}),Object.defineProperty(e,"isBoolean",{enumerable:!0,get:function(){return k.isBoolean}}),Object.defineProperty(e,"isEmail",{enumerable:!0,get:function(){return k.isEmail}}),Object.defineProperty(e,"isErrorResponse",{enumerable:!0,get:function(){return k.isErrorResponse}}),Object.defineProperty(e,"isNullish",{enumerable:!0,get:function(){return k.isNullish}}),Object.defineProperty(e,"isNumber",{enumerable:!0,get:function(){return k.isNumber}}),Object.defineProperty(e,"isObject",{enumerable:!0,get:function(){return k.isObject}}),Object.defineProperty(e,"isString",{enumerable:!0,get:function(){return k.isString}}),Object.defineProperty(e,"isSuccessResponse",{enumerable:!0,get:function(){return k.isSuccessResponse}}),Object.defineProperty(e,"isUrl",{enumerable:!0,get:function(){return k.isUrl}}),Object.defineProperty(e,"isValidDate",{enumerable:!0,get:function(){return k.isValidDate}}),Object.defineProperty(e,"optional",{enumerable:!0,get:function(){return k.optional}}),Object.defineProperty(e,"parseJson",{enumerable:!0,get:function(){return k.parseJson}}),Object.defineProperty(e,"validateArray",{enumerable:!0,get:function(){return k.validateArray}});var S=ht();Object.defineProperty(e,"AddressType",{enumerable:!0,get:function(){return S.AddressType}}),Object.defineProperty(e,"formatWalletAddress",{enumerable:!0,get:function(){return S.formatWalletAddress}}),Object.defineProperty(e,"getAddressType",{enumerable:!0,get:function(){return S.getAddressType}}),Object.defineProperty(e,"getChainDisplayName",{enumerable:!0,get:function(){return S.getChainDisplayName}}),Object.defineProperty(e,"isENSName",{enumerable:!0,get:function(){return S.isENSName}}),Object.defineProperty(e,"isSNSName",{enumerable:!0,get:function(){return S.isSNSName}}),Object.defineProperty(e,"isValidSignature",{enumerable:!0,get:function(){return S.isValidSignature}}),Object.defineProperty(e,"isValidWalletAddress",{enumerable:!0,get:function(){return S.isValidWalletAddress}}),Object.defineProperty(e,"parseEmailAddress",{enumerable:!0,get:function(){return S.parseEmailAddress}});var w=Yo();Object.defineProperty(e,"createChainStatsId",{enumerable:!0,get:function(){return w.createChainStatsId}}),Object.defineProperty(e,"createDelegationId",{enumerable:!0,get:function(){return w.createDelegationId}}),Object.defineProperty(e,"createMultiChainId",{enumerable:!0,get:function(){return w.createMultiChainId}}),Object.defineProperty(e,"createUserMultiChainId",{enumerable:!0,get:function(){return w.createUserMultiChainId}}),Object.defineProperty(e,"formatBigInt",{enumerable:!0,get:function(){return w.formatBigInt}}),Object.defineProperty(e,"isTestNet",{enumerable:!0,get:function(){return w.isTestNet}}),Object.defineProperty(e,"isZeroAddress",{enumerable:!0,get:function(){return w.isZeroAddress}}),Object.defineProperty(e,"normalizeAddress",{enumerable:!0,get:function(){return w.normalizeAddress}}),Object.defineProperty(e,"validateEventArgs",{enumerable:!0,get:function(){return w.validateEventArgs}});var N=Ko();Object.defineProperty(e,"canAccessProtectedFeatures",{enumerable:!0,get:function(){return N.canAccessProtectedFeatures}}),Object.defineProperty(e,"extractNonceFromMessage",{enumerable:!0,get:function(){return N.extractNonceFromMessage}}),Object.defineProperty(e,"generateAuthMessage",{enumerable:!0,get:function(){return N.generateAuthMessage}}),Object.defineProperty(e,"generateNonce",{enumerable:!0,get:function(){return N.generateNonce}}),Object.defineProperty(e,"getAuthStatusText",{enumerable:!0,get:function(){return N.getAuthStatusText}}),Object.defineProperty(e,"isAuthExpired",{enumerable:!0,get:function(){return N.isAuthExpired}}),Object.defineProperty(e,"isAuthStatusConnected",{enumerable:!0,get:function(){return N.isAuthStatusConnected}}),Object.defineProperty(e,"isValidNonce",{enumerable:!0,get:function(){return N.isValidNonce}});var C=Xo();Object.defineProperty(e,"parseAdminEmails",{enumerable:!0,get:function(){return C.parseAdminEmails}}),Object.defineProperty(e,"isAdminEmail",{enumerable:!0,get:function(){return C.isAdminEmail}}),Object.defineProperty(e,"createAdminChecker",{enumerable:!0,get:function(){return C.createAdminChecker}});var E=Zo();Object.defineProperty(e,"CLAIM_PERIOD_DAYS",{enumerable:!0,get:function(){return E.CLAIM_PERIOD_DAYS}}),Object.defineProperty(e,"USDC_DECIMALS",{enumerable:!0,get:function(){return E.USDC_DECIMALS}}),Object.defineProperty(e,"formatUSDC",{enumerable:!0,get:function(){return E.formatUSDC}}),Object.defineProperty(e,"parseUSDC",{enumerable:!0,get:function(){return E.parseUSDC}});var I=Jo();Object.defineProperty(e,"addDays",{enumerable:!0,get:function(){return I.addDays}}),Object.defineProperty(e,"addHours",{enumerable:!0,get:function(){return I.addHours}}),Object.defineProperty(e,"formatEmailDate",{enumerable:!0,get:function(){return I.formatEmailDate}}),Object.defineProperty(e,"formatRelativeTime",{enumerable:!0,get:function(){return I.formatRelativeTime}}),Object.defineProperty(e,"formatTimestamp",{enumerable:!0,get:function(){return I.formatTimestamp}}),Object.defineProperty(e,"isDateInRange",{enumerable:!0,get:function(){return I.isDateInRange}}),Object.defineProperty(e,"parseDate",{enumerable:!0,get:function(){return I.parseDate}});var x=Qo();Object.defineProperty(e,"capitalize",{enumerable:!0,get:function(){return x.capitalize}}),Object.defineProperty(e,"escapeHtml",{enumerable:!0,get:function(){return x.escapeHtml}}),Object.defineProperty(e,"formatBytes",{enumerable:!0,get:function(){return x.formatBytes}}),Object.defineProperty(e,"formatNumber",{enumerable:!0,get:function(){return x.formatNumber}}),Object.defineProperty(e,"getInitials",{enumerable:!0,get:function(){return x.getInitials}}),Object.defineProperty(e,"isBlank",{enumerable:!0,get:function(){return x.isBlank}}),Object.defineProperty(e,"isNotBlank",{enumerable:!0,get:function(){return x.isNotBlank}}),Object.defineProperty(e,"normalizeWhitespace",{enumerable:!0,get:function(){return x.normalizeWhitespace}}),Object.defineProperty(e,"pluralize",{enumerable:!0,get:function(){return x.pluralize}}),Object.defineProperty(e,"randomString",{enumerable:!0,get:function(){return x.randomString}}),Object.defineProperty(e,"stripHtml",{enumerable:!0,get:function(){return x.stripHtml}}),Object.defineProperty(e,"toCamelCase",{enumerable:!0,get:function(){return x.toCamelCase}}),Object.defineProperty(e,"toKebabCase",{enumerable:!0,get:function(){return x.toKebabCase}}),Object.defineProperty(e,"toSnakeCase",{enumerable:!0,get:function(){return x.toSnakeCase}}),Object.defineProperty(e,"toTitleCase",{enumerable:!0,get:function(){return x.toTitleCase}}),Object.defineProperty(e,"truncate",{enumerable:!0,get:function(){return x.truncate}});var A=Ro();Object.defineProperty(e,"API_TIMEOUT",{enumerable:!0,get:function(){return A.API_TIMEOUT}}),Object.defineProperty(e,"API_RETRY_ATTEMPTS",{enumerable:!0,get:function(){return A.API_RETRY_ATTEMPTS}}),Object.defineProperty(e,"API_RETRY_DELAY",{enumerable:!0,get:function(){return A.API_RETRY_DELAY}}),Object.defineProperty(e,"AUTH_STATUS",{enumerable:!0,get:function(){return A.AUTH_STATUS}}),Object.defineProperty(e,"CHAIN_TYPE",{enumerable:!0,get:function(){return A.CHAIN_TYPE}}),Object.defineProperty(e,"STORAGE_KEYS",{enumerable:!0,get:function(){return A.STORAGE_KEYS}}),Object.defineProperty(e,"EMAIL_CONFIG",{enumerable:!0,get:function(){return A.EMAIL_CONFIG}}),Object.defineProperty(e,"SUBSCRIPTION_TIERS",{enumerable:!0,get:function(){return A.SUBSCRIPTION_TIERS}}),Object.defineProperty(e,"TIME_FORMAT",{enumerable:!0,get:function(){return A.TIME_FORMAT}}),Object.defineProperty(e,"ERROR_MESSAGES",{enumerable:!0,get:function(){return A.ERROR_MESSAGES}}),Object.defineProperty(e,"SUCCESS_MESSAGES",{enumerable:!0,get:function(){return A.SUCCESS_MESSAGES}}),Object.defineProperty(e,"ROUTES",{enumerable:!0,get:function(){return A.ROUTES}}),Object.defineProperty(e,"CONTACT_INFO",{enumerable:!0,get:function(){return A.CONTACT_INFO}}),Object.defineProperty(e,"WALLET_NAMES",{enumerable:!0,get:function(){return A.WALLET_NAMES}}),Object.defineProperty(e,"NETWORK_IDS",{enumerable:!0,get:function(){return A.NETWORK_IDS}}),Object.defineProperty(e,"ANIMATION",{enumerable:!0,get:function(){return A.ANIMATION}}),Object.defineProperty(e,"Z_INDEX",{enumerable:!0,get:function(){return A.Z_INDEX}});var L=es();Object.defineProperty(e,"STATUS_VALUES",{enumerable:!0,get:function(){return L.STATUS_VALUES}});var O=jt();Object.defineProperty(e,"LogLevel",{enumerable:!0,get:function(){return O.LogLevel}}),Object.defineProperty(e,"logger",{enumerable:!0,get:function(){return O.logger}}),Object.defineProperty(e,"authLogger",{enumerable:!0,get:function(){return O.authLogger}}),Object.defineProperty(e,"apiLogger",{enumerable:!0,get:function(){return O.apiLogger}}),Object.defineProperty(e,"contractLogger",{enumerable:!0,get:function(){return O.contractLogger}}),Object.defineProperty(e,"ensLogger",{enumerable:!0,get:function(){return O.ensLogger}}),Object.defineProperty(e,"storageLogger",{enumerable:!0,get:function(){return O.storageLogger}});var M=rs();Object.defineProperty(e,"createURLSearchParams",{enumerable:!0,get:function(){return M.createURLSearchParams}}),Object.defineProperty(e,"createSearchParams",{enumerable:!0,get:function(){return M.createSearchParams}}),Object.defineProperty(e,"searchParamsToString",{enumerable:!0,get:function(){return M.searchParamsToString}}),Object.defineProperty(e,"parseSearchParams",{enumerable:!0,get:function(){return M.parseSearchParams}});var U=ts();Object.defineProperty(e,"safeAsync",{enumerable:!0,get:function(){return U.safeAsync}}),Object.defineProperty(e,"withLoadingState",{enumerable:!0,get:function(){return U.withLoadingState}}),Object.defineProperty(e,"safeParallel",{enumerable:!0,get:function(){return U.safeParallel}}),Object.defineProperty(e,"withTimeout",{enumerable:!0,get:function(){return U.withTimeout}}),Object.defineProperty(e,"withCache",{enumerable:!0,get:function(){return U.withCache}}),Object.defineProperty(e,"clearExpiredCache",{enumerable:!0,get:function(){return U.clearExpiredCache}}),Object.defineProperty(e,"debounceAsync",{enumerable:!0,get:function(){return U.debounceAsync}})})(kr)),kr}var ge=as();const ns=e=>{switch(e){case"verified":case"success":return Ce("success");case"connected":case"warning":return Ce("warning");case"disconnected":case"error":return Ce("error");case"pending":return Ce("info");default:return Ce("neutral")}},os=e=>{switch(e){case"sm":return"w-1.5 h-1.5";case"lg":return"w-3 h-3";default:return"w-2 h-2"}},ss=({status:e,label:r,showDot:a=!0,size:n="md"})=>{const s=r||{verified:"Verified",connected:"Connected",disconnected:"Disconnected",pending:"Pending",error:"Error",success:"Success",warning:"Warning"}[e],c=((h,u)=>{const y={sm:"small",md:"default",lg:"large"},b={verified:"success",success:"success",connected:"warning",warning:"warning",disconnected:"error",error:"error",pending:"primary"}[h]||"default",v=y[u];return v==="default"?j.badge[b]():j.badge[v](b)})(e,n),d=ns(e),i=os(n);return t.jsxs("span",{className:c,children:[a&&t.jsx("span",{className:`inline-block ${i} rounded-full ${d} mr-1`}),s]})},ls=({chainType:e,size:r="md"})=>{if(!e)return null;const a=e===ge.ChainType.SOLANA?"SOL":"ETH",o={sm:"small",md:"default",lg:"large"}[r],s=()=>{const l=e===ge.ChainType.SOLANA?"solana":"ethereum";return o==="default"?j.badge[l]():j.badge[o](l)};return t.jsx("span",{className:s(),children:a})},is={xs:"w-1.5 h-1.5",sm:"w-2 h-2",md:"w-3 h-3",lg:"w-4 h-4"},cs=({status:e,size:r="sm",pulse:a=!1,className:n})=>t.jsx("div",{className:f("rounded-full flex-shrink-0",Ce(e),is[r],a&&"animate-pulse",n)}),ds=({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":"UstatusUpipeline",children:r||"UstatusUpipeline Component"}),Re=G.forwardRef(({className:e,type:r,onTrack:a,trackingLabel:n,componentName:o,onBlur:s,onChange:l,...c},d)=>{const i=u=>{a&&a({action:"blur",trackingLabel:n,componentName:o}),s?.(u)},h=u=>{a&&a({action:"change",trackingLabel:n,componentName:o}),l?.(u)};return t.jsx("input",{type:r,className:f(j.input.default(),e),ref:d,onBlur:i,onChange:h,...c})});Re.displayName="Input";const gs=({value:e,onChange:r,placeholder:a,rows:n=4,disabled:o=!1,readOnly:s=!1,showCount:l=!1,maxLength:c,resize:d="vertical",size:i="md",className:h,textareaProps:u,onTrack:y,trackingLabel:m,componentName:b})=>{const v={sm:"p-2 text-sm",md:"p-3 text-base",lg:"p-4 text-lg"},k={none:"resize-none",vertical:"resize-y",horizontal:"resize-x",both:"resize"},S=E=>{const I=E.target.value;c&&I.length>c||(y&&y({action:"change",trackingLabel:m,componentName:b}),r(I))},w=()=>{y&&y({action:"blur",trackingLabel:m,componentName:b})},N=e.length,C=l||c!==void 0;return t.jsxs("div",{className:f("w-full",h),children:[t.jsx("textarea",{value:e,onChange:S,onBlur:w,placeholder:a,rows:n,disabled:o,readOnly:s,maxLength:c,className:f("w-full rounded-lg border","bg-white dark:bg-gray-800","text-gray-900 dark:text-gray-100","placeholder-gray-400 dark:placeholder-gray-500","border-gray-300 dark:border-gray-600","focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-transparent","transition-colors duration-200",v[i],k[d],o&&"opacity-50 cursor-not-allowed",s&&"bg-gray-50 dark:bg-gray-900 cursor-default"),...u}),C&&t.jsx("div",{className:"flex justify-end mt-1",children:t.jsxs("span",{className:f("text-xs",c&&N>c*.9?"text-yellow-600 dark:text-yellow-400":"text-gray-500 dark:text-gray-400",c&&N>=c&&"text-red-600 dark:text-red-400"),children:[N,c&&` / ${c}`]})})]})},us=({value:e,onChange:r,min:a,max:n,step:o=1,disabled:s=!1,showSteppers:l=!1,stepperPosition:c="right",placeholder:d,size:i="md",className:h,inputProps:u,onTrack:y,trackingLabel:m,componentName:b})=>{const k={sm:{input:"py-1.5 px-3 text-sm",button:"w-6 h-6",icon:"h-3 w-3"},md:{input:"py-2 px-3 text-base",button:"w-8 h-8",icon:"h-4 w-4"},lg:{input:"py-3 px-4 text-lg",button:"w-10 h-10",icon:"h-5 w-5"}}[i],S=L=>({action:L,trackingLabel:m,componentName:b}),w=L=>{const O=parseFloat(L.target.value);if(isNaN(O)){if(L.target.value===""){const M=a??0;y&&y(S("input")),r(M)}}else{const M=N(O);y&&y(S("input")),r(M)}},N=L=>{let O=L;return a!==void 0&&O<a&&(O=a),n!==void 0&&O>n&&(O=n),O},C=()=>{const L=N(e+o);y&&y(S("increment")),r(L)},E=()=>{const L=N(e-o);y&&y(S("decrement")),r(L)},I=n===void 0||e<n,x=a===void 0||e>a,A=({onClick:L,icon:O,disabled:M,ariaLabel:U})=>t.jsx("button",{type:"button",onClick:L,disabled:s||M,"aria-label":U,className:f("inline-flex items-center justify-center","border border-gray-300 dark:border-gray-600","bg-white dark:bg-gray-800","text-gray-700 dark:text-gray-300","hover:bg-gray-50 dark:hover:bg-gray-700","focus:outline-none focus:ring-2 focus:ring-blue-500","transition-colors",k.button,(s||M)&&"opacity-50 cursor-not-allowed"),children:O});return l&&c==="sides"?t.jsxs("div",{className:f("inline-flex items-stretch",h),children:[t.jsx(A,{onClick:E,disabled:!x,icon:t.jsx(P.MinusIcon,{className:k.icon}),ariaLabel:"Decrement"}),t.jsx("input",{type:"number",value:e,onChange:w,min:a,max:n,step:o,disabled:s,placeholder:d,className:f("border-x-0 text-center","border-gray-300 dark:border-gray-600","bg-white dark:bg-gray-800","text-gray-900 dark:text-gray-100","focus:outline-none focus:ring-2 focus:ring-blue-500 focus:z-10","transition-colors",k.input,s&&"opacity-50 cursor-not-allowed","[appearance:textfield]","[&::-webkit-outer-spin-button]:appearance-none","[&::-webkit-inner-spin-button]:appearance-none"),...u}),t.jsx(A,{onClick:C,disabled:!I,icon:t.jsx(P.PlusIcon,{className:k.icon}),ariaLabel:"Increment"})]}):l&&c==="right"?t.jsxs("div",{className:f("inline-flex items-stretch gap-2",h),children:[t.jsx("input",{type:"number",value:e,onChange:w,min:a,max:n,step:o,disabled:s,placeholder:d,className:f("rounded-lg border","border-gray-300 dark:border-gray-600","bg-white dark:bg-gray-800","text-gray-900 dark:text-gray-100","placeholder-gray-400 dark:placeholder-gray-500","focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-transparent","transition-colors",k.input,s&&"opacity-50 cursor-not-allowed","[appearance:textfield]","[&::-webkit-outer-spin-button]:appearance-none","[&::-webkit-inner-spin-button]:appearance-none"),...u}),t.jsxs("div",{className:"inline-flex flex-col gap-0.5",children:[t.jsx("button",{type:"button",onClick:C,disabled:s||!I,"aria-label":"Increment",className:f("inline-flex items-center justify-center","rounded border border-gray-300 dark:border-gray-600","bg-white dark:bg-gray-800","text-gray-700 dark:text-gray-300","hover:bg-gray-50 dark:hover:bg-gray-700","focus:outline-none focus:ring-2 focus:ring-blue-500","transition-colors","flex-1",k.button.replace(/h-\d+/,"h-auto"),(s||!I)&&"opacity-50 cursor-not-allowed"),children:t.jsx(P.PlusIcon,{className:f(k.icon,"w-3 h-3")})}),t.jsx("button",{type:"button",onClick:E,disabled:s||!x,"aria-label":"Decrement",className:f("inline-flex items-center justify-center","rounded border border-gray-300 dark:border-gray-600","bg-white dark:bg-gray-800","text-gray-700 dark:text-gray-300","hover:bg-gray-50 dark:hover:bg-gray-700","focus:outline-none focus:ring-2 focus:ring-blue-500","transition-colors","flex-1",k.button.replace(/h-\d+/,"h-auto"),(s||!x)&&"opacity-50 cursor-not-allowed"),children:t.jsx(P.MinusIcon,{className:f(k.icon,"w-3 h-3")})})]})]}):t.jsx("input",{type:"number",value:e,onChange:w,min:a,max:n,step:o,disabled:s,placeholder:d,className:f("rounded-lg border","border-gray-300 dark:border-gray-600","bg-white dark:bg-gray-800","text-gray-900 dark:text-gray-100","placeholder-gray-400 dark:placeholder-gray-500","focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-transparent","transition-colors",k.input,s&&"opacity-50 cursor-not-allowed",h),...u})},hs=({value:e,onChange:r,placeholder:a="Search...",autoFocus:n=!1,disabled:o=!1,size:s="md",showIcon:l=!0,showClear:c=!0,loading:d=!1,className:i,inputProps:h,onTrack:u,trackingLabel:y,componentName:m})=>{const[b,v]=p.useState(""),k=e!==void 0?e:b,S=e!==void 0,N={sm:{input:"py-1.5 text-sm",icon:"h-4 w-4",padding:l?"pl-8 pr-8":"px-3",iconLeft:"left-0 pl-2.5",iconRight:"right-0 pr-2.5"},md:{input:"py-2 text-base",icon:"h-5 w-5",padding:l?"pl-10 pr-10":"px-3",iconLeft:"left-0 pl-3",iconRight:"right-0 pr-3"},lg:{input:"py-3 text-lg",icon:"h-6 w-6",padding:l?"pl-12 pr-12":"px-4",iconLeft:"left-0 pl-3.5",iconRight:"right-0 pr-3.5"}}[s],C=p.useCallback(x=>{const A=x.target.value;S||v(A),r?.(A)},[r,S]),E=p.useCallback(()=>{u&&u({action:"search",trackingLabel:y,componentName:m})},[u,y,m]),I=p.useCallback(()=>{S||v(""),u&&u({action:"clear",trackingLabel:y,componentName:m}),r?.("")},[r,S,u,y,m]);return t.jsxs("div",{className:f("relative w-full",i),children:[l&&t.jsx("div",{className:f("absolute inset-y-0 flex items-center pointer-events-none",N.iconLeft),children:t.jsx(P.MagnifyingGlassIcon,{className:f(N.icon,"text-gray-400 dark:text-gray-500")})}),t.jsx("input",{type:"text",value:k,onChange:C,onBlur:E,placeholder:a,autoFocus:n,disabled:o||d,className:f("block w-full rounded-lg border","bg-white dark:bg-gray-800","text-gray-900 dark:text-gray-100","placeholder-gray-400 dark:placeholder-gray-500","border-gray-300 dark:border-gray-600","focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-transparent","transition-colors duration-200",N.input,N.padding,o&&"opacity-50 cursor-not-allowed",d&&"opacity-60"),...h}),c&&k&&!d&&t.jsx("button",{type:"button",onClick:I,disabled:o,className:f("absolute inset-y-0 flex items-center","text-gray-400 hover:text-gray-600 dark:hover:text-gray-300","transition-colors",o?"cursor-not-allowed":"cursor-pointer",N.iconRight),"aria-label":"Clear search",children:t.jsx(P.XMarkIcon,{className:N.icon})}),d&&t.jsx("div",{className:f("absolute inset-y-0 flex items-center",N.iconRight),children:t.jsxs("svg",{className:f(N.icon,"animate-spin text-gray-400"),xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",children:[t.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),t.jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})]})})]})},fs=({value:e,onChange:r,type:a="date",min:n,max:o,disabled:s=!1,showIcon:l=!1,placeholder:c,size:d="md",className:i,inputProps:h})=>{const y={sm:{input:"py-1.5 text-sm",icon:"h-4 w-4",padding:l?"pl-8 pr-3":"px-3",iconLeft:"left-0 pl-2.5"},md:{input:"py-2 text-base",icon:"h-5 w-5",padding:l?"pl-10 pr-4":"px-4",iconLeft:"left-0 pl-3"},lg:{input:"py-3 text-lg",icon:"h-6 w-6",padding:l?"pl-12 pr-4":"px-4",iconLeft:"left-0 pl-3.5"}}[d],m=e instanceof Date?bs(e,a):e,b=v=>{r(v.target.value)};return t.jsxs("div",{className:f("relative",i),children:[l&&t.jsx("div",{className:f("absolute inset-y-0 flex items-center pointer-events-none",y.iconLeft),children:t.jsx(P.CalendarIcon,{className:f(y.icon,"text-gray-400 dark:text-gray-500")})}),t.jsx("input",{type:a,value:m,onChange:b,min:n,max:o,disabled:s,placeholder:c,className:f("block w-full rounded-lg border","bg-white dark:bg-gray-800","text-gray-900 dark:text-gray-100","placeholder-gray-400 dark:placeholder-gray-500","border-gray-300 dark:border-gray-600","focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-transparent","transition-colors duration-200",y.input,y.padding,s&&"opacity-50 cursor-not-allowed","appearance-none","[&::-webkit-calendar-picker-indicator]:opacity-100","[&::-webkit-calendar-picker-indicator]:cursor-pointer"),...h})]})};function bs(e,r){const a=d=>String(d).padStart(2,"0"),n=e.getFullYear(),o=a(e.getMonth()+1),s=a(e.getDate()),l=a(e.getHours()),c=a(e.getMinutes());switch(r){case"date":return`${n}-${o}-${s}`;case"time":return`${l}:${c}`;case"datetime-local":return`${n}-${o}-${s}T${l}:${c}`;case"month":return`${n}-${o}`;case"week":{const d=new Date(n,0,1),i=Math.floor((e.getTime()-d.getTime())/(1440*60*1e3)),h=Math.ceil((i+d.getDay()+1)/7);return`${n}-W${a(h)}`}default:return`${n}-${o}-${s}`}}const Wt=({value:e,onChange:r,use12Hour:a=!1,minuteStep:n=1,disabled:o=!1,className:s})=>{const[l,c]=p.useState(!1),[d,i]=p.useState("12"),[h,u]=p.useState("00"),[y,m]=p.useState("AM"),b=p.useRef(null);p.useEffect(()=>{if(e){const[N,C]=e.split(":"),E=parseInt(N,10);if(a){const I=E>=12,x=E===0?12:E>12?E-12:E;i(x.toString().padStart(2,"0")),m(I?"PM":"AM")}else i(N);u(C)}},[e,a]),p.useEffect(()=>{const N=C=>{b.current&&!b.current.contains(C.target)&&c(!1)};return document.addEventListener("mousedown",N),()=>document.removeEventListener("mousedown",N)},[]);const v=()=>{if(!e)return"";const[N,C]=e.split(":"),E=parseInt(N,10);if(a){const I=E===0?12:E>12?E-12:E,x=E>=12?"PM":"AM";return`${I}:${C} ${x}`}return`${N}:${C}`},k=(N,C,E)=>{let I=parseInt(N,10);const x=parseInt(C,10);a&&E&&(E==="PM"&&I!==12?I+=12:E==="AM"&&I===12&&(I=0));const A=`${I.toString().padStart(2,"0")}:${x.toString().padStart(2,"0")}`;r(A)},S=a?Array.from({length:12},(N,C)=>(C+1).toString().padStart(2,"0")):Array.from({length:24},(N,C)=>C.toString().padStart(2,"0")),w=Array.from({length:Math.ceil(60/n)},(N,C)=>(C*n).toString().padStart(2,"0"));return t.jsxs("div",{ref:b,className:f("relative w-full",s),children:[t.jsxs("button",{type:"button",onClick:()=>!o&&c(!l),disabled:o,className:f("w-full px-3 py-2 text-sm text-left flex items-center justify-between","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",l&&"ring-2 ring-blue-500 dark:ring-blue-400"),children:[t.jsx("span",{className:f(e?"text-gray-900 dark:text-white":"text-gray-500 dark:text-gray-400"),children:e?v():"Select time"}),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 8v4l3 3m6-3a9 9 0 11-18 0 9 9 0 0118 0z"})})]}),l&&t.jsx("div",{className:"absolute top-full left-0 mt-1 bg-white dark:bg-gray-900 border border-gray-300 dark:border-gray-700 rounded-md shadow-lg z-50",children:t.jsxs("div",{className:"flex gap-1 p-2",children:[t.jsxs("div",{className:"flex flex-col",children:[t.jsx("div",{className:"text-xs font-medium text-gray-700 dark:text-gray-300 text-center mb-1 px-2",children:"Hour"}),t.jsx("div",{className:"h-48 overflow-y-auto w-16 border border-gray-200 dark:border-gray-700 rounded",children:S.map(N=>t.jsx("button",{onClick:()=>{i(N),k(N,h,a?y:void 0)},className:f("w-full px-3 py-1.5 text-sm text-center","hover:bg-gray-100 dark:hover:bg-gray-800","transition-colors",N===d&&"bg-blue-100 dark:bg-blue-900/30 text-blue-700 dark:text-blue-300 font-medium"),children:N},N))})]}),t.jsxs("div",{className:"flex flex-col",children:[t.jsx("div",{className:"text-xs font-medium text-gray-700 dark:text-gray-300 text-center mb-1 px-2",children:"Min"}),t.jsx("div",{className:"h-48 overflow-y-auto w-16 border border-gray-200 dark:border-gray-700 rounded",children:w.map(N=>t.jsx("button",{onClick:()=>{u(N),k(d,N,a?y:void 0)},className:f("w-full px-3 py-1.5 text-sm text-center","hover:bg-gray-100 dark:hover:bg-gray-800","transition-colors",N===h&&"bg-blue-100 dark:bg-blue-900/30 text-blue-700 dark:text-blue-300 font-medium"),children:N},N))})]}),a&&t.jsxs("div",{className:"flex flex-col",children:[t.jsx("div",{className:"text-xs font-medium text-gray-700 dark:text-gray-300 text-center mb-1 px-2",children:" "}),t.jsxs("div",{className:"h-48 flex flex-col justify-center gap-2 w-16",children:[t.jsx("button",{onClick:()=>{m("AM"),k(d,h,"AM")},className:f("px-3 py-2 text-sm text-center rounded","hover:bg-gray-100 dark:hover:bg-gray-800","transition-colors",y==="AM"&&"bg-blue-100 dark:bg-blue-900/30 text-blue-700 dark:text-blue-300 font-medium"),children:"AM"}),t.jsx("button",{onClick:()=>{m("PM"),k(d,h,"PM")},className:f("px-3 py-2 text-sm text-center rounded","hover:bg-gray-100 dark:hover:bg-gray-800","transition-colors",y==="PM"&&"bg-blue-100 dark:bg-blue-900/30 text-blue-700 dark:text-blue-300 font-medium"),children:"PM"})]})]})]})})]})},ms=[{code:"US",name:"United States",dialCode:"+1",flag:"🇺🇸"},{code:"GB",name:"United Kingdom",dialCode:"+44",flag:"🇬🇧"},{code:"CA",name:"Canada",dialCode:"+1",flag:"🇨🇦"},{code:"AU",name:"Australia",dialCode:"+61",flag:"🇦🇺"},{code:"DE",name:"Germany",dialCode:"+49",flag:"🇩🇪"},{code:"FR",name:"France",dialCode:"+33",flag:"🇫🇷"},{code:"IT",name:"Italy",dialCode:"+39",flag:"🇮🇹"},{code:"ES",name:"Spain",dialCode:"+34",flag:"🇪🇸"},{code:"MX",name:"Mexico",dialCode:"+52",flag:"🇲🇽"},{code:"BR",name:"Brazil",dialCode:"+55",flag:"🇧🇷"},{code:"IN",name:"India",dialCode:"+91",flag:"🇮🇳"},{code:"CN",name:"China",dialCode:"+86",flag:"🇨🇳"},{code:"JP",name:"Japan",dialCode:"+81",flag:"🇯🇵"},{code:"KR",name:"South Korea",dialCode:"+82",flag:"🇰🇷"},{code:"SG",name:"Singapore",dialCode:"+65",flag:"🇸🇬"}],ys=({value:e,onChange:r,country:a,onCountryChange:n,countries:o=ms,placeholder:s="Phone number",disabled:l=!1,className:c})=>{const[d,i]=p.useState(o[0]?.code||"US"),[h,u]=p.useState(!1),[y,m]=p.useState(""),b=a!==void 0?a:d,v=o.find(C=>C.code===b),k=C=>{a!==void 0&&n?n(C):i(C),u(!1),m("")},S=C=>{const E=C.replace(/\D/g,"");return v?.dialCode==="+1"?E.length<=3?E:E.length<=6?`(${E.slice(0,3)}) ${E.slice(3)}`:`(${E.slice(0,3)}) ${E.slice(3,6)}-${E.slice(6,10)}`:E},w=C=>{const E=S(C.target.value);r(E)},N=o.filter(C=>C.name.toLowerCase().includes(y.toLowerCase())||C.dialCode.includes(y)||C.code.toLowerCase().includes(y.toLowerCase()));return t.jsxs("div",{className:f("relative w-full",c),children:[t.jsxs("div",{className:"flex gap-2",children:[t.jsxs("div",{className:"relative",children:[t.jsxs("button",{type:"button",onClick:()=>!l&&u(!h),disabled:l,className:f("flex items-center gap-2 px-3 py-2 min-w-[120px]","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",h&&"ring-2 ring-blue-500 dark:ring-blue-400"),children:[t.jsx("span",{className:"text-xl",children:v?.flag}),t.jsx("span",{className:"text-sm font-medium text-gray-900 dark:text-white",children:v?.dialCode}),t.jsx("svg",{className:f("w-4 h-4 text-gray-600 dark:text-gray-400 transition-transform",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"})})]}),h&&t.jsxs("div",{className:"absolute top-full left-0 mt-1 w-72 bg-white dark:bg-gray-900 border border-gray-300 dark:border-gray-700 rounded-md shadow-lg z-50",children:[t.jsx("div",{className:"p-2 border-b border-gray-200 dark:border-gray-700",children:t.jsx("input",{type:"text",value:y,onChange:C=>m(C.target.value),placeholder:"Search countries...",className:"w-full px-3 py-2 text-sm bg-gray-50 dark:bg-gray-800 border-none rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500 dark:focus:ring-blue-400",onClick:C=>C.stopPropagation()})}),t.jsx("div",{className:"max-h-60 overflow-y-auto py-1",children:N.length===0?t.jsx("div",{className:"px-3 py-2 text-sm text-gray-500 dark:text-gray-400 text-center",children:"No countries found"}):N.map(C=>t.jsxs("button",{onClick:()=>k(C.code),className:f("w-full px-3 py-2 text-left flex items-center gap-3","hover:bg-gray-100 dark:hover:bg-gray-800","transition-colors",C.code===b&&"bg-blue-50 dark:bg-blue-900/30"),children:[t.jsx("span",{className:"text-xl",children:C.flag}),t.jsx("span",{className:"flex-1 text-sm text-gray-900 dark:text-white",children:C.name}),t.jsx("span",{className:"text-sm text-gray-600 dark:text-gray-400",children:C.dialCode})]},C.code))})]})]}),t.jsx("input",{type:"tel",value:e,onChange:w,placeholder:s,disabled:l,className:f("flex-1 px-3 py-2 text-sm","bg-white dark:bg-gray-900","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","disabled:opacity-50 disabled:cursor-not-allowed")})]}),e&&v&&t.jsxs("p",{className:"mt-1.5 text-xs text-gray-600 dark:text-gray-400",children:["Full number: ",v.dialCode," ",e]}),h&&t.jsx("div",{className:"fixed inset-0 z-40",onClick:()=>u(!1)})]})},ps=({checked:e,defaultChecked:r=!1,onChange:a,label:n,description:o,disabled:s=!1,size:l="md",variant:c="primary",color:d,className:i,id:h,name:u,value:y,required:m=!1,indeterminate:b=!1,error:v=!1,errorMessage:k,icon:S,onTrack:w,trackingLabel:N,componentName:C})=>{const[E,I]=p.useState(r),x=e!==void 0,A=x?e:E,L={sm:{box:"w-4 h-4",check:"w-3 h-3",text:"text-sm",desc:"text-xs"},md:{box:"w-5 h-5",check:"w-4 h-4",text:"text-base",desc:"text-sm"},lg:{box:"w-6 h-6",check:"w-5 h-5",text:"text-lg",desc:"text-base"}},M=d?{blue:"primary",green:"success",yellow:"warning",red:"error"}[d]:c,U=()=>v?A?"bg-red-600 border-red-600":"border-red-600 dark:border-red-500":{primary:A?"bg-blue-600 border-blue-600":"border-gray-300 dark:border-gray-600",success:A?"bg-green-600 border-green-600":"border-gray-300 dark:border-gray-600",warning:A?"bg-yellow-600 border-yellow-600":"border-gray-300 dark:border-gray-600",error:A?"bg-red-600 border-red-600":"border-gray-300 dark:border-gray-600"}[M],B=V=>{if(s)return;const R=V.target.checked;x||I(R),w&&w({action:"toggle",trackingLabel:N,componentName:C}),a?.(R)},z=V=>{if(!s&&(V.key===" "||V.key==="Spacebar")){V.preventDefault();const R=!A;x||I(R),w&&w({action:"toggle",trackingLabel:N,componentName:C}),a?.(R)}},F=L[l];return t.jsxs("div",{className:f("inline-flex flex-col",i),children:[t.jsxs("label",{className:f("inline-flex items-start gap-2 cursor-pointer",s&&"opacity-50 cursor-not-allowed"),children:[t.jsxs("div",{className:"relative flex items-center",children:[t.jsx("input",{type:"checkbox",checked:A,defaultChecked:x?void 0:r,onChange:B,onKeyDown:z,disabled:s,id:h,name:u,value:y,required:m,className:"sr-only peer"}),t.jsx("div",{"data-indeterminate":b?"true":void 0,className:f("rounded border-2 flex items-center justify-center transition-colors bg-white dark:bg-gray-900",F.box,U(),!s&&"hover:border-opacity-75"),children:b?t.jsx(he.MinusIcon,{className:f("text-white",F.check)}):A?S||t.jsx(he.CheckIcon,{className:f("text-white",F.check)}):null})]}),(n||o)&&t.jsxs("div",{className:"flex flex-col",children:[n&&t.jsx("span",{className:f("text-gray-900 dark:text-white",F.text),children:n}),o&&t.jsx("span",{className:f("text-gray-600 dark:text-gray-400",F.desc),children:o})]})]}),k&&t.jsx("span",{className:"mt-1 text-sm text-red-600 dark:text-red-400",children:k})]})},Vt=G.forwardRef(({className:e,onTrack:r,trackingLabel:a,componentName:n,onCheckedChange:o,...s},l)=>{const c=d=>{r&&r({action:"toggle",trackingLabel:a,componentName:n}),o?.(d)};return t.jsx(mr.Root,{className:f("peer inline-flex h-6 w-11 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-blue-500 focus-visible:ring-offset-2 focus-visible:ring-offset-white disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-blue-600 data-[state=unchecked]:bg-gray-200 dark:focus-visible:ring-blue-400 dark:focus-visible:ring-offset-gray-950 dark:data-[state=checked]:bg-blue-500 dark:data-[state=unchecked]:bg-gray-700",e),onCheckedChange:c,...s,ref:l,children:t.jsx(mr.Thumb,{className:f("pointer-events-none block h-5 w-5 rounded-full bg-white shadow-lg ring-0 transition-transform data-[state=checked]:translate-x-5 data-[state=unchecked]:translate-x-0")})})});Vt.displayName=mr.Root.displayName;const vs=({name:e="radio-group",value:r,onChange:a,options:n,label:o,orientation:s="vertical",disabled:l=!1,error:c=!1,errorMessage:d,required:i=!1,size:h="md",renderOption:u,className:y})=>{const m=p.useRef(null),v={sm:{radio:"w-4 h-4",label:"text-sm",description:"text-xs"},md:{radio:"w-5 h-5",label:"text-base",description:"text-sm"},lg:{radio:"w-6 h-6",label:"text-lg",description:"text-base"}}[h],k=(w,N)=>{!l&&!N&&a(w)},S=(w,N)=>{const C=n.filter(I=>!I.disabled&&!l),E=C.findIndex(I=>I.value===n[N].value);if(w.key==="ArrowDown"||w.key==="ArrowRight"){w.preventDefault();const I=(E+1)%C.length;a(C[I].value)}else if(w.key==="ArrowUp"||w.key==="ArrowLeft"){w.preventDefault();const I=(E-1+C.length)%C.length;a(C[I].value)}};return t.jsxs("div",{className:f("w-full",y),children:[o&&t.jsx("div",{className:"mb-2",children:t.jsxs("span",{className:"text-sm font-medium text-gray-700 dark:text-gray-300",children:[o,i&&t.jsx("span",{className:"text-red-600 ml-1",children:"*"})]})}),t.jsx("div",{ref:m,className:f(s==="horizontal"?"flex flex-row gap-4":"flex flex-col space-y-2"),role:"radiogroup",children:n.map((w,N)=>{const C=l||w.disabled,E=r===w.value;return t.jsxs("label",{className:f("flex items-start cursor-pointer",C&&"opacity-50 cursor-not-allowed",c&&"border-red-600 dark:border-red-500"),children:[t.jsx("input",{type:"radio",name:e,value:w.value,checked:E,onChange:()=>k(w.value,!!w.disabled),onKeyDown:I=>S(I,N),disabled:C,className:f("mt-0.5 mr-2",v.radio,"text-blue-600 bg-white dark:bg-gray-900","border-gray-300 dark:border-gray-600","focus:ring-blue-500 focus:ring-2","transition-colors",c&&"border-red-600 dark:border-red-500",C&&"cursor-not-allowed")}),t.jsx("div",{className:"flex-1 min-w-0",children:u?u(w):t.jsxs(t.Fragment,{children:[t.jsx("span",{className:f("font-medium text-gray-700 dark:text-gray-300",v.label),children:w.label}),w.description&&t.jsx("p",{className:f("text-gray-500 dark:text-gray-400 mt-0.5",v.description),children:w.description})]})})]},w.value)})}),d&&t.jsx("p",{className:"mt-1 text-sm text-red-600 dark:text-red-400",children:d})]})},Er=({onTrack:e,trackingLabel:r,componentName:a,onValueChange:n,children:o,...s})=>{const l=c=>{e&&e({action:"change",trackingLabel:r,componentName:a}),n?.(c)};return t.jsx($.Root,{onValueChange:l,...s,children:o})},ks=$.Group,$t=$.Value,er=G.forwardRef(({className:e,children:r,...a},n)=>t.jsxs($.Trigger,{ref:n,className:f("flex h-9 w-full items-center justify-between rounded-md border border-gray-300 dark:border-gray-600 bg-white dark:bg-gray-800 px-3 py-2 text-sm text-gray-900 dark:text-gray-100 hover:bg-gray-50 dark:hover:bg-gray-700 focus:outline-none focus:ring-2 focus:ring-blue-500 focus:ring-offset-2 dark:ring-offset-gray-950 transition-colors disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1",e),...a,children:[r,t.jsx($.Icon,{asChild:!0,children:t.jsx(Oe.ChevronDownIcon,{className:"h-4 w-4 opacity-50 ml-2 flex-shrink-0"})})]}));er.displayName=$.Trigger.displayName;const Ar=G.forwardRef(({className:e,...r},a)=>t.jsx($.ScrollUpButton,{ref:a,className:f("flex cursor-default items-center justify-center py-1",e),...r,children:t.jsx(Oe.ChevronUpIcon,{className:"h-4 w-4"})}));Ar.displayName=$.ScrollUpButton.displayName;const Tr=G.forwardRef(({className:e,...r},a)=>t.jsx($.ScrollDownButton,{ref:a,className:f("flex cursor-default items-center justify-center py-1",e),...r,children:t.jsx(Oe.ChevronDownIcon,{className:"h-4 w-4"})}));Tr.displayName=$.ScrollDownButton.displayName;const rr=G.forwardRef(({className:e,children:r,position:a="popper",...n},o)=>t.jsx($.Portal,{children:t.jsxs($.Content,{ref:o,className:f(j.overlays.dropdown.menu(),"z-[1000000] max-h-96 overflow-hidden data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",a==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1 w-[var(--radix-select-trigger-width)]",e),position:a,...n,children:[t.jsx(Ar,{}),t.jsx($.Viewport,{className:f(j.overlays.dropdown.itemContainer(),a==="popper"&&"h-[var(--radix-select-trigger-height)] w-full"),children:r}),t.jsx(Tr,{})]})}));rr.displayName=$.Content.displayName;const Ht=G.forwardRef(({className:e,...r},a)=>t.jsx($.Label,{ref:a,className:f(j.overlays.dropdown.header(),"py-1.5",e),...r}));Ht.displayName=$.Label.displayName;const tr=G.forwardRef(({className:e,children:r,...a},n)=>t.jsxs($.Item,{ref:n,className:f(j.overlays.dropdown.item(),"relative select-none justify-between pr-8 data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...a,children:[t.jsx($.ItemText,{children:r}),t.jsx("span",{className:"absolute right-2 flex h-3.5 w-3.5 items-center justify-center",children:t.jsx($.ItemIndicator,{children:t.jsx(Oe.CheckIcon,{className:"h-4 w-4"})})})]}));tr.displayName=$.Item.displayName;const qt=G.forwardRef(({className:e,...r},a)=>t.jsx($.Separator,{ref:a,className:f("my-1 h-px bg-gray-200 dark:bg-gray-700",e),...r}));qt.displayName=$.Separator.displayName;const ws=({options:e,value:r,onChange:a,placeholder:n="Select items...",searchPlaceholder:o="Search...",searchable:s=!0,maxDisplay:l=3,disabled:c=!1,className:d})=>{const[i,h]=p.useState(!1),[u,y]=p.useState(""),m=p.useRef(null),b=s?e.filter(C=>C.label.toLowerCase().includes(u.toLowerCase())):e,v=e.filter(C=>r.includes(C.value)),k=C=>{r.includes(C)?a(r.filter(E=>E!==C)):a([...r,C])},S=C=>{a(r.filter(E=>E!==C))};p.useEffect(()=>{const C=E=>{m.current&&!m.current.contains(E.target)&&(h(!1),y(""))};return document.addEventListener("mousedown",C),()=>document.removeEventListener("mousedown",C)},[]);const w=v.length,N=w>l?w-l:0;return t.jsxs("div",{ref:m,className:f("relative w-full",d),children:[t.jsx("button",{type:"button",onClick:()=>!c&&h(!i),disabled:c,className:f("w-full min-h-[42px] px-3 py-2 text-sm text-left","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",i&&"ring-2 ring-blue-500 dark:ring-blue-400"),children:t.jsx("div",{className:"flex flex-wrap gap-1.5",children:v.length===0?t.jsx("span",{className:"text-gray-500 dark:text-gray-400",children:n}):t.jsxs(t.Fragment,{children:[v.slice(0,l).map(C=>t.jsxs("span",{className:"inline-flex items-center gap-1 px-2 py-0.5 bg-blue-100 dark:bg-blue-900/30 text-blue-700 dark:text-blue-300 rounded text-xs font-medium",children:[C.label,t.jsx("button",{onClick:E=>{E.stopPropagation(),S(C.value)},className:"hover:text-blue-900 dark:hover:text-blue-100",children:t.jsx("svg",{className:"w-3 h-3",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"})})})]},C.value)),N>0&&t.jsxs("span",{className:"inline-flex items-center px-2 py-0.5 bg-gray-200 dark:bg-gray-700 text-gray-700 dark:text-gray-300 rounded text-xs font-medium",children:["+",N," more"]})]})})}),i&&t.jsxs("div",{className:"absolute z-50 w-full mt-1 bg-white dark:bg-gray-900 border border-gray-300 dark:border-gray-700 rounded-md shadow-lg",children:[s&&t.jsx("div",{className:"p-2 border-b border-gray-200 dark:border-gray-700",children:t.jsx("input",{type:"text",value:u,onChange:C=>y(C.target.value),placeholder:o,className:"w-full px-3 py-2 text-sm bg-gray-50 dark:bg-gray-800 border-none rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500 dark:focus:ring-blue-400",onClick:C=>C.stopPropagation()})}),t.jsx("div",{className:"max-h-60 overflow-y-auto py-1",children:b.length===0?t.jsx("div",{className:"px-3 py-2 text-sm text-gray-500 dark:text-gray-400 text-center",children:"No options found"}):b.map(C=>{const E=r.includes(C.value);return t.jsxs("button",{onClick:()=>!C.disabled&&k(C.value),disabled:C.disabled,className:f("w-full px-3 py-2 text-sm text-left flex items-center gap-2","hover:bg-gray-100 dark:hover:bg-gray-800","transition-colors","disabled:opacity-50 disabled:cursor-not-allowed"),children:[t.jsx("div",{className:f("w-4 h-4 border-2 rounded flex items-center justify-center",E?"bg-blue-600 border-blue-600 dark:bg-blue-500 dark:border-blue-500":"border-gray-300 dark:border-gray-600"),children:E&&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.jsx("span",{className:"flex-1 text-gray-900 dark:text-white",children:C.label})]},C.value)})}),r.length>0&&t.jsxs("div",{className:"p-2 border-t border-gray-200 dark:border-gray-700 flex justify-between items-center",children:[t.jsxs("span",{className:"text-xs text-gray-600 dark:text-gray-400",children:[r.length," selected"]}),t.jsx("button",{onClick:C=>{C.stopPropagation(),a([])},className:"text-xs text-blue-600 dark:text-blue-400 hover:underline",children:"Clear all"})]})]})]})},xs=({options:e,value:r,onChange:a,placeholder:n="Select option...",searchPlaceholder:o="Search...",emptyMessage:s="No results found.",disabled:l=!1,className:c})=>{const[d,i]=p.useState(!1),[h,u]=p.useState(""),[y,m]=p.useState(0),b=p.useRef(null),v=p.useRef(null),k=e.filter(C=>C.label.toLowerCase().includes(h.toLowerCase())),S=e.find(C=>C.value===r);p.useEffect(()=>{if(!d)return;const C=E=>{b.current&&!b.current.contains(E.target)&&(i(!1),u(""))};return document.addEventListener("mousedown",C),()=>document.removeEventListener("mousedown",C)},[d]),p.useEffect(()=>{d&&v.current&&v.current.focus()},[d]),p.useEffect(()=>{m(0)},[h]);const w=C=>{if(!d){(C.key==="Enter"||C.key===" ")&&(C.preventDefault(),i(!0));return}switch(C.key){case"ArrowDown":C.preventDefault(),m(E=>E<k.length-1?E+1:E);break;case"ArrowUp":C.preventDefault(),m(E=>E>0?E-1:E);break;case"Enter":C.preventDefault(),k[y]&&!k[y].disabled&&(a(k[y].value),i(!1),u(""));break;case"Escape":C.preventDefault(),i(!1),u("");break}},N=(C,E)=>{E||(a(C),i(!1),u(""))};return t.jsxs("div",{ref:b,className:f("relative w-full",c),children:[t.jsxs("button",{type:"button",onClick:()=>!l&&i(!d),onKeyDown:w,disabled:l,className:f("w-full flex items-center justify-between","px-3 py-2 text-sm text-left","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",d&&"ring-2 ring-blue-500 dark:ring-blue-400"),children:[t.jsx("span",{className:f("truncate",!S&&"text-gray-500 dark:text-gray-400"),children:S?S.label:n}),t.jsx("svg",{className:f("w-4 h-4 ml-2 transition-transform",d&&"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"})})]}),d&&t.jsxs("div",{className:"absolute z-50 w-full mt-1 bg-white dark:bg-gray-900 border border-gray-300 dark:border-gray-700 rounded-md shadow-lg",children:[t.jsx("div",{className:"p-2 border-b border-gray-200 dark:border-gray-700",children:t.jsx("input",{ref:v,type:"text",value:h,onChange:C=>u(C.target.value),onKeyDown:w,placeholder:o,className:"w-full px-3 py-2 text-sm bg-gray-50 dark:bg-gray-800 border-none rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500 dark:focus:ring-blue-400"})}),t.jsx("div",{className:"max-h-60 overflow-y-auto py-1",children:k.length===0?t.jsx("div",{className:"px-3 py-2 text-sm text-gray-500 dark:text-gray-400 text-center",children:s}):k.map((C,E)=>t.jsx("button",{onClick:()=>N(C.value,C.disabled),disabled:C.disabled,className:f("w-full px-3 py-2 text-sm text-left","transition-colors","disabled:opacity-50 disabled:cursor-not-allowed",C.value===r?"bg-blue-50 dark:bg-blue-900/30 text-blue-700 dark:text-blue-300":E===y?"bg-gray-100 dark:bg-gray-800":"hover:bg-gray-50 dark:hover:bg-gray-800"),children:C.label},C.value))})]})]})},Ns=({options:e,value:r,onChange:a,placeholder:n="Enter or select...",disabled:o=!1,className:s,inputClassName:l,filterOptions:c=!0,emptyMessage:d="No matching options"})=>{const[i,h]=p.useState(!1),[u,y]=p.useState(!1),[m,b]=p.useState(!1),[v,k]=p.useState(0),S=p.useRef(null),w=p.useRef(null),N=e.find(M=>M.value===r),C=N?.label&&typeof N.label!="string",E=c&&m?e.filter(M=>(M.searchLabel||M.value).toLowerCase().includes(r.toLowerCase())):e;p.useEffect(()=>{if(!i&&!u)return;const M=U=>{S.current&&!S.current.contains(U.target)&&(h(!1),y(!1),b(!1))};return document.addEventListener("mousedown",M),()=>document.removeEventListener("mousedown",M)},[i,u]),p.useEffect(()=>{k(0)},[r,E.length]);const I=M=>{if(!i){M.key==="ArrowDown"&&(M.preventDefault(),h(!0));return}switch(M.key){case"ArrowDown":M.preventDefault(),k(U=>U<E.length-1?U+1:U);break;case"ArrowUp":M.preventDefault(),k(U=>U>0?U-1:U);break;case"Enter":M.preventDefault(),E[v]&&!E[v].disabled&&(a(E[v].value),h(!1),b(!1));break;case"Escape":M.preventDefault(),h(!1),b(!1);break;case"Tab":h(!1),b(!1);break}},x=(M,U)=>{U||(a(M),h(!1),y(!1),b(!1))},A=M=>{a(M.target.value),b(!0),i||h(!0)},L=()=>{o||(h(!i),i||w.current?.focus())},O=()=>{o||(y(!0),h(!0),setTimeout(()=>w.current?.focus(),0))};return t.jsxs("div",{ref:S,className:f("relative w-full",s),children:[t.jsxs("div",{className:"relative flex items-center",children:[!u&&C&&r?t.jsx("button",{type:"button",onClick:O,disabled:o,className:f(j.input.default(),"pr-10 text-left flex items-center",o&&"opacity-50 cursor-not-allowed",l),children:N?.label}):t.jsx("input",{ref:w,type:"text",value:r,onChange:A,onKeyDown:I,onFocus:()=>{y(!0),e.length>0&&h(!0)},onBlur:()=>{setTimeout(()=>{i||y(!1)},150)},placeholder:n,disabled:o,className:f(j.input.default(),"pr-10",o&&"opacity-50 cursor-not-allowed",l)}),t.jsx("button",{type:"button",onClick:L,disabled:o,className:f("absolute right-0 top-0 h-full px-3","flex items-center justify-center","text-gray-500 dark:text-gray-400","hover:text-gray-700 dark:hover:text-gray-200","transition-colors","disabled:opacity-50 disabled:cursor-not-allowed",i&&"text-gray-700 dark:text-gray-200"),"aria-label":"Toggle dropdown",children:t.jsx(Oe.ChevronDownIcon,{className:f("w-4 h-4 transition-transform",i&&"rotate-180")})})]}),i&&e.length>0&&t.jsx("div",{className:f("absolute z-50 w-full mt-1","bg-white dark:bg-gray-900","border border-gray-300 dark:border-gray-700","rounded-md shadow-lg","max-h-60 overflow-y-auto"),children:E.length===0?t.jsx("div",{className:"px-3 py-2 text-sm text-gray-500 dark:text-gray-400 text-center",children:d}):E.map((M,U)=>t.jsx("button",{type:"button",onClick:()=>x(M.value,M.disabled),disabled:M.disabled,className:f("w-full px-3 py-2 text-sm text-left","flex items-center gap-2","transition-colors","disabled:opacity-50 disabled:cursor-not-allowed",M.value===r?"bg-blue-50 dark:bg-blue-900/30 text-blue-700 dark:text-blue-300":U===v?"bg-gray-100 dark:bg-gray-800":"hover:bg-gray-50 dark:hover:bg-gray-800","text-gray-900 dark:text-gray-100"),children:M.label||M.value},M.value))})]})};function ar(e,r){p.useEffect(()=>{const a=n=>{const o=e?.current;!o||o.contains(n?.target||null)||r(n)};return document.addEventListener("mousedown",a),document.addEventListener("touchstart",a),()=>{document.removeEventListener("mousedown",a),document.removeEventListener("touchstart",a)}},[e,r])}const Cs=({trigger:e,items:r,align:a="right",className:n="",variant:o="default",onTrack:s,trackingLabel:l,componentName:c})=>{const[d,i]=p.useState(!1),h=p.useRef(null);ar(h,()=>i(!1));const u=b=>{b.disabled||(s&&s({action:"select",trackingLabel:l,componentName:c}),b.onClick(),i(!1))},y=a==="left"?j.overlays.dropdown.menuRight():j.overlays.dropdown.menuLeft(),m=o==="bordered"?j.overlays.dropdown.triggerBordered():j.overlays.dropdown.trigger();return t.jsxs("div",{className:`${j.overlays.dropdown.container()} ${n}`,ref:h,children:[t.jsx("div",{className:m,onClick:()=>i(!d),children:e}),d&&t.jsx("div",{className:`${j.overlays.dropdown.menu()} ${y} ${j.overlays.dropdown.menuBottom()}`,children:t.jsx("div",{className:j.overlays.dropdown.itemContainer(),children:r.map(b=>b.separator?t.jsx("div",{className:"my-1 h-px bg-gray-200 dark:bg-gray-700",role:"separator"},b.id):t.jsxs("button",{onClick:()=>u(b),disabled:b.disabled,className:`${b.disabled?j.overlays.dropdown.itemDisabled():j.overlays.dropdown.item()} flex items-center gap-2`,children:[b.icon&&t.jsx(b.icon,{className:j.overlays.dropdown.itemIcon()}),t.jsx("span",{children:b.label})]},b.id))})})]})},Ss=({options:e,value:r,values:a=[],onChange:n,onValuesChange:o,multiple:s=!1,size:l="md",variant:c="default",className:d})=>{const i=(m,b)=>{if(!b)if(s){const v=a.includes(m)?a.filter(k=>k!==m):[...a,m];o?.(v)}else n?.(m)},h=m=>s?a.includes(m):r===m,u={sm:"text-xs px-2 py-1",md:"text-sm px-3 py-2",lg:"text-base px-4 py-2"},y={default:{base:"bg-gray-100 dark:bg-gray-800",button:"hover:bg-gray-200 dark:hover:bg-gray-700",selected:"bg-white dark:bg-gray-900 shadow-sm"},outline:{base:"border border-gray-200 dark:border-gray-700",button:"hover:bg-gray-50 dark:hover:bg-gray-800",selected:"bg-gray-100 dark:bg-gray-800 border-gray-300 dark:border-gray-600"}};return t.jsx("div",{className:f("inline-flex rounded-lg p-1 gap-1",y[c].base,d),role:"group",children:e.map(m=>{const b=h(m.value);return t.jsxs("button",{onClick:()=>i(m.value,m.disabled),disabled:m.disabled,className:f("inline-flex items-center justify-center gap-2","rounded-md font-medium","transition-all duration-150","disabled:opacity-50 disabled:cursor-not-allowed",u[l],b?y[c].selected:y[c].button,b?"text-gray-900 dark:text-white":"text-gray-600 dark:text-gray-400"),"aria-pressed":b,children:[m.icon&&t.jsx("span",{className:"flex-shrink-0 w-4 h-4",children:m.icon}),m.label]},m.value)})})},Es=({value:e,onChange:r,min:a=0,max:n=100,step:o=1,disabled:s=!1,showValue:l=!1,formatValue:c=b=>String(b),showMinMax:d=!1,minLabel:i,maxLabel:h,variant:u="primary",size:y="md",className:m})=>{const b={sm:"h-1",md:"h-2",lg:"h-3"},v={primary:"accent-blue-600 dark:accent-blue-500",success:"accent-green-600 dark:accent-green-500",warning:"accent-yellow-600 dark:accent-yellow-500",danger:"accent-red-600 dark:accent-red-500"},k=w=>{r(Number(w.target.value))},S=(e-a)/(n-a)*100;return t.jsxs("div",{className:f("w-full",m),children:[l&&t.jsxs("div",{className:"flex justify-between items-center mb-2",children:[t.jsx("span",{className:"text-sm font-medium text-gray-700 dark:text-gray-300",children:c(e)}),d&&t.jsxs("span",{className:"text-xs text-gray-500 dark:text-gray-400",children:[i||a," - ",h||n]})]}),t.jsxs("div",{className:"relative",children:[t.jsx("div",{className:f("absolute inset-0 rounded-full","bg-gray-200 dark:bg-gray-700",b[y])}),t.jsx("div",{className:f("absolute left-0 rounded-full transition-all","bg-current",v[u],b[y]),style:{width:`${S}%`}}),t.jsx("input",{type:"range",min:a,max:n,step:o,value:e,onChange:k,disabled:s,className:f("relative w-full appearance-none bg-transparent cursor-pointer","focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-blue-500","rounded-lg",b[y],v[u],s&&"opacity-50 cursor-not-allowed","[&::-webkit-slider-thumb]:appearance-none","[&::-webkit-slider-thumb]:w-4","[&::-webkit-slider-thumb]:h-4","[&::-webkit-slider-thumb]:rounded-full","[&::-webkit-slider-thumb]:bg-white","[&::-webkit-slider-thumb]:border-2","[&::-webkit-slider-thumb]:border-current","[&::-webkit-slider-thumb]:shadow-md","[&::-webkit-slider-thumb]:transition-transform","[&::-webkit-slider-thumb]:hover:scale-110","[&::-moz-range-thumb]:w-4","[&::-moz-range-thumb]:h-4","[&::-moz-range-thumb]:rounded-full","[&::-moz-range-thumb]:bg-white","[&::-moz-range-thumb]:border-2","[&::-moz-range-thumb]:border-current","[&::-moz-range-thumb]:shadow-md","[&::-moz-range-thumb]:transition-transform","[&::-moz-range-thumb]:hover:scale-110")})]}),d&&!l&&t.jsxs("div",{className:"flex justify-between mt-1",children:[t.jsx("span",{className:"text-xs text-gray-500 dark:text-gray-400",children:i||a}),t.jsx("span",{className:"text-xs text-gray-500 dark:text-gray-400",children:h||n})]})]})},As=({value:e,onChange:r,min:a=0,max:n=100,step:o=1,showValue:s=!0,className:l})=>t.jsxs("div",{className:f("flex items-center gap-4",l),children:[t.jsx("input",{type:"range",min:a,max:n,step:o,value:e,onChange:c=>r(Number(c.target.value)),className:"flex-1 accent-blue-500"}),s&&t.jsx("span",{className:"w-12 text-center font-semibold text-gray-900 dark:text-white",children:e})]}),Ts=({onChange:e,accept:r,multiple:a=!1,maxSize:n,maxFiles:o,disabled:s=!1,showDropZone:l=!1,showFileList:c=!0,files:d=[],onRemove:i,className:h,buttonText:u="Choose Files",dropZoneText:y="Drop files here or click to browse",onTrack:m,trackingLabel:b,componentName:v})=>{const k=p.useRef(null),[S,w]=p.useState(!1),[N,C]=p.useState(null),E=z=>(C(null),o&&d.length+z.length>o?(C(`Maximum ${o} files allowed`),[]):z.filter(V=>n&&V.size>n?(C(`File "${V.name}" exceeds maximum size of ${Ir(n)}`),!1):!0)),I=z=>{m&&m({action:z,trackingLabel:b,componentName:v})},x=z=>{const F=Array.from(z.target.files||[]),V=E(F);V.length>0&&(I("select"),e(V)),k.current&&(k.current.value="")},A=()=>{k.current?.click()},L=z=>{z.preventDefault(),z.stopPropagation(),s||w(!0)},O=z=>{z.preventDefault(),z.stopPropagation(),w(!1)},M=z=>{z.preventDefault(),z.stopPropagation()},U=z=>{if(z.preventDefault(),z.stopPropagation(),w(!1),s)return;const F=Array.from(z.dataTransfer.files),V=E(F);V.length>0&&(I("drop"),e(V))},B=z=>{i&&(I("remove"),i(z))};return l?t.jsxs("div",{className:f("w-full",h),children:[t.jsx("input",{ref:k,type:"file",onChange:x,accept:r,multiple:a,disabled:s,className:"hidden"}),t.jsx("div",{onClick:A,onDragEnter:L,onDragLeave:O,onDragOver:M,onDrop:U,className:f("relative border-2 border-dashed rounded-lg p-8","transition-colors duration-200","cursor-pointer",S?"border-blue-500 bg-blue-50 dark:bg-blue-900/10":"border-gray-300 dark:border-gray-600 hover:border-gray-400 dark:hover:border-gray-500",s&&"opacity-50 cursor-not-allowed"),children:t.jsxs("div",{className:"flex flex-col items-center justify-center space-y-3",children:[t.jsx(P.CloudArrowUpIcon,{className:"h-12 w-12 text-gray-400 dark:text-gray-500"}),t.jsx("p",{className:"text-sm text-gray-600 dark:text-gray-400 text-center",children:y}),n&&t.jsxs("p",{className:"text-xs text-gray-500 dark:text-gray-500",children:["Max file size: ",Ir(n)]})]})}),N&&t.jsx("p",{className:"mt-2 text-sm text-red-600 dark:text-red-400",children:N}),c&&d.length>0&&t.jsx(Gt,{files:d,onRemove:B})]}):t.jsxs("div",{className:f("w-full",h),children:[t.jsx("input",{ref:k,type:"file",onChange:x,accept:r,multiple:a,disabled:s,className:"hidden"}),t.jsxs("button",{type:"button",onClick:A,disabled:s,className:f("inline-flex items-center px-4 py-2 border border-gray-300 dark:border-gray-600","rounded-lg shadow-sm 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","focus:outline-none focus:ring-2 focus:ring-blue-500","transition-colors",s&&"opacity-50 cursor-not-allowed"),children:[t.jsx(P.DocumentIcon,{className:"h-5 w-5 mr-2"}),u]}),N&&t.jsx("p",{className:"mt-2 text-sm text-red-600 dark:text-red-400",children:N}),c&&d.length>0&&t.jsx(Gt,{files:d,onRemove:B})]})},Gt=({files:e,onRemove:r})=>t.jsx("div",{className:"mt-3 space-y-2",children:e.map((a,n)=>t.jsxs("div",{className:"flex items-center justify-between p-2 bg-gray-50 dark:bg-gray-800 rounded-lg border border-gray-200 dark:border-gray-700",children:[t.jsxs("div",{className:"flex items-center space-x-2 flex-1 min-w-0",children:[t.jsx(P.DocumentIcon,{className:"h-5 w-5 text-gray-400 flex-shrink-0"}),t.jsxs("div",{className:"flex-1 min-w-0",children:[t.jsx("p",{className:"text-sm font-medium text-gray-900 dark:text-gray-100 truncate",children:a.name}),t.jsx("p",{className:"text-xs text-gray-500 dark:text-gray-400",children:Ir(a.size)})]})]}),t.jsx("button",{type:"button",onClick:()=>r(n),className:"flex-shrink-0 p-1 text-gray-400 hover:text-red-600 dark:hover:text-red-400 transition-colors","aria-label":"Remove file",children:t.jsx(P.XMarkIcon,{className:"h-5 w-5"})})]},`${a.name}-${n}`))});function Ir(e){if(e===0)return"0 Bytes";const r=1024,a=["Bytes","KB","MB","GB"],n=Math.floor(Math.log(e)/Math.log(r));return Math.round(e/Math.pow(r,n)*100)/100+" "+a[n]}const Is=({value:e,onChange:r,placeholder:a="Type and press Enter...",maxTags:n,validate:o,validator:s,separators:l=[],allowDuplicates:c=!1,disabled:d=!1,error:i=!1,errorMessage:h,variant:u="primary",renderTag:y,className:m})=>{const b=o||s,[v,k]=p.useState(""),S=p.useRef(null),w={primary:"bg-blue-100 dark:bg-blue-900/30 text-blue-700 dark:text-blue-300",secondary:"bg-gray-100 dark:bg-gray-700 text-gray-700 dark:text-gray-300",success:"bg-green-100 dark:bg-green-900/30 text-green-700 dark:text-green-300",warning:"bg-yellow-100 dark:bg-yellow-900/30 text-yellow-700 dark:text-yellow-300",error:"bg-red-100 dark:bg-red-900/30 text-red-700 dark:text-red-300"},N=A=>{const L=A.trim();L&&(n&&e.length>=n||!c&&e.includes(L)||b&&!b(L)||(r([...e,L]),k("")))},C=A=>{r(e.filter((L,O)=>O!==A))},E=A=>{k(A.target.value)},I=A=>{A.key==="Enter"&&(A.preventDefault(),v.trim()&&N(v)),A.key===","&&(A.preventDefault(),v.trim()&&N(v)),l.length>0&&l.includes(A.key)&&A.key!==","&&(A.preventDefault(),v.trim()&&N(v)),A.key==="Backspace"&&!v&&e.length>0&&C(e.length-1),A.key==="Escape"&&k("")},x=n!==void 0&&e.length>=n;return t.jsxs("div",{className:f("w-full",m),children:[t.jsxs("div",{className:f("min-h-[42px] px-3 py-2 flex flex-wrap gap-2 items-center","bg-white dark:bg-gray-900","border border-gray-300 dark:border-gray-700","rounded-md","focus-within:ring-2 focus-within:ring-blue-500 dark:focus-within:ring-blue-400","transition-all",d&&"opacity-50 cursor-not-allowed bg-gray-50 dark:bg-gray-800",i&&"border-red-500 dark:border-red-400"),onClick:()=>!d&&S.current?.focus(),children:[e.map((A,L)=>y?t.jsx(p.Fragment,{children:y(A,L,()=>C(L))},L):t.jsxs("span",{className:f("inline-flex items-center gap-1.5 px-2.5 py-1",w[u],"text-sm font-medium","rounded-md","transition-colors"),children:[t.jsx("span",{className:"truncate max-w-[200px]",children:A}),t.jsx("button",{type:"button",onClick:O=>{O.stopPropagation(),C(L)},disabled:d,className:f("flex-shrink-0 hover:text-blue-900 dark:hover:text-blue-100","transition-colors","disabled:cursor-not-allowed"),"aria-label":`Remove ${A}`,children:t.jsx("svg",{className:"w-3.5 h-3.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"})})})]},L)),t.jsx("input",{ref:S,type:"text",value:v,onChange:E,onKeyDown:I,placeholder:e.length===0?a:x?`Max ${n} tags`:"",disabled:d,className:f("flex-1 min-w-[120px] outline-none bg-transparent","text-sm text-gray-900 dark:text-white","placeholder:text-gray-500 dark:placeholder:text-gray-400","disabled:cursor-not-allowed")})]}),h&&t.jsx("p",{className:"mt-1.5 text-xs text-red-600 dark:text-red-400",children:h}),n&&t.jsxs("p",{className:"mt-1.5 text-xs text-gray-600 dark:text-gray-400",children:[e.length," / ",n," tags"]})]})},Ls=({value:e,onChange:r,mentions:a,trigger:n="@",placeholder:o="Type a message...",disabled:s=!1,className:l})=>{const[c,d]=p.useState(!1),[i,h]=p.useState([]),[u,y]=p.useState(0),[m,b]=p.useState(0),v=p.useRef(null),k=p.useRef(null),S=C=>{const E=C.target.value,I=C.target.selectionStart||0;r(E),b(I);const A=E.substring(0,I).split(/\s/),L=A[A.length-1];if(L.startsWith(n)){const O=L.substring(n.length),M=a.filter(U=>U.label.toLowerCase().includes(O.toLowerCase()));h(M),d(M.length>0),y(0)}else d(!1)},w=C=>{const E=e.substring(0,m),I=e.substring(m),x=E.split(/\s/),A=x[x.length-1],L=E.length-A.length,O=e.substring(0,L)+n+C.label+" "+I;if(r(O),d(!1),v.current){const M=L+n.length+C.label.length+1;setTimeout(()=>{v.current?.focus(),v.current?.setSelectionRange(M,M)},0)}},N=C=>{if(c)switch(C.key){case"ArrowDown":C.preventDefault(),y(E=>E<i.length-1?E+1:E);break;case"ArrowUp":C.preventDefault(),y(E=>E>0?E-1:E);break;case"Enter":C.preventDefault(),i[u]&&w(i[u]);break;case"Escape":C.preventDefault(),d(!1);break}};return p.useEffect(()=>{const C=E=>{k.current&&!k.current.contains(E.target)&&v.current&&!v.current.contains(E.target)&&d(!1)};return document.addEventListener("mousedown",C),()=>document.removeEventListener("mousedown",C)},[]),t.jsxs("div",{className:f("relative w-full",l),children:[t.jsx("textarea",{ref:v,value:e,onChange:S,onKeyDown:N,placeholder:o,disabled:s,className:f("w-full px-3 py-2 text-sm","bg-white dark:bg-gray-900","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","disabled:opacity-50 disabled:cursor-not-allowed","resize-none","min-h-[100px]")}),c&&t.jsx("div",{ref:k,className:"absolute z-50 w-full mt-1 bg-white dark:bg-gray-900 border border-gray-300 dark:border-gray-700 rounded-md shadow-lg max-h-60 overflow-y-auto",children:i.map((C,E)=>t.jsxs("button",{onClick:()=>w(C),className:f("w-full px-3 py-2 text-left flex items-center gap-3","hover:bg-gray-100 dark:hover:bg-gray-800","transition-colors",E===u&&"bg-blue-50 dark:bg-blue-900/30"),children:[C.avatar&&t.jsx("img",{src:C.avatar,alt:C.label,className:"w-8 h-8 rounded-full"}),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:C.label}),C.metadata&&t.jsx("p",{className:"text-xs text-gray-600 dark:text-gray-400 truncate",children:C.metadata})]})]},C.id))})]})},Ms=X.cva(`${D.label.default()} peer-disabled:cursor-not-allowed peer-disabled:opacity-70`),Lr=G.forwardRef(({className:e,...r},a)=>t.jsx(at.Root,{ref:a,className:f(Ms(),e),...r}));Lr.displayName=at.Root.displayName;const Ps=({id:e,label:r,type:a="text",value:n,onChange:o,placeholder:s,helperText:l,error:c,required:d=!1,disabled:i=!1,maxLength:h,autoFocus:u=!1,className:y,inputClassName:m})=>{const b=!!c,v=l||c?`${e}-helper`:void 0;return t.jsxs("div",{className:f("space-y-2",y),children:[t.jsxs(Lr,{htmlFor:e,children:[r,d&&t.jsx("span",{className:"text-red-500 ml-1",children:"*"})]}),t.jsx(Re,{type:a,id:e,value:n,onChange:o,placeholder:s,disabled:i,maxLength:h,autoFocus:u,required:d,"aria-invalid":b,"aria-describedby":v,className:m}),(l||c)&&t.jsx("p",{id:v,className:f(D.body.sm(),b?"text-red-600 dark:text-red-400":"text-gray-500 dark:text-gray-400"),role:b?"alert":void 0,children:c||l})]})},nr=({label:e,required:r=!1,error:a,helpText:n,children:o,layout:s="vertical",className:l="",labelClassName:c="",contentClassName:d=""})=>{const i=s==="horizontal";return t.jsxs("div",{className:`${i?"grid grid-cols-1 md:grid-cols-3 gap-4 items-start":"space-y-2"} ${l}`,children:[t.jsxs("div",{className:i?"md:col-span-1":"",children:[t.jsxs("label",{className:`block text-sm font-medium text-gray-700 dark:text-gray-300 ${c}`,children:[e,r&&t.jsx("span",{className:"text-red-500 ml-1",children:"*"})]}),n&&!a&&t.jsxs("div",{className:"mt-1 flex items-start",children:[t.jsx(P.InformationCircleIcon,{className:"h-4 w-4 text-gray-400 mr-1 mt-0.5 flex-shrink-0"}),t.jsx("p",{className:"text-xs text-gray-500 dark:text-gray-400",children:n})]})]}),t.jsxs("div",{className:`${i?"md:col-span-2":""} ${d}`,children:[t.jsx("div",{className:a?"relative":"",children:o}),a&&t.jsxs("div",{className:"mt-1 flex items-start",children:[t.jsx(P.ExclamationCircleIcon,{className:"h-4 w-4 text-red-500 mr-1 mt-0.5 flex-shrink-0"}),t.jsx("p",{className:"text-xs text-red-600 dark:text-red-400",children:a})]})]})]})},Os=({label:e,value:r,onChange:a,placeholder:n,required:o=!1,error:s,helpText:l,type:c="text",layout:d="vertical",className:i=""})=>t.jsx(nr,{label:e,required:o,error:s,helpText:l,layout:d,className:i,children:t.jsx("input",{type:c,value:r,onChange:h=>a(h.target.value),placeholder:n,className:`
20
+ ${c.text}
21
+ `,"aria-label":"Dismiss notification",children:e.jsx("svg",{className:"h-4 w-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})})]})}const no={"top-right":"top-4 right-4","top-left":"top-4 left-4","bottom-right":"bottom-4 right-4","bottom-left":"bottom-4 left-4","top-center":"top-4 left-1/2 -translate-x-1/2","bottom-center":"bottom-4 left-1/2 -translate-x-1/2"};function lo({toasts:t,onDismiss:r,position:a="bottom-right"}){return t.length===0?null:e.jsx("div",{className:`fixed z-50 flex flex-col gap-2 max-w-sm w-full ${no[a]}`,"aria-label":"Notifications",children:t.map(o=>e.jsx(Ir,{toast:o,onDismiss:r},o.id))})}function io(){const t=b.useContext(Ge);if(!t)throw new Error("useToast must be used within a ToastProvider");return t}const co=({message:t,variant:r="info",onClose:a,className:o})=>{const s={info:"bg-blue-500",success:"bg-green-500",warning:"bg-yellow-500",error:"bg-red-500"};return e.jsxs("div",{className:u("fixed bottom-4 right-4 p-4 rounded-lg text-white shadow-lg flex items-center gap-3",s[r],o),children:[e.jsx("span",{children:t}),a&&e.jsx("button",{onClick:a,className:"ml-4",children:"×"})]})},go=({count:t,maxCount:r=99,variant:a="danger",className:o})=>{const s=t>r?`${r}+`:t,n={default:"bg-gray-500",primary:"bg-blue-500",danger:"bg-red-500"};return e.jsx("span",{className:u("inline-flex items-center justify-center px-2 py-1 text-xs font-bold text-white rounded-full",n[a],o),children:s})},uo=({notifications:t,onMarkAsRead:r,className:a})=>e.jsx("div",{className:u("bg-white dark:bg-gray-900 rounded-lg border border-gray-200 dark:border-gray-700 p-4 max-h-96 overflow-y-auto",a),children:t.map(o=>e.jsxs("div",{className:u("p-3 rounded mb-2",o.read?"bg-transparent":"bg-blue-50 dark:bg-blue-900/20"),onClick:()=>r?.(o.id),children:[e.jsx("h4",{className:"font-semibold text-gray-900 dark:text-white",children:o.title}),e.jsx("p",{className:"text-sm text-gray-600 dark:text-gray-400",children:o.message}),e.jsx("span",{className:"text-xs text-gray-500 dark:text-gray-500",children:o.timestamp})]},o.id))}),ho=({children:t,variant:r="default",size:a="sm",icon:o,dot:s=!1,pill:n=!1,outline:l=!1,onClick:i,dismissible:g=!1,onDismiss:c,count:h,maxCount:f,className:v})=>{const p={default:"bg-gray-100 text-gray-800 dark:bg-gray-700 dark:text-gray-300",primary:"bg-blue-100 text-blue-800 dark:bg-blue-900/30 dark:text-blue-400",success:"bg-green-100 text-green-800 dark:bg-green-900/30 dark:text-green-400",warning:"bg-yellow-100 text-yellow-800 dark:bg-yellow-900/30 dark:text-yellow-400",danger:"bg-red-100 text-red-800 dark:bg-red-900/30 dark:text-red-400",info:"bg-blue-100 text-blue-800 dark:bg-blue-900/30 dark:text-blue-400",purple:"bg-purple-100 text-purple-800 dark:bg-purple-900/30 dark:text-purple-400"},m={default:"border border-gray-300 text-gray-700 dark:border-gray-600 dark:text-gray-300",primary:"border border-blue-600 text-blue-600 dark:border-blue-400 dark:text-blue-400",success:"border border-green-600 text-green-600 dark:border-green-400 dark:text-green-400",warning:"border border-yellow-600 text-yellow-600 dark:border-yellow-400 dark:text-yellow-400",danger:"border border-red-600 text-red-600 dark:border-red-400 dark:text-red-400",info:"border border-blue-600 text-blue-600 dark:border-blue-400 dark:text-blue-400",purple:"border border-purple-600 text-purple-600 dark:border-purple-400 dark:text-purple-400"},y={sm:"px-2 py-0.5 text-xs",md:"px-2.5 py-1 text-sm",lg:"px-3 py-1.5 text-base"},x={sm:"h-3 w-3",md:"h-3.5 w-3.5",lg:"h-4 w-4"},N={default:"bg-gray-600 dark:bg-gray-400",primary:"bg-blue-600 dark:bg-blue-400",success:"bg-green-600 dark:bg-green-400",warning:"bg-yellow-600 dark:bg-yellow-400",danger:"bg-red-600 dark:bg-red-400",info:"bg-blue-600 dark:bg-blue-400",purple:"bg-purple-600 dark:bg-purple-400"},k=h!==void 0?f!==void 0&&h>f?`${f}+`:h.toString():null,S=e.jsxs(e.Fragment,{children:[s&&e.jsx("span",{className:u("h-2 w-2 rounded-full mr-1.5",N[r])}),o&&e.jsx("span",{className:u(x[a],"mr-1"),children:o}),t,k&&e.jsx("span",{className:"ml-1",children:k}),g&&c&&e.jsx("button",{onClick:C=>{C.stopPropagation(),c()},className:"ml-1 hover:bg-black/10 dark:hover:bg-white/10 rounded-full p-0.5","aria-label":"Dismiss",children:e.jsx(ee.XMarkIcon,{className:u(x[a])})})]}),w=i?"button":"span";return e.jsx(w,{onClick:i,className:u("inline-flex items-center font-medium",l?m[r]:p[r],y[a],n?"rounded-full":"rounded",i&&"cursor-pointer hover:opacity-80",v),children:S})},fo=({className:t,children:r,disabled:a=!1,onClick:o})=>e.jsx("div",{className:u("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",t),onClick:a?void 0:o,role:"region","aria-label":"UbadgeUdesigner",children:r||"UbadgeUdesigner Component"}),bo=t=>{switch(t){case"verified":case"success":return T.getStatusIndicatorColor("success");case"connected":case"warning":return T.getStatusIndicatorColor("warning");case"disconnected":case"error":return T.getStatusIndicatorColor("error");case"pending":return T.getStatusIndicatorColor("info");default:return T.getStatusIndicatorColor("neutral")}},mo=t=>{switch(t){case"sm":return"w-1.5 h-1.5";case"lg":return"w-3 h-3";default:return"w-2 h-2"}},po=({status:t,label:r,showDot:a=!0,size:o="md"})=>{const n=r||{verified:"Verified",connected:"Connected",disconnected:"Disconnected",pending:"Pending",error:"Error",success:"Success",warning:"Warning"}[t],i=((h,f)=>{const v={sm:"small",md:"default",lg:"large"},m={verified:"success",success:"success",connected:"warning",warning:"warning",disconnected:"error",error:"error",pending:"primary"}[h]||"default",y=v[f];return y==="default"?T.variants.badge[m]():T.variants.badge[y](m)})(t,o),g=bo(t),c=mo(o);return e.jsxs("span",{className:i,children:[a&&e.jsx("span",{className:`inline-block ${c} rounded-full ${g} mr-1`}),n]})},yo=({chainType:t,size:r="md"})=>{if(!t)return null;const a=t===Z.ChainType.SOLANA?"SOL":"ETH",s={sm:"small",md:"default",lg:"large"}[r],n=()=>{const l=t===Z.ChainType.SOLANA?"solana":"ethereum";return s==="default"?T.variants.badge[l]():T.variants.badge[s](l)};return e.jsx("span",{className:n(),children:a})},vo={xs:"w-1.5 h-1.5",sm:"w-2 h-2",md:"w-3 h-3",lg:"w-4 h-4"},xo=({status:t,size:r="sm",pulse:a=!1,className:o})=>e.jsx("div",{className:u("rounded-full flex-shrink-0",T.getStatusIndicatorColor(t),vo[r],a&&"animate-pulse",o)}),ko=({className:t,children:r,disabled:a=!1,onClick:o})=>e.jsx("div",{className:u("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",t),onClick:a?void 0:o,role:"region","aria-label":"UstatusUpipeline",children:r||"UstatusUpipeline Component"}),Le=V.forwardRef(({className:t,type:r,onTrack:a,trackingLabel:o,componentName:s,onBlur:n,onChange:l,...i},g)=>{const c=f=>{a&&a({action:"blur",trackingLabel:o,componentName:s}),n?.(f)},h=f=>{a&&a({action:"change",trackingLabel:o,componentName:s}),l?.(f)};return e.jsx("input",{type:r,className:u(T.variants.input.default(),t),ref:g,onBlur:c,onChange:h,...i})});Le.displayName="Input";const wo=({value:t,onChange:r,placeholder:a,rows:o=4,disabled:s=!1,readOnly:n=!1,showCount:l=!1,maxLength:i,resize:g="vertical",size:c="md",className:h,textareaProps:f,onTrack:v,trackingLabel:p,componentName:m})=>{const y={sm:"p-2 text-sm",md:"p-3 text-base",lg:"p-4 text-lg"},x={none:"resize-none",vertical:"resize-y",horizontal:"resize-x",both:"resize"},N=C=>{const E=C.target.value;i&&E.length>i||(v&&v({action:"change",trackingLabel:p,componentName:m}),r(E))},k=()=>{v&&v({action:"blur",trackingLabel:p,componentName:m})},S=t.length,w=l||i!==void 0;return e.jsxs("div",{className:u("w-full",h),children:[e.jsx("textarea",{value:t,onChange:N,onBlur:k,placeholder:a,rows:o,disabled:s,readOnly:n,maxLength:i,className:u("w-full rounded-lg border","bg-white dark:bg-gray-800","text-gray-900 dark:text-gray-100","placeholder-gray-400 dark:placeholder-gray-500","border-gray-300 dark:border-gray-600","focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-transparent","transition-colors duration-200",y[c],x[g],s&&"opacity-50 cursor-not-allowed",n&&"bg-gray-50 dark:bg-gray-900 cursor-default"),...f}),w&&e.jsx("div",{className:"flex justify-end mt-1",children:e.jsxs("span",{className:u("text-xs",i&&S>i*.9?"text-yellow-600 dark:text-yellow-400":"text-gray-500 dark:text-gray-400",i&&S>=i&&"text-red-600 dark:text-red-400"),children:[S,i&&` / ${i}`]})})]})},Co=({value:t,onChange:r,min:a,max:o,step:s=1,disabled:n=!1,showSteppers:l=!1,stepperPosition:i="right",placeholder:g,size:c="md",className:h,inputProps:f,onTrack:v,trackingLabel:p,componentName:m})=>{const x={sm:{input:"py-1.5 px-3 text-sm",button:"w-6 h-6",icon:"h-3 w-3"},md:{input:"py-2 px-3 text-base",button:"w-8 h-8",icon:"h-4 w-4"},lg:{input:"py-3 px-4 text-lg",button:"w-10 h-10",icon:"h-5 w-5"}}[c],N=I=>({action:I,trackingLabel:p,componentName:m}),k=I=>{const U=parseFloat(I.target.value);if(isNaN(U)){if(I.target.value===""){const P=a??0;v&&v(N("input")),r(P)}}else{const P=S(U);v&&v(N("input")),r(P)}},S=I=>{let U=I;return a!==void 0&&U<a&&(U=a),o!==void 0&&U>o&&(U=o),U},w=()=>{const I=S(t+s);v&&v(N("increment")),r(I)},C=()=>{const I=S(t-s);v&&v(N("decrement")),r(I)},E=o===void 0||t<o,M=a===void 0||t>a,L=({onClick:I,icon:U,disabled:P,ariaLabel:A})=>e.jsx("button",{type:"button",onClick:I,disabled:n||P,"aria-label":A,className:u("inline-flex items-center justify-center","border border-gray-300 dark:border-gray-600","bg-white dark:bg-gray-800","text-gray-700 dark:text-gray-300","hover:bg-gray-50 dark:hover:bg-gray-700","focus:outline-none focus:ring-2 focus:ring-blue-500","transition-colors",x.button,(n||P)&&"opacity-50 cursor-not-allowed"),children:U});return l&&i==="sides"?e.jsxs("div",{className:u("inline-flex items-stretch",h),children:[e.jsx(L,{onClick:C,disabled:!M,icon:e.jsx(z.MinusIcon,{className:x.icon}),ariaLabel:"Decrement"}),e.jsx("input",{type:"number",value:t,onChange:k,min:a,max:o,step:s,disabled:n,placeholder:g,className:u("border-x-0 text-center","border-gray-300 dark:border-gray-600","bg-white dark:bg-gray-800","text-gray-900 dark:text-gray-100","focus:outline-none focus:ring-2 focus:ring-blue-500 focus:z-10","transition-colors",x.input,n&&"opacity-50 cursor-not-allowed","[appearance:textfield]","[&::-webkit-outer-spin-button]:appearance-none","[&::-webkit-inner-spin-button]:appearance-none"),...f}),e.jsx(L,{onClick:w,disabled:!E,icon:e.jsx(z.PlusIcon,{className:x.icon}),ariaLabel:"Increment"})]}):l&&i==="right"?e.jsxs("div",{className:u("inline-flex items-stretch gap-2",h),children:[e.jsx("input",{type:"number",value:t,onChange:k,min:a,max:o,step:s,disabled:n,placeholder:g,className:u("rounded-lg border","border-gray-300 dark:border-gray-600","bg-white dark:bg-gray-800","text-gray-900 dark:text-gray-100","placeholder-gray-400 dark:placeholder-gray-500","focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-transparent","transition-colors",x.input,n&&"opacity-50 cursor-not-allowed","[appearance:textfield]","[&::-webkit-outer-spin-button]:appearance-none","[&::-webkit-inner-spin-button]:appearance-none"),...f}),e.jsxs("div",{className:"inline-flex flex-col gap-0.5",children:[e.jsx("button",{type:"button",onClick:w,disabled:n||!E,"aria-label":"Increment",className:u("inline-flex items-center justify-center","rounded border border-gray-300 dark:border-gray-600","bg-white dark:bg-gray-800","text-gray-700 dark:text-gray-300","hover:bg-gray-50 dark:hover:bg-gray-700","focus:outline-none focus:ring-2 focus:ring-blue-500","transition-colors","flex-1",x.button.replace(/h-\d+/,"h-auto"),(n||!E)&&"opacity-50 cursor-not-allowed"),children:e.jsx(z.PlusIcon,{className:u(x.icon,"w-3 h-3")})}),e.jsx("button",{type:"button",onClick:C,disabled:n||!M,"aria-label":"Decrement",className:u("inline-flex items-center justify-center","rounded border border-gray-300 dark:border-gray-600","bg-white dark:bg-gray-800","text-gray-700 dark:text-gray-300","hover:bg-gray-50 dark:hover:bg-gray-700","focus:outline-none focus:ring-2 focus:ring-blue-500","transition-colors","flex-1",x.button.replace(/h-\d+/,"h-auto"),(n||!M)&&"opacity-50 cursor-not-allowed"),children:e.jsx(z.MinusIcon,{className:u(x.icon,"w-3 h-3")})})]})]}):e.jsx("input",{type:"number",value:t,onChange:k,min:a,max:o,step:s,disabled:n,placeholder:g,className:u("rounded-lg border","border-gray-300 dark:border-gray-600","bg-white dark:bg-gray-800","text-gray-900 dark:text-gray-100","placeholder-gray-400 dark:placeholder-gray-500","focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-transparent","transition-colors",x.input,n&&"opacity-50 cursor-not-allowed",h),...f})},No=({value:t,onChange:r,placeholder:a="Search...",autoFocus:o=!1,disabled:s=!1,size:n="md",showIcon:l=!0,showClear:i=!0,loading:g=!1,className:c,inputProps:h,onTrack:f,trackingLabel:v,componentName:p})=>{const[m,y]=b.useState(""),x=t!==void 0?t:m,N=t!==void 0,S={sm:{input:"py-1.5 text-sm",icon:"h-4 w-4",padding:l?"pl-8 pr-8":"px-3",iconLeft:"left-0 pl-2.5",iconRight:"right-0 pr-2.5"},md:{input:"py-2 text-base",icon:"h-5 w-5",padding:l?"pl-10 pr-10":"px-3",iconLeft:"left-0 pl-3",iconRight:"right-0 pr-3"},lg:{input:"py-3 text-lg",icon:"h-6 w-6",padding:l?"pl-12 pr-12":"px-4",iconLeft:"left-0 pl-3.5",iconRight:"right-0 pr-3.5"}}[n],w=b.useCallback(M=>{const L=M.target.value;N||y(L),r?.(L)},[r,N]),C=b.useCallback(()=>{f&&f({action:"search",trackingLabel:v,componentName:p})},[f,v,p]),E=b.useCallback(()=>{N||y(""),f&&f({action:"clear",trackingLabel:v,componentName:p}),r?.("")},[r,N,f,v,p]);return e.jsxs("div",{className:u("relative w-full",c),children:[l&&e.jsx("div",{className:u("absolute inset-y-0 flex items-center pointer-events-none",S.iconLeft),children:e.jsx(z.MagnifyingGlassIcon,{className:u(S.icon,"text-gray-400 dark:text-gray-500")})}),e.jsx("input",{type:"text",value:x,onChange:w,onBlur:C,placeholder:a,autoFocus:o,disabled:s||g,className:u("block w-full rounded-lg border","bg-white dark:bg-gray-800","text-gray-900 dark:text-gray-100","placeholder-gray-400 dark:placeholder-gray-500","border-gray-300 dark:border-gray-600","focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-transparent","transition-colors duration-200",S.input,S.padding,s&&"opacity-50 cursor-not-allowed",g&&"opacity-60"),...h}),i&&x&&!g&&e.jsx("button",{type:"button",onClick:E,disabled:s,className:u("absolute inset-y-0 flex items-center","text-gray-400 hover:text-gray-600 dark:hover:text-gray-300","transition-colors",s?"cursor-not-allowed":"cursor-pointer",S.iconRight),"aria-label":"Clear search",children:e.jsx(z.XMarkIcon,{className:S.icon})}),g&&e.jsx("div",{className:u("absolute inset-y-0 flex items-center",S.iconRight),children:e.jsxs("svg",{className:u(S.icon,"animate-spin text-gray-400"),xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",children:[e.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),e.jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})]})})]})},So=({value:t,onChange:r,type:a="date",min:o,max:s,disabled:n=!1,showIcon:l=!1,placeholder:i,size:g="md",className:c,inputProps:h})=>{const v={sm:{input:"py-1.5 text-sm",icon:"h-4 w-4",padding:l?"pl-8 pr-3":"px-3",iconLeft:"left-0 pl-2.5"},md:{input:"py-2 text-base",icon:"h-5 w-5",padding:l?"pl-10 pr-4":"px-4",iconLeft:"left-0 pl-3"},lg:{input:"py-3 text-lg",icon:"h-6 w-6",padding:l?"pl-12 pr-4":"px-4",iconLeft:"left-0 pl-3.5"}}[g],p=t instanceof Date?Lo(t,a):t,m=y=>{r(y.target.value)};return e.jsxs("div",{className:u("relative",c),children:[l&&e.jsx("div",{className:u("absolute inset-y-0 flex items-center pointer-events-none",v.iconLeft),children:e.jsx(z.CalendarIcon,{className:u(v.icon,"text-gray-400 dark:text-gray-500")})}),e.jsx("input",{type:a,value:p,onChange:m,min:o,max:s,disabled:n,placeholder:i,className:u("block w-full rounded-lg border","bg-white dark:bg-gray-800","text-gray-900 dark:text-gray-100","placeholder-gray-400 dark:placeholder-gray-500","border-gray-300 dark:border-gray-600","focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-transparent","transition-colors duration-200",v.input,v.padding,n&&"opacity-50 cursor-not-allowed","appearance-none","[&::-webkit-calendar-picker-indicator]:opacity-100","[&::-webkit-calendar-picker-indicator]:cursor-pointer"),...h})]})};function Lo(t,r){const a=g=>String(g).padStart(2,"0"),o=t.getFullYear(),s=a(t.getMonth()+1),n=a(t.getDate()),l=a(t.getHours()),i=a(t.getMinutes());switch(r){case"date":return`${o}-${s}-${n}`;case"time":return`${l}:${i}`;case"datetime-local":return`${o}-${s}-${n}T${l}:${i}`;case"month":return`${o}-${s}`;case"week":{const g=new Date(o,0,1),c=Math.floor((t.getTime()-g.getTime())/(1440*60*1e3)),h=Math.ceil((c+g.getDay()+1)/7);return`${o}-W${a(h)}`}default:return`${o}-${s}-${n}`}}const Tr=({value:t,onChange:r,use12Hour:a=!1,minuteStep:o=1,disabled:s=!1,className:n})=>{const[l,i]=b.useState(!1),[g,c]=b.useState("12"),[h,f]=b.useState("00"),[v,p]=b.useState("AM"),m=b.useRef(null);b.useEffect(()=>{if(t){const[S,w]=t.split(":"),C=parseInt(S,10);if(a){const E=C>=12,M=C===0?12:C>12?C-12:C;c(M.toString().padStart(2,"0")),p(E?"PM":"AM")}else c(S);f(w)}},[t,a]),b.useEffect(()=>{const S=w=>{m.current&&!m.current.contains(w.target)&&i(!1)};return document.addEventListener("mousedown",S),()=>document.removeEventListener("mousedown",S)},[]);const y=()=>{if(!t)return"";const[S,w]=t.split(":"),C=parseInt(S,10);if(a){const E=C===0?12:C>12?C-12:C,M=C>=12?"PM":"AM";return`${E}:${w} ${M}`}return`${S}:${w}`},x=(S,w,C)=>{let E=parseInt(S,10);const M=parseInt(w,10);a&&C&&(C==="PM"&&E!==12?E+=12:C==="AM"&&E===12&&(E=0));const L=`${E.toString().padStart(2,"0")}:${M.toString().padStart(2,"0")}`;r(L)},N=a?Array.from({length:12},(S,w)=>(w+1).toString().padStart(2,"0")):Array.from({length:24},(S,w)=>w.toString().padStart(2,"0")),k=Array.from({length:Math.ceil(60/o)},(S,w)=>(w*o).toString().padStart(2,"0"));return e.jsxs("div",{ref:m,className:u("relative w-full",n),children:[e.jsxs("button",{type:"button",onClick:()=>!s&&i(!l),disabled:s,className:u("w-full px-3 py-2 text-sm text-left flex items-center justify-between","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",l&&"ring-2 ring-blue-500 dark:ring-blue-400"),children:[e.jsx("span",{className:u(t?"text-gray-900 dark:text-white":"text-gray-500 dark:text-gray-400"),children:t?y():"Select time"}),e.jsx("svg",{className:"w-5 h-5 text-gray-600 dark:text-gray-400",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 8v4l3 3m6-3a9 9 0 11-18 0 9 9 0 0118 0z"})})]}),l&&e.jsx("div",{className:"absolute top-full left-0 mt-1 bg-white dark:bg-gray-900 border border-gray-300 dark:border-gray-700 rounded-md shadow-lg z-50",children:e.jsxs("div",{className:"flex gap-1 p-2",children:[e.jsxs("div",{className:"flex flex-col",children:[e.jsx("div",{className:"text-xs font-medium text-gray-700 dark:text-gray-300 text-center mb-1 px-2",children:"Hour"}),e.jsx("div",{className:"h-48 overflow-y-auto w-16 border border-gray-200 dark:border-gray-700 rounded",children:N.map(S=>e.jsx("button",{onClick:()=>{c(S),x(S,h,a?v:void 0)},className:u("w-full px-3 py-1.5 text-sm text-center","hover:bg-gray-100 dark:hover:bg-gray-800","transition-colors",S===g&&"bg-blue-100 dark:bg-blue-900/30 text-blue-700 dark:text-blue-300 font-medium"),children:S},S))})]}),e.jsxs("div",{className:"flex flex-col",children:[e.jsx("div",{className:"text-xs font-medium text-gray-700 dark:text-gray-300 text-center mb-1 px-2",children:"Min"}),e.jsx("div",{className:"h-48 overflow-y-auto w-16 border border-gray-200 dark:border-gray-700 rounded",children:k.map(S=>e.jsx("button",{onClick:()=>{f(S),x(g,S,a?v:void 0)},className:u("w-full px-3 py-1.5 text-sm text-center","hover:bg-gray-100 dark:hover:bg-gray-800","transition-colors",S===h&&"bg-blue-100 dark:bg-blue-900/30 text-blue-700 dark:text-blue-300 font-medium"),children:S},S))})]}),a&&e.jsxs("div",{className:"flex flex-col",children:[e.jsx("div",{className:"text-xs font-medium text-gray-700 dark:text-gray-300 text-center mb-1 px-2",children:" "}),e.jsxs("div",{className:"h-48 flex flex-col justify-center gap-2 w-16",children:[e.jsx("button",{onClick:()=>{p("AM"),x(g,h,"AM")},className:u("px-3 py-2 text-sm text-center rounded","hover:bg-gray-100 dark:hover:bg-gray-800","transition-colors",v==="AM"&&"bg-blue-100 dark:bg-blue-900/30 text-blue-700 dark:text-blue-300 font-medium"),children:"AM"}),e.jsx("button",{onClick:()=>{p("PM"),x(g,h,"PM")},className:u("px-3 py-2 text-sm text-center rounded","hover:bg-gray-100 dark:hover:bg-gray-800","transition-colors",v==="PM"&&"bg-blue-100 dark:bg-blue-900/30 text-blue-700 dark:text-blue-300 font-medium"),children:"PM"})]})]})]})})]})},Eo=[{code:"US",name:"United States",dialCode:"+1",flag:"🇺🇸"},{code:"GB",name:"United Kingdom",dialCode:"+44",flag:"🇬🇧"},{code:"CA",name:"Canada",dialCode:"+1",flag:"🇨🇦"},{code:"AU",name:"Australia",dialCode:"+61",flag:"🇦🇺"},{code:"DE",name:"Germany",dialCode:"+49",flag:"🇩🇪"},{code:"FR",name:"France",dialCode:"+33",flag:"🇫🇷"},{code:"IT",name:"Italy",dialCode:"+39",flag:"🇮🇹"},{code:"ES",name:"Spain",dialCode:"+34",flag:"🇪🇸"},{code:"MX",name:"Mexico",dialCode:"+52",flag:"🇲🇽"},{code:"BR",name:"Brazil",dialCode:"+55",flag:"🇧🇷"},{code:"IN",name:"India",dialCode:"+91",flag:"🇮🇳"},{code:"CN",name:"China",dialCode:"+86",flag:"🇨🇳"},{code:"JP",name:"Japan",dialCode:"+81",flag:"🇯🇵"},{code:"KR",name:"South Korea",dialCode:"+82",flag:"🇰🇷"},{code:"SG",name:"Singapore",dialCode:"+65",flag:"🇸🇬"}],Mo=({value:t,onChange:r,country:a,onCountryChange:o,countries:s=Eo,placeholder:n="Phone number",disabled:l=!1,className:i})=>{const[g,c]=b.useState(s[0]?.code||"US"),[h,f]=b.useState(!1),[v,p]=b.useState(""),m=a!==void 0?a:g,y=s.find(w=>w.code===m),x=w=>{a!==void 0&&o?o(w):c(w),f(!1),p("")},N=w=>{const C=w.replace(/\D/g,"");return y?.dialCode==="+1"?C.length<=3?C:C.length<=6?`(${C.slice(0,3)}) ${C.slice(3)}`:`(${C.slice(0,3)}) ${C.slice(3,6)}-${C.slice(6,10)}`:C},k=w=>{const C=N(w.target.value);r(C)},S=s.filter(w=>w.name.toLowerCase().includes(v.toLowerCase())||w.dialCode.includes(v)||w.code.toLowerCase().includes(v.toLowerCase()));return e.jsxs("div",{className:u("relative w-full",i),children:[e.jsxs("div",{className:"flex gap-2",children:[e.jsxs("div",{className:"relative",children:[e.jsxs("button",{type:"button",onClick:()=>!l&&f(!h),disabled:l,className:u("flex items-center gap-2 px-3 py-2 min-w-[120px]","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",h&&"ring-2 ring-blue-500 dark:ring-blue-400"),children:[e.jsx("span",{className:"text-xl",children:y?.flag}),e.jsx("span",{className:"text-sm font-medium text-gray-900 dark:text-white",children:y?.dialCode}),e.jsx("svg",{className:u("w-4 h-4 text-gray-600 dark:text-gray-400 transition-transform",h&&"rotate-180"),fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 9l-7 7-7-7"})})]}),h&&e.jsxs("div",{className:"absolute top-full left-0 mt-1 w-72 bg-white dark:bg-gray-900 border border-gray-300 dark:border-gray-700 rounded-md shadow-lg z-50",children:[e.jsx("div",{className:"p-2 border-b border-gray-200 dark:border-gray-700",children:e.jsx("input",{type:"text",value:v,onChange:w=>p(w.target.value),placeholder:"Search countries...",className:"w-full px-3 py-2 text-sm bg-gray-50 dark:bg-gray-800 border-none rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500 dark:focus:ring-blue-400",onClick:w=>w.stopPropagation()})}),e.jsx("div",{className:"max-h-60 overflow-y-auto py-1",children:S.length===0?e.jsx("div",{className:"px-3 py-2 text-sm text-gray-500 dark:text-gray-400 text-center",children:"No countries found"}):S.map(w=>e.jsxs("button",{onClick:()=>x(w.code),className:u("w-full px-3 py-2 text-left flex items-center gap-3","hover:bg-gray-100 dark:hover:bg-gray-800","transition-colors",w.code===m&&"bg-blue-50 dark:bg-blue-900/30"),children:[e.jsx("span",{className:"text-xl",children:w.flag}),e.jsx("span",{className:"flex-1 text-sm text-gray-900 dark:text-white",children:w.name}),e.jsx("span",{className:"text-sm text-gray-600 dark:text-gray-400",children:w.dialCode})]},w.code))})]})]}),e.jsx("input",{type:"tel",value:t,onChange:k,placeholder:n,disabled:l,className:u("flex-1 px-3 py-2 text-sm","bg-white dark:bg-gray-900","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","disabled:opacity-50 disabled:cursor-not-allowed")})]}),t&&y&&e.jsxs("p",{className:"mt-1.5 text-xs text-gray-600 dark:text-gray-400",children:["Full number: ",y.dialCode," ",t]}),h&&e.jsx("div",{className:"fixed inset-0 z-40",onClick:()=>f(!1)})]})},Io=({checked:t,defaultChecked:r=!1,onChange:a,label:o,description:s,disabled:n=!1,size:l="md",variant:i="primary",color:g,className:c,id:h,name:f,value:v,required:p=!1,indeterminate:m=!1,error:y=!1,errorMessage:x,icon:N,onTrack:k,trackingLabel:S,componentName:w})=>{const[C,E]=b.useState(r),M=t!==void 0,L=M?t:C,I={sm:{box:"w-4 h-4",check:"w-3 h-3",text:"text-sm",desc:"text-xs"},md:{box:"w-5 h-5",check:"w-4 h-4",text:"text-base",desc:"text-sm"},lg:{box:"w-6 h-6",check:"w-5 h-5",text:"text-lg",desc:"text-base"}},P=g?{blue:"primary",green:"success",yellow:"warning",red:"error"}[g]:i,A=()=>y?L?"bg-red-600 border-red-600":"border-red-600 dark:border-red-500":{primary:L?"bg-blue-600 border-blue-600":"border-gray-300 dark:border-gray-600",success:L?"bg-green-600 border-green-600":"border-gray-300 dark:border-gray-600",warning:L?"bg-yellow-600 border-yellow-600":"border-gray-300 dark:border-gray-600",error:L?"bg-red-600 border-red-600":"border-gray-300 dark:border-gray-600"}[P],D=j=>{if(n)return;const _=j.target.checked;M||E(_),k&&k({action:"toggle",trackingLabel:S,componentName:w}),a?.(_)},$=j=>{if(!n&&(j.key===" "||j.key==="Spacebar")){j.preventDefault();const _=!L;M||E(_),k&&k({action:"toggle",trackingLabel:S,componentName:w}),a?.(_)}},B=I[l];return e.jsxs("div",{className:u("inline-flex flex-col",c),children:[e.jsxs("label",{className:u("inline-flex items-start gap-2 cursor-pointer",n&&"opacity-50 cursor-not-allowed"),children:[e.jsxs("div",{className:"relative flex items-center",children:[e.jsx("input",{type:"checkbox",checked:L,defaultChecked:M?void 0:r,onChange:D,onKeyDown:$,disabled:n,id:h,name:f,value:v,required:p,className:"sr-only peer"}),e.jsx("div",{"data-indeterminate":m?"true":void 0,className:u("rounded border-2 flex items-center justify-center transition-colors bg-white dark:bg-gray-900",B.box,A(),!n&&"hover:border-opacity-75"),children:m?e.jsx(ee.MinusIcon,{className:u("text-white",B.check)}):L?N||e.jsx(ee.CheckIcon,{className:u("text-white",B.check)}):null})]}),(o||s)&&e.jsxs("div",{className:"flex flex-col",children:[o&&e.jsx("span",{className:u("text-gray-900 dark:text-white",B.text),children:o}),s&&e.jsx("span",{className:u("text-gray-600 dark:text-gray-400",B.desc),children:s})]})]}),x&&e.jsx("span",{className:"mt-1 text-sm text-red-600 dark:text-red-400",children:x})]})},Pr=V.forwardRef(({className:t,onTrack:r,trackingLabel:a,componentName:o,onCheckedChange:s,...n},l)=>{const i=g=>{r&&r({action:"toggle",trackingLabel:a,componentName:o}),s?.(g)};return e.jsx(He.Root,{className:u("peer inline-flex h-6 w-11 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-blue-500 focus-visible:ring-offset-2 focus-visible:ring-offset-white disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-blue-600 data-[state=unchecked]:bg-gray-200 dark:focus-visible:ring-blue-400 dark:focus-visible:ring-offset-gray-950 dark:data-[state=checked]:bg-blue-500 dark:data-[state=unchecked]:bg-gray-700",t),onCheckedChange:i,...n,ref:l,children:e.jsx(He.Thumb,{className:u("pointer-events-none block h-5 w-5 rounded-full bg-white shadow-lg ring-0 transition-transform data-[state=checked]:translate-x-5 data-[state=unchecked]:translate-x-0")})})});Pr.displayName=He.Root.displayName;const To=({name:t="radio-group",value:r,onChange:a,options:o,label:s,orientation:n="vertical",disabled:l=!1,error:i=!1,errorMessage:g,required:c=!1,size:h="md",renderOption:f,className:v})=>{const p=b.useRef(null),y={sm:{radio:"w-4 h-4",label:"text-sm",description:"text-xs"},md:{radio:"w-5 h-5",label:"text-base",description:"text-sm"},lg:{radio:"w-6 h-6",label:"text-lg",description:"text-base"}}[h],x=(k,S)=>{!l&&!S&&a(k)},N=(k,S)=>{const w=o.filter(E=>!E.disabled&&!l),C=w.findIndex(E=>E.value===o[S].value);if(k.key==="ArrowDown"||k.key==="ArrowRight"){k.preventDefault();const E=(C+1)%w.length;a(w[E].value)}else if(k.key==="ArrowUp"||k.key==="ArrowLeft"){k.preventDefault();const E=(C-1+w.length)%w.length;a(w[E].value)}};return e.jsxs("div",{className:u("w-full",v),children:[s&&e.jsx("div",{className:"mb-2",children:e.jsxs("span",{className:"text-sm font-medium text-gray-700 dark:text-gray-300",children:[s,c&&e.jsx("span",{className:"text-red-600 ml-1",children:"*"})]})}),e.jsx("div",{ref:p,className:u(n==="horizontal"?"flex flex-row gap-4":"flex flex-col space-y-2"),role:"radiogroup",children:o.map((k,S)=>{const w=l||k.disabled,C=r===k.value;return e.jsxs("label",{className:u("flex items-start cursor-pointer",w&&"opacity-50 cursor-not-allowed",i&&"border-red-600 dark:border-red-500"),children:[e.jsx("input",{type:"radio",name:t,value:k.value,checked:C,onChange:()=>x(k.value,!!k.disabled),onKeyDown:E=>N(E,S),disabled:w,className:u("mt-0.5 mr-2",y.radio,"text-blue-600 bg-white dark:bg-gray-900","border-gray-300 dark:border-gray-600","focus:ring-blue-500 focus:ring-2","transition-colors",i&&"border-red-600 dark:border-red-500",w&&"cursor-not-allowed")}),e.jsx("div",{className:"flex-1 min-w-0",children:f?f(k):e.jsxs(e.Fragment,{children:[e.jsx("span",{className:u("font-medium text-gray-700 dark:text-gray-300",y.label),children:k.label}),k.description&&e.jsx("p",{className:u("text-gray-500 dark:text-gray-400 mt-0.5",y.description),children:k.description})]})})]},k.value)})}),g&&e.jsx("p",{className:"mt-1 text-sm text-red-600 dark:text-red-400",children:g})]})},Ke=({onTrack:t,trackingLabel:r,componentName:a,onValueChange:o,children:s,...n})=>{const l=i=>{t&&t({action:"change",trackingLabel:r,componentName:a}),o?.(i)};return e.jsx(F.Root,{onValueChange:l,...n,children:s})},Po=F.Group,zr=F.Value,Ee=V.forwardRef(({className:t,children:r,...a},o)=>e.jsxs(F.Trigger,{ref:o,className:u("flex h-9 w-full items-center justify-between rounded-md border border-gray-300 dark:border-gray-600 bg-white dark:bg-gray-800 px-3 py-2 text-sm text-gray-900 dark:text-gray-100 hover:bg-gray-50 dark:hover:bg-gray-700 focus:outline-none focus:ring-2 focus:ring-blue-500 focus:ring-offset-2 dark:ring-offset-gray-950 transition-colors disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1",t),...a,children:[r,e.jsx(F.Icon,{asChild:!0,children:e.jsx(he.ChevronDownIcon,{className:"h-4 w-4 opacity-50 ml-2 flex-shrink-0"})})]}));Ee.displayName=F.Trigger.displayName;const Ye=V.forwardRef(({className:t,...r},a)=>e.jsx(F.ScrollUpButton,{ref:a,className:u("flex cursor-default items-center justify-center py-1",t),...r,children:e.jsx(he.ChevronUpIcon,{className:"h-4 w-4"})}));Ye.displayName=F.ScrollUpButton.displayName;const Qe=V.forwardRef(({className:t,...r},a)=>e.jsx(F.ScrollDownButton,{ref:a,className:u("flex cursor-default items-center justify-center py-1",t),...r,children:e.jsx(he.ChevronDownIcon,{className:"h-4 w-4"})}));Qe.displayName=F.ScrollDownButton.displayName;const Me=V.forwardRef(({className:t,children:r,position:a="popper",...o},s)=>e.jsx(F.Portal,{children:e.jsxs(F.Content,{ref:s,className:u(T.variants.overlays.dropdown.menu(),"z-[1000000] max-h-96 overflow-hidden data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",a==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1 w-[var(--radix-select-trigger-width)]",t),position:a,...o,children:[e.jsx(Ye,{}),e.jsx(F.Viewport,{className:u(T.variants.overlays.dropdown.itemContainer(),a==="popper"&&"h-[var(--radix-select-trigger-height)] w-full"),children:r}),e.jsx(Qe,{})]})}));Me.displayName=F.Content.displayName;const Ur=V.forwardRef(({className:t,...r},a)=>e.jsx(F.Label,{ref:a,className:u(T.variants.overlays.dropdown.header(),"py-1.5",t),...r}));Ur.displayName=F.Label.displayName;const Ie=V.forwardRef(({className:t,children:r,...a},o)=>e.jsxs(F.Item,{ref:o,className:u(T.variants.overlays.dropdown.item(),"relative select-none justify-between pr-8 data-[disabled]:pointer-events-none data-[disabled]:opacity-50",t),...a,children:[e.jsx(F.ItemText,{children:r}),e.jsx("span",{className:"absolute right-2 flex h-3.5 w-3.5 items-center justify-center",children:e.jsx(F.ItemIndicator,{children:e.jsx(he.CheckIcon,{className:"h-4 w-4"})})})]}));Ie.displayName=F.Item.displayName;const Ar=V.forwardRef(({className:t,...r},a)=>e.jsx(F.Separator,{ref:a,className:u("my-1 h-px bg-gray-200 dark:bg-gray-700",t),...r}));Ar.displayName=F.Separator.displayName;const zo=({options:t,value:r,onChange:a,placeholder:o="Select items...",searchPlaceholder:s="Search...",searchable:n=!0,maxDisplay:l=3,disabled:i=!1,className:g})=>{const[c,h]=b.useState(!1),[f,v]=b.useState(""),p=b.useRef(null),m=n?t.filter(w=>w.label.toLowerCase().includes(f.toLowerCase())):t,y=t.filter(w=>r.includes(w.value)),x=w=>{r.includes(w)?a(r.filter(C=>C!==w)):a([...r,w])},N=w=>{a(r.filter(C=>C!==w))};b.useEffect(()=>{const w=C=>{p.current&&!p.current.contains(C.target)&&(h(!1),v(""))};return document.addEventListener("mousedown",w),()=>document.removeEventListener("mousedown",w)},[]);const k=y.length,S=k>l?k-l:0;return e.jsxs("div",{ref:p,className:u("relative w-full",g),children:[e.jsx("button",{type:"button",onClick:()=>!i&&h(!c),disabled:i,className:u("w-full min-h-[42px] px-3 py-2 text-sm text-left","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",c&&"ring-2 ring-blue-500 dark:ring-blue-400"),children:e.jsx("div",{className:"flex flex-wrap gap-1.5",children:y.length===0?e.jsx("span",{className:"text-gray-500 dark:text-gray-400",children:o}):e.jsxs(e.Fragment,{children:[y.slice(0,l).map(w=>e.jsxs("span",{className:"inline-flex items-center gap-1 px-2 py-0.5 bg-blue-100 dark:bg-blue-900/30 text-blue-700 dark:text-blue-300 rounded text-xs font-medium",children:[w.label,e.jsx("button",{onClick:C=>{C.stopPropagation(),N(w.value)},className:"hover:text-blue-900 dark:hover:text-blue-100",children:e.jsx("svg",{className:"w-3 h-3",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})})]},w.value)),S>0&&e.jsxs("span",{className:"inline-flex items-center px-2 py-0.5 bg-gray-200 dark:bg-gray-700 text-gray-700 dark:text-gray-300 rounded text-xs font-medium",children:["+",S," more"]})]})})}),c&&e.jsxs("div",{className:"absolute z-50 w-full mt-1 bg-white dark:bg-gray-900 border border-gray-300 dark:border-gray-700 rounded-md shadow-lg",children:[n&&e.jsx("div",{className:"p-2 border-b border-gray-200 dark:border-gray-700",children:e.jsx("input",{type:"text",value:f,onChange:w=>v(w.target.value),placeholder:s,className:"w-full px-3 py-2 text-sm bg-gray-50 dark:bg-gray-800 border-none rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500 dark:focus:ring-blue-400",onClick:w=>w.stopPropagation()})}),e.jsx("div",{className:"max-h-60 overflow-y-auto py-1",children:m.length===0?e.jsx("div",{className:"px-3 py-2 text-sm text-gray-500 dark:text-gray-400 text-center",children:"No options found"}):m.map(w=>{const C=r.includes(w.value);return e.jsxs("button",{onClick:()=>!w.disabled&&x(w.value),disabled:w.disabled,className:u("w-full px-3 py-2 text-sm text-left flex items-center gap-2","hover:bg-gray-100 dark:hover:bg-gray-800","transition-colors","disabled:opacity-50 disabled:cursor-not-allowed"),children:[e.jsx("div",{className:u("w-4 h-4 border-2 rounded flex items-center justify-center",C?"bg-blue-600 border-blue-600 dark:bg-blue-500 dark:border-blue-500":"border-gray-300 dark:border-gray-600"),children:C&&e.jsx("svg",{className:"w-3 h-3 text-white",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:3,d:"M5 13l4 4L19 7"})})}),e.jsx("span",{className:"flex-1 text-gray-900 dark:text-white",children:w.label})]},w.value)})}),r.length>0&&e.jsxs("div",{className:"p-2 border-t border-gray-200 dark:border-gray-700 flex justify-between items-center",children:[e.jsxs("span",{className:"text-xs text-gray-600 dark:text-gray-400",children:[r.length," selected"]}),e.jsx("button",{onClick:w=>{w.stopPropagation(),a([])},className:"text-xs text-blue-600 dark:text-blue-400 hover:underline",children:"Clear all"})]})]})]})},Uo=({options:t,value:r,onChange:a,placeholder:o="Select option...",searchPlaceholder:s="Search...",emptyMessage:n="No results found.",disabled:l=!1,className:i})=>{const[g,c]=b.useState(!1),[h,f]=b.useState(""),[v,p]=b.useState(0),m=b.useRef(null),y=b.useRef(null),x=t.filter(w=>w.label.toLowerCase().includes(h.toLowerCase())),N=t.find(w=>w.value===r);b.useEffect(()=>{if(!g)return;const w=C=>{m.current&&!m.current.contains(C.target)&&(c(!1),f(""))};return document.addEventListener("mousedown",w),()=>document.removeEventListener("mousedown",w)},[g]),b.useEffect(()=>{g&&y.current&&y.current.focus()},[g]),b.useEffect(()=>{p(0)},[h]);const k=w=>{if(!g){(w.key==="Enter"||w.key===" ")&&(w.preventDefault(),c(!0));return}switch(w.key){case"ArrowDown":w.preventDefault(),p(C=>C<x.length-1?C+1:C);break;case"ArrowUp":w.preventDefault(),p(C=>C>0?C-1:C);break;case"Enter":w.preventDefault(),x[v]&&!x[v].disabled&&(a(x[v].value),c(!1),f(""));break;case"Escape":w.preventDefault(),c(!1),f("");break}},S=(w,C)=>{C||(a(w),c(!1),f(""))};return e.jsxs("div",{ref:m,className:u("relative w-full",i),children:[e.jsxs("button",{type:"button",onClick:()=>!l&&c(!g),onKeyDown:k,disabled:l,className:u("w-full flex items-center justify-between","px-3 py-2 text-sm text-left","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",g&&"ring-2 ring-blue-500 dark:ring-blue-400"),children:[e.jsx("span",{className:u("truncate",!N&&"text-gray-500 dark:text-gray-400"),children:N?N.label:o}),e.jsx("svg",{className:u("w-4 h-4 ml-2 transition-transform",g&&"rotate-180"),fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 9l-7 7-7-7"})})]}),g&&e.jsxs("div",{className:"absolute z-50 w-full mt-1 bg-white dark:bg-gray-900 border border-gray-300 dark:border-gray-700 rounded-md shadow-lg",children:[e.jsx("div",{className:"p-2 border-b border-gray-200 dark:border-gray-700",children:e.jsx("input",{ref:y,type:"text",value:h,onChange:w=>f(w.target.value),onKeyDown:k,placeholder:s,className:"w-full px-3 py-2 text-sm bg-gray-50 dark:bg-gray-800 border-none rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500 dark:focus:ring-blue-400"})}),e.jsx("div",{className:"max-h-60 overflow-y-auto py-1",children:x.length===0?e.jsx("div",{className:"px-3 py-2 text-sm text-gray-500 dark:text-gray-400 text-center",children:n}):x.map((w,C)=>e.jsx("button",{onClick:()=>S(w.value,w.disabled),disabled:w.disabled,className:u("w-full px-3 py-2 text-sm text-left","transition-colors","disabled:opacity-50 disabled:cursor-not-allowed",w.value===r?"bg-blue-50 dark:bg-blue-900/30 text-blue-700 dark:text-blue-300":C===v?"bg-gray-100 dark:bg-gray-800":"hover:bg-gray-50 dark:hover:bg-gray-800"),children:w.label},w.value))})]})]})},Ao=({options:t,value:r,onChange:a,placeholder:o="Enter or select...",disabled:s=!1,className:n,inputClassName:l,filterOptions:i=!0,emptyMessage:g="No matching options"})=>{const[c,h]=b.useState(!1),[f,v]=b.useState(!1),[p,m]=b.useState(!1),[y,x]=b.useState(0),N=b.useRef(null),k=b.useRef(null),S=t.find(P=>P.value===r),w=S?.label&&typeof S.label!="string",C=i&&p?t.filter(P=>(P.searchLabel||P.value).toLowerCase().includes(r.toLowerCase())):t;b.useEffect(()=>{if(!c&&!f)return;const P=A=>{N.current&&!N.current.contains(A.target)&&(h(!1),v(!1),m(!1))};return document.addEventListener("mousedown",P),()=>document.removeEventListener("mousedown",P)},[c,f]),b.useEffect(()=>{x(0)},[r,C.length]);const E=P=>{if(!c){P.key==="ArrowDown"&&(P.preventDefault(),h(!0));return}switch(P.key){case"ArrowDown":P.preventDefault(),x(A=>A<C.length-1?A+1:A);break;case"ArrowUp":P.preventDefault(),x(A=>A>0?A-1:A);break;case"Enter":P.preventDefault(),C[y]&&!C[y].disabled&&(a(C[y].value),h(!1),m(!1));break;case"Escape":P.preventDefault(),h(!1),m(!1);break;case"Tab":h(!1),m(!1);break}},M=(P,A)=>{A||(a(P),h(!1),v(!1),m(!1))},L=P=>{a(P.target.value),m(!0),c||h(!0)},I=()=>{s||(h(!c),c||k.current?.focus())},U=()=>{s||(v(!0),h(!0),setTimeout(()=>k.current?.focus(),0))};return e.jsxs("div",{ref:N,className:u("relative w-full",n),children:[e.jsxs("div",{className:"relative flex items-center",children:[!f&&w&&r?e.jsx("button",{type:"button",onClick:U,disabled:s,className:u(T.variants.input.default(),"pr-10 text-left flex items-center",s&&"opacity-50 cursor-not-allowed",l),children:S?.label}):e.jsx("input",{ref:k,type:"text",value:r,onChange:L,onKeyDown:E,onFocus:()=>{v(!0),t.length>0&&h(!0)},onBlur:()=>{setTimeout(()=>{c||v(!1)},150)},placeholder:o,disabled:s,className:u(T.variants.input.default(),"pr-10",s&&"opacity-50 cursor-not-allowed",l)}),e.jsx("button",{type:"button",onClick:I,disabled:s,className:u("absolute right-0 top-0 h-full px-3","flex items-center justify-center","text-gray-500 dark:text-gray-400","hover:text-gray-700 dark:hover:text-gray-200","transition-colors","disabled:opacity-50 disabled:cursor-not-allowed",c&&"text-gray-700 dark:text-gray-200"),"aria-label":"Toggle dropdown",children:e.jsx(he.ChevronDownIcon,{className:u("w-4 h-4 transition-transform",c&&"rotate-180")})})]}),c&&t.length>0&&e.jsx("div",{className:u("absolute z-50 w-full mt-1","bg-white dark:bg-gray-900","border border-gray-300 dark:border-gray-700","rounded-md shadow-lg","max-h-60 overflow-y-auto"),children:C.length===0?e.jsx("div",{className:"px-3 py-2 text-sm text-gray-500 dark:text-gray-400 text-center",children:g}):C.map((P,A)=>e.jsx("button",{type:"button",onClick:()=>M(P.value,P.disabled),disabled:P.disabled,className:u("w-full px-3 py-2 text-sm text-left","flex items-center gap-2","transition-colors","disabled:opacity-50 disabled:cursor-not-allowed",P.value===r?"bg-blue-50 dark:bg-blue-900/30 text-blue-700 dark:text-blue-300":A===y?"bg-gray-100 dark:bg-gray-800":"hover:bg-gray-50 dark:hover:bg-gray-800","text-gray-900 dark:text-gray-100"),children:P.label||P.value},P.value))})]})};function Te(t,r){b.useEffect(()=>{const a=o=>{const s=t?.current;!s||s.contains(o?.target||null)||r(o)};return document.addEventListener("mousedown",a),document.addEventListener("touchstart",a),()=>{document.removeEventListener("mousedown",a),document.removeEventListener("touchstart",a)}},[t,r])}const $o=({trigger:t,items:r,align:a="right",className:o="",variant:s="default",onTrack:n,trackingLabel:l,componentName:i})=>{const[g,c]=b.useState(!1),h=b.useRef(null);Te(h,()=>c(!1));const f=m=>{m.disabled||(n&&n({action:"select",trackingLabel:l,componentName:i}),m.onClick(),c(!1))},v=a==="left"?T.variants.overlays.dropdown.menuRight():T.variants.overlays.dropdown.menuLeft(),p=s==="bordered"?T.variants.overlays.dropdown.triggerBordered():T.variants.overlays.dropdown.trigger();return e.jsxs("div",{className:`${T.variants.overlays.dropdown.container()} ${o}`,ref:h,children:[e.jsx("div",{className:p,onClick:()=>c(!g),children:t}),g&&e.jsx("div",{className:`${T.variants.overlays.dropdown.menu()} ${v} ${T.variants.overlays.dropdown.menuBottom()}`,children:e.jsx("div",{className:T.variants.overlays.dropdown.itemContainer(),children:r.map(m=>m.separator?e.jsx("div",{className:"my-1 h-px bg-gray-200 dark:bg-gray-700",role:"separator"},m.id):e.jsxs("button",{onClick:()=>f(m),disabled:m.disabled,className:`${m.disabled?T.variants.overlays.dropdown.itemDisabled():T.variants.overlays.dropdown.item()} flex items-center gap-2`,children:[m.icon&&e.jsx(m.icon,{className:T.variants.overlays.dropdown.itemIcon()}),e.jsx("span",{children:m.label})]},m.id))})})]})},Do=({options:t,value:r,values:a=[],onChange:o,onValuesChange:s,multiple:n=!1,size:l="md",variant:i="default",className:g})=>{const c=(p,m)=>{if(!m)if(n){const y=a.includes(p)?a.filter(x=>x!==p):[...a,p];s?.(y)}else o?.(p)},h=p=>n?a.includes(p):r===p,f={sm:"text-xs px-2 py-1",md:"text-sm px-3 py-2",lg:"text-base px-4 py-2"},v={default:{base:"bg-gray-100 dark:bg-gray-800",button:"hover:bg-gray-200 dark:hover:bg-gray-700",selected:"bg-white dark:bg-gray-900 shadow-sm"},outline:{base:"border border-gray-200 dark:border-gray-700",button:"hover:bg-gray-50 dark:hover:bg-gray-800",selected:"bg-gray-100 dark:bg-gray-800 border-gray-300 dark:border-gray-600"}};return e.jsx("div",{className:u("inline-flex rounded-lg p-1 gap-1",v[i].base,g),role:"group",children:t.map(p=>{const m=h(p.value);return e.jsxs("button",{onClick:()=>c(p.value,p.disabled),disabled:p.disabled,className:u("inline-flex items-center justify-center gap-2","rounded-md font-medium","transition-all duration-150","disabled:opacity-50 disabled:cursor-not-allowed",f[l],m?v[i].selected:v[i].button,m?"text-gray-900 dark:text-white":"text-gray-600 dark:text-gray-400"),"aria-pressed":m,children:[p.icon&&e.jsx("span",{className:"flex-shrink-0 w-4 h-4",children:p.icon}),p.label]},p.value)})})},Bo=({value:t,onChange:r,min:a=0,max:o=100,step:s=1,disabled:n=!1,showValue:l=!1,formatValue:i=m=>String(m),showMinMax:g=!1,minLabel:c,maxLabel:h,variant:f="primary",size:v="md",className:p})=>{const m={sm:"h-1",md:"h-2",lg:"h-3"},y={primary:"accent-blue-600 dark:accent-blue-500",success:"accent-green-600 dark:accent-green-500",warning:"accent-yellow-600 dark:accent-yellow-500",danger:"accent-red-600 dark:accent-red-500"},x=k=>{r(Number(k.target.value))},N=(t-a)/(o-a)*100;return e.jsxs("div",{className:u("w-full",p),children:[l&&e.jsxs("div",{className:"flex justify-between items-center mb-2",children:[e.jsx("span",{className:"text-sm font-medium text-gray-700 dark:text-gray-300",children:i(t)}),g&&e.jsxs("span",{className:"text-xs text-gray-500 dark:text-gray-400",children:[c||a," - ",h||o]})]}),e.jsxs("div",{className:"relative",children:[e.jsx("div",{className:u("absolute inset-0 rounded-full","bg-gray-200 dark:bg-gray-700",m[v])}),e.jsx("div",{className:u("absolute left-0 rounded-full transition-all","bg-current",y[f],m[v]),style:{width:`${N}%`}}),e.jsx("input",{type:"range",min:a,max:o,step:s,value:t,onChange:x,disabled:n,className:u("relative w-full appearance-none bg-transparent cursor-pointer","focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-blue-500","rounded-lg",m[v],y[f],n&&"opacity-50 cursor-not-allowed","[&::-webkit-slider-thumb]:appearance-none","[&::-webkit-slider-thumb]:w-4","[&::-webkit-slider-thumb]:h-4","[&::-webkit-slider-thumb]:rounded-full","[&::-webkit-slider-thumb]:bg-white","[&::-webkit-slider-thumb]:border-2","[&::-webkit-slider-thumb]:border-current","[&::-webkit-slider-thumb]:shadow-md","[&::-webkit-slider-thumb]:transition-transform","[&::-webkit-slider-thumb]:hover:scale-110","[&::-moz-range-thumb]:w-4","[&::-moz-range-thumb]:h-4","[&::-moz-range-thumb]:rounded-full","[&::-moz-range-thumb]:bg-white","[&::-moz-range-thumb]:border-2","[&::-moz-range-thumb]:border-current","[&::-moz-range-thumb]:shadow-md","[&::-moz-range-thumb]:transition-transform","[&::-moz-range-thumb]:hover:scale-110")})]}),g&&!l&&e.jsxs("div",{className:"flex justify-between mt-1",children:[e.jsx("span",{className:"text-xs text-gray-500 dark:text-gray-400",children:c||a}),e.jsx("span",{className:"text-xs text-gray-500 dark:text-gray-400",children:h||o})]})]})},jo=({value:t,onChange:r,min:a=0,max:o=100,step:s=1,showValue:n=!0,className:l})=>e.jsxs("div",{className:u("flex items-center gap-4",l),children:[e.jsx("input",{type:"range",min:a,max:o,step:s,value:t,onChange:i=>r(Number(i.target.value)),className:"flex-1 accent-blue-500"}),n&&e.jsx("span",{className:"w-12 text-center font-semibold text-gray-900 dark:text-white",children:t})]}),Fo=({onChange:t,accept:r,multiple:a=!1,maxSize:o,maxFiles:s,disabled:n=!1,showDropZone:l=!1,showFileList:i=!0,files:g=[],onRemove:c,className:h,buttonText:f="Choose Files",dropZoneText:v="Drop files here or click to browse",onTrack:p,trackingLabel:m,componentName:y})=>{const x=b.useRef(null),[N,k]=b.useState(!1),[S,w]=b.useState(null),C=$=>(w(null),s&&g.length+$.length>s?(w(`Maximum ${s} files allowed`),[]):$.filter(j=>o&&j.size>o?(w(`File "${j.name}" exceeds maximum size of ${Xe(o)}`),!1):!0)),E=$=>{p&&p({action:$,trackingLabel:m,componentName:y})},M=$=>{const B=Array.from($.target.files||[]),j=C(B);j.length>0&&(E("select"),t(j)),x.current&&(x.current.value="")},L=()=>{x.current?.click()},I=$=>{$.preventDefault(),$.stopPropagation(),n||k(!0)},U=$=>{$.preventDefault(),$.stopPropagation(),k(!1)},P=$=>{$.preventDefault(),$.stopPropagation()},A=$=>{if($.preventDefault(),$.stopPropagation(),k(!1),n)return;const B=Array.from($.dataTransfer.files),j=C(B);j.length>0&&(E("drop"),t(j))},D=$=>{c&&(E("remove"),c($))};return l?e.jsxs("div",{className:u("w-full",h),children:[e.jsx("input",{ref:x,type:"file",onChange:M,accept:r,multiple:a,disabled:n,className:"hidden"}),e.jsx("div",{onClick:L,onDragEnter:I,onDragLeave:U,onDragOver:P,onDrop:A,className:u("relative border-2 border-dashed rounded-lg p-8","transition-colors duration-200","cursor-pointer",N?"border-blue-500 bg-blue-50 dark:bg-blue-900/10":"border-gray-300 dark:border-gray-600 hover:border-gray-400 dark:hover:border-gray-500",n&&"opacity-50 cursor-not-allowed"),children:e.jsxs("div",{className:"flex flex-col items-center justify-center space-y-3",children:[e.jsx(z.CloudArrowUpIcon,{className:"h-12 w-12 text-gray-400 dark:text-gray-500"}),e.jsx("p",{className:"text-sm text-gray-600 dark:text-gray-400 text-center",children:v}),o&&e.jsxs("p",{className:"text-xs text-gray-500 dark:text-gray-500",children:["Max file size: ",Xe(o)]})]})}),S&&e.jsx("p",{className:"mt-2 text-sm text-red-600 dark:text-red-400",children:S}),i&&g.length>0&&e.jsx($r,{files:g,onRemove:D})]}):e.jsxs("div",{className:u("w-full",h),children:[e.jsx("input",{ref:x,type:"file",onChange:M,accept:r,multiple:a,disabled:n,className:"hidden"}),e.jsxs("button",{type:"button",onClick:L,disabled:n,className:u("inline-flex items-center px-4 py-2 border border-gray-300 dark:border-gray-600","rounded-lg shadow-sm 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","focus:outline-none focus:ring-2 focus:ring-blue-500","transition-colors",n&&"opacity-50 cursor-not-allowed"),children:[e.jsx(z.DocumentIcon,{className:"h-5 w-5 mr-2"}),f]}),S&&e.jsx("p",{className:"mt-2 text-sm text-red-600 dark:text-red-400",children:S}),i&&g.length>0&&e.jsx($r,{files:g,onRemove:D})]})},$r=({files:t,onRemove:r})=>e.jsx("div",{className:"mt-3 space-y-2",children:t.map((a,o)=>e.jsxs("div",{className:"flex items-center justify-between p-2 bg-gray-50 dark:bg-gray-800 rounded-lg border border-gray-200 dark:border-gray-700",children:[e.jsxs("div",{className:"flex items-center space-x-2 flex-1 min-w-0",children:[e.jsx(z.DocumentIcon,{className:"h-5 w-5 text-gray-400 flex-shrink-0"}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("p",{className:"text-sm font-medium text-gray-900 dark:text-gray-100 truncate",children:a.name}),e.jsx("p",{className:"text-xs text-gray-500 dark:text-gray-400",children:Xe(a.size)})]})]}),e.jsx("button",{type:"button",onClick:()=>r(o),className:"flex-shrink-0 p-1 text-gray-400 hover:text-red-600 dark:hover:text-red-400 transition-colors","aria-label":"Remove file",children:e.jsx(z.XMarkIcon,{className:"h-5 w-5"})})]},`${a.name}-${o}`))});function Xe(t){if(t===0)return"0 Bytes";const r=1024,a=["Bytes","KB","MB","GB"],o=Math.floor(Math.log(t)/Math.log(r));return Math.round(t/Math.pow(r,o)*100)/100+" "+a[o]}const Oo=({value:t,onChange:r,placeholder:a="Type and press Enter...",maxTags:o,validate:s,validator:n,separators:l=[],allowDuplicates:i=!1,disabled:g=!1,error:c=!1,errorMessage:h,variant:f="primary",renderTag:v,className:p})=>{const m=s||n,[y,x]=b.useState(""),N=b.useRef(null),k={primary:"bg-blue-100 dark:bg-blue-900/30 text-blue-700 dark:text-blue-300",secondary:"bg-gray-100 dark:bg-gray-700 text-gray-700 dark:text-gray-300",success:"bg-green-100 dark:bg-green-900/30 text-green-700 dark:text-green-300",warning:"bg-yellow-100 dark:bg-yellow-900/30 text-yellow-700 dark:text-yellow-300",error:"bg-red-100 dark:bg-red-900/30 text-red-700 dark:text-red-300"},S=L=>{const I=L.trim();I&&(o&&t.length>=o||!i&&t.includes(I)||m&&!m(I)||(r([...t,I]),x("")))},w=L=>{r(t.filter((I,U)=>U!==L))},C=L=>{x(L.target.value)},E=L=>{L.key==="Enter"&&(L.preventDefault(),y.trim()&&S(y)),L.key===","&&(L.preventDefault(),y.trim()&&S(y)),l.length>0&&l.includes(L.key)&&L.key!==","&&(L.preventDefault(),y.trim()&&S(y)),L.key==="Backspace"&&!y&&t.length>0&&w(t.length-1),L.key==="Escape"&&x("")},M=o!==void 0&&t.length>=o;return e.jsxs("div",{className:u("w-full",p),children:[e.jsxs("div",{className:u("min-h-[42px] px-3 py-2 flex flex-wrap gap-2 items-center","bg-white dark:bg-gray-900","border border-gray-300 dark:border-gray-700","rounded-md","focus-within:ring-2 focus-within:ring-blue-500 dark:focus-within:ring-blue-400","transition-all",g&&"opacity-50 cursor-not-allowed bg-gray-50 dark:bg-gray-800",c&&"border-red-500 dark:border-red-400"),onClick:()=>!g&&N.current?.focus(),children:[t.map((L,I)=>v?e.jsx(b.Fragment,{children:v(L,I,()=>w(I))},I):e.jsxs("span",{className:u("inline-flex items-center gap-1.5 px-2.5 py-1",k[f],"text-sm font-medium","rounded-md","transition-colors"),children:[e.jsx("span",{className:"truncate max-w-[200px]",children:L}),e.jsx("button",{type:"button",onClick:U=>{U.stopPropagation(),w(I)},disabled:g,className:u("flex-shrink-0 hover:text-blue-900 dark:hover:text-blue-100","transition-colors","disabled:cursor-not-allowed"),"aria-label":`Remove ${L}`,children:e.jsx("svg",{className:"w-3.5 h-3.5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})})]},I)),e.jsx("input",{ref:N,type:"text",value:y,onChange:C,onKeyDown:E,placeholder:t.length===0?a:M?`Max ${o} tags`:"",disabled:g,className:u("flex-1 min-w-[120px] outline-none bg-transparent","text-sm text-gray-900 dark:text-white","placeholder:text-gray-500 dark:placeholder:text-gray-400","disabled:cursor-not-allowed")})]}),h&&e.jsx("p",{className:"mt-1.5 text-xs text-red-600 dark:text-red-400",children:h}),o&&e.jsxs("p",{className:"mt-1.5 text-xs text-gray-600 dark:text-gray-400",children:[t.length," / ",o," tags"]})]})},Vo=({value:t,onChange:r,mentions:a,trigger:o="@",placeholder:s="Type a message...",disabled:n=!1,className:l})=>{const[i,g]=b.useState(!1),[c,h]=b.useState([]),[f,v]=b.useState(0),[p,m]=b.useState(0),y=b.useRef(null),x=b.useRef(null),N=w=>{const C=w.target.value,E=w.target.selectionStart||0;r(C),m(E);const L=C.substring(0,E).split(/\s/),I=L[L.length-1];if(I.startsWith(o)){const U=I.substring(o.length),P=a.filter(A=>A.label.toLowerCase().includes(U.toLowerCase()));h(P),g(P.length>0),v(0)}else g(!1)},k=w=>{const C=t.substring(0,p),E=t.substring(p),M=C.split(/\s/),L=M[M.length-1],I=C.length-L.length,U=t.substring(0,I)+o+w.label+" "+E;if(r(U),g(!1),y.current){const P=I+o.length+w.label.length+1;setTimeout(()=>{y.current?.focus(),y.current?.setSelectionRange(P,P)},0)}},S=w=>{if(i)switch(w.key){case"ArrowDown":w.preventDefault(),v(C=>C<c.length-1?C+1:C);break;case"ArrowUp":w.preventDefault(),v(C=>C>0?C-1:C);break;case"Enter":w.preventDefault(),c[f]&&k(c[f]);break;case"Escape":w.preventDefault(),g(!1);break}};return b.useEffect(()=>{const w=C=>{x.current&&!x.current.contains(C.target)&&y.current&&!y.current.contains(C.target)&&g(!1)};return document.addEventListener("mousedown",w),()=>document.removeEventListener("mousedown",w)},[]),e.jsxs("div",{className:u("relative w-full",l),children:[e.jsx("textarea",{ref:y,value:t,onChange:N,onKeyDown:S,placeholder:s,disabled:n,className:u("w-full px-3 py-2 text-sm","bg-white dark:bg-gray-900","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","disabled:opacity-50 disabled:cursor-not-allowed","resize-none","min-h-[100px]")}),i&&e.jsx("div",{ref:x,className:"absolute z-50 w-full mt-1 bg-white dark:bg-gray-900 border border-gray-300 dark:border-gray-700 rounded-md shadow-lg max-h-60 overflow-y-auto",children:c.map((w,C)=>e.jsxs("button",{onClick:()=>k(w),className:u("w-full px-3 py-2 text-left flex items-center gap-3","hover:bg-gray-100 dark:hover:bg-gray-800","transition-colors",C===f&&"bg-blue-50 dark:bg-blue-900/30"),children:[w.avatar&&e.jsx("img",{src:w.avatar,alt:w.label,className:"w-8 h-8 rounded-full"}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("p",{className:"text-sm font-medium text-gray-900 dark:text-white truncate",children:w.label}),w.metadata&&e.jsx("p",{className:"text-xs text-gray-600 dark:text-gray-400 truncate",children:w.metadata})]})]},w.id))})]})},Wo=W.cva(`${T.textVariants.label.default()} peer-disabled:cursor-not-allowed peer-disabled:opacity-70`),Je=V.forwardRef(({className:t,...r},a)=>e.jsx(Sr.Root,{ref:a,className:u(Wo(),t),...r}));Je.displayName=Sr.Root.displayName;const Ho=({id:t,label:r,type:a="text",value:o,onChange:s,placeholder:n,helperText:l,error:i,required:g=!1,disabled:c=!1,maxLength:h,autoFocus:f=!1,className:v,inputClassName:p})=>{const m=!!i,y=l||i?`${t}-helper`:void 0;return e.jsxs("div",{className:u("space-y-2",v),children:[e.jsxs(Je,{htmlFor:t,children:[r,g&&e.jsx("span",{className:"text-red-500 ml-1",children:"*"})]}),e.jsx(Le,{type:a,id:t,value:o,onChange:s,placeholder:n,disabled:c,maxLength:h,autoFocus:f,required:g,"aria-invalid":m,"aria-describedby":y,className:p}),(l||i)&&e.jsx("p",{id:y,className:u(T.textVariants.body.sm(),m?"text-red-600 dark:text-red-400":"text-gray-500 dark:text-gray-400"),role:m?"alert":void 0,children:i||l})]})},Pe=({label:t,required:r=!1,error:a,helpText:o,children:s,layout:n="vertical",className:l="",labelClassName:i="",contentClassName:g=""})=>{const c=n==="horizontal";return e.jsxs("div",{className:`${c?"grid grid-cols-1 md:grid-cols-3 gap-4 items-start":"space-y-2"} ${l}`,children:[e.jsxs("div",{className:c?"md:col-span-1":"",children:[e.jsxs("label",{className:`block text-sm font-medium text-gray-700 dark:text-gray-300 ${i}`,children:[t,r&&e.jsx("span",{className:"text-red-500 ml-1",children:"*"})]}),o&&!a&&e.jsxs("div",{className:"mt-1 flex items-start",children:[e.jsx(z.InformationCircleIcon,{className:"h-4 w-4 text-gray-400 mr-1 mt-0.5 flex-shrink-0"}),e.jsx("p",{className:"text-xs text-gray-500 dark:text-gray-400",children:o})]})]}),e.jsxs("div",{className:`${c?"md:col-span-2":""} ${g}`,children:[e.jsx("div",{className:a?"relative":"",children:s}),a&&e.jsxs("div",{className:"mt-1 flex items-start",children:[e.jsx(z.ExclamationCircleIcon,{className:"h-4 w-4 text-red-500 mr-1 mt-0.5 flex-shrink-0"}),e.jsx("p",{className:"text-xs text-red-600 dark:text-red-400",children:a})]})]})]})},_o=({label:t,value:r,onChange:a,placeholder:o,required:s=!1,error:n,helpText:l,type:i="text",layout:g="vertical",className:c=""})=>e.jsx(Pe,{label:t,required:s,error:n,helpText:l,layout:g,className:c,children:e.jsx("input",{type:i,value:r,onChange:h=>a(h.target.value),placeholder:o,className:`
23
22
  block w-full px-3 py-2 border rounded-md shadow-sm
24
23
  focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-blue-500
25
24
  dark:bg-gray-800 dark:border-gray-600 dark:text-white
26
25
  transition-colors duration-200
27
- ${s?"border-red-300 focus:ring-red-500 focus:border-red-500":"border-gray-300 dark:border-gray-600"}
28
- `})}),Us=({label:e,value:r,onChange:a,placeholder:n,required:o=!1,error:s,helpText:l,rows:c=4,layout:d="vertical",className:i=""})=>t.jsx(nr,{label:e,required:o,error:s,helpText:l,layout:d,className:i,children:t.jsx("textarea",{value:r,onChange:h=>a(h.target.value),placeholder:n,rows:c,className:`
26
+ ${n?"border-red-300 focus:ring-red-500 focus:border-red-500":"border-gray-300 dark:border-gray-600"}
27
+ `})}),qo=({label:t,value:r,onChange:a,placeholder:o,required:s=!1,error:n,helpText:l,rows:i=4,layout:g="vertical",className:c=""})=>e.jsx(Pe,{label:t,required:s,error:n,helpText:l,layout:g,className:c,children:e.jsx("textarea",{value:r,onChange:h=>a(h.target.value),placeholder:o,rows:i,className:`
29
28
  block w-full px-3 py-2 border rounded-md shadow-sm
30
29
  focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-blue-500
31
30
  dark:bg-gray-800 dark:border-gray-600 dark:text-white
32
31
  transition-colors duration-200 resize-vertical
33
- ${s?"border-red-300 focus:ring-red-500 focus:border-red-500":"border-gray-300 dark:border-gray-600"}
34
- `})}),Ds=({label:e,value:r,onChange:a,options:n,required:o=!1,error:s,helpText:l,placeholder:c="Select an option",layout:d="vertical",className:i=""})=>t.jsx(nr,{label:e,required:o,error:s,helpText:l,layout:d,className:i,children:t.jsxs("select",{value:r,onChange:h=>a(h.target.value),className:`
32
+ ${n?"border-red-300 focus:ring-red-500 focus:border-red-500":"border-gray-300 dark:border-gray-600"}
33
+ `})}),Go=({label:t,value:r,onChange:a,options:o,required:s=!1,error:n,helpText:l,placeholder:i="Select an option",layout:g="vertical",className:c=""})=>e.jsx(Pe,{label:t,required:s,error:n,helpText:l,layout:g,className:c,children:e.jsxs("select",{value:r,onChange:h=>a(h.target.value),className:`
35
34
  block w-full px-3 py-2 border rounded-md shadow-sm
36
35
  focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-blue-500
37
36
  dark:bg-gray-800 dark:border-gray-600 dark:text-white
38
37
  transition-colors duration-200
39
- ${s?"border-red-300 focus:ring-red-500 focus:border-red-500":"border-gray-300 dark:border-gray-600"}
40
- `,children:[c&&t.jsx("option",{value:"",disabled:!0,children:c}),n.map(h=>t.jsx("option",{value:h.value,disabled:h.disabled,children:h.label},h.value))]})}),zs=({successMessage:e,errorMessage:r,successTitle:a="Success",errorTitle:n="Error",autoDismissDelay:o=0,onSuccessDismiss:s,className:l=""})=>(p.useEffect(()=>{if(e&&o>0&&s){const c=setTimeout(()=>{s()},o);return()=>clearTimeout(c)}},[e,o,s]),!e&&!r?null:t.jsxs("div",{className:`space-y-3 ${l}`,children:[r&&t.jsx(pr,{variant:"error",title:n,description:r}),e&&t.jsx(pr,{variant:"success",title:a,description:e})]})),js=({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":"PhoneDirectory",children:r||"PhoneDirectory Component"}),Yt=X.cva("min-h-[44px] touch-manipulation",{variants:{variant:{default:"",primary:"",secondary:"",outline:"",ghost:"",destructive:"","destructive-outline":"",success:"",link:"",gradient:"","gradient-secondary":"","gradient-success":"",wallet:"",connect:"",disconnect:""},size:{default:"",sm:"h-8",lg:"h-12",icon:"h-10 w-10 p-0"},animation:{none:"transition-colors duration-200",hover:"transition-all duration-200 hover:scale-105",lift:"transition-all duration-200 hover:scale-105",scale:"transition-transform duration-200 hover:scale-95",glow:"transition-all duration-200 hover:shadow-lg",shimmer:"transition-all duration-200",tap:"transition-transform duration-100 active:scale-95",connect:"transition-all duration-200 hover:scale-105",transaction:"transition-all duration-200 animate-pulse",disconnect:"transition-all duration-200 hover:opacity-80"}},defaultVariants:{variant:"default",size:"default",animation:"hover"}}),ne=G.forwardRef(({className:e,variant:r,size:a,animation:n,asChild:o=!1,onTrack:s,trackingLabel:l,componentName:c,onClick:d,children:i,...h},u)=>{const y=o?mn.Slot:"button",m=r||"default",b=a&&a!=="default"&&a!=="icon"?a:void 0,v=N=>N?{sm:"small",lg:"large",default:"default"}[N]||N:"default",S=(()=>{if(m.startsWith("gradient")){const N=m.replace("gradient-","").replace("gradient","primary");return j.button.gradient[N]?.()||j.button.primary.default()}else{if(["wallet","connect","disconnect"].includes(m))return j.button.web3[m]?.()||j.button.primary.default();{const N=v(b);return j.button[m]?.[N]?.()||j.button.primary.default()}}})(),w=N=>{s&&s({action:"click",trackingLabel:l,componentName:c}),d?.(N)};return t.jsx(y,{className:f(Yt({size:a,animation:n}),S,e),ref:u,onClick:w,...h,children:i})});ne.displayName="Button";const _s=({children:e,isLoading:r=!1,loadingText:a="Loading...",showSpinner:n=!0,disabled:o,...s})=>t.jsx(ne,{...s,disabled:o||r,className:s.className,children:r?t.jsxs("span",{className:"flex items-center gap-2",children:[n&&t.jsx(Se,{size:"small"}),t.jsx("span",{children:a})]}):e}),Kt=({value:e,onChange:r,minDate:a,maxDate:n,disabledDates:o=[],showOutsideDays:s=!0,className:l})=>{const[c,d]=p.useState(e||new Date),i=C=>{const E=C.getFullYear(),I=C.getMonth();return new Date(E,I+1,0).getDate()},h=C=>{const E=C.getFullYear(),I=C.getMonth();return new Date(E,I,1).getDay()},u=(C,E)=>C.getFullYear()===E.getFullYear()&&C.getMonth()===E.getMonth()&&C.getDate()===E.getDate(),y=C=>a&&C<a||n&&C>n?!0:o.some(E=>u(C,E)),m=()=>{d(new Date(c.getFullYear(),c.getMonth()-1))},b=()=>{d(new Date(c.getFullYear(),c.getMonth()+1))},k=(()=>{const C=c.getFullYear(),E=c.getMonth(),I=i(c),x=h(c),A=[];if(s){const L=i(new Date(C,E-1));for(let O=x-1;O>=0;O--)A.push(new Date(C,E-1,L-O))}else for(let L=0;L<x;L++)A.push(null);for(let L=1;L<=I;L++)A.push(new Date(C,E,L));if(s){const L=42-A.length;for(let O=1;O<=L;O++)A.push(new Date(C,E+1,O))}return A})(),S=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],w=C=>{!C||y(C)||r(C)},N=c.toLocaleDateString("en-US",{month:"long",year:"numeric"});return t.jsxs("div",{className:f("bg-white dark:bg-gray-900 rounded-lg p-4",l),children:[t.jsxs("div",{className:"flex items-center justify-between mb-4",children:[t.jsx("button",{onClick:m,className:"p-2 hover:bg-gray-100 dark:hover:bg-gray-800 rounded-md transition-colors","aria-label":"Previous month",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:"M15 19l-7-7 7-7"})})}),t.jsx("h2",{className:"text-base font-semibold text-gray-900 dark:text-white",children:N}),t.jsx("button",{onClick:b,className:"p-2 hover:bg-gray-100 dark:hover:bg-gray-800 rounded-md transition-colors","aria-label":"Next month",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:"M9 5l7 7-7 7"})})})]}),t.jsx("div",{className:"grid grid-cols-7 gap-1 mb-2",children:S.map(C=>t.jsx("div",{className:"text-center text-xs font-medium text-gray-600 dark:text-gray-400 py-2",children:C},C))}),t.jsx("div",{className:"grid grid-cols-7 gap-1",children:k.map((C,E)=>{if(!C)return t.jsx("div",{className:"aspect-square"},E);const I=C.getMonth()===c.getMonth(),x=e&&u(C,e),A=u(C,new Date),L=y(C);return t.jsx("button",{onClick:()=>w(C),disabled:L,className:f("aspect-square flex items-center justify-center rounded-md text-sm transition-colors","hover:bg-gray-100 dark:hover:bg-gray-800","disabled:opacity-40 disabled:cursor-not-allowed disabled:hover:bg-transparent",I?"text-gray-900 dark:text-white":"text-gray-400 dark:text-gray-600",x&&"bg-blue-600 text-white hover:bg-blue-700 dark:bg-blue-500 dark:hover:bg-blue-600",A&&!x&&"border-2 border-blue-600 dark:border-blue-400"),children:C.getDate()},E)})})]})},Bs=({value:e,onChange:r,use12Hour:a=!1,minuteStep:n=1,minDate:o,maxDate:s,disabled:l=!1,className:c})=>{const[d,i]=p.useState(!1),[h,u]=p.useState(e),y=k=>{const S=k.toLocaleDateString("en-US",{month:"short",day:"numeric",year:"numeric"}),w=k.getHours(),N=k.getMinutes();if(a){const C=w===0?12:w>12?w-12:w,E=w>=12?"PM":"AM";return`${S}, ${C}:${N.toString().padStart(2,"0")} ${E}`}return`${S}, ${w.toString().padStart(2,"0")}:${N.toString().padStart(2,"0")}`},m=k=>{const S=new Date(k);S.setHours(h.getHours()),S.setMinutes(h.getMinutes()),u(S),r(S)},b=k=>{const[S,w]=k.split(":").map(Number),N=new Date(h);N.setHours(S),N.setMinutes(w),u(N),r(N)},v=k=>{const S=k.getHours(),w=k.getMinutes();return`${S.toString().padStart(2,"0")}:${w.toString().padStart(2,"0")}`};return t.jsxs("div",{className:f("relative w-full",c),children:[t.jsxs("button",{type:"button",onClick:()=>!l&&i(!d),disabled:l,className:f("w-full px-3 py-2 text-sm text-left flex items-center justify-between","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",d&&"ring-2 ring-blue-500 dark:ring-blue-400"),children:[t.jsx("span",{className:"text-gray-900 dark:text-white",children:y(e)}),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:"M8 7V3m8 4V3m-9 8h10M5 21h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v12a2 2 0 002 2z"})})]}),d&&t.jsx("div",{className:"absolute top-full left-0 mt-1 bg-white dark:bg-gray-900 border border-gray-300 dark:border-gray-700 rounded-md shadow-lg z-50 p-3",children:t.jsxs("div",{className:"space-y-3",children:[t.jsxs("div",{children:[t.jsx("label",{className:"block text-xs font-medium text-gray-700 dark:text-gray-300 mb-2",children:"Select Date"}),t.jsx(Kt,{value:h,onChange:m,minDate:o,maxDate:s})]}),t.jsx("div",{className:"h-px bg-gray-200 dark:bg-gray-700"}),t.jsxs("div",{children:[t.jsx("label",{className:"block text-xs font-medium text-gray-700 dark:text-gray-300 mb-2",children:"Select Time"}),t.jsx(Wt,{value:v(h),onChange:b,use12Hour:a,minuteStep:n})]}),t.jsxs("div",{className:"flex gap-2 pt-2",children:[t.jsx("button",{onClick:()=>i(!1),className:f("flex-1 px-3 py-1.5 text-sm","bg-gray-100 dark:bg-gray-800","text-gray-700 dark:text-gray-300","rounded-md","hover:bg-gray-200 dark:hover:bg-gray-700","transition-colors"),children:"Cancel"}),t.jsx("button",{onClick:()=>{r(h),i(!1)},className:f("flex-1 px-3 py-1.5 text-sm","bg-blue-600 dark:bg-blue-500","text-white","rounded-md","hover:bg-blue-700 dark:hover:bg-blue-600","transition-colors"),children:"OK"})]})]})}),d&&t.jsx("div",{className:"fixed inset-0 z-40",onClick:()=>i(!1)})]})},Fs=({value:e,onChange:r,minDate:a,maxDate:n,disabledDates:o=[],months:s=2,className:l})=>{const[c,d]=p.useState(new Date),[i,h]=p.useState(null),u=(x,A)=>x.getFullYear()===A.getFullYear()&&x.getMonth()===A.getMonth()&&x.getDate()===A.getDate(),y=x=>a&&x<a||n&&x>n?!0:o.some(A=>u(x,A)),m=x=>{if(!e.start||!e.end&&!i)return!1;const A=e.end||i;return A?x>e.start&&x<A:!1},b=x=>e.start?u(x,e.start):!1,v=x=>e.end?u(x,e.end):!1,k=x=>{y(x)||(!e.start||e.start&&e.end?r({start:x,end:null}):x<e.start?r({start:x,end:e.start}):r({start:e.start,end:x}))},S=x=>{const A=x.getFullYear(),L=x.getMonth();return new Date(A,L+1,0).getDate()},w=x=>{const A=x.getFullYear(),L=x.getMonth();return new Date(A,L,1).getDay()},N=x=>{const A=new Date(c.getFullYear(),c.getMonth()+x),L=A.getFullYear(),O=A.getMonth(),M=S(A),U=w(A),B=[];for(let z=0;z<U;z++)B.push(null);for(let z=1;z<=M;z++)B.push(new Date(L,O,z));return{days:B,monthName:A.toLocaleDateString("en-US",{month:"long",year:"numeric"})}},C=()=>{d(new Date(c.getFullYear(),c.getMonth()-1))},E=()=>{d(new Date(c.getFullYear(),c.getMonth()+1))},I=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"];return t.jsxs("div",{className:f("bg-white dark:bg-gray-900 rounded-lg p-4",l),children:[t.jsxs("div",{className:"flex items-center justify-between mb-4",children:[t.jsx("button",{onClick:C,className:"p-2 hover:bg-gray-100 dark:hover:bg-gray-800 rounded-md transition-colors","aria-label":"Previous month",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:"M15 19l-7-7 7-7"})})}),t.jsx("button",{onClick:E,className:"p-2 hover:bg-gray-100 dark:hover:bg-gray-800 rounded-md transition-colors","aria-label":"Next month",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:"M9 5l7 7-7 7"})})})]}),t.jsx("div",{className:"grid gap-4",style:{gridTemplateColumns:`repeat(${s}, 1fr)`},children:Array.from({length:s},(x,A)=>{const{days:L,monthName:O}=N(A);return t.jsxs("div",{children:[t.jsx("h3",{className:"text-base font-semibold text-gray-900 dark:text-white mb-4 text-center",children:O}),t.jsx("div",{className:"grid grid-cols-7 gap-1 mb-2",children:I.map(M=>t.jsx("div",{className:"text-center text-xs font-medium text-gray-600 dark:text-gray-400 py-2",children:M},M))}),t.jsx("div",{className:"grid grid-cols-7 gap-1",children:L.map((M,U)=>{if(!M)return t.jsx("div",{className:"aspect-square"},U);const B=y(M),z=b(M),F=v(M),V=m(M),R=u(M,new Date);return t.jsx("button",{onClick:()=>k(M),onMouseEnter:()=>h(M),onMouseLeave:()=>h(null),disabled:B,className:f("aspect-square flex items-center justify-center rounded-md text-sm transition-colors relative","disabled:opacity-40 disabled:cursor-not-allowed disabled:hover:bg-transparent",V&&"bg-blue-100 dark:bg-blue-900/30",(z||F)&&"bg-blue-600 text-white hover:bg-blue-700 dark:bg-blue-500 dark:hover:bg-blue-600",!z&&!F&&!V&&"hover:bg-gray-100 dark:hover:bg-gray-800",R&&!z&&!F&&"border-2 border-blue-600 dark:border-blue-400"),children:M.getDate()},U)})})]},A)})}),(e.start||e.end)&&t.jsx("div",{className:"mt-4 pt-4 border-t border-gray-200 dark:border-gray-700",children:t.jsxs("div",{className:"flex items-center justify-between text-sm",children:[t.jsxs("div",{children:[t.jsx("span",{className:"text-gray-600 dark:text-gray-400",children:"Start: "}),t.jsx("span",{className:"font-medium text-gray-900 dark:text-white",children:e.start?.toLocaleDateString()||"Not selected"})]}),t.jsxs("div",{children:[t.jsx("span",{className:"text-gray-600 dark:text-gray-400",children:"End: "}),t.jsx("span",{className:"font-medium text-gray-900 dark:text-white",children:e.end?.toLocaleDateString()||"Not selected"})]})]})})]})},Ws=({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":"UtimeUslotUpicker",children:r||"UtimeUslotUpicker Component"}),Vs=({value:e,onChange:r,presets:a=["#000000","#FFFFFF","#FF6B6B","#4ECDC4","#45B7D1","#FFA07A","#F7DC6F","#BB8FCE","#85C1E2","#F8B500","#52B788","#E63946","#1D3557","#457B9D","#A8DADC","#F4A261","#264653","#2A9D8F"],showInput:n=!0,showOpacity:o=!1,className:s})=>{const[l,c]=p.useState(e),[d,i]=p.useState(100),h=v=>{r(v),c(v)},u=v=>{const k=v.target.value;c(k),/^#[0-9A-F]{6}$/i.test(k)&&r(k)},y=v=>{i(Number(v.target.value))},b=o?((v,k)=>{const S=parseInt(v.slice(1,3),16),w=parseInt(v.slice(3,5),16),N=parseInt(v.slice(5,7),16);return`rgba(${S}, ${w}, ${N}, ${k/100})`})(e,d):e;return t.jsxs("div",{className:f("bg-white dark:bg-gray-900 rounded-lg p-4",s),children:[t.jsx("div",{className:"mb-4",children:t.jsxs("div",{className:"flex items-center gap-3",children:[t.jsx("div",{className:"w-16 h-16 rounded-lg border-2 border-gray-200 dark:border-gray-700 shadow-sm",style:{backgroundColor:b}}),t.jsxs("div",{className:"flex-1",children:[t.jsx("p",{className:"text-sm font-medium text-gray-900 dark:text-white",children:"Selected Color"}),t.jsxs("p",{className:"text-xs text-gray-600 dark:text-gray-400 mt-1 font-mono",children:[e,o&&` (${d}%)`]})]})]})}),t.jsxs("div",{className:"mb-4",children:[t.jsx("p",{className:"text-sm font-medium text-gray-700 dark:text-gray-300 mb-2",children:"Preset Colors"}),t.jsx("div",{className:"grid grid-cols-6 gap-2",children:a.map(v=>t.jsx("button",{onClick:()=>h(v),className:f("w-full aspect-square rounded-md border-2 transition-all hover:scale-110",v===e?"border-blue-500 dark:border-blue-400 ring-2 ring-blue-200 dark:ring-blue-800":"border-gray-200 dark:border-gray-700"),style:{backgroundColor:v},"aria-label":`Select color ${v}`},v))})]}),n&&t.jsxs("div",{className:"mb-4",children:[t.jsx("label",{className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-2",children:"Custom Color (Hex)"}),t.jsxs("div",{className:"flex gap-2",children:[t.jsx("input",{type:"text",value:l,onChange:u,placeholder:"#000000",className:"flex-1 px-3 py-2 text-sm font-mono bg-white 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("input",{type:"color",value:e,onChange:v=>h(v.target.value),className:"w-12 h-10 rounded-md cursor-pointer"})]})]}),o&&t.jsxs("div",{children:[t.jsxs("label",{className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-2",children:["Opacity: ",d,"%"]}),t.jsx("input",{type:"range",min:"0",max:"100",value:d,onChange:y,className:"w-full h-2 bg-gray-200 dark:bg-gray-700 rounded-lg appearance-none cursor-pointer"})]})]})},$s=({value:e,onChange:r,presets:a,className:n})=>{const s=a||["#000000","#ffffff","#ff0000","#00ff00","#0000ff","#ffff00","#ff00ff","#00ffff"];return t.jsxs("div",{className:f("space-y-3",n),children:[t.jsx("input",{type:"color",value:e,onChange:l=>r(l.target.value),className:"w-full h-12 rounded cursor-pointer"}),t.jsx("div",{className:"grid grid-cols-8 gap-2",children:s.map(l=>t.jsx("button",{onClick:()=>r(l),className:f("w-8 h-8 rounded border-2",e===l?"border-blue-500":"border-transparent"),style:{backgroundColor:l}},l))})]})},Hs=({colors:e,selectedColor:r,onColorSelect:a,size:n="md",showNames:o=!1,showCopy:s=!1,className:l})=>{const[c,d]=p.useState(null),i={sm:"w-8 h-8",md:"w-12 h-12",lg:"w-16 h-16"},h=()=>e.map(m=>typeof m=="string"?{hex:m}:m),u=async(m,b)=>{b.stopPropagation(),await navigator.clipboard.writeText(m),d(m),setTimeout(()=>d(null),2e3)},y=h();return t.jsx("div",{className:f("flex flex-wrap gap-3",l),children:y.map((m,b)=>{const v=r===m.hex,k=c===m.hex;return t.jsxs("div",{className:"flex flex-col items-center gap-2",children:[t.jsx("button",{onClick:()=>a?.(m.hex),className:f("rounded-lg transition-all relative group",i[n],v&&"ring-2 ring-blue-500 ring-offset-2 dark:ring-offset-gray-900",!v&&"hover:scale-110"),style:{backgroundColor:m.hex},"aria-label":m.name||m.hex,children:s&&t.jsx("div",{className:"absolute inset-0 flex items-center justify-center opacity-0 group-hover:opacity-100 transition-opacity bg-black/50 rounded-lg",onClick:S=>u(m.hex,S),children:k?t.jsx("svg",{className:"w-4 h-4 text-white",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:t.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M5 13l4 4L19 7"})}):t.jsx("svg",{className:"w-4 h-4 text-white",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:t.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M8 16H6a2 2 0 01-2-2V6a2 2 0 012-2h8a2 2 0 012 2v2m-6 12h8a2 2 0 002-2v-8a2 2 0 00-2-2h-8a2 2 0 00-2 2v8a2 2 0 002 2z"})})})}),o&&t.jsxs("div",{className:"text-center",children:[m.name&&t.jsx("p",{className:"text-xs font-medium text-gray-900 dark:text-white",children:m.name}),t.jsx("p",{className:"text-xs text-gray-600 dark:text-gray-400 font-mono",children:m.hex})]})]},b)})})},qs=({onSave:e,width:r=400,height:a=200,className:n})=>t.jsxs("div",{className:f("border border-gray-300 dark:border-gray-700 rounded-lg",n),children:[t.jsx("canvas",{width:r,height:a,className:"bg-white dark:bg-gray-900"}),t.jsxs("div",{className:"flex gap-2 p-2",children:[t.jsx("button",{className:"px-3 py-1 bg-blue-500 text-white rounded hover:bg-blue-600",children:"Clear"}),t.jsx("button",{onClick:()=>e?.(""),className:"px-3 py-1 bg-green-500 text-white rounded hover:bg-green-600",children:"Save"})]})]}),Gs=({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":"SignatureRequest",children:r||"SignatureRequest Component"}),Ys=({value:e,onChange:r,placeholder:a,className:n})=>t.jsxs("div",{className:f("border border-gray-300 dark:border-gray-700 rounded-lg",n),children:[t.jsx("div",{className:"flex gap-1 p-2 border-b border-gray-300 dark:border-gray-700",children:["B","I","U","H1","H2","List","Link"].map(o=>t.jsx("button",{className:"px-3 py-1 hover:bg-gray-100 dark:hover:bg-gray-800 rounded text-sm font-semibold",children:o},o))}),t.jsx("textarea",{value:e,onChange:o=>r(o.target.value),placeholder:a,className:"w-full p-4 bg-white dark:bg-gray-900 text-gray-900 dark:text-white resize-none focus:outline-none",rows:10})]}),Ks=({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":"UmarkdownUrenderer",children:r||"UmarkdownUrenderer Component"}),Xs=({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":"UcodeUhighlighter",children:r||"UcodeUhighlighter Component"}),Zs=({cardNumber:e,onCardNumberChange:r,expiryDate:a="",onExpiryDateChange:n,cvv:o="",onCVVChange:s,cardholderName:l="",onCardholderNameChange:c,showAllFields:d=!1,disabled:i=!1,className:h})=>{const u=C=>{const E=C.replace(/\s/g,"");return/^4/.test(E)?"visa":/^5[1-5]/.test(E)?"mastercard":/^3[47]/.test(E)?"amex":/^6(?:011|5)/.test(E)?"discover":"unknown"},y=u(e),m=C=>{const E=C.replace(/\D/g,"");if(u(E)==="amex"){const M=E.slice(0,15);return[M.slice(0,4),M.slice(4,10),M.slice(10,15)].filter(Boolean).join(" ")}return(E.slice(0,16).match(/.{1,4}/g)||[]).join(" ")},b=C=>{const x=C.replace(/\D/g,"").slice(0,4);return x.length>=2?`${x.slice(0,2)}/${x.slice(2)}`:x},v=C=>{const E=C.replace(/\D/g,""),I=y==="amex"?4:3;return E.slice(0,I)},k=C=>{const E=m(C.target.value);r(E)},S=C=>{if(!n)return;const E=b(C.target.value);n(E)},w=C=>{if(!s)return;const E=v(C.target.value);s(E)},N=()=>{switch(y){case"visa":return t.jsxs("svg",{className:"w-8 h-5",viewBox:"0 0 48 32",fill:"none",children:[t.jsx("rect",{width:"48",height:"32",rx:"4",fill:"#1434CB"}),t.jsx("path",{d:"M20 11l-2 10h2l2-10h-2zm8 0l-3.5 7-1.5-7h-2l2.5 10h2l5.5-10h-3zm-12 0c-1.5 0-2.5.5-2.5 1.5 0 1.5 3 1.5 3 3.5s-2.5 2-4 2l-.5-2c1 0 2-.5 2-1.5s-3-1.5-3-3.5 2.5-2 4-2l.5 2z",fill:"white"})]});case"mastercard":return t.jsxs("svg",{className:"w-8 h-5",viewBox:"0 0 48 32",fill:"none",children:[t.jsx("rect",{width:"48",height:"32",rx:"4",fill:"#EB001B"}),t.jsx("circle",{cx:"18",cy:"16",r:"8",fill:"#F79E1B"}),t.jsx("circle",{cx:"30",cy:"16",r:"8",fill:"#FF5F00"})]});case"amex":return t.jsxs("svg",{className:"w-8 h-5",viewBox:"0 0 48 32",fill:"none",children:[t.jsx("rect",{width:"48",height:"32",rx:"4",fill:"#006FCF"}),t.jsx("path",{d:"M10 12h8l2 8-2 8h-8l-2-8 2-8z",fill:"white"})]});case"discover":return t.jsxs("svg",{className:"w-8 h-5",viewBox:"0 0 48 32",fill:"none",children:[t.jsx("rect",{width:"48",height:"32",rx:"4",fill:"#FF6000"}),t.jsx("circle",{cx:"38",cy:"16",r:"6",fill:"#FFA500"})]});default:return 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:"M3 10h18M7 15h1m4 0h1m-7 4h12a3 3 0 003-3V8a3 3 0 00-3-3H6a3 3 0 00-3 3v8a3 3 0 003 3z"})})}};return t.jsxs("div",{className:f("w-full space-y-3",h),children:[t.jsxs("div",{children:[t.jsx("label",{className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-1",children:"Card number"}),t.jsxs("div",{className:"relative",children:[t.jsx("input",{type:"text",value:e,onChange:k,placeholder:"1234 5678 9012 3456",disabled:i,className:f("w-full px-3 py-2 pr-12 text-sm","bg-white dark:bg-gray-900","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","disabled:opacity-50 disabled:cursor-not-allowed")}),t.jsx("div",{className:"absolute right-3 top-1/2 -translate-y-1/2",children:N()})]})]}),d&&t.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[t.jsxs("div",{children:[t.jsx("label",{className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-1",children:"Expiry date"}),t.jsx("input",{type:"text",value:a,onChange:S,placeholder:"MM/YY",disabled:i,className:f("w-full px-3 py-2 text-sm","bg-white dark:bg-gray-900","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","disabled:opacity-50 disabled:cursor-not-allowed")})]}),t.jsxs("div",{children:[t.jsx("label",{className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-1",children:"CVV"}),t.jsx("input",{type:"text",value:o,onChange:w,placeholder:y==="amex"?"1234":"123",disabled:i,className:f("w-full px-3 py-2 text-sm","bg-white dark:bg-gray-900","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","disabled:opacity-50 disabled:cursor-not-allowed")})]})]}),d&&t.jsxs("div",{children:[t.jsx("label",{className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-1",children:"Cardholder name"}),t.jsx("input",{type:"text",value:l,onChange:C=>c?.(C.target.value),placeholder:"John Doe",disabled:i,className:f("w-full px-3 py-2 text-sm","bg-white dark:bg-gray-900","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","disabled:opacity-50 disabled:cursor-not-allowed")})]})]})},Xt=[{code:"USD",symbol:"$",name:"US Dollar",decimals:2},{code:"EUR",symbol:"€",name:"Euro",decimals:2},{code:"GBP",symbol:"£",name:"British Pound",decimals:2},{code:"JPY",symbol:"¥",name:"Japanese Yen",decimals:0},{code:"CNY",symbol:"¥",name:"Chinese Yuan",decimals:2},{code:"AUD",symbol:"A$",name:"Australian Dollar",decimals:2},{code:"CAD",symbol:"C$",name:"Canadian Dollar",decimals:2},{code:"CHF",symbol:"Fr",name:"Swiss Franc",decimals:2},{code:"INR",symbol:"₹",name:"Indian Rupee",decimals:2},{code:"BRL",symbol:"R$",name:"Brazilian Real",decimals:2}],Js=({value:e,onChange:r,currency:a="USD",onCurrencyChange:n,currencies:o=Xt,showCurrencySelector:s=!1,placeholder:l="0.00",min:c,max:d,disabled:i=!1,className:h})=>{const[u,y]=p.useState(""),[m,b]=p.useState(!1),[v,k]=p.useState(!1),w=typeof a=="string"?o.find(A=>A.code===a)||Xt[0]:a,N=p.useCallback(A=>{const L=w.decimals??2;return A.toLocaleString("en-US",{minimumFractionDigits:L,maximumFractionDigits:L})},[w]);p.useEffect(()=>{m||y(N(e||0))},[e,N,m]);const C=A=>{const O=A.target.value.replace(/[^\d.]/g,""),M=O.split("."),U=M.length>2?`${M[0]}.${M.slice(1).join("")}`:O;y(U);let z=parseFloat(U)||0;c!==void 0&&z<c&&(z=c),d!==void 0&&z>d&&(z=d),r(z)},E=()=>{b(!0),y(e?e.toString():"")},I=()=>{b(!1),y(N(e||0))},x=A=>{n?.(A),k(!1)};return t.jsxs("div",{className:f("relative w-full",h),children:[t.jsxs("div",{className:"flex gap-2",children:[s&&t.jsxs("div",{className:"relative",children:[t.jsxs("button",{type:"button",onClick:()=>!i&&k(!v),disabled:i,className:f("flex items-center gap-2 px-3 py-2 min-w-[100px]","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",v&&"ring-2 ring-blue-500 dark:ring-blue-400"),children:[t.jsx("span",{className:"text-sm font-medium text-gray-900 dark:text-white",children:w.code}),t.jsx("svg",{className:f("w-4 h-4 text-gray-600 dark:text-gray-400 transition-transform",v&&"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"})})]}),v&&t.jsx("div",{className:"absolute top-full left-0 mt-1 w-64 bg-white dark:bg-gray-900 border border-gray-300 dark:border-gray-700 rounded-md shadow-lg z-50",children:t.jsx("div",{className:"max-h-60 overflow-y-auto py-1",children:o.map(A=>t.jsxs("button",{onClick:()=>x(A.code),className:f("w-full px-3 py-2 text-left flex items-center gap-3","hover:bg-gray-100 dark:hover:bg-gray-800","transition-colors",A.code===w.code&&"bg-blue-50 dark:bg-blue-900/30"),children:[t.jsx("span",{className:"text-lg font-semibold w-8",children:A.symbol}),t.jsxs("div",{className:"flex-1",children:[t.jsx("p",{className:"text-sm font-medium text-gray-900 dark:text-white",children:A.code}),t.jsx("p",{className:"text-xs text-gray-600 dark:text-gray-400",children:A.name})]})]},A.code))})})]}),t.jsxs("div",{className:"relative flex-1",children:[t.jsx("div",{className:"absolute left-3 top-1/2 -translate-y-1/2 text-gray-600 dark:text-gray-400 text-sm font-medium",children:w.symbol}),t.jsx("input",{type:"text",value:u,onChange:C,onFocus:E,onBlur:I,placeholder:l,disabled:i,className:f("w-full pl-8 pr-3 py-2 text-sm","bg-white dark:bg-gray-900","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","disabled:opacity-50 disabled:cursor-not-allowed")})]})]}),(c!==void 0||d!==void 0)&&t.jsx("p",{className:"mt-1.5 text-xs text-gray-600 dark:text-gray-400",children:c!==void 0&&d!==void 0?`Range: ${w.symbol}${N(c)} - ${w.symbol}${N(d)}`:c!==void 0?`Minimum: ${w.symbol}${N(c)}`:`Maximum: ${w.symbol}${N(d)}`}),v&&t.jsx("div",{className:"fixed inset-0 z-40",onClick:()=>k(!1)})]})},Qs=({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":"UcurrencyUconverter",children:r||"UcurrencyUconverter Component"}),Rs=({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":"UcurrencyUrates",children:r||"UcurrencyUrates Component"}),el=({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":"UformUbuilder",children:r||"UformUbuilder Component"}),rl=({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":"UformUvalidator",children:r||"UformUvalidator Component"}),tl=({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":"UformUtemplate",children:r||"UformUtemplate Component"}),al=({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":"UschemaUvalidator",children:r||"UschemaUvalidator Component"}),nl=({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":"UfieldUmapper",children:r||"UfieldUmapper Component"}),ol=({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":"UsurveyUbuilder",children:r||"UsurveyUbuilder Component"}),sl=({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":"QuizBuilder",children:r||"QuizBuilder Component"}),ll=(e,r,a)=>{if(a)return`${a}/address/${e}`;if(!r)return null;if(r<0)return`https://explorer.solana.com/address/${e}${r===-101?"":r===-102?"?cluster=devnet":"?cluster=testnet"}`;const o={1:"https://etherscan.io",11155111:"https://sepolia.etherscan.io",5:"https://goerli.etherscan.io",137:"https://polygonscan.com",80002:"https://amoy.polygonscan.com",42161:"https://arbiscan.io",421614:"https://sepolia.arbiscan.io",10:"https://optimistic.etherscan.io",11155420:"https://sepolia-optimism.etherscan.io",8453:"https://basescan.org",84532:"https://sepolia.basescan.org"}[r];return o?`${o}/address/${e}`:null},il=(e,r)=>r==="full"?e:r==="medium"?`${e.substring(0,10)}...${e.substring(e.length-8)}`:`${e.substring(0,6)}...${e.substring(e.length-4)}`,cl=({address:e,chainId:r,explorerUrl:a,label:n,format:o="short",showCopy:s=!0,showExplorer:l=!0,className:c="",textClassName:d=""})=>{const[i,h]=p.useState(!1),u=il(e,o),y=ll(e,r,a),m=async()=>{try{await navigator.clipboard.writeText(e),h(!0),setTimeout(()=>h(!1),2e3)}catch{}};return t.jsxs("div",{className:f("flex items-center gap-2",c),children:[n&&t.jsxs("span",{className:D.label.default(),children:[n,":"]}),t.jsx("span",{className:f("font-mono text-sm",o==="full"&&"break-all",d),children:u}),t.jsxs("div",{className:"flex items-center gap-1",children:[s&&t.jsx("button",{onClick:m,className:f("p-1 rounded hover:bg-gray-100 dark:hover:bg-gray-800 transition-colors","text-gray-500 hover:text-gray-700 dark:text-gray-400 dark:hover:text-gray-200"),title:i?"Copied!":"Copy address","aria-label":"Copy address",children:i?t.jsx("svg",{className:"w-4 h-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:t.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M5 13l4 4L19 7"})}):t.jsx("svg",{className:"w-4 h-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:t.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M8 16H6a2 2 0 01-2-2V6a2 2 0 012-2h8a2 2 0 012 2v2m-6 12h8a2 2 0 002-2v-8a2 2 0 00-2-2h-8a2 2 0 00-2 2v8a2 2 0 002 2z"})})}),l&&y&&t.jsx("a",{href:y,target:"_blank",rel:"noopener noreferrer",className:f("p-1 rounded hover:bg-gray-100 dark:hover:bg-gray-800 transition-colors","text-gray-500 hover:text-blue-600 dark:text-gray-400 dark:hover:text-blue-400"),title:"View on block explorer","aria-label":"View on block explorer",children:t.jsx("svg",{className:"w-4 h-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:t.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M10 6H6a2 2 0 00-2 2v10a2 2 0 002 2h10a2 2 0 002-2v-4M14 4h6m0 0v6m0-6L10 14"})})})]})]})},Zt=()=>typeof document<"u"&&typeof document.createElement=="function"&&typeof document.getElementById=="function",dl=e=>{if(typeof document<"u"&&document.getElementById)try{return document.getElementById(e)}catch{}return null},gl=e=>{if(typeof document<"u"&&document.createElement)try{return document.createElement(e)}catch{}return null},ul=e=>{const r=typeof document<"u"?document.head:null;if(r&&e)try{return r.appendChild(e),!0}catch{}return!1},or=({animation:e="fade-in-up",delay:r=0,duration:a=600,once:n=!0,children:o,className:s="",threshold:l=.1})=>{const[c,d]=p.useState(!1),[i,h]=p.useState(!1),u=p.useRef(null);p.useEffect(()=>{if(!Zt()||typeof IntersectionObserver>"u"){d(!0),n&&h(!0);return}const m=new IntersectionObserver(([v])=>{v.isIntersecting&&(!i||!n)?(d(!0),n&&h(!0)):n||d(!1)},{threshold:l}),b=u.current;return b&&m.observe(b),()=>{b&&m.unobserve(b)}},[l,n,i]);const y=()=>{if(e==="none")return"";const m=`transition-all duration-${a} ease-out`,b=r>0?`delay-${r}`:"",v={"fade-in-up":c?`opacity-100 translate-y-0 ${m} ${b}`:`opacity-0 translate-y-8 ${m} ${b}`,"fade-in-scale":c?`opacity-100 scale-100 ${m} ${b}`:`opacity-0 scale-95 ${m} ${b}`,"fade-in-left":c?`opacity-100 translate-x-0 ${m} ${b}`:`opacity-0 -translate-x-8 ${m} ${b}`,"fade-in-right":c?`opacity-100 translate-x-0 ${m} ${b}`:`opacity-0 translate-x-8 ${m} ${b}`,"slide-in-bottom":c?`translate-y-0 ${m} ${b}`:`translate-y-full ${m} ${b}`,"zoom-in":c?`opacity-100 scale-100 ${m} ${b}`:`opacity-0 scale-50 ${m} ${b}`,float:"animate-float","bounce-slow":"animate-bounce-slow"};return v[e]||v["fade-in-up"]};return p.useEffect(()=>{if(Zt()&&(e==="float"||e==="bounce-slow")){const m="animated-section-keyframes";if(!dl(m)){const b=gl("style");b&&(b.id=m,b.textContent=`
38
+ ${n?"border-red-300 focus:ring-red-500 focus:border-red-500":"border-gray-300 dark:border-gray-600"}
39
+ `,children:[i&&e.jsx("option",{value:"",disabled:!0,children:i}),o.map(h=>e.jsx("option",{value:h.value,disabled:h.disabled,children:h.label},h.value))]})}),Ko=({successMessage:t,errorMessage:r,successTitle:a="Success",errorTitle:o="Error",autoDismissDelay:s=0,onSuccessDismiss:n,className:l=""})=>(b.useEffect(()=>{if(t&&s>0&&n){const i=setTimeout(()=>{n()},s);return()=>clearTimeout(i)}},[t,s,n]),!t&&!r?null:e.jsxs("div",{className:`space-y-3 ${l}`,children:[r&&e.jsx(qe,{variant:"error",title:o,description:r}),t&&e.jsx(qe,{variant:"success",title:a,description:t})]})),Yo=({className:t,children:r,disabled:a})=>e.jsx("div",{className:u("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",t),role:"region","aria-label":"PhoneDirectory",children:r||"PhoneDirectory Component"}),Dr=W.cva("min-h-[44px] touch-manipulation",{variants:{variant:{default:"",primary:"",secondary:"",outline:"",ghost:"",destructive:"","destructive-outline":"",success:"",link:"",gradient:"","gradient-secondary":"","gradient-success":"",wallet:"",connect:"",disconnect:""},size:{default:"",sm:"h-8",lg:"h-12",icon:"h-10 w-10 p-0"},animation:{none:"transition-colors duration-200",hover:"transition-all duration-200 hover:scale-105",lift:"transition-all duration-200 hover:scale-105",scale:"transition-transform duration-200 hover:scale-95",glow:"transition-all duration-200 hover:shadow-lg",shimmer:"transition-all duration-200",tap:"transition-transform duration-100 active:scale-95",connect:"transition-all duration-200 hover:scale-105",transaction:"transition-all duration-200 animate-pulse",disconnect:"transition-all duration-200 hover:opacity-80"}},defaultVariants:{variant:"default",size:"default",animation:"hover"}}),G=V.forwardRef(({className:t,variant:r,size:a,animation:o,asChild:s=!1,onTrack:n,trackingLabel:l,componentName:i,onClick:g,children:c,...h},f)=>{const v=s?aa.Slot:"button",p=r||"default",m=a&&a!=="default"&&a!=="icon"?a:void 0,y=S=>S?{sm:"small",lg:"large",default:"default"}[S]||S:"default",N=(()=>{if(p.startsWith("gradient")){const S=p.replace("gradient-","").replace("gradient","primary");return T.variants.button.gradient[S]?.()||T.variants.button.primary.default()}else{if(["wallet","connect","disconnect"].includes(p))return T.variants.button.web3[p]?.()||T.variants.button.primary.default();{const S=y(m);return T.variants.button[p]?.[S]?.()||T.variants.button.primary.default()}}})(),k=S=>{n&&n({action:"click",trackingLabel:l,componentName:i}),g?.(S)};return e.jsx(v,{className:u(Dr({size:a,animation:o}),N,t),ref:f,onClick:k,...h,children:c})});G.displayName="Button";const Qo=({children:t,isLoading:r=!1,loadingText:a="Loading...",showSpinner:o=!0,disabled:s,...n})=>e.jsx(G,{...n,disabled:s||r,className:n.className,children:r?e.jsxs("span",{className:"flex items-center gap-2",children:[o&&e.jsx(le,{size:"small"}),e.jsx("span",{children:a})]}):t}),Br=({value:t,onChange:r,minDate:a,maxDate:o,disabledDates:s=[],showOutsideDays:n=!0,className:l})=>{const[i,g]=b.useState(t||new Date),c=w=>{const C=w.getFullYear(),E=w.getMonth();return new Date(C,E+1,0).getDate()},h=w=>{const C=w.getFullYear(),E=w.getMonth();return new Date(C,E,1).getDay()},f=(w,C)=>w.getFullYear()===C.getFullYear()&&w.getMonth()===C.getMonth()&&w.getDate()===C.getDate(),v=w=>a&&w<a||o&&w>o?!0:s.some(C=>f(w,C)),p=()=>{g(new Date(i.getFullYear(),i.getMonth()-1))},m=()=>{g(new Date(i.getFullYear(),i.getMonth()+1))},x=(()=>{const w=i.getFullYear(),C=i.getMonth(),E=c(i),M=h(i),L=[];if(n){const I=c(new Date(w,C-1));for(let U=M-1;U>=0;U--)L.push(new Date(w,C-1,I-U))}else for(let I=0;I<M;I++)L.push(null);for(let I=1;I<=E;I++)L.push(new Date(w,C,I));if(n){const I=42-L.length;for(let U=1;U<=I;U++)L.push(new Date(w,C+1,U))}return L})(),N=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],k=w=>{!w||v(w)||r(w)},S=i.toLocaleDateString("en-US",{month:"long",year:"numeric"});return e.jsxs("div",{className:u("bg-white dark:bg-gray-900 rounded-lg p-4",l),children:[e.jsxs("div",{className:"flex items-center justify-between mb-4",children:[e.jsx("button",{onClick:p,className:"p-2 hover:bg-gray-100 dark:hover:bg-gray-800 rounded-md transition-colors","aria-label":"Previous month",children:e.jsx("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M15 19l-7-7 7-7"})})}),e.jsx("h2",{className:"text-base font-semibold text-gray-900 dark:text-white",children:S}),e.jsx("button",{onClick:m,className:"p-2 hover:bg-gray-100 dark:hover:bg-gray-800 rounded-md transition-colors","aria-label":"Next month",children:e.jsx("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 5l7 7-7 7"})})})]}),e.jsx("div",{className:"grid grid-cols-7 gap-1 mb-2",children:N.map(w=>e.jsx("div",{className:"text-center text-xs font-medium text-gray-600 dark:text-gray-400 py-2",children:w},w))}),e.jsx("div",{className:"grid grid-cols-7 gap-1",children:x.map((w,C)=>{if(!w)return e.jsx("div",{className:"aspect-square"},C);const E=w.getMonth()===i.getMonth(),M=t&&f(w,t),L=f(w,new Date),I=v(w);return e.jsx("button",{onClick:()=>k(w),disabled:I,className:u("aspect-square flex items-center justify-center rounded-md text-sm transition-colors","hover:bg-gray-100 dark:hover:bg-gray-800","disabled:opacity-40 disabled:cursor-not-allowed disabled:hover:bg-transparent",E?"text-gray-900 dark:text-white":"text-gray-400 dark:text-gray-600",M&&"bg-blue-600 text-white hover:bg-blue-700 dark:bg-blue-500 dark:hover:bg-blue-600",L&&!M&&"border-2 border-blue-600 dark:border-blue-400"),children:w.getDate()},C)})})]})},Xo=({value:t,onChange:r,use12Hour:a=!1,minuteStep:o=1,minDate:s,maxDate:n,disabled:l=!1,className:i})=>{const[g,c]=b.useState(!1),[h,f]=b.useState(t),v=x=>{const N=x.toLocaleDateString("en-US",{month:"short",day:"numeric",year:"numeric"}),k=x.getHours(),S=x.getMinutes();if(a){const w=k===0?12:k>12?k-12:k,C=k>=12?"PM":"AM";return`${N}, ${w}:${S.toString().padStart(2,"0")} ${C}`}return`${N}, ${k.toString().padStart(2,"0")}:${S.toString().padStart(2,"0")}`},p=x=>{const N=new Date(x);N.setHours(h.getHours()),N.setMinutes(h.getMinutes()),f(N),r(N)},m=x=>{const[N,k]=x.split(":").map(Number),S=new Date(h);S.setHours(N),S.setMinutes(k),f(S),r(S)},y=x=>{const N=x.getHours(),k=x.getMinutes();return`${N.toString().padStart(2,"0")}:${k.toString().padStart(2,"0")}`};return e.jsxs("div",{className:u("relative w-full",i),children:[e.jsxs("button",{type:"button",onClick:()=>!l&&c(!g),disabled:l,className:u("w-full px-3 py-2 text-sm text-left flex items-center justify-between","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",g&&"ring-2 ring-blue-500 dark:ring-blue-400"),children:[e.jsx("span",{className:"text-gray-900 dark:text-white",children:v(t)}),e.jsx("svg",{className:"w-5 h-5 text-gray-600 dark:text-gray-400",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M8 7V3m8 4V3m-9 8h10M5 21h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v12a2 2 0 002 2z"})})]}),g&&e.jsx("div",{className:"absolute top-full left-0 mt-1 bg-white dark:bg-gray-900 border border-gray-300 dark:border-gray-700 rounded-md shadow-lg z-50 p-3",children:e.jsxs("div",{className:"space-y-3",children:[e.jsxs("div",{children:[e.jsx("label",{className:"block text-xs font-medium text-gray-700 dark:text-gray-300 mb-2",children:"Select Date"}),e.jsx(Br,{value:h,onChange:p,minDate:s,maxDate:n})]}),e.jsx("div",{className:"h-px bg-gray-200 dark:bg-gray-700"}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-xs font-medium text-gray-700 dark:text-gray-300 mb-2",children:"Select Time"}),e.jsx(Tr,{value:y(h),onChange:m,use12Hour:a,minuteStep:o})]}),e.jsxs("div",{className:"flex gap-2 pt-2",children:[e.jsx("button",{onClick:()=>c(!1),className:u("flex-1 px-3 py-1.5 text-sm","bg-gray-100 dark:bg-gray-800","text-gray-700 dark:text-gray-300","rounded-md","hover:bg-gray-200 dark:hover:bg-gray-700","transition-colors"),children:"Cancel"}),e.jsx("button",{onClick:()=>{r(h),c(!1)},className:u("flex-1 px-3 py-1.5 text-sm","bg-blue-600 dark:bg-blue-500","text-white","rounded-md","hover:bg-blue-700 dark:hover:bg-blue-600","transition-colors"),children:"OK"})]})]})}),g&&e.jsx("div",{className:"fixed inset-0 z-40",onClick:()=>c(!1)})]})},Jo=({value:t,onChange:r,minDate:a,maxDate:o,disabledDates:s=[],months:n=2,className:l})=>{const[i,g]=b.useState(new Date),[c,h]=b.useState(null),f=(M,L)=>M.getFullYear()===L.getFullYear()&&M.getMonth()===L.getMonth()&&M.getDate()===L.getDate(),v=M=>a&&M<a||o&&M>o?!0:s.some(L=>f(M,L)),p=M=>{if(!t.start||!t.end&&!c)return!1;const L=t.end||c;return L?M>t.start&&M<L:!1},m=M=>t.start?f(M,t.start):!1,y=M=>t.end?f(M,t.end):!1,x=M=>{v(M)||(!t.start||t.start&&t.end?r({start:M,end:null}):M<t.start?r({start:M,end:t.start}):r({start:t.start,end:M}))},N=M=>{const L=M.getFullYear(),I=M.getMonth();return new Date(L,I+1,0).getDate()},k=M=>{const L=M.getFullYear(),I=M.getMonth();return new Date(L,I,1).getDay()},S=M=>{const L=new Date(i.getFullYear(),i.getMonth()+M),I=L.getFullYear(),U=L.getMonth(),P=N(L),A=k(L),D=[];for(let $=0;$<A;$++)D.push(null);for(let $=1;$<=P;$++)D.push(new Date(I,U,$));return{days:D,monthName:L.toLocaleDateString("en-US",{month:"long",year:"numeric"})}},w=()=>{g(new Date(i.getFullYear(),i.getMonth()-1))},C=()=>{g(new Date(i.getFullYear(),i.getMonth()+1))},E=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"];return e.jsxs("div",{className:u("bg-white dark:bg-gray-900 rounded-lg p-4",l),children:[e.jsxs("div",{className:"flex items-center justify-between mb-4",children:[e.jsx("button",{onClick:w,className:"p-2 hover:bg-gray-100 dark:hover:bg-gray-800 rounded-md transition-colors","aria-label":"Previous month",children:e.jsx("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M15 19l-7-7 7-7"})})}),e.jsx("button",{onClick:C,className:"p-2 hover:bg-gray-100 dark:hover:bg-gray-800 rounded-md transition-colors","aria-label":"Next month",children:e.jsx("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 5l7 7-7 7"})})})]}),e.jsx("div",{className:"grid gap-4",style:{gridTemplateColumns:`repeat(${n}, 1fr)`},children:Array.from({length:n},(M,L)=>{const{days:I,monthName:U}=S(L);return e.jsxs("div",{children:[e.jsx("h3",{className:"text-base font-semibold text-gray-900 dark:text-white mb-4 text-center",children:U}),e.jsx("div",{className:"grid grid-cols-7 gap-1 mb-2",children:E.map(P=>e.jsx("div",{className:"text-center text-xs font-medium text-gray-600 dark:text-gray-400 py-2",children:P},P))}),e.jsx("div",{className:"grid grid-cols-7 gap-1",children:I.map((P,A)=>{if(!P)return e.jsx("div",{className:"aspect-square"},A);const D=v(P),$=m(P),B=y(P),j=p(P),_=f(P,new Date);return e.jsx("button",{onClick:()=>x(P),onMouseEnter:()=>h(P),onMouseLeave:()=>h(null),disabled:D,className:u("aspect-square flex items-center justify-center rounded-md text-sm transition-colors relative","disabled:opacity-40 disabled:cursor-not-allowed disabled:hover:bg-transparent",j&&"bg-blue-100 dark:bg-blue-900/30",($||B)&&"bg-blue-600 text-white hover:bg-blue-700 dark:bg-blue-500 dark:hover:bg-blue-600",!$&&!B&&!j&&"hover:bg-gray-100 dark:hover:bg-gray-800",_&&!$&&!B&&"border-2 border-blue-600 dark:border-blue-400"),children:P.getDate()},A)})})]},L)})}),(t.start||t.end)&&e.jsx("div",{className:"mt-4 pt-4 border-t border-gray-200 dark:border-gray-700",children:e.jsxs("div",{className:"flex items-center justify-between text-sm",children:[e.jsxs("div",{children:[e.jsx("span",{className:"text-gray-600 dark:text-gray-400",children:"Start: "}),e.jsx("span",{className:"font-medium text-gray-900 dark:text-white",children:t.start?.toLocaleDateString()||"Not selected"})]}),e.jsxs("div",{children:[e.jsx("span",{className:"text-gray-600 dark:text-gray-400",children:"End: "}),e.jsx("span",{className:"font-medium text-gray-900 dark:text-white",children:t.end?.toLocaleDateString()||"Not selected"})]})]})})]})},Zo=({className:t,children:r,disabled:a=!1,onClick:o})=>e.jsx("div",{className:u("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",t),onClick:a?void 0:o,role:"region","aria-label":"UtimeUslotUpicker",children:r||"UtimeUslotUpicker Component"}),Ro=({value:t,onChange:r,presets:a=["#000000","#FFFFFF","#FF6B6B","#4ECDC4","#45B7D1","#FFA07A","#F7DC6F","#BB8FCE","#85C1E2","#F8B500","#52B788","#E63946","#1D3557","#457B9D","#A8DADC","#F4A261","#264653","#2A9D8F"],showInput:o=!0,showOpacity:s=!1,className:n})=>{const[l,i]=b.useState(t),[g,c]=b.useState(100),h=y=>{r(y),i(y)},f=y=>{const x=y.target.value;i(x),/^#[0-9A-F]{6}$/i.test(x)&&r(x)},v=y=>{c(Number(y.target.value))},m=s?((y,x)=>{const N=parseInt(y.slice(1,3),16),k=parseInt(y.slice(3,5),16),S=parseInt(y.slice(5,7),16);return`rgba(${N}, ${k}, ${S}, ${x/100})`})(t,g):t;return e.jsxs("div",{className:u("bg-white dark:bg-gray-900 rounded-lg p-4",n),children:[e.jsx("div",{className:"mb-4",children:e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:"w-16 h-16 rounded-lg border-2 border-gray-200 dark:border-gray-700 shadow-sm",style:{backgroundColor:m}}),e.jsxs("div",{className:"flex-1",children:[e.jsx("p",{className:"text-sm font-medium text-gray-900 dark:text-white",children:"Selected Color"}),e.jsxs("p",{className:"text-xs text-gray-600 dark:text-gray-400 mt-1 font-mono",children:[t,s&&` (${g}%)`]})]})]})}),e.jsxs("div",{className:"mb-4",children:[e.jsx("p",{className:"text-sm font-medium text-gray-700 dark:text-gray-300 mb-2",children:"Preset Colors"}),e.jsx("div",{className:"grid grid-cols-6 gap-2",children:a.map(y=>e.jsx("button",{onClick:()=>h(y),className:u("w-full aspect-square rounded-md border-2 transition-all hover:scale-110",y===t?"border-blue-500 dark:border-blue-400 ring-2 ring-blue-200 dark:ring-blue-800":"border-gray-200 dark:border-gray-700"),style:{backgroundColor:y},"aria-label":`Select color ${y}`},y))})]}),o&&e.jsxs("div",{className:"mb-4",children:[e.jsx("label",{className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-2",children:"Custom Color (Hex)"}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx("input",{type:"text",value:l,onChange:f,placeholder:"#000000",className:"flex-1 px-3 py-2 text-sm font-mono bg-white 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"}),e.jsx("input",{type:"color",value:t,onChange:y=>h(y.target.value),className:"w-12 h-10 rounded-md cursor-pointer"})]})]}),s&&e.jsxs("div",{children:[e.jsxs("label",{className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-2",children:["Opacity: ",g,"%"]}),e.jsx("input",{type:"range",min:"0",max:"100",value:g,onChange:v,className:"w-full h-2 bg-gray-200 dark:bg-gray-700 rounded-lg appearance-none cursor-pointer"})]})]})},es=({value:t,onChange:r,presets:a,className:o})=>{const n=a||["#000000","#ffffff","#ff0000","#00ff00","#0000ff","#ffff00","#ff00ff","#00ffff"];return e.jsxs("div",{className:u("space-y-3",o),children:[e.jsx("input",{type:"color",value:t,onChange:l=>r(l.target.value),className:"w-full h-12 rounded cursor-pointer"}),e.jsx("div",{className:"grid grid-cols-8 gap-2",children:n.map(l=>e.jsx("button",{onClick:()=>r(l),className:u("w-8 h-8 rounded border-2",t===l?"border-blue-500":"border-transparent"),style:{backgroundColor:l}},l))})]})},rs=({colors:t,selectedColor:r,onColorSelect:a,size:o="md",showNames:s=!1,showCopy:n=!1,className:l})=>{const[i,g]=b.useState(null),c={sm:"w-8 h-8",md:"w-12 h-12",lg:"w-16 h-16"},h=()=>t.map(p=>typeof p=="string"?{hex:p}:p),f=async(p,m)=>{m.stopPropagation(),await navigator.clipboard.writeText(p),g(p),setTimeout(()=>g(null),2e3)},v=h();return e.jsx("div",{className:u("flex flex-wrap gap-3",l),children:v.map((p,m)=>{const y=r===p.hex,x=i===p.hex;return e.jsxs("div",{className:"flex flex-col items-center gap-2",children:[e.jsx("button",{onClick:()=>a?.(p.hex),className:u("rounded-lg transition-all relative group",c[o],y&&"ring-2 ring-blue-500 ring-offset-2 dark:ring-offset-gray-900",!y&&"hover:scale-110"),style:{backgroundColor:p.hex},"aria-label":p.name||p.hex,children:n&&e.jsx("div",{className:"absolute inset-0 flex items-center justify-center opacity-0 group-hover:opacity-100 transition-opacity bg-black/50 rounded-lg",onClick:N=>f(p.hex,N),children:x?e.jsx("svg",{className:"w-4 h-4 text-white",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M5 13l4 4L19 7"})}):e.jsx("svg",{className:"w-4 h-4 text-white",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M8 16H6a2 2 0 01-2-2V6a2 2 0 012-2h8a2 2 0 012 2v2m-6 12h8a2 2 0 002-2v-8a2 2 0 00-2-2h-8a2 2 0 00-2 2v8a2 2 0 002 2z"})})})}),s&&e.jsxs("div",{className:"text-center",children:[p.name&&e.jsx("p",{className:"text-xs font-medium text-gray-900 dark:text-white",children:p.name}),e.jsx("p",{className:"text-xs text-gray-600 dark:text-gray-400 font-mono",children:p.hex})]})]},m)})})},ts=({onSave:t,width:r=400,height:a=200,className:o})=>e.jsxs("div",{className:u("border border-gray-300 dark:border-gray-700 rounded-lg",o),children:[e.jsx("canvas",{width:r,height:a,className:"bg-white dark:bg-gray-900"}),e.jsxs("div",{className:"flex gap-2 p-2",children:[e.jsx("button",{className:"px-3 py-1 bg-blue-500 text-white rounded hover:bg-blue-600",children:"Clear"}),e.jsx("button",{onClick:()=>t?.(""),className:"px-3 py-1 bg-green-500 text-white rounded hover:bg-green-600",children:"Save"})]})]}),as=({className:t,children:r,disabled:a})=>e.jsx("div",{className:u("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",t),role:"region","aria-label":"SignatureRequest",children:r||"SignatureRequest Component"}),os=({value:t,onChange:r,placeholder:a,className:o})=>e.jsxs("div",{className:u("border border-gray-300 dark:border-gray-700 rounded-lg",o),children:[e.jsx("div",{className:"flex gap-1 p-2 border-b border-gray-300 dark:border-gray-700",children:["B","I","U","H1","H2","List","Link"].map(s=>e.jsx("button",{className:"px-3 py-1 hover:bg-gray-100 dark:hover:bg-gray-800 rounded text-sm font-semibold",children:s},s))}),e.jsx("textarea",{value:t,onChange:s=>r(s.target.value),placeholder:a,className:"w-full p-4 bg-white dark:bg-gray-900 text-gray-900 dark:text-white resize-none focus:outline-none",rows:10})]}),ss=({className:t,children:r,disabled:a=!1,onClick:o})=>e.jsx("div",{className:u("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",t),onClick:a?void 0:o,role:"region","aria-label":"UmarkdownUrenderer",children:r||"UmarkdownUrenderer Component"}),ns=({className:t,children:r,disabled:a=!1,onClick:o})=>e.jsx("div",{className:u("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",t),onClick:a?void 0:o,role:"region","aria-label":"UcodeUhighlighter",children:r||"UcodeUhighlighter Component"}),ls=({cardNumber:t,onCardNumberChange:r,expiryDate:a="",onExpiryDateChange:o,cvv:s="",onCVVChange:n,cardholderName:l="",onCardholderNameChange:i,showAllFields:g=!1,disabled:c=!1,className:h})=>{const f=w=>{const C=w.replace(/\s/g,"");return/^4/.test(C)?"visa":/^5[1-5]/.test(C)?"mastercard":/^3[47]/.test(C)?"amex":/^6(?:011|5)/.test(C)?"discover":"unknown"},v=f(t),p=w=>{const C=w.replace(/\D/g,"");if(f(C)==="amex"){const P=C.slice(0,15);return[P.slice(0,4),P.slice(4,10),P.slice(10,15)].filter(Boolean).join(" ")}return(C.slice(0,16).match(/.{1,4}/g)||[]).join(" ")},m=w=>{const M=w.replace(/\D/g,"").slice(0,4);return M.length>=2?`${M.slice(0,2)}/${M.slice(2)}`:M},y=w=>{const C=w.replace(/\D/g,""),E=v==="amex"?4:3;return C.slice(0,E)},x=w=>{const C=p(w.target.value);r(C)},N=w=>{if(!o)return;const C=m(w.target.value);o(C)},k=w=>{if(!n)return;const C=y(w.target.value);n(C)},S=()=>{switch(v){case"visa":return e.jsxs("svg",{className:"w-8 h-5",viewBox:"0 0 48 32",fill:"none",children:[e.jsx("rect",{width:"48",height:"32",rx:"4",fill:"#1434CB"}),e.jsx("path",{d:"M20 11l-2 10h2l2-10h-2zm8 0l-3.5 7-1.5-7h-2l2.5 10h2l5.5-10h-3zm-12 0c-1.5 0-2.5.5-2.5 1.5 0 1.5 3 1.5 3 3.5s-2.5 2-4 2l-.5-2c1 0 2-.5 2-1.5s-3-1.5-3-3.5 2.5-2 4-2l.5 2z",fill:"white"})]});case"mastercard":return e.jsxs("svg",{className:"w-8 h-5",viewBox:"0 0 48 32",fill:"none",children:[e.jsx("rect",{width:"48",height:"32",rx:"4",fill:"#EB001B"}),e.jsx("circle",{cx:"18",cy:"16",r:"8",fill:"#F79E1B"}),e.jsx("circle",{cx:"30",cy:"16",r:"8",fill:"#FF5F00"})]});case"amex":return e.jsxs("svg",{className:"w-8 h-5",viewBox:"0 0 48 32",fill:"none",children:[e.jsx("rect",{width:"48",height:"32",rx:"4",fill:"#006FCF"}),e.jsx("path",{d:"M10 12h8l2 8-2 8h-8l-2-8 2-8z",fill:"white"})]});case"discover":return e.jsxs("svg",{className:"w-8 h-5",viewBox:"0 0 48 32",fill:"none",children:[e.jsx("rect",{width:"48",height:"32",rx:"4",fill:"#FF6000"}),e.jsx("circle",{cx:"38",cy:"16",r:"6",fill:"#FFA500"})]});default:return e.jsx("svg",{className:"w-5 h-5 text-gray-400",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M3 10h18M7 15h1m4 0h1m-7 4h12a3 3 0 003-3V8a3 3 0 00-3-3H6a3 3 0 00-3 3v8a3 3 0 003 3z"})})}};return e.jsxs("div",{className:u("w-full space-y-3",h),children:[e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-1",children:"Card number"}),e.jsxs("div",{className:"relative",children:[e.jsx("input",{type:"text",value:t,onChange:x,placeholder:"1234 5678 9012 3456",disabled:c,className:u("w-full px-3 py-2 pr-12 text-sm","bg-white dark:bg-gray-900","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","disabled:opacity-50 disabled:cursor-not-allowed")}),e.jsx("div",{className:"absolute right-3 top-1/2 -translate-y-1/2",children:S()})]})]}),g&&e.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-1",children:"Expiry date"}),e.jsx("input",{type:"text",value:a,onChange:N,placeholder:"MM/YY",disabled:c,className:u("w-full px-3 py-2 text-sm","bg-white dark:bg-gray-900","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","disabled:opacity-50 disabled:cursor-not-allowed")})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-1",children:"CVV"}),e.jsx("input",{type:"text",value:s,onChange:k,placeholder:v==="amex"?"1234":"123",disabled:c,className:u("w-full px-3 py-2 text-sm","bg-white dark:bg-gray-900","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","disabled:opacity-50 disabled:cursor-not-allowed")})]})]}),g&&e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-1",children:"Cardholder name"}),e.jsx("input",{type:"text",value:l,onChange:w=>i?.(w.target.value),placeholder:"John Doe",disabled:c,className:u("w-full px-3 py-2 text-sm","bg-white dark:bg-gray-900","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","disabled:opacity-50 disabled:cursor-not-allowed")})]})]})},jr=[{code:"USD",symbol:"$",name:"US Dollar",decimals:2},{code:"EUR",symbol:"€",name:"Euro",decimals:2},{code:"GBP",symbol:"£",name:"British Pound",decimals:2},{code:"JPY",symbol:"¥",name:"Japanese Yen",decimals:0},{code:"CNY",symbol:"¥",name:"Chinese Yuan",decimals:2},{code:"AUD",symbol:"A$",name:"Australian Dollar",decimals:2},{code:"CAD",symbol:"C$",name:"Canadian Dollar",decimals:2},{code:"CHF",symbol:"Fr",name:"Swiss Franc",decimals:2},{code:"INR",symbol:"₹",name:"Indian Rupee",decimals:2},{code:"BRL",symbol:"R$",name:"Brazilian Real",decimals:2}],is=({value:t,onChange:r,currency:a="USD",onCurrencyChange:o,currencies:s=jr,showCurrencySelector:n=!1,placeholder:l="0.00",min:i,max:g,disabled:c=!1,className:h})=>{const[f,v]=b.useState(""),[p,m]=b.useState(!1),[y,x]=b.useState(!1),k=typeof a=="string"?s.find(L=>L.code===a)||jr[0]:a,S=b.useCallback(L=>{const I=k.decimals??2;return L.toLocaleString("en-US",{minimumFractionDigits:I,maximumFractionDigits:I})},[k]);b.useEffect(()=>{p||v(S(t||0))},[t,S,p]);const w=L=>{const U=L.target.value.replace(/[^\d.]/g,""),P=U.split("."),A=P.length>2?`${P[0]}.${P.slice(1).join("")}`:U;v(A);let $=parseFloat(A)||0;i!==void 0&&$<i&&($=i),g!==void 0&&$>g&&($=g),r($)},C=()=>{m(!0),v(t?t.toString():"")},E=()=>{m(!1),v(S(t||0))},M=L=>{o?.(L),x(!1)};return e.jsxs("div",{className:u("relative w-full",h),children:[e.jsxs("div",{className:"flex gap-2",children:[n&&e.jsxs("div",{className:"relative",children:[e.jsxs("button",{type:"button",onClick:()=>!c&&x(!y),disabled:c,className:u("flex items-center gap-2 px-3 py-2 min-w-[100px]","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",y&&"ring-2 ring-blue-500 dark:ring-blue-400"),children:[e.jsx("span",{className:"text-sm font-medium text-gray-900 dark:text-white",children:k.code}),e.jsx("svg",{className:u("w-4 h-4 text-gray-600 dark:text-gray-400 transition-transform",y&&"rotate-180"),fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 9l-7 7-7-7"})})]}),y&&e.jsx("div",{className:"absolute top-full left-0 mt-1 w-64 bg-white dark:bg-gray-900 border border-gray-300 dark:border-gray-700 rounded-md shadow-lg z-50",children:e.jsx("div",{className:"max-h-60 overflow-y-auto py-1",children:s.map(L=>e.jsxs("button",{onClick:()=>M(L.code),className:u("w-full px-3 py-2 text-left flex items-center gap-3","hover:bg-gray-100 dark:hover:bg-gray-800","transition-colors",L.code===k.code&&"bg-blue-50 dark:bg-blue-900/30"),children:[e.jsx("span",{className:"text-lg font-semibold w-8",children:L.symbol}),e.jsxs("div",{className:"flex-1",children:[e.jsx("p",{className:"text-sm font-medium text-gray-900 dark:text-white",children:L.code}),e.jsx("p",{className:"text-xs text-gray-600 dark:text-gray-400",children:L.name})]})]},L.code))})})]}),e.jsxs("div",{className:"relative flex-1",children:[e.jsx("div",{className:"absolute left-3 top-1/2 -translate-y-1/2 text-gray-600 dark:text-gray-400 text-sm font-medium",children:k.symbol}),e.jsx("input",{type:"text",value:f,onChange:w,onFocus:C,onBlur:E,placeholder:l,disabled:c,className:u("w-full pl-8 pr-3 py-2 text-sm","bg-white dark:bg-gray-900","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","disabled:opacity-50 disabled:cursor-not-allowed")})]})]}),(i!==void 0||g!==void 0)&&e.jsx("p",{className:"mt-1.5 text-xs text-gray-600 dark:text-gray-400",children:i!==void 0&&g!==void 0?`Range: ${k.symbol}${S(i)} - ${k.symbol}${S(g)}`:i!==void 0?`Minimum: ${k.symbol}${S(i)}`:`Maximum: ${k.symbol}${S(g)}`}),y&&e.jsx("div",{className:"fixed inset-0 z-40",onClick:()=>x(!1)})]})},cs=({className:t,children:r,disabled:a=!1,onClick:o})=>e.jsx("div",{className:u("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",t),onClick:a?void 0:o,role:"region","aria-label":"UcurrencyUconverter",children:r||"UcurrencyUconverter Component"}),ds=({className:t,children:r,disabled:a=!1,onClick:o})=>e.jsx("div",{className:u("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",t),onClick:a?void 0:o,role:"region","aria-label":"UcurrencyUrates",children:r||"UcurrencyUrates Component"}),gs=({className:t,children:r,disabled:a=!1,onClick:o})=>e.jsx("div",{className:u("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",t),onClick:a?void 0:o,role:"region","aria-label":"UformUbuilder",children:r||"UformUbuilder Component"}),us=({className:t,children:r,disabled:a=!1,onClick:o})=>e.jsx("div",{className:u("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",t),onClick:a?void 0:o,role:"region","aria-label":"UformUvalidator",children:r||"UformUvalidator Component"}),hs=({className:t,children:r,disabled:a=!1,onClick:o})=>e.jsx("div",{className:u("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",t),onClick:a?void 0:o,role:"region","aria-label":"UformUtemplate",children:r||"UformUtemplate Component"}),fs=({className:t,children:r,disabled:a=!1,onClick:o})=>e.jsx("div",{className:u("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",t),onClick:a?void 0:o,role:"region","aria-label":"UschemaUvalidator",children:r||"UschemaUvalidator Component"}),bs=({className:t,children:r,disabled:a=!1,onClick:o})=>e.jsx("div",{className:u("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",t),onClick:a?void 0:o,role:"region","aria-label":"UfieldUmapper",children:r||"UfieldUmapper Component"}),ms=({className:t,children:r,disabled:a=!1,onClick:o})=>e.jsx("div",{className:u("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",t),onClick:a?void 0:o,role:"region","aria-label":"UsurveyUbuilder",children:r||"UsurveyUbuilder Component"}),ps=({className:t,children:r,disabled:a})=>e.jsx("div",{className:u("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",t),role:"region","aria-label":"QuizBuilder",children:r||"QuizBuilder Component"}),ys=(t,r,a)=>{if(a)return`${a}/address/${t}`;if(!r)return null;if(r<0)return`https://explorer.solana.com/address/${t}${r===-101?"":r===-102?"?cluster=devnet":"?cluster=testnet"}`;const s={1:"https://etherscan.io",11155111:"https://sepolia.etherscan.io",5:"https://goerli.etherscan.io",137:"https://polygonscan.com",80002:"https://amoy.polygonscan.com",42161:"https://arbiscan.io",421614:"https://sepolia.arbiscan.io",10:"https://optimistic.etherscan.io",11155420:"https://sepolia-optimism.etherscan.io",8453:"https://basescan.org",84532:"https://sepolia.basescan.org"}[r];return s?`${s}/address/${t}`:null},vs=(t,r)=>r==="full"?t:r==="medium"?`${t.substring(0,10)}...${t.substring(t.length-8)}`:`${t.substring(0,6)}...${t.substring(t.length-4)}`,xs=({address:t,chainId:r,explorerUrl:a,label:o,format:s="short",showCopy:n=!0,showExplorer:l=!0,className:i="",textClassName:g=""})=>{const[c,h]=b.useState(!1),f=vs(t,s),v=ys(t,r,a),p=async()=>{try{await navigator.clipboard.writeText(t),h(!0),setTimeout(()=>h(!1),2e3)}catch{}};return e.jsxs("div",{className:u("flex items-center gap-2",i),children:[o&&e.jsxs("span",{className:T.textVariants.label.default(),children:[o,":"]}),e.jsx("span",{className:u("font-mono text-sm",s==="full"&&"break-all",g),children:f}),e.jsxs("div",{className:"flex items-center gap-1",children:[n&&e.jsx("button",{onClick:p,className:u("p-1 rounded hover:bg-gray-100 dark:hover:bg-gray-800 transition-colors","text-gray-500 hover:text-gray-700 dark:text-gray-400 dark:hover:text-gray-200"),title:c?"Copied!":"Copy address","aria-label":"Copy address",children:c?e.jsx("svg",{className:"w-4 h-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M5 13l4 4L19 7"})}):e.jsx("svg",{className:"w-4 h-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M8 16H6a2 2 0 01-2-2V6a2 2 0 012-2h8a2 2 0 012 2v2m-6 12h8a2 2 0 002-2v-8a2 2 0 00-2-2h-8a2 2 0 00-2 2v8a2 2 0 002 2z"})})}),l&&v&&e.jsx("a",{href:v,target:"_blank",rel:"noopener noreferrer",className:u("p-1 rounded hover:bg-gray-100 dark:hover:bg-gray-800 transition-colors","text-gray-500 hover:text-blue-600 dark:text-gray-400 dark:hover:text-blue-400"),title:"View on block explorer","aria-label":"View on block explorer",children:e.jsx("svg",{className:"w-4 h-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M10 6H6a2 2 0 00-2 2v10a2 2 0 002 2h10a2 2 0 002-2v-4M14 4h6m0 0v6m0-6L10 14"})})})]})]})},Fr=()=>typeof document<"u"&&typeof document.createElement=="function"&&typeof document.getElementById=="function",ks=t=>{if(typeof document<"u"&&document.getElementById)try{return document.getElementById(t)}catch{}return null},ws=t=>{if(typeof document<"u"&&document.createElement)try{return document.createElement(t)}catch{}return null},Cs=t=>{const r=typeof document<"u"?document.head:null;if(r&&t)try{return r.appendChild(t),!0}catch{}return!1},ze=({animation:t="fade-in-up",delay:r=0,duration:a=600,once:o=!0,children:s,className:n="",threshold:l=.1})=>{const[i,g]=b.useState(!1),[c,h]=b.useState(!1),f=b.useRef(null);b.useEffect(()=>{if(!Fr()||typeof IntersectionObserver>"u"){g(!0),o&&h(!0);return}const p=new IntersectionObserver(([y])=>{y.isIntersecting&&(!c||!o)?(g(!0),o&&h(!0)):o||g(!1)},{threshold:l}),m=f.current;return m&&p.observe(m),()=>{m&&p.unobserve(m)}},[l,o,c]);const v=()=>{if(t==="none")return"";const p=`transition-all duration-${a} ease-out`,m=r>0?`delay-${r}`:"",y={"fade-in-up":i?`opacity-100 translate-y-0 ${p} ${m}`:`opacity-0 translate-y-8 ${p} ${m}`,"fade-in-scale":i?`opacity-100 scale-100 ${p} ${m}`:`opacity-0 scale-95 ${p} ${m}`,"fade-in-left":i?`opacity-100 translate-x-0 ${p} ${m}`:`opacity-0 -translate-x-8 ${p} ${m}`,"fade-in-right":i?`opacity-100 translate-x-0 ${p} ${m}`:`opacity-0 translate-x-8 ${p} ${m}`,"slide-in-bottom":i?`translate-y-0 ${p} ${m}`:`translate-y-full ${p} ${m}`,"zoom-in":i?`opacity-100 scale-100 ${p} ${m}`:`opacity-0 scale-50 ${p} ${m}`,float:"animate-float","bounce-slow":"animate-bounce-slow"};return y[t]||y["fade-in-up"]};return b.useEffect(()=>{if(Fr()&&(t==="float"||t==="bounce-slow")){const p="animated-section-keyframes";if(!ks(p)){const m=ws("style");m&&(m.id=p,m.textContent=`
41
40
  @keyframes float {
42
41
  0%, 100% { transform: translateY(0px); }
43
42
  50% { transform: translateY(-20px); }
@@ -52,23 +51,23 @@ Nonce: ${u}`}function a(i,h=24){const u=new Date(i.getTime()+h*60*60*1e3);return
52
51
  .animate-bounce-slow {
53
52
  animation: bounce-slow 4s ease-in-out infinite;
54
53
  }
55
- `,ul(b))}}},[e]),t.jsx("div",{ref:u,className:`${y()} ${s}`,children:o})},hl=({children:e,delay:r=0,className:a=""})=>t.jsx(or,{animation:"fade-in-up",delay:r,className:a,children:e}),fl=({children:e,delay:r=0,className:a=""})=>t.jsx(or,{animation:"fade-in-scale",delay:r,className:a,children:e}),bl=({children:e,className:r=""})=>t.jsx(or,{animation:"float",className:r,children:e}),ml=({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},yl={[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"}},pl=({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=yl[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 br.createPortal(S,document.body)},vl=(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}},Jt=({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(Qe,{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]})})]})},kl=({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(Jt,{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"]})]})]})},wl=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"}}),xl=({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(wl({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})]})})},Nl=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"}}),Cl=({title:e,description:r,children:a,variant:n="default",spacing:o="normal",className:s})=>t.jsxs("div",{className:f(Nl({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]}),Sl=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}}),El=({icon:e,title:r,description:a,layout:n="vertical",spacing:o="normal",interactive:s=!1,className:l,onClick:c})=>t.jsxs("div",{className:f(Sl({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})]})]}),Al=({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"}),Tl=({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)})})},Il={sm:"w-12 h-12",md:"w-16 h-16",lg:"w-20 h-20",xl:"w-24 h-24"},Ll={sm:"h-6 w-6",md:"h-8 w-8",lg:"h-10 w-10",xl:"h-12 w-12"},Ml={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"},Pl={square:"rounded-none",rounded:"rounded-2xl",circle:"rounded-full"},Ol={none:"",float:"animate-float",pulse:"animate-pulse",bounce:"animate-bounce-slow"},Ul=({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",Il[r],Ml[a],Pl[n],Ol[o],s),children:t.jsx("div",{className:f(Ll[r]),children:e})}),Dl=({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 zl({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 w="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(w,"bg-blue-600 text-white hover:bg-blue-700 dark:bg-blue-500 dark:hover:bg-blue-600");case"ghost":return f(w,"text-gray-600 hover:bg-gray-100 dark:text-gray-400 dark:hover:bg-gray-800");case"secondary":default:return f(w,"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,w)=>t.jsx("div",{children:n(S,w)},o(S,w)))})]})}const jl=({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(D.body.strong.md(),i.title),children:r})]}),t.jsx("div",{className:f(!r&&!o&&i.text),children:e})]})},_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":"UkeyboardUshortcut",children:r||"UkeyboardUshortcut Component"}),Bl=({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})},Fl=({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"}),Wl=({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:D.heading.h4(),description:D.body.sm(),count:D.caption.default()},md:{title:D.heading.h3(),description:D.body.md(),count:D.body.sm()},lg:{title:D.heading.h2(),description:D.body.lg(),count:D.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})]})},Vl=({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"}),$l=({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))})},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":"UrevealUonUscroll",children:r||"UrevealUonUscroll Component"}),ql={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"}},Gl=({icon:e,text:r,variant:a="default",size:n="md",className:o})=>{const{container:s,icon:l}=Un(a),c=ql[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})]})},Yl=({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"})})})]})]})}),Kl=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}},Xl=({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=Kl(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]",D.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)})})}),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":"UskipUnavigation",children:r||"UskipUnavigation Component"}),Jl=({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"}),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":"UversionUbadge",children:r||"UversionUbadge Component"}),Rl=({children:e,as:r="span"})=>t.jsx(r,{className:"sr-only",children:e}),ei=({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(st,{as:"span",size:c[a],weight:"medium",color:r?"default":"muted",className:"font-mono tabular-nums",children:e})]})},ri=["#3b82f6","#10b981","#f59e0b","#ef4444","#8b5cf6","#ec4899"],ti=({show:e,onComplete:r,particleCount:a=50,duration:n=3e3,colors:o=ri,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))})},sr=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:D.link.subtle(),default:D.link.default(),muted:D.link.muted(),external:D.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"}}),Mr=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(sr({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(sr({variant:r,size:a,className:e})),to:m,ref:y,onClick:v,...u,children:l}):t.jsx("span",{className:f(sr({variant:r,size:a,className:e})),onClick:v,...u,children:l})});Mr.displayName="SmartLink";const ai=(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]),ni={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"},oi=({children:e,mappings:r=ni,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(Mr,{to:i,variant:n,children:h},c)}return l})})},si=({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"})]})},li=({href:e,children:r,showIcon:a=!0,iconPosition:n="right",size:o="md",variant:s="default",className:l,onClick:c})=>{const d={sm:{text:D.body.sm(),icon:"h-3 w-3",gap:"gap-1"},md:{text:D.body.md(),icon:"h-4 w-4",gap:"gap-1.5"},lg:{text:D.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")})]})},lr=new Set,ii=()=>{lr.clear()},ci=e=>lr.has(e);function di(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 gi=({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(lr.has(S))return;const w=e||di(S,a,n,o);w&&(u.current=setTimeout(()=>{w().then(()=>{lr.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})},ui=({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))}),Qt=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})});Qt.displayName="Tabs";const Rt=G.forwardRef(({className:e,...r},a)=>t.jsx(fe.List,{ref:a,className:f(j.navigation.tabs.list(),e),...r}));Rt.displayName=fe.List.displayName;const ea=G.forwardRef(({className:e,...r},a)=>t.jsx(fe.Trigger,{ref:a,className:f(j.navigation.tabs.trigger(),e),...r}));ea.displayName=fe.Trigger.displayName;const ra=G.forwardRef(({className:e,...r},a)=>t.jsx(fe.Content,{ref:a,className:f(j.navigation.tabs.content(),e),...r}));ra.displayName=fe.Content.displayName;const hi=({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))})},fi=({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",D.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)})})},bi=({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))}),mi=({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:D.body.sm()},md:{button:"h-10 w-10 text-sm",icon:"h-4 w-4",text:D.body.md()},lg:{button:"h-12 w-12 text-base",icon:"h-5 w-5",text:D.body.lg()}}[s],h=(()=>{const w=[];w.push(1);const N=Math.max(e-n,2),C=Math.min(e+n,r-1);N>2&&w.push("ellipsis");for(let E=N;E<=C;E++)w.push(E);return C<r-1&&w.push("ellipsis"),r>1&&w.push(r),w})(),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=w=>f(v,d.button,d.text,w?"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((w,N)=>w==="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(w),className:k(w===e),"aria-label":`Go to page ${w}`,"aria-current":w===e?"page":void 0,children:w},w)),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"})})]})},yi=({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"})]})},pi=({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)})})})},vi=({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))}),ki=({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))})})},wi=({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(ki,{subsections:d.subsections,isExpanded:n.includes(d.id),selectedSubsection:a,parentSectionId:d.id,onSubsectionSelect:s})]},d.id))});function xi({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 Ni=({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:`${D.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:`${D.label.default()} text-left py-3 px-4 whitespace-nowrap`,children:d},i)),a&&t.jsx("th",{className:`${D.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:D.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)))})]})})}),Ci=({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"}),Si=({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"}),Ei=({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"}),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":"UcolumnUresize",children:r||"UcolumnUresize Component"}),Ti=({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"}),Ii=({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"}),Li=({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})},Mi=({children:e,className:r})=>t.jsx("li",{className:f("leading-relaxed",r),children:e}),Pi=({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]})]})},Oi=({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"}),Ui=({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,w]=p.useState(new Set),N=s?e.filter(U=>U.label.toLowerCase().includes(u.toLowerCase())):e,C=s?r.filter(U=>U.label.toLowerCase().includes(m.toLowerCase())):r,E=U=>{const B=new Set(v);B.has(U)?B.delete(U):B.add(U),k(B)},I=U=>{const B=new Set(S);B.has(U)?B.delete(U):B.add(U),w(B)},x=()=>{const U=e.filter(F=>v.has(F.id)),B=e.filter(F=>!v.has(F.id)),z=[...r,...U];a(B,z),k(new Set)},A=()=>{const U=r.filter(F=>S.has(F.id)),B=r.filter(F=>!S.has(F.id)),z=[...e,...U];a(z,B),w(new Set)},L=()=>{const U=[...r,...e];a([],U),k(new Set)},O=()=>{const U=[...e,...r];a(U,[]),w(new Set)},M=(U,B,z,F,V,R,Gh)=>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:[U.length," item",U.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:Gh,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:U.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"}):U.map(se=>{const tt=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",tt&&"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",tt?"bg-blue-600 border-blue-600 dark:bg-blue-500 dark:border-blue-500":"border-gray-300 dark:border-gray-600"),children:tt&&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:x,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:A,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(C,o,S,I,m,b,c)]})};function Di({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 zi=({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),w=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",w&&"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",w?"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))})},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":"UlistingUform",children:r||"UlistingUform Component"}),_i="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",Bi={none:"",sm:"p-3",md:"p-6",lg:"p-8"},Pr=({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"?_i:Pn(e);return t.jsx("div",{className:f("rounded-lg",i,Bi[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})},Fi=({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:D.heading.h4(),children:e}),r&&t.jsx("p",{className:D.body.sm(),children:r}),n]}),Wi=({className:e,children:r,...a})=>t.jsx("div",{className:f("",e),...a,children:r}),Vi=({className:e,children:r,...a})=>t.jsx("div",{className:f("flex items-center pt-4",e),...a,children:r}),$i=({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(Pr,{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]})},Hi=({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(Pr,{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})]})})},qi=({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})]})]})})]})},Gi=({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 w=S.trim().split(/\s+/);return w.length===1?w[0].charAt(0).toUpperCase():w[0].charAt(0).toUpperCase()+w[w.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})]})},Yi=({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"}),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":"UprofileUheader",children:r||"UprofileUheader Component"}),Xi=({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:D.body.sm(),value:D.body.sm(),gap:"gap-1"},md:{label:D.body.md(),value:D.body.md(),gap:"gap-2"},lg:{label:D.body.lg(),value:D.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})]})},Zi=({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:D.heading.h5(),label:D.caption.default(),icon:"h-4 w-4"},md:{value:D.heading.h4(),label:D.body.sm(),icon:"h-5 w-5"},lg:{value:D.heading.h3(),label:D.body.md(),icon:"h-6 w-6"},xl:{value:D.heading.h2(),label:D.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})]})]})]})},ta=({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(D.heading.h3(),"mb-2"),children:r}),a&&t.jsx("p",{className:f(D.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})]}),Ji=({title:e,subtext:r,className:a})=>t.jsx(ta,{title:e,description:r,className:a}),Qi=({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)})})]})})},Ri=({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 w=k.x/h*100,N=100-(k.y-i)/(d-i)*100;return t.jsx("circle",{cx:w,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))})]})]})},ec=({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,w=S/100*360,N=b.length>0?b[b.length-1].endAngle:-90,C=N+w;return b.push({...v,percentage:S,startAngle:N,endAngle:C,color:v.color||d[k%d.length]}),b},[]),h=(b,v,k,S)=>{const w=(S-90)*Math.PI/180;return{x:b+k*Math.cos(w),y:v+k*Math.sin(w)}},u=(b,v,k,S,w)=>{const N=h(b,v,k,w),C=h(b,v,k,S),E=w-S<=180?"0":"1";if(r==="donut"){const I=k*s/100,x=h(b,v,I,w),A=h(b,v,I,S);return["M",N.x,N.y,"A",k,k,0,E,0,C.x,C.y,"L",A.x,A.y,"A",I,I,0,E,1,x.x,x.y,"Z"].join(" ")}return["M",b,v,"L",N.x,N.y,"A",k,k,0,E,0,C.x,C.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))})]})},rc=({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(w=>{const N=w.x/h*100,C=100-(w.y-i)/(d-i)*100;return`${N},${C}`}),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,w=100-(k.y-i)/(d-i)*100;return`${S},${w}`}).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))})]})]})},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":"UradarUchart",children:r||"UradarUchart 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":"UbubbleUchart",children:r||"UbubbleUchart Component"}),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":"UscatterUplot",children:r||"UscatterUplot 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":"UtreeUmap",children:r||"UtreeUmap 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":"UsankeyUdiagram",children:r||"UsankeyUdiagram Component"}),lc=({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"})]})},ic=({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"}),cc=({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"}),dc=({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"}),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":"UperformanceUchart",children:r||"UperformanceUchart Component"}),uc=({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"}),hc=({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})]})]})},fc=({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)}%`})]})},bc=({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})]})]})})},mc=({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"}),yc=({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,w]=p.useState(e);p.useEffect(()=>{b(!0),k(!1),w(e)},[e]);const N=()=>{b(!1),u?.()},C=()=>{b(!1),k(!0),a&&S!==a&&(w(a),k(!1),b(!0)),y?.()},E={none:"",sm:"rounded-sm",md:"rounded-md",lg:"rounded-lg",full:"rounded-full"},I={contain:"object-contain",cover:"object-cover",fill:"object-fill",none:"object-none","scale-down":"object-scale-down"},x={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:x,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:C,className:f("w-full h-full",I[s],m&&c&&"opacity-0")})]})},pc=({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})]})]})]})},vc=({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"}),kc=({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.'})]})},wc=({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 C=r-1;o?.(C),h(1)}},[y,r,o]),v=p.useCallback(()=>{if(m){const C=r+1;o?.(C),h(1)}},[m,r,o]),k=()=>{h(C=>Math.min(C+.5,3))},S=()=>{h(C=>Math.max(C-.5,.5))},w=()=>{h(1)},N=()=>{const C=document.createElement("a");C.href=u.src,C.download=u.alt||"image",C.click()};return p.useEffect(()=>{if(!a)return;const C=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":w();break}};return document.addEventListener("keydown",C),()=>document.removeEventListener("keydown",C)},[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:w,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((C,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:C.thumbnail||C.src,alt:C.alt||"",className:"w-full h-full object-cover"})},E))})]})})},xc=({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"}})},Nc=({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 I=()=>m(E.currentTime),x=()=>v(E.duration),A=()=>i(!0),L=()=>i(!1);return E.addEventListener("timeupdate",I),E.addEventListener("loadedmetadata",x),E.addEventListener("play",A),E.addEventListener("pause",L),()=>{E.removeEventListener("timeupdate",I),E.removeEventListener("loadedmetadata",x),E.removeEventListener("play",A),E.removeEventListener("pause",L)}},[]);const k=()=>{c.current&&(d?c.current.pause():c.current.play())},S=E=>{const I=parseFloat(E.target.value);u(I),c.current&&(c.current.volume=I)},w=E=>{const I=parseFloat(E.target.value);m(I),c.current&&(c.current.currentTime=I)},N=()=>{c.current&&(document.fullscreenElement?document.exitFullscreen():c.current.requestFullscreen())},C=E=>{const I=Math.floor(E/60),x=Math.floor(E%60);return`${I}:${x.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:w,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:[C(y)," / ",C(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"})})})]})]})]})},Cc=({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"}),Sc=({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"}),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":"UvideoUcall",children:r||"UvideoUcall Component"}),Ac=({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"}),Tc=({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 I=()=>u(E.currentTime),x=()=>m(E.duration),A=()=>i(!0),L=()=>i(!1),O=()=>i(!1);return E.addEventListener("timeupdate",I),E.addEventListener("loadedmetadata",x),E.addEventListener("play",A),E.addEventListener("pause",L),E.addEventListener("ended",O),()=>{E.removeEventListener("timeupdate",I),E.removeEventListener("loadedmetadata",x),E.removeEventListener("play",A),E.removeEventListener("pause",L),E.removeEventListener("ended",O)}},[]);const k=()=>{c.current&&(d?c.current.pause():c.current.play())},S=E=>{const I=parseFloat(E.target.value);u(I),c.current&&(c.current.currentTime=I)},w=E=>{const I=parseFloat(E.target.value);v(I),c.current&&(c.current.volume=I)},N=E=>{const I=Math.floor(E/60),x=Math.floor(E%60);return`${I}:${x.toString().padStart(2,"0")}`},C=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:w,className:"w-24 accent-blue-500"})]})]}),t.jsxs("span",{className:"text-sm text-gray-600 dark:text-gray-400",children:[C.toFixed(0),"%"]})]})]})},Ic=({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"}),Lc=({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)})})},Mc=({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"}),Pc=({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"}),Oc=({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 C=Array.from(N.dataTransfer.files);k(C)},v=N=>{if(N.target.files){const C=Array.from(N.target.files);k(C)}},k=N=>{const C=N.filter(A=>{const L=e.some(M=>{if(M.endsWith("/*")){const U=M.split("/")[0];return A.type.startsWith(U)}return A.type===M}),O=A.size<=r;return L&&O}),E=a-c.length,I=C.slice(0,E),x=I.map(A=>({id:`${Date.now()}-${Math.random()}`,file:A,preview:A.type.startsWith("image/")?URL.createObjectURL(A):void 0,status:"pending"}));d(A=>[...A,...x]),o&&o(I)},S=N=>{d(C=>C.filter(E=>E.id!==N)),s&&s(N)},w=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, ",w(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:w(N.file.size)})]})]},N.id))})]})},Uc=({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"}),Dc=({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"}),zc=({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})]})},Or=({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=C=>{C.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(),C=j.overlays.modal[n]();return f(N,C)},S=N=>{c&&N.target===N.currentTarget&&r()},w=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 br.createPortal(w,document.body)},jc=({children:e,variant:r="default",className:a})=>t.jsx("div",{"data-testid":"modal-header",className:f(j.overlays.modal.header(),a),children:e}),Ur=({children:e,variant:r="default",className:a})=>t.jsx("div",{"data-testid":"modal-body",className:f(j.overlays.modal.body(),a),children:e}),Dr=({children:e,variant:r="default",className:a})=>t.jsx("div",{"data-testid":"modal-footer",className:f(j.overlays.modal.footer(),a),children:e}),_c=({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(Qe,{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})]})]})},Bc=({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})},Fc=({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 w=()=>{const{scrollTop:N,scrollHeight:C,clientHeight:E,scrollLeft:I,scrollWidth:x,clientWidth:A}=S;d==="vertical"&&m(N>300);let L;d==="vertical"?i?L=N:L=C-N-E:i?L=I:L=x-I-A,L<o&&r()};return S.addEventListener("scroll",w),()=>S.removeEventListener("scroll",w)},[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"})})})]})},Wc=({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 I=y.current.getBoundingClientRect(),x=8;let A=0,L=0;switch(a){case"top":A=I.top-x,L=I.left+I.width/2;break;case"top-start":A=I.top-x,L=I.left;break;case"top-end":A=I.top-x,L=I.right;break;case"bottom":A=I.bottom+x,L=I.left+I.width/2;break;case"bottom-start":A=I.bottom+x,L=I.left;break;case"bottom-end":A=I.bottom+x,L=I.right;break;case"left":A=I.top+I.height/2,L=I.left-x;break;case"right":A=I.top+I.height/2,L=I.right+x;break}v({top:A,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=I=>{y.current&&!y.current.contains(I.target)&&m.current&&!m.current.contains(I.target)&&u(!1)};return document.addEventListener("mousedown",E),()=>document.removeEventListener("mousedown",E)},[h,u]),p.useEffect(()=>{if(!h)return;const E=I=>{I.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)},w=()=>{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"},C={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:w,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],C[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")})]})]})},Vc=({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=w=>w.flatMap(N=>[N.id,...N.subsections?v(N.subsections):[]]),S=v(e).map(w=>document.getElementById(w)).filter(Boolean);if(S.length!==0)return h.current=new IntersectionObserver(w=>{w.forEach(N=>{if(N.isIntersecting){const C=N.target.id;r!==void 0&&a?a(C):i(C)}})},{root:o?b:null,rootMargin:`-${n}px 0px -50% 0px`,threshold:0}),S.forEach(w=>{h.current?.observe(w)}),()=>{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 w=v.offsetTop-n;s?k===window?window.scrollTo({top:w,behavior:"smooth"}):k.scrollTo({top:w,behavior:"smooth"}):k===window?window.scrollTo(0,w):k.scrollTop=w},m=(b,v=0)=>{const k=u===b.id,S=b.subsections?.some(w=>u===w.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(w=>m(w,v+1))})]},b.id)};return t.jsx("nav",{className:f("space-y-1",c),children:e.map(b=>m(b,0))})},$c=({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(Qe,{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})]})]})},Hc=({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 w=async E=>{if(E.preventDefault(),S(null),y&&!b.trim()){S("This field is required");return}if(m){const I=m(b);if(I){S(I);return}}try{await a(b.trim())}catch(I){S(I instanceof Error?I.message:"An error occurred")}},N=()=>{v(l),S(null),r()},C=y?b.trim().length>0:!0;return t.jsx(Or,{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:w,children:[t.jsxs(Ur,{variant:"padded",children:[t.jsx("h3",{id:"text-input-modal-title",className:D.heading.h4(),children:n}),t.jsx("p",{id:"text-input-modal-description",className:`${D.body.md()} mt-2 mb-4`,children:o}),t.jsx(Re,{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:`${D.body.sm()} text-red-600 dark:text-red-400 mt-2`,role:"alert",children:k})]}),t.jsxs(Dr,{children:[t.jsx(ne,{type:"button",variant:"outline",onClick:N,disabled:i,children:c}),t.jsx(ne,{type:"submit",variant:"default",disabled:!C||i,children:i?h:d})]})]})})},aa=({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),w=h!==void 0,N=w?h:y,C=p.useCallback(()=>{l||w||(v.current&&(clearTimeout(v.current),v.current=void 0),n>0?b.current=setTimeout(()=>{m(!0),u?.(!0)},n):(m(!0),u?.(!0)))},[l,w,n,u]),E=p.useCallback(()=>{w||(b.current&&(clearTimeout(b.current),b.current=void 0),o>0?v.current=setTimeout(()=>{m(!1),u?.(!1)},o):(m(!1),u?.(!1)))},[w,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 I=()=>{i==="hover"&&C()},x=()=>{i==="hover"&&E()},A=()=>{i==="hover"&&C()},L=()=>{i==="hover"&&E()},O=()=>{i==="click"&&!w&&(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"},U={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:I,onMouseLeave:x,onFocus:A,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",U[a],z[d][a])})]})]})},qc={default:P.InformationCircleIcon,warning:P.ExclamationTriangleIcon,danger:P.XCircleIcon,success:P.CheckCircleIcon,info:P.InformationCircleIcon},Gc={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()},Yc={default:"default",warning:"default",danger:"destructive",success:"default",info:"default"},Kc=({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=qc[d],u=Gc[d],y=Yc[d];return t.jsxs(Or,{isOpen:e,onClose:r,size:"small",variant:"web3confirmation","aria-labelledby":"confirmation-dialog-title","aria-describedby":"confirmation-dialog-description",children:[t.jsxs(Ur,{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:D.heading.h4(),children:n})]}),t.jsx("p",{id:"confirmation-dialog-description",className:D.body.md(),children:o})]}),t.jsxs(Dr,{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})]})]})},Xc=({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 w=()=>{const N=h.current.getBoundingClientRect(),C=8;let E=0,I=0;switch(a){case"top":E=N.top-C,I=N.left+N.width/2;break;case"bottom":E=N.bottom+C,I=N.left+N.width/2;break;case"left":E=N.top+N.height/2,I=N.left-C;break;case"right":E=N.top+N.height/2,I=N.right+C;break}i({top:E,left:I})};return w(),window.addEventListener("scroll",w),window.addEventListener("resize",w),()=>{window.removeEventListener("scroll",w),window.removeEventListener("resize",w)}},[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})})]})},Zc=({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(w=>w+1),S.dataTransfer.items&&S.dataTransfer.items.length>0&&i(!0))},m=S=>{S.preventDefault(),S.stopPropagation(),!l&&u(w=>{const N=w-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 C=N;n&&n.length>0&&(C=N.filter(E=>n.some(I=>{if(I.endsWith("/*")){const x=I.split("/")[0];return E.type.startsWith(x)}return E.type===I}))),r(C);return}const w=S.dataTransfer.getData("text/plain");if(w)try{const N=JSON.parse(w);r(N)}catch{r(w)}},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)]})},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":"UdragUdropUlist",children:r||"UdragUdropUlist 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":"UsortableUgrid",children:r||"UsortableUgrid 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":"UnestedUdrag",children:r||"UnestedUdrag Component"}),ed=({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"}),rd=({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"}),td=({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"}),ad=({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"}),nd=({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"}),od=({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"}),sd=({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 I=L=>{if(a||u)return;E.scrollTop<=0&&(v.current=L.touches[0].clientY,b(!0))},x=L=>{if(!m)return;const M=L.touches[0].clientY-v.current;if(M>0&&E.scrollTop<=0){const U=Math.min(M/c,1),B=Math.min(M*(1-U*.5),c);h(B),M>10&&L.preventDefault()}},A=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",I,{passive:!0}),E.addEventListener("touchmove",x,{passive:!1}),E.addEventListener("touchend",A),()=>{E.removeEventListener("touchstart",I),E.removeEventListener("touchmove",x),E.removeEventListener("touchend",A)}},[a,u,m,i,l,c,r]);const S=Math.min(i/l,1),w=m||u,N=m?i:u?l:0,C=()=>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:w?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:C()})]})}),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+`
54
+ `,Cs(m))}}},[t]),e.jsx("div",{ref:f,className:`${v()} ${n}`,children:s})},Ns=({children:t,delay:r=0,className:a=""})=>e.jsx(ze,{animation:"fade-in-up",delay:r,className:a,children:t}),Ss=({children:t,delay:r=0,className:a=""})=>e.jsx(ze,{animation:"fade-in-scale",delay:r,className:a,children:t}),Ls=({children:t,className:r=""})=>e.jsx(ze,{animation:"float",className:r,children:t}),Es=({isOpen:t,onClick:r,opacity:a="medium",blur:o=!1,zIndex:s=50,className:n,children:l})=>{const i={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 t?e.jsx("div",{onClick:r,className:u("fixed inset-0","transition-all duration-200",i[a],o&&"backdrop-blur-sm",n),style:{zIndex:s},role:"presentation","aria-hidden":"true",children:l}):null},Ms={[Z.InfoType.INFO]:{icon:z.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"},[Z.InfoType.SUCCESS]:{icon:z.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"},[Z.InfoType.WARNING]:{icon:z.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"},[Z.InfoType.ERROR]:{icon:z.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"}},Is=({isVisible:t,onDismiss:r,title:a,description:o,variant:s=Z.InfoType.INFO,duration:n=5e3,icon:l,className:i,closeAriaLabel:g="Dismiss banner"})=>{const[c,h]=b.useState("hidden"),f=b.useRef(null),v=b.useRef(null),p=Ms[s],m=p.icon,y=b.useCallback(()=>{f.current&&(clearTimeout(f.current),f.current=null),v.current&&(clearTimeout(v.current),v.current=null)},[]),x=b.useCallback(()=>{y(),h("exiting"),v.current=setTimeout(()=>{h("hidden"),r()},300)},[y,r]);if(b.useEffect(()=>{t?(h("entering"),v.current=setTimeout(()=>{h("visible")},10)):(c==="visible"||c==="entering")&&x()},[t]),b.useEffect(()=>(c==="visible"&&n>0&&(f.current=setTimeout(()=>{x()},n)),()=>{f.current&&clearTimeout(f.current)}),[c,n,x]),b.useEffect(()=>()=>y(),[y]),c==="hidden")return null;const N=e.jsx("div",{role:"alert","aria-live":"polite","data-testid":"banner",className:u("fixed inset-x-0 top-0 z-[100] w-full","transition-all duration-300 ease-out",c==="entering"||c==="exiting"?"-translate-y-full opacity-0":"translate-y-0 opacity-100"),children:e.jsxs("div",{className:u("flex items-start gap-3 p-4 border-b shadow-lg","backdrop-blur-sm",p.container,i),children:[e.jsx("div",{className:u("flex-shrink-0 mt-0.5",p.iconColor),children:l||e.jsx(m,{className:"h-5 w-5"})}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("p",{className:u("font-semibold",p.titleColor),children:a}),o&&e.jsx("p",{className:u("text-sm mt-1",p.descriptionColor),children:o})]}),e.jsx("button",{type:"button",onClick:x,className:u("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":g,children:e.jsx(z.XMarkIcon,{className:u("h-5 w-5",p.iconColor)})})]})});return We.createPortal(N,document.body)},Ts=(t={})=>{const{defaultDuration:r=5e3}=t,[a,o]=b.useState(!1),[s,n]=b.useState(null),l=b.useCallback(({title:g,description:c,variant:h=Z.InfoType.INFO,duration:f=r})=>{n({title:g,description:c,variant:h,duration:f}),o(!0)},[r]),i=b.useCallback(()=>{o(!1)},[]);return{isVisible:a,bannerProps:s,showBanner:l,hideBanner:i}},Or=({isOpen:t,onClose:r,children:a,size:o="md",showCloseButton:s=!0,closeOnOutsideClick:n=!0,closeOnEscape:l=!0,className:i})=>{if(b.useEffect(()=>{if(!l||!t||!r)return;const h=f=>{f.key==="Escape"&&r()};return document.addEventListener("keydown",h),()=>document.removeEventListener("keydown",h)},[t,r,l]),!t)return null;const g={sm:"max-w-sm",md:"max-w-md",lg:"max-w-lg",xl:"max-w-xl",full:"max-w-full mx-4"},c=()=>{n&&r&&r()};return e.jsxs(te,{children:[e.jsx(Se,{isOpen:t,onClose:c,opacity:"dark",blur:!0}),e.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center p-4",children:e.jsxs("div",{className:u("relative w-full",g[o],"bg-white dark:bg-gray-900","rounded-lg shadow-xl","animate-in fade-in zoom-in-95 duration-200",i),onClick:h=>h.stopPropagation(),children:[s&&r&&e.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:e.jsx("svg",{className:"w-6 h-6",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})}),a]})})]})},Ps=({isOpen:t,onClose:r,items:a,placeholder:o="Type a command or search...",emptyMessage:s="No results found.",className:n})=>{const[l,i]=b.useState(""),[g,c]=b.useState(0),h=b.useRef(null),f=a.filter(y=>{const x=l.toLowerCase();return y.label.toLowerCase().includes(x)||y.keywords?.some(N=>N.toLowerCase().includes(x))||y.group?.toLowerCase().includes(x)}),v=f.reduce((y,x)=>{const N=x.group||"Commands";return y[N]||(y[N]=[]),y[N].push(x),y},{});b.useEffect(()=>{t||(i(""),c(0))},[t]),b.useEffect(()=>{t&&h.current&&h.current.focus()},[t]),b.useEffect(()=>{c(0)},[l]);const p=y=>{switch(y.key){case"ArrowDown":y.preventDefault(),c(x=>x<f.length-1?x+1:x);break;case"ArrowUp":y.preventDefault(),c(x=>x>0?x-1:x);break;case"Enter":y.preventDefault(),f[g]&&(f[g].onSelect(),r());break;case"Escape":y.preventDefault(),r();break}},m=y=>{y.onSelect(),r()};return e.jsxs(Or,{isOpen:t,onClose:r,size:"lg",showCloseButton:!1,className:u("overflow-hidden p-0",n),children:[e.jsx("div",{className:"border-b border-gray-200 dark:border-gray-700 p-4",children:e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("svg",{className:"w-5 h-5 text-gray-400",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z"})}),e.jsx("input",{ref:h,type:"text",value:l,onChange:y=>i(y.target.value),onKeyDown:p,placeholder:o,className:"flex-1 bg-transparent border-none outline-none text-gray-900 dark:text-white placeholder-gray-500"})]})}),e.jsx("div",{className:"max-h-96 overflow-y-auto p-2",children:Object.keys(v).length===0?e.jsx("div",{className:"px-4 py-8 text-sm text-gray-500 dark:text-gray-400 text-center",children:s}):Object.entries(v).map(([y,x])=>e.jsxs("div",{className:"mb-4 last:mb-0",children:[e.jsx("div",{className:"px-3 py-2 text-xs font-semibold text-gray-500 dark:text-gray-400 uppercase tracking-wider",children:y}),e.jsx("div",{className:"space-y-1",children:x.map(N=>{const S=f.indexOf(N)===g;return e.jsxs("button",{onClick:()=>m(N),className:u("w-full flex items-center gap-3 px-3 py-2 rounded-md","text-sm text-left transition-colors",S?"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:[N.icon&&e.jsx("span",{className:"flex-shrink-0 w-4 h-4",children:N.icon}),e.jsx("span",{className:"flex-1 truncate",children:N.label}),N.shortcut&&e.jsx("span",{className:"flex-shrink-0 text-xs text-gray-500 dark:text-gray-400 font-mono",children:N.shortcut})]},N.id)})})]},y))}),e.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:[e.jsxs("div",{className:"flex items-center gap-4",children:[e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx("kbd",{className:"px-1.5 py-0.5 bg-gray-100 dark:bg-gray-800 rounded",children:"↑"}),e.jsx("kbd",{className:"px-1.5 py-0.5 bg-gray-100 dark:bg-gray-800 rounded",children:"↓"}),"to navigate"]}),e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx("kbd",{className:"px-1.5 py-0.5 bg-gray-100 dark:bg-gray-800 rounded",children:"↵"}),"to select"]})]}),e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx("kbd",{className:"px-1.5 py-0.5 bg-gray-100 dark:bg-gray-800 rounded",children:"esc"}),"to close"]})]})]})},zs=W.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"}}),Us=({label:t,value:r,change:a,trend:o="none",icon:s,variant:n="default",className:l})=>{const i={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"},g={up:"↗",down:"↘",neutral:"→",none:""};return e.jsx("div",{className:u(zs({variant:n,trend:o}),l),children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsx("p",{className:"text-sm font-medium text-gray-600 dark:text-gray-400 mb-1",children:t}),e.jsx("p",{className:"text-2xl font-bold text-gray-900 dark:text-white",children:r}),a&&e.jsxs("p",{className:u("text-sm font-medium flex items-center gap-1 mt-1",i[o||"none"]),children:[e.jsx("span",{children:g[o||"none"]}),a]})]}),s&&e.jsx("div",{className:"text-3xl opacity-80",children:s})]})})},As=W.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"}}),$s=({title:t,description:r,children:a,variant:o="default",spacing:s="normal",className:n})=>e.jsxs("div",{className:u(As({variant:o,spacing:s}),n),children:[(t||r)&&e.jsxs("div",{className:"space-y-1",children:[t&&e.jsx("h3",{className:"text-lg font-medium text-gray-900 dark:text-white",children:t}),r&&e.jsx("p",{className:"text-sm text-gray-600 dark:text-gray-400",children:r})]}),a]}),Ds=W.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}}),Bs=({icon:t,title:r,description:a,layout:o="vertical",spacing:s="normal",interactive:n=!1,className:l,onClick:i})=>e.jsxs("div",{className:u(Ds({layout:o,spacing:s,interactive:n}),l),onClick:i,children:[e.jsx("div",{className:"text-4xl mb-4 flex-shrink-0",children:t}),e.jsxs("div",{className:"space-y-2",children:[e.jsx("h3",{className:"text-xl font-bold text-gray-900 dark:text-white",children:r}),e.jsx("div",{className:"text-gray-600 dark:text-gray-300 leading-relaxed",children:a})]})]}),js=({className:t,children:r,disabled:a=!1,onClick:o})=>e.jsx("div",{className:u("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",t),onClick:a?void 0:o,role:"region","aria-label":"UfocusUindicator",children:r||"UfocusUindicator Component"}),Fs=({icon:t,size:r="md",shape:a="rounded",variant:o="blue-purple",gradientClasses:s,className:n,iconClassName:l})=>{const i={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"}},g={square:"rounded-lg",rounded:"rounded-xl",circle:"rounded-full"},c={"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:s||"bg-gradient-to-r from-blue-600 to-purple-600"},h=i[r];return e.jsx("div",{className:u("flex items-center justify-center flex-shrink-0",h.container,g[a],c[o],n),children:e.jsx(t,{className:u("text-white",h.icon,l)})})},Os={sm:"w-12 h-12",md:"w-16 h-16",lg:"w-20 h-20",xl:"w-24 h-24"},Vs={sm:"h-6 w-6",md:"h-8 w-8",lg:"h-10 w-10",xl:"h-12 w-12"},Ws={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"},Hs={square:"rounded-none",rounded:"rounded-2xl",circle:"rounded-full"},_s={none:"",float:"animate-float",pulse:"animate-pulse",bounce:"animate-bounce-slow"},qs=({children:t,size:r="lg",variant:a="primary",shape:o="rounded",animation:s="float",className:n})=>e.jsx("div",{className:u("flex items-center justify-center mx-auto mb-6 transition-all duration-300 group-hover:scale-105",Os[r],Ws[a],Hs[o],_s[s],n),children:e.jsx("div",{className:u(Vs[r]),children:t})}),Gs=({icon:t,children:r,iconPosition:a="left",gap:o="md",iconSize:s="md",align:n="left",variant:l="default",className:i,iconClassName:g,textClassName:c})=>{const h={xs:"gap-1",sm:"gap-2",md:"gap-3",lg:"gap-4"},f={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"},v={left:"text-left",center:"text-center items-center",right:"text-right items-end"},p={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"},m={left:"flex items-center",right:"flex flex-row-reverse items-center",top:"flex flex-col"};return e.jsxs("div",{className:u(m[a],h[o],a==="top"&&v[n],p[l],i),children:[e.jsx(t,{className:u(f[s],"flex-shrink-0",g)}),e.jsx("span",{className:u(c),children:r})]})};function Ks({title:t,subtitle:r,items:a,renderItem:o,keyExtractor:s,actions:n,emptyMessage:l="No items",emptyIcon:i,emptyAction:g,loading:c=!1,className:h,headerClassName:f,listClassName:v,spacing:p="none",showDividers:m=!1}){const y={none:"",sm:"space-y-1",md:"space-y-2",lg:"space-y-4"},x=(N="secondary")=>{const k="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(N){case"primary":return u(k,"bg-blue-600 text-white hover:bg-blue-700 dark:bg-blue-500 dark:hover:bg-blue-600");case"ghost":return u(k,"text-gray-600 hover:bg-gray-100 dark:text-gray-400 dark:hover:bg-gray-800");case"secondary":default:return u(k,"bg-gray-100 text-gray-700 hover:bg-gray-200 dark:bg-gray-800 dark:text-gray-300 dark:hover:bg-gray-700")}};return e.jsxs("div",{className:u("",h),children:[e.jsxs("div",{className:u("flex items-center justify-between gap-4 pb-4",f),children:[e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsx("h2",{className:"text-lg font-semibold text-gray-900 dark:text-gray-100 truncate",children:t}),r&&e.jsx("p",{className:"mt-0.5 text-sm text-gray-500 dark:text-gray-400",children:r})]}),n&&n.length>0&&e.jsx("div",{className:"flex items-center gap-2 flex-shrink-0",children:n.map(N=>e.jsxs("button",{onClick:N.onClick,disabled:N.disabled,className:x(N.variant),children:[N.icon,N.label]},N.id))})]}),c&&e.jsx("div",{className:"flex items-center justify-center py-12",children:e.jsx("div",{className:"w-6 h-6 border-2 border-blue-600 border-t-transparent rounded-full animate-spin"})}),!c&&a.length===0&&e.jsxs("div",{className:"flex flex-col items-center justify-center py-12 text-center",children:[i&&e.jsx("div",{className:"mb-4 text-gray-400 dark:text-gray-500",children:i}),e.jsx("p",{className:"text-gray-500 dark:text-gray-400",children:l}),g&&e.jsx("button",{onClick:g.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:g.label})]}),!c&&a.length>0&&e.jsx("div",{className:u(y[p],m&&"divide-y divide-gray-200 dark:divide-gray-700",v),children:a.map((N,k)=>e.jsx("div",{children:o(N,k)},s(N,k)))})]})}const Ys=({children:t,title:r,variant:a="info",size:o="md",icon:s,bordered:n=!0,className:l})=>{const i={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"}},g={sm:"p-3",md:"p-4",lg:"p-6"},c=i[a];return e.jsxs("div",{className:u("rounded-lg",c.bg,n&&`border ${c.border}`,g[o],l),children:[(r||s)&&e.jsxs("div",{className:"flex items-start gap-3 mb-2",children:[s&&e.jsx(s,{className:u("h-5 w-5 flex-shrink-0 mt-0.5",c.icon)}),r&&e.jsx("h3",{className:u(T.textVariants.body.strong.md(),c.title),children:r})]}),e.jsx("div",{className:u(!r&&!s&&c.text),children:t})]})},Qs=({className:t,children:r,disabled:a=!1,onClick:o})=>e.jsx("div",{className:u("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",t),onClick:a?void 0:o,role:"region","aria-label":"UkeyboardUshortcut",children:r||"UkeyboardUshortcut Component"}),Xs=({size:t="md",className:r="",showText:a=!0,onClick:o,logoSrc:s="/logo.png",logoAlt:n="Logo",logoText:l,fontFamily:i="Dancing Script, cursive"})=>{const c=(()=>{switch(t){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=e.jsxs(e.Fragment,{children:[e.jsx("img",{src:s,alt:n,className:c.image}),a&&e.jsx("div",{className:`${c.text} font-bold text-gray-900 dark:text-gray-100`,style:{fontFamily:i,fontWeight:"700"},children:l})]});return o?e.jsx("button",{onClick:o,className:`flex items-center ${c.container} ${r} hover:opacity-80 transition-opacity`,children:h}):e.jsx("div",{className:`flex items-center ${c.container} ${r}`,children:h})},Js=({className:t,children:r,disabled:a=!1,onClick:o})=>e.jsx("div",{className:u("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",t),onClick:a?void 0:o,role:"region","aria-label":"UmorphUtransition",children:r||"UmorphUtransition Component"}),Zs=({title:t,description:r,count:a,countLabel:o,action:s,loading:n=!1,loadingText:l="Loading...",size:i="md",className:g})=>{const h={sm:{title:T.textVariants.heading.h4(),description:T.textVariants.body.sm(),count:T.textVariants.caption.default()},md:{title:T.textVariants.heading.h3(),description:T.textVariants.body.md(),count:T.textVariants.body.sm()},lg:{title:T.textVariants.heading.h2(),description:T.textVariants.body.lg(),count:T.textVariants.body.md()}}[i];return e.jsxs("div",{className:u("flex items-start justify-between gap-4",g),children:[e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsxs("div",{className:"flex items-center gap-3 flex-wrap",children:[e.jsx("h2",{className:u(h.title,"text-gray-900 dark:text-gray-100"),children:t}),a!==void 0&&e.jsxs("span",{className:u(h.count,"text-gray-500 dark:text-gray-400"),children:["(",a,o&&` ${o}`,")"]}),n&&e.jsxs("span",{className:u(h.count,"text-gray-500 dark:text-gray-400 flex items-center gap-2"),children:[e.jsx("div",{className:"animate-spin rounded-full h-4 w-4 border-b-2 border-blue-600"}),l]})]}),r&&e.jsx("p",{className:u(h.description,"mt-1 text-gray-600 dark:text-gray-400"),children:r})]}),s&&e.jsx("div",{className:"flex-shrink-0",children:s})]})},Rs=({className:t,children:r,disabled:a=!1,onClick:o})=>e.jsx("div",{className:u("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",t),onClick:a?void 0:o,role:"region","aria-label":"UparallaxUscroll",children:r||"UparallaxUscroll Component"}),en=({actions:t,orientation:r="horizontal",columns:a=3,className:o})=>{const s={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"},n={horizontal:"flex flex-wrap gap-2",vertical:"flex flex-col gap-2",grid:"grid gap-2"};return e.jsx("div",{className:u(n[r],r==="grid"&&`grid-cols-${a}`,o),style:r==="grid"?{gridTemplateColumns:`repeat(${a}, 1fr)`}:void 0,children:t.map(l=>e.jsxs("button",{onClick:l.onClick,disabled:l.disabled,className:u("flex items-center justify-center gap-2 px-4 py-3 rounded-lg border transition-colors font-medium",s[l.variant||"default"],l.disabled&&"opacity-50 cursor-not-allowed"),children:[l.icon&&e.jsx("span",{className:"w-5 h-5",children:l.icon}),e.jsx("span",{children:l.label})]},l.id))})},rn=({className:t,children:r,disabled:a=!1,onClick:o})=>e.jsx("div",{className:u("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",t),onClick:a?void 0:o,role:"region","aria-label":"UrevealUonUscroll",children:r||"UrevealUonUscroll Component"}),tn={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"}},an=({icon:t,text:r,variant:a="default",size:o="md",className:s})=>{const{container:n,icon:l}=T.getSectionBadgeColors(a),i=tn[o];return e.jsxs("div",{className:u("inline-flex items-center rounded-full mb-6",n,i.container,s),children:[e.jsx("div",{className:u("animate-float-icon",l,i.icon),children:t}),e.jsx("span",{className:i.text,children:r})]})},on=({title:t,onAdd:r,addButtonTooltip:a,loading:o,className:s=""})=>e.jsx("div",{className:`p-4 border-b border-gray-200 dark:border-gray-700 ${s}`,children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("h2",{className:"text-lg font-semibold text-gray-900 dark:text-gray-100",children:t}),e.jsxs("div",{className:"flex items-center space-x-2",children:[o&&e.jsx("div",{className:"w-5 h-5 border-2 border-blue-600 border-t-transparent rounded-full animate-spin"}),r&&e.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:e.jsx("svg",{className:"w-5 h-5 text-gray-600 dark:text-gray-400",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 4v16m8-8H4"})})})]})]})}),sn=t=>{switch(t){case"cog":return z.Cog6ToothIcon;case"arrow-right":return z.ArrowRightIcon;case"shield":return z.ShieldCheckIcon;case"reply":case"chat":return z.ChatBubbleLeftRightIcon;case"filter":return z.FunnelIcon;case"plug":return z.LinkIcon;case"adjustments":return z.AdjustmentsHorizontalIcon;case"currency-dollar":return z.CurrencyDollarIcon;default:return z.Cog6ToothIcon}},nn=({settings:t,selectedSetting:r,onSettingSelect:a,className:o=""})=>e.jsx("nav",{className:u("space-y-1",o),"aria-label":"Settings navigation",children:e.jsx("ul",{className:"space-y-1",role:"list",children:t.map(s=>{const n=sn(s.icon),l=r===s.id;return e.jsx("li",{children:e.jsx("button",{onClick:()=>a(s.id),className:u("w-full flex items-center text-left px-3 py-2 rounded-lg transition-colors h-[44px]",T.textVariants.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:s.description,children:e.jsxs("div",{className:"flex items-center flex-1 min-w-0",children:[e.jsx(n,{className:"h-5 w-5 mr-3 flex-shrink-0","aria-hidden":"true"}),e.jsx("span",{className:"truncate",children:s.title})]})})},s.id)})})}),ln=({className:t,children:r,disabled:a=!1,onClick:o})=>e.jsx("div",{className:u("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",t),onClick:a?void 0:o,role:"region","aria-label":"UskipUnavigation",children:r||"UskipUnavigation Component"}),cn=({className:t,children:r,disabled:a=!1,onClick:o})=>e.jsx("div",{className:u("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",t),onClick:a?void 0:o,role:"region","aria-label":"UsortUdropdown",children:r||"UsortUdropdown Component"}),dn=({className:t,children:r,disabled:a=!1,onClick:o})=>e.jsx("div",{className:u("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",t),onClick:a?void 0:o,role:"region","aria-label":"UversionUbadge",children:r||"UversionUbadge Component"}),gn=({children:t,as:r="span"})=>e.jsx(r,{className:"sr-only",children:t}),un=({time:t,isActive:r=!0,size:a="sm",showIcon:o=!0,className:s})=>{const n={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"},i={sm:"sm",md:"base",lg:"lg"};return e.jsxs("div",{className:u("flex items-center",n[a],s),role:"timer","aria-label":`Timer: ${t}`,children:[o&&e.jsx("svg",{className:u(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:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 8v4l3 3m6-3a9 9 0 11-18 0 9 9 0 0118 0z"})}),e.jsx(Mr,{as:"span",size:i[a],weight:"medium",color:r?"default":"muted",className:"font-mono tabular-nums",children:t})]})},hn=["#3b82f6","#10b981","#f59e0b","#ef4444","#8b5cf6","#ec4899"],fn=({show:t,onComplete:r,particleCount:a=50,duration:o=3e3,colors:s=hn,className:n})=>{const[l,i]=b.useState([]),[g,c]=b.useState(!1);b.useEffect(()=>{if(t&&!g){c(!0);const f=[];for(let p=0;p<a;p++){const m=Math.PI*2*p/a+Math.random()*.5,y=2+Math.random()*4;f.push({id:p,x:50,y:50,vx:Math.cos(m)*y,vy:Math.sin(m)*y-2,color:s[Math.floor(Math.random()*s.length)],size:8+Math.random()*8,rotation:Math.random()*360,rotationSpeed:(Math.random()-.5)*20,isCircle:Math.random()>.5})}i(f);const v=setTimeout(()=>{c(!1),i([]),r?.()},o);return()=>clearTimeout(v)}},[t,g,r,a,o,s]);const h=b.useCallback(()=>{i(f=>f.map(v=>({...v,x:v.x+v.vx*.5,y:v.y+v.vy*.5,vy:v.vy+.15,rotation:v.rotation+v.rotationSpeed})))},[]);return b.useEffect(()=>{if(!g||l.length===0)return;const f=setInterval(h,16);return()=>clearInterval(f)},[g,l.length,h]),!g||l.length===0?null:e.jsx("div",{className:u("fixed inset-0 pointer-events-none z-50 overflow-hidden",n),"aria-hidden":"true",children:l.map(f=>e.jsx("div",{className:"absolute",style:{left:`${f.x}%`,top:`${f.y}%`,width:f.size,height:f.size,backgroundColor:f.color,transform:`rotate(${f.rotation}deg)`,borderRadius:f.isCircle?"50%":"2px",opacity:Math.max(0,1-f.y/150)}},f.id))})},Ue=W.cva("transition-all duration-200 focus:outline-none focus:ring-2 focus:ring-blue-500 focus:ring-offset-2 rounded-sm",{variants:{variant:{subtle:T.textVariants.link.subtle(),default:T.textVariants.link.default(),muted:T.textVariants.link.muted(),external:T.textVariants.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"}}),Ze=V.forwardRef(({className:t,variant:r,size:a,to:o,href:s,external:n,children:l,onTrack:i,trackingLabel:g,componentName:c,onClick:h,...f},v)=>{const p=o||s,m=n||p&&(p.startsWith("http")||p.startsWith("mailto:")),y=x=>{i&&i({action:"click",trackingLabel:g,componentName:c}),h?.(x)};return p?m?e.jsx("a",{className:u(Ue({variant:r==="subtle"?"external":r,size:a,className:t})),href:p,target:"_blank",rel:"noopener noreferrer",ref:v,onClick:y,...f,children:l}):e.jsx(H.Link,{className:u(Ue({variant:r,size:a,className:t})),to:p,ref:v,onClick:y,...f,children:l}):e.jsx("span",{className:u(Ue({variant:r,size:a,className:t})),onClick:y,...f,children:l})});Ze.displayName="SmartLink";const bn=(t,r)=>V.useMemo(()=>{let a=t;return Object.entries(r).forEach(([o,s])=>{const n=new RegExp(`\\b${o.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}\\b`,"gi");a=a.replace(n,l=>`<SmartLink to="${s}" variant="subtle">${l}</SmartLink>`)}),a},[t,r]),mn={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"},pn=({children:t,mappings:r=mn,className:a,variant:o="subtle"})=>{const s=V.useMemo(()=>{if(!t||typeof t!="string")return t||"";let l=t;return Object.entries(r).sort(([g],[c])=>c.length-g.length).forEach(([g,c])=>{if(g&&c){const h=new RegExp(`\\b${g.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}\\b`,"gi");l=l.replace(h,f=>`__LINK_START__${c}__LINK_MID__${f}__LINK_END__`)}}),l},[t,r]);if(!s||typeof s!="string")return e.jsx("span",{className:a,children:t});const n=s.split(/(__LINK_START__.*?__LINK_END__)/);return e.jsx("span",{className:a,children:n.map((l,i)=>{const g=l.match(/__LINK_START__(.*?)__LINK_MID__(.*?)__LINK_END__/);if(g){const[,c,h]=g;return e.jsx(Ze,{to:c,variant:o,children:h},i)}return l})})},yn=({href:t,children:r,variant:a="default",external:o=!1,showExternalIcon:s=!1,disabled:n=!1,className:l,onTrack:i,trackingLabel:g,componentName:c,onClick:h,...f})=>{const v=o||t.startsWith("http://")||t.startsWith("https://"),p={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"},m=v?{target:"_blank",rel:"noopener noreferrer"}:{},y=x=>{i&&i({action:"click",trackingLabel:g,componentName:c}),h?.(x)};return n?e.jsxs("span",{className:u("cursor-not-allowed opacity-50",p[a],l),children:[r,s&&v&&e.jsx(z.ArrowTopRightOnSquareIcon,{className:"inline-block h-4 w-4 ml-1"})]}):e.jsxs("a",{href:t,className:u("inline-flex items-center transition-colors",p[a],l),onClick:y,...m,...f,children:[r,s&&v&&e.jsx(z.ArrowTopRightOnSquareIcon,{className:"inline-block h-4 w-4 ml-1 flex-shrink-0"})]})},vn=({href:t,children:r,showIcon:a=!0,iconPosition:o="right",size:s="md",variant:n="default",className:l,onClick:i})=>{const g={sm:{text:T.textVariants.body.sm(),icon:"h-3 w-3",gap:"gap-1"},md:{text:T.textVariants.body.md(),icon:"h-4 w-4",gap:"gap-1.5"},lg:{text:T.textVariants.body.lg(),icon:"h-5 w-5",gap:"gap-2"}},c={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=g[s];return e.jsxs("a",{href:t,target:"_blank",rel:"noopener noreferrer",onClick:i,className:u("inline-flex items-center",h.gap,h.text,c[n],"underline decoration-1 underline-offset-2","hover:decoration-2","transition-all duration-200",l),children:[a&&o==="left"&&e.jsx(z.ArrowTopRightOnSquareIcon,{className:u(h.icon,"flex-shrink-0")}),e.jsx("span",{children:r}),a&&o==="right"&&e.jsx(z.ArrowTopRightOnSquareIcon,{className:u(h.icon,"flex-shrink-0")})]})},Ae=new Set,xn=()=>{Ae.clear()},kn=t=>Ae.has(t);function wn(t,r,a,o){let s=t;if(a.length>0){const n=new RegExp(`^/(${a.join("|")})/`);s=s.replace(n,"/")}for(const{pattern:n,replacement:l}of o)s=s.replace(n,l);if(r[s])return r[s];for(const[n,l]of Object.entries(r))if(s.endsWith(n))return l}const Cn=({preload:t,preloadDelay:r=50,routeModules:a={},languagePrefixes:o=[],pathNormalizations:s=[],to:n,children:l,onMouseEnter:i,onMouseLeave:g,onFocus:c,...h})=>{const f=b.useRef(null),v=b.useCallback(()=>{const N=typeof n=="string"?n:n.pathname||"";if(Ae.has(N))return;const k=t||wn(N,a,o,s);k&&(f.current=setTimeout(()=>{k().then(()=>{Ae.add(N)}).catch(()=>{})},r))},[t,r,n,a,o,s]),p=b.useCallback(()=>{f.current&&(clearTimeout(f.current),f.current=null)},[]),m=b.useCallback(N=>{v(),i?.(N)},[v,i]),y=b.useCallback(N=>{p(),g?.(N)},[p,g]),x=b.useCallback(N=>{v(),c?.(N)},[v,c]);return e.jsx(H.Link,{to:n,onMouseEnter:m,onMouseLeave:y,onFocus:x,...h,children:l})},Nn=({items:t,separator:r="/",className:a})=>e.jsx("nav",{className:u("flex items-center gap-2 text-sm",a),children:t.map((o,s)=>e.jsxs(b.Fragment,{children:[s>0&&e.jsx("span",{className:"text-gray-400 dark:text-gray-600",children:r}),s===t.length-1?e.jsx("span",{className:"text-gray-900 dark:text-white font-medium",children:o.label}):e.jsx("button",{onClick:o.onClick,className:"text-blue-600 dark:text-blue-400 hover:underline",children:o.label})]},s))}),Vr=V.forwardRef(({onTrack:t,trackingLabel:r,componentName:a,onValueChange:o,children:s,...n},l)=>{const i=g=>{t&&t({action:"change",trackingLabel:r,componentName:a}),o?.(g)};return e.jsx(re.Root,{ref:l,onValueChange:i,...n,children:s})});Vr.displayName="Tabs";const Wr=V.forwardRef(({className:t,...r},a)=>e.jsx(re.List,{ref:a,className:u(T.variants.navigation.tabs.list(),t),...r}));Wr.displayName=re.List.displayName;const Hr=V.forwardRef(({className:t,...r},a)=>e.jsx(re.Trigger,{ref:a,className:u(T.variants.navigation.tabs.trigger(),t),...r}));Hr.displayName=re.Trigger.displayName;const _r=V.forwardRef(({className:t,...r},a)=>e.jsx(re.Content,{ref:a,className:u(T.variants.navigation.tabs.content(),t),...r}));_r.displayName=re.Content.displayName;const Sn=({items:t,orientation:r="horizontal",className:a})=>{const[o,s]=b.useState(new Set),n=i=>{s(g=>{const c=new Set(g);return c.has(i)?c.delete(i):c.add(i),c})},l=(i,g)=>{const c=i.children&&i.children.length>0,h=o.has(g),f=e.jsxs(e.Fragment,{children:[i.icon&&e.jsx("span",{className:"flex-shrink-0 w-4 h-4",children:i.icon}),e.jsx("span",{className:"flex-1",children:i.label}),c&&e.jsx("svg",{className:u("w-4 h-4 transition-transform",r==="horizontal"&&!h&&"-rotate-90",h&&"rotate-180"),fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 9l-7 7-7-7"})})]}),v=u("flex items-center gap-2 px-4 py-2 text-sm font-medium","transition-colors",i.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 e.jsxs("div",{children:[c?e.jsx("button",{onClick:()=>n(g),className:u(v,"w-full"),children:f}):i.href?e.jsx("a",{href:i.href,className:v,onClick:i.onClick,children:f}):e.jsx("button",{onClick:i.onClick,className:u(v,"w-full"),children:f}),c&&h&&e.jsx("div",{className:u("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:i.children.map((p,m)=>e.jsx("div",{children:p.href?e.jsxs("a",{href:p.href,onClick:p.onClick,className:u("flex items-center gap-2 px-4 py-2 text-sm","transition-colors",p.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:[p.icon&&e.jsx("span",{className:"flex-shrink-0 w-4 h-4",children:p.icon}),p.label]}):e.jsxs("button",{onClick:p.onClick,className:u("w-full flex items-center gap-2 px-4 py-2 text-sm","transition-colors",p.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:[p.icon&&e.jsx("span",{className:"flex-shrink-0 w-4 h-4",children:p.icon}),p.label]})},m))})]},g)};return e.jsx("nav",{className:u("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:t.map((i,g)=>l(i,g))})},Ln=({items:t,selectedPath:r,onSelect:a,variant:o="default",className:s})=>{const n=o==="compact"?"space-y-1":"space-y-0";return e.jsx("div",{className:u(n,s),children:t.map(l=>{const i=l.icon,g=r===l.path,c=l.disabled,h=u("flex items-start cursor-pointer transition-colors",o==="compact"?"p-3 rounded-lg":"p-4 border-b border-gray-200 dark:border-gray-700 last:border-b-0",c&&"opacity-50 cursor-not-allowed"),f=g?"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 e.jsxs("div",{onClick:()=>!c&&a(l.path),className:u(h,!c&&f),role:"button",tabIndex:c?-1:0,"aria-current":g?"page":void 0,"aria-disabled":c,onKeyDown:v=>{!c&&(v.key==="Enter"||v.key===" ")&&(v.preventDefault(),a(l.path))},children:[e.jsx(i,{className:"h-5 w-5 mt-0.5 mr-3 flex-shrink-0"}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsxs("div",{className:u("font-medium",T.textVariants.body.md()),children:[l.label,l.badge!==void 0&&l.badge>0&&e.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&&e.jsx("div",{className:u("text-xs text-gray-500 dark:text-gray-400 mt-0.5"),children:l.description})]})]},l.id)})})},En=({items:t,className:r})=>e.jsx("nav",{className:u("flex flex-col gap-1",r),children:t.map(a=>e.jsxs("button",{onClick:a.onClick,className:u("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&&e.jsx("span",{className:"w-5 h-5",children:a.icon}),e.jsx("span",{className:"flex-1 text-left font-medium",children:a.label}),a.badge&&e.jsx("span",{className:"px-2 py-0.5 bg-gray-200 dark:bg-gray-700 rounded text-xs",children:a.badge})]},a.id))}),Mn=({currentPage:t,totalPages:r,onPageChange:a,siblingCount:o=1,showFirstLast:s=!1,size:n="md",className:l})=>{const g={sm:{button:"h-8 w-8 text-xs",icon:"h-3 w-3",text:T.textVariants.body.sm()},md:{button:"h-10 w-10 text-sm",icon:"h-4 w-4",text:T.textVariants.body.md()},lg:{button:"h-12 w-12 text-base",icon:"h-5 w-5",text:T.textVariants.body.lg()}}[n],h=(()=>{const k=[];k.push(1);const S=Math.max(t-o,2),w=Math.min(t+o,r-1);S>2&&k.push("ellipsis");for(let C=S;C<=w;C++)k.push(C);return w<r-1&&k.push("ellipsis"),r>1&&k.push(r),k})(),f=()=>{t>1&&a(t-1)},v=()=>{t<r&&a(t+1)},p=()=>{a(1)},m=()=>{a(r)},y=u("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"),x=k=>u(y,g.button,g.text,k?"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"),N=u(y,g.button,"bg-white dark:bg-gray-800 text-gray-700 dark:text-gray-300","hover:bg-gray-50 dark:hover:bg-gray-700");return e.jsxs("nav",{className:u("flex items-center gap-1",l),"aria-label":"Pagination",children:[s&&e.jsx("button",{onClick:p,disabled:t===1,className:N,"aria-label":"Go to first page",children:e.jsx("span",{className:g.text,children:"First"})}),e.jsx("button",{onClick:f,disabled:t===1,className:N,"aria-label":"Go to previous page",children:e.jsx(z.ChevronLeftIcon,{className:g.icon})}),h.map((k,S)=>k==="ellipsis"?e.jsx("span",{className:u("inline-flex items-center justify-center",g.button,"text-gray-400 dark:text-gray-500"),children:"..."},`ellipsis-${S}`):e.jsx("button",{onClick:()=>a(k),className:x(k===t),"aria-label":`Go to page ${k}`,"aria-current":k===t?"page":void 0,children:k},k)),e.jsx("button",{onClick:v,disabled:t===r,className:N,"aria-label":"Go to next page",children:e.jsx(z.ChevronRightIcon,{className:g.icon})}),s&&e.jsx("button",{onClick:m,disabled:t===r,className:N,"aria-label":"Go to last page",children:e.jsx("span",{className:g.text,children:"Last"})})]})},In=({currentPage:t,totalPages:r,onPageChange:a,maxVisible:o=7,className:s})=>{const n=[];if(r<=o)for(let l=1;l<=r;l++)n.push(l);else{n.push(1),t>3&&n.push("...");const l=Math.max(2,t-1),i=Math.min(r-1,t+1);for(let g=l;g<=i;g++)n.push(g);t<r-2&&n.push("..."),n.push(r)}return e.jsxs("nav",{className:u("flex items-center gap-1",s),children:[e.jsx("button",{onClick:()=>a(t-1),disabled:t===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"}),n.map((l,i)=>l==="..."?e.jsx("span",{className:"px-3 py-2",children:"..."},`ellipsis-${i}`):e.jsx("button",{onClick:()=>a(l),className:u("px-3 py-2 rounded",l===t?"bg-blue-500 text-white":"hover:bg-gray-100 dark:hover:bg-gray-800"),children:l},l)),e.jsx("button",{onClick:()=>a(t+1),disabled:t===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"})]})},Tn=({steps:t,currentStep:r,orientation:a="horizontal",clickable:o=!1,onStepClick:s,className:n})=>{const l=g=>{o&&s&&s(g)},i=g=>g<r?"completed":g===r?"active":"upcoming";return a==="horizontal"?e.jsx("div",{className:u("w-full",n),children:e.jsx("div",{className:"flex items-center justify-between",children:t.map((g,c)=>{const h=i(c),f=c===t.length-1;return e.jsxs(b.Fragment,{children:[e.jsxs("div",{className:"flex flex-col items-center",children:[e.jsx("button",{onClick:()=>l(c),disabled:!o,className:u("flex items-center justify-center w-10 h-10 rounded-full border-2 transition-all","disabled:cursor-default",o&&"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"?e.jsx("svg",{className:"w-5 h-5 text-white",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:3,d:"M5 13l4 4L19 7"})}):g.icon?e.jsx("span",{className:u("w-5 h-5",h==="active"?"text-blue-600 dark:text-blue-500":"text-gray-400 dark:text-gray-600"),children:g.icon}):e.jsx("span",{className:u("text-sm font-semibold",h==="active"?"text-blue-600 dark:text-blue-500":"text-gray-400 dark:text-gray-600"),children:c+1})}),e.jsxs("div",{className:"mt-2 text-center",children:[e.jsx("p",{className:u("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:g.label}),g.description&&e.jsx("p",{className:"text-xs text-gray-500 dark:text-gray-400 mt-0.5",children:g.description})]})]}),!f&&e.jsx("div",{className:"flex-1 h-0.5 mx-2 bg-gray-300 dark:bg-gray-700 relative",children:e.jsx("div",{className:u("absolute left-0 top-0 h-full bg-blue-600 dark:bg-blue-500 transition-all duration-300",c<r?"w-full":"w-0")})})]},g.id)})})}):e.jsx("div",{className:u("w-full",n),children:e.jsx("div",{className:"space-y-4",children:t.map((g,c)=>{const h=i(c),f=c===t.length-1;return e.jsxs("div",{className:"flex gap-4",children:[e.jsxs("div",{className:"flex flex-col items-center",children:[e.jsx("button",{onClick:()=>l(c),disabled:!o,className:u("flex items-center justify-center w-10 h-10 rounded-full border-2 transition-all","disabled:cursor-default flex-shrink-0",o&&"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"?e.jsx("svg",{className:"w-5 h-5 text-white",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:3,d:"M5 13l4 4L19 7"})}):g.icon?e.jsx("span",{className:u("w-5 h-5",h==="active"?"text-blue-600 dark:text-blue-500":"text-gray-400 dark:text-gray-600"),children:g.icon}):e.jsx("span",{className:u("text-sm font-semibold",h==="active"?"text-blue-600 dark:text-blue-500":"text-gray-400 dark:text-gray-600"),children:c+1})}),!f&&e.jsx("div",{className:"w-0.5 flex-1 min-h-[32px] bg-gray-300 dark:bg-gray-700 relative mt-2",children:e.jsx("div",{className:u("absolute top-0 left-0 w-full bg-blue-600 dark:bg-blue-500 transition-all duration-300",c<r?"h-full":"h-0")})})]}),e.jsxs("div",{className:"flex-1 pb-4",children:[e.jsx("p",{className:u("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:g.label}),g.description&&e.jsx("p",{className:"text-xs text-gray-500 dark:text-gray-400 mt-1",children:g.description})]})]},g.id)})})})},Pn=({steps:t,currentStep:r,onStepClick:a,orientation:o="horizontal",className:s})=>e.jsx("nav",{className:u(o==="horizontal"?"flex items-center":"flex flex-col",s),children:t.map((n,l)=>e.jsxs("div",{className:u("flex items-center",o==="vertical"&&"flex-col items-start"),children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("button",{onClick:()=>a?.(l),disabled:l>r,className:u("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}),e.jsxs("div",{children:[e.jsx("p",{className:"font-medium text-gray-900 dark:text-white",children:n.label}),n.description&&e.jsx("p",{className:"text-sm text-gray-600 dark:text-gray-400",children:n.description})]})]}),l<t.length-1&&e.jsx("div",{className:u(o==="horizontal"?"w-full h-0.5 mx-4":"h-8 w-0.5 ml-5 my-2","bg-gray-300 dark:bg-gray-700")})]},n.id))}),zn=({subsections:t,isExpanded:r,selectedSubsection:a,parentSectionId:o,onSubsectionSelect:s})=>{const n=b.useRef(null),[l,i]=b.useState(void 0);return b.useEffect(()=>{if(n.current){const g=n.current.scrollHeight;i(r?g+8:0)}},[r,t]),e.jsx("div",{className:"overflow-hidden transition-all duration-300 ease-in-out",style:{height:l!==void 0?`${l}px`:"auto"},children:e.jsx("div",{ref:n,className:"ml-6 mt-2 space-y-1",children:t.map(g=>e.jsx("button",{onClick:()=>s?.(g.id,o),className:`block w-full text-left px-3 py-2 rounded-md text-sm transition-all duration-200 hover:scale-[1.02] ${a===g.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:g.title},g.id))})})},Un=({sections:t,selectedSection:r,selectedSubsection:a,expandedSections:o,onSectionSelect:s,onSubsectionSelect:n,onToggleSection:l,className:i=""})=>e.jsx("nav",{className:`space-y-2 ${i}`,children:t.map(g=>e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center",children:[e.jsx("button",{onClick:()=>s(g.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===g.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:g.title}),g.subsections&&g.subsections.length>0&&e.jsx("button",{onClick:()=>l(g.id),className:"p-1 rounded-md hover:bg-gray-100 dark:hover:bg-gray-800 hover:scale-110 transition-all duration-200",children:e.jsx(z.ChevronRightIcon,{className:`h-4 w-4 text-gray-500 transition-transform duration-300 ease-in-out ${o.includes(g.id)?"rotate-90":"rotate-0"}`})})]}),g.subsections&&e.jsx(zn,{subsections:g.subsections,isExpanded:o.includes(g.id),selectedSubsection:a,parentSectionId:g.id,onSubsectionSelect:n})]},g.id))});function An({columns:t,data:r,keyExtractor:a,sort:o,onSort:s,onRowClick:n,striped:l=!1,hoverable:i=!1,compact:g=!1,bordered:c=!1,emptyMessage:h="No data available",className:f}){const v=m=>{m.sortable&&s&&s(m.key)},p={left:"text-left",center:"text-center",right:"text-right"};return e.jsx("div",{className:u("w-full overflow-x-auto",f),children:e.jsxs("table",{className:"w-full",children:[e.jsx("thead",{className:"bg-gray-50 dark:bg-gray-800 border-b border-gray-200 dark:border-gray-700",children:e.jsx("tr",{children:t.map(m=>e.jsx("th",{className:u(g?"px-3 py-2":"px-6 py-3","text-xs font-medium text-gray-700 dark:text-gray-300 uppercase tracking-wider",p[m.align||"left"],m.sortable&&"cursor-pointer select-none hover:bg-gray-100 dark:hover:bg-gray-700",c&&"border-r border-gray-200 dark:border-gray-700 last:border-r-0"),style:{width:m.width},onClick:()=>m.sortable&&v(m),children:e.jsxs("div",{className:"flex items-center gap-2",children:[m.label,m.sortable&&e.jsx("span",{className:"flex flex-col",children:o?.column===m.key?o.direction==="asc"?e.jsx("svg",{className:"w-4 h-4",fill:"currentColor",viewBox:"0 0 20 20",children:e.jsx("path",{d:"M5 10l5-5 5 5H5z"})}):e.jsx("svg",{className:"w-4 h-4",fill:"currentColor",viewBox:"0 0 20 20",children:e.jsx("path",{d:"M15 10l-5 5-5-5h10z"})}):e.jsx("svg",{className:"w-4 h-4 text-gray-400",fill:"currentColor",viewBox:"0 0 20 20",children:e.jsx("path",{d:"M5 10l5-5 5 5H5z"})})})]})},m.key))})}),e.jsx("tbody",{className:"bg-white dark:bg-gray-900 divide-y divide-gray-200 dark:divide-gray-700",children:r.length===0?e.jsx("tr",{children:e.jsx("td",{colSpan:t.length,className:"px-6 py-8 text-center text-sm text-gray-500 dark:text-gray-400",children:h})}):r.map((m,y)=>e.jsx("tr",{className:u(l&&y%2===1&&"bg-gray-50 dark:bg-gray-800/50",i&&"hover:bg-gray-100 dark:hover:bg-gray-800 transition-colors",n&&"cursor-pointer"),onClick:()=>n?.(m,y),children:t.map(x=>e.jsx("td",{className:u(g?"px-3 py-2":"px-6 py-4","text-sm text-gray-900 dark:text-white",p[x.align||"left"],c&&"border-r border-gray-200 dark:border-gray-700 last:border-r-0"),children:x.render?x.render(m,y):m[x.key]},x.key))},a(m,y)))})]})})}const $n=({data:t,columns:r,hasActions:a=!1,renderCell:o,renderAction:s,emptyMessage:n="No data available",getRowKey:l=(g,c)=>String(c),className:i=""})=>!t||t.length===0?e.jsx("div",{className:`text-center py-8 bg-gray-50 dark:bg-gray-800 rounded-lg ${i}`,children:e.jsx("p",{className:`${T.textVariants.body.sm()} text-gray-500 dark:text-gray-400`,children:n})}):e.jsx("div",{className:`relative ${i}`,children:e.jsx("div",{className:"overflow-x-auto",children:e.jsxs("table",{className:"w-full border-collapse",children:[e.jsx("thead",{children:e.jsxs("tr",{className:"border-b border-gray-200 dark:border-gray-700",children:[r.map((g,c)=>e.jsx("th",{className:`${T.textVariants.label.default()} text-left py-3 px-4 whitespace-nowrap`,children:g},c)),a&&e.jsx("th",{className:`${T.textVariants.label.default()} text-right py-3 px-4 sticky right-0 bg-white dark:bg-gray-900 whitespace-nowrap`})]})}),e.jsx("tbody",{children:t.map((g,c)=>e.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,f)=>{const v=o(g,f);return e.jsx("td",{className:"py-3 px-4",children:typeof v=="string"?e.jsx("span",{className:T.textVariants.body.sm(),children:v}):v},f)}),a&&e.jsx("td",{className:"py-3 px-4 text-right sticky right-0 bg-white dark:bg-gray-900",children:s?.(g)})]},l(g,c)))})]})})}),Dn=({className:t,children:r,disabled:a=!1,onClick:o})=>e.jsx("div",{className:u("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",t),onClick:a?void 0:o,role:"region","aria-label":"UdataUgrid",children:r||"UdataUgrid Component"}),Bn=({className:t,children:r,disabled:a=!1,onClick:o})=>e.jsx("div",{className:u("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",t),onClick:a?void 0:o,role:"region","aria-label":"UpivotUtable",children:r||"UpivotUtable Component"}),jn=({className:t,children:r,disabled:a=!1,onClick:o})=>e.jsx("div",{className:u("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",t),onClick:a?void 0:o,role:"region","aria-label":"UspreadsheetUgrid",children:r||"UspreadsheetUgrid Component"}),Fn=({className:t,children:r,disabled:a=!1,onClick:o})=>e.jsx("div",{className:u("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",t),onClick:a?void 0:o,role:"region","aria-label":"UcolumnUresize",children:r||"UcolumnUresize Component"}),On=({className:t,children:r,disabled:a=!1,onClick:o})=>e.jsx("div",{className:u("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",t),onClick:a?void 0:o,role:"region","aria-label":"UcellUeditor",children:r||"UcellUeditor Component"}),Vn=({className:t,children:r,disabled:a=!1,onClick:o})=>e.jsx("div",{className:u("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",t),onClick:a?void 0:o,role:"region","aria-label":"UtableUreservation",children:r||"UtableUreservation Component"}),Wn=({children:t,type:r="unordered",spacing:a="sm",marker:o,size:s="md",className:n})=>{const l=r==="ordered"?"ol":"ul",i={none:"space-y-0",sm:"space-y-1",md:"space-y-2",lg:"space-y-4"},g={sm:"text-sm",md:"text-base",lg:"text-lg"},c=()=>o==="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"}[o||"disc"]:{decimal:"list-decimal",alpha:"list-alpha",roman:"list-roman",disc:"list-decimal",circle:"list-decimal",square:"list-decimal",none:"list-none"}[o||"decimal"];return e.jsx(l,{className:u("ml-6",c(),i[a],g[s],"text-gray-900 dark:text-gray-100",n),children:t})},Hn=({children:t,className:r})=>e.jsx("li",{className:u("leading-relaxed",r),children:t}),_n=({children:t,onAction:r,actionText:a="Remove",actionIcon:o=z.TrashIcon,destructive:s=!0,isProcessing:n=!1,variant:l="default",className:i})=>{const g="flex items-center justify-between p-4 rounded-lg transition-colors",c={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 e.jsxs("div",{className:u(g,c[l],i),children:[e.jsx("div",{className:"flex-1 text-sm text-gray-900 dark:text-white",children:t}),e.jsxs(G,{variant:s?"ghost":"outline",size:"sm",onClick:r,disabled:n,className:u("ml-4",s&&"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:[e.jsx(o,{className:"h-4 w-4 mr-1"}),a]})]})},qn=({className:t,children:r,disabled:a=!1,onClick:o})=>e.jsx("div",{className:u("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",t),onClick:a?void 0:o,role:"region","aria-label":"UuserUtable",children:r||"UuserUtable Component"}),Gn=({source:t,target:r,onChange:a,sourceTitle:o="Available",targetTitle:s="Selected",searchable:n=!0,sourceSearchPlaceholder:l="Search available...",targetSearchPlaceholder:i="Search selected...",height:g=300,disabled:c=!1,className:h})=>{const[f,v]=b.useState(""),[p,m]=b.useState(""),[y,x]=b.useState(new Set),[N,k]=b.useState(new Set),S=n?t.filter(A=>A.label.toLowerCase().includes(f.toLowerCase())):t,w=n?r.filter(A=>A.label.toLowerCase().includes(p.toLowerCase())):r,C=A=>{const D=new Set(y);D.has(A)?D.delete(A):D.add(A),x(D)},E=A=>{const D=new Set(N);D.has(A)?D.delete(A):D.add(A),k(D)},M=()=>{const A=t.filter(B=>y.has(B.id)),D=t.filter(B=>!y.has(B.id)),$=[...r,...A];a(D,$),x(new Set)},L=()=>{const A=r.filter(B=>N.has(B.id)),D=r.filter(B=>!N.has(B.id)),$=[...t,...A];a($,D),k(new Set)},I=()=>{const A=[...r,...t];a([],A),x(new Set)},U=()=>{const A=[...t,...r];a(A,[]),k(new Set)},P=(A,D,$,B,j,_,su)=>e.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:[e.jsxs("div",{className:"px-3 py-2 border-b border-gray-300 dark:border-gray-700 bg-gray-50 dark:bg-gray-800",children:[e.jsx("h3",{className:"text-sm font-semibold text-gray-900 dark:text-white",children:D}),e.jsxs("p",{className:"text-xs text-gray-600 dark:text-gray-400",children:[A.length," item",A.length!==1?"s":""]})]}),n&&e.jsx("div",{className:"p-2 border-b border-gray-200 dark:border-gray-700",children:e.jsx("input",{type:"text",value:j,onChange:Y=>_(Y.target.value),placeholder:su,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"})}),e.jsx("div",{className:"overflow-y-auto p-2 space-y-1",style:{height:n?g-120:g-60},children:A.length===0?e.jsx("div",{className:"flex items-center justify-center h-full text-sm text-gray-500 dark:text-gray-400",children:"No items"}):A.map(Y=>{const Nr=$.has(Y.id);return e.jsx("button",{onClick:()=>!Y.disabled&&B(Y.id),disabled:Y.disabled||c,className:u("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",Nr&&"bg-blue-50 dark:bg-blue-900/30 border border-blue-200 dark:border-blue-700"),children:e.jsxs("div",{className:"flex items-start gap-2",children:[e.jsx("div",{className:u("w-4 h-4 border-2 rounded flex items-center justify-center flex-shrink-0 mt-0.5",Nr?"bg-blue-600 border-blue-600 dark:bg-blue-500 dark:border-blue-500":"border-gray-300 dark:border-gray-600"),children:Nr&&e.jsx("svg",{className:"w-3 h-3 text-white",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:3,d:"M5 13l4 4L19 7"})})}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("p",{className:"text-sm font-medium text-gray-900 dark:text-white truncate",children:Y.label}),Y.description&&e.jsx("p",{className:"text-xs text-gray-600 dark:text-gray-400 truncate",children:Y.description})]})]})},Y.id)})})]});return e.jsxs("div",{className:u("flex gap-4",h),children:[P(S,o,y,C,f,v,l),e.jsxs("div",{className:"flex flex-col justify-center gap-2",children:[e.jsx("button",{onClick:I,disabled:c||t.length===0,className:u("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:e.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M13 5l7 7-7 7M5 5l7 7-7 7"})})}),e.jsx("button",{onClick:M,disabled:c||y.size===0,className:u("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:e.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 5l7 7-7 7"})})}),e.jsx("button",{onClick:L,disabled:c||N.size===0,className:u("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:e.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M15 19l-7-7 7-7"})})}),e.jsx("button",{onClick:U,disabled:c||r.length===0,className:u("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:e.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M11 19l-7-7 7-7M19 19l-7-7 7-7"})})})]}),P(w,s,N,E,p,m,i)]})};function Kn({items:t,itemHeight:r,height:a,renderItem:o,keyExtractor:s,overscan:n=3,className:l}){const[i,g]=b.useState(0),c=b.useRef(null),h=y=>{g(y.currentTarget.scrollTop)},f=t.length*r,v=Math.max(0,Math.floor(i/r)-n),p=Math.min(t.length-1,Math.ceil((i+a)/r)+n),m=t.slice(v,p+1);return e.jsx("div",{ref:c,className:u("overflow-auto",l),style:{height:a},onScroll:h,children:e.jsx("div",{style:{height:f,position:"relative"},children:m.map((y,x)=>{const N=v+x;return e.jsx("div",{style:{position:"absolute",top:N*r,height:r,width:"100%"},children:o(y,N)},s(y,N))})})})}const Yn=({data:t,selectedId:r,onSelect:a,expandedIds:o,onExpand:s,defaultExpanded:n=!1,showLines:l=!1,className:i})=>{const[g,c]=b.useState(new Set(n?t.map(m=>m.id):[])),h=o!==void 0?new Set(o):g,f=m=>{o!==void 0&&s?s(m):c(y=>{const x=new Set(y);return x.has(m)?x.delete(m):x.add(m),x})},v=m=>{!m.disabled&&a&&a(m)},p=(m,y=0)=>{const x=m.children&&m.children.length>0,N=h.has(m.id),k=r===m.id;return e.jsxs("div",{children:[e.jsxs("div",{className:u("flex items-center gap-2 px-2 py-1.5 rounded-md transition-colors",!m.disabled&&"hover:bg-gray-100 dark:hover:bg-gray-800",k&&"bg-blue-50 dark:bg-blue-900/30",m.disabled&&"opacity-50 cursor-not-allowed",!m.disabled&&"cursor-pointer"),style:{paddingLeft:`${y*1.5+.5}rem`},onClick:()=>v(m),children:[x?e.jsx("button",{onClick:S=>{S.stopPropagation(),f(m.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:e.jsx("svg",{className:u("w-3 h-3 transition-transform",N&&"rotate-90"),fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 5l7 7-7 7"})})}):e.jsx("div",{className:"w-4 h-4 flex-shrink-0"}),m.icon&&e.jsx("span",{className:"flex-shrink-0 w-4 h-4 text-gray-600 dark:text-gray-400",children:m.icon}),e.jsx("span",{className:u("flex-1 text-sm",k?"text-blue-700 dark:text-blue-300 font-medium":"text-gray-900 dark:text-white"),children:m.label})]}),x&&N&&e.jsx("div",{className:u(l&&"border-l-2 border-gray-200 dark:border-gray-700 ml-2"),children:m.children.map(S=>p(S,y+1))})]},m.id)};return e.jsx("div",{className:u("w-full",i),children:t.map(m=>p(m,0))})},Qn=({className:t,children:r,disabled:a=!1,onClick:o})=>e.jsx("div",{className:u("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",t),onClick:a?void 0:o,role:"region","aria-label":"UlistingUform",children:r||"UlistingUform Component"}),Xn="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",Jn={none:"",sm:"p-3",md:"p-6",lg:"p-8"},Re=({variant:t="elevated",padding:r="md",icon:a,onClose:o,className:s,children:n,...l})=>{const g=["info","success","warning","error"].includes(t)&&(a||o),c=t==="callout"?Xn:T.getCardVariantColors(t);return e.jsx("div",{className:u("rounded-lg",c,Jn[r],s),...l,children:g?e.jsxs("div",{className:"flex items-start gap-3",children:[a&&e.jsx("div",{className:"flex-shrink-0 text-lg",children:a}),e.jsx("div",{className:"flex-1 min-w-0",children:n}),o&&e.jsx("button",{onClick:o,className:"flex-shrink-0 text-current hover:opacity-70 transition-opacity","aria-label":"Close",children:e.jsx("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})})]}):n})},Zn=({title:t,description:r,className:a,children:o,...s})=>e.jsxs("div",{className:u("space-y-1.5",a),...s,children:[t&&e.jsx("h3",{className:T.textVariants.heading.h4(),children:t}),r&&e.jsx("p",{className:T.textVariants.body.sm(),children:r}),o]}),Rn=({className:t,children:r,...a})=>e.jsx("div",{className:u("",t),...a,children:r}),el=({className:t,children:r,...a})=>e.jsx("div",{className:u("flex items-center pt-4",t),...a,children:r}),rl=({title:t,children:r,variant:a="info",size:o="default",className:s})=>{const n={sm:"sm",default:"md",lg:"lg"},l=a==="neutral"?"bordered":a;return e.jsxs(Re,{variant:l,padding:n[o],className:s,children:[t&&e.jsx("h3",{className:u("font-semibold mb-2",o==="sm"?"text-base":o==="lg"?"text-xl":"text-lg"),children:t}),r]})},tl=({title:t,icon:r,children:a,variant:o="gradient",size:s="default",centered:n=!1,className:l})=>{const i={sm:"sm",default:"md",lg:"lg"},g=o==="gradient"||o==="neutral"?"callout":o;return e.jsx(Re,{variant:g,padding:i[s],className:l,children:e.jsxs("div",{className:u("space-y-4",n&&"text-center"),children:[r&&e.jsx("div",{className:u("font-bold",s==="sm"?"text-2xl":s==="lg"?"text-5xl":"text-4xl",n?"text-center":"text-left"),children:r}),t&&e.jsx("h3",{className:u("font-bold mb-4",s==="sm"?"text-lg":s==="lg"?"text-3xl":"text-2xl"),children:t}),e.jsx("div",{className:u("text-gray-600 dark:text-gray-400",s==="sm"?"text-sm":s==="lg"?"text-lg":"text-base"),children:a})]})})},al=({title:t,value:r,change:a,changePeriod:o="vs last period",icon:s,variant:n="default",className:l})=>{const i={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 e.jsxs("div",{className:u("rounded-lg border border-gray-200 dark:border-gray-700 p-6",i[n],l),children:[e.jsxs("div",{className:"flex items-start justify-between mb-2",children:[e.jsx("h3",{className:"text-sm font-medium text-gray-600 dark:text-gray-400",children:t}),s&&e.jsx("div",{className:"text-gray-400 dark:text-gray-600",children:s})]}),e.jsx("div",{className:"flex items-end justify-between",children:e.jsxs("div",{children:[e.jsx("p",{className:"text-3xl font-bold text-gray-900 dark:text-white",children:r}),a!==void 0&&e.jsxs("div",{className:"flex items-center gap-1 mt-2",children:[e.jsxs("span",{className:u("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),"%"]}),e.jsx("span",{className:"text-xs text-gray-500 dark:text-gray-400",children:o})]})]})})]})},ol=({src:t,alt:r="Avatar",fallback:a,name:o,size:s="md",status:n,className:l,onClick:i})=>{const[g,c]=b.useState(!1),h={sm:"w-8 h-8 text-xs",md:"w-10 h-10 text-sm",lg:"w-12 h-12 text-base"},f={sm:"w-2 h-2",md:"w-2.5 h-2.5",lg:"w-3 h-3"},v={online:"bg-green-500",offline:"bg-gray-400",away:"bg-yellow-500",busy:"bg-red-500"},m=a||(o?(N=>{const k=N.trim().split(/\s+/);return k.length===1?k[0].charAt(0).toUpperCase():k[0].charAt(0).toUpperCase()+k[k.length-1].charAt(0).toUpperCase()})(o):""),y=t&&!g,x=()=>{c(!0)};return e.jsxs("div",{className:"relative inline-block flex-shrink-0",children:[e.jsx("div",{className:u("flex items-center justify-center overflow-hidden rounded-full",h[s],!y&&"bg-gray-300 dark:bg-gray-600 text-gray-700 dark:text-gray-200",i&&"cursor-pointer hover:opacity-80 transition-opacity",l),onClick:i,role:i?"button":void 0,tabIndex:i?0:void 0,children:y?e.jsx("img",{src:t,alt:r,className:"w-full h-full object-cover",onError:x}):e.jsx("span",{className:"font-semibold",children:m})}),n&&e.jsx("span",{className:u("absolute bottom-0 right-0 rounded-full border-2 border-white dark:border-gray-800",v[n],f[s]),"aria-label":n})]})},sl=({className:t,children:r,disabled:a=!1,onClick:o})=>e.jsx("div",{className:u("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",t),onClick:a?void 0:o,role:"region","aria-label":"UavatarUgroup",children:r||"UavatarUgroup Component"}),nl=({className:t,children:r,disabled:a=!1,onClick:o})=>e.jsx("div",{className:u("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",t),onClick:a?void 0:o,role:"region","aria-label":"UprofileUheader",children:r||"UprofileUheader Component"}),ll=({label:t,value:r,orientation:a="vertical",align:o="start",labelWidth:s="auto",size:n="md",separator:l=!1,labelVariant:i="muted",valueVariant:g="default",className:c,labelClassName:h,valueClassName:f})=>{const v={sm:{label:T.textVariants.body.sm(),value:T.textVariants.body.sm(),gap:"gap-1"},md:{label:T.textVariants.body.md(),value:T.textVariants.body.md(),gap:"gap-2"},lg:{label:T.textVariants.body.lg(),value:T.textVariants.body.lg(),gap:"gap-3"}},p={auto:"",sm:"w-24",md:"w-32",lg:"w-40"},m={start:"justify-start",center:"justify-center",between:"justify-between"},y={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"},x={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"},N=v[n];return e.jsxs("div",{className:u(a==="horizontal"?"flex items-center":"flex flex-col",a==="horizontal"&&m[o],N.gap,l&&"pb-3 mb-3 border-b border-gray-200 dark:border-gray-700",c),children:[e.jsx("dt",{className:u(N.label,y[i],a==="horizontal"&&p[s],a==="horizontal"&&"flex-shrink-0",h),children:t}),e.jsx("dd",{className:u(N.value,x[g],a==="horizontal"&&"flex-1",f),children:r})]})},il=({value:t,label:r,variant:a="neutral",size:o="md",align:s="center",icon:n,iconPosition:l="top",className:i,valueClassName:g,labelClassName:c})=>{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"}},f={sm:{value:T.textVariants.heading.h5(),label:T.textVariants.caption.default(),icon:"h-4 w-4"},md:{value:T.textVariants.heading.h4(),label:T.textVariants.body.sm(),icon:"h-5 w-5"},lg:{value:T.textVariants.heading.h3(),label:T.textVariants.body.md(),icon:"h-6 w-6"},xl:{value:T.textVariants.heading.h2(),label:T.textVariants.body.lg(),icon:"h-8 w-8"}},v={left:"text-left",center:"text-center",right:"text-right"},p=h[a],m=f[o];return e.jsxs("div",{className:u(v[s],i),children:[n&&l==="top"&&e.jsx(n,{className:u(m.icon,p.icon,"mb-2",s==="center"&&"mx-auto")}),e.jsxs("div",{className:u(l==="left"&&n&&"flex items-center gap-3",s==="center"&&l==="left"&&"justify-center"),children:[n&&l==="left"&&e.jsx(n,{className:u(m.icon,p.icon)}),e.jsxs("div",{children:[e.jsx("div",{className:u("font-bold",m.value,p.value,g),children:t}),e.jsx("div",{className:u(m.label,p.label,c),children:r})]})]})]})},qr=({icon:t,title:r="No data",description:a,action:o,className:s})=>e.jsxs("div",{className:u("flex flex-col items-center justify-center py-12 px-4 text-center",s),children:[t&&e.jsx("div",{className:"mb-4 text-gray-400 dark:text-gray-600",children:t}),e.jsx("h3",{className:u(T.textVariants.heading.h3(),"mb-2"),children:r}),a&&e.jsx("p",{className:u(T.textVariants.body.sm(),"text-gray-600 dark:text-gray-400 max-w-sm mb-6"),children:a}),o&&e.jsx("div",{className:"mt-4",children:o})]}),cl=({title:t,subtext:r,className:a})=>e.jsx(qr,{title:t,description:r,className:a}),dl=({data:t,orientation:r="vertical",showValues:a=!1,showGrid:o=!0,barWidth:s=40,height:n=300,className:l})=>{const i=Math.max(...t.map(c=>c.value)),g="#3b82f6";return e.jsx("div",{className:u("w-full",l),children:e.jsxs("div",{className:"relative bg-white dark:bg-gray-900 rounded-lg p-6",style:{height:`${n}px`},children:[o&&e.jsx("div",{className:"absolute inset-6 flex flex-col justify-between",children:[...Array(5)].map((c,h)=>e.jsx("div",{className:"border-t border-gray-200 dark:border-gray-700"},h))}),r==="vertical"?e.jsx("div",{className:"relative h-full flex items-end justify-around gap-2",children:t.map((c,h)=>{const f=c.value/i*100;return e.jsxs("div",{className:"flex flex-col items-center gap-2",style:{width:`${s}px`},children:[a&&e.jsx("span",{className:"text-xs text-gray-600 dark:text-gray-400",children:c.value}),e.jsx("div",{className:"w-full rounded-t transition-all hover:opacity-80",style:{height:`${f}%`,backgroundColor:c.color||g}}),e.jsx("span",{className:"text-xs text-gray-600 dark:text-gray-400",children:c.label})]},h)})}):e.jsx("div",{className:"relative h-full flex flex-col justify-around gap-2",children:t.map((c,h)=>{const f=c.value/i*100;return e.jsxs("div",{className:"flex items-center gap-4",children:[e.jsx("span",{className:"text-sm text-gray-600 dark:text-gray-400 w-16 text-right",children:c.label}),e.jsxs("div",{className:"flex-1 flex items-center gap-2",children:[e.jsx("div",{className:"h-8 rounded transition-all hover:opacity-80",style:{width:`${f}%`,backgroundColor:c.color||g}}),a&&e.jsx("span",{className:"text-xs text-gray-600 dark:text-gray-400",children:c.value})]})]},h)})})]})})},gl=({series:t,showLegend:r=!0,showGrid:a=!0,showPoints:o=!0,height:s=300,xLabels:n,className:l})=>{const i=t.flatMap(p=>p.data),g=Math.max(...i.map(p=>p.y)),c=Math.min(...i.map(p=>p.y)),h=Math.max(...i.map(p=>p.x)),f=["#3b82f6","#10b981","#f59e0b","#ef4444","#8b5cf6"],v=p=>p.length===0?"":`M ${p.map(y=>{const x=y.x/h*100,N=100-(y.y-c)/(g-c)*100;return`${x},${N}`}).join(" L ")}`;return e.jsxs("div",{className:u("w-full",l),children:[r&&e.jsx("div",{className:"flex flex-wrap gap-4 mb-4",children:t.map((p,m)=>e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("div",{className:"w-3 h-3 rounded-full",style:{backgroundColor:p.color||f[m%f.length]}}),e.jsx("span",{className:"text-sm text-gray-700 dark:text-gray-300",children:p.name})]},m))}),e.jsxs("div",{className:"bg-white dark:bg-gray-900 rounded-lg p-6",children:[e.jsxs("div",{className:"relative",style:{height:`${s}px`},children:[a&&e.jsx("div",{className:"absolute inset-0",children:[...Array(5)].map((p,m)=>e.jsx("div",{className:"absolute w-full border-t border-gray-200 dark:border-gray-700",style:{top:`${m*25}%`}},m))}),e.jsx("svg",{viewBox:"0 0 100 100",preserveAspectRatio:"none",className:"absolute inset-0 w-full h-full",children:t.map((p,m)=>{const y=p.color||f[m%f.length];return e.jsxs("g",{children:[e.jsx("path",{d:v(p.data),fill:"none",stroke:y,strokeWidth:"0.5",vectorEffect:"non-scaling-stroke"}),o&&p.data.map((x,N)=>{const k=x.x/h*100,S=100-(x.y-c)/(g-c)*100;return e.jsx("circle",{cx:k,cy:S,r:"1",fill:y,vectorEffect:"non-scaling-stroke"},N)})]},m)})})]}),n&&e.jsx("div",{className:"flex justify-between mt-2",children:n.map((p,m)=>e.jsx("span",{className:"text-xs text-gray-600 dark:text-gray-400",children:p},m))})]})]})},ul=({data:t,variant:r="pie",showLegend:a=!0,showPercentages:o=!1,size:s=200,donutHoleSize:n=40,className:l})=>{const i=t.reduce((m,y)=>m+y.value,0),g=["#3b82f6","#10b981","#f59e0b","#ef4444","#8b5cf6","#ec4899"],c=t.reduce((m,y,x)=>{const N=y.value/i*100,k=N/100*360,S=m.length>0?m[m.length-1].endAngle:-90,w=S+k;return m.push({...y,percentage:N,startAngle:S,endAngle:w,color:y.color||g[x%g.length]}),m},[]),h=(m,y,x,N)=>{const k=(N-90)*Math.PI/180;return{x:m+x*Math.cos(k),y:y+x*Math.sin(k)}},f=(m,y,x,N,k)=>{const S=h(m,y,x,k),w=h(m,y,x,N),C=k-N<=180?"0":"1";if(r==="donut"){const E=x*n/100,M=h(m,y,E,k),L=h(m,y,E,N);return["M",S.x,S.y,"A",x,x,0,C,0,w.x,w.y,"L",L.x,L.y,"A",E,E,0,C,1,M.x,M.y,"Z"].join(" ")}return["M",m,y,"L",S.x,S.y,"A",x,x,0,C,0,w.x,w.y,"Z"].join(" ")},v=s/2,p=s/2-10;return e.jsxs("div",{className:u("flex flex-col items-center gap-4",l),children:[e.jsx("svg",{width:s,height:s,className:"transform rotate-0",children:c.map((m,y)=>e.jsx("path",{d:f(v,v,p,m.startAngle,m.endAngle),fill:m.color,className:"transition-opacity hover:opacity-80"},y))}),a&&e.jsx("div",{className:"flex flex-col gap-2",children:c.map((m,y)=>e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("div",{className:"w-3 h-3 rounded-sm",style:{backgroundColor:m.color}}),e.jsxs("span",{className:"text-sm text-gray-700 dark:text-gray-300",children:[m.label,o&&e.jsxs("span",{className:"text-gray-500 dark:text-gray-400 ml-1",children:["(",Math.round(m.percentage),"%)"]})]})]},y))})]})},hl=({series:t,showLegend:r=!0,showGrid:a=!0,fillOpacity:o=.2,height:s=300,xLabels:n,className:l})=>{const i=t.flatMap(m=>m.data),g=Math.max(...i.map(m=>m.y)),c=Math.min(...i.map(m=>m.y)),h=Math.max(...i.map(m=>m.x)),f=["#3b82f6","#10b981","#f59e0b","#ef4444","#8b5cf6"],v=m=>{if(m.length===0)return"";const y=m.map(k=>{const S=k.x/h*100,w=100-(k.y-c)/(g-c)*100;return`${S},${w}`}),x=m[0].x/h*100,N=m[m.length-1].x/h*100;return`M ${x},100 L ${y.join(" L ")} L ${N},100 Z`},p=m=>m.length===0?"":`M ${m.map(x=>{const N=x.x/h*100,k=100-(x.y-c)/(g-c)*100;return`${N},${k}`}).join(" L ")}`;return e.jsxs("div",{className:u("w-full",l),children:[r&&e.jsx("div",{className:"flex flex-wrap gap-4 mb-4",children:t.map((m,y)=>e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("div",{className:"w-3 h-3 rounded-full",style:{backgroundColor:m.color||f[y%f.length]}}),e.jsx("span",{className:"text-sm text-gray-700 dark:text-gray-300",children:m.name})]},y))}),e.jsxs("div",{className:"bg-white dark:bg-gray-900 rounded-lg p-6",children:[e.jsxs("div",{className:"relative",style:{height:`${s}px`},children:[a&&e.jsx("div",{className:"absolute inset-0",children:[...Array(5)].map((m,y)=>e.jsx("div",{className:"absolute w-full border-t border-gray-200 dark:border-gray-700",style:{top:`${y*25}%`}},y))}),e.jsx("svg",{viewBox:"0 0 100 100",preserveAspectRatio:"none",className:"absolute inset-0 w-full h-full",children:t.map((m,y)=>{const x=m.color||f[y%f.length];return e.jsxs("g",{children:[e.jsx("path",{d:v(m.data),fill:x,fillOpacity:o}),e.jsx("path",{d:p(m.data),fill:"none",stroke:x,strokeWidth:"0.5",vectorEffect:"non-scaling-stroke"})]},y)})})]}),n&&e.jsx("div",{className:"flex justify-between mt-2",children:n.map((m,y)=>e.jsx("span",{className:"text-xs text-gray-600 dark:text-gray-400",children:m},y))})]})]})},fl=({className:t,children:r,disabled:a=!1,onClick:o})=>e.jsx("div",{className:u("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",t),onClick:a?void 0:o,role:"region","aria-label":"UradarUchart",children:r||"UradarUchart Component"}),bl=({className:t,children:r,disabled:a=!1,onClick:o})=>e.jsx("div",{className:u("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",t),onClick:a?void 0:o,role:"region","aria-label":"UbubbleUchart",children:r||"UbubbleUchart Component"}),ml=({className:t,children:r,disabled:a=!1,onClick:o})=>e.jsx("div",{className:u("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",t),onClick:a?void 0:o,role:"region","aria-label":"UscatterUplot",children:r||"UscatterUplot Component"}),pl=({className:t,children:r,disabled:a=!1,onClick:o})=>e.jsx("div",{className:u("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",t),onClick:a?void 0:o,role:"region","aria-label":"UtreeUmap",children:r||"UtreeUmap Component"}),yl=({className:t,children:r,disabled:a=!1,onClick:o})=>e.jsx("div",{className:u("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",t),onClick:a?void 0:o,role:"region","aria-label":"UsankeyUdiagram",children:r||"UsankeyUdiagram Component"}),vl=({data:t,width:r=100,height:a=30,color:o="#3b82f6",fill:s=!1,className:n})=>{if(t.length===0)return null;const l=Math.max(...t),i=Math.min(...t),g=l-i||1,c=t.map((h,f)=>{const v=f/(t.length-1)*r,p=a-(h-i)/g*a;return`${v},${p}`}).join(" ");return e.jsxs("svg",{width:r,height:a,className:u("inline-block",n),children:[s&&e.jsx("polygon",{points:`0,${a} ${c} ${r},${a}`,fill:o,opacity:"0.2"}),e.jsx("polyline",{points:c,fill:"none",stroke:o,strokeWidth:"2",strokeLinejoin:"round",strokeLinecap:"round"})]})},xl=({className:t,children:r,disabled:a=!1,onClick:o})=>e.jsx("div",{className:u("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",t),onClick:a?void 0:o,role:"region","aria-label":"Uheatmap",children:r||"Uheatmap Component"}),kl=({className:t,children:r,disabled:a=!1,onClick:o})=>e.jsx("div",{className:u("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",t),onClick:a?void 0:o,role:"region","aria-label":"UfunnelUchart",children:r||"UfunnelUchart Component"}),wl=({className:t,children:r,disabled:a})=>e.jsx("div",{className:u("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",t),role:"region","aria-label":"BurndownChart",children:r||"BurndownChart Component"}),Cl=({className:t,children:r,disabled:a=!1,onClick:o})=>e.jsx("div",{className:u("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",t),onClick:a?void 0:o,role:"region","aria-label":"UperformanceUchart",children:r||"UperformanceUchart Component"}),Nl=({className:t,children:r,disabled:a=!1,onClick:o})=>e.jsx("div",{className:u("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",t),onClick:a?void 0:o,role:"region","aria-label":"UmetricUcomparison",children:r||"UmetricUcomparison Component"}),Sl=({value:t,min:r=0,max:a=100,size:o=120,strokeWidth:s=10,showValue:n=!0,label:l,variant:i="primary",className:g})=>{const c=Math.min(a,Math.max(r,t)),h=(c-r)/(a-r)*100,f=o/2,v=(o-s)/2,p=Math.PI*v,m=p-h/100*p,y={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 e.jsxs("div",{className:u("inline-flex flex-col items-center gap-2",g),children:[e.jsxs("svg",{width:o,height:o*.65,className:"transform rotate-180",children:[e.jsx("path",{d:`M ${s/2} ${f} A ${v} ${v} 0 0 1 ${o-s/2} ${f}`,fill:"none",className:"stroke-gray-200 dark:stroke-gray-700",strokeWidth:s,strokeLinecap:"round"}),e.jsx("path",{d:`M ${s/2} ${f} A ${v} ${v} 0 0 1 ${o-s/2} ${f}`,fill:"none",className:u(y[i],"transition-all duration-500"),strokeWidth:s,strokeDasharray:p,strokeDashoffset:m,strokeLinecap:"round"})]}),n&&e.jsxs("div",{className:"text-center -mt-8",children:[e.jsx("div",{className:"text-2xl font-bold text-gray-900 dark:text-white",children:Math.round(c)}),l&&e.jsx("div",{className:"text-xs text-gray-600 dark:text-gray-400",children:l})]})]})},Ll=({value:t=0,max:r=100,variant:a="default",size:o="md",showLabel:s=!1,label:n,indeterminate:l=!1,striped:i=!1,animated:g=!1,className:c})=>{const h=Math.min(Math.max(t/r*100,0),100),f={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"},v={sm:"h-1",md:"h-2",lg:"h-4"};return e.jsxs("div",{className:u("w-full",c),children:[e.jsx("div",{className:u("w-full bg-gray-200 dark:bg-gray-700 rounded-full overflow-hidden",v[o]),role:"progressbar","aria-valuenow":l?void 0:h,"aria-valuemin":0,"aria-valuemax":100,children:l?e.jsx("div",{className:u("h-full rounded-full animate-pulse",f[a]),style:{width:"100%"}}):e.jsx("div",{className:u("h-full rounded-full transition-all duration-300",f[a],i&&"bg-stripe",i&&g&&"animate-stripe"),style:{width:`${h}%`}})}),(s||n)&&e.jsx("div",{className:"mt-1 text-xs text-gray-600 dark:text-gray-400 text-right",children:n||`${Math.round(h)}%`})]})},El=({value:t,size:r=100,strokeWidth:a=8,showValue:o=!0,label:s,variant:n="primary",color:l,trackColor:i,className:g})=>{const c=Math.min(100,Math.max(0,t)),h=r/2,f=(r-a)/2,v=2*Math.PI*f,p=v-c/100*v,m={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"},y=i||"stroke-gray-200 dark:stroke-gray-700";return e.jsx("div",{className:u("inline-flex items-center justify-center",g),children:e.jsxs("div",{className:"relative",style:{width:r,height:r},children:[e.jsxs("svg",{width:r,height:r,className:"transform -rotate-90",children:[e.jsx("circle",{cx:h,cy:h,r:f,className:y,strokeWidth:a,fill:"none"}),e.jsx("circle",{cx:h,cy:h,r:f,className:u(l?"":m[n],"transition-all duration-300 ease-in-out"),stroke:l,strokeWidth:a,strokeDasharray:v,strokeDashoffset:p,strokeLinecap:"round",fill:"none"})]}),(o||s)&&e.jsxs("div",{className:"absolute inset-0 flex flex-col items-center justify-center",children:[o&&!s&&e.jsxs("span",{className:"text-gray-900 dark:text-white font-bold",style:{fontSize:r*.2},children:[Math.round(c),"%"]}),s&&e.jsx("span",{className:"text-gray-900 dark:text-white font-medium text-center px-2",style:{fontSize:r*.15},children:s})]})]})})},Ml=({className:t,children:r,disabled:a=!1,onClick:o})=>e.jsx("div",{className:u("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",t),onClick:a?void 0:o,role:"region","aria-label":"UprogressUtracker",children:r||"UprogressUtracker Component"}),Il=({src:t,alt:r,fallback:a,width:o,height:s,objectFit:n="cover",loading:l="lazy",showLoader:i=!0,rounded:g="none",border:c=!1,className:h,onLoad:f,onError:v})=>{const[p,m]=b.useState(!0),[y,x]=b.useState(!1),[N,k]=b.useState(t);b.useEffect(()=>{m(!0),x(!1),k(t)},[t]);const S=()=>{m(!1),f?.()},w=()=>{m(!1),x(!0),a&&N!==a&&(k(a),x(!1),m(!0)),v?.()},C={none:"",sm:"rounded-sm",md:"rounded-md",lg:"rounded-lg",full:"rounded-full"},E={contain:"object-contain",cover:"object-cover",fill:"object-fill",none:"object-none","scale-down":"object-scale-down"},M={width:typeof o=="number"?`${o}px`:o,height:typeof s=="number"?`${s}px`:s};return e.jsxs("div",{className:u("relative inline-block overflow-hidden bg-gray-100 dark:bg-gray-800",C[g],c&&"border border-gray-200 dark:border-gray-700",h),style:M,children:[i&&p&&e.jsx("div",{className:"absolute inset-0 flex items-center justify-center",children:e.jsx("div",{className:"animate-pulse",children:e.jsx(z.PhotoIcon,{className:"h-8 w-8 text-gray-400"})})}),y&&e.jsx("div",{className:"absolute inset-0 flex items-center justify-center",children:e.jsx(z.PhotoIcon,{className:"h-8 w-8 text-gray-400"})}),!y&&e.jsx("img",{src:N,alt:r,loading:l,onLoad:S,onError:w,className:u("w-full h-full",E[n],p&&i&&"opacity-0")})]})},Tl=({images:t,columns:r=3,gap:a=16,lightbox:o=!0,className:s})=>{const[n,l]=b.useState(null),i=f=>{o&&l(f)},g=()=>{l(null)},c=()=>{if(!n)return;const f=t.findIndex(p=>p.id===n.id),v=f>0?f-1:t.length-1;l(t[v])},h=()=>{if(!n)return;const f=t.findIndex(p=>p.id===n.id),v=f<t.length-1?f+1:0;l(t[v])};return e.jsxs(e.Fragment,{children:[e.jsx("div",{className:u("grid",s),style:{gridTemplateColumns:`repeat(${r}, 1fr)`,gap:`${a}px`},children:t.map(f=>e.jsxs("div",{className:u("relative aspect-square overflow-hidden rounded-lg bg-gray-200 dark:bg-gray-700",o&&"cursor-pointer hover:opacity-90 transition-opacity"),onClick:()=>i(f),children:[e.jsx("img",{src:f.thumbnail||f.src,alt:f.alt||"",className:"w-full h-full object-cover"}),f.caption&&e.jsx("div",{className:"absolute bottom-0 left-0 right-0 bg-black/50 text-white text-sm p-2",children:f.caption})]},f.id))}),o&&n&&e.jsxs("div",{className:"fixed inset-0 z-50 bg-black/90 flex items-center justify-center p-4",onClick:g,children:[e.jsx("button",{onClick:g,className:"absolute top-4 right-4 text-white hover:text-gray-300 transition-colors",children:e.jsx("svg",{className:"w-8 h-8",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})}),e.jsx("button",{onClick:f=>{f.stopPropagation(),c()},className:"absolute left-4 text-white hover:text-gray-300 transition-colors",children:e.jsx("svg",{className:"w-8 h-8",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M15 19l-7-7 7-7"})})}),e.jsx("button",{onClick:f=>{f.stopPropagation(),h()},className:"absolute right-4 text-white hover:text-gray-300 transition-colors",children:e.jsx("svg",{className:"w-8 h-8",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 5l7 7-7 7"})})}),e.jsxs("div",{className:"max-w-4xl max-h-full",onClick:f=>f.stopPropagation(),children:[e.jsx("img",{src:n.src,alt:n.alt||"",className:"max-w-full max-h-[80vh] object-contain"}),n.caption&&e.jsx("p",{className:"text-white text-center mt-4",children:n.caption})]})]})]})},Pl=({className:t,children:r,disabled:a=!1,onClick:o})=>e.jsx("div",{className:u("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",t),onClick:a?void 0:o,role:"region","aria-label":"UimageUcomparison",children:r||"UimageUcomparison Component"}),zl=({src:t,onCropComplete:r,initialCrop:a,className:o})=>{const[s,n]=b.useState(a||{x:50,y:50,width:200,height:200}),l=b.useRef(null),i=async()=>{if(!l.current||!r)return;const g=document.createElement("canvas"),c=g.getContext("2d");if(!c)return;const h=l.current,f=h.naturalWidth/h.width,v=h.naturalHeight/h.height;g.width=s.width*f,g.height=s.height*v,c.drawImage(h,s.x*f,s.y*v,s.width*f,s.height*v,0,0,g.width,g.height);const p=g.toDataURL("image/png");r(p,s)};return e.jsxs("div",{className:u("inline-flex flex-col gap-4",o),children:[e.jsxs("div",{className:"relative inline-block",children:[e.jsx("img",{ref:l,src:t,alt:"Crop preview",className:"max-w-full h-auto",crossOrigin:"anonymous"}),e.jsxs("div",{className:"absolute border-2 border-blue-500 bg-blue-500/20",style:{left:`${s.x}px`,top:`${s.y}px`,width:`${s.width}px`,height:`${s.height}px`,cursor:"move"},children:[e.jsx("div",{className:"absolute -top-1 -left-1 w-3 h-3 bg-blue-500 rounded-full cursor-nw-resize"}),e.jsx("div",{className:"absolute -top-1 -right-1 w-3 h-3 bg-blue-500 rounded-full cursor-ne-resize"}),e.jsx("div",{className:"absolute -bottom-1 -left-1 w-3 h-3 bg-blue-500 rounded-full cursor-sw-resize"}),e.jsx("div",{className:"absolute -bottom-1 -right-1 w-3 h-3 bg-blue-500 rounded-full cursor-se-resize"})]})]}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx("button",{onClick:i,className:u("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"}),e.jsx("button",{onClick:()=>n(a||{x:50,y:50,width:200,height:200}),className:u("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"})]}),e.jsx("p",{className:"text-xs text-gray-600 dark:text-gray-400",children:'Drag to adjust crop area. Click "Crop Image" to export.'})]})},Ul=({images:t,index:r,isOpen:a,onClose:o,onIndexChange:s,showThumbnails:n=!1,showDownload:l=!1,showZoom:i=!0,className:g})=>{const[c,h]=b.useState(1),f=t[r],v=r>0,p=r<t.length-1,m=b.useCallback(()=>{if(v){const w=r-1;s?.(w),h(1)}},[v,r,s]),y=b.useCallback(()=>{if(p){const w=r+1;s?.(w),h(1)}},[p,r,s]),x=()=>{h(w=>Math.min(w+.5,3))},N=()=>{h(w=>Math.max(w-.5,.5))},k=()=>{h(1)},S=()=>{const w=document.createElement("a");w.href=f.src,w.download=f.alt||"image",w.click()};return b.useEffect(()=>{if(!a)return;const w=C=>{switch(C.key){case"Escape":o();break;case"ArrowLeft":m();break;case"ArrowRight":y();break;case"+":case"=":x();break;case"-":case"_":N();break;case"0":k();break}};return document.addEventListener("keydown",w),()=>document.removeEventListener("keydown",w)},[a,r,t.length,o,m,y]),b.useEffect(()=>(a?document.body.style.overflow="hidden":document.body.style.overflow="",()=>{document.body.style.overflow=""}),[a]),b.useEffect(()=>{h(1)},[r]),!a||!f?null:e.jsx(te,{children:e.jsxs("div",{className:u("fixed inset-0 z-50 flex items-center justify-center","bg-black/95",g),children:[e.jsx("div",{className:"absolute inset-0",onClick:o,"aria-label":"Close lightbox"}),e.jsx("button",{onClick:o,className:"absolute top-4 right-4 z-10 p-2 text-white hover:text-gray-300 transition-colors","aria-label":"Close",children:e.jsx("svg",{className:"w-8 h-8",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})}),v&&e.jsx("button",{onClick:m,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:e.jsx("svg",{className:"w-6 h-6",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M15 19l-7-7 7-7"})})}),p&&e.jsx("button",{onClick:y,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:e.jsx("svg",{className:"w-6 h-6",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 5l7 7-7 7"})})}),e.jsxs("div",{className:"absolute top-4 left-4 z-10 flex gap-2",children:[e.jsxs("div",{className:"px-3 py-1.5 bg-black/50 text-white text-sm rounded-md",children:[r+1," / ",t.length]}),i&&e.jsxs("div",{className:"flex gap-1 bg-black/50 rounded-md p-1",children:[e.jsx("button",{onClick:N,className:"p-1.5 text-white hover:text-gray-300 transition-colors","aria-label":"Zoom out",children:e.jsx("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:e.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"})})}),e.jsxs("button",{onClick:k,className:"px-2 text-white text-sm hover:text-gray-300 transition-colors","aria-label":"Reset zoom",children:[Math.round(c*100),"%"]}),e.jsx("button",{onClick:x,className:"p-1.5 text-white hover:text-gray-300 transition-colors","aria-label":"Zoom in",children:e.jsx("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:e.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&&e.jsx("button",{onClick:S,className:"p-1.5 bg-black/50 text-white hover:text-gray-300 rounded-md transition-colors","aria-label":"Download image",children:e.jsx("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:e.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"})})})]}),e.jsx("div",{className:"relative z-0 flex items-center justify-center max-w-7xl max-h-screen p-20",children:e.jsx("img",{src:f.src,alt:f.alt||"",className:"max-w-full max-h-full object-contain transition-transform",style:{transform:`scale(${c})`}})}),f.caption&&e.jsx("div",{className:"absolute bottom-20 left-0 right-0 z-10 text-center",children:e.jsx("p",{className:"px-4 py-2 bg-black/50 text-white text-sm inline-block rounded-md max-w-2xl",children:f.caption})}),n&&t.length>1&&e.jsx("div",{className:"absolute bottom-4 left-0 right-0 z-10 flex justify-center gap-2 px-4 overflow-x-auto",children:t.map((w,C)=>e.jsx("button",{onClick:()=>{s?.(C),h(1)},className:u("flex-shrink-0 w-16 h-16 rounded-md overflow-hidden","border-2 transition-all",C===r?"border-white scale-110":"border-transparent opacity-60 hover:opacity-100 hover:border-gray-400"),children:e.jsx("img",{src:w.thumbnail||w.src,alt:w.alt||"",className:"w-full h-full object-cover"})},C))})]})})},Al=({src:t,alt:r,scale:a=2,className:o,containerClassName:s,onLoad:n,onError:l})=>{const[i,g]=b.useState(null),c=f=>{const v=f.currentTarget;g({width:Math.round(v.naturalWidth/a),height:Math.round(v.naturalHeight/a)}),n?.()},h=f=>{l?.()};return e.jsx("img",{src:t,alt:r,className:u("max-w-full h-auto",o),onLoad:c,onError:h,width:i?.width,height:i?.height,style:i?void 0:{visibility:"hidden"}})},$l=({src:t,poster:r,autoPlay:a=!1,loop:o=!1,muted:s=!1,controls:n=!0,className:l})=>{const i=b.useRef(null),[g,c]=b.useState(a),[h,f]=b.useState(1),[v,p]=b.useState(0),[m,y]=b.useState(0);b.useEffect(()=>{const C=i.current;if(!C)return;const E=()=>p(C.currentTime),M=()=>y(C.duration),L=()=>c(!0),I=()=>c(!1);return C.addEventListener("timeupdate",E),C.addEventListener("loadedmetadata",M),C.addEventListener("play",L),C.addEventListener("pause",I),()=>{C.removeEventListener("timeupdate",E),C.removeEventListener("loadedmetadata",M),C.removeEventListener("play",L),C.removeEventListener("pause",I)}},[]);const x=()=>{i.current&&(g?i.current.pause():i.current.play())},N=C=>{const E=parseFloat(C.target.value);f(E),i.current&&(i.current.volume=E)},k=C=>{const E=parseFloat(C.target.value);p(E),i.current&&(i.current.currentTime=E)},S=()=>{i.current&&(document.fullscreenElement?document.exitFullscreen():i.current.requestFullscreen())},w=C=>{const E=Math.floor(C/60),M=Math.floor(C%60);return`${E}:${M.toString().padStart(2,"0")}`};return e.jsxs("div",{className:u("relative group",l),children:[e.jsx("video",{ref:i,src:t,poster:r,autoPlay:a,loop:o,muted:s,className:"w-full rounded-lg",onClick:x}),n&&e.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:[e.jsx("input",{type:"range",min:"0",max:m||0,value:v,onChange:k,className:"w-full mb-2 accent-white"}),e.jsxs("div",{className:"flex items-center justify-between gap-4",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("button",{onClick:x,className:"text-white hover:text-gray-300 transition-colors",children:g?e.jsx("svg",{className:"w-6 h-6",fill:"currentColor",viewBox:"0 0 24 24",children:e.jsx("path",{d:"M6 4h4v16H6V4zm8 0h4v16h-4V4z"})}):e.jsx("svg",{className:"w-6 h-6",fill:"currentColor",viewBox:"0 0 24 24",children:e.jsx("path",{d:"M8 5v14l11-7z"})})}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("svg",{className:"w-4 h-4 text-white",fill:"currentColor",viewBox:"0 0 24 24",children:e.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"})}),e.jsx("input",{type:"range",min:"0",max:"1",step:"0.1",value:h,onChange:N,className:"w-20 accent-white"})]}),e.jsxs("span",{className:"text-white text-sm",children:[w(v)," / ",w(m)]})]}),e.jsx("button",{onClick:S,className:"text-white hover:text-gray-300 transition-colors",children:e.jsx("svg",{className:"w-5 h-5",fill:"currentColor",viewBox:"0 0 24 24",children:e.jsx("path",{d:"M7 14H5v5h5v-2H7v-3zm-2-4h2V7h3V5H5v5zm12 7h-3v2h5v-5h-2v3zM14 5v2h3v3h2V5h-5z"})})})]})]})]})},Dl=({className:t,children:r,disabled:a=!1,onClick:o})=>e.jsx("div",{className:u("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",t),onClick:a?void 0:o,role:"region","aria-label":"UvideoUthumbnail",children:r||"UvideoUthumbnail Component"}),Bl=({className:t,children:r,disabled:a})=>e.jsx("div",{className:u("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",t),role:"region","aria-label":"VideoEditor",children:r||"VideoEditor Component"}),jl=({className:t,children:r,disabled:a=!1,onClick:o})=>e.jsx("div",{className:u("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",t),onClick:a?void 0:o,role:"region","aria-label":"UvideoUcall",children:r||"UvideoUcall Component"}),Fl=({className:t,children:r,disabled:a})=>e.jsx("div",{className:u("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",t),role:"region","aria-label":"LiveStream",children:r||"LiveStream Component"}),Ol=({src:t,title:r,artist:a,artwork:o,autoPlay:s=!1,loop:n=!1,className:l})=>{const i=b.useRef(null),[g,c]=b.useState(s),[h,f]=b.useState(0),[v,p]=b.useState(0),[m,y]=b.useState(1);b.useEffect(()=>{const C=i.current;if(!C)return;const E=()=>f(C.currentTime),M=()=>p(C.duration),L=()=>c(!0),I=()=>c(!1),U=()=>c(!1);return C.addEventListener("timeupdate",E),C.addEventListener("loadedmetadata",M),C.addEventListener("play",L),C.addEventListener("pause",I),C.addEventListener("ended",U),()=>{C.removeEventListener("timeupdate",E),C.removeEventListener("loadedmetadata",M),C.removeEventListener("play",L),C.removeEventListener("pause",I),C.removeEventListener("ended",U)}},[]);const x=()=>{i.current&&(g?i.current.pause():i.current.play())},N=C=>{const E=parseFloat(C.target.value);f(E),i.current&&(i.current.currentTime=E)},k=C=>{const E=parseFloat(C.target.value);y(E),i.current&&(i.current.volume=E)},S=C=>{const E=Math.floor(C/60),M=Math.floor(C%60);return`${E}:${M.toString().padStart(2,"0")}`},w=v>0?h/v*100:0;return e.jsxs("div",{className:u("bg-white dark:bg-gray-900 rounded-lg p-6 shadow-lg",l),children:[e.jsx("audio",{ref:i,src:t,autoPlay:s,loop:n}),e.jsxs("div",{className:"flex items-center gap-4 mb-4",children:[o&&e.jsx("div",{className:"w-16 h-16 rounded-lg overflow-hidden flex-shrink-0 bg-gray-200 dark:bg-gray-700",children:e.jsx("img",{src:o,alt:r||"Album artwork",className:"w-full h-full object-cover"})}),e.jsxs("div",{className:"flex-1 min-w-0",children:[r&&e.jsx("h4",{className:"font-semibold text-gray-900 dark:text-white truncate",children:r}),a&&e.jsx("p",{className:"text-sm text-gray-600 dark:text-gray-400 truncate",children:a})]})]}),e.jsxs("div",{className:"mb-4",children:[e.jsx("input",{type:"range",min:"0",max:v||0,value:h,onChange:N,className:"w-full accent-blue-500"}),e.jsxs("div",{className:"flex justify-between text-xs text-gray-600 dark:text-gray-400 mt-1",children:[e.jsx("span",{children:S(h)}),e.jsx("span",{children:S(v)})]})]}),e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center gap-4",children:[e.jsx("button",{onClick:x,className:"w-10 h-10 rounded-full bg-blue-500 text-white flex items-center justify-center hover:bg-blue-600 transition-colors",children:g?e.jsx("svg",{className:"w-5 h-5",fill:"currentColor",viewBox:"0 0 24 24",children:e.jsx("path",{d:"M6 4h4v16H6V4zm8 0h4v16h-4V4z"})}):e.jsx("svg",{className:"w-5 h-5 ml-0.5",fill:"currentColor",viewBox:"0 0 24 24",children:e.jsx("path",{d:"M8 5v14l11-7z"})})}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("svg",{className:"w-4 h-4 text-gray-600 dark:text-gray-400",fill:"currentColor",viewBox:"0 0 24 24",children:e.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"})}),e.jsx("input",{type:"range",min:"0",max:"1",step:"0.1",value:m,onChange:k,className:"w-24 accent-blue-500"})]})]}),e.jsxs("span",{className:"text-sm text-gray-600 dark:text-gray-400",children:[w.toFixed(0),"%"]})]})]})},Vl=({className:t,children:r,disabled:a=!1,onClick:o})=>e.jsx("div",{className:u("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",t),onClick:a?void 0:o,role:"region","aria-label":"UaudioUwaveform",children:r||"UaudioUwaveform Component"}),Wl=({data:t,width:r=200,height:a=40,color:o="#3b82f6",gap:s=2,className:n})=>{if(t.length===0)return null;const l=(r-(t.length-1)*s)/t.length;return e.jsx("svg",{width:r,height:a,className:u("inline-block",n),children:t.map((i,g)=>{const c=Math.max(2,i*a),h=g*(l+s),f=(a-c)/2;return e.jsx("rect",{x:h,y:f,width:l,height:c,fill:o,rx:l/2},g)})})},Hl=({className:t,children:r,disabled:a=!1,onClick:o})=>e.jsx("div",{className:u("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",t),onClick:a?void 0:o,role:"region","aria-label":"UvoiceUrecorder",children:r||"UvoiceUrecorder Component"}),_l=({className:t,children:r,disabled:a})=>e.jsx("div",{className:u("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",t),role:"region","aria-label":"PodcastPlayer",children:r||"PodcastPlayer Component"}),ql=({accept:t=["image/*","video/*","audio/*"],maxSize:r=50*1024*1024,maxFiles:a=10,multiple:o=!0,onUpload:s,onRemove:n,className:l})=>{const[i,g]=b.useState([]),[c,h]=b.useState(!1),f=b.useRef(null),v=S=>{S.preventDefault(),h(!0)},p=S=>{S.preventDefault(),h(!1)},m=S=>{S.preventDefault(),h(!1);const w=Array.from(S.dataTransfer.files);x(w)},y=S=>{if(S.target.files){const w=Array.from(S.target.files);x(w)}},x=S=>{const w=S.filter(L=>{const I=t.some(P=>{if(P.endsWith("/*")){const A=P.split("/")[0];return L.type.startsWith(A)}return L.type===P}),U=L.size<=r;return I&&U}),C=a-i.length,E=w.slice(0,C),M=E.map(L=>({id:`${Date.now()}-${Math.random()}`,file:L,preview:L.type.startsWith("image/")?URL.createObjectURL(L):void 0,status:"pending"}));g(L=>[...L,...M]),s&&s(E)},N=S=>{g(w=>w.filter(C=>C.id!==S)),n&&n(S)},k=S=>S<1024?`${S} B`:S<1024*1024?`${(S/1024).toFixed(1)} KB`:`${(S/(1024*1024)).toFixed(1)} MB`;return e.jsxs("div",{className:u("space-y-4",l),children:[e.jsxs("div",{onDragEnter:v,onDragOver:S=>S.preventDefault(),onDragLeave:p,onDrop:m,onClick:()=>f.current?.click(),className:u("border-2 border-dashed rounded-lg p-8 text-center cursor-pointer transition-colors",c?"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:[e.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:e.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"})}),e.jsx("p",{className:"text-gray-700 dark:text-gray-300 mb-2",children:"Drag and drop files here, or click to browse"}),e.jsxs("p",{className:"text-sm text-gray-500 dark:text-gray-400",children:["Max ",a," files, ",k(r)," each"]}),e.jsx("input",{ref:f,type:"file",multiple:o,accept:t.join(","),onChange:y,className:"hidden"})]}),i.length>0&&e.jsx("div",{className:"grid grid-cols-2 md:grid-cols-3 lg:grid-cols-4 gap-4",children:i.map(S=>e.jsxs("div",{className:"relative aspect-square rounded-lg overflow-hidden bg-gray-100 dark:bg-gray-800",children:[S.preview?e.jsx("img",{src:S.preview,alt:S.file.name,className:"w-full h-full object-cover"}):e.jsx("div",{className:"w-full h-full flex items-center justify-center",children:e.jsx("svg",{className:"w-12 h-12 text-gray-400",fill:"currentColor",viewBox:"0 0 24 24",children:e.jsx("path",{d:"M14 2H6a2 2 0 00-2 2v16a2 2 0 002 2h12a2 2 0 002-2V8l-6-6zm4 18H6V4h7v5h5v11z"})})}),e.jsx("button",{onClick:()=>N(S.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:e.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})}),e.jsxs("div",{className:"absolute bottom-0 left-0 right-0 bg-black/70 text-white text-xs p-2",children:[e.jsx("p",{className:"truncate",children:S.file.name}),e.jsx("p",{className:"text-gray-300",children:k(S.file.size)})]})]},S.id))})]})},Gl=({className:t,children:r,disabled:a=!1,onClick:o})=>e.jsx("div",{className:u("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",t),onClick:a?void 0:o,role:"region","aria-label":"UmediaUplaylist",children:r||"UmediaUplaylist Component"}),Kl=({className:t,children:r,disabled:a})=>e.jsx("div",{className:u("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",t),role:"region","aria-label":"PlaylistManager",children:r||"PlaylistManager Component"}),Yl=({value:t,size:r=200,fgColor:a="#000000",bgColor:o="#ffffff",showDownload:s=!1,className:n})=>{const l=b.useRef(null);b.useEffect(()=>{const g=l.current;if(!g)return;const c=g.getContext("2d");if(!c)return;c.fillStyle=o,c.fillRect(0,0,r,r),c.fillStyle=a;const h=8,f=r/h,v=t.split("").reduce((m,y)=>m+y.charCodeAt(0),0);for(let m=0;m<h;m++)for(let y=0;y<h;y++)(v+m*h+y)%3!==0&&c.fillRect(y*f,m*f,f,f);const p=f*3;[[0,0],[r-p,0],[0,r-p]].forEach(([m,y])=>{c.strokeStyle=a,c.lineWidth=f,c.strokeRect(m+f/2,y+f/2,p-f,p-f)})},[t,r,a,o]);const i=()=>{const g=l.current;if(!g)return;const c=g.toDataURL("image/png"),h=document.createElement("a");h.download="qrcode.png",h.href=c,h.click()};return e.jsxs("div",{className:u("inline-flex flex-col items-center gap-3",n),children:[e.jsx("canvas",{ref:l,width:r,height:r,className:"border-2 border-gray-200 dark:border-gray-700 rounded-lg"}),s&&e.jsx("button",{onClick:i,className:u("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"}),e.jsx("p",{className:"text-xs text-gray-600 dark:text-gray-400 max-w-[200px] text-center break-all",children:t})]})},er=({isOpen:t,onClose:r,title:a,size:o="medium",variant:s="default",overlay:n="default",showCloseButton:l=!0,closeOnOverlayClick:i=!0,closeOnEscape:g=!0,children:c,className:h,"aria-labelledby":f,"aria-describedby":v,closeAriaLabel:p="Close modal"})=>{const m=b.useRef(null),y=b.useRef(null);if(b.useEffect(()=>{if(!t||!g)return;const S=w=>{w.key==="Escape"&&r()};return document.addEventListener("keydown",S),()=>document.removeEventListener("keydown",S)},[t,g,r]),b.useEffect(()=>{if(t)return y.current=document.activeElement,m.current&&m.current.focus(),document.body.style.overflow="hidden",()=>{document.body.style.overflow="unset",y.current&&y.current.focus()}},[t]),!t)return null;const x=()=>{const S=T.variants.overlays.modal.content(),w=T.variants.overlays.modal[o]();return u(S,w)},N=S=>{i&&S.target===S.currentTarget&&r()},k=e.jsxs(e.Fragment,{children:[e.jsx("div",{className:T.variants.overlays.modal.backdrop(),onClick:N}),e.jsx("div",{className:T.variants.overlays.modal.container(),role:"dialog","aria-modal":"true","aria-labelledby":f,"aria-describedby":v,children:e.jsxs("div",{ref:m,"data-testid":"modal-content",className:u(x(),h),tabIndex:-1,onClick:S=>S.stopPropagation(),children:[a&&e.jsxs("div",{className:T.variants.overlays.modal.header(),children:[e.jsx("h2",{id:f,className:T.variants.overlays.modal.title(),children:a}),l&&e.jsx("button",{onClick:r,className:T.variants.overlays.modal.closeButton(),"aria-label":p,children:e.jsx(z.XMarkIcon,{className:T.variants.icon.variant.muted.md()})})]}),c]})})]});return We.createPortal(k,document.body)},Ql=({children:t,variant:r="default",className:a})=>e.jsx("div",{"data-testid":"modal-header",className:u(T.variants.overlays.modal.header(),a),children:t}),rr=({children:t,variant:r="default",className:a})=>e.jsx("div",{"data-testid":"modal-body",className:u(T.variants.overlays.modal.body(),a),children:t}),tr=({children:t,variant:r="default",className:a})=>e.jsx("div",{"data-testid":"modal-footer",className:u(T.variants.overlays.modal.footer(),a),children:t}),Xl=({isOpen:t,onClose:r,children:a,side:o="right",size:s="md",showCloseButton:n=!0,title:l,footer:i,className:g})=>{if(b.useEffect(()=>{const v=p=>{p.key==="Escape"&&t&&r()};if(t)return document.addEventListener("keydown",v),()=>document.removeEventListener("keydown",v)},[t,r]),!t)return null;const c={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"},f={left:t?"translate-x-0":"-translate-x-full",right:t?"translate-x-0":"translate-x-full",top:t?"translate-y-0":"-translate-y-full",bottom:t?"translate-y-0":"translate-y-full"};return e.jsxs(te,{children:[e.jsx(Se,{isOpen:t,onClose:r,opacity:"medium"}),e.jsxs("div",{className:u("fixed z-50","bg-white dark:bg-gray-900","shadow-xl","transition-transform duration-300 ease-in-out",h[o],c[o][s],f[o],g),children:[(l||n)&&e.jsxs("div",{className:"flex items-center justify-between px-6 py-4 border-b border-gray-200 dark:border-gray-700",children:[l&&e.jsx("h2",{className:"text-lg font-semibold text-gray-900 dark:text-white",children:l}),n&&e.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:e.jsx("svg",{className:"w-6 h-6",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})})]}),e.jsx("div",{className:"flex-1 overflow-y-auto p-6",children:a}),i&&e.jsx("div",{className:"px-6 py-4 border-t border-gray-200 dark:border-gray-700",children:i})]})]})},Jl=({children:t,active:r=!0,initialFocus:a,returnFocus:o=!0,className:s})=>{const n=b.useRef(null),l=b.useRef(null);return b.useEffect(()=>{if(!r)return;o&&(l.current=document.activeElement);const i=()=>{if(!n.current)return[];const f=["a[href]","button:not([disabled])","textarea:not([disabled])","input:not([disabled])","select:not([disabled])",'[tabindex]:not([tabindex="-1"])'].join(",");return Array.from(n.current.querySelectorAll(f))},g=()=>{if(a){const v=n.current?.querySelector(a);if(v){v.focus();return}}const f=i();f.length>0&&f[0].focus()},c=f=>{if(f.key!=="Tab")return;const v=i();if(v.length===0){f.preventDefault();return}const p=v[0],m=v[v.length-1];f.shiftKey?document.activeElement===p&&(f.preventDefault(),m.focus()):document.activeElement===m&&(f.preventDefault(),p.focus())},h=setTimeout(g,0);return document.addEventListener("keydown",c),()=>{clearTimeout(h),document.removeEventListener("keydown",c),o&&l.current&&l.current.focus()}},[r,a,o]),r?e.jsx("div",{ref:n,className:u(s),children:t}):e.jsx(e.Fragment,{children:t})},Zl=({children:t,onLoadMore:r,loading:a=!1,hasMore:o=!0,threshold:s=100,loader:n,endMessage:l,height:i,scrollDirection:g="vertical",reverse:c=!1,className:h})=>{const f=b.useRef(null),[v,p]=b.useState(!1);b.useEffect(()=>{const N=f.current;if(!N||a||!o)return;const k=()=>{const{scrollTop:S,scrollHeight:w,clientHeight:C,scrollLeft:E,scrollWidth:M,clientWidth:L}=N;g==="vertical"&&p(S>300);let I;g==="vertical"?c?I=S:I=w-S-C:c?I=E:I=M-E-L,I<s&&r()};return N.addEventListener("scroll",k),()=>N.removeEventListener("scroll",k)},[a,o,s,r,g,c]);const m=()=>{f.current?.scrollTo({top:0,behavior:"smooth"})},y=e.jsxs("div",{className:"flex justify-center items-center py-4",children:[e.jsx("div",{className:"w-6 h-6 border-2 border-blue-600 dark:border-blue-400 border-t-transparent rounded-full animate-spin"}),e.jsx("span",{className:"ml-2 text-sm text-gray-600 dark:text-gray-400",children:"Loading..."})]}),x=e.jsx("div",{className:"flex justify-center items-center py-4",children:e.jsx("span",{className:"text-sm text-gray-600 dark:text-gray-400",children:"No more items to load"})});return e.jsxs("div",{className:u("relative",h),children:[e.jsxs("div",{ref:f,className:u(g==="vertical"?"overflow-y-auto":"overflow-x-auto","overflow-auto"),style:{height:g==="vertical"?i:void 0,width:g==="horizontal"?"100%":void 0,display:g==="horizontal"?"flex":void 0,flexDirection:c&&g==="vertical"?"column-reverse":void 0},children:[c&&a&&(n||y),c&&!a&&!o&&l,e.jsx("div",{className:u(g==="horizontal"&&"flex",g==="horizontal"&&c&&"flex-row-reverse"),children:t}),!c&&a&&(n||y),!c&&!a&&!o&&(l||x)]}),g==="vertical"&&!c&&v&&e.jsx("button",{onClick:m,className:u("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:e.jsx("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M5 10l7-7m0 0l7 7m-7-7v18"})})})]})},Rl=({trigger:t,children:r,placement:a="bottom",isOpen:o,onOpenChange:s,trigger_action:n="click",showArrow:l=!0,className:i})=>{const[g,c]=b.useState(!1),h=o!==void 0?o:g,f=b.useCallback(C=>{o===void 0&&c(C),s?.(C)},[o,s]),v=b.useRef(null),p=b.useRef(null),[m,y]=b.useState({top:0,left:0});b.useEffect(()=>{if(!h||!v.current)return;const C=()=>{const E=v.current.getBoundingClientRect(),M=8;let L=0,I=0;switch(a){case"top":L=E.top-M,I=E.left+E.width/2;break;case"top-start":L=E.top-M,I=E.left;break;case"top-end":L=E.top-M,I=E.right;break;case"bottom":L=E.bottom+M,I=E.left+E.width/2;break;case"bottom-start":L=E.bottom+M,I=E.left;break;case"bottom-end":L=E.bottom+M,I=E.right;break;case"left":L=E.top+E.height/2,I=E.left-M;break;case"right":L=E.top+E.height/2,I=E.right+M;break}y({top:L,left:I})};return C(),window.addEventListener("scroll",C),window.addEventListener("resize",C),()=>{window.removeEventListener("scroll",C),window.removeEventListener("resize",C)}},[h,a]),b.useEffect(()=>{if(!h)return;const C=E=>{v.current&&!v.current.contains(E.target)&&p.current&&!p.current.contains(E.target)&&f(!1)};return document.addEventListener("mousedown",C),()=>document.removeEventListener("mousedown",C)},[h,f]),b.useEffect(()=>{if(!h)return;const C=E=>{E.key==="Escape"&&f(!1)};return document.addEventListener("keydown",C),()=>document.removeEventListener("keydown",C)},[h,f]);const x=()=>{n==="click"&&f(!h)},N=()=>{n==="hover"&&f(!0)},k=()=>{n==="hover"&&f(!1)},S={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 e.jsxs("div",{className:u("relative inline-block",i),children:[e.jsx("div",{ref:v,onClick:x,onMouseEnter:N,onMouseLeave:k,className:"inline-block",children:t}),h&&e.jsxs("div",{ref:p,className:u("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",S[a],w[a]),style:{position:"fixed",top:m.top+"px",left:m.left+"px"},onMouseEnter:n==="hover"?()=>f(!0):void 0,onMouseLeave:n==="hover"?()=>f(!1):void 0,children:[r,l&&e.jsx("div",{className:u("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")})]})]})},ei=({sections:t,activeId:r,onActiveChange:a,offset:o=80,container:s,smoothScroll:n=!0,showSubsections:l=!0,className:i})=>{const[g,c]=b.useState(""),h=b.useRef(null),f=r!==void 0?r:g;b.useEffect(()=>{const m=s?document.querySelector(s):window;if(!m)return;const y=k=>k.flatMap(S=>[S.id,...S.subsections?y(S.subsections):[]]),N=y(t).map(k=>document.getElementById(k)).filter(Boolean);if(N.length!==0)return h.current=new IntersectionObserver(k=>{k.forEach(S=>{if(S.isIntersecting){const w=S.target.id;r!==void 0&&a?a(w):c(w)}})},{root:s?m:null,rootMargin:`-${o}px 0px -50% 0px`,threshold:0}),N.forEach(k=>{h.current?.observe(k)}),()=>{h.current?.disconnect()}},[t,s,o,r,a]);const v=m=>{const y=document.getElementById(m);if(!y)return;const x=s?document.querySelector(s):window;if(!x)return;const k=y.offsetTop-o;n?x===window?window.scrollTo({top:k,behavior:"smooth"}):x.scrollTo({top:k,behavior:"smooth"}):x===window?window.scrollTo(0,k):x.scrollTop=k},p=(m,y=0)=>{const x=f===m.id,N=m.subsections?.some(k=>f===k.id)||!1;return e.jsxs("div",{children:[e.jsx("button",{onClick:()=>v(m.id),className:u("w-full text-left px-3 py-1.5 text-sm rounded-md transition-colors",y===0?"font-medium":"pl-6 text-sm",x?"text-blue-700 dark:text-blue-300 bg-blue-50 dark:bg-blue-900/30":N?"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:`${y*.75+.75}rem`},children:m.label}),l&&m.subsections&&m.subsections.length>0&&e.jsx("div",{className:"ml-2 border-l-2 border-gray-200 dark:border-gray-700",children:m.subsections.map(k=>p(k,y+1))})]},m.id)};return e.jsx("nav",{className:u("space-y-1",i),children:t.map(m=>p(m,0))})},ri=({isOpen:t,onClose:r,children:a,title:o,description:s,footer:n,side:l="bottom",size:i="md",showHandle:g=!0,showCloseButton:c=!0,className:h})=>{if(b.useEffect(()=>{if(!t)return;const m=y=>{y.key==="Escape"&&r()};return document.addEventListener("keydown",m),()=>document.removeEventListener("keydown",m)},[t,r]),!t)return null;const f={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"}},v={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"},p={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 e.jsxs(te,{children:[e.jsx(Se,{isOpen:t,onClose:r,opacity:"dark"}),e.jsxs("div",{className:u("fixed z-50","bg-white dark:bg-gray-900","shadow-xl","flex flex-col",v[l],f[l][i],p[l],h),children:[g&&(l==="bottom"||l==="top")&&e.jsx("div",{className:u("flex items-center justify-center",l==="bottom"?"pt-3 pb-2":"pb-3 pt-2"),children:e.jsx("div",{className:"w-12 h-1.5 bg-gray-300 dark:bg-gray-700 rounded-full"})}),(o||s||c)&&e.jsx("div",{className:"px-6 py-4 border-b border-gray-200 dark:border-gray-700",children:e.jsxs("div",{className:"flex items-start justify-between",children:[e.jsxs("div",{className:"flex-1",children:[o&&e.jsx("h2",{className:"text-lg font-semibold text-gray-900 dark:text-white",children:o}),s&&e.jsx("p",{className:"mt-1 text-sm text-gray-600 dark:text-gray-400",children:s})]}),c&&e.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:e.jsx("svg",{className:"w-6 h-6",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})})]})}),e.jsx("div",{className:"flex-1 overflow-y-auto px-6 py-4",children:a}),n&&e.jsx("div",{className:"px-6 py-4 border-t border-gray-200 dark:border-gray-700",children:n})]})]})},ti=({isOpen:t,onClose:r,onSubmit:a,title:o,description:s,placeholder:n="",initialValue:l="",cancelText:i="Cancel",confirmText:g="Confirm",isLoading:c=!1,loadingText:h="Processing...",maxLength:f,required:v=!0,validate:p})=>{const[m,y]=b.useState(l),[x,N]=b.useState(null);b.useEffect(()=>{t&&(y(l),N(null))},[t,l]);const k=async C=>{if(C.preventDefault(),N(null),v&&!m.trim()){N("This field is required");return}if(p){const E=p(m);if(E){N(E);return}}try{await a(m.trim())}catch(E){N(E instanceof Error?E.message:"An error occurred")}},S=()=>{y(l),N(null),r()},w=v?m.trim().length>0:!0;return e.jsx(er,{isOpen:t,onClose:S,size:"small","aria-labelledby":"text-input-modal-title","aria-describedby":"text-input-modal-description",closeOnEscape:!c,closeOnOverlayClick:!c,children:e.jsxs("form",{onSubmit:k,children:[e.jsxs(rr,{variant:"padded",children:[e.jsx("h3",{id:"text-input-modal-title",className:T.textVariants.heading.h4(),children:o}),e.jsx("p",{id:"text-input-modal-description",className:`${T.textVariants.body.md()} mt-2 mb-4`,children:s}),e.jsx(Le,{type:"text",value:m,onChange:C=>y(C.target.value),placeholder:n,maxLength:f,disabled:c,autoFocus:!0,"aria-invalid":!!x,"aria-describedby":x?"text-input-error":void 0}),x&&e.jsx("p",{id:"text-input-error",className:`${T.textVariants.body.sm()} text-red-600 dark:text-red-400 mt-2`,role:"alert",children:x})]}),e.jsxs(tr,{children:[e.jsx(G,{type:"button",variant:"outline",onClick:S,disabled:c,children:i}),e.jsx(G,{type:"submit",variant:"default",disabled:!w||c,children:c?h:g})]})]})})},Gr=({content:t,children:r,placement:a="top",delayShow:o=0,delayHide:s=0,className:n,disabled:l=!1,showArrow:i=!0,variant:g="default",trigger:c="hover",isOpen:h,onVisibilityChange:f})=>{const[v,p]=b.useState(!1),m=b.useRef(void 0),y=b.useRef(void 0),x=b.useRef(null),N=b.useRef(null),k=h!==void 0,S=k?h:v,w=b.useCallback(()=>{l||k||(y.current&&(clearTimeout(y.current),y.current=void 0),o>0?m.current=setTimeout(()=>{p(!0),f?.(!0)},o):(p(!0),f?.(!0)))},[l,k,o,f]),C=b.useCallback(()=>{k||(m.current&&(clearTimeout(m.current),m.current=void 0),s>0?y.current=setTimeout(()=>{p(!1),f?.(!1)},s):(p(!1),f?.(!1)))},[k,s,f]);b.useEffect(()=>()=>{m.current&&clearTimeout(m.current),y.current&&clearTimeout(y.current)},[]),b.useEffect(()=>{if(c!=="click"||!S)return;const B=j=>{x.current&&!x.current.contains(j.target)&&N.current&&!N.current.contains(j.target)&&C()};return document.addEventListener("mousedown",B),()=>{document.removeEventListener("mousedown",B)}},[c,S,C]);const E=()=>{c==="hover"&&w()},M=()=>{c==="hover"&&C()},L=()=>{c==="hover"&&w()},I=()=>{c==="hover"&&C()},U=()=>{c==="click"&&!k&&(S?(p(!1),f?.(!1)):(p(!0),f?.(!0)))},P={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"},A={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"},D={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"},$={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 e.jsxs("div",{ref:N,className:"relative inline-block",onMouseEnter:E,onMouseLeave:M,onFocus:L,onBlur:I,onClick:U,children:[r,S&&!l&&e.jsxs("div",{ref:x,className:u("absolute z-50 px-2 py-1 text-xs font-medium rounded shadow-lg whitespace-nowrap pointer-events-none",P[a],D[g],n),role:"tooltip",children:[t,i&&e.jsx("div",{className:u("absolute w-0 h-0 border-4 arrow",A[a],$[g][a])})]})]})},ai={default:z.InformationCircleIcon,warning:z.ExclamationTriangleIcon,danger:z.XCircleIcon,success:z.CheckCircleIcon,info:z.InformationCircleIcon},oi={default:()=>T.variants.icon.variant.default.lg(),warning:()=>T.variants.icon.variant.warning.lg(),danger:()=>T.variants.icon.variant.error.lg(),success:()=>T.variants.icon.variant.success.lg(),info:()=>T.variants.icon.variant.default.lg()},si={default:"default",warning:"default",danger:"destructive",success:"default",info:"default"},ni=({isOpen:t,onClose:r,onConfirm:a,title:o,message:s,confirmText:n="Confirm",cancelText:l="Cancel",loadingText:i="Processing...",variant:g="default",isLoading:c=!1})=>{const h=ai[g],f=oi[g],v=si[g];return e.jsxs(er,{isOpen:t,onClose:r,size:"small",variant:"web3confirmation","aria-labelledby":"confirmation-dialog-title","aria-describedby":"confirmation-dialog-description",children:[e.jsxs(rr,{variant:"padded",children:[e.jsxs("div",{className:"flex items-center gap-3 mb-4",children:[e.jsx(h,{className:f()}),e.jsx("h3",{id:"confirmation-dialog-title",className:T.textVariants.heading.h4(),children:o})]}),e.jsx("p",{id:"confirmation-dialog-description",className:T.textVariants.body.md(),children:s})]}),e.jsxs(tr,{children:[e.jsx(G,{variant:"outline",onClick:r,disabled:c,children:l}),e.jsx(G,{variant:v,onClick:a,disabled:c,children:c?i:n})]})]})},li=({trigger:t,children:r,placement:a="bottom",openDelay:o=200,closeDelay:s=300,className:n})=>{const[l,i]=b.useState(!1),[g,c]=b.useState({top:0,left:0}),h=b.useRef(null),f=b.useRef(null),v=b.useRef(void 0),p=b.useRef(void 0);b.useEffect(()=>{if(!l||!h.current)return;const k=()=>{const S=h.current.getBoundingClientRect(),w=8;let C=0,E=0;switch(a){case"top":C=S.top-w,E=S.left+S.width/2;break;case"bottom":C=S.bottom+w,E=S.left+S.width/2;break;case"left":C=S.top+S.height/2,E=S.left-w;break;case"right":C=S.top+S.height/2,E=S.right+w;break}c({top:C,left:E})};return k(),window.addEventListener("scroll",k),window.addEventListener("resize",k),()=>{window.removeEventListener("scroll",k),window.removeEventListener("resize",k)}},[l,a]);const m=()=>{p.current&&clearTimeout(p.current),v.current=setTimeout(()=>{i(!0)},o)},y=()=>{v.current&&clearTimeout(v.current),p.current=setTimeout(()=>{i(!1)},s)},x={top:"origin-bottom",bottom:"origin-top",left:"origin-right",right:"origin-left"},N={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 e.jsxs(e.Fragment,{children:[e.jsx("div",{ref:h,onMouseEnter:m,onMouseLeave:y,className:"inline-block",children:t}),l&&e.jsx(te,{children:e.jsx("div",{ref:f,className:u("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",x[a],N[a],n),style:{top:g.top+"px",left:g.left+"px"},onMouseEnter:()=>{p.current&&clearTimeout(p.current)},onMouseLeave:y,children:r})})]})},ii=({children:t,onDrop:r,onDragOver:a,accept:o,showIndicator:s=!0,indicator:n,disabled:l=!1,className:i})=>{const[g,c]=b.useState(!1),[h,f]=b.useState(0),v=N=>{N.preventDefault(),N.stopPropagation(),!l&&(f(k=>k+1),N.dataTransfer.items&&N.dataTransfer.items.length>0&&c(!0))},p=N=>{N.preventDefault(),N.stopPropagation(),!l&&f(k=>{const S=k-1;return S===0&&c(!1),S})},m=N=>{N.preventDefault(),N.stopPropagation(),!l&&a&&a(N)},y=N=>{if(N.preventDefault(),N.stopPropagation(),l)return;if(c(!1),f(0),N.dataTransfer.files&&N.dataTransfer.files.length>0){const S=Array.from(N.dataTransfer.files);let w=S;o&&o.length>0&&(w=S.filter(C=>o.some(E=>{if(E.endsWith("/*")){const M=E.split("/")[0];return C.type.startsWith(M)}return C.type===E}))),r(w);return}const k=N.dataTransfer.getData("text/plain");if(k)try{const S=JSON.parse(k);r(S)}catch{r(k)}},x=e.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:[e.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:e.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"})}),e.jsx("p",{className:"text-blue-700 dark:text-blue-300 font-medium",children:"Drop here"})]});return e.jsxs("div",{onDragEnter:v,onDragLeave:p,onDragOver:m,onDrop:y,className:u("relative",l&&"opacity-50 cursor-not-allowed",i),children:[t,s&&g&&!l&&(n||x)]})},ci=({className:t,children:r,disabled:a=!1,onClick:o})=>e.jsx("div",{className:u("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",t),onClick:a?void 0:o,role:"region","aria-label":"UdragUdropUlist",children:r||"UdragUdropUlist Component"}),di=({className:t,children:r,disabled:a=!1,onClick:o})=>e.jsx("div",{className:u("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",t),onClick:a?void 0:o,role:"region","aria-label":"UsortableUgrid",children:r||"UsortableUgrid Component"}),gi=({className:t,children:r,disabled:a=!1,onClick:o})=>e.jsx("div",{className:u("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",t),onClick:a?void 0:o,role:"region","aria-label":"UnestedUdrag",children:r||"UnestedUdrag Component"}),ui=({className:t,children:r,disabled:a=!1,onClick:o})=>e.jsx("div",{className:u("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",t),onClick:a?void 0:o,role:"region","aria-label":"UgestureUdetector",children:r||"UgestureUdetector Component"}),hi=({className:t,children:r,disabled:a=!1,onClick:o})=>e.jsx("div",{className:u("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",t),onClick:a?void 0:o,role:"region","aria-label":"UswipeUactions",children:r||"UswipeUactions Component"}),fi=({className:t,children:r,disabled:a=!1,onClick:o})=>e.jsx("div",{className:u("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",t),onClick:a?void 0:o,role:"region","aria-label":"UpinchUzoom",children:r||"UpinchUzoom Component"}),bi=({className:t,children:r,disabled:a=!1,onClick:o})=>e.jsx("div",{className:u("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",t),onClick:a?void 0:o,role:"region","aria-label":"UdoubleUtap",children:r||"UdoubleUtap Component"}),mi=({className:t,children:r,disabled:a=!1,onClick:o})=>e.jsx("div",{className:u("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",t),onClick:a?void 0:o,role:"region","aria-label":"UlongUpress",children:r||"UlongUpress Component"}),pi=({className:t,children:r,disabled:a=!1,onClick:o})=>e.jsx("div",{className:u("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",t),onClick:a?void 0:o,role:"region","aria-label":"UradialUmenu",children:r||"UradialUmenu Component"}),yi=({children:t,onRefresh:r,disabled:a=!1,refreshingText:o="Refreshing...",pullDownText:s="Pull down to refresh",releaseText:n="Release to refresh",threshold:l=80,maxPullDistance:i=120,className:g=""})=>{const[c,h]=b.useState(0),[f,v]=b.useState(!1),[p,m]=b.useState(!1),y=b.useRef(0),x=b.useRef(null);b.useEffect(()=>{const C=x.current;if(!C)return;const E=I=>{if(a||f)return;C.scrollTop<=0&&(y.current=I.touches[0].clientY,m(!0))},M=I=>{if(!p)return;const P=I.touches[0].clientY-y.current;if(P>0&&C.scrollTop<=0){const A=Math.min(P/i,1),D=Math.min(P*(1-A*.5),i);h(D),P>10&&I.preventDefault()}},L=async()=>{if(p)if(m(!1),c>=l&&!f){v(!0);try{await r()}catch{}finally{v(!1),h(0)}}else h(0)};return C.addEventListener("touchstart",E,{passive:!0}),C.addEventListener("touchmove",M,{passive:!1}),C.addEventListener("touchend",L),()=>{C.removeEventListener("touchstart",E),C.removeEventListener("touchmove",M),C.removeEventListener("touchend",L)}},[a,f,p,c,l,i,r]);const N=Math.min(c/l,1),k=p||f,S=p?c:f?l:0,w=()=>f?o:c>=l?n:s;return e.jsxs("div",{ref:x,className:`relative ${g}`,style:{height:"100%",overflowY:"auto",WebkitOverflowScrolling:"touch"},children:[e.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:`${S}px`,marginTop:p?0:`-${S}px`,opacity:k?1:0,pointerEvents:"none"},children:e.jsxs("div",{className:"flex flex-col items-center justify-center gap-2",children:[e.jsx(z.ArrowPathIcon,{className:`w-6 h-6 text-blue-600 dark:text-blue-400 transition-transform duration-200 ${f?"animate-spin":""}`,style:{transform:`rotate(${N*360}deg)`}}),c>20&&e.jsx("span",{className:"text-xs font-medium text-blue-600 dark:text-blue-400",children:w()})]})}),e.jsx("div",{style:{paddingTop:p?`${c}px`:0,transition:p?"none":"padding-top 200ms ease-out"},children:t})]})},Q={twitter:(t,r,a)=>{const o=a.length>0?`&hashtags=${a.join(",")}`:"";return`https://twitter.com/intent/tweet?url=${encodeURIComponent(t)}&text=${encodeURIComponent(r)}${o}`},facebook:t=>`https://www.facebook.com/sharer/sharer.php?u=${encodeURIComponent(t)}`,linkedin:(t,r,a)=>`https://www.linkedin.com/sharing/share-offsite/?url=${encodeURIComponent(t)}`,reddit:(t,r)=>`https://reddit.com/submit?url=${encodeURIComponent(t)}&title=${encodeURIComponent(r)}`,telegram:(t,r)=>`https://t.me/share/url?url=${encodeURIComponent(t)}&text=${encodeURIComponent(r)}`,whatsapp:(t,r)=>`https://wa.me/?text=${encodeURIComponent(r+" "+t)}`,email:(t,r,a)=>`mailto:?subject=${encodeURIComponent(r)}&body=${encodeURIComponent(a+`
56
55
 
57
- `+e)}`,discord:(e,r)=>`https://discord.com/channels/@me?message=${encodeURIComponent(r+`
58
- `+e)}`,messages:(e,r)=>`sms:?&body=${encodeURIComponent(r+" "+e)}`},ld=({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 w=e.onBeforeShare;w&&!n&&(async()=>{l(!0);try{const C=typeof window<"u"?window.location.href:"",E=await w(C);o(E)}catch{const C=typeof window<"u"?window.location.href:"";o(C)}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(w){w instanceof Error&&w.name!=="AbortError"&&(console.error("Share failed:",w),w.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=w=>{window.open(w,"_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(w=>t.jsxs("button",{onClick:()=>k(w.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 ${w.color}`,fill:"currentColor",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:w.svg}),t.jsx("span",{className:"text-sm text-gray-700 dark:text-gray-300",children:w.name})]},w.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"})]})]})]})]})},na=({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(ld,{shareConfig:r})]}),oa={standard:"max-w-7xl mx-auto px-4",wide:"max-w-[1920px] mx-auto px-4",full:"w-full px-4"},sa={standard:"max-w-7xl mx-auto",wide:"max-w-[1920px] mx-auto",full:"w-full"},la="px-4",zr=p.createContext(void 0),ia=({mode:e="standard",children:r})=>{const a={mode:e,containerClass:oa[e],maxWidthClass:sa[e],paddingClass:la};return t.jsx(zr.Provider,{value:a,children:r})},ue=()=>{const e=p.useContext(zr);return e||{mode:"standard",containerClass:oa.standard,maxWidthClass:sa.standard,paddingClass:la}},id=({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(na,{items:e,shareConfig:r})})})},ca=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}},cd=({filename:e,code:r,language:a,title:n,className:o="",showCopy:s=!0,showHeader:l=!0})=>{const{t:c}=Je.useTranslation("codeBlock"),{code:d,loading:i,error:h}=ca(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")})},dd=({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))})})},gd=({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(dd,{subsections:n,isExpanded:i,selectedSubsection:s,parentSectionId:e,onSubsectionSelect:c})]})},ud=({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()]})]})})})},hd=({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})},fd=({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})},da={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:"🇨🇳"}},bd=({variant:e="compact",className:r=""})=>{const{i18n:a,t:n}=Je.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:da[i]?.name||i.toUpperCase(),flag:da[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(Er,{value:o,onValueChange:d,children:[t.jsx(er,{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(rr,{children:l.map(i=>t.jsx(tr,{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(Er,{value:o,onValueChange:d,children:[t.jsx(er,{children:t.jsx($t,{placeholder:n("selectLanguage","Select language")})}),t.jsx(rr,{children:l.map(i=>t.jsx(tr,{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")})]})},md=({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 yd 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 ir 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 pd(e,r){const a=n=>t.jsx(ir,{...r,children:t.jsx(e,{...n})});return a.displayName=`withLazyErrorBoundary(${e.displayName||e.name})`,a}class vd extends ir{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 kd(){const[e,r]=p.useState(0),a=p.useCallback(()=>{r(n=>n+1)},[]);return{errorRecoveryCount:e,triggerErrorRecovery:a}}function wd({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(ir,{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 xd=({children:e})=>t.jsx(t.Fragment,{children:e}),Nd=({children:e})=>t.jsx(t.Fragment,{children:e}),Cd=(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},Sd=(e,r)=>p.memo(e,(a,n)=>r.every(o=>a[o]===n[o])),Ed=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)})}),Ad=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),Td=p.memo(({condition:e,children:r,fallback:a=null})=>e?t.jsx(t.Fragment,{children:r}):t.jsx(t.Fragment,{children:a})),Id=({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})},Ld=({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})},Md=({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)})},Pd=({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(w=>{w.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"})]})})]})},Od=e=>/^[a-z]{2}(-[a-z]+)?$/.test(e);function Ud({to:e,language:r,children:a,isLanguageSupported:n=Od,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 Dd({isLanguageSupported:e,defaultLanguage:r="en",storageKey:a="language",fallback:n=null}){const{lang:o}=Z.useParams(),s=Z.useNavigate(),{i18n:l}=Je.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 jr(e,r){const a=_r(e);return`/${r}${a.startsWith("/")?a:`/${a}`}`}function _r(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 zd(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}=Je.useTranslation(),c=s&&r(s)?s:l.language||a,d=p.useCallback((h,u)=>{if(typeof h=="number"){o(h);return}const y=jr(h,c);o(y,u)},[o,c]),i=p.useCallback((h,u)=>{l.changeLanguage(h);const y=_r(u||(typeof window<"u"?window.location.pathname:"/"),r),m=jr(y,h);o(m,{replace:!0});try{localStorage.setItem(n,h)}catch{}},[o,l,r,n]);return{navigate:d,switchLanguage:i,currentLanguage:c}}function jd(){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 _d({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(jd,{})}):r?t.jsx(t.Fragment,{children:e}):t.jsx(t.Fragment,{children:s})}function Bd(){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 Fd({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 Wd({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(Bd,{})}),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(Fd,{spinning:n}),n?s:o]})]})})}var re=(e=>(e.LIGHT="light",e.DARK="dark",e.SYSTEM="system",e))(re||{}),Br=(e=>(e.SMALL="small",e.MEDIUM="medium",e.LARGE="large",e))(Br||{});const cr={getItem:e=>{try{return localStorage.getItem(e)}catch{return null}},setItem:(e,r)=>{try{localStorage.setItem(e,r)}catch{}}},Fr=p.createContext(void 0);function Vd(){const e=p.useContext(Fr);if(e===void 0)throw new Error("useTheme must be used within a ThemeProvider");return e}function $d({children:e,themeStorageKey:r="theme",fontSizeStorageKey:a="font-size",defaultTheme:n=re.LIGHT,defaultFontSize:o=Br.MEDIUM}){const[s,l]=p.useState(()=>cr.getItem(r)||n),[c,d]=p.useState(()=>cr.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),cr.setItem(r,b)},[r]),y=p.useCallback(b=>{d(b),cr.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,w=k.matches?re.DARK:re.LIGHT;h(w),S.classList.remove("light","dark"),S.classList.add(w)};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(Fr.Provider,{value:m,children:e})}const Hd=({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",w=()=>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,I)=>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})]},I))}),o&&Object.keys(o).length>0&&t.jsx("div",{className:"grid grid-cols-2 gap-4 mt-4",children:Object.entries(o).map(([E,I],x)=>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:I}),t.jsx("div",{className:"text-xs text-gray-500 dark:text-gray-400 mt-1",children:E})]},x))})]})]}),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),C=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(),C(E)}:void 0,children:t.jsx(w,{})}):i?t.jsx("div",{className:N,onClick:C,onKeyDown:C,role:"button",tabIndex:0,"aria-label":r,children:t.jsx(w,{})}):t.jsx("div",{className:N,children:t.jsx(w,{})})},qd=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"}}),Gd=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"}}),Yd=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"}}),Kd={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"},Xd=({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=(w,N)=>{if(c==="colorful"&&w.gradient)return{background:`linear-gradient(135deg, ${w.gradient.from}, ${w.gradient.to})`};if(c==="colorful"){const C=[{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=C[N%C.length];return{background:`linear-gradient(135deg, ${E.from}, ${E.to})`}}},S=(w,N)=>{const C=t.jsxs("div",{className:f(Gd({variant:o,animation:s})),onClick:()=>b?.(w),role:b?"button":void 0,tabIndex:b?0:void 0,children:[w.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",Kd[w.badge.variant||"default"]),children:w.badge.text})}),t.jsx("div",{className:f(Yd({size:l,style:c,position:d})),style:k(w,N),children:t.jsx("div",{className:f("flex items-center justify-center",c==="colorful"?"text-white":"text-blue-600 dark:text-blue-400"),children:w.icon})}),t.jsx("h3",{className:f("text-xl font-bold text-gray-900 dark:text-white mb-4",i),children:w.title}),t.jsx("div",{className:f("text-gray-600 dark:text-gray-300 leading-relaxed",h),children:w.description}),w.link&&t.jsx("div",{className:"mt-6",children:t.jsxs("a",{href:w.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:[w.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:C},w.id||N)};return t.jsx("div",{className:f(qd({columns:a,spacing:n}),e),children:r.map(S)})},Wr=(e,r,a,n)=>({icon:e,title:r,description:a,...n}),Zd=e=>[Wr(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."),Wr(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.")],Jd=({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 w=()=>k.variant==="primary"||S?"gradient":(k.variant==="secondary","outline"),N=t.jsx(ne,{variant:w(),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)]})]})]})},Qd={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"}},Rd={basic:"Basic KYC",enhanced:"Enhanced KYC",accredited:"Accredited Investor"},e0=({status:e,level:r,className:a=""})=>{const n=Qd[e],o=Rd[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]})})},r0=({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"})})},t0={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"}},a0=({level:e,price:r,features:a,isActive:n=!1,isVerified:o=!1,onSelect:s,className:l=""})=>{const c=t0[e];return t.jsxs("div",{className:`
56
+ `+t)}`,discord:(t,r)=>`https://discord.com/channels/@me?message=${encodeURIComponent(r+`
57
+ `+t)}`,messages:(t,r)=>`sms:?&body=${encodeURIComponent(r+" "+t)}`},vi=({shareConfig:t})=>{const[r,a]=b.useState(!1),[o,s]=b.useState(""),[n,l]=b.useState(!1),[i,g]=b.useState(!1),[c,h]=b.useState(!1);b.useEffect(()=>{const k=t.onBeforeShare;k&&!o&&(async()=>{l(!0);try{const w=typeof window<"u"?window.location.href:"",C=await k(w);s(C)}catch{const w=typeof window<"u"?window.location.href:"";s(w)}finally{l(!1)}})()},[t,o]);const f=o||(typeof window<"u"?window.location.href:""),v=typeof navigator<"u"&&navigator.share!==void 0,p=async()=>{if(!(!v||c)){h(!0);try{await navigator.share({title:t.title,text:t.description,url:f}),a(!1)}catch(k){k instanceof Error&&k.name!=="AbortError"&&(console.error("Share failed:",k),k.name!=="InvalidStateError"&&a(!0))}finally{h(!1)}}},m=async()=>{try{await navigator.clipboard.writeText(f),g(!0),setTimeout(()=>{g(!1),a(!1)},1500)}catch{}},y=()=>{a(!r)},x=k=>{window.open(k,"_blank","noopener,noreferrer,width=600,height=400"),a(!1)},N=[{name:"Twitter",url:Q.twitter(f,t.title,t.hashtags),color:"text-blue-400",svg:e.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:Q.facebook(f),color:"text-blue-600",svg:e.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:Q.linkedin(f,t.title,t.description),color:"text-blue-700",svg:e.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:Q.reddit(f,t.title),color:"text-orange-600",svg:e.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:Q.telegram(f,t.title),color:"text-blue-500",svg:e.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:Q.whatsapp(f,t.title),color:"text-green-600",svg:e.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:Q.discord(f,t.title),color:"text-indigo-500",svg:e.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:Q.messages(f,t.title),color:"text-green-500",svg:e.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:Q.email(f,t.title,t.description),color:"text-gray-600",svg:e.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 e.jsxs("div",{className:"relative",children:[e.jsx("button",{onClick:y,disabled:n||c,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:n||c?e.jsx("div",{className:"w-4 h-4 border-2 border-blue-600 border-t-transparent rounded-full animate-spin"}):e.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:e.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&&e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"fixed inset-0 z-[999998]",onClick:()=>a(!1)}),e.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:[N.map(k=>e.jsxs("button",{onClick:()=>x(k.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:[e.jsx("svg",{className:`w-4 h-4 mr-2 ${k.color}`,fill:"currentColor",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:k.svg}),e.jsx("span",{className:"text-sm text-gray-700 dark:text-gray-300",children:k.name})]},k.name)),e.jsx("div",{className:"border-t border-gray-200 dark:border-gray-700 my-1"}),v&&e.jsxs("button",{onClick:()=>{a(!1),p()},disabled:c,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:[e.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:e.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"})}),e.jsx("span",{className:"text-sm text-gray-700 dark:text-gray-300",children:"More..."})]}),e.jsxs("button",{onClick:m,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:[e.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:e.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"})}),e.jsx("span",{className:"text-sm text-gray-700 dark:text-gray-300",children:i?"Copied!":"Copy Link"})]})]})]})]})},ar=({items:t,shareConfig:r,className:a,showHome:o})=>e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("nav",{"aria-label":"Breadcrumb",children:e.jsx("ol",{className:"flex items-center text-sm space-x-2",children:t.map((s,n)=>e.jsxs(b.Fragment,{children:[e.jsx("li",{children:s.current?e.jsx("span",{className:"text-gray-700 dark:text-gray-300",children:s.label}):e.jsx(H.Link,{to:s.href||"#",className:"text-blue-600 dark:text-blue-400 hover:text-blue-800 dark:hover:text-blue-300 transition-colors",children:s.label})}),n<t.length-1&&e.jsx("li",{children:e.jsx("span",{className:"text-gray-400 dark:text-gray-500",children:"/"})})]},n))})}),r&&e.jsx(vi,{shareConfig:r})]}),xi=ar,Kr={standard:"max-w-7xl mx-auto px-4",wide:"max-w-[1920px] mx-auto px-4",full:"w-full px-4"},Yr={standard:"max-w-7xl mx-auto",wide:"max-w-[1920px] mx-auto",full:"w-full"},Qr="px-4",or=b.createContext(void 0),Xr=({mode:t="standard",children:r})=>{const a={mode:t,containerClass:Kr[t],maxWidthClass:Yr[t],paddingClass:Qr};return e.jsx(or.Provider,{value:a,children:r})},R=()=>{const t=b.useContext(or);return t||{mode:"standard",containerClass:Kr.standard,maxWidthClass:Yr.standard,paddingClass:Qr}},ki=({items:t,shareConfig:r})=>{const{containerClass:a}=R();return e.jsx("div",{className:"bg-white dark:bg-gray-800 border-b border-gray-200 dark:border-gray-700 relative z-50",children:e.jsx("div",{className:`${a} py-3 relative`,children:e.jsx(ar,{items:t,shareConfig:r})})})},Jr=t=>{const[r,a]=b.useState(""),[o,s]=b.useState(!0),[n,l]=b.useState(null);return b.useEffect(()=>{t&&(async()=>{try{s(!0),l(null);const g=await fetch(`/code/${t}`);if(!g.ok)throw new Error(`Failed to load code file: ${t}`);const c=await g.text();a(c)}catch(g){l(g instanceof Error?g.message:"Unknown error"),a("// Error loading code file")}finally{s(!1)}})()},[t]),{code:r,loading:o,error:n}},wi=({filename:t,code:r,language:a,title:o,className:s="",showCopy:n=!0,showHeader:l=!0})=>{const{t:i}=Ne.useTranslation("codeBlock"),{code:g,loading:c,error:h}=Jr(t||""),[f,v]=b.useState(!1),p=r||g,y=a||(t?(N=>{switch(N.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"}})(t):"text"),x=async()=>{if(p)try{await navigator.clipboard.writeText(p),v(!0),setTimeout(()=>v(!1),2e3)}catch{}};return t&&c?e.jsx("div",{className:`bg-gray-900 text-green-400 rounded-lg p-4 font-mono text-sm ${s}`,children:e.jsx("div",{className:"animate-pulse text-gray-500",children:i("loadingCode","Loading code...")})}):t&&h?e.jsxs("div",{className:`bg-gray-900 text-red-400 rounded-lg p-4 font-mono text-sm ${s}`,children:[i("error","Error"),": ",h]}):p?e.jsxs("div",{className:`bg-gray-900 rounded-lg border border-green-500/20 shadow-lg shadow-green-500/10 ${s}`,children:[l&&e.jsxs("div",{className:"flex items-center justify-between px-4 py-2 border-b border-green-500/20 bg-gray-800/50",children:[e.jsx("span",{className:"text-sm text-green-400 font-mono",children:o||t||`${y} code`}),n&&e.jsx("button",{onClick:x,className:"p-2 text-gray-400 hover:text-green-400 hover:bg-gray-800 rounded-lg transition-all duration-200 group",title:i("copyCode","Copy code"),children:f?e.jsx(z.CheckIcon,{className:"h-4 w-4 text-green-400"}):e.jsx(z.ClipboardDocumentIcon,{className:"h-4 w-4 group-hover:scale-110 transition-transform"})})]}),e.jsx("div",{className:"p-4 overflow-x-auto text-left",children:e.jsx("pre",{className:`text-sm language-${y}`,children:e.jsx("code",{className:"text-gray-100",children:p})})})]}):e.jsx("div",{className:`bg-gray-900 text-gray-400 rounded-lg p-4 font-mono text-sm ${s}`,children:i("noCode","No code to display")})},Ci=({subsections:t,isExpanded:r,selectedSubsection:a,parentSectionId:o,onSubsectionSelect:s})=>{const n=b.useRef(null),[l,i]=b.useState(void 0);return b.useLayoutEffect(()=>{if(n.current){const g=n.current.scrollHeight;i(r?g+16:0)}},[r,t]),e.jsx("div",{className:"overflow-hidden transition-all duration-300 ease-in-out",style:{height:l!==void 0?`${l}px`:"auto"},children:e.jsx("div",{ref:n,className:"ml-6 mt-1 mb-1 space-y-1",children:t.map(g=>e.jsxs("div",{className:"relative group",children:[a===g.id&&e.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!==g.id&&e.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"}),e.jsx("button",{onClick:()=>s?.(g.id,o),className:`relative z-10 block w-full text-left pl-4 pr-3 py-2 rounded-md text-sm transition-all duration-200 ${a===g.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:g.title})]},g.id))})})},Ni=({id:t,title:r,content:a,subsections:o,isSelected:s=!1,selectedSubsection:n=null,onSectionSelect:l,onSubsectionSelect:i,className:g=""})=>{const[c,h]=b.useState(!1),f=()=>{h(!c)},v=()=>{l?.(t)},p=o&&o.length>0;return e.jsxs("div",{className:g,children:[e.jsxs("div",{className:"relative flex items-center group",children:[s&&!n&&e.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"}),!(s&&!n)&&e.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"}),e.jsx("button",{onClick:v,className:`relative z-10 flex-1 text-left pl-5 pr-3 py-4 text-base font-medium transition-all duration-200 ${s&&!n?"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}),p&&e.jsx("button",{onClick:f,className:"p-2 rounded-md hover:bg-gray-100 dark:hover:bg-gray-800 hover:scale-110 transition-all duration-200","aria-label":c?"Collapse section":"Expand section",children:e.jsx(z.ChevronRightIcon,{className:`h-5 w-5 text-gray-500 transition-transform duration-300 ease-in-out ${c?"rotate-90":"rotate-0"}`})})]}),p&&e.jsx(Ci,{subsections:o,isExpanded:c,selectedSubsection:n,parentSectionId:t,onSubsectionSelect:i})]})},Si=({title:t,subtitle:r,buttonText:a,buttonIcon:o="envelope",variant:s="default",badgeText:n="FREE",prominentBadgeText:l="100% Free",onButtonClick:i,className:g=""})=>{const c=()=>o==="envelope"||o==="both"?e.jsx(z.EnvelopeIcon,{className:s==="prominent"?"h-5 w-5 mr-2":"h-4 w-4 mr-1"}):o==="none"?null:e.jsx("svg",{className:s==="prominent"?"h-5 w-5 mr-2":"h-4 w-4 mr-1",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:e.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=()=>o==="arrow"||o==="both"?e.jsx(z.ArrowRightIcon,{className:"h-4 w-4 ml-2"}):null,f=()=>s==="prominent"?"border-b-2 border-green-200 dark:border-green-700":"border-b border-green-200 dark:border-green-700",v=()=>{const x="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 s==="prominent"?`${x} px-8 py-3 text-base`:`${x} px-6 py-2 text-sm`},p=()=>s==="prominent"?"text-green-800 dark:text-green-200 font-semibold text-lg":"text-green-800 dark:text-green-200 font-semibold",m=s==="prominent"?l:n,{containerClass:y}=R();return e.jsx("div",{className:`bg-gradient-to-r from-green-100 to-blue-100 dark:from-green-900/20 dark:to-blue-900/20 ${f()} ${g}`,children:e.jsx("div",{className:`${y} py-4`,children:e.jsxs("div",{className:"flex flex-col sm:flex-row items-center justify-between gap-4",children:[e.jsxs("div",{className:`flex items-center ${s==="prominent"?"text-center sm:text-left":""}`,children:[e.jsx("div",{className:"bg-green-500 text-white text-xs font-bold px-3 py-1 rounded-full mr-3 animate-pulse",children:m}),e.jsxs("div",{children:[e.jsx("span",{className:p(),children:t}),r&&e.jsx("span",{className:"text-green-700 dark:text-green-300 text-sm block",children:r})]})]}),e.jsxs("button",{onClick:i,className:v(),children:[c(),a,h()]})]})})})},Li=({children:t,onClick:r,variant:a,size:o,disabled:s,className:n,type:l,trackingLabel:i,actionType:g,componentName:c,onTrack:h,trackingParams:f={},...v})=>{const p=m=>{if(h){const y=i||(typeof t=="string"?t:"")||"Unknown Button",N=a&&["default","primary","secondary","outline","ghost","destructive","link"].includes(a)?a:"default";h({button_text:y,button_type:N,component_name:c,action_type:g,...f})}r&&r(m)};return e.jsx(G,{...v,variant:a,size:o,disabled:s,className:n,type:l,onClick:p,children:t})},Ei=({children:t,onClick:r,to:a,href:o,trackingLabel:s,componentName:n,onTrack:l,trackingParams:i={},LinkComponent:g,linkProps:c={},...h})=>{const f=p=>{if(l){const m=s||(typeof t=="string"?t:"")||"Unknown Link",y=a?typeof a=="string"?a:a.pathname||"":o||"";l({link_text:m,link_url:y,to_page:y,navigation_type:g?"router_link":"anchor_link",component_name:n,...i})}r&&r(p)};if(g&&a!==void 0)return e.jsx(g,{...c,to:a,onClick:f,...h,children:t});const v=a?typeof a=="string"?a:a.pathname||"#":o;return e.jsx("a",{...h,href:v,onClick:f,children:t})},Zr={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:"🇨🇳"}},Mi=({variant:t="compact",className:r=""})=>{const{i18n:a,t:o}=Ne.useTranslation("languageSelector"),[s,n]=b.useState(a.language),l=b.useMemo(()=>a.options.supportedLngs?a.options.supportedLngs.filter(c=>c!=="cimode").map(c=>({code:c,name:Zr[c]?.name||c.toUpperCase(),flag:Zr[c]?.flag||"🌐"})).sort((c,h)=>c.name.localeCompare(h.name)):[],[a.options.supportedLngs]),i=l.find(c=>c.code===s||c.code.toLowerCase()===s.toLowerCase());b.useEffect(()=>{n(a.language)},[a.language]);const g=c=>{localStorage.setItem("language",c),a.changeLanguage(c).then(()=>{n(a.language),setTimeout(()=>{window.dispatchEvent(new Event("languagechange"))},100)}).catch(()=>{})};return t==="compact"?e.jsx("div",{className:`relative ${r}`,children:e.jsxs(Ke,{value:s,onValueChange:g,children:[e.jsx(Ee,{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:e.jsxs("div",{className:"flex items-center space-x-2",children:[e.jsx("span",{className:"text-lg leading-none",children:i?.flag}),e.jsx("span",{className:"hidden sm:block text-sm font-medium text-gray-700 dark:text-gray-300",children:i?.name})]})}),e.jsx(Me,{children:l.map(c=>e.jsx(Ie,{value:c.code,className:"cursor-pointer",children:e.jsxs("div",{className:"flex items-center space-x-2",children:[e.jsx("span",{className:"text-lg leading-none",children:c.flag}),e.jsx("span",{className:"text-sm",children:c.name})]})},c.code))})]})}):e.jsxs("div",{className:`space-y-2 ${r}`,children:[e.jsxs("label",{className:"text-sm font-medium text-gray-700 dark:text-gray-300 flex items-center space-x-2",children:[e.jsx(z.LanguageIcon,{className:"h-4 w-4 text-gray-500 dark:text-gray-400"}),e.jsx("span",{children:o("language","Language")})]}),e.jsxs(Ke,{value:s,onValueChange:g,children:[e.jsx(Ee,{children:e.jsx(zr,{placeholder:o("selectLanguage","Select language")})}),e.jsx(Me,{children:l.map(c=>e.jsx(Ie,{value:c.code,className:"cursor-pointer",children:e.jsxs("div",{className:"flex items-center space-x-2",children:[e.jsx("span",{className:"text-lg leading-none",children:c.flag}),e.jsx("span",{children:c.name})]})},c.code))})]}),e.jsx("p",{className:"text-xs text-gray-500 dark:text-gray-400",children:o("selectPreferredLanguage","Select your preferred language")})]})},Ii=({items:t,type:r="ordered",variant:a="default",className:o,itemClassName:s})=>{const n=()=>{const c="space-y-2",h={ordered:r==="ordered"?"list-decimal":"",unordered:r==="unordered"?"list-disc":""},f={default:"list-inside",enhanced:"list-inside space-y-3",minimal:"list-none space-y-1"};return u(c,h[r],f[a])},l=c=>{const h="text-gray-600 dark:text-gray-400";return a==="enhanced"?u(h,"relative pl-8 pb-2 border-l-2 border-gray-200 dark:border-gray-700",c===t.length-1&&"border-l-transparent"):a==="minimal"?u(h,"flex items-start"):h},i=c=>a==="enhanced"&&r==="ordered"?e.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:c+1}):null,g=(c,h)=>{const f=typeof c=="object",v=f?c.content:c,p=f?c.subItems:void 0;return e.jsxs("li",{className:u(l(h),s),children:[i(h),a==="minimal"&&r==="ordered"&&e.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"&&e.jsx("span",{className:"inline-block w-2 h-2 bg-blue-600 rounded-full mt-2 mr-3 flex-shrink-0"}),e.jsxs("div",{className:"flex-1",children:[e.jsx("div",{children:v}),p&&p.length>0&&e.jsx("ul",{className:"mt-2 ml-4 space-y-1 list-disc list-inside text-sm text-gray-500 dark:text-gray-500",children:p.map((m,y)=>e.jsx("li",{children:m},y))})]})]},h)};return e.jsx("ul",{className:u(n(),o),children:t.map(g)})};class Ti extends b.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:e.jsxs("div",{style:{padding:"20px",border:"1px solid red",margin:"10px"},children:[e.jsx("h2",{children:"Something went wrong"}),e.jsxs("p",{children:["Error: ",this.state.error?.message||"Unknown error"]}),e.jsx("button",{onClick:()=>this.setState({hasError:!1}),children:"Try again"})]}):this.props.children}}class $e extends b.Component{constructor(r){super(r),this.retryTimer=null,this.sendErrorToMonitoring=(a,o)=>{try{typeof window<"u"&&window.Sentry&&window.Sentry?.captureException(a,{contexts:{react:{componentStack:o.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:o=1e3}=this.props,{retryCount:s}=this.state;if(s>=a)return;this.setState({isRetrying:!0}),this.retryTimer&&clearTimeout(this.retryTimer);const n=o*Math.pow(2,s);this.retryTimer=setTimeout(()=>{this.setState({hasError:!1,error:null,errorInfo:null,retryCount:s+1,isRetrying:!1})},n)},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:o,componentName:s}=this.props;this.setState({error:r,errorInfo:a}),console.error(`LazyErrorBoundary caught an error in ${s||"Unknown Component"}:`,r,a),o?.(r,a),this.sendErrorToMonitoring(r,a)}componentWillUnmount(){this.retryTimer&&clearTimeout(this.retryTimer)}render(){const{children:r,fallback:a,componentName:o,showRetryButton:s=!0,maxRetries:n=3}=this.props,{hasError:l,error:i,isRetrying:g,retryCount:c}=this.state;return l&&i?a||e.jsx("div",{className:"lazy-error-boundary error-boundary-container",children:e.jsxs("div",{className:"error-content",children:[e.jsx("div",{className:"error-icon",children:"⚠️"}),e.jsxs("h3",{className:"error-title",children:["Something went wrong loading ",o||"this component"]}),e.jsxs("div",{className:"error-details",children:[e.jsx("p",{className:"error-message",children:i.message}),process.env.NODE_ENV==="development"&&e.jsxs("details",{className:"error-stack",children:[e.jsx("summary",{children:"Error Details (Development)"}),e.jsx("pre",{children:i.stack})]})]}),e.jsxs("div",{className:"error-actions",children:[s&&c<n&&e.jsx("button",{onClick:this.handleRetry,disabled:g,className:"retry-button",children:g?"Retrying...":`Retry (${c}/${n})`}),c>=n&&e.jsx("button",{onClick:this.handleReload,className:"reload-button",children:"Reload Page"})]}),e.jsxs("div",{className:"error-help",children:[e.jsx("p",{children:"This might be a temporary issue. Try refreshing the page."}),navigator.onLine===!1&&e.jsx("p",{className:"offline-notice",children:"You appear to be offline. Check your connection and try again."})]})]})}):r}}function Pi(t,r){const a=o=>e.jsx($e,{...r,children:e.jsx(t,{...o})});return a.displayName=`withLazyErrorBoundary(${t.displayName||t.name})`,a}class zi extends $e{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 Ui(){const[t,r]=b.useState(0),a=b.useCallback(()=>{r(o=>o+1)},[]);return{errorRecoveryCount:t,triggerErrorRecovery:a}}function Ai({children:t}){const r=(a,o)=>{console.error("Global lazy loading error:",a,o),typeof window<"u"&&window.Sentry&&window.Sentry?.captureException(a,{level:"error",tags:{globalErrorBoundary:!0,lazyLoading:!0}})};return e.jsx($e,{onError:r,componentName:"Application",maxRetries:1,showRetryButton:!0,fallback:e.jsxs("div",{className:"global-error-fallback",children:[e.jsx("h1",{children:"Application Error"}),e.jsx("p",{children:"Something went wrong with the application. Please refresh the page."}),e.jsx("button",{onClick:()=>window.location.reload(),children:"Refresh Page"})]}),children:t})}const $i=({children:t})=>e.jsx(e.Fragment,{children:t}),Di=({children:t})=>e.jsx(e.Fragment,{children:t}),Bi=(t,r,a)=>{const o=b.memo(t,r);return a&&(o.displayName=`Memo(${a})`),process.env.NODE_ENV==="development"?s=>(b.useMemo(()=>{let l=0;return()=>++l},[])(),e.jsx(o,{...s})):o},ji=(t,r)=>b.memo(t,(a,o)=>r.every(s=>a[s]===o[s])),Fi=b.memo(({children:t,compute:r,deps:a})=>{const o=b.useRef(a),s=b.useRef(r),n=b.useRef(void 0),l=b.useMemo(()=>{const i=a.length!==o.current.length||a.some((c,h)=>c!==o.current[h]),g=r!==s.current;if(i||g||n.current===void 0){let c;return process.env.NODE_ENV==="development"?(performance.now(),c=r(),performance.now()):c=r(),o.current=a,s.current=r,n.current=c,c}return n.current},[r,a]);return e.jsx(e.Fragment,{children:t(l)})}),Oi=b.memo(({item:t,index:r,style:a,renderItem:o})=>e.jsx("div",{style:a,children:o(t,r)}),(t,r)=>t.index===r.index&&t.item===r.item&&t.style.height===r.style.height&&t.style.top===r.style.top),Vi=b.memo(({condition:t,children:r,fallback:a=null})=>t?e.jsx(e.Fragment,{children:r}):e.jsx(e.Fragment,{children:a})),Wi=({children:t,threshold:r=.1,rootMargin:a="50px",fallback:o=null})=>{const[s,n]=b.useState(!1),l=b.useRef(null);return b.useEffect(()=>{const i=new IntersectionObserver(([g])=>{g.isIntersecting&&(n(!0),i.disconnect())},{threshold:r,rootMargin:a});return l.current&&i.observe(l.current),()=>i.disconnect()},[r,a]),e.jsx("div",{ref:l,children:s?t:o})},Hi=({children:t,maxRenderTime:r=16,onSlowRender:a})=>{const o=b.useRef(0);return b.useLayoutEffect(()=>{o.current=performance.now()}),b.useEffect(()=>{const s=performance.now()-o.current;s>r&&a?.(s)}),e.jsx(e.Fragment,{children:t})},_i=({children:t,batchSize:r=5,delay:a=0})=>{const[o,s]=b.useState(r);return b.useEffect(()=>{if(o<t.length){const n=setTimeout(()=>{s(l=>Math.min(l+r,t.length))},a);return()=>clearTimeout(n)}},[o,t.length,r,a]),e.jsx(e.Fragment,{children:t.slice(0,o)})},qi=({src:t,alt:r,placeholder:a,lowQualitySrc:o,aspectRatio:s="16/9",eager:n=!1,className:l="",...i})=>{const[g,c]=b.useState(!1),[h,f]=b.useState(n),[v,p]=b.useState(!1),m=b.useRef(null),y=b.useRef(null);b.useEffect(()=>{if(n){f(!0);return}return y.current=new IntersectionObserver(k=>{k.forEach(S=>{S.isIntersecting&&(f(!0),y.current&&m.current&&y.current.unobserve(m.current))})},{rootMargin:"50px",threshold:.01}),m.current&&y.current.observe(m.current),()=>{y.current&&y.current.disconnect()}},[n]);const x=()=>{c(!0)},N=()=>{p(!0)};return e.jsxs("div",{className:`relative overflow-hidden ${l}`,style:{aspectRatio:s},children:[o&&!g&&e.jsx("img",{src:o,alt:"",className:"absolute inset-0 w-full h-full object-cover blur-sm","aria-hidden":"true"}),!o&&!g&&e.jsx("div",{className:"absolute inset-0 bg-gray-200 dark:bg-gray-700 animate-pulse","aria-hidden":"true"}),h&&!v&&e.jsx("img",{ref:m,src:t,alt:r,onLoad:x,onError:N,className:`absolute inset-0 w-full h-full object-cover transition-opacity duration-500 ${g?"opacity-100":"opacity-0"}`,loading:n?"eager":"lazy",...i}),v&&e.jsx("div",{className:"absolute inset-0 flex items-center justify-center bg-gray-100 dark:bg-gray-800",children:e.jsxs("div",{className:"text-center text-gray-500 dark:text-gray-400",children:[e.jsx("svg",{className:"mx-auto h-12 w-12 mb-2",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:e.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"})}),e.jsx("p",{className:"text-sm",children:"Failed to load image"})]})})]})},Gi=t=>/^[a-z]{2}(-[a-z]+)?$/.test(t);function Ki({to:t,language:r,children:a,isLanguageSupported:o=Gi,defaultLanguage:s="en",...n}){const{lang:l}=H.useParams(),i=l&&o(l)?l:s,g=r||i,c=t.startsWith(`/${g}`)?t:`/${g}${t.startsWith("/")?t:`/${t}`}`;return e.jsx(H.Link,{to:c,...n,children:a})}function Yi({isLanguageSupported:t,defaultLanguage:r="en",storageKey:a="language",fallback:o=null}){const{lang:s}=H.useParams(),n=H.useNavigate(),{i18n:l}=Ne.useTranslation();return b.useEffect(()=>{if(!s||!t(s)){n(`/${r}`,{replace:!0});return}l.language!==s&&l.changeLanguage(s);try{localStorage.setItem(a,s)}catch{}},[s,l,n,t,r,a]),!s||!t(s)?e.jsx(e.Fragment,{children:o}):e.jsx(H.Outlet,{})}function sr(t,r){const a=nr(t);return`/${r}${a.startsWith("/")?a:`/${a}`}`}function nr(t,r){const a=t.split("/").filter(Boolean);if(a.length>0){const o=a[0];if(/^[a-z]{2}(-[a-z]+)?$/.test(o)&&(!r||r(o)))return"/"+a.slice(1).join("/")}return t}function Qi(t={}){const{isLanguageSupported:r=h=>/^[a-z]{2}(-[a-z]+)?$/.test(h),defaultLanguage:a="en",storageKey:o="language"}=t,s=H.useNavigate(),{lang:n}=H.useParams(),{i18n:l}=Ne.useTranslation(),i=n&&r(n)?n:l.language||a,g=b.useCallback((h,f)=>{if(typeof h=="number"){s(h);return}const v=sr(h,i);s(v,f)},[s,i]),c=b.useCallback((h,f)=>{l.changeLanguage(h);const v=nr(f||(typeof window<"u"?window.location.pathname:"/"),r),p=sr(v,h);s(p,{replace:!0});try{localStorage.setItem(o,h)}catch{}},[s,l,r,o]);return{navigate:g,switchLanguage:c,currentLanguage:i}}function Xi(){return e.jsx("div",{className:"min-h-screen flex items-center justify-center bg-theme-bg-primary",children:e.jsx("div",{className:"animate-spin rounded-full h-8 w-8 border-b-2 border-blue-600"})})}function Ji({children:t,isAuthenticated:r,isLoading:a=!1,redirectPath:o,loadingComponent:s,fallback:n=null}){const l=H.useNavigate(),{lang:i}=H.useParams();return b.useEffect(()=>{if(!a&&!r){const g=o?o.replace(":lang",i||"en"):`/${i||"en"}`;l(g,{replace:!0})}},[r,a,l,i,o]),a?e.jsx(e.Fragment,{children:s??e.jsx(Xi,{})}):r?e.jsx(e.Fragment,{children:t}):e.jsx(e.Fragment,{children:n})}function Zi(){return e.jsx("svg",{className:"w-8 h-8 text-red-600 dark:text-red-400",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:e.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 Ri({spinning:t=!1}){return e.jsx("svg",{className:`w-4 h-4 ${t?"animate-spin":""}`,fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:e.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 ec({title:t="Something went wrong",message:r="An unexpected error occurred. Please try again.",onRetry:a,isRetrying:o=!1,retryText:s="Retry",loadingText:n="Loading...",icon:l,className:i=""}){return e.jsx("div",{className:`flex flex-col items-center justify-center py-12 px-4 ${i}`,children:e.jsxs("div",{className:"flex flex-col items-center max-w-md text-center",children:[e.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??e.jsx(Zi,{})}),e.jsx("h3",{className:"text-lg font-semibold text-theme-text-primary mb-2",children:t}),e.jsx("p",{className:"text-sm text-theme-text-secondary mb-6",children:r}),a&&e.jsxs("button",{onClick:a,disabled:o,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:[e.jsx(Ri,{spinning:o}),o?n:s]})]})})}var q=(t=>(t.LIGHT="light",t.DARK="dark",t.SYSTEM="system",t))(q||{}),lr=(t=>(t.SMALL="small",t.MEDIUM="medium",t.LARGE="large",t))(lr||{});const De={getItem:t=>{try{return localStorage.getItem(t)}catch{return null}},setItem:(t,r)=>{try{localStorage.setItem(t,r)}catch{}}},ir=b.createContext(void 0);function rc(){const t=b.useContext(ir);if(t===void 0)throw new Error("useTheme must be used within a ThemeProvider");return t}function tc({children:t,themeStorageKey:r="theme",fontSizeStorageKey:a="font-size",defaultTheme:o=q.LIGHT,defaultFontSize:s=lr.MEDIUM}){const[n,l]=b.useState(()=>De.getItem(r)||o),[i,g]=b.useState(()=>De.getItem(a)||s),[c,h]=b.useState(()=>n===q.SYSTEM?typeof window<"u"&&window.matchMedia("(prefers-color-scheme: dark)").matches?q.DARK:q.LIGHT:n),f=b.useCallback(m=>{l(m),De.setItem(r,m)},[r]),v=b.useCallback(m=>{g(m),De.setItem(a,m)},[a]);b.useEffect(()=>{const m=document.documentElement;let y=n;n===q.SYSTEM&&(y=window.matchMedia("(prefers-color-scheme: dark)").matches?q.DARK:q.LIGHT),h(y),m.classList.remove("light","dark"),m.classList.add(y),m.classList.remove("font-small","font-medium","font-large"),m.classList.add(`font-${i}`)},[n,i]),b.useEffect(()=>{if(n===q.SYSTEM){const m=window.matchMedia("(prefers-color-scheme: dark)"),y=x=>{const N=document.documentElement,k=x.matches?q.DARK:q.LIGHT;h(k),N.classList.remove("light","dark"),N.classList.add(k)};return m.addEventListener("change",y),()=>{m.removeEventListener("change",y)}}},[n]);const p=b.useMemo(()=>({theme:n,fontSize:i,setTheme:f,setFontSize:v,resolvedTheme:c}),[n,i,f,v,c]);return e.jsx(ir.Provider,{value:p,children:t})}const ac=({icon:t,title:r,description:a,benefits:o,metrics:s,color:n="blue",isHighlight:l=!1,learnMoreUrl:i,cta:g,onClick:c,interactive:h=!1,borderColor:f=!1,className:v})=>{const p={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"},m={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"},y={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"},x=p[n],N=typeof t=="string",k=()=>e.jsxs(e.Fragment,{children:[N?e.jsx("div",{className:"text-4xl mb-4",children:t}):f?e.jsx("div",{className:u("w-12 h-12","rounded-lg","flex items-center justify-center","mb-4",y[n],x),children:t}):e.jsx("div",{className:u("flex-shrink-0 mb-4",x),children:t}),e.jsxs("div",{className:"flex-1",children:[e.jsx("h3",{className:"text-xl font-semibold text-gray-900 dark:text-white mb-3",children:r}),e.jsx("p",{className:"text-gray-600 dark:text-gray-300 mb-4 leading-relaxed",children:a}),g&&e.jsx("div",{className:"mt-3 mb-4",children:g}),o&&o.length>0&&e.jsx("ul",{className:"space-y-2 mb-4",children:o.map((C,E)=>e.jsxs("li",{className:"flex items-start",children:[e.jsx("div",{className:u("w-2 h-2 rounded-full mt-2 mr-3 flex-shrink-0",`bg-${n}-500`)}),e.jsx("span",{className:"text-sm text-gray-600 dark:text-gray-400",children:C})]},E))}),s&&Object.keys(s).length>0&&e.jsx("div",{className:"grid grid-cols-2 gap-4 mt-4",children:Object.entries(s).map(([C,E],M)=>e.jsxs("div",{className:"text-center p-3 bg-gray-50 dark:bg-gray-700/50 rounded-lg",children:[e.jsx("div",{className:u("text-lg font-bold",x),children:E}),e.jsx("div",{className:"text-xs text-gray-500 dark:text-gray-400 mt-1",children:C})]},M))})]})]}),S=u("p-6 rounded-xl shadow-lg hover:shadow-xl transition-all duration-200",f&&m[n],(h||c)&&"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",v),w=C=>{c&&("key"in C?(C.key==="Enter"||C.key===" ")&&(C.preventDefault(),c()):c())};return i?e.jsx("a",{href:i,className:u(S,"block group"),onClick:c?C=>{C.preventDefault(),w(C)}:void 0,children:e.jsx(k,{})}):c?e.jsx("div",{className:S,onClick:w,onKeyDown:w,role:"button",tabIndex:0,"aria-label":r,children:e.jsx(k,{})}):e.jsx("div",{className:S,children:e.jsx(k,{})})},oc=W.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"}}),sc=W.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"}}),nc=W.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"}}),lc={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"},ic=({className:t,features:r,columns:a=3,spacing:o="md",cardVariant:s="default",cardAnimation:n="hover",iconSize:l="md",iconStyle:i="gradient",iconPosition:g="center",titleClass:c,descriptionClass:h,animate:f=!0,animationDelay:v=0,staggerDelay:p=100,onFeatureClick:m,defaultLinkText:y="Learn more"})=>{const x=(k,S)=>{if(i==="colorful"&&k.gradient)return{background:`linear-gradient(135deg, ${k.gradient.from}, ${k.gradient.to})`};if(i==="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"}],C=w[S%w.length];return{background:`linear-gradient(135deg, ${C.from}, ${C.to})`}}},N=(k,S)=>{const w=e.jsxs("div",{className:u(sc({variant:s,animation:n})),onClick:()=>m?.(k),role:m?"button":void 0,tabIndex:m?0:void 0,children:[k.badge&&e.jsx("div",{className:"mb-4",children:e.jsx("span",{className:u("inline-flex items-center px-2.5 py-0.5 rounded-full text-xs font-medium",lc[k.badge.variant||"default"]),children:k.badge.text})}),e.jsx("div",{className:u(nc({size:l,style:i,position:g})),style:x(k,S),children:e.jsx("div",{className:u("flex items-center justify-center",i==="colorful"?"text-white":"text-blue-600 dark:text-blue-400"),children:k.icon})}),e.jsx("h3",{className:u("text-xl font-bold text-gray-900 dark:text-white mb-4",c),children:k.title}),e.jsx("div",{className:u("text-gray-600 dark:text-gray-300 leading-relaxed",h),children:k.description}),k.link&&e.jsx("div",{className:"mt-6",children:e.jsxs("a",{href:k.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:[k.link.text||y,e.jsx("svg",{className:"w-4 h-4 ml-1",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 5l7 7-7 7"})})]})})]});return e.jsx("div",{children:w},k.id||S)};return e.jsx("div",{className:u(oc({columns:a,spacing:o}),t),children:r.map(N)})},cr=(t,r,a,o)=>({icon:t,title:r,description:a,...o}),cc=t=>[cr(e.jsx("svg",{className:"w-8 h-8",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:e.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"})}),t?.passwordlessTitle||"Passwordless Security",t?.passwordlessDescription||"Authenticate using your Web3 wallet - no passwords to remember or lose."),cr(e.jsx("svg",{className:"w-8 h-8",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:e.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"})}),t?.encryptionTitle||"End-to-End Encryption",t?.encryptionDescription||"Your emails are encrypted and only you can read them.")],dc=({title:t,description:r,primaryButton:a,secondaryButton:o,gradient:s={from:"blue-600",to:"purple-600"},textColor:n="light",className:l="",size:i="lg"})=>{const{paddingClass:g}=R(),h=(()=>{const x=s.via?`${s.from}-${s.via}-${s.to}`:`${s.from}-${s.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"}[x]||"bg-gradient-to-r from-blue-600 to-purple-600 dark:from-blue-700 dark:to-purple-700"})(),f=n==="light"?"text-white":"text-gray-900 dark:text-gray-100",v={sm:"py-12",md:"py-16",lg:"py-20"},p={sm:"text-2xl md:text-3xl",md:"text-3xl md:text-4xl",lg:"text-4xl md:text-5xl"},m={sm:"text-base md:text-lg",md:"text-lg md:text-xl",lg:"text-xl md:text-2xl"},y=(x,N=!1)=>{const k=()=>x.variant==="primary"||N?"gradient":(x.variant==="secondary","outline"),S=e.jsx(G,{variant:k(),size:"lg",className:N?"":"bg-white/10 hover:bg-white/20 backdrop-blur-sm border-white/30",children:x.label});return x.external?e.jsx("a",{href:x.href,target:"_blank",rel:"noopener noreferrer",children:S}):e.jsx(H.Link,{to:x.href,children:S})};return e.jsxs("section",{className:`${h} ${v[i]} relative overflow-hidden ${l}`,children:[e.jsx("div",{className:"absolute inset-0 bg-black/20"}),e.jsxs("div",{className:"absolute top-0 left-1/2 transform -translate-x-1/2 w-full h-full",children:[e.jsx("div",{className:"absolute top-10 left-10 w-72 h-72 bg-white/10 rounded-full blur-3xl"}),e.jsx("div",{className:"absolute bottom-10 right-10 w-72 h-72 bg-white/10 rounded-full blur-3xl"})]}),e.jsxs("div",{className:`relative z-10 max-w-4xl mx-auto ${g} text-center`,children:[e.jsx("h2",{className:`${p[i]} font-bold ${f} mb-6`,children:t}),e.jsx("p",{className:`${m[i]} ${f}/90 mb-8 max-w-2xl mx-auto`,children:r}),e.jsxs("div",{className:"flex flex-col sm:flex-row gap-4 justify-center",children:[y(a,!0),o&&y(o,!1)]})]})]})},gc={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"}},uc={basic:"Basic KYC",enhanced:"Enhanced KYC",accredited:"Accredited Investor"},hc=({status:t,level:r,className:a=""})=>{const o=gc[t],s=uc[r];return e.jsx("div",{className:`inline-flex items-center gap-2 ${a}`,children:e.jsxs("span",{className:`px-3 py-1 rounded-full text-sm font-medium ${o.color} ${o.textColor}`,children:[s,": ",o.label]})})},fc=({accessToken:t,onComplete:r,onError:a,className:o=""})=>{const s=b.useRef(null),n=b.useRef(null);return b.useEffect(()=>{if(!t)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(s.current&&window.snsWebSdk)try{const i=window.snsWebSdk.init(t,()=>t).withConf({lang:"en"}).withOptions({addViewportTag:!1,adaptIframeHeight:!0}).on("idCheck.onStepCompleted",g=>{}).on("idCheck.onApplicantSubmitted",g=>{r?.()}).on("idCheck.onError",g=>{console.error("SumsubWebSDK: Error",g),a?.(g)}).build();n.current=i,i.launch("#sumsub-websdk-container")}catch(i){console.error("Failed to initialize Sumsub SDK:",i),a?.(i)}else console.error("SumsubWebSDK: Missing requirements - containerRef:",!!s.current,"snsWebSdk:",!!window.snsWebSdk)},l.onerror=()=>{const i=new Error("Failed to load Sumsub Web SDK script");console.error(i),a?.(i)},document.body.appendChild(l),()=>{document.body.contains(l)&&document.body.removeChild(l),n.current&&typeof n.current.destroy=="function"&&n.current.destroy()}},[t,r,a]),e.jsx("div",{className:`sumsub-sdk-container ${o}`,children:e.jsx("div",{ref:s,id:"sumsub-websdk-container"})})},bc={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"}},mc=({level:t,price:r,features:a,isActive:o=!1,isVerified:s=!1,onSelect:n,className:l=""})=>{const i=bc[t];return e.jsxs("div",{className:`
59
58
  relative border-2 rounded-lg p-6 transition-all
60
- ${n?c.activeColor:`${c.color} hover:border-gray-400`}
59
+ ${o?i.activeColor:`${i.color} hover:border-gray-400`}
61
60
  ${l}
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:`
61
+ `,children:[s&&e.jsx("div",{className:"absolute top-4 right-4",children:e.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"})}),e.jsx("h3",{className:"text-xl font-bold mb-2",children:i.title}),e.jsx("p",{className:"text-gray-600 mb-4",children:i.description}),e.jsxs("p",{className:"text-3xl font-bold mb-4",children:[r,e.jsx("span",{className:"text-sm font-normal text-gray-600",children:"/year"})]}),e.jsx("ul",{className:"space-y-2 mb-6",children:a.map((g,c)=>e.jsxs("li",{className:"flex items-start gap-2",children:[e.jsx("span",{className:"text-green-500 mt-0.5",children:"✓"}),e.jsx("span",{className:"text-sm",children:g})]},c))}),n&&e.jsx("button",{onClick:n,disabled:s,className:`
63
62
  w-full py-2 px-4 rounded font-medium transition-colors
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"})]})},n0=({children:e,backgroundClassName:r="",contentClassName:a=""})=>t.jsx("div",{className:r,children:t.jsx("div",{className:a,children:e})}),o0=({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})]}),s0=({children:e,mode:r,className:a,as:n="div",withPadding:o=!0})=>{const s=ue(),l=r?l0(r,o):o?s.containerClass:s.maxWidthClass;return t.jsx(n,{className:f(l,a),children:e})};function l0(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 i0=({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})})},c0=({children:e,className:r})=>t.jsx("div",{className:f("grid md:grid-cols-5 gap-8",r),children:e}),d0=({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:D.body.sm(),children:r})]}),g0=({title:e,children:r,className:a})=>t.jsxs("div",{className:a,children:[t.jsx("h3",{className:f(D.heading.h5(),"mb-4 text-white"),children:e}),t.jsx("ul",{className:f("space-y-2",D.body.sm()),children:r})]}),u0=({children:e,className:r})=>t.jsx("li",{className:f("hover:text-white transition-colors",r),children:e}),h0=({children:e,className:r})=>t.jsx("div",{className:f("border-t mt-8 pt-8 text-center space-y-4",Dn.border.default,r),children:e}),f0=({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}),b0=({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}),m0=({children:e,className:r})=>t.jsx("div",{className:f("flex items-center gap-3 text-gray-400 text-sm",r),children:e}),y0=({children:e,className:r})=>t.jsx("div",{className:f("flex space-x-6 text-sm",r),children:e}),p0=({version:e,className:r})=>t.jsxs("span",{className:f("text-gray-500",r),children:["v",e]}),v0=({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}`]}),ke=({href:e,label:r,children:a})=>t.jsx(aa,{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})}),k0=({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(ke,{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(ke,{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(ke,{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(ke,{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(ke,{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(ke,{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(ke,{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,w0=({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})]})]})]}),x0=({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:w})=>{const{containerClass:N}=ue(),C=`gap-${Math.round(b/4)}`||"gap-8",E=V=>V?V.split("-")[0].trim():"Back",I=a?E(a):e?E(e):"Back",[x,A]=p.useState(!1),[L,O]=p.useState("auto"),M=p.useRef(null),U=p.useRef(null);p.useEffect(()=>(w&&(w.current={triggerTransition:V=>{if(!k){V();return}if(M.current){const R=M.current.scrollHeight;O(R)}A(!0),U.current&&clearTimeout(U.current),U.current=setTimeout(()=>{V(),setTimeout(()=>{if(M.current){const R=M.current.scrollHeight;O(R),setTimeout(()=>{O("auto"),A(!1)},S)}},50)},S/2)}}),()=>{U.current&&clearTimeout(U.current)}),[k,S,w]);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?`${x?"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:["← ",I]}),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 ${C}`,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]})})})]})]})]})},N0=({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(ia,{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]})})},C0=({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})}),Vr=p.createContext(null),ga=({children:e,variant:r="default",sticky:a=!0})=>{const[n,o]=p.useState(!1),s=p.useCallback(()=>{o(l=>!l)},[]);return t.jsx(Vr.Provider,{value:{variant:r,sticky:a,mobileMenuOpen:n,setMobileMenuOpen:o,toggleMobileMenu:s},children:e})},$r=()=>{const e=p.useContext(Vr);if(!e)throw new Error("useTopbar must be used within a TopbarProvider");return e},ua={sm:"min-h-12",md:"min-h-14",lg:"min-h-16"},S0={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"},E0={default:"z-40",high:"z-50",highest:"z-[60]"},A0=({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(ga,{variant:r,sticky:a,children:t.jsxs("header",{role:"banner","aria-label":c,className:f("w-full",ua[o],S0[r],E0[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,ua[o],"flex flex-wrap items-center justify-between"),children:e})]})})},T0=({children:e,className:r})=>t.jsx("div",{className:f("flex items-center gap-2 shrink-0",r),children:e}),I0=({children:e,className:r})=>t.jsx("div",{className:f("flex-1 flex items-center justify-center px-4",r),children:e}),L0=({children:e,className:r})=>t.jsx("div",{className:f("flex items-center gap-2 shrink-0",r),children:e}),M0=({children:e,className:r})=>t.jsx("div",{className:f("md:hidden w-full basis-full pt-2 pb-3",r),children:e}),P0=({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"}),O0={sm:"h-6",md:"h-8",lg:"h-10"},U0=({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(O0[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})},D0={sm:"sm:hidden",md:"md:hidden",lg:"lg:hidden",xl:"xl:hidden"},z0=({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"})}),ha=({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}=$r(),[h,u]=p.useState(!1),y=p.useRef(null);ar(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",D0[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(z0,{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,w=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:w})},k.id):k.href?t.jsx("a",{href:k.href,role:"menuitem",className:N,onClick:v,children:w},k.id):t.jsx("button",{type:"button",role:"menuitem",className:N,onClick:()=>{v(),k.onClick?.()},disabled:k.disabled,children:w},k.id)})})]})},j0={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"}},_0={left:"justify-start",center:"justify-center",right:"justify-end"},fa=({items:e,className:r,collapseBelow:a="lg",LinkComponent:n,align:o="center"})=>{const[s,l]=p.useState(null),c=p.useRef(null);ar(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(Hr,{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(Hr,{item:i,LinkComponent:n,className:m},i.id)};return t.jsx("nav",{className:f("flex items-center gap-1",j0[a].show,_0[o],r),"aria-label":"Main navigation",children:e.map(i=>d(i))})},Hr=({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})},B0=({items:e,isOpen:r,className:a,LinkComponent:n})=>{const{mobileMenuOpen:o,setMobileMenuOpen:s}=$r();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(Hr,{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},F0=({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(ha,{hideAbove:a,menuItems:e,LinkComponent:r,"aria-label":s,className:o}),l,t.jsx(fa,{items:e,collapseBelow:a,LinkComponent:r,align:n,className:o})]}),W0={sm:"gap-1",md:"gap-2",lg:"gap-3"},V0={left:"justify-start",center:"justify-center",right:"justify-end"},$0=({children:e,className:r,gap:a="md",align:n="right"})=>t.jsx("div",{className:f("flex items-center",W0[a],V0[n],r),children:e}),H0={sm:"h-4 w-4",md:"h-5 w-5",lg:"h-6 w-6"},q0={sm:"p-1.5",md:"p-2",lg:"p-2.5"},G0=({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",q0[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:H0[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})]}),Y0={sm:"w-48",md:"w-64",lg:"w-96",full:"w-full"},K0=({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(Y0[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")})]})})},X0=({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 w=S.target;w.dataset.src&&(w.src=w.dataset.src,w.removeAttribute("data-src")),b.unobserve(w)}})},{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 w=document.createElement("meta");w.name=k,w.content=S,document.head.appendChild(w)}});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})),Z0=()=>(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),J0=({children:e})=>t.jsx(t.Fragment,{children:e}),ba={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 Te=new Q0,we=new Map,ma=async(e,r,a="messages")=>{const n=ba[a],o=Te.get(e,n);if(o&&!o.isStale)return o.data;const s=we.get(e);if(s)return s;if(o&&o.isStale&&n.staleWhileRevalidate){const c=r().then(d=>(Te.set(e,d,n),we.delete(e),d)).catch(d=>{throw we.delete(e),d});return we.set(e,c),o.data}const l=r().then(c=>(Te.set(e,c,n),we.delete(e),c)).catch(c=>{throw we.delete(e),c});return we.set(e,l),l};class R0{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 eg=new R0;class rg{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)?eg.add(l,c):ma(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 tg=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 ag{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 ng={invalidate:e=>Te.invalidate(e),clear:()=>Te.clear(),getStats:()=>Te.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 ya(){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 pa(){return typeof window>"u"?!1:window.location.hostname==="localhost"||window.location.hostname==="127.0.0.1"}function va(){if(typeof window>"u")return!1;const e=window.location.hostname;return/^\d+\.\d+\.\d+\.\d+$/.test(e)}function ka(){return pa()?"localhost":ya()?"wallet-browser":va()?"network":"production"}function og(){const e=ka();return e==="localhost"||e==="wallet-browser"}function sg(e){}function wa(){return typeof window<"u"}function lg(){return typeof window<"u"}function ig(e,r){if(wa())e();else return r}const qr=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'"]}),cg=qr(),xa=e=>{const r=qr(e);return Object.entries(r).map(([a,n])=>`${a} ${n.join(" ")}`).join("; ")},Na=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":xa(e)}),dg=Na(),gg={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"},ug=()=>{typeof window<"u"&&document.addEventListener("securitypolicyviolation",()=>{})},hg={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,Ve=new Map,dr=new Set;let $e="medium",Gr=!1;function fg(){if("connection"in navigator){const a=navigator.connection;a&&($e=a.effectiveType==="4g"?"fast":a.effectiveType==="3g"?"medium":"slow")}const e=navigator.deviceMemory,r=navigator.hardwareConcurrency;Gr=e&&e<4||r&&r<4}fg();function bg(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(Ve.has(r))return Ve.get(r).then(v=>({default:v}));const b=mg(e,n,o);Ve.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 Ve.delete(r),i?.(v.default),v}catch(v){throw Ve.delete(r),h?.(v),v}}),y=m=>{const[b,v]=p.useState(!0);p.useEffect(()=>{if(l&&!ce.has(r)&&l()&&!dr.has(r)){dr.add(r);const w=yg(d,$e);setTimeout(()=>{e().catch(()=>{})},w)}},[]);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&&Gr&&$e==="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 mg(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 yg(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 Xe=class Xe{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)},$e==="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)}}};Xe.routeMap=new Map,Xe.routeUsageStats=new Map,Xe.currentRoute="";let Yr=Xe;const pg=({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 vg(){ce.clear(),dr.clear()}function kg(){return{cachedComponents:ce.size,preloadQueue:dr.size,networkSpeed:$e,isLowEndDevice:Gr,cacheEntries:Array.from(ce.entries()).map(([e,r])=>({name:e,loadTime:r.loadTime,age:Date.now()-r.timestamp}))}}const wg=({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})]}),xg=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(wg,{message:"Loading component..."})}},Ca=(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=xg(r);return s=>t.jsx(p.Suspense,{fallback:t.jsx(o,{}),children:t.jsx(n,{...s})})},Ng=async e=>{try{await e()}catch{}},Cg=e=>{const r={};return Object.entries(e).forEach(([a,n])=>{r[a]=Ca(n,"skeleton")}),r},Sg=e=>e,Sa={critical:["/","/connect","/mail"],secondary:["/settings","/compose","/points"],optional:["/document","/about","/terms","/privacy"]},Ze=class Ze{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}};Ze.preloadedComponents=new Set,Ze.preloadQueue=[],Ze.isPreloading=!1;let Kr=Ze;const Eg=()=>{"requestIdleCallback"in window&&window.requestIdleCallback(()=>{Sa.secondary.forEach(e=>{})})},Ea=({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})]}),He=new Map;function Ag(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=He.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 Lg(e,o,s);He.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(Ea,{message:"Loading component..."}),children:t.jsx(y,{...i})}):null:n||t.jsx(Ea,{message:"Checking conditions..."})};return d.displayName=`ConditionalLazy(${c})`,d}const Tg={},Ig={};async function Lg(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 Mg(){He.clear()}function Pg(){return{cachedComponents:He.size,cacheEntries:Array.from(He.entries()).map(([e,r])=>({key:e,lastCheck:r.lastCheck,isValid:r.isValid,age:Date.now()-r.lastCheck}))}}const Aa=[{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 Og{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(){Aa.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"&&Aa.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 qe=null;function Ug(){qe||(qe=new Og,document.readyState==="loading"?document.addEventListener("DOMContentLoaded",()=>{qe?.initializePreloading()}):qe.initializePreloading())}function Dg(){return qe?.getPreloadingStats()}function zg(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 Ta(e){const r={"@context":"https://schema.org","@type":Bg(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 jg(e,r){return r.map(a=>({type:"related-content",target:a.url,strength:a.relevance}))}function Ia(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 La(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 _g(e,r){return{contentClassification:{type:e.contentType,topic:e.primaryTopic,audience:e.targetAudience.join(","),complexity:e.complexityLevel,purpose:e.contentPurpose,vertical:e.industryVertical},semanticMarkup:Ta(e),entityRecognition:Ia(e),topicClustering:La(e),contentRelationships:r?.contentRelationships||[],...r}}function Bg(e){return{article:"Article","landing-page":"WebPage","product-page":"Product","governance-page":"SoftwareApplication",documentation:"TechArticle"}[e]||"WebPage"}function Fg(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 Wg={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"]}},Vg=({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})]}),Xr=new Map,Ge=new Set;function Zr(){const e=[];return!!window.ethereum?.isMetaMask&&(Ge.add("metamask"),e.push({name:"MetaMask",detected:!0,priority:1})),!!window.ethereum?.isCoinbaseWallet&&(Ge.add("coinbase"),e.push({name:"Coinbase Wallet",detected:!0,priority:2})),!!window.solana?.isPhantom&&(Ge.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 Jr(e){const r=`wallet-${e.toLowerCase()}`;if(Xr.has(r))return Xr.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(Vg,{message:`Loading ${e} wallet...`,className:"wallet-loading"}),children:t.jsx(n,{...s})});return o.displayName=`Lazy${e}Provider`,Xr.set(r,o),o}function $g({children:e}){const r=Zr();return r.filter(a=>a.priority<=2&&a.detected).forEach(a=>{setTimeout(()=>{},1e3)}),t.jsxs(t.Fragment,{children:[r.map(a=>{const n=Jr(a.name);return t.jsx(n,{},a.name)}),e]})}const rt=class rt{static preloadWallet(r){const a=r.toLowerCase();this.preloadedWallets.has(a)||(this.preloadedWallets.add(a),setTimeout(()=>{Jr(r)},500))}static preloadCommonWallets(){["metamask","walletconnect","coinbase"].forEach((a,n)=>{setTimeout(()=>{this.preloadWallet(a)},n*1e3)})}static getPreloadedWallets(){return Array.from(this.preloadedWallets)}};rt.preloadedWallets=new Set;let Ye=rt;function Hg(){return{availableWallets:Zr(),preloadWallet:n=>{Ye.preloadWallet(n)},getDetectedWallets:()=>Array.from(Ge),hasWallet:n=>Ge.has(n.toLowerCase())}}function qg({walletName:e,onConnect:r,disabled:a=!1}){const n=()=>{Ye.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 Gg{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 gr={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?.()))}},Yg=(e,r=[])=>{p.useEffect(()=>(gr.mark(`${e}-start`),()=>{gr.mark(`${e}-end`),gr.measure(e,`${e}-start`,`${e}-end`)}),[e,r])},Kg=e=>{const r=p.useRef(e);return r.current=e,p.useCallback((...a)=>r.current(...a),[])},Xg=(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])},ur=new Map,Zg=e=>{const r=ur.get(e)||0;ur.set(e,r+1),p.useEffect(()=>{process.env.NODE_ENV})},Jg=()=>Object.fromEntries(ur),Qg=()=>ur.clear(),Rg=e=>p.lazy(e),eu=(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}},ru=e=>{typeof window<"u"&&"requestIdleCallback"in window?window.requestIdleCallback(()=>{e().catch(()=>{})}):setTimeout(()=>{e().catch(()=>{})},100)},Ma={},tu=e=>{Ma[e.name]=e.value,process.env.NODE_ENV},au=()=>Ma,nu=(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)}},ou=(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)}},su=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 lu{constructor(r){this.metrics={timestamp:Date.now()},this.observers=[],this.performanceMarks=new Map,this.reportCallback=r,this.initializeWebVitals(),this.initializeCustomObservers(),this.collectDeviceInfo()}initializeWebVitals(){Ue.onCLS(r=>{this.metrics.CLS=r.value,this.reportMetric("CLS",r.value)}),Ue.onINP(r=>{this.metrics.INP=r.value,this.reportMetric("INP",r.value)}),Ue.onFCP(r=>{this.metrics.FCP=r.value,this.reportMetric("FCP",r.value)}),Ue.onLCP(r=>{this.metrics.LCP=r.value,this.reportMetric("LCP",r.value)}),Ue.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 hr=null;const iu=e=>(hr||(hr=new lu(e)),hr),fr=()=>hr,Pa=e=>{const r=p.useRef(performance.now());p.useEffect(()=>{const a=performance.now()-r.current,n=fr();n&&n.measureComponentRender(e,a)},[e])},cu=(e,r)=>p.forwardRef((a,n)=>(Pa(r),p.createElement(e,{...a,ref:n}))),du=async(e,r)=>{const a=performance.now(),n=await e(),o=performance.now()-a,s=fr();return s&&s.measureAPICall(r,o),n},Oa={LCP:2500,INP:200,CLS:.1,FCP:1800,TTFB:800,bundleSize:17e4},gu=(e,r=Oa)=>{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}},uu=e=>{const r=e||fr()?.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)},hu={CLS:[.1,.25],FCP:[1800,3e3],FID:[100,300],LCP:[2500,4e3],TTFB:[800,1800],INP:[200,500]};function Ie(e,r){const[a,n]=hu[e];return r<=a?"good":r<=n?"needs-improvement":"poor"}function Ke(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 Ua(e){let r=0;Ke("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:Ie("CLS",r)})})}function Da(e){Ke("paint",r=>{for(const a of r)a.name==="first-contentful-paint"&&e({name:"FCP",value:a.startTime,rating:Ie("FCP",a.startTime)})})}function za(e){let r=0;Ke("largest-contentful-paint",n=>{const o=n[n.length-1];o&&(r=o.startTime)});const a=()=>{r>0&&e({name:"LCP",value:r,rating:Ie("LCP",r)})};document.addEventListener("visibilitychange",()=>{document.visibilityState==="hidden"&&a()}),["keydown","click"].forEach(n=>{document.addEventListener(n,a,{once:!0,capture:!0})})}function ja(e){Ke("first-input",r=>{const a=r[0];if(a){const n=a.processingStart-a.startTime;e({name:"FID",value:n,rating:Ie("FID",n)})}})}function _a(e){const r=performance.getEntriesByType("navigation")[0];if(r){const a=r.responseStart-r.requestStart;e({name:"TTFB",value:a,rating:Ie("TTFB",a)})}}function Ba(e){const r=[];Ke("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:Ie("INP",n)})}})}function fu(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`)}});Ua(r),Da(r),za(r),ja(r),_a(r),Ba(r)}function Fa(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 bu(e,r,a){typeof window<"u"&&window.__DEV__&&console.log(`[CustomMetric] ${e}: ${r}`,a||"")}function mu(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 yu=({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"})}),pu=({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"})}),Wa=({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(yu,{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(pu,{})})]})]}),vu={sm:"w-2 h-2",md:"w-3 h-3",lg:"w-4 h-4"},ku={good:"bg-green-500","needs-improvement":"bg-yellow-500",poor:"bg-red-500",unknown:"bg-gray-400",neutral:"bg-gray-500"},wu={good:"Good","needs-improvement":"Needs Improvement",poor:"Poor",unknown:"Unknown",neutral:"Neutral"},xu=({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",vu[r],ku[e])}),a&&t.jsx("span",{className:"text-xs text-gray-400",children:wu[e]})]}),Va=({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"]})]}),Nu={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",Nu[n]),children:[l,a]})]})},Cu=(e,r="ms",a=0)=>e===void 0?"N/A":`${e.toFixed(a)}${r}`,$a=(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"},Ha=({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"})]})]})},qa=(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}},Ga=e=>e===void 0?"N/A":e<1024?`${e}B`:e<1024*1024?`${(e/1024).toFixed(1)}KB`:`${(e/(1024*1024)).toFixed(1)}MB`,Ya=({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:Ga(e.totalTransferSize),rating:"neutral"})]})]})},Su=e=>e===void 0?"unknown":e<=200?"good":e<=500?"needs-improvement":"poor",Ka=({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:Su(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"})]})]})},Xa=e=>e===void 0?"N/A":(e/(1024*1024)).toFixed(1),Za=(e,r)=>{if(e===void 0||r===void 0)return"unknown";const a=e/r;return a<=.5?"good":a<=.75?"needs-improvement":"poor"},Ja=({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:Xa(a.usedJSHeapSize),unit:"MB",rating:Za(a.usedJSHeapSize,a.jsHeapSizeLimit)}),t.jsx(H,{label:"Total Heap",value:Xa(a.totalJSHeapSize),unit:"MB",rating:"neutral"}),t.jsx(H,{label:"Usage",value:l,unit:"%",rating:Za(a.usedJSHeapSize,a.jsHeapSizeLimit)})]})]})},Eu=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"},Qa=({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:Eu(o),description:o.description},o.id))})]}),Au=["/api/","graphql",".json"],Ra=(e={})=>{const{enabled:r=!0,patterns:a=Au,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(w=>y.some(N=>w.name.includes(N)));if(m.length===0)return;const b=m.reduce((w,N)=>w+N.duration,0),v=Math.max(...m.map(w=>w.duration)),k=m.filter(w=>{const N=w.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}},en=(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 w=S.clientX-u.x,N=S.clientY-u.y;if(a){const C=window.innerWidth-l.current.offsetWidth,E=window.innerHeight-l.current.offsetHeight;w=Math.max(0,Math.min(w,C)),N=Math.max(0,Math.min(N,E))}d({x:n?w:o?c.x:w,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}},rn={"bottom-right":"bottom-4 right-4","bottom-left":"bottom-4 left-4","top-right":"top-4 right-4","top-left":"top-4 left-4"},Tu=["webVitals","bundle","api","memory"],Iu=({enabled:e,defaultCollapsed:r=!0,defaultVisible:a=!0,position:n="bottom-right",draggable:o=!0,sections:s=Tu,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:w}=$a({enabled:u&&s.includes("webVitals")}),{metrics:N}=qa({enabled:u&&s.includes("bundle")}),{metrics:C}=Ra({enabled:u&&s.includes("api"),patterns:k});p.useEffect(()=>{S.current&&S.current({webVitals:w,bundle:N,api:C})},[w,N,C]);const{position:E,isDragging:I,handleMouseDown:x,ref:A}=en({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]",rn[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 U=E.x!==null?{left:`${E.x}px`,bottom:n.includes("bottom")?"1rem":void 0,top:n.includes("top")?"1rem":void 0,position:"fixed",transition:I?"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:A,className:f(E.x!==null?"":`fixed ${rn[n]}`,"z-[9999] font-mono text-xs",I&&"cursor-grabbing",h),style:{maxWidth:"320px",...U},children:[t.jsx(Wa,{isCollapsed:y,onToggleCollapse:L,onClose:O,onMouseDown:o?x:void 0,isDragging:I}),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(Ha,{metrics:w}),s.includes("bundle")&&t.jsx("div",{className:"pt-3 border-t border-gray-700",children:t.jsx(Ya,{metrics:N})}),s.includes("api")&&C.callCount>0&&t.jsx("div",{className:"pt-3 border-t border-gray-700",children:t.jsx(Ka,{metrics:C})}),s.includes("memory")&&t.jsx("div",{className:"pt-3 border-t border-gray-700",children:t.jsx(Ja,{})}),B&&l.length>0&&t.jsx("div",{className:"pt-3 border-t border-gray-700",children:t.jsx(Qa,{title:c,metrics:l})}),t.jsx("div",{className:"pt-3 border-t border-gray-700",children:t.jsx(Va,{})})]})})]})},Lu=(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 w=S instanceof Error?S.message:"An error occurred";throw u(n?`${n}: ${w}`:w),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}},Mu=(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}},Pu=(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}},Ou=(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 Uu(){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&&(Fa(r.current,n,o),r.current=n,a.current=Date.now())},[e])}function Du({fields:e,validateOnChange:r=!1,validateOnBlur:a=!0}){const n=p.useMemo(()=>{const x={};for(const A in e)x[A]=e[A].initialValue;return x},[e]),[o,s]=p.useState(n),[l,c]=p.useState({}),[d,i]=p.useState({}),[h,u]=p.useState({}),y=p.useCallback(x=>{const A=e[x],L=o[x];if(A.required&&(L===""||L===null||L===void 0||Array.isArray(L)&&L.length===0))return A.requiredMessage||"This field is required";if(A.validate)for(const O of A.validate){const M=O(L);if(M)return M}},[e,o]),m=p.useCallback((x,A)=>{if(s(L=>({...L,[x]:A})),u(L=>({...L,[x]:!0})),r&&d[x]){const L=y(x);c(O=>({...O,[x]:L}))}},[r,d,y]),b=p.useCallback(x=>{s(L=>({...L,...x}));const A={};for(const L in x)A[L]=!0;u(L=>({...L,...A}))},[]),v=p.useCallback(x=>{if(i(A=>({...A,[x]:!0})),a){const A=y(x);c(L=>({...L,[x]:A}))}},[a,y]),k=p.useCallback(()=>{const x={},A={};let L=!0;for(const O in e){A[O]=!0;const M=y(O);M&&(x[O]=M,L=!1)}return i(A),c(x),L},[e,y]),S=p.useCallback(()=>{s(n),c({}),i({}),u({})},[n]),w=p.useCallback(x=>{s(A=>({...A,[x]:e[x].initialValue})),c(A=>{const L={...A};return delete L[x],L}),i(A=>{const L={...A};return delete L[x],L}),u(A=>{const L={...A};return delete L[x],L})},[e]),N=p.useCallback(x=>({value:o[x],onChange:A=>{m(x,A.target.value)},onBlur:()=>v(x),name:String(x),"aria-invalid":!!(d[x]&&l[x])}),[o,m,v,d,l]),C=p.useCallback(x=>d[x]?l[x]:void 0,[d,l]),E=p.useMemo(()=>{for(const x in e)if(y(x))return!1;return!0},[e,y]),I=p.useMemo(()=>Object.values(h).some(Boolean),[h]);return{values:o,errors:l,touched:d,dirty:h,isValid:E,isDirty:I,setValue:m,setValues:b,setTouched:v,validateField:y,validateAll:k,reset:S,resetField:w,getFieldProps:N,getFieldError:C}}const zu=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]},ju=(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},_u=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},Bu=e=>e,Fu=e=>{if(typeof document>"u")return;const r=document.createElement("style");r.textContent=e,r.setAttribute("data-critical","true"),document.head.appendChild(r)},Wu=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)},Vu=e=>{const r={};return Object.entries(e).forEach(([a,n])=>{r[`--${a}`]=typeof n=="number"?`${n}px`:n}),r},$u={xs:475,sm:640,md:768,lg:1024,xl:1280,"2xl":1536},Hu=(e,r=$u)=>{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||{}},tn=()=>typeof window>"u"?!1:window.matchMedia("(prefers-reduced-motion: reduce)").matches,qu=()=>{const[e,r]=p.useState(tn);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},Gu=(e,r=["layout","paint"])=>{e&&(e.style.contain=r.join(" "))},Yu=(e,r)=>e?(e.style.willChange=r.join(", "),()=>{e.style.willChange="auto"}):void 0,Ku=e=>{typeof window>"u"||requestAnimationFrame(()=>{e.forEach(r=>r())})},Xu=(...e)=>e.filter(Boolean).join(" "),Zu=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},Ju=(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"}),Ru=(e="row",r="center",a="flex-start")=>({display:"flex",flexDirection:e,alignItems:r,justifyContent:a,contain:"layout"}),eh=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},rh=(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},th=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},ah=(e,r=[320,640,768,1024,1280,1920])=>r.map(a=>`${e.replace(/\{width\}/g,a.toString())} ${a}w`).join(", "),nh=e=>e.map(r=>r.maxWidth?`(max-width: ${r.maxWidth}px) ${r.size}`:r.size).join(", "),oh=(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},sh=(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))}},an=()=>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"}),nn=()=>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="}),lh=async(e="jpg")=>{const[r,a]=await Promise.all([an(),nn()]);return a?"avif":r?"webp":e},ih=(e,r,a,n)=>`
63
+ ${s?"bg-gray-200 text-gray-500 cursor-not-allowed":o?"bg-blue-600 text-white hover:bg-blue-700":"bg-gray-200 text-gray-700 hover:bg-gray-300"}
64
+ `,children:s?"Verified":o?"Current Plan":"Select Plan"})]})},pc=({children:t,backgroundClassName:r="",contentClassName:a=""})=>e.jsx("div",{className:r,children:e.jsx("div",{className:a,children:t})}),yc=({title:t,description:r})=>e.jsxs("div",{className:"mb-8",children:[e.jsx("h1",{className:"text-3xl font-bold text-gray-900 dark:text-white",children:t}),r&&e.jsx("p",{className:"mt-2 text-gray-600 dark:text-gray-400",children:r})]}),vc=({children:t,mode:r,className:a,as:o="div",withPadding:s=!0})=>{const n=R(),l=r?xc(r,s):s?n.containerClass:n.maxWidthClass;return e.jsx(o,{className:u(l,a),children:t})};function xc(t,r){const a={standard:"max-w-7xl mx-auto",wide:"max-w-[1920px] mx-auto",full:"w-full"};return r?`${a[t]} px-4`:a[t]}const kc=({variant:t="full",sticky:r=!1,className:a,children:o})=>{const{containerClass:s}=R(),n=t==="compact";return e.jsx("footer",{className:u("bg-gray-900 text-white transition-all duration-300 ease-in-out",n?"py-4":"py-12",r?"sticky bottom-0 z-50 border-t border-gray-700":"relative z-10","pointer-events-auto",a),children:e.jsx("div",{className:s,children:o})})},wc=({children:t,className:r})=>e.jsx("div",{className:u("grid md:grid-cols-5 gap-8",r),children:t}),Cc=({children:t,description:r,className:a})=>e.jsxs("div",{className:a,children:[e.jsx("div",{className:"mb-4",children:t}),r&&e.jsx("p",{className:T.textVariants.body.sm(),children:r})]}),Nc=({title:t,children:r,className:a})=>e.jsxs("div",{className:a,children:[e.jsx("h3",{className:u(T.textVariants.heading.h5(),"mb-4 text-white"),children:t}),e.jsx("ul",{className:u("space-y-2",T.textVariants.body.sm()),children:r})]}),Sc=({children:t,className:r})=>e.jsx("li",{className:u("hover:text-white transition-colors",r),children:t}),Lc=({children:t,className:r})=>e.jsx("div",{className:u("border-t mt-8 pt-8 text-center space-y-4",T.ui.border.default,r),children:t}),Ec=({children:t,className:r})=>b.Children.toArray(t).filter(Boolean).length===0?null:e.jsx("div",{className:u("flex items-center justify-center gap-3 text-gray-400 text-sm",r),children:t}),Mc=({children:t,className:r})=>e.jsx("div",{className:u("flex flex-col sm:flex-row justify-between items-center space-y-2 sm:space-y-0",r),children:t}),Ic=({children:t,className:r})=>e.jsx("div",{className:u("flex items-center gap-3 text-gray-400 text-sm",r),children:t}),Tc=({children:t,className:r})=>e.jsx("div",{className:u("flex space-x-6 text-sm",r),children:t}),Pc=({version:t,className:r})=>e.jsxs("span",{className:u("text-gray-500",r),children:["v",t]}),zc=({year:t,companyName:r,rightsText:a,companyLink:o,className:s})=>e.jsxs("span",{className:s,children:["© ",t," ",o||e.jsx("span",{className:"text-blue-400",children:r}),a&&`. ${a}`]}),ae=({href:t,label:r,children:a})=>e.jsx(Gr,{content:r,children:e.jsx("a",{href:t,target:"_blank",rel:"noopener noreferrer",className:"text-gray-400 hover:text-white transition-colors","aria-label":r,children:a})}),Uc=({twitterUrl:t,redditUrl:r,discordUrl:a,linkedinUrl:o,farcasterUrl:s,telegramUrl:n,githubUrl:l,className:i})=>t||r||a||o||s||n||l?e.jsxs("div",{className:u("flex items-center gap-4",i),children:[t&&e.jsx(ae,{href:t,label:"Twitter / X",children:e.jsx("svg",{className:"w-5 h-5",fill:"currentColor",viewBox:"0 0 24 24","aria-hidden":"true",children:e.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&&e.jsx(ae,{href:r,label:"Reddit",children:e.jsx("svg",{className:"w-5 h-5",fill:"currentColor",viewBox:"0 0 24 24","aria-hidden":"true",children:e.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&&e.jsx(ae,{href:a,label:"Discord",children:e.jsx("svg",{className:"w-5 h-5",fill:"currentColor",viewBox:"0 0 24 24","aria-hidden":"true",children:e.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"})})}),o&&e.jsx(ae,{href:o,label:"LinkedIn",children:e.jsx("svg",{className:"w-5 h-5",fill:"currentColor",viewBox:"0 0 24 24","aria-hidden":"true",children:e.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"})})}),s&&e.jsx(ae,{href:s,label:"Farcaster",children:e.jsx("svg",{className:"w-5 h-5",fill:"currentColor",viewBox:"0 0 24 24","aria-hidden":"true",children:e.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"})})}),n&&e.jsx(ae,{href:n,label:"Telegram",children:e.jsx("svg",{className:"w-5 h-5",fill:"currentColor",viewBox:"0 0 24 24","aria-hidden":"true",children:e.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&&e.jsx(ae,{href:l,label:"GitHub",children:e.jsx("svg",{className:"w-5 h-5",fill:"currentColor",viewBox:"0 0 24 24","aria-hidden":"true",children:e.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,Ac=({isSelected:t,onClick:r,icon:a,label:o,description:s,className:n=""})=>e.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 ${n}`,children:[t&&e.jsx("div",{className:"absolute inset-1 bg-blue-500/10 dark:bg-blue-400/10 rounded-lg pointer-events-none"}),e.jsxs("div",{className:"relative z-10 flex items-start w-full",children:[a&&e.jsx(a,{className:`h-5 w-5 mt-0.5 mr-3 flex-shrink-0 transition-colors ${t?"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"}`}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("div",{className:`font-medium transition-colors ${t?"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:o}),s&&e.jsx("div",{className:`text-xs mt-0.5 transition-colors ${t?"text-blue-500 dark:text-blue-300":"text-gray-500 dark:text-gray-400"}`,children:s})]})]})]}),$c=({masterTitle:t,masterSubtitle:r,backButtonText:a,masterContent:o,detailContent:s,detailTitle:n,mobileView:l="navigation",onBackToNavigation:i,masterClassName:g="",detailClassName:c="",detailTitleClassName:h="",masterWidth:f=320,stickyMaster:v=!0,stickyTopOffset:p=96,desktopGap:m=32,showMasterBackground:y=!0,enableAnimations:x=!0,animationDuration:N=300,animationRef:k})=>{const{containerClass:S}=R(),w=`gap-${Math.round(m/4)}`||"gap-8",C=j=>j?j.split("-")[0].trim():"Back",E=a?C(a):t?C(t):"Back",[M,L]=b.useState(!1),[I,U]=b.useState("auto"),P=b.useRef(null),A=b.useRef(null);b.useEffect(()=>(k&&(k.current={triggerTransition:j=>{if(!x){j();return}if(P.current){const _=P.current.scrollHeight;U(_)}L(!0),A.current&&clearTimeout(A.current),A.current=setTimeout(()=>{j(),setTimeout(()=>{if(P.current){const _=P.current.scrollHeight;U(_),setTimeout(()=>{U("auto"),L(!1)},N)}},50)},N/2)}}),()=>{A.current&&clearTimeout(A.current)}),[x,N,k]);const D=x?{height:I==="auto"?"auto":`${I}px`,transition:`height ${N}ms cubic-bezier(0.4, 0, 0.2, 1)`,width:"100%",maxWidth:"100%"}:{width:"100%",maxWidth:"100%"},$=x?`${M?"opacity-0 transform translate-y-2":"opacity-100 transform translate-y-0"}`:"",B=x?{transition:`opacity ${N}ms ease-in-out, transform ${N}ms ease-in-out`}:{};return e.jsxs(e.Fragment,{children:[e.jsx("div",{className:`md:hidden ${l==="navigation"?"block":"hidden"} flex-1`,children:e.jsxs("div",{className:y?"bg-white dark:bg-gray-800 p-6":"p-6",children:[t&&e.jsxs("div",{className:S,children:[e.jsx("h2",{className:"text-xl font-semibold text-gray-900 dark:text-white mb-4",children:t}),r&&e.jsx("p",{className:"text-sm text-gray-600 dark:text-gray-400 mb-6 break-all",children:r})]}),e.jsx("div",{className:g,children:o})]})}),e.jsxs("div",{className:`${S} py-8`,children:[e.jsxs("div",{className:`md:hidden ${l==="content"?"block":"hidden"}`,children:[l==="content"&&i&&e.jsxs("button",{onClick:i,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:["← ",E]}),e.jsx("div",{ref:P,className:`bg-white dark:bg-gray-800 rounded-lg border border-gray-200 dark:border-gray-700 p-8 overflow-hidden ${c}`,style:D,children:e.jsxs("div",{className:$,style:B,children:[n&&e.jsx("h1",{className:`text-4xl font-bold text-gray-900 dark:text-white mb-6 ${h}`,children:n}),s]})})]}),e.jsxs("div",{className:`hidden md:flex min-h-full ${w}`,style:{width:"100%"},children:[e.jsx("aside",{className:"flex-shrink-0",style:{width:`${f}px`,minWidth:`${f}px`},children:e.jsxs("div",{className:v?"sticky":"",style:v?{top:`${p}px`}:void 0,children:[t&&e.jsx("h2",{className:"text-lg font-semibold text-gray-900 dark:text-white mb-4",children:t}),r&&e.jsx("p",{className:"text-sm text-gray-600 dark:text-gray-400 mb-6 break-all",children:r}),e.jsx("div",{className:`bg-white dark:bg-gray-800 rounded-lg border border-gray-200 dark:border-gray-700 ${v?"max-h-[calc(100vh-200px)] overflow-y-auto":""} ${g}`,children:o})]})}),e.jsx("div",{className:"flex-1 min-w-0",style:{width:`calc(100% - ${f+m}px)`},children:e.jsx("div",{ref:P,className:`bg-white dark:bg-gray-800 rounded-lg border border-gray-200 dark:border-gray-700 p-8 overflow-hidden ${c}`,style:D,children:e.jsxs("div",{className:$,style:B,children:[n&&e.jsx("h1",{className:`text-4xl font-bold text-gray-900 dark:text-white mb-6 ${h}`,children:n}),s]})})})]})]})]})},Dc=({children:t,topBar:r,footer:a,breadcrumbSection:o,stickyHeader:s=!0,layoutMode:n="standard",className:l,contentClassName:i,headerZIndex:g=40})=>{const c=r||o;return e.jsx(Xr,{mode:n,children:e.jsxs("div",{className:u("min-h-screen bg-gray-50 dark:bg-gray-900 flex flex-col",l),children:[c&&e.jsxs("div",{className:s?"sticky top-0":"",style:s?{zIndex:g}:void 0,children:[r,o]}),e.jsx("div",{className:u("flex-1",i),children:t}),a]})})},Bc=({aspectRatio:t,children:r,className:a,innerClassName:o})=>e.jsx("div",{className:u("h-full w-full",a),children:e.jsx("div",{className:u("mx-auto max-h-full max-w-full overflow-auto",o),style:{aspectRatio:t},children:r})}),dr=b.createContext(null),Rr=({children:t,variant:r="default",sticky:a=!0})=>{const[o,s]=b.useState(!1),n=b.useCallback(()=>{s(l=>!l)},[]);return e.jsx(dr.Provider,{value:{variant:r,sticky:a,mobileMenuOpen:o,setMobileMenuOpen:s,toggleMobileMenu:n},children:t})},gr=()=>{const t=b.useContext(dr);if(!t)throw new Error("useTopbar must be used within a TopbarProvider");return t},et={sm:"min-h-12",md:"min-h-14",lg:"min-h-16"},jc={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"},Fc={default:"z-40",high:"z-50",highest:"z-[60]"},Oc=({children:t,variant:r="default",sticky:a=!0,className:o,height:s="md",blur:n=!1,zIndex:l="high","aria-label":i="Main navigation"})=>{const{containerClass:g}=R();return e.jsx(Rr,{variant:r,sticky:a,children:e.jsxs("header",{role:"banner","aria-label":i,className:u("w-full",et[s],jc[r],Fc[l],a&&"sticky top-0",n&&"backdrop-blur-md","transition-colors duration-200",o),children:[e.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"}),e.jsx("div",{className:u(g,et[s],"flex flex-wrap items-center justify-between"),children:t})]})})},Vc=({children:t,className:r})=>e.jsx("div",{className:u("flex items-center gap-2 shrink-0",r),children:t}),Wc=({children:t,className:r})=>e.jsx("div",{className:u("flex-1 flex items-center justify-center px-4",r),children:t}),Hc=({children:t,className:r})=>e.jsx("div",{className:u("flex items-center gap-2 shrink-0",r),children:t}),_c=({children:t,className:r})=>e.jsx("div",{className:u("md:hidden w-full basis-full pt-2 pb-3",r),children:t}),qc=({className:t})=>e.jsx("div",{className:u("hidden md:block h-6 w-px bg-gray-200 dark:bg-gray-700 mx-2",t),role:"separator","aria-orientation":"vertical"}),Gc={sm:"h-6",md:"h-8",lg:"h-10"},Kc=({children:t,src:r,alt:a="Logo",onClick:o,href:s,className:n,size:l="md"})=>{const i=t||r&&e.jsx("img",{src:r,alt:a,className:u(Gc[l],"w-auto object-contain")}),g=u("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",n);return s?e.jsx("a",{href:s,className:g,title:a,children:i}):o?e.jsx("button",{type:"button",onClick:o,className:g,title:a,"aria-label":`Go to ${a||"home"}`,children:i}):e.jsx("div",{className:g,children:i})},Yc={sm:"sm:hidden",md:"md:hidden",lg:"lg:hidden",xl:"xl:hidden"},Qc=({className:t,isOpen:r})=>e.jsx("svg",{className:t,fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,"aria-hidden":"true",children:r?e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 18L18 6M6 6l12 12"}):e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M4 6h16M4 12h16M4 18h16"})}),rt=({icon:t,"aria-label":r="Toggle navigation menu",className:a,onClick:o,hideAbove:s="lg",menuItems:n,LinkComponent:l})=>{const{mobileMenuOpen:i,toggleMobileMenu:g,setMobileMenuOpen:c}=gr(),[h,f]=b.useState(!1),v=b.useRef(null);Te(v,()=>{f(!1)});const p=n?h:i,m=()=>{o?o():n?f(!h):g()},y=()=>{f(!1),c(!1)};return e.jsxs("div",{className:u("relative",Yc[s]),ref:v,children:[e.jsx("button",{type:"button",onClick:m,className:u("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":p,"aria-haspopup":n?"menu":void 0,"aria-controls":n?"topbar-dropdown-menu":"mobile-menu",children:t?e.jsx(t,{className:"h-6 w-6"}):e.jsx(Qc,{className:"h-6 w-6",isOpen:p})}),n&&h&&e.jsx("div",{id:"topbar-dropdown-menu",role:"menu",className:u("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:n.map(x=>{const N=x.icon,k=e.jsxs(e.Fragment,{children:[N&&e.jsx(N,{className:"h-5 w-5 mr-3 flex-shrink-0"}),e.jsx("span",{children:x.label})]}),S=u("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",x.active&&"bg-blue-50 dark:bg-blue-900/20 text-blue-600 dark:text-blue-400",x.disabled&&"opacity-50 cursor-not-allowed");return x.href&&l?e.jsx(l,{href:x.href,className:S,children:e.jsx("div",{className:"flex items-center",onClick:y,children:k})},x.id):x.href?e.jsx("a",{href:x.href,role:"menuitem",className:S,onClick:y,children:k},x.id):e.jsx("button",{type:"button",role:"menuitem",className:S,onClick:()=>{y(),x.onClick?.()},disabled:x.disabled,children:k},x.id)})})]})},Xc={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"}},Jc={left:"justify-start",center:"justify-center",right:"justify-end"},tt=({items:t,className:r,collapseBelow:a="lg",LinkComponent:o,align:s="center"})=>{const[n,l]=b.useState(null),i=b.useRef(null);Te(i,()=>l(null));const g=(c,h=!1)=>{const f=c.children&&c.children.length>0,v=n===c.id,p=u("px-3 py-2 rounded-md text-sm 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.disabled&&"opacity-50 cursor-not-allowed pointer-events-none",h&&"w-full text-left",c.className);return f?e.jsxs("div",{className:"relative",ref:i,children:[e.jsxs("button",{type:"button",onClick:()=>l(v?null:c.id),className:u(p,"flex items-center gap-1"),"aria-expanded":v,"aria-haspopup":"true",disabled:c.disabled,children:[c.icon&&e.jsx(c.icon,{className:"h-4 w-4 mr-1"}),c.label,e.jsx("svg",{className:u("h-4 w-4 transition-transform duration-200",v&&"rotate-180"),fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 9l-7 7-7-7"})})]}),v&&e.jsx("div",{className:u("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:c.children?.map(m=>e.jsx(ur,{item:m,LinkComponent:o,className:u("block px-4 py-2 text-sm","text-gray-700 dark:text-gray-300","hover:bg-gray-100 dark:hover:bg-gray-700",m.active&&"bg-blue-50 dark:bg-blue-900/20 text-blue-600 dark:text-blue-400"),onClick:()=>l(null)},m.id))})]},c.id):e.jsx(ur,{item:c,LinkComponent:o,className:p},c.id)};return e.jsx("nav",{className:u("flex items-center gap-1",Xc[a].show,Jc[s],r),"aria-label":"Main navigation",children:t.map(c=>g(c))})},ur=({item:t,LinkComponent:r,className:a,onClick:o})=>{const s=()=>{o?.(),t.onClick?.()},n=e.jsxs(e.Fragment,{children:[t.icon&&e.jsx(t.icon,{className:"h-4 w-4 mr-2"}),t.label]});return t.href&&r?e.jsx(r,{href:t.href,className:u(a,"flex items-center"),children:n}):t.href?e.jsx("a",{href:t.href,className:u(a,"flex items-center"),onClick:s,children:n}):e.jsx("button",{type:"button",onClick:s,className:u(a,"flex items-center"),disabled:t.disabled,children:n})},Zc=({items:t,isOpen:r,className:a,LinkComponent:o})=>{const{mobileMenuOpen:s,setMobileMenuOpen:n}=gr();return r??s?e.jsx("div",{id:"mobile-menu",className:u("lg:hidden","border-t border-gray-200 dark:border-gray-700","bg-white dark:bg-gray-900","shadow-lg",a),children:e.jsx("nav",{className:"px-4 py-2 space-y-1","aria-label":"Mobile navigation",children:t.map(i=>e.jsx(ur,{item:i,LinkComponent:o,className:u("flex items-center w-full px-3 py-2 rounded-md text-base 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.className),onClick:()=>n(!1)},i.id))})}):null},Rc=({items:t,LinkComponent:r,collapseBelow:a="lg",align:o="center",className:s,mobileMenuLabel:n="Toggle navigation menu",children:l})=>e.jsxs(e.Fragment,{children:[e.jsx(rt,{hideAbove:a,menuItems:t,LinkComponent:r,"aria-label":n,className:s}),l,e.jsx(tt,{items:t,collapseBelow:a,LinkComponent:r,align:o,className:s})]}),ed={sm:"gap-1",md:"gap-2",lg:"gap-3"},rd={left:"justify-start",center:"justify-center",right:"justify-end"},td=({children:t,className:r,gap:a="md",align:o="right"})=>e.jsx("div",{className:u("flex items-center",ed[a],rd[o],r),children:t}),ad={sm:"h-4 w-4",md:"h-5 w-5",lg:"h-6 w-6"},od={sm:"p-1.5",md:"p-2",lg:"p-2.5"},sd=({icon:t,onClick:r,"aria-label":a,className:o,disabled:s=!1,badge:n,size:l="md"})=>e.jsxs("button",{type:"button",onClick:r,className:u("relative rounded-lg",od[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",s&&"opacity-50 cursor-not-allowed",o),"aria-label":a,disabled:s,children:[e.jsx(t,{className:ad[l]}),n!==void 0&&n>0&&e.jsx("span",{className:u("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":`${n} notifications`,children:n>99?"99+":n})]}),nd={sm:"w-48",md:"w-64",lg:"w-96",full:"w-full"},ld=({placeholder:t="Search...",value:r,onChange:a,onSubmit:o,className:s,width:n="md",showOnMobile:l=!1})=>{const[i,g]=b.useState(r||""),c=f=>{const v=f.target.value;g(v),a?.(v)},h=f=>{f.preventDefault(),o?.(i)};return e.jsx("form",{onSubmit:h,className:u(!l&&"hidden md:block",s),role:"search",children:e.jsxs("div",{className:"relative",children:[e.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:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z"})}),e.jsx("input",{type:"search",value:i,onChange:c,placeholder:t,"aria-label":t,className:u(nd[n],"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")})]})})},id=({children:t,appName:r,appUrl:a,apiUrl:o})=>(b.useEffect(()=>{const s=()=>{[].forEach(m=>{const y=document.createElement("link");y.rel="preload",y.href=m.href,y.as=m.as,m.type&&(y.type=m.type),m.crossorigin&&(y.crossOrigin=""),document.head.appendChild(y)})},n=()=>{document.querySelectorAll('img[data-priority="high"]').forEach(y=>{y.fetchPriority="high"});const m=document.querySelector("[data-hero]");if(m){const y=m.getAttribute("data-bg-image");if(y){const x=document.createElement("link");x.rel="preload",x.href=y,x.as="image",document.head.appendChild(x)}}},l=()=>{document.querySelectorAll("img:not([width]):not([height])").forEach(y=>{const x=y;x.naturalWidth&&x.naturalHeight&&(x.width=x.naturalWidth,x.height=x.naturalHeight)}),document.querySelectorAll("[data-dynamic]").forEach(y=>{y.getAttribute("style")?.includes("min-height")||(y.style.minHeight="200px")})},i=()=>{const p=()=>{document.querySelectorAll("script[data-defer]").forEach(x=>{x.setAttribute("defer","")})};"requestIdleCallback"in window?requestIdleCallback(()=>{p()}):setTimeout(p,1),(()=>{["scroll","touchstart","touchmove","wheel"].forEach(x=>{document.addEventListener(x,()=>{},{passive:!0})})})()},g=()=>{},c=()=>{[{rel:"dns-prefetch",href:"//fonts.googleapis.com"},...o?[{rel:"dns-prefetch",href:`//${o.replace(/^https?:\/\//,"")}`}]:[],{rel:"preconnect",href:"https://fonts.gstatic.com",crossorigin:!0},...o?[{rel:"preconnect",href:o}]:[]].forEach(m=>{const y=document.createElement("link");y.rel=m.rel,y.href=m.href,m.crossorigin&&(y.crossOrigin=""),document.head.appendChild(y)})},h=()=>{if(document.querySelectorAll("img[data-lazy]").forEach(m=>{m.loading="lazy"}),"IntersectionObserver"in window){const m=new IntersectionObserver(x=>{x.forEach(N=>{if(N.isIntersecting){const k=N.target;k.dataset.src&&(k.src=k.dataset.src,k.removeAttribute("data-src")),m.unobserve(k)}})},{rootMargin:"50px 0px"});document.querySelectorAll("img[data-src]").forEach(x=>m.observe(x))}},f=()=>{[{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:x,content:N})=>{if(!document.querySelector(`meta[name="${x}"]`)){const k=document.createElement("meta");k.name=x,k.content=N,document.head.appendChild(k)}});const m={"@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"}},y=document.createElement("script");y.type="application/ld+json",y.textContent=JSON.stringify(m),document.head.appendChild(y)},v=()=>{document.querySelectorAll('link[rel="stylesheet"][data-non-critical]').forEach(m=>{const y=m.cloneNode(!0);y.rel="preload",y.as="style",y.onload=()=>{y.onload=null,y.rel="stylesheet"},document.head.appendChild(y),m.remove()})};return s(),n(),l(),i(),c(),h(),f(),v(),setTimeout(g,2e3),()=>{}},[o,r,a]),e.jsx(e.Fragment,{children:t})),cd=()=>(b.useEffect(()=>{if(typeof window>"u"||typeof document>"u"||!document.documentElement)return;const t=()=>{if("IntersectionObserver"in window){const i=new IntersectionObserver(g=>{g.forEach(c=>{if(c.isIntersecting){const h=c.target;h.dataset.src&&(h.src=h.dataset.src,h.removeAttribute("data-src"),i.unobserve(h))}})},{rootMargin:"50px 0px"});document.querySelectorAll("img[data-src]").forEach(g=>{i.observe(g)})}const s=()=>{["/connect","/mail","/settings"].forEach(g=>{const c=document.createElement("link");c.rel="prefetch",c.href=g,document.head.appendChild(c)})},n=()=>{if(!document.querySelector("script[data-wallet-detection]")){const i=document.createElement("script");i.dataset.walletDetection="true",i.innerHTML='(function() { window.walletPreload = { hasMetaMask: typeof window.ethereum !== "undefined", hasPhantom: typeof window.solana !== "undefined", hasWalletConnect: true }; })();',document.head.appendChild(i)}},l=()=>{document.querySelectorAll("img[data-hero]").forEach(i=>{const g=i;g.loading="eager","fetchPriority"in g&&(g.fetchPriority="high")}),document.querySelectorAll('img[data-priority="low"]').forEach(i=>{const g=i;g.loading="lazy","fetchPriority"in g&&(g.fetchPriority="low")})};requestIdleCallback(()=>{s(),n(),l()},{timeout:2e3})},r=()=>{if("PerformanceObserver"in window){const s=new PerformanceObserver(l=>{const i=l.getEntries(),g=i[i.length-1];g&&g.startTime>2500&&(document.documentElement.style.setProperty("--animation-duration","0s"),localStorage.setItem("reduce-image-quality","true"))});try{s.observe({entryTypes:["largest-contentful-paint"]})}catch{}const n=new PerformanceObserver(l=>{let i=0;for(const g of l.getEntries())g.hadRecentInput||(i+=g.value);i>.1&&document.querySelectorAll("img:not([width]):not([height])").forEach(g=>{const c=g;c.style.aspectRatio="16/9"})});try{n.observe({entryTypes:["layout-shift"]})}catch{}}},a=()=>{if("connection"in navigator&&typeof document<"u"&&document.documentElement){const s=navigator.connection;if(s){const n=s.effectiveType;n==="slow-2g"||n==="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")):n==="3g"?document.documentElement.classList.add("moderate-connection"):document.documentElement.classList.add("fast-connection")}}};return(()=>{t(),r(),a()})(),()=>{if("PerformanceObserver"in window)try{PerformanceObserver.supportedEntryTypes.forEach(()=>{})}catch{}}},[]),null),dd=({children:t})=>e.jsx(e.Fragment,{children:t}),at={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 gd{constructor(){this.cache=new Map}set(r,a,o){if(this.cache.size>=o.maxSize){const s=this.cache.keys().next().value;s&&this.cache.delete(s)}this.cache.set(r,{data:a,timestamp:Date.now(),isStale:!1})}get(r,a){const o=this.cache.get(r);if(!o)return null;const n=Date.now()-o.timestamp>a.duration;return n&&!a.staleWhileRevalidate?(this.cache.delete(r),null):{data:o.data,isStale:n}}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 ie=new gd,oe=new Map,ot=async(t,r,a="messages")=>{const o=at[a],s=ie.get(t,o);if(s&&!s.isStale)return s.data;const n=oe.get(t);if(n)return n;if(s&&s.isStale&&o.staleWhileRevalidate){const i=r().then(g=>(ie.set(t,g,o),oe.delete(t),g)).catch(g=>{throw oe.delete(t),g});return oe.set(t,i),s.data}const l=r().then(i=>(ie.set(t,i,o),oe.delete(t),i)).catch(i=>{throw oe.delete(t),i});return oe.set(t,l),l};class ud{constructor(){this.queue=[],this.timer=null,this.batchDelay=10}add(r,a){return new Promise((o,s)=>{this.queue.push({key:r,fetcher:a,resolve:o,reject:s}),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 o of a)await Promise.allSettled(o.map(async s=>{try{const n=await s.fetcher();s.resolve(n)}catch(n){s.reject(n)}}))}groupRequests(r){const a=[];for(let s=0;s<r.length;s+=5)a.push(r.slice(s,s+5));return a}}const hd=new ud;class fd{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={},o,s="messages"){const n=`${this.baseURL}${r}`,l=o||`${a.method||"GET"}:${n}`,i=async()=>{let g={...a,headers:{...this.defaultHeaders,...a.headers}};for(const h of this.requestInterceptors)g=h(g);let c=await fetch(n,g);for(const h of this.responseInterceptors)c=await h(c);if(!c.ok)throw new Error(`API Error: ${c.status} ${c.statusText}`);return c.json()};return a.method==="GET"&&this.shouldBatch(r)?hd.add(l,i):ot(l,i,s)}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 bd=async(t,r=3,a=1e3)=>{let o;for(let s=0;s<=r;s++)try{return await t()}catch(n){if(o=n,s===r)throw o;const l=a*Math.pow(2,s)+Math.random()*1e3;await new Promise(i=>setTimeout(i,l))}throw o};class md{constructor(){this.abortController=new AbortController}async request(r,a={}){const o=await fetch(r,{...a,signal:this.abortController.signal});if(!o.ok)throw new Error(`HTTP ${o.status}: ${o.statusText}`);return o.json()}cancel(){this.abortController.abort()}}const pd={invalidate:t=>ie.invalidate(t),clear:()=>ie.clear(),getStats:()=>ie.getStats(),warmUp:async t=>{await Promise.allSettled(t.map(r=>r()))},prefetch:async t=>{"requestIdleCallback"in window?window.requestIdleCallback(async()=>{await Promise.allSettled(t.map(r=>r()))}):setTimeout(async()=>{await Promise.allSettled(t.map(r=>r()))},100)}};function st(){if(typeof window>"u")return!1;const t=window.navigator.userAgent.toLowerCase();return["metamask","trustwallet","coinbase","rainbow","phantom","solflare","exodus","ledger","binance","okx"].some(a=>t.includes(a))}function nt(){return typeof window>"u"?!1:window.location.hostname==="localhost"||window.location.hostname==="127.0.0.1"}function lt(){if(typeof window>"u")return!1;const t=window.location.hostname;return/^\d+\.\d+\.\d+\.\d+$/.test(t)}function it(){return nt()?"localhost":st()?"wallet-browser":lt()?"network":"production"}function yd(){const t=it();return t==="localhost"||t==="wallet-browser"}function vd(t){}function ct(){return typeof window<"u"}function xd(){return typeof window<"u"}function kd(t,r){if(ct())t();else return r}const hr=t=>({"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'",...t?.apiUrls||[],...t?.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'"]}),wd=hr(),dt=t=>{const r=hr(t);return Object.entries(r).map(([a,o])=>`${a} ${o.join(" ")}`).join("; ")},gt=t=>({"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":dt(t)}),Cd=gt(),Nd={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"},Sd=()=>{typeof window<"u"&&document.addEventListener("securitypolicyviolation",()=>{})},Ld={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"},X=new Map,be=new Map,Be=new Set;let me="medium",fr=!1;function Ed(){if("connection"in navigator){const a=navigator.connection;a&&(me=a.effectiveType==="4g"?"fast":a.effectiveType==="3g"?"medium":"slow")}const t=navigator.deviceMemory,r=navigator.hardwareConcurrency;fr=t&&t<4||r&&r<4}Ed();function Md(t,r,a={}){const{retries:o=3,timeout:s=1e4,fallback:n,preloadCondition:l,cacheStrategy:i="memory",priority:g="medium",onLoad:c,onError:h}=a;if(X.has(r))return X.get(r).component;const f=b.lazy(async()=>{const p=performance.now();if(be.has(r))return be.get(r).then(y=>({default:y}));const m=Id(t,o,s);be.set(r,m.then(y=>y.default));try{const y=await m,x=performance.now()-p;if(i!=="none"){const N={component:y.default,timestamp:Date.now(),loadTime:x};if(X.set(r,N),i==="session")try{sessionStorage.setItem(`lazy_${r}`,JSON.stringify({timestamp:N.timestamp,loadTime:x}))}catch{}}return be.delete(r),c?.(y.default),y}catch(y){throw be.delete(r),h?.(y),y}}),v=p=>{const[m,y]=b.useState(!0);b.useEffect(()=>{if(l&&!X.has(r)&&l()&&!Be.has(r)){Be.add(r);const k=Td(g,me);setTimeout(()=>{t().catch(()=>{})},k)}},[]);const x=n||e.jsxs("div",{className:"flex items-center justify-center p-4",children:[e.jsx("div",{className:"animate-spin rounded-full h-6 w-6 border-b-2 border-blue-500"}),e.jsxs("span",{className:"ml-2 text-sm text-gray-600",children:["Loading ",r.replace(/([A-Z])/g," $1").trim(),"..."]})]});return!m&&fr&&me==="slow"?e.jsx("div",{className:"lazy-placeholder",children:e.jsxs("button",{onClick:()=>y(!0),className:"load-component-btn",children:["Load ",r]})}):e.jsx(b.Suspense,{fallback:x,children:e.jsx(f,{...p})})};return v.displayName=`AdvancedLazy(${r})`,v}async function Id(t,r,a){let o;for(let s=0;s<r;s++)try{const n=new Promise((i,g)=>{setTimeout(()=>g(new Error("Load timeout")),a)});return await Promise.race([t(),n])}catch(n){if(o=n,s<r-1){const l=Math.pow(2,s)*1e3,i=Math.random()*1e3;await new Promise(g=>setTimeout(g,l+i))}}throw o}function Td(t,r){const a={critical:0,high:500,medium:2e3,low:5e3},o={fast:.5,medium:1,slow:2},s=a[t]||2e3,n=o[r]||1;return s*n}const we=class we{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:o,probability:s})=>{s>.3&&!X.has(o)&&setTimeout(()=>{this.routeMap.get(o)},me==="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:X.size,currentRoute:this.currentRoute,usageStats:Object.fromEntries(this.routeUsageStats)}}};we.routeMap=new Map,we.routeUsageStats=new Map,we.currentRoute="";let br=we;const Pd=({src:t,alt:r,className:a,placeholder:o,priority:s="medium"})=>{const[n,l]=b.useState(!1),[i,g]=b.useState(!1),c=b.useRef(null);b.useEffect(()=>{if(!c.current)return;if(s==="high"){g(!0);return}const f=new IntersectionObserver(([v])=>{v.isIntersecting&&(g(!0),f.unobserve(v.target))},{rootMargin:s==="low"?"100px":"200px",threshold:.1});return f.observe(c.current),()=>f.disconnect()},[s]);const h=()=>{l(!0)};return e.jsxs("div",{className:`lazy-image-container ${a}`,children:[e.jsx("img",{ref:c,src:i?t:o||"data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB2aWV3Qm94PSIwIDAgMSAxIiBmaWxsPSJub25lIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjxyZWN0IHdpZHRoPSIxIiBoZWlnaHQ9IjEiIGZpbGw9IiNGM0Y0RjYiLz48L3N2Zz4=",alt:r,className:`transition-opacity duration-300 ${n?"opacity-100":"opacity-0"}`,onLoad:h,loading:s==="high"?"eager":"lazy",fetchPriority:s==="high"?"high":"low"}),!n&&i&&e.jsx("div",{className:"absolute inset-0 bg-gray-200 animate-pulse rounded"})]})};function zd(){X.clear(),Be.clear()}function Ud(){return{cachedComponents:X.size,preloadQueue:Be.size,networkSpeed:me,isLowEndDevice:fr,cacheEntries:Array.from(X.entries()).map(([t,r])=>({name:t,loadTime:r.loadTime,age:Date.now()-r.timestamp}))}}const Ad=({message:t})=>e.jsxs("div",{className:"flex items-center justify-center p-4",children:[e.jsx("div",{className:"animate-spin rounded-full h-6 w-6 border-b-2 border-blue-500"}),e.jsx("span",{className:"ml-2 text-sm text-gray-600",children:t})]}),$d=t=>{if(typeof t=="function"||typeof t=="object")return t;switch(t){case"minimal":return()=>e.jsx("div",{className:"flex justify-center items-center p-4",children:"Loading..."});case"skeleton":return()=>e.jsxs("div",{className:"animate-pulse",children:[e.jsx("div",{className:"h-4 bg-gray-200 rounded w-3/4 mb-2"}),e.jsx("div",{className:"h-4 bg-gray-200 rounded w-1/2"})]});case"default":default:return()=>e.jsx(Ad,{message:"Loading component..."})}},ut=(t,r="default",a=3)=>{const o=b.lazy(async()=>{let n=null;for(let l=0;l<a;l++)try{return await t()}catch(i){n=i,l<a-1&&await new Promise(g=>setTimeout(g,Math.pow(2,l)*1e3))}throw n}),s=$d(r);return n=>e.jsx(b.Suspense,{fallback:e.jsx(s,{}),children:e.jsx(o,{...n})})},Dd=async t=>{try{await t()}catch{}},Bd=t=>{const r={};return Object.entries(t).forEach(([a,o])=>{r[a]=ut(o,"skeleton")}),r},jd=t=>t,ht={critical:["/","/connect","/mail"],secondary:["/settings","/compose","/points"],optional:["/document","/about","/terms","/privacy"]},Ce=class Ce{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}};Ce.preloadedComponents=new Set,Ce.preloadQueue=[],Ce.isPreloading=!1;let mr=Ce;const Fd=()=>{"requestIdleCallback"in window&&window.requestIdleCallback(()=>{ht.secondary.forEach(t=>{})})},ft=({message:t})=>e.jsxs("div",{className:"flex items-center justify-center p-4",children:[e.jsx("div",{className:"animate-spin rounded-full h-6 w-6 border-b-2 border-blue-500"}),e.jsx("span",{className:"ml-2 text-sm text-gray-600",children:t})]}),pe=new Map;function Od(t,r){const{condition:a,fallback:o,retries:s=3,timeout:n=1e4,priority:l="medium",cacheKey:i=`conditional-${Math.random()}`}=r,g=c=>{const[h,f]=b.useState(!1),[v,p]=b.useState(null);return b.useEffect(()=>{const x=setTimeout(async()=>{const N=pe.get(i);if(N&&N.isValid&&Date.now()-N.lastCheck<3e5)try{if(await N.condition()){p(()=>N.component),f(!0);return}}catch{}try{if(await a()){const S=await Hd(t,s,n);pe.set(i,{component:S.default,condition:a,lastCheck:Date.now(),isValid:!0}),p(()=>S.default),f(!0)}}catch{}},l==="high"?0:l==="medium"?100:500);return()=>clearTimeout(x)},[]),h?v?e.jsx(b.Suspense,{fallback:o||e.jsx(ft,{message:"Loading component..."}),children:e.jsx(v,{...c})}):null:o||e.jsx(ft,{message:"Checking conditions..."})};return g.displayName=`ConditionalLazy(${i})`,g}const Vd={},Wd={};async function Hd(t,r,a){let o;for(let s=0;s<r;s++)try{const n=new Promise((l,i)=>{setTimeout(()=>i(new Error("Import timeout")),a)});return await Promise.race([t(),n])}catch(n){if(o=n,s<r-1){const l=Math.pow(2,s)*1e3;await new Promise(i=>setTimeout(i,l))}}throw o}function _d(){pe.clear()}function qd(){return{cachedComponents:pe.size,cacheEntries:Array.from(pe.entries()).map(([t,r])=>({key:t,lastCheck:r.lastCheck,isValid:r.isValid,age:Date.now()-r.lastCheck}))}}const bt=[{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 Gd{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 o=a.effectiveType;o==="4g"?this.networkSpeedEstimate="fast":o==="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(o=>{o.level&&o.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(o=>{document.addEventListener(o,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 o=document.createElement("link");o.rel="modulepreload",o.href=r.path.replace("*",this.getChunkHash(r.name)),o.crossOrigin="","fetchPriority"in o&&(o.fetchPriority=r.config.priority==="critical"?"high":"low"),document.head.appendChild(o),this.preloaded.add(r.name)}catch{}}getChunkHash(r){const a=Array.from(document.querySelectorAll("script[src]"));for(const o of a){const s=o.src;if(s.includes(r)){const n=s.match(new RegExp(`${r}-([A-Za-z0-9_-]+)\\.js`));if(n)return n[1]}}return"unknown"}async schedulePreload(r){const a=r.config;return a.delay&&await new Promise(o=>setTimeout(o,a.delay)),a.onIdle&&"requestIdleCallback"in window?new Promise(o=>{window.requestIdleCallback(()=>{this.preloadChunk(r).then(o)})}):this.preloadChunk(r)}initializePreloading(){bt.sort((a,o)=>{const s={critical:0,high:1,medium:2,low:3};return s[a.config.priority]-s[o.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(o=>{let s=!1;o.addEventListener("mouseenter",()=>{!s&&this.userActivityScore>30&&(this.preloadChunk(r),s=!0)},{passive:!0})})}setupScrollPreloading(r,a){let o=!1;const s=()=>{if(o)return;window.scrollY/(document.body.scrollHeight-window.innerHeight)*100>=a&&(this.preloadChunk(r),o=!0,window.removeEventListener("scroll",s))};window.addEventListener("scroll",s,{passive:!0})}startIntelligentPreloading(){setTimeout(()=>{this.userActivityScore>50&&this.networkSpeedEstimate!=="slow"&&bt.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 ye=null;function Kd(){ye||(ye=new Gd,document.readyState==="loading"?document.addEventListener("DOMContentLoaded",()=>{ye?.initializePreloading()}):ye.initializePreloading())}function Yd(){return ye?.getPreloadingStats()}function Qd(t){const r={"ai-content-type":t.contentType,"ai-primary-topic":t.primaryTopic,"ai-complexity-level":t.complexityLevel,"ai-content-purpose":t.contentPurpose,"ai-industry-vertical":t.industryVertical,"ai-semantic-keywords":t.semanticKeywords.join(","),"ai-target-audience":t.targetAudience.join(","),"ai-technical-tags":t.technicalTags.join(","),"ai-user-intent":t.userIntent.join(","),"ai-conversion-goals":t.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 t.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 mt(t){const r={"@context":"https://schema.org","@type":Zd(t.contentType),name:t.primaryTopic,description:`Comprehensive ${t.primaryTopic} resource for ${t.targetAudience.join(", ")}`,about:t.semanticKeywords.map(a=>({"@type":"Thing",name:a})),audience:{"@type":"Audience",audienceType:t.targetAudience.join(", ")},educationalLevel:t.complexityLevel,inLanguage:"en",isAccessibleForFree:!0};return t.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 Xd(t,r){return r.map(a=>({type:"related-content",target:a.url,strength:a.relevance}))}function pt(t){const r=["Web3 Email Platform","Web3","blockchain","email","wallet","cryptocurrency"],a=["DAO","governance","voting","multi-sig","Snapshot","Tally","Aragon","Safe","proposal","community"];return t.contentType==="governance-page"?[...r,...a]:r}function yt(t){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 t.contentType==="governance-page"?[...r,...a]:r}function Jd(t,r){return{contentClassification:{type:t.contentType,topic:t.primaryTopic,audience:t.targetAudience.join(","),complexity:t.complexityLevel,purpose:t.contentPurpose,vertical:t.industryVertical},semanticMarkup:mt(t),entityRecognition:pt(t),topicClustering:yt(t),contentRelationships:r?.contentRelationships||[],...r}}function Zd(t){return{article:"Article","landing-page":"WebPage","product-page":"Product","governance-page":"SoftwareApplication",documentation:"TechArticle"}[t]||"WebPage"}function Rd(t){return{"@context":"https://schema.org","@type":"MonitorAction",name:`AI Performance Tracking - ${t}`,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:`${t} Performance Data`,description:"AI-optimized performance metrics and user interaction data"}}}const e0={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"]}},r0=({message:t,className:r})=>e.jsxs("div",{className:`flex items-center justify-center p-4 ${r||""}`,children:[e.jsx("div",{className:"animate-spin rounded-full h-6 w-6 border-b-2 border-blue-500"}),e.jsx("span",{className:"ml-2 text-sm text-gray-600",children:t})]}),pr=new Map,ve=new Set;function yr(){const t=[];return!!window.ethereum?.isMetaMask&&(ve.add("metamask"),t.push({name:"MetaMask",detected:!0,priority:1})),!!window.ethereum?.isCoinbaseWallet&&(ve.add("coinbase"),t.push({name:"Coinbase Wallet",detected:!0,priority:2})),!!window.solana?.isPhantom&&(ve.add("phantom"),t.push({name:"Phantom",detected:!0,priority:3})),t.push({name:"WalletConnect",detected:!0,priority:4}),t.sort((s,n)=>s.priority-n.priority)}function vr(t){const r=`wallet-${t.toLowerCase()}`;if(pr.has(r))return pr.get(r);const a=()=>Promise.resolve({default:()=>b.createElement("div",{},`${t} Provider Placeholder`)}),o=b.lazy(a),s=n=>e.jsx(b.Suspense,{fallback:e.jsx(r0,{message:`Loading ${t} wallet...`,className:"wallet-loading"}),children:e.jsx(o,{...n})});return s.displayName=`Lazy${t}Provider`,pr.set(r,s),s}function t0({children:t}){const r=yr();return r.filter(a=>a.priority<=2&&a.detected).forEach(a=>{setTimeout(()=>{},1e3)}),e.jsxs(e.Fragment,{children:[r.map(a=>{const o=vr(a.name);return e.jsx(o,{},a.name)}),t]})}const Cr=class Cr{static preloadWallet(r){const a=r.toLowerCase();this.preloadedWallets.has(a)||(this.preloadedWallets.add(a),setTimeout(()=>{vr(r)},500))}static preloadCommonWallets(){["metamask","walletconnect","coinbase"].forEach((a,o)=>{setTimeout(()=>{this.preloadWallet(a)},o*1e3)})}static getPreloadedWallets(){return Array.from(this.preloadedWallets)}};Cr.preloadedWallets=new Set;let xe=Cr;function a0(){return{availableWallets:yr(),preloadWallet:o=>{xe.preloadWallet(o)},getDetectedWallets:()=>Array.from(ve),hasWallet:o=>ve.has(o.toLowerCase())}}function o0({walletName:t,onConnect:r,disabled:a=!1}){const o=()=>{xe.preloadWallet(t),setTimeout(r,100)};return e.jsxs("button",{onClick:o,disabled:a,className:"wallet-connect-btn","data-wallet":t.toLowerCase(),children:["Connect ",t]})}class s0{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(n=>{for(const l of n.getEntries())l.name==="first-contentful-paint"&&(this.observedMetrics.fcp=l.startTime,this.optimizeBasedOnFCP(l.startTime))}).observe({entryTypes:["paint"]}),new PerformanceObserver(n=>{for(const l of n.getEntries())this.observedMetrics.lcp=l.startTime,this.optimizeBasedOnLCP(l.startTime)}).observe({entryTypes:["largest-contentful-paint"]});let o=0;new PerformanceObserver(n=>{for(const l of n.getEntries())l.hadRecentInput||(o+=l.value);this.observedMetrics.cls=o}).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(o=>{o.loading="lazy",o.style.display="none",setTimeout(()=>{o.style.display=""},3e3)}),document.querySelectorAll('script[data-priority="low"]').forEach(o=>{o.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(o=>{o instanceof HTMLImageElement&&(o.fetchPriority="high",o.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 s=document.createElement("link");switch(s.rel="preload",s.href=r,a){case"script":s.as="script";break;case"style":s.as="style";break;case"font":s.as="font",s.type="font/woff2",s.crossOrigin="";break;case"image":s.as="image";break}document.head.appendChild(s)}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 o=document.createElement("style");o.textContent=a,document.head.appendChild(o),r.remove()}}).catch(()=>{})}optimizeFontLoading(){document.querySelectorAll('link[href*="fonts.googleapis.com"]').forEach(a=>{const o=a.getAttribute("href")||"";if(!o.includes("display=swap")){const s=o.includes("?")?"&":"?";a.setAttribute("href",`${o}${s}display=swap`)}})}removeRenderBlocking(){document.querySelectorAll('link[rel="stylesheet"]:not([data-critical])').forEach(a=>{const o=a.cloneNode(!0);o.rel="preload",o.as="style",o.onload=()=>{o.onload=null,o.rel="stylesheet"};const s=document.createElement("noscript"),n=a.cloneNode(!0);s.appendChild(n),document.head.appendChild(o),document.head.appendChild(s),a.remove()})}setupProgressiveLoading(){const r=document.querySelectorAll("img[data-src]");if("IntersectionObserver"in window){const a=new IntersectionObserver(o=>{o.forEach(s=>{if(s.isIntersecting){const n=s.target;n.src=n.dataset.src||"",n.removeAttribute("data-src"),a.unobserve(n)}})},{rootMargin:"50px 0px",threshold:.01});r.forEach(o=>a.observe(o))}else r.forEach(a=>{const o=a;o.src=o.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 je={mark:t=>{typeof performance<"u"&&performance.mark&&performance.mark(t)},measure:(t,r,a)=>{if(typeof performance<"u"&&performance.measure)try{performance.measure(t,r,a);const o=performance.getEntriesByName(t);return o[o.length-1]?.duration||0}catch{return 0}return 0},getEntries:t=>typeof performance<"u"&&performance.getEntriesByName?t?performance.getEntriesByName(t):performance.getEntries():[],clearEntries:t=>{typeof performance<"u"&&(t?(performance.clearMeasures?.(t),performance.clearMarks?.(t)):(performance.clearMeasures?.(),performance.clearMarks?.()))}},n0=(t,r=[])=>{b.useEffect(()=>(je.mark(`${t}-start`),()=>{je.mark(`${t}-end`),je.measure(t,`${t}-start`,`${t}-end`)}),[t,r])},l0=t=>{const r=b.useRef(t);return r.current=t,b.useCallback((...a)=>r.current(...a),[])},i0=(t,r,a)=>{const o=b.useRef(r),s=b.useRef(void 0);return b.useMemo(()=>(a&&process.env.NODE_ENV==="development"&&r.some((n,l)=>n!==o.current[l]),o.current=r,s.current=t(),s.current),[t,a,r])},Fe=new Map,c0=t=>{const r=Fe.get(t)||0;Fe.set(t,r+1),b.useEffect(()=>{process.env.NODE_ENV})},d0=()=>Object.fromEntries(Fe),g0=()=>Fe.clear(),u0=t=>b.lazy(t),h0=(t=.1)=>{const[r,a]=b.useState(new Set),o=b.useRef(null);b.useEffect(()=>(o.current=new IntersectionObserver(n=>{n.forEach(l=>{if(l.isIntersecting){const i=l.target,g=i.dataset.src;g&&(i.src=g,i.onload=()=>{a(c=>new Set(c).add(g))},o.current?.unobserve(i))}})},{threshold:t}),()=>o.current?.disconnect()),[t]);const s=b.useCallback(n=>{n&&o.current&&o.current.observe(n)},[]);return{loadedImages:r,observeImage:s}},f0=t=>{typeof window<"u"&&"requestIdleCallback"in window?window.requestIdleCallback(()=>{t().catch(()=>{})}):setTimeout(()=>{t().catch(()=>{})},100)},vt={},b0=t=>{vt[t.name]=t.value,process.env.NODE_ENV},m0=()=>vt,p0=(t,r="script")=>{if(typeof document<"u"){const a=document.createElement("link");a.rel="prefetch",a.href=t,a.as=r,document.head.appendChild(a)}},y0=(t,r="script",a)=>{if(typeof document<"u"){const o=document.createElement("link");o.rel="preload",o.href=t,o.as=r,a&&(o.crossOrigin="anonymous"),document.head.appendChild(o)}},v0=t=>{const r=b.useRef(new Set),a=b.useRef(new Set),o=b.useCallback((n,l)=>{const i=setTimeout(()=>{r.current.delete(i),n()},l);return r.current.add(i),i},[]),s=b.useCallback((n,l)=>{const i=setInterval(n,l);return a.current.add(i),i},[]);return b.useEffect(()=>{const n=r.current,l=a.current;return()=>{n.forEach(i=>clearTimeout(i)),l.forEach(i=>clearInterval(i)),process.env.NODE_ENV}},[t]),{createTimer:o,createInterval:s}},J={maxBundleSize:500,maxChunkSize:200,maxImageSize:100,maxFCP:1800,maxLCP:2500,maxFID:100,maxCLS:.1,check:t=>{const r=[];return t.FCP&&t.FCP>J.maxFCP&&r.push(`FCP (${t.FCP}ms) exceeds budget (${J.maxFCP}ms)`),t.LCP&&t.LCP>J.maxLCP&&r.push(`LCP (${t.LCP}ms) exceeds budget (${J.maxLCP}ms)`),t.FID&&t.FID>J.maxFID&&r.push(`FID (${t.FID}ms) exceeds budget (${J.maxFID}ms)`),t.CLS&&t.CLS>J.maxCLS&&r.push(`CLS (${t.CLS}) exceeds budget (${J.maxCLS})`),r}};class x0{constructor(r){this.metrics={timestamp:Date.now()},this.observers=[],this.performanceMarks=new Map,this.reportCallback=r,this.initializeWebVitals(),this.initializeCustomObservers(),this.collectDeviceInfo()}initializeWebVitals(){fe.onCLS(r=>{this.metrics.CLS=r.value,this.reportMetric("CLS",r.value)}),fe.onINP(r=>{this.metrics.INP=r.value,this.reportMetric("INP",r.value)}),fe.onFCP(r=>{this.metrics.FCP=r.value,this.reportMetric("FCP",r.value)}),fe.onLCP(r=>{this.metrics.LCP=r.value,this.reportMetric("LCP",r.value)}),fe.onTTFB(r=>{this.metrics.TTFB=r.value,this.reportMetric("TTFB",r.value)})}initializeCustomObservers(){if("PerformanceObserver"in window){const r=new PerformanceObserver(o=>{o.getEntries().forEach(n=>{if(n.entryType==="navigation"){const l=n;this.metrics.bundleLoadTime=l.loadEventEnd-l.fetchStart}})});try{r.observe({entryTypes:["navigation"]}),this.observers.push(r)}catch{}const a=new PerformanceObserver(o=>{o.getEntries().forEach(n=>{(n.name.includes(".js")||n.name.includes(".css"))&&this.trackResourceLoad(n.name,n.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 o=r.includes(".js"),s=r.includes(".css");if(o||s){const n=o?"JavaScript":"CSS";this.reportMetric(`${n} 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 o=performance.now()-a;this.reportMetric(`Mark (${r})`,o),this.performanceMarks.delete(r)}}trackRouteChange(r,a,o){typeof a=="string"?this.measureRouteChange(a,o||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 Oe=null;const k0=t=>(Oe||(Oe=new x0(t)),Oe),Ve=()=>Oe,xt=t=>{const r=b.useRef(performance.now());b.useEffect(()=>{const a=performance.now()-r.current,o=Ve();o&&o.measureComponentRender(t,a)},[t])},w0=(t,r)=>b.forwardRef((a,o)=>(xt(r),b.createElement(t,{...a,ref:o}))),C0=async(t,r)=>{const a=performance.now(),o=await t(),s=performance.now()-a,n=Ve();return n&&n.measureAPICall(r,s),o},kt={LCP:2500,INP:200,CLS:.1,FCP:1800,TTFB:800,bundleSize:17e4},N0=(t,r=kt)=>{const a=[];return r.LCP&&t.LCP&&t.LCP>r.LCP&&a.push(`LCP: ${t.LCP.toFixed(0)}ms (budget: ${r.LCP}ms)`),r.INP&&t.INP&&t.INP>r.INP&&a.push(`INP: ${t.INP.toFixed(0)}ms (budget: ${r.INP}ms)`),r.CLS&&t.CLS&&t.CLS>r.CLS&&a.push(`CLS: ${t.CLS.toFixed(3)} (budget: ${r.CLS})`),r.FCP&&t.FCP&&t.FCP>r.FCP&&a.push(`FCP: ${t.FCP.toFixed(0)}ms (budget: ${r.FCP}ms)`),r.TTFB&&t.TTFB&&t.TTFB>r.TTFB&&a.push(`TTFB: ${t.TTFB.toFixed(0)}ms (budget: ${r.TTFB}ms)`),{passed:a.length===0,violations:a}},S0=t=>{const r=t||Ve()?.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)},L0={CLS:[.1,.25],FCP:[1800,3e3],FID:[100,300],LCP:[2500,4e3],TTFB:[800,1800],INP:[200,500]};function ce(t,r){const[a,o]=L0[t];return r<=a?"good":r<=o?"needs-improvement":"poor"}function ke(t,r){try{if(PerformanceObserver.supportedEntryTypes?.includes(t)){const a=new PerformanceObserver(o=>{r(o.getEntries())});return a.observe({type:t,buffered:!0}),a}}catch{}}function wt(t){let r=0;ke("layout-shift",a=>{for(const o of a){const s=o;s.hadRecentInput||(r+=s.value)}}),document.addEventListener("visibilitychange",()=>{document.visibilityState==="hidden"&&t({name:"CLS",value:r,rating:ce("CLS",r)})})}function Ct(t){ke("paint",r=>{for(const a of r)a.name==="first-contentful-paint"&&t({name:"FCP",value:a.startTime,rating:ce("FCP",a.startTime)})})}function Nt(t){let r=0;ke("largest-contentful-paint",o=>{const s=o[o.length-1];s&&(r=s.startTime)});const a=()=>{r>0&&t({name:"LCP",value:r,rating:ce("LCP",r)})};document.addEventListener("visibilitychange",()=>{document.visibilityState==="hidden"&&a()}),["keydown","click"].forEach(o=>{document.addEventListener(o,a,{once:!0,capture:!0})})}function St(t){ke("first-input",r=>{const a=r[0];if(a){const o=a.processingStart-a.startTime;t({name:"FID",value:o,rating:ce("FID",o)})}})}function Lt(t){const r=performance.getEntriesByType("navigation")[0];if(r){const a=r.responseStart-r.requestStart;t({name:"TTFB",value:a,rating:ce("TTFB",a)})}}function Et(t){const r=[];ke("event",a=>{for(const o of a){const s=o;if(s.interactionId){const n=s.processingEnd-s.processingStart;r.push(n)}}}),document.addEventListener("visibilitychange",()=>{if(document.visibilityState==="hidden"&&r.length>0){r.sort((s,n)=>s-n);const a=Math.min(r.length-1,Math.ceil(r.length*.98)-1),o=r[a];t({name:"INP",value:o,rating:ce("INP",o)})}})}function E0(t){const r=t||(a=>{if(typeof window<"u"&&window.__DEV__){const o=a.rating==="good"?"\x1B[32m":a.rating==="needs-improvement"?"\x1B[33m":"\x1B[31m";console.log(`${o}[WebVitals] ${a.name}: ${a.value.toFixed(2)} (${a.rating})\x1B[0m`)}});wt(r),Ct(r),Nt(r),St(r),Lt(r),Et(r)}function Mt(t,r,a){if(typeof window<"u"&&window.__DEV__){const o=a<100?"good":a<300?"needs-improvement":"poor";console.log(`${o==="good"?"\x1B[32m":o==="needs-improvement"?"\x1B[33m":"\x1B[31m"}[RouteChange] ${t} -> ${r}: ${a}ms (${o})\x1B[0m`)}}function M0(t,r,a){typeof window<"u"&&window.__DEV__&&console.log(`[CustomMetric] ${t}: ${r}`,a||"")}function I0(t,r,a,o="GET"){if(typeof window<"u"&&window.__DEV__){const s=r<200?"good":r<500?"needs-improvement":"poor";console.log(`${s==="good"?"\x1B[32m":s==="needs-improvement"?"\x1B[33m":"\x1B[31m"}[API] ${o} ${t}: ${r}ms (${a})\x1B[0m`)}}const T0=({direction:t,className:r})=>e.jsx("svg",{className:u("w-4 h-4",r),fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:t==="up"?"M5 15l7-7 7 7":"M19 9l-7 7-7-7"})}),P0=({className:t})=>e.jsx("svg",{className:u("w-4 h-4",t),fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 18L18 6M6 6l12 12"})}),It=({title:t="Performance Monitor",isCollapsed:r,onToggleCollapse:a,onClose:o,onMouseDown:s,isDragging:n,className:l})=>e.jsxs("div",{className:u("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",s&&"cursor-grab",n&&"cursor-grabbing",l),onMouseDown:s,children:[e.jsxs("span",{className:"font-semibold text-sm flex items-center gap-2",children:[e.jsx("span",{children:"🚀"}),t]}),e.jsxs("div",{className:"flex gap-1",children:[e.jsx("button",{onClick:a,className:"hover:bg-gray-700 rounded p-1 transition-colors","aria-label":r?"Expand":"Collapse",type:"button",children:e.jsx(T0,{direction:r?"up":"down"})}),o&&e.jsx("button",{onClick:o,className:"hover:bg-gray-700 rounded p-1 transition-colors","aria-label":"Close",type:"button",children:e.jsx(P0,{})})]})]}),z0={sm:"w-2 h-2",md:"w-3 h-3",lg:"w-4 h-4"},U0={good:"bg-green-500","needs-improvement":"bg-yellow-500",poor:"bg-red-500",unknown:"bg-gray-400",neutral:"bg-gray-500"},A0={good:"Good","needs-improvement":"Needs Improvement",poor:"Poor",unknown:"Unknown",neutral:"Neutral"},$0=({rating:t,size:r="sm",showLabel:a=!1,className:o})=>e.jsxs("div",{className:u("flex items-center gap-1",o),children:[e.jsx("span",{className:u("rounded-full",z0[r],U0[t])}),a&&e.jsx("span",{className:"text-xs text-gray-400",children:A0[t]})]}),Tt=({className:t})=>e.jsxs("div",{className:u("flex gap-3 text-[10px] text-gray-400",t),children:[e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx("span",{className:"w-2 h-2 rounded-full bg-green-500"}),"Good"]}),e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx("span",{className:"w-2 h-2 rounded-full bg-yellow-500"}),"Needs Improvement"]}),e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx("span",{className:"w-2 h-2 rounded-full bg-red-500"}),"Poor"]})]}),D0={good:"text-green-500","needs-improvement":"text-yellow-500",poor:"text-red-500",unknown:"text-gray-400",neutral:"text-gray-300"},O=({label:t,value:r,unit:a="",rating:o="neutral",description:s,className:n})=>{const l=typeof r=="number"?Number.isInteger(r)?r.toString():r.toFixed(r<1?3:0):r;return e.jsxs("div",{className:u("flex justify-between items-center",n),children:[e.jsxs("div",{className:"flex flex-col",children:[e.jsx("span",{className:"text-gray-300",children:t}),s&&e.jsx("span",{className:"text-[10px] text-gray-500",children:s})]}),e.jsxs("span",{className:u("font-medium",D0[o]),children:[l,a]})]})},B0=(t,r="ms",a=0)=>t===void 0?"N/A":`${t.toFixed(a)}${r}`,Pt=(t={})=>{const{enabled:r=!0,onUpdate:a}=t,[o,s]=b.useState({}),[n,l]=b.useState(!0),i=b.useRef(a);b.useEffect(()=>{i.current=a},[a]);const g=b.useCallback(c=>{s(h=>{const f={...h,...c};return i.current?.(f),f})},[]);return b.useEffect(()=>{if(!r)return;if(typeof PerformanceObserver>"u"){l(!1);return}const c=[];try{const h=new PerformanceObserver(f=>{const v=f.getEntries(),p=v[v.length-1];g({lcp:p.renderTime||p.loadTime})});h.observe({type:"largest-contentful-paint",buffered:!0}),c.push(h)}catch{}try{const h=new PerformanceObserver(f=>{f.getEntries().forEach(p=>{p.processingStart&&g({fid:p.processingStart-p.startTime})})});h.observe({type:"first-input",buffered:!0}),c.push(h)}catch{}try{let h=0;const f=new PerformanceObserver(v=>{for(const p of v.getEntries())!p.hadRecentInput&&p.value&&(h+=p.value,g({cls:h}))});f.observe({type:"layout-shift",buffered:!0}),c.push(f)}catch{}try{const h=new PerformanceObserver(f=>{f.getEntries().forEach(p=>{p.name==="first-contentful-paint"&&g({fcp:p.startTime})})});h.observe({type:"paint",buffered:!0}),c.push(h)}catch{}try{const h=new PerformanceObserver(f=>{f.getEntries().forEach(p=>{p.duration&&g({inp:p.duration})})});h.observe({type:"event",buffered:!0}),c.push(h)}catch{}try{const h=performance.getEntriesByType("navigation")[0];h&&g({ttfb:h.responseStart-h.requestStart})}catch{}return()=>{c.forEach(h=>h.disconnect())}},[r,g]),{metrics:o,isSupported:n}},se=(t,r)=>{if(r===void 0)return"unknown";const o={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}}[t];return o?r<=o.good?"good":r<=o.poor?"needs-improvement":"poor":"unknown"},zt=({metrics:t,className:r})=>{const a=(o,s=0)=>o===void 0?"N/A":o.toFixed(s);return e.jsxs("div",{className:u("space-y-1",r),children:[e.jsx("h3",{className:"font-semibold text-yellow-400 mb-2 text-xs",children:"Web Vitals"}),e.jsxs("div",{className:"space-y-1.5",children:[e.jsx(O,{label:"LCP",value:a(t.lcp),unit:"ms",rating:se("lcp",t.lcp),description:"Largest Contentful Paint"}),e.jsx(O,{label:"FID",value:a(t.fid),unit:"ms",rating:se("fid",t.fid),description:"First Input Delay"}),e.jsx(O,{label:"CLS",value:a(t.cls,3),rating:se("cls",t.cls),description:"Cumulative Layout Shift"}),e.jsx(O,{label:"FCP",value:a(t.fcp),unit:"ms",rating:se("fcp",t.fcp),description:"First Contentful Paint"}),e.jsx(O,{label:"TTFB",value:a(t.ttfb),unit:"ms",rating:se("ttfb",t.ttfb),description:"Time to First Byte"}),t.inp!==void 0&&e.jsx(O,{label:"INP",value:a(t.inp),unit:"ms",rating:se("inp",t.inp),description:"Interaction to Next Paint"})]})]})},Ut=(t={})=>{const{enabled:r=!0,refreshInterval:a=5e3,onUpdate:o}=t,[s,n]=b.useState({}),l=b.useRef(o);b.useEffect(()=>{l.current=o},[o]);const i=b.useCallback(()=>{if(!(typeof performance>"u"))try{const c=performance.getEntriesByType("resource"),h=c.filter(x=>x.name.endsWith(".js")||x.initiatorType==="script"),f=h.reduce((x,N)=>x+N.duration,0),v=c.filter(x=>x.name.endsWith(".css")||x.initiatorType==="link"),p=v.reduce((x,N)=>x+N.duration,0),m=c.reduce((x,N)=>x+(N.transferSize||0),0),y={jsLoadTime:f,cssLoadTime:p,jsCount:h.length,cssCount:v.length,totalTransferSize:m};n(y),l.current?.(y)}catch{}},[]),g=b.useCallback(()=>{i()},[i]);return b.useEffect(()=>{if(!r)return;i();const c=setInterval(i,a);return()=>clearInterval(c)},[r,a,i]),{metrics:s,refresh:g}},At=t=>t===void 0?"N/A":t<1024?`${t}B`:t<1024*1024?`${(t/1024).toFixed(1)}KB`:`${(t/(1024*1024)).toFixed(1)}MB`,$t=({metrics:t,className:r})=>{const a=o=>o===void 0?"N/A":o.toFixed(0);return e.jsxs("div",{className:u("space-y-1",r),children:[e.jsx("h3",{className:"font-semibold text-blue-400 mb-2 text-xs",children:"Bundle Performance"}),e.jsxs("div",{className:"space-y-1.5",children:[e.jsx(O,{label:"JS Load",value:a(t.jsLoadTime),unit:"ms",rating:"neutral"}),e.jsx(O,{label:"CSS Load",value:a(t.cssLoadTime),unit:"ms",rating:"neutral"}),e.jsx(O,{label:"JS Files",value:t.jsCount??"N/A",rating:"neutral"}),e.jsx(O,{label:"Transfer Size",value:At(t.totalTransferSize),rating:"neutral"})]})]})},j0=t=>t===void 0?"unknown":t<=200?"good":t<=500?"needs-improvement":"poor",Dt=({metrics:t,className:r})=>{const a=o=>o===void 0||isNaN(o)?"N/A":o.toFixed(0);return t.callCount===0?null:e.jsxs("div",{className:u("space-y-1",r),children:[e.jsx("h3",{className:"font-semibold text-purple-400 mb-2 text-xs",children:"API Calls"}),e.jsxs("div",{className:"space-y-1.5",children:[e.jsx(O,{label:"Count",value:t.callCount,rating:"neutral"}),e.jsx(O,{label:"Total Time",value:a(t.totalTime),unit:"ms",rating:"neutral"}),e.jsx(O,{label:"Avg Time",value:a(t.averageTime),unit:"ms",rating:j0(t.averageTime)}),t.slowestCall!==void 0&&e.jsx(O,{label:"Slowest",value:a(t.slowestCall),unit:"ms",rating:t.slowestCall>1e3?"poor":"neutral"}),t.failedCalls>0&&e.jsx(O,{label:"Failed",value:t.failedCalls,rating:"poor"})]})]})},Bt=t=>t===void 0?"N/A":(t/(1024*1024)).toFixed(1),jt=(t,r)=>{if(t===void 0||r===void 0)return"unknown";const a=t/r;return a<=.5?"good":a<=.75?"needs-improvement":"poor"},Ft=({refreshInterval:t=2e3,className:r})=>{const[a,o]=b.useState({}),[s,n]=b.useState(!0);if(b.useEffect(()=>{const i=performance;if(!i.memory){n(!1);return}const g=()=>{i.memory&&o({usedJSHeapSize:i.memory.usedJSHeapSize,totalJSHeapSize:i.memory.totalJSHeapSize,jsHeapSizeLimit:i.memory.jsHeapSizeLimit})};g();const c=setInterval(g,t);return()=>clearInterval(c)},[t]),!s)return null;const l=a.usedJSHeapSize&&a.jsHeapSizeLimit?(a.usedJSHeapSize/a.jsHeapSizeLimit*100).toFixed(0):"N/A";return e.jsxs("div",{className:u("space-y-1",r),children:[e.jsx("h3",{className:"font-semibold text-cyan-400 mb-2 text-xs",children:"Memory"}),e.jsxs("div",{className:"space-y-1.5",children:[e.jsx(O,{label:"Used Heap",value:Bt(a.usedJSHeapSize),unit:"MB",rating:jt(a.usedJSHeapSize,a.jsHeapSizeLimit)}),e.jsx(O,{label:"Total Heap",value:Bt(a.totalJSHeapSize),unit:"MB",rating:"neutral"}),e.jsx(O,{label:"Usage",value:l,unit:"%",rating:jt(a.usedJSHeapSize,a.jsHeapSizeLimit)})]})]})},F0=t=>{if(t.rating)return t.rating;if(typeof t.value=="number"&&t.thresholds){const{good:r,poor:a}=t.thresholds;return t.value<=r?"good":t.value<=a?"needs-improvement":"poor"}return"neutral"},Ot=({title:t="Custom Metrics",titleColor:r="text-orange-400",metrics:a,className:o})=>a.length===0?null:e.jsxs("div",{className:u("space-y-1",o),children:[e.jsx("h3",{className:u("font-semibold mb-2 text-xs",r),children:t}),e.jsx("div",{className:"space-y-1.5",children:a.map(s=>e.jsx(O,{label:s.label,value:s.value,unit:s.unit,rating:F0(s),description:s.description},s.id))})]}),O0=["/api/","graphql",".json"],Vt=(t={})=>{const{enabled:r=!0,patterns:a=O0,refreshInterval:o=5e3,onUpdate:s}=t,[n,l]=b.useState({callCount:0,totalTime:0,averageTime:0,failedCalls:0}),i=b.useRef(a),g=b.useRef(s);b.useEffect(()=>{i.current=a},[a]),b.useEffect(()=>{g.current=s},[s]);const c=b.useCallback(()=>{if(!(typeof performance>"u"))try{const f=performance.getEntriesByType("resource"),v=i.current,p=f.filter(k=>v.some(S=>k.name.includes(S)));if(p.length===0)return;const m=p.reduce((k,S)=>k+S.duration,0),y=Math.max(...p.map(k=>k.duration)),x=p.filter(k=>{const S=k.responseStatus;return S!==void 0&&S>=400}).length,N={callCount:p.length,totalTime:m,averageTime:m/p.length,slowestCall:y,failedCalls:x};l(N),g.current?.(N)}catch{}},[]),h=b.useCallback(()=>{c()},[c]);return b.useEffect(()=>{if(!r)return;c();const f=setInterval(c,o);return()=>clearInterval(f)},[r,o,c]),{metrics:n,refresh:h}},Wt=(t={})=>{const{enabled:r=!0,constrainToViewport:a=!0,horizontalOnly:o=!1,verticalOnly:s=!1,initialPosition:n}=t,l=b.useRef(null),[i,g]=b.useState({x:n?.x??null,y:n?.y??null}),[c,h]=b.useState(!1),[f,v]=b.useState({x:0,y:0}),p=b.useCallback(y=>{if(!r||!l.current)return;const x=l.current.getBoundingClientRect();h(!0),v({x:y.clientX-x.left,y:y.clientY-x.top}),(i.x===null||i.y===null)&&g({x:o?x.left:i.x??x.left,y:s?x.top:i.y??x.top}),y.preventDefault()},[r,i,o,s]),m=b.useCallback(()=>{g({x:n?.x??null,y:n?.y??null})},[n]);return b.useEffect(()=>{if(!c)return;const y=N=>{if(!l.current)return;let k=N.clientX-f.x,S=N.clientY-f.y;if(a){const w=window.innerWidth-l.current.offsetWidth,C=window.innerHeight-l.current.offsetHeight;k=Math.max(0,Math.min(k,w)),S=Math.max(0,Math.min(S,C))}g({x:o?k:s?i.x:k,y:s?S:o?i.y:S})},x=()=>{h(!1)};return document.addEventListener("mousemove",y),document.addEventListener("mouseup",x),()=>{document.removeEventListener("mousemove",y),document.removeEventListener("mouseup",x)}},[c,f,a,o,s,i.x,i.y]),{position:i,isDragging:c,handleMouseDown:p,resetPosition:m,ref:l}},Ht={"bottom-right":"bottom-4 right-4","bottom-left":"bottom-4 left-4","top-right":"top-4 right-4","top-left":"top-4 left-4"},V0=["webVitals","bundle","api","memory"],W0=({enabled:t,defaultCollapsed:r=!0,defaultVisible:a=!0,position:o="bottom-right",draggable:s=!0,sections:n=V0,customMetrics:l=[],customSectionTitle:i="Custom Metrics",apiPatterns:g,onMetricsUpdate:c,className:h})=>{const f=t??(typeof process<"u"&&process.env?.NODE_ENV!=="production"),[v,p]=b.useState(r),[m,y]=b.useState(a),x=b.useMemo(()=>g,[JSON.stringify(g)]),N=b.useRef(c);b.useEffect(()=>{N.current=c},[c]);const{metrics:k}=Pt({enabled:f&&n.includes("webVitals")}),{metrics:S}=Ut({enabled:f&&n.includes("bundle")}),{metrics:w}=Vt({enabled:f&&n.includes("api"),patterns:x});b.useEffect(()=>{N.current&&N.current({webVitals:k,bundle:S,api:w})},[k,S,w]);const{position:C,isDragging:E,handleMouseDown:M,ref:L}=Wt({enabled:s,horizontalOnly:o.includes("bottom")||o.includes("top")}),I=b.useCallback(()=>{p($=>!$)},[]),U=b.useCallback(()=>{y(!1)},[]),P=b.useCallback(()=>{y(!0)},[]);if(!f)return null;if(!m)return e.jsx("button",{onClick:P,className:u("fixed z-[9999]",Ht[o],"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 A=C.x!==null?{left:`${C.x}px`,bottom:o.includes("bottom")?"1rem":void 0,top:o.includes("top")?"1rem":void 0,position:"fixed",transition:E?"none":"height 0.2s ease-in-out"}:{transition:"height 0.2s ease-in-out"},D=l.length>0||n.includes("custom");return e.jsxs("div",{ref:L,className:u(C.x!==null?"":`fixed ${Ht[o]}`,"z-[9999] font-mono text-xs",E&&"cursor-grabbing",h),style:{maxWidth:"320px",...A},children:[e.jsx(It,{isCollapsed:v,onToggleCollapse:I,onClose:U,onMouseDown:s?M:void 0,isDragging:E}),e.jsx("div",{className:u("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",v?"max-h-0 opacity-0":"max-h-[70vh] opacity-100 py-2 px-3"),children:e.jsxs("div",{className:"overflow-y-auto max-h-full space-y-3",children:[n.includes("webVitals")&&e.jsx(zt,{metrics:k}),n.includes("bundle")&&e.jsx("div",{className:"pt-3 border-t border-gray-700",children:e.jsx($t,{metrics:S})}),n.includes("api")&&w.callCount>0&&e.jsx("div",{className:"pt-3 border-t border-gray-700",children:e.jsx(Dt,{metrics:w})}),n.includes("memory")&&e.jsx("div",{className:"pt-3 border-t border-gray-700",children:e.jsx(Ft,{})}),D&&l.length>0&&e.jsx("div",{className:"pt-3 border-t border-gray-700",children:e.jsx(Ot,{title:i,metrics:l})}),e.jsx("div",{className:"pt-3 border-t border-gray-700",children:e.jsx(Tt,{})})]})})]})},H0=(t={})=>{const{successMessage:r="",successDuration:a=3e3,errorPrefix:o="",onSuccess:s,onError:n}=t,[l,i]=b.useState(!1),[g,c]=b.useState(""),[h,f]=b.useState(""),v=b.useCallback(()=>{c(""),f("")},[]),p=b.useCallback(()=>{c("")},[]),m=b.useCallback(()=>{f("")},[]),y=b.useCallback(async x=>{i(!0),v();try{await x(),r&&(c(r),a>0&&setTimeout(()=>{c("")},a)),s&&s()}catch(N){const k=N instanceof Error?N.message:"An error occurred";throw f(o?`${o}: ${k}`:k),n&&N instanceof Error&&n(N),N}finally{i(!1)}},[r,a,o,s,n,v]);return{isSubmitting:l,successMessage:g,errorMessage:h,submit:y,clearMessages:v,clearSuccess:p,clearError:m}},_0=(t=!1)=>{const[r,a]=b.useState(t),o=b.useCallback(()=>a(!0),[]),s=b.useCallback(()=>a(!1),[]),n=b.useCallback(()=>a(l=>!l),[]);return{value:r,setTrue:o,setFalse:s,toggle:n,setValue:a}},q0=(t={})=>{const{successDuration:r=2e3,onSuccess:a,onError:o}=t,[s,n]=b.useState(null),l=b.useCallback(async c=>{try{if(navigator.clipboard&&window.isSecureContext)await navigator.clipboard.writeText(c);else{const h=document.createElement("textarea");h.value=c,h.style.position="fixed",h.style.left="-999999px",h.style.top="-999999px",document.body.appendChild(h),h.focus(),h.select();const f=document.execCommand("copy");if(document.body.removeChild(h),!f)throw new Error("Copy command was unsuccessful")}return n(c),a?.(c),setTimeout(()=>{n(null)},r),!0}catch(h){const f=h instanceof Error?h:new Error("Copy failed");return o?.(f),!1}},[r,a,o]),i=b.useCallback(c=>s===c,[s]),g=b.useCallback(()=>{n(null)},[]);return{copiedValue:s,copyToClipboard:l,isCopied:i,resetCopiedState:g}},G0=(t={})=>{const{successDuration:r=2e3,onSuccess:a,onError:o}=t,[s,n]=b.useState({}),l=b.useCallback(async(c,h)=>{try{if(navigator.clipboard&&window.isSecureContext)await navigator.clipboard.writeText(c);else{const f=document.createElement("textarea");f.value=c,f.style.position="fixed",f.style.left="-999999px",f.style.top="-999999px",document.body.appendChild(f),f.focus(),f.select();const v=document.execCommand("copy");if(document.body.removeChild(f),!v)throw new Error("Copy command was unsuccessful")}return n(f=>({...f,[h]:!0})),a?.(c),setTimeout(()=>{n(f=>({...f,[h]:!1}))},r),!0}catch(f){const v=f instanceof Error?f:new Error("Copy failed");return o?.(v),!1}},[r,a,o]),i=b.useCallback(c=>s[c]||!1,[s]),g=b.useCallback(c=>{n(c?h=>({...h,[c]:!1}):{})},[]);return{copiedStates:s,copyToClipboard:l,isCopied:i,resetCopiedState:g}};function K0(){const t=H.useLocation(),r=b.useRef(null),a=b.useRef(0);b.useEffect(()=>{const o=t.pathname;if(!r.current){r.current=o,a.current=Date.now();return}const s=Date.now()-a.current;r.current!==o&&(Mt(r.current,o,s),r.current=o,a.current=Date.now())},[t])}function Y0({fields:t,validateOnChange:r=!1,validateOnBlur:a=!0}){const o=b.useMemo(()=>{const M={};for(const L in t)M[L]=t[L].initialValue;return M},[t]),[s,n]=b.useState(o),[l,i]=b.useState({}),[g,c]=b.useState({}),[h,f]=b.useState({}),v=b.useCallback(M=>{const L=t[M],I=s[M];if(L.required&&(I===""||I===null||I===void 0||Array.isArray(I)&&I.length===0))return L.requiredMessage||"This field is required";if(L.validate)for(const U of L.validate){const P=U(I);if(P)return P}},[t,s]),p=b.useCallback((M,L)=>{if(n(I=>({...I,[M]:L})),f(I=>({...I,[M]:!0})),r&&g[M]){const I=v(M);i(U=>({...U,[M]:I}))}},[r,g,v]),m=b.useCallback(M=>{n(I=>({...I,...M}));const L={};for(const I in M)L[I]=!0;f(I=>({...I,...L}))},[]),y=b.useCallback(M=>{if(c(L=>({...L,[M]:!0})),a){const L=v(M);i(I=>({...I,[M]:L}))}},[a,v]),x=b.useCallback(()=>{const M={},L={};let I=!0;for(const U in t){L[U]=!0;const P=v(U);P&&(M[U]=P,I=!1)}return c(L),i(M),I},[t,v]),N=b.useCallback(()=>{n(o),i({}),c({}),f({})},[o]),k=b.useCallback(M=>{n(L=>({...L,[M]:t[M].initialValue})),i(L=>{const I={...L};return delete I[M],I}),c(L=>{const I={...L};return delete I[M],I}),f(L=>{const I={...L};return delete I[M],I})},[t]),S=b.useCallback(M=>({value:s[M],onChange:L=>{p(M,L.target.value)},onBlur:()=>y(M),name:String(M),"aria-invalid":!!(g[M]&&l[M])}),[s,p,y,g,l]),w=b.useCallback(M=>g[M]?l[M]:void 0,[g,l]),C=b.useMemo(()=>{for(const M in t)if(v(M))return!1;return!0},[t,v]),E=b.useMemo(()=>Object.values(h).some(Boolean),[h]);return{values:s,errors:l,touched:g,dirty:h,isValid:C,isDirty:E,setValue:p,setValues:m,setTouched:y,validateField:v,validateAll:x,reset:N,resetField:k,getFieldProps:S,getFieldError:w}}const Q0=t=>{if(t===0)return"0 Bytes";const r=1024,a=["Bytes","KB","MB","GB","TB"],o=Math.floor(Math.log(t)/Math.log(r)),s=Math.min(o,a.length-1);return parseFloat((t/Math.pow(r,s)).toFixed(2))+" "+a[s]},X0=(t,r,a)=>{const o={bytes:0,kb:1,mb:2,gb:3,tb:4},s=1024,l=t*Math.pow(s,o[r])/Math.pow(s,o[a]);return Math.round(l*100)/100},J0=t=>{const r=t.match(/^(\d+(?:\.\d+)?)\s*(bytes?|kb|mb|gb|tb)$/i);if(!r)return null;const a=parseFloat(r[1]),o=r[2].toLowerCase(),n={bytes:1,byte:1,kb:1024,mb:1024*1024,gb:1024*1024*1024,tb:1024*1024*1024*1024}[o];return n?Math.round(a*n):null},Z0=t=>t,R0=t=>{if(typeof document>"u")return;const r=document.createElement("style");r.textContent=t,r.setAttribute("data-critical","true"),document.head.appendChild(r)},eg=t=>{if(typeof document>"u")return;const r=document.createElement("link");r.rel="preload",r.as="style",r.href=t,r.onload=()=>{r.rel="stylesheet"},document.head.appendChild(r);const a=document.createElement("noscript");a.innerHTML=`<link rel="stylesheet" href="${t}">`,document.head.appendChild(a)},rg=t=>{const r={};return Object.entries(t).forEach(([a,o])=>{r[`--${a}`]=typeof o=="number"?`${o}px`:o}),r},tg={xs:475,sm:640,md:768,lg:1024,xl:1280,"2xl":1536},ag=(t,r=tg)=>{const[a,o]=b.useState("base");return b.useEffect(()=>{const s=()=>{const n=window.innerWidth;n>=r["2xl"]?o("2xl"):n>=r.xl?o("xl"):n>=r.lg?o("lg"):n>=r.md?o("md"):n>=r.sm?o("sm"):n>=r.xs?o("xs"):o("base")};return s(),window.addEventListener("resize",s),()=>window.removeEventListener("resize",s)},[r]),t[a]||t.base||{}},_t=()=>typeof window>"u"?!1:window.matchMedia("(prefers-reduced-motion: reduce)").matches,og=()=>{const[t,r]=b.useState(_t);return b.useEffect(()=>{const a=window.matchMedia("(prefers-reduced-motion: reduce)"),o=()=>{r(a.matches)};return a.addEventListener?a.addEventListener("change",o):a.addListener(o),()=>{a.removeEventListener?a.removeEventListener("change",o):a.removeListener(o)}},[]),t},sg=(t,r=["layout","paint"])=>{t&&(t.style.contain=r.join(" "))},ng=(t,r)=>t?(t.style.willChange=r.join(", "),()=>{t.style.willChange="auto"}):void 0,lg=t=>{typeof window>"u"||requestAnimationFrame(()=>{t.forEach(r=>r())})},ig=(...t)=>t.filter(Boolean).join(" "),cg=t=>{const r={},a=["display","position","width","height","margin","padding","fontSize","fontFamily","color","backgroundColor"];return Object.entries(t).forEach(([o,s])=>{a.includes(o)&&(r[o]=s)}),r},dg=(t,r=[])=>{const[a,o]=b.useState(null),[s,n]=b.useState(!0);return b.useEffect(()=>{let l=!0;return t().then(i=>{l&&(o(i.default),n(!1))}),()=>{l=!1}},[t,...r]),{styles:a,loading:s}},gg=(t,r="1rem")=>({display:"grid",gridTemplateColumns:`repeat(${t}, minmax(0, 1fr))`,gap:r,contain:"layout",willChange:"transform"}),ug=(t="row",r="center",a="flex-start")=>({display:"flex",flexDirection:t,alignItems:r,justifyContent:a,contain:"layout"}),hg=t=>{const[r,a]=b.useState(!1);return b.useEffect(()=>{const o=window.matchMedia(t);a(o.matches);const s=()=>a(o.matches);return o.addEventListener?o.addEventListener("change",s):o.addListener(s),()=>{o.removeEventListener?o.removeEventListener("change",s):o.removeListener(s)}},[t]),r},fg=(t,r)=>{const[a,o]=b.useState("light");return b.useEffect(()=>{const s=window.matchMedia("(prefers-color-scheme: dark)");o(s.matches?"dark":"light");const n=()=>{o(s.matches?"dark":"light")};return s.addEventListener?s.addEventListener("change",n):s.addListener(n),()=>{s.removeEventListener?s.removeEventListener("change",n):s.removeListener(n)}},[]),a==="dark"?r:t},bg=t=>{const r={src:t.src,alt:t.alt,loading:t.loading||"lazy"};return t.title&&(r.title=t.title),t.width&&(r.width=t.width),t.height&&(r.height=t.height),t.sizes&&(r.sizes=t.sizes),t.srcSet&&(r.srcSet=t.srcSet),r.itemProp="image",r},mg=(t,r=[320,640,768,1024,1280,1920])=>r.map(a=>`${t.replace(/\{width\}/g,a.toString())} ${a}w`).join(", "),pg=t=>t.map(r=>r.maxWidth?`(max-width: ${r.maxWidth}px) ${r.size}`:r.size).join(", "),yg=(t,r="openGraph")=>{const a={};return r==="openGraph"?(a["og:image"]=t.url,t.width&&(a["og:image:width"]=t.width.toString()),t.height&&(a["og:image:height"]=t.height.toString()),t.alt&&(a["og:image:alt"]=t.alt),t.type&&(a["og:image:type"]=t.type)):(a["twitter:image"]=t.url,t.alt&&(a["twitter:image:alt"]=t.alt)),a},vg=(t='img[loading="lazy"]')=>{if(typeof window>"u"||!("IntersectionObserver"in window))return;const r=document.querySelectorAll(t);if("loading"in HTMLImageElement.prototype){r.forEach(o=>{o.dataset.src&&(o.src=o.dataset.src)});return}const a=new IntersectionObserver(o=>{o.forEach(s=>{if(s.isIntersecting){const n=s.target;n.dataset.src&&(n.src=n.dataset.src,n.removeAttribute("data-src")),n.dataset.srcset&&(n.srcset=n.dataset.srcset,n.removeAttribute("data-srcset")),a.unobserve(n)}})},{rootMargin:"50px 0px",threshold:.01});return r.forEach(o=>a.observe(o)),()=>{r.forEach(o=>a.unobserve(o))}},qt=()=>typeof window>"u"?Promise.resolve(!1):new Promise(t=>{const r=new Image;r.onload=r.onerror=function(){t(r.height===2)},r.src="data:image/webp;base64,UklGRjoAAABXRUJQVlA4IC4AAACyAgCdASoCAAIALmk0mk0iIiIiIgBoSygABc6WWgAA/veff/0PP8bA//LwYAAA"}),Gt=()=>typeof window>"u"?Promise.resolve(!1):new Promise(t=>{const r=new Image;r.onload=()=>t(!0),r.onerror=()=>t(!1),r.src="data:image/avif;base64,AAAAIGZ0eXBhdmlmAAAAAGF2aWZtaWYxbWlhZk1BMUIAAADybWV0YQAAAAAAAAAoaGRscgAAAAAAAAAAcGljdAAAAAAAAAAAAAAAAGxpYmF2aWYAAAAADnBpdG0AAAAAAAEAAAAeaWxvYwAAAABEAAABAAEAAAABAAABGgAAAB0AAAAoaWluZgAAAAAAAQAAABppbmZlAgAAAAABAABhdjAxQ29sb3IAAAAAamlwcnAAAABLaXBjbwAAABRpc3BlAAAAAAAAAAIAAAACAAAAEHBpeGkAAAAAAwgICAAAAAxhdjFDgQ0MAAAAABNjb2xybmNseAACAAIAAYAAAAAXaXBtYQAAAAAAAAABAAEEAQKDBAAAACVtZGF0EgAKCBgANogQEAwgMg8f8D///8WfhwB8+ErK42A="}),xg=async(t="jpg")=>{const[r,a]=await Promise.all([qt(),Gt()]);return a?"avif":r?"webp":t},kg=(t,r,a,o)=>`
66
65
  <picture>
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(`
66
+ ${t.map(n=>{const l=[`srcset="${n.srcSet}"`];return n.type&&l.push(`type="${n.type}"`),n.media&&l.push(`media="${n.media}"`),n.sizes&&l.push(`sizes="${n.sizes}"`),`<source ${l.join(" ")}>`}).join(`
68
67
  `)}
69
- <img src="${r}" alt="${a}"${n?` class="${n}"`:""} loading="lazy">
70
- </picture>`.trim(),ch=(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)},dh=(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)})}},gh=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!==""})})}),uh=(e,r,a="#e0e0e0")=>{const n=`
71
- <svg width="${e}" height="${r}" xmlns="http://www.w3.org/2000/svg">
68
+ <img src="${r}" alt="${a}"${o?` class="${o}"`:""} loading="lazy">
69
+ </picture>`.trim(),wg=(t,r="image")=>{if(typeof document>"u")return;const a=document.createElement("link");a.rel="preload",a.as=r,a.href=t,t.includes(".webp")?a.type="image/webp":t.includes(".avif")&&(a.type="image/avif"),document.head.appendChild(a)},Cg=(t,r,a)=>{if(typeof window>"u")return;const o=new Image;o.src=t,o.classList.add("progressive-image-placeholder"),a.appendChild(o);const s=new Image;s.src=r,s.classList.add("progressive-image-main"),s.style.opacity="0",s.onload=()=>{a.appendChild(s),requestAnimationFrame(()=>{s.style.transition="opacity 0.3s",s.style.opacity="1",setTimeout(()=>{o.remove()},300)})}},Ng=t=>new Promise(r=>{const a=performance.now();t.complete?r({loadTime:0,size:0,format:t.src.split(".").pop()||"unknown",dimensions:{width:t.naturalWidth,height:t.naturalHeight},isLazyLoaded:t.loading==="lazy",isOptimized:t.srcset!==""||t.sizes!==""}):t.addEventListener("load",()=>{const o=performance.now()-a;r({loadTime:o,size:0,format:t.src.split(".").pop()||"unknown",dimensions:{width:t.naturalWidth,height:t.naturalHeight},isLazyLoaded:t.loading==="lazy",isOptimized:t.srcset!==""||t.sizes!==""})})}),Sg=(t,r,a="#e0e0e0")=>{const o=`
70
+ <svg width="${t}" height="${r}" xmlns="http://www.w3.org/2000/svg">
72
71
  <rect width="100%" height="100%" fill="${a}"/>
73
72
  </svg>
74
- `;return`data:image/svg+xml;base64,${btoa(n)}`},hh=(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")},Le={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})},fh=e=>{const r={};return Object.entries(e).forEach(([a,n])=>{r[a]=()=>{try{return n()}catch{return Promise.resolve({default:null})}}}),r},on={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)||!on.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)})}},bh=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},Me={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=>{Le.isDevelopment&&Me.usageTracker.add(e)},getUsageReport:()=>Le.isDevelopment?Array.from(Me.usageTracker).sort():[],estimateImpact:e=>{const r=e.map(a=>Me.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}})}},sn={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))}}},mh=(e={})=>{const{features:r={},criticalCSS:a="",enableUsageTracking:n=Le.isDevelopment}=e;return{features:Le.createFeatureFlags(r),initialize:()=>{a&&typeof document<"u"&&sn.inlineCriticalCSS(a)},cleanup:()=>{Me.usageTracker.clear()},getReport:()=>({usage:Me.getUsageReport(),features:Le.createFeatureFlags(r)})}};let Qr;function yh(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 Qr||(Qr=yh()),Qr}function ph(){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 vh(){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 kh(){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 Ne={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:()=>{Ne.navigate("/mail")},goToPreferences:()=>{Ne.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();Ne.navigate(`/mail/compose${n?`?${n}`:""}`)},goToConnect:()=>{Ne.navigate("/connect")},goToDelegate:()=>{Ne.navigate("/admin/delegate")},goToHome:()=>{Ne.navigate("/")},canGoBack:()=>oe().canGoBack()};function wh(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 xh(e){let r=null;const a=()=>(r||(r=e()),r.then(()=>{}));return{Component:p.lazy(()=>r||e()),preload:a}}function Nh(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 ln(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 Ch=({children:e,fallback:r=t.jsx("div",{children:"Loading..."}),threshold:a=.01,rootMargin:n="50px",placeholder:o})=>{const s=p.useRef(null),l=ln(s,{threshold:a,rootMargin:n});return t.jsx("div",{ref:s,children:l?e:o||r})};function Sh(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 Eh(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 cn{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 Ah(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 Rr=(e=>(e[e.HIGH=0]="HIGH",e[e.MEDIUM=1]="MEDIUM",e[e.LOW=2]="LOW",e[e.IDLE=3]="IDLE",e))(Rr||{});class dn{constructor(){this.queues=new Map,this.isProcessing=!1,Object.values(Rr).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 Th=new cn,Ih=new dn;class et{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 Lh=new et,Mh=new et({prefix:"mailbox-theme"}),Ph=new et({prefix:"walletUser",ttl:10080*60*1e3}),Oh=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 gn(){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 Uh(){const e=gn();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 Dh(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 zh(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 jh(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 _h(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 Bh(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 Fh(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 un(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 Wh=un;function hn(e){return e.replace(/^\/[a-z]{2}(-[a-z]+)?(?=\/|$)/,"")}function Vh(e,r){const a=hn(e);return r?.[a]?r[a]:a.replace(/\//g,"_").replace(/^_/,"")||"home"}const $h={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 Hh(e,r){return{event:e,parameters:{...r,timestamp:r?.timestamp??Date.now()}}}const qh={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=vo,g.ActionButton=_s,g.AddressLink=cl,g.Alert=pr,g.AlertBanner=yo,g.AlertDescription=mo,g.AlertTitle=bo,g.AnimatedSection=or,g.ApiSection=Ka,g.AreaChart=rc,g.AspectFitView=C0,g.AspectRatio=In,g.AudioPlayer=Tc,g.Avatar=Gi,g.Backdrop=ml,g.Badge=Po,g.Banner=pl,g.BarChart=Qi,g.BatchRender=Md,g.Blockquote=ao,g.BodyText=Jn,g.BorderAccent=_n,g.Box=ot,g.Breadcrumb=na,g.BreadcrumbNav=ui,g.BreadcrumbSection=id,g.BundleSection=Ya,g.BurndownChart=dc,g.Button=ne,g.CACHE_CONFIGS=ba,g.CTASection=Jd,g.Calendar=Kt,g.CalloutBox=Hi,g.CancellableRequest=ag,g.Card=Pr,g.CardContent=Wi,g.CardFooter=Vi,g.CardHeader=Fi,g.Center=xn,g.ChainBadge=ls,g.Checkbox=ps,g.Code=eo,g.CodeBlock=cd,g.CodeDisplay=ro,g.CollapsibleDocumentationTopic=gd,g.ColorPicker=Vs,g.ColorPickerAdvanced=$s,g.ColorSwatch=Hs,g.Combobox=xs,g.Command=kl,g.CommonAnalyticsEvents=$h,g.ComponentPreloader=Kr,g.ConditionalRender=Td,g.Confetti=ti,g.ConfirmationDialog=Kc,g.Container=pn,g.ContentContainer=s0,g.CreditCardInput=Zs,g.CriticalPathOptimizer=Gg,g.CurrencyInput=Js,g.CustomSection=Qa,g.DashboardStatCard=qi,g.DataSkeleton=wo,g.DataTable=Ni,g.DateInput=fs,g.DateRangePicker=Fs,g.DateTimePicker=Bs,g.DetailErrorState=Wd,g.Dialog=Jt,g.Divider=zn,g.DragDrop=Zc,g.Drawer=_c,g.Dropdown=Cs,g.EditableSelector=Ns,g.EmptyState=ta,g.ErrorBoundary=yd,g.ExpensiveComponent=Ed,g.ExternalLink=li,g.FadeInScale=fl,g.FadeInUp=hl,g.FeatureBlock=El,g.FeatureCard=Hd,g.FeatureGrid=Xd,g.FileInput=Ts,g.Flex=yn,g.FloatingElement=bl,g.FloatingPanel=Bn,g.FocusTrap=Bc,g.FontSize=Br,g.Footer=i0,g.FooterBottom=h0,g.FooterBottomRow=f0,g.FooterBrand=d0,g.FooterCompact=b0,g.FooterCompactLeft=m0,g.FooterCompactRight=y0,g.FooterCopyright=v0,g.FooterGrid=c0,g.FooterLink=u0,g.FooterLinkSection=g0,g.FooterSocialLinks=k0,g.FooterVersion=p0,g.FormAlerts=zs,g.FormField=Ps,g.FormFieldGroup=nr,g.FormSection=Cl,g.FormattedNumber=lo,g.FullPageSpinner=ko,g.Gauge=hc,g.GlobalLazyErrorBoundary=wd,g.GradientIconContainer=Tl,g.Grid=vn,g.HStack=wn,g.Heading=qn,g.HelperText=no,g.HoverCard=Xc,g.IconContainer=Ul,g.IconText=Dl,g.Image=yc,g.ImageCropper=kc,g.ImageGallery=pc,g.InfiniteScroll=Fc,g.InfoBox=jl,g.InfoCard=$i,g.Input=Re,g.ItemList=zl,g.KYCLevelCard=a0,g.KYCStatusBadge=e0,g.Kbd=to,g.KeyValuePair=Xi,g.Label=Lr,g.LanguageSelector=bd,g.LanguageValidator=Dd,g.LayoutContext=zr,g.LayoutProvider=ia,g.LazyComponent=Id,g.LazyErrorBoundary=ir,g.LazyImage=pg,g.LazyLoadQueue=cn,g.LazyWalletButton=qg,g.LazyWrapper=Ch,g.Lightbox=wc,g.LineChart=Ri,g.Link=si,g.List=Li,g.ListItem=Mi,g.ListItemWithAction=Pi,g.LiveStream=Ac,g.LoadPriority=Rr,g.LoadingDots=go,g.LoadingOptimizer=Z0,g.LoadingOverlay=co,g.LoadingState=uo,g.LocalizedLink=Ud,g.Logo=Bl,g.Masonry=Hn,g.MasterDetailLayout=x0,g.MasterListItem=w0,g.MediaUploader=Oc,g.MemorySection=Ja,g.MentionInput=Ls,g.MetricRow=H,g.Modal=Or,g.ModalContent=Ur,g.ModalFooter=Dr,g.ModalHeader=jc,g.MultiSelect=ws,g.NavigationList=fi,g.NavigationMenu=hi,g.NetworkErrorBoundary=vd,g.NoContent=Ji,g.NotificationBadge=Lo,g.NotificationPanel=Mo,g.NumberInput=us,g.OptimizedAPIClient=rg,g.OptimizedImage=Pd,g.OptimizedRoutePreloader=J0,g.Overlay=Qe,g.PageContainer=Tn,g.PageHeader=o0,g.PageSectionHeader=Wl,g.PageTitle=Yn,g.Pagination=mi,g.PaginationNav=yi,g.PanelHeader=Wa,g.PerformanceBoundary=Ld,g.PerformanceOptimizer=X0,g.PerformancePanel=Iu,g.PhoneDirectory=js,g.PhoneInput=ys,g.PieChart=ec,g.PlatformSpecificComponents=Ig,g.PlaylistManager=Dc,g.PodcastPlayer=Pc,g.Popover=Wc,g.Portal=be,g.PreloadLink=gi,g.PriorityLoader=dn,g.Progress=fc,g.ProgressCircle=bc,g.PromotionalBanner=ud,g.ProtectedRoute=_d,g.PullToRefresh=sd,g.QRCodeDisplay=zc,g.QuickActions=$l,g.QuizBuilder=sl,g.RadioGroup=vs,g.RelativeTime=io,g.Resizable=Wn,g.RetinaImage=xc,g.RouteBasedLazyLoader=Yr,g.SafeAppWrapper=xd,g.ScoreIndicator=xu,g.ScoreLegend=Va,g.ScreenContainer=N0,g.ScrollArea=$n,g.ScrollSpy=Vc,g.SearchInput=hs,g.Section=En,g.SectionBadge=Gl,g.SectionHeader=Yl,g.SectionTitle=Xn,g.SecurityProvider=Nd,g.Select=Er,g.SelectContent=rr,g.SelectField=Ds,g.SelectGroup=ks,g.SelectItem=tr,g.SelectLabel=Ht,g.SelectScrollDownButton=Tr,g.SelectScrollUpButton=Ar,g.SelectSeparator=qt,g.SelectTrigger=er,g.SelectValue=$t,g.Separator=jn,g.SettingsList=Xl,g.Sheet=$c,g.SideNav=bi,g.SignaturePad=qs,g.SignatureRequest=Gs,g.SkeletonLoader=ho,g.Slider=Es,g.SliderInput=As,g.SmartContent=oi,g.SmartLink=Mr,g.SmartWalletProviders=$g,g.Spacer=Nn,g.Sparkline=lc,g.Spinner=Se,g.SplitPane=Fn,g.Stack=yr,g.StandardPageLayout=n0,g.StatCard=xl,g.StatDisplay=Zi,g.StatusBadge=ss,g.StatusIndicator=cs,g.StepList=md,g.Stepper=pi,g.StepperNav=vi,g.SubscriptionGatedComponents=Tg,g.SumsubWebSDK=r0,g.Switch=Vt,g.Table=xi,g.TableOfContents=wi,g.Tabs=Qt,g.TabsContent=ra,g.TabsList=Rt,g.TabsTrigger=ea,g.TagInput=Is,g.Text=st,g.TextArea=gs,g.TextAreaField=Us,g.TextField=Os,g.TextInputModal=Hc,g.TextLink=Rn,g.Theme=re,g.ThemeContext=Fr,g.ThemeProvider=$d,g.TimePicker=Wt,g.TimerDisplay=ei,g.Toast=lt,g.ToastContainer=Ao,g.ToastContext=vr,g.ToastNotification=Io,g.ToastProvider=No,g.ToggleGroup=Ss,g.Tooltip=aa,g.Topbar=A0,g.TopbarActions=$0,g.TopbarCenter=I0,g.TopbarContext=Vr,g.TopbarDivider=P0,g.TopbarIconButton=G0,g.TopbarLeft=T0,g.TopbarLogo=U0,g.TopbarMenuToggle=ha,g.TopbarMobileContent=M0,g.TopbarMobileNav=B0,g.TopbarNav=fa,g.TopbarNavigation=F0,g.TopbarProvider=ga,g.TopbarRight=L0,g.TopbarSearch=K0,g.TrackedButton=hd,g.TrackedLink=fd,g.TransferList=Ui,g.TreeView=zi,g.TruncatedText=so,g.UaudioUwaveform=Ic,g.UavatarUgroup=Yi,g.UbadgeUdesigner=Oo,g.UbubbleUchart=ac,g.UcellUeditor=Ti,g.UcodeUhighlighter=Xs,g.UcolumnUresize=Ai,g.UcurrencyUconverter=Qs,g.UcurrencyUrates=Rs,g.UdataUgrid=Ci,g.UdoubleUtap=ad,g.UdragUdropUlist=Jc,g.UfieldUmapper=nl,g.UfocusUindicator=Al,g.UformUbuilder=el,g.UformUtemplate=tl,g.UformUvalidator=rl,g.UfunnelUchart=cc,g.UgestureUdetector=ed,g.Uheatmap=ic,g.UimageUcomparison=vc,g.UkeyboardUshortcut=_l,g.UlistingUform=ji,g.UlongUpress=nd,g.UmarkdownUrenderer=Ks,g.UmediaUplaylist=Uc,g.UmetricUcomparison=uc,g.UmorphUtransition=Fl,g.UnestedUdrag=Rc,g.UparallaxUscroll=Vl,g.UperformanceUchart=gc,g.UpinchUzoom=td,g.UpivotUtable=Si,g.UprofileUheader=Ki,g.UprogressUtracker=mc,g.UradarUchart=tc,g.UradialUmenu=od,g.UresizableUpanels=Vn,g.UrevealUonUscroll=Hl,g.UsankeyUdiagram=sc,g.UscatterUplot=nc,g.UschemaUvalidator=al,g.UscreenUreaderUtext=oo,g.UskipUnavigation=Zl,g.UsortUdropdown=Jl,g.UsortableUgrid=Qc,g.UspreadsheetUgrid=Ei,g.UstatusUpipeline=ds,g.UsurveyUbuilder=ol,g.UswipeUactions=rd,g.UtableUreservation=Ii,g.UtimeUslotUpicker=Ws,g.UtreeUmap=oc,g.UuserUtable=Oi,g.UversionUbadge=Ql,g.UvideoUcall=Ec,g.UvideoUthumbnail=Cc,g.UvoiceUrecorder=Mc,g.VStack=kn,g.VideoEditor=Sc,g.VideoPlayer=Nc,g.VirtualList=Di,g.VirtualListItem=Ad,g.VisuallyHidden=Rl,g.WalletPreloader=Ye,g.WaveForm=Lc,g.WebVitalsSection=Ha,g.WysiwygEditor=Ys,g.addLanguageToPath=jr,g.addResourceHint=Ah,g.aiOptimizationPresets=Wg,g.appStorage=Lh,g.autoConnectWalletBrowser=Uh,g.batchDOMUpdates=Ku,g.bundleAnalysis=Me,g.buttonVariants=Yt,g.cacheHeaders=gg,g.cacheUtils=ng,g.checkPerformanceBudget=gu,g.clearComponentCache=vg,g.clearConditionalCache=Mg,g.clearPreloadCache=ii,g.clearRenderCounts=Qg,g.cn=f,g.conditionalCSS=ig,g.convertFileSize=ju,g.createAdvancedLazyComponent=bg,g.createAnalyticsEvent=Hh,g.createCSSVariables=Vu,g.createConditionalImports=fh,g.createConditionalLazyComponent=Ag,g.createFeature=Wr,g.createLazyComponent=Ca,g.createLazyComponentFactory=Rg,g.createLazyRoute=Sh,g.createLazyWalletProvider=Jr,g.createLibraryImports=Sg,g.createMemoComponent=Cd,g.createOptimizedStyles=Bu,g.createProgressiveComponent=Nh,g.createSecurityFeatures=Zd,g.createSelectiveExports=bh,g.createSelectiveMemoComponent=Sd,g.createSimpleStorage=Oh,g.createTreeShakingConfig=mh,g.createUIComponents=Cg,g.cspDirectives=cg,g.cssOptimization=sn,g.deadCodeElimination=Le,g.default=qh,g.defaultPerformanceBudget=Oa,g.detectAvailableWallets=Zr,g.detectWalletBrowser=gn,g.exportPerformanceData=uu,g.formatBytes=Ga,g.formatFileSize=zu,g.formatMetricValue=Cu,g.generateAIMetaTags=zg,g.generateAIStructuredData=_g,g.generateCSP=xa,g.generateCSPDirectives=qr,g.generateContentRelationships=jg,g.generateEntityRecognition=Ia,g.generateImageSEO=th,g.generatePerformanceTrackingSchema=Fg,g.generatePictureElement=ih,g.generatePlaceholder=uh,g.generateSemanticMarkup=Ta,g.generateSizes=nh,g.generateSocialImageMeta=oh,g.generateSrcSet=ah,g.generateTopicClustering=La,g.getConditionalStats=Pg,g.getEnvironmentType=ka,g.getErrorMessage=Fh,g.getLazyLoadingStats=kg,g.getOptimalImageFormat=lh,g.getPageName=Vh,g.getPerformanceMonitor=fr,g.getPreloadingStats=Dg,g.getRenderCounts=Jg,g.getSecurityHeaders=Na,g.getUINavigationService=oe,g.getWebVitalRating=xe,g.getWebVitals=au,g.hashString=un,g.hashUserId=Wh,g.initWebVitals=fu,g.initializeAdvancedPreloading=Ug,g.initializePerformanceMonitoring=iu,g.initializePreloading=Eg,g.inlineCriticalStyles=Zu,g.isAuthError=jh,g.isForbiddenError=_h,g.isLocalhost=pa,g.isNetworkAccess=va,g.isNotFoundError=Bh,g.isPreloaded=ci,g.isRateLimitError=zh,g.isServerError=Dh,g.isWalletBrowser=ya,g.isWebEnvironment=wa,g.lazyLoadQueue=Th,g.lazyWithPreload=xh,g.lazyWithRetry=wh,g.loadCSS=sg,g.loadCriticalCSS=Fu,g.loadNonCriticalCSS=Wu,g.measureAsyncOperation=du,g.measureCLS=Ua,g.measureFCP=Da,g.measureFID=ja,g.measureINP=Ba,g.measureImagePerformance=gh,g.measureLCP=za,g.measureTTFB=_a,g.navigationHelper=Ne,g.optimizeClassNames=Xu,g.optimizeContainment=Gu,g.optimizeFlex=Ru,g.optimizeGrid=Qu,g.optimizeWillChange=Yu,g.optimizedFetch=ma,g.parseFileSize=_u,g.performanceBudget=de,g.performanceUtils=gr,g.prefersReducedMotion=tn,g.prefetchResource=nu,g.preloadComponent=Ng,g.preloadImage=ch,g.preloadResource=ou,g.preloadRoute=ru,g.preserveAspectRatio=hh,g.priorityLoader=Ih,g.removeLanguageFromPath=_r,g.reportApiCall=mu,g.reportCustomMetric=bu,g.reportRouteChange=Fa,g.reportWebVitals=tu,g.routeConfig=Sa,g.securityHeaders=dg,g.setupCSPReporting=ug,g.setupLazyLoading=sh,g.setupProgressiveLoading=dh,g.shouldEnableWallet=og,g.smartLinkVariants=sr,g.stripLanguagePrefix=hn,g.supportsAVIF=nn,g.supportsCSSImports=lg,g.supportsWebP=an,g.themeStorage=Mh,g.useApiMetrics=Ra,g.useBanner=vl,g.useBundleMetrics=qa,g.useClickOutside=ar,g.useCodeLoader=ca,g.useComponentPerformance=Pa,g.useCopyToClipboard=Pu,g.useDebugMemo=Xg,g.useDraggable=en,g.useDynamicImport=Eh,g.useErrorRecovery=kd,g.useFormSubmission=Lu,g.useFormValidation=Du,g.useImageLazyLoading=eu,g.useLayout=ue,g.useLazyLoad=ln,g.useLazyStyles=Ju,g.useLocalizedNavigate=zd,g.useLocation=vh,g.useMediaQuery=eh,g.useMemoryLeakDetection=su,g.useMultipleCopyToClipboard=Ou,g.useNavigation=ph,g.useOptimizedTheme=rh,g.useOptimizedWallets=Hg,g.usePerformanceMark=Yg,g.useReducedMotion=qu,g.useRenderCount=Zg,g.useResponsiveStyles=Hu,g.useRoutePerformance=Uu,g.useSearchParams=kh,g.useSmartLinks=ai,g.useStableCallback=Kg,g.useTheme=Vd,g.useToast=To,g.useToggle=Mu,g.useTopbar=$r,g.useWebVitals=$a,g.utils=on,g.walletStorage=Ph,g.web3SecurityNotes=hg,g.withLazyErrorBoundary=pd,g.withPerformanceTracking=cu,g.withRetry=tg,Object.defineProperties(g,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})}));
73
+ `;return`data:image/svg+xml;base64,${btoa(o)}`},Lg=(t,r)=>{const a=1/r*100;t.style.position="relative",t.style.paddingTop=`${a}%`;const o=t.querySelector("img");o&&(o.style.position="absolute",o.style.top="0",o.style.left="0",o.style.width="100%",o.style.height="100%",o.style.objectFit="cover")},de={createPureFunction:t=>t,isDevelopment:process.env.NODE_ENV==="development",isProduction:process.env.NODE_ENV==="production",isTest:process.env.NODE_ENV==="test",createFeatureFlags:(t={})=>({enableAnalytics:process.env.VITE_ENABLE_ANALYTICS==="true",enableDebugTools:process.env.NODE_ENV==="development",enablePerformanceMonitoring:process.env.VITE_ENABLE_PERF_MONITORING!=="false",...t})},Eg=t=>{const r={};return Object.entries(t).forEach(([a,o])=>{r[a]=()=>{try{return o()}catch{return Promise.resolve({default:null})}}}),r},Kt={createDebounce:t=>r=>{let a;return((...o)=>{clearTimeout(a),a=setTimeout(()=>r(...o),t)})},memoize:t=>{const r=new Map;return((...a)=>{const o=JSON.stringify(a);if(r.has(o))return r.get(o);const s=t(...a);return r.set(o,s),s})},isDeepEqual:(t,r)=>{if(t===r)return!0;if(t==null||r==null||typeof t!="object"||typeof r!="object")return!1;const a=Object.keys(t),o=Object.keys(r);if(a.length!==o.length)return!1;for(const s of a)if(!o.includes(s)||!Kt.isDeepEqual(t[s],r[s]))return!1;return!0},createThrottle:t=>r=>{let a=0;return((...o)=>{const s=Date.now();if(s-a>=t)return a=s,r(...o)})}},Mg=t=>{const r={};return Object.entries(t).forEach(([a,o])=>{r[a]={},Object.entries(o).forEach(([s,n])=>{r[a][s]=()=>import(n).then(l=>({[s]:l[s]}))})}),r},ge={getModuleSize:t=>new Promise(r=>{if(typeof window<"u"&&"performance"in window){const o=performance.getEntriesByType("resource").find(s=>s.name.includes(t));r(o?.transferSize||0)}else r(0)}),usageTracker:new Set,trackUsage:t=>{de.isDevelopment&&ge.usageTracker.add(t)},getUsageReport:()=>de.isDevelopment?Array.from(ge.usageTracker).sort():[],estimateImpact:t=>{const r=t.map(a=>ge.getModuleSize(a).then(o=>[a,o]));return Promise.all(r).then(a=>{const o={};let s=0;return a.forEach(([n,l])=>{o[n]=l,s+=l}),{total:s,modules:o}})}},Yt={inlineCriticalCSS:t=>{if(typeof document<"u"){const r=document.createElement("style");r.textContent=t,document.head.appendChild(r)}},loadAsyncCSS:t=>{if(typeof document<"u"){const r=document.createElement("link");r.rel="stylesheet",r.href=t,r.media="print",r.onload=()=>{r.media="all"},document.head.appendChild(r)}},removeUnusedCSS:t=>{if(typeof document>"u")return;const r=new Set;return t.forEach(a=>{try{document.querySelector(a)&&r.add(a)}catch{}}),{used:Array.from(r),unused:t.filter(a=>!r.has(a))}}},Ig=(t={})=>{const{features:r={},criticalCSS:a="",enableUsageTracking:o=de.isDevelopment}=t;return{features:de.createFeatureFlags(r),initialize:()=>{a&&typeof document<"u"&&Yt.inlineCriticalCSS(a)},cleanup:()=>{ge.usageTracker.clear()},getReport:()=>({usage:ge.getUsageReport(),features:de.createFeatureFlags(r)})}};let xr;function Tg(t){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 K(t){return xr||(xr=Tg()),xr}function Pg(){const t=K(),r=t.getCurrentState();return{navigate:(a,o)=>{t.navigate(a,o)},goBack:a=>{t.goBack(a)},replace:(a,o)=>{t.replace(a,o)},currentPath:r.currentPath,searchParams:r.searchParams,params:r.params,canGoBack:t.canGoBack(),isSupported:t.isSupported()}}function zg(){const r=K().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 Ug(){const t=K(),r=t.getCurrentState();return[new URLSearchParams(r.searchParams),s=>{const n=s instanceof URLSearchParams?Object.fromEntries(s.entries()):s,l=new URLSearchParams(n).toString(),i=r.currentPath+(l?`?${l}`:"");t.replace(i)}]}const ne={navigate:(t,r)=>{K().navigate(t,r)},goBack:t=>{K().goBack(t)},replace:(t,r)=>{K().replace(t,r)},getCurrentPath:()=>K().getCurrentPath(),getSearchParams:()=>K().getSearchParams(),goToMail:()=>{ne.navigate("/mail")},goToPreferences:()=>{ne.navigate("/preferences")},goToCompose:(t,r)=>{const a=new URLSearchParams;t&&a.set("type",t),r&&Object.entries(r).forEach(([s,n])=>{a.set(s,n)});const o=a.toString();ne.navigate(`/mail/compose${o?`?${o}`:""}`)},goToConnect:()=>{ne.navigate("/connect")},goToDelegate:()=>{ne.navigate("/admin/delegate")},goToHome:()=>{ne.navigate("/")},canGoBack:()=>K().canGoBack()};function Ag(t,r=3,a=1e3){return b.lazy(()=>new Promise((o,s)=>{const n=l=>{t().then(o).catch(i=>{l>0?setTimeout(()=>{n(l-1)},a):s(i)})};n(r)}))}function $g(t){let r=null;const a=()=>(r||(r=t()),r.then(()=>{}));return{Component:b.lazy(()=>r||t()),preload:a}}function Dg(t,r={}){const{fallback:a=e.jsx("div",{children:"Loading..."}),errorFallback:o=e.jsx("div",{children:"Failed to load component"}),loadingDelay:s=200,minimumLoadingTime:n=500}=r,l=b.lazy(async()=>{const g=Date.now();try{const c=await t(),h=Date.now()-g;return h<n&&await new Promise(f=>setTimeout(f,n-h)),c}catch{return{default:(()=>o)}}}),i=()=>{const[g,c]=b.useState(!1);return b.useEffect(()=>{const h=setTimeout(()=>{c(!0)},s);return()=>clearTimeout(h)},[]),g?e.jsx(e.Fragment,{children:a}):null};return b.forwardRef((g,c)=>e.jsx(b.Suspense,{fallback:e.jsx(i,{}),children:e.jsx(l,{...g,ref:c})}))}function Qt(t,r={}){const[a,o]=b.useState(!1),[s,n]=b.useState(!1);return b.useEffect(()=>{const l=t.current;if(!l||s)return;const i=new IntersectionObserver(([g])=>{g.isIntersecting&&(o(!0),n(!0),i.disconnect())},{rootMargin:"50px",threshold:.01,...r});return i.observe(l),()=>{i.disconnect()}},[t,r,s]),a}const Bg=({children:t,fallback:r=e.jsx("div",{children:"Loading..."}),threshold:a=.01,rootMargin:o="50px",placeholder:s})=>{const n=b.useRef(null),l=Qt(n,{threshold:a,rootMargin:o});return e.jsx("div",{ref:n,children:l?t:s||r})};function jg(t){const{importFn:r,preloadOnHover:a=!0,preloadOnFocus:o=!0,prefetchDelay:s=50}=t;let n=null,l=null;const i=()=>(l||(l=r()),l),g=()=>{n&&clearTimeout(n),n=setTimeout(()=>{i()},s)};return{Component:b.lazy(()=>l||r()),preload:i,linkProps:{...a&&{onMouseEnter:g,onMouseLeave:()=>{n&&clearTimeout(n)}},...o&&{onFocus:g}}}}function Fg(t,r=[]){const[a,o]=b.useState(null),[s,n]=b.useState(!0),[l,i]=b.useState(null);return b.useEffect(()=>{let g=!0;return n(!0),i(null),t().then(c=>{g&&(o(c),n(!1))}).catch(c=>{g&&(i(c),n(!1))}),()=>{g=!1}},[t,...r]),{module:a,loading:s,error:l}}class Xt{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 Og(t,r,a){if(typeof document>"u")return;const o=document.createElement("link");o.rel=r,o.href=t,a&&(r==="preload"||r==="prefetch")&&(o.as=a),document.head.appendChild(o)}var kr=(t=>(t[t.HIGH=0]="HIGH",t[t.MEDIUM=1]="MEDIUM",t[t.LOW=2]="LOW",t[t.IDLE=3]="IDLE",t))(kr||{});class Jt{constructor(){this.queues=new Map,this.isProcessing=!1,Object.values(kr).filter(r=>typeof r=="number").forEach(r=>{this.queues.set(r,[])})}load(r,a=1){const o=this.queues.get(a);o&&o.push(r),this.process()}async process(){if(!this.isProcessing){this.isProcessing=!0;for(const[r,a]of this.queues)for(;a.length>0;){const o=a.shift();if(o)try{await o()}catch{}r>=2&&await new Promise(s=>setTimeout(s,50))}this.isProcessing=!1}}}const Vg=new Xt,Wg=new Jt;class wr{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,o)=>{r.set(a,o)},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,o){try{const s={value:a,timestamp:Date.now(),ttl:o||this.defaultTTL};this.platformStorage.setItem(this.getKey(r),JSON.stringify(s))}catch{}}get(r,a){try{const o=this.platformStorage.getItem(this.getKey(r));if(!o)return a;const s=JSON.parse(o);return this.isExpired(s)?(this.remove(r),a):s.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(),o=this.getKey(r||""),s=a.filter(n=>n.startsWith(o));for(const n of s)this.platformStorage.removeItem(n)}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(o=>o.startsWith(a)).map(o=>o.substring(a.length))}return[]}catch(r){return console.error("Failed to get all keys:",r),[]}}}const Hg=new wr,_g=new wr({prefix:"mailbox-theme"}),qg=new wr({prefix:"walletUser",ttl:10080*60*1e3}),Gg=t=>{if(!t)throw new Error("PlatformStorage must be provided to createSimpleStorage");return{setItem:(r,a)=>{try{t.setItem(r,a)}catch{}},getItem:r=>{try{return t.getItem(r)}catch{return null}},removeItem:r=>{try{t.removeItem(r)}catch{}}}};function Zt(){const t={isWalletBrowser:!1,walletType:"unknown",hasEthereum:!1,hasSolana:!1,provider:null};if(typeof window>"u")return t;try{const r=navigator.userAgent.toLowerCase();let a="unknown",o=!1;r.includes("metamask")?(a="metamask",o=!0):r.includes("trustwallet")?(a="trustwallet",o=!0):r.includes("coinbase")?(a="coinbase",o=!0):r.includes("rainbow")?(a="rainbow",o=!0):r.includes("phantom")?(a="phantom",o=!0):r.includes("solflare")?(a="solflare",o=!0):r.includes("exodus")&&(a="exodus",o=!0);const s=!!window.ethereum,n=!!window.solana||!!window.phantom?.solana;(s||n)&&!o&&(o=!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=s?window.ethereum:n?window.solana||window.phantom?.solana:null;return{isWalletBrowser:o,walletType:a,hasEthereum:s,hasSolana:n,provider:l}}catch{return t}}async function Kg(){const t=Zt();if(!t.isWalletBrowser)return{success:!1,error:"Not running in a wallet browser"};try{if(t.hasEthereum&&t.provider)try{const r=await t.provider.request({method:"eth_requestAccounts"});if(r&&r.length>0)return{success:!0,address:r[0]}}catch{}if(t.hasSolana&&t.provider)try{const r=await t.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 Yg(t){if(!t)return!1;if(t instanceof Error){const r=t.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 t=="string"){const r=t.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 t=="object"&&t!==null&&"status"in t){const r=t.status;if(typeof r=="number"&&r>=500&&r<600)return!0}return!1}function Qg(t){if(!t)return!1;if(typeof t=="string"){const r=t.toLowerCase();return r.includes("429")||r.includes("rate limit")||r.includes("too many requests")||r.includes("rate_limit")}if(t instanceof Error){const r=t.message.toLowerCase();return r.includes("429")||r.includes("rate limit")||r.includes("too many requests")||r.includes("rate_limit")}return typeof t=="object"&&t!==null&&"status"in t?t.status===429:!1}function Xg(t){if(!t)return!1;if(typeof t=="string"){const r=t.toLowerCase();return r.includes("401")||r.includes("unauthorized")||r.includes("unauthenticated")}if(t instanceof Error){const r=t.message.toLowerCase();return r.includes("401")||r.includes("unauthorized")||r.includes("unauthenticated")}return typeof t=="object"&&t!==null&&"status"in t?t.status===401:!1}function Jg(t){if(!t)return!1;if(typeof t=="string"){const r=t.toLowerCase();return r.includes("403")||r.includes("forbidden")}if(t instanceof Error){const r=t.message.toLowerCase();return r.includes("403")||r.includes("forbidden")}return typeof t=="object"&&t!==null&&"status"in t?t.status===403:!1}function Zg(t){if(!t)return!1;if(typeof t=="string"){const r=t.toLowerCase();return r.includes("404")||r.includes("not found")}if(t instanceof Error){const r=t.message.toLowerCase();return r.includes("404")||r.includes("not found")}return typeof t=="object"&&t!==null&&"status"in t?t.status===404:!1}function Rg(t,r="An unexpected error occurred"){return t?typeof t=="string"?t:t instanceof Error||typeof t=="object"&&t!==null&&"message"in t&&typeof t.message=="string"?t.message:r:r}async function Rt(t){const a=new TextEncoder().encode(t.toLowerCase()),o=await crypto.subtle.digest("SHA-256",a);return Array.from(new Uint8Array(o)).map(n=>n.toString(16).padStart(2,"0")).join("")}const eu=Rt;function ea(t){return t.replace(/^\/[a-z]{2}(-[a-z]+)?(?=\/|$)/,"")}function ru(t,r){const a=ea(t);return r?.[a]?r[a]:a.replace(/\//g,"_").replace(/^_/,"")||"home"}const tu={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 au(t,r){return{event:t,parameters:{...r,timestamp:r?.timestamp??Date.now()}}}const ou={utils:{cn:u}};Object.defineProperty(d,"ArrowLeftIcon",{enumerable:!0,get:()=>z.ArrowLeftIcon}),Object.defineProperty(d,"ArrowRightIcon",{enumerable:!0,get:()=>z.ArrowRightIcon}),Object.defineProperty(d,"Bars3Icon",{enumerable:!0,get:()=>z.Bars3Icon}),Object.defineProperty(d,"BellIcon",{enumerable:!0,get:()=>z.BellIcon}),Object.defineProperty(d,"BellSlashIcon",{enumerable:!0,get:()=>z.BellSlashIcon}),Object.defineProperty(d,"ChartBarIcon",{enumerable:!0,get:()=>z.ChartBarIcon}),Object.defineProperty(d,"CheckCircleIcon",{enumerable:!0,get:()=>z.CheckCircleIcon}),Object.defineProperty(d,"CheckIcon",{enumerable:!0,get:()=>z.CheckIcon}),Object.defineProperty(d,"ChevronDownIcon",{enumerable:!0,get:()=>z.ChevronDownIcon}),Object.defineProperty(d,"ChevronLeftIcon",{enumerable:!0,get:()=>z.ChevronLeftIcon}),Object.defineProperty(d,"ChevronRightIcon",{enumerable:!0,get:()=>z.ChevronRightIcon}),Object.defineProperty(d,"ChevronUpIcon",{enumerable:!0,get:()=>z.ChevronUpIcon}),Object.defineProperty(d,"ClockIcon",{enumerable:!0,get:()=>z.ClockIcon}),Object.defineProperty(d,"CodeBracketIcon",{enumerable:!0,get:()=>z.CodeBracketIcon}),Object.defineProperty(d,"Cog6ToothIcon",{enumerable:!0,get:()=>z.Cog6ToothIcon}),Object.defineProperty(d,"CreditCardIcon",{enumerable:!0,get:()=>z.CreditCardIcon}),Object.defineProperty(d,"DocumentTextIcon",{enumerable:!0,get:()=>z.DocumentTextIcon}),Object.defineProperty(d,"EnvelopeIcon",{enumerable:!0,get:()=>z.EnvelopeIcon}),Object.defineProperty(d,"ExclamationTriangleIcon",{enumerable:!0,get:()=>z.ExclamationTriangleIcon}),Object.defineProperty(d,"EyeSlashIcon",{enumerable:!0,get:()=>z.EyeSlashIcon}),Object.defineProperty(d,"GlobeAltIcon",{enumerable:!0,get:()=>z.GlobeAltIcon}),Object.defineProperty(d,"HomeIcon",{enumerable:!0,get:()=>z.HomeIcon}),Object.defineProperty(d,"InboxIcon",{enumerable:!0,get:()=>z.InboxIcon}),Object.defineProperty(d,"InformationCircleIcon",{enumerable:!0,get:()=>z.InformationCircleIcon}),Object.defineProperty(d,"KeyIcon",{enumerable:!0,get:()=>z.KeyIcon}),Object.defineProperty(d,"MegaphoneIcon",{enumerable:!0,get:()=>z.MegaphoneIcon}),Object.defineProperty(d,"MinusIcon",{enumerable:!0,get:()=>z.MinusIcon}),Object.defineProperty(d,"PaperAirplaneIcon",{enumerable:!0,get:()=>z.PaperAirplaneIcon}),Object.defineProperty(d,"PaperClipIcon",{enumerable:!0,get:()=>z.PaperClipIcon}),Object.defineProperty(d,"PlusIcon",{enumerable:!0,get:()=>z.PlusIcon}),Object.defineProperty(d,"RocketLaunchIcon",{enumerable:!0,get:()=>z.RocketLaunchIcon}),Object.defineProperty(d,"ShieldCheckIcon",{enumerable:!0,get:()=>z.ShieldCheckIcon}),Object.defineProperty(d,"SparklesIcon",{enumerable:!0,get:()=>z.SparklesIcon}),Object.defineProperty(d,"StarIcon",{enumerable:!0,get:()=>z.StarIcon}),Object.defineProperty(d,"TrashIcon",{enumerable:!0,get:()=>z.TrashIcon}),Object.defineProperty(d,"UserGroupIcon",{enumerable:!0,get:()=>z.UserGroupIcon}),Object.defineProperty(d,"XMarkIcon",{enumerable:!0,get:()=>z.XMarkIcon}),Object.defineProperty(d,"CheckCircleIconSolid",{enumerable:!0,get:()=>ee.CheckCircleIcon}),Object.defineProperty(d,"CheckIconSolid",{enumerable:!0,get:()=>ee.CheckIcon}),Object.defineProperty(d,"ExclamationTriangleIconSolid",{enumerable:!0,get:()=>ee.ExclamationTriangleIcon}),Object.defineProperty(d,"StarIconSolid",{enumerable:!0,get:()=>ee.StarIcon}),d.ActionBanner=Ra,d.ActionButton=Qo,d.AddressLink=xs,d.Alert=qe,d.AlertBanner=Ja,d.AlertDescription=Xa,d.AlertTitle=Qa,d.AnimatedSection=ze,d.ApiSection=Dt,d.AreaChart=hl,d.AspectFitView=Bc,d.AspectRatio=ma,d.AudioPlayer=Ol,d.Avatar=ol,d.Backdrop=Es,d.Badge=ho,d.Banner=Is,d.BarChart=dl,d.BatchRender=_i,d.Blockquote=ja,d.BodyText=za,d.BorderAccent=va,d.Box=Er,d.Breadcrumb=xi,d.BreadcrumbNav=Nn,d.BreadcrumbSection=ki,d.BundleSection=$t,d.BurndownChart=wl,d.Button=G,d.CACHE_CONFIGS=at,d.CTASection=dc,d.Calendar=Br,d.CalloutBox=tl,d.CancellableRequest=md,d.Card=Re,d.CardContent=Rn,d.CardFooter=el,d.CardHeader=Zn,d.Center=ca,d.ChainBadge=yo,d.Checkbox=Io,d.Code=$a,d.CodeBlock=wi,d.CodeDisplay=Da,d.CollapsibleDocumentationTopic=Ni,d.ColorPicker=Ro,d.ColorPickerAdvanced=es,d.ColorSwatch=rs,d.Combobox=Uo,d.Command=Ps,d.CommonAnalyticsEvents=tu,d.ComponentPreloader=mr,d.ConditionalRender=Vi,d.Confetti=fn,d.ConfirmationDialog=ni,d.Container=sa,d.ContentContainer=vc,d.CreditCardInput=ls,d.CriticalPathOptimizer=s0,d.CurrencyInput=is,d.CustomSection=Ot,d.DashboardStatCard=al,d.DataSkeleton=ro,d.DataTable=$n,d.DateInput=So,d.DateRangePicker=Jo,d.DateTimePicker=Xo,d.DetailErrorState=ec,d.Dialog=Or,d.Divider=pa,d.DragDrop=ii,d.Drawer=Xl,d.Dropdown=$o,d.EditableSelector=Ao,d.EmptyState=qr,d.ErrorBoundary=Ti,d.ExpensiveComponent=Fi,d.ExternalLink=vn,d.FadeInScale=Ss,d.FadeInUp=Ns,d.FeatureBlock=Bs,d.FeatureCard=ac,d.FeatureGrid=ic,d.FileInput=Fo,d.Flex=oa,d.FloatingElement=Ls,d.FloatingPanel=xa,d.FocusTrap=Jl,d.FontSize=lr,d.Footer=kc,d.FooterBottom=Lc,d.FooterBottomRow=Ec,d.FooterBrand=Cc,d.FooterCompact=Mc,d.FooterCompactLeft=Ic,d.FooterCompactRight=Tc,d.FooterCopyright=zc,d.FooterGrid=wc,d.FooterLink=Sc,d.FooterLinkSection=Nc,d.FooterSocialLinks=Uc,d.FooterVersion=Pc,d.FormAlerts=Ko,d.FormField=Ho,d.FormFieldGroup=Pe,d.FormSection=$s,d.FormattedNumber=Wa,d.FullPageSpinner=eo,d.Gauge=Sl,d.GlobalLazyErrorBoundary=Ai,d.GradientIconContainer=Fs,d.Grid=na,d.HStack=ia,d.Heading=La,d.HelperText=Fa,d.HoverCard=li,d.IconContainer=qs,d.IconText=Gs,d.Image=Il,d.ImageCropper=zl,d.ImageGallery=Tl,d.InfiniteScroll=Zl,d.InfoBox=Ys,d.InfoCard=rl,d.Input=Le,d.ItemList=Ks,d.KYCLevelCard=mc,d.KYCStatusBadge=hc,d.Kbd=Ba,d.KeyValuePair=ll,d.Label=Je,d.LanguageSelector=Mi,d.LanguageValidator=Yi,d.LayoutContext=or,d.LayoutProvider=Xr,d.LazyComponent=Wi,d.LazyErrorBoundary=$e,d.LazyImage=Pd,d.LazyLoadQueue=Xt,d.LazyWalletButton=o0,d.LazyWrapper=Bg,d.Lightbox=Ul,d.LineChart=gl,d.Link=yn,d.List=Wn,d.ListItem=Hn,d.ListItemWithAction=_n,d.LiveStream=Fl,d.LoadPriority=kr,d.LoadingDots=qa,d.LoadingOptimizer=cd,d.LoadingOverlay=_a,d.LoadingState=Ga,d.LocalizedLink=Ki,d.Logo=Xs,d.Masonry=Sa,d.MasterDetailLayout=$c,d.MasterListItem=Ac,d.MediaUploader=ql,d.MemorySection=Ft,d.MentionInput=Vo,d.MetricRow=O,d.Modal=er,d.ModalContent=rr,d.ModalFooter=tr,d.ModalHeader=Ql,d.MultiSelect=zo,d.NavigationList=Ln,d.NavigationMenu=Sn,d.NetworkErrorBoundary=zi,d.NoContent=cl,d.NotificationBadge=go,d.NotificationPanel=uo,d.NumberInput=Co,d.OptimizedAPIClient=fd,d.OptimizedImage=qi,d.OptimizedRoutePreloader=dd,d.Overlay=Se,d.PageContainer=ba,d.PageHeader=yc,d.PageSectionHeader=Zs,d.PageTitle=Ma,d.Pagination=Mn,d.PaginationNav=In,d.PanelHeader=It,d.PerformanceBoundary=Hi,d.PerformanceOptimizer=id,d.PerformancePanel=W0,d.PhoneDirectory=Yo,d.PhoneInput=Mo,d.PieChart=ul,d.PlatformSpecificComponents=Wd,d.PlaylistManager=Kl,d.PodcastPlayer=_l,d.Popover=Rl,d.Portal=te,d.PreloadLink=Cn,d.PriorityLoader=Jt,d.Progress=Ll,d.ProgressCircle=El,d.PromotionalBanner=Si,d.ProtectedRoute=Ji,d.PullToRefresh=yi,d.QRCodeDisplay=Yl,d.QuickActions=en,d.QuizBuilder=ps,d.RadioGroup=To,d.RelativeTime=Ha,d.Resizable=wa,d.RetinaImage=Al,d.RouteBasedLazyLoader=br,d.RouterBreadcrumb=ar,d.SafeAppWrapper=$i,d.ScoreIndicator=$0,d.ScoreLegend=Tt,d.ScreenContainer=Dc,d.ScrollArea=Na,d.ScrollSpy=ei,d.SearchInput=No,d.Section=ha,d.SectionBadge=an,d.SectionHeader=on,d.SectionTitle=Ta,d.SecurityProvider=Di,d.Select=Ke,d.SelectContent=Me,d.SelectField=Go,d.SelectGroup=Po,d.SelectItem=Ie,d.SelectLabel=Ur,d.SelectScrollDownButton=Qe,d.SelectScrollUpButton=Ye,d.SelectSeparator=Ar,d.SelectTrigger=Ee,d.SelectValue=zr,d.Separator=ya,d.SettingsList=nn,d.Sheet=ri,d.SideNav=En,d.SignaturePad=ts,d.SignatureRequest=as,d.SkeletonLoader=Ka,d.Slider=Bo,d.SliderInput=jo,d.SmartContent=pn,d.SmartLink=Ze,d.SmartWalletProviders=t0,d.Spacer=da,d.Sparkline=vl,d.Spinner=le,d.SplitPane=ka,d.Stack=_e,d.StandardPageLayout=pc,d.StatCard=Us,d.StatDisplay=il,d.StatusBadge=po,d.StatusIndicator=xo,d.StepList=Ii,d.Stepper=Tn,d.StepperNav=Pn,d.SubscriptionGatedComponents=Vd,d.SumsubWebSDK=fc,d.Switch=Pr,d.Table=An,d.TableOfContents=Un,d.Tabs=Vr,d.TabsContent=_r,d.TabsList=Wr,d.TabsTrigger=Hr,d.TagInput=Oo,d.Text=Mr,d.TextArea=wo,d.TextAreaField=qo,d.TextField=_o,d.TextInputModal=ti,d.TextLink=Aa,d.Theme=q,d.ThemeContext=ir,d.ThemeProvider=tc,d.TimePicker=Tr,d.TimerDisplay=un,d.Toast=Ir,d.ToastContainer=lo,d.ToastContext=Ge,d.ToastNotification=co,d.ToastProvider=ao,d.ToggleGroup=Do,d.Tooltip=Gr,d.Topbar=Oc,d.TopbarActions=td,d.TopbarCenter=Wc,d.TopbarContext=dr,d.TopbarDivider=qc,d.TopbarIconButton=sd,d.TopbarLeft=Vc,d.TopbarLogo=Kc,d.TopbarMenuToggle=rt,d.TopbarMobileContent=_c,d.TopbarMobileNav=Zc,d.TopbarNav=tt,d.TopbarNavigation=Rc,d.TopbarProvider=Rr,d.TopbarRight=Hc,d.TopbarSearch=ld,d.TrackedButton=Li,d.TrackedLink=Ei,d.TransferList=Gn,d.TreeView=Yn,d.TruncatedText=Va,d.UaudioUwaveform=Vl,d.UavatarUgroup=sl,d.UbadgeUdesigner=fo,d.UbubbleUchart=bl,d.UcellUeditor=On,d.UcodeUhighlighter=ns,d.UcolumnUresize=Fn,d.UcurrencyUconverter=cs,d.UcurrencyUrates=ds,d.UdataUgrid=Dn,d.UdoubleUtap=bi,d.UdragUdropUlist=ci,d.UfieldUmapper=bs,d.UfocusUindicator=js,d.UformUbuilder=gs,d.UformUtemplate=hs,d.UformUvalidator=us,d.UfunnelUchart=kl,d.UgestureUdetector=ui,d.Uheatmap=xl,d.UimageUcomparison=Pl,d.UkeyboardUshortcut=Qs,d.UlistingUform=Qn,d.UlongUpress=mi,d.UmarkdownUrenderer=ss,d.UmediaUplaylist=Gl,d.UmetricUcomparison=Nl,d.UmorphUtransition=Js,d.UnestedUdrag=gi,d.UparallaxUscroll=Rs,d.UperformanceUchart=Cl,d.UpinchUzoom=fi,d.UpivotUtable=Bn,d.UprofileUheader=nl,d.UprogressUtracker=Ml,d.UradarUchart=fl,d.UradialUmenu=pi,d.UresizableUpanels=Ca,d.UrevealUonUscroll=rn,d.UsankeyUdiagram=yl,d.UscatterUplot=ml,d.UschemaUvalidator=fs,d.UscreenUreaderUtext=Oa,d.UskipUnavigation=ln,d.UsortUdropdown=cn,d.UsortableUgrid=di,d.UspreadsheetUgrid=jn,d.UstatusUpipeline=ko,d.UsurveyUbuilder=ms,d.UswipeUactions=hi,d.UtableUreservation=Vn,d.UtimeUslotUpicker=Zo,d.UtreeUmap=pl,d.UuserUtable=qn,d.UversionUbadge=dn,d.UvideoUcall=jl,d.UvideoUthumbnail=Dl,d.UvoiceUrecorder=Hl,d.VStack=la,d.VideoEditor=Bl,d.VideoPlayer=$l,d.VirtualList=Kn,d.VirtualListItem=Oi,d.VisuallyHidden=gn,d.WalletPreloader=xe,d.WaveForm=Wl,d.WebVitalsSection=zt,d.WysiwygEditor=os,d.addLanguageToPath=sr,d.addResourceHint=Og,d.aiOptimizationPresets=e0,d.appStorage=Hg,d.autoConnectWalletBrowser=Kg,d.batchDOMUpdates=lg,d.bundleAnalysis=ge,d.buttonVariants=Dr,d.cacheHeaders=Nd,d.cacheUtils=pd,d.checkPerformanceBudget=N0,d.clearComponentCache=zd,d.clearConditionalCache=_d,d.clearPreloadCache=xn,d.clearRenderCounts=g0,d.cn=u,d.conditionalCSS=kd,d.convertFileSize=X0,d.createAdvancedLazyComponent=Md,d.createAnalyticsEvent=au,d.createCSSVariables=rg,d.createConditionalImports=Eg,d.createConditionalLazyComponent=Od,d.createFeature=cr,d.createLazyComponent=ut,d.createLazyComponentFactory=u0,d.createLazyRoute=jg,d.createLazyWalletProvider=vr,d.createLibraryImports=jd,d.createMemoComponent=Bi,d.createOptimizedStyles=Z0,d.createProgressiveComponent=Dg,d.createSecurityFeatures=cc,d.createSelectiveExports=Mg,d.createSelectiveMemoComponent=ji,d.createSimpleStorage=Gg,d.createTreeShakingConfig=Ig,d.createUIComponents=Bd,d.cspDirectives=wd,d.cssOptimization=Yt,d.deadCodeElimination=de,d.default=ou,d.defaultPerformanceBudget=kt,d.detectAvailableWallets=yr,d.detectWalletBrowser=Zt,d.exportPerformanceData=S0,d.formatBytes=At,d.formatFileSize=Q0,d.formatMetricValue=B0,d.generateAIMetaTags=Qd,d.generateAIStructuredData=Jd,d.generateCSP=dt,d.generateCSPDirectives=hr,d.generateContentRelationships=Xd,d.generateEntityRecognition=pt,d.generateImageSEO=bg,d.generatePerformanceTrackingSchema=Rd,d.generatePictureElement=kg,d.generatePlaceholder=Sg,d.generateSemanticMarkup=mt,d.generateSizes=pg,d.generateSocialImageMeta=yg,d.generateSrcSet=mg,d.generateTopicClustering=yt,d.getConditionalStats=qd,d.getEnvironmentType=it,d.getErrorMessage=Rg,d.getLazyLoadingStats=Ud,d.getOptimalImageFormat=xg,d.getPageName=ru,d.getPerformanceMonitor=Ve,d.getPreloadingStats=Yd,d.getRenderCounts=d0,d.getSecurityHeaders=gt,d.getUINavigationService=K,d.getWebVitalRating=se,d.getWebVitals=m0,d.hashString=Rt,d.hashUserId=eu,d.initWebVitals=E0,d.initializeAdvancedPreloading=Kd,d.initializePerformanceMonitoring=k0,d.initializePreloading=Fd,d.inlineCriticalStyles=cg,d.isAuthError=Xg,d.isForbiddenError=Jg,d.isLocalhost=nt,d.isNetworkAccess=lt,d.isNotFoundError=Zg,d.isPreloaded=kn,d.isRateLimitError=Qg,d.isServerError=Yg,d.isWalletBrowser=st,d.isWebEnvironment=ct,d.lazyLoadQueue=Vg,d.lazyWithPreload=$g,d.lazyWithRetry=Ag,d.loadCSS=vd,d.loadCriticalCSS=R0,d.loadNonCriticalCSS=eg,d.measureAsyncOperation=C0,d.measureCLS=wt,d.measureFCP=Ct,d.measureFID=St,d.measureINP=Et,d.measureImagePerformance=Ng,d.measureLCP=Nt,d.measureTTFB=Lt,d.navigationHelper=ne,d.optimizeClassNames=ig,d.optimizeContainment=sg,d.optimizeFlex=ug,d.optimizeGrid=gg,d.optimizeWillChange=ng,d.optimizedFetch=ot,d.parseFileSize=J0,d.performanceBudget=J,d.performanceUtils=je,d.prefersReducedMotion=_t,d.prefetchResource=p0,d.preloadComponent=Dd,d.preloadImage=wg,d.preloadResource=y0,d.preloadRoute=f0,d.preserveAspectRatio=Lg,d.priorityLoader=Wg,d.removeLanguageFromPath=nr,d.reportApiCall=I0,d.reportCustomMetric=M0,d.reportRouteChange=Mt,d.reportWebVitals=b0,d.routeConfig=ht,d.securityHeaders=Cd,d.setupCSPReporting=Sd,d.setupLazyLoading=vg,d.setupProgressiveLoading=Cg,d.shouldEnableWallet=yd,d.smartLinkVariants=Ue,d.stripLanguagePrefix=ea,d.supportsAVIF=Gt,d.supportsCSSImports=xd,d.supportsWebP=qt,d.themeStorage=_g,d.useApiMetrics=Vt,d.useBanner=Ts,d.useBundleMetrics=Ut,d.useClickOutside=Te,d.useCodeLoader=Jr,d.useComponentPerformance=xt,d.useCopyToClipboard=q0,d.useDebugMemo=i0,d.useDraggable=Wt,d.useDynamicImport=Fg,d.useErrorRecovery=Ui,d.useFormSubmission=H0,d.useFormValidation=Y0,d.useImageLazyLoading=h0,d.useLayout=R,d.useLazyLoad=Qt,d.useLazyStyles=dg,d.useLocalizedNavigate=Qi,d.useLocation=zg,d.useMediaQuery=hg,d.useMemoryLeakDetection=v0,d.useMultipleCopyToClipboard=G0,d.useNavigation=Pg,d.useOptimizedTheme=fg,d.useOptimizedWallets=a0,d.usePerformanceMark=n0,d.useReducedMotion=og,d.useRenderCount=c0,d.useResponsiveStyles=ag,d.useRoutePerformance=K0,d.useSearchParams=Ug,d.useSmartLinks=bn,d.useStableCallback=l0,d.useTheme=rc,d.useToast=io,d.useToggle=_0,d.useTopbar=gr,d.useWebVitals=Pt,d.utils=Kt,d.walletStorage=qg,d.web3SecurityNotes=Ld,d.withLazyErrorBoundary=Pi,d.withPerformanceTracking=w0,d.withRetry=bd,Object.defineProperties(d,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})}));