better-auth-studio 1.0.49-beta.11 → 1.0.49-beta.12

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "better-auth-studio",
3
- "version": "1.0.49-beta.11",
3
+ "version": "1.0.49-beta.12",
4
4
  "description": "Studio for Better Auth",
5
5
  "main": "dist/index.js",
6
6
  "bin": {
@@ -47,8 +47,11 @@
47
47
  "@types/express": "^4.17.21",
48
48
  "@types/node": "^20.10.0",
49
49
  "@types/ws": "^8.5.10",
50
+ "@types/supertest": "^6.0.2",
51
+ "supertest": "^6.3.3",
50
52
  "tsx": "^4.6.0",
51
- "typescript": "^5.3.2"
53
+ "typescript": "^5.3.2",
54
+ "vitest": "^1.6.1"
52
55
  },
53
56
  "engines": {
54
57
  "node": ">=18.0.0"
@@ -74,7 +77,10 @@
74
77
  "lint:fix": "biome check --write .",
75
78
  "format": "biome format --write .",
76
79
  "type-check": "tsc --noEmit",
77
- "test:ci": "node scripts/test-ci.js",
80
+ "test": "vitest",
81
+ "test:watch": "vitest --watch",
82
+ "test:coverage": "vitest --coverage",
83
+ "test:ci": "pnpm test --run",
78
84
  "release": "pnpm build && bumpp && pnpm publish --access public --no-git-checks",
79
85
  "release:beta": "pnpm build && bumpp --preid beta && pnpm publish --access public --tag beta --no-git-checks",
80
86
  "release:no-build": "bumpp && pnpm publish --access public --no-git-checks --tag next",
@@ -1087,4 +1087,4 @@ migrateFromClerk()
1087
1087
  }`),be(null),Be(!0)},TU=async()=>{try{const Z=await(await fetch("/api/database/schema")).json();if(Z.success&&Z.schema&&Z.schema.tables){const oe=Z.schema.tables.map(Se=>({name:Se.name,displayName:Se.displayName||Se.name}));ae(oe)}}catch{H.error("Failed to fetch available tables")}};m.useEffect(()=>{ne&&(TU(),re(new Set))},[ne]);const CU=z=>{re(Z=>{const oe=new Set(Z);return oe.has(z)?oe.delete(z):oe.add(z),oe})},AU=()=>{re(new Set(ee.map(z=>z.name)))},jU=()=>{re(new Set)},kU=async()=>{if(!jt.trim()){H.error("Please paste a JWT to decode");return}qt(!0),se(null),Et(null);try{const Z=await(await fetch("/api/tools/jwt/decode",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({token:jt.trim(),secret:We.trim()||void 0})})).json();if(Z.success)Et(Z),H.success("JWT decoded successfully");else{const oe=Z.error||"Failed to decode JWT";se(oe),H.error(oe)}}catch(z){const Z=z instanceof Error?z.message:"Failed to decode JWT";se(Z),H.error(Z)}finally{qt(!1)}},_U=async()=>{const z=parseInt(Q,10);if(isNaN(z)||z<=0){H.error("Please provide a valid expiration (minutes)");return}let Z;if(V==="jwt"){const oe=ke.trim();if(oe.length>0&&oe!=="{"&&oe!=="}")try{Z=JSON.parse(oe)}catch{H.error("Custom claims must be valid JSON");return}}tt(!0),be(null);try{const Se=await(await fetch("/api/tools/token-generator",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({type:V,subject:he||void 0,audience:De||void 0,expiresInMinutes:z,customClaims:Z,secretOverride:Ne||void 0})})).json();if(Se.success)be(Se),_e("success",`✅ Generated ${V.replace("_"," ")} token`,"completed"),H.success("Token generated successfully");else throw new Error(Se.error||"Failed to generate token")}catch(oe){const Se=oe instanceof Error?oe.message:"Failed to generate token";_e("error",`❌ ${Se}`,"failed"),H.error(Se)}finally{tt(!1)}},RU=async()=>{if(ge.size===0){H.error("Please select at least one table to export");return}const z=parseInt(Re,10);if(isNaN(z)||z<=0){H.error("Please enter a valid limit (greater than 0)");return}if(z>1e4){H.error("Limit cannot exceed 10,000 rows per table");return}$e(!0),a("export-data"),l(!0),i([]);try{_e("info",`📦 Starting export of ${ge.size} table(s)...`,"running"),_e("progress",`Format: ${fe.toUpperCase()} | Limit: ${z} rows per table`,"running");const oe=await(await fetch("/api/tools/export",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({tables:Array.from(ge),format:fe,limit:z})})).json();if(oe.success){_e("success","✅ Export completed successfully!","completed"),oe.rowCounts&&Object.entries(oe.rowCounts).forEach(([Kt,Tn])=>{_e("info",` • ${Kt}: ${Tn} rows`,"completed")}),_e("info",`Downloading ${oe.filename}...`,"completed");const Se=new Blob([oe.data],{type:oe.contentType||(fe==="json"?"application/json":"text/csv")}),ze=window.URL.createObjectURL(Se),ct=document.createElement("a");ct.href=ze,ct.download=oe.filename,document.body.appendChild(ct),ct.click(),document.body.removeChild(ct),window.URL.revokeObjectURL(ze),H.success("Export downloaded successfully"),te(!1)}else throw new Error(oe.error||"Export failed")}catch(Z){_e("error",`❌ Export failed: ${Z instanceof Error?Z.message:Z}`,"failed"),H.error("Export failed")}finally{$e(!1),a(null)}},OU=async()=>{a("health-check"),l(!0),i([]),_e("info","Running Better Auth health check...","running");try{_e("progress","Testing Better Auth endpoints...","running");const z=await fetch("/api/tools/health-check",{method:"POST"}),Z=await z.json();if(!z.ok)throw new Error(Z.error||Z.message||"Health check failed");Z.success?(_e("success","✅ Better Auth health check passed","completed"),H.success("Health check passed")):(_e("error","❌ Better Auth health check failed","failed"),Z.failedEndpoints&&Z.failedEndpoints.length>0&&Z.failedEndpoints.forEach(oe=>{const Se=oe.status?` (Status: ${oe.status})`:"",ze=oe.error?` - ${oe.error}`:"";_e("error",` • Endpoint ${oe.endpoint}${Se}${ze}`,"failed")}),H.error("Health check failed"))}catch(z){_e("error",`❌ Health check failed: ${z instanceof Error?z.message:z}`,"failed"),H.error("Health check failed")}finally{a(null)}},DU=new Set(["test-oauth","test-db","hash-password","health-check","export-data","jwt-decoder","token-generator","validate-config","uuid-generator","password-strength","oauth-credentials","secret-generator"]),IU=[{id:"test-oauth",name:"Test OAuth",description:"Test OAuth provider connections",icon:Yn,action:iU,category:"oauth"},{id:"hash-password",name:"Hash Password",description:"Generate SHA hashes",icon:Zi,action:rU,category:"utilities"},{id:"run-migration",name:"Run Migration",description:"Run database migrations",icon:ps,action:lU,category:"database"},{id:"test-db",name:"Test Database",description:"Test database connection",icon:ps,action:dU,category:"database"},{id:"validate-config",name:"Validate Config",description:"Validate Better Auth configuration",icon:Bf,action:cU,category:"utilities"},{id:"health-check",name:"Health Check",description:"Run system health check",icon:fT,action:OU,category:"testing"},{id:"export-data",name:"Export Data",description:"Export database tables to JSON or CSV",icon:ud,action:hU,category:"database"},{id:"jwt-decoder",name:"JWT Decoder",description:"Inspect tokens and verify claims",icon:Cn,action:fU,category:"utilities"},{id:"token-generator",name:"Token Generator",description:"Mint short-lived test tokens",icon:hd,action:EU,category:"utilities"},{id:"uuid-generator",name:"UUID Generator",description:"Generate and validate UUIDs",icon:zm,action:pU,category:"utilities"},{id:"password-strength",name:"Password Strength Checker",description:"Validate passwords against your config",icon:Tl,action:mU,category:"utilities"},{id:"oauth-credentials",name:"OAuth Credentials",description:"View and test OAuth provider credentials",icon:Yn,action:yU,category:"oauth"},{id:"secret-generator",name:"Secret Generator",description:"Generate secure AUTH_SECRET for Better Auth",icon:Zi,action:bU,category:"utilities"}],MU=[{id:"oauth",name:"OAuth",icon:Yn},{id:"database",name:"Database",icon:ps},{id:"testing",name:"Testing",icon:fT},{id:"utilities",name:"Utilities",icon:d5}].map(z=>({...z,tools:IU.filter(Z=>Z.category===z.id)}));return r.jsxs("div",{className:"space-y-8 bg-black w-full min-h-screen",children:[r.jsxs("div",{className:"w-full flex flex-col",children:[r.jsx("div",{className:"flex items-center justify-between p-5 pt-7",children:r.jsxs("div",{className:"pb-8",children:[r.jsx("h1",{className:"text-3xl font-normal text-white tracking-tight",children:"Tools"}),r.jsx("p",{className:"text-gray-300 mt-2 uppercase font-mono font-light text-xs",children:"Utility tools for managing and testing your Better Auth setup"})]})}),r.jsxs("div",{className:"flex flex-col items-center space-y-8",children:[r.jsx("hr",{className:"w-full border-white/15 h-px"}),r.jsx("hr",{className:"w-full border-white/15 h-px"})]}),o&&s.length>0&&r.jsxs("div",{className:"mb-6 p-6 gap-8",children:[r.jsxs("div",{className:"flex items-center justify-between mb-2",children:[r.jsx("h3",{className:"text-sm uppercase font-mono text-gray-400 tracking-wider",children:"Tool Output"}),r.jsx($,{variant:"ghost",size:"sm",onClick:()=>l(!1),className:"text-gray-400 hover:text-white rounded-none",children:r.jsx(xt,{className:"w-4 h-4"})})]}),r.jsx(ji,{title:"Tool Execution Logs",lines:s,isRunning:n!==null,className:"w-full",defaultCollapsed:!1})]}),r.jsx("div",{className:"space-y-8 p-6 gap-8",children:MU.map(z=>r.jsxs("div",{className:"space-y-4",children:[r.jsxs("div",{className:"flex items-center space-x-2",children:[r.jsx(z.icon,{className:"w-5 h-5 text-white"}),r.jsx("h2",{className:"text-lg font-light text-white uppercase tracking-wider",children:z.name})]}),r.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4",children:z.tools.map(Z=>{const oe=Z.icon,Se=n===Z.id,ze=DU.has(Z.id),ct=!ze||n!==null&&n!==Z.id||Se;return r.jsxs("button",{onClick:()=>Z.action(),disabled:ct,className:`relative flex items-center space-x-4 p-4 bg-black/30 border border-dashed border-white/20 rounded-none transition-colors text-left group ${ze?"hover:bg-black/50 disabled:opacity-50 disabled:cursor-not-allowed":"opacity-60 cursor-not-allowed"}`,children:[r.jsx("div",{className:"p-2 bg-white/10 rounded-none group-hover:bg-white/20 transition-colors",children:Se?r.jsx(gn,{className:"w-6 h-6 text-white animate-spin"}):r.jsx(oe,{className:"w-6 h-6 text-white"})}),r.jsxs("div",{className:"flex-1",children:[r.jsx("h4",{className:"text-white font-light mb-1",children:Z.name}),r.jsxs("p",{className:"text-xs uppercase font-mono flex items-center text-gray-400",children:[r.jsx(dC,{className:"w-4 h-4 mr-2"}),Z.description]})]}),!ze&&r.jsx("span",{className:"absolute top-2 right-3 text-[10px] font-mono uppercase tracking-[0.2em] text-white/60",children:"Coming Soon"}),r.jsx(Xs,{className:"w-4 h-4 text-gray-400 group-hover:text-white transition-colors"})]},Z.id)})})]},z.id))})]}),w&&r.jsx("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center z-50",children:r.jsxs("div",{className:"bg-black/90 border border-dashed border-white/20 p-6 w-full max-w-2xl rounded-none",children:[r.jsxs("div",{className:"flex items-center justify-between mb-6",children:[r.jsxs("div",{className:"flex items-center space-x-2",children:[r.jsx(Zi,{className:"w-5 h-5 text-white"}),r.jsx("h3",{className:"text-xl text-white font-light uppercase tracking-wider",children:"Password Hasher"})]}),r.jsx($,{variant:"ghost",size:"sm",onClick:()=>S(!1),className:"text-gray-400 hover:text-white rounded-none",children:r.jsx(xt,{className:"w-5 h-5"})})]}),r.jsxs("div",{className:"space-y-4",children:[r.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[r.jsxs("div",{children:[r.jsx(pe,{className:"text-xs uppercase font-mono text-gray-400",children:"Algorithm"}),r.jsxs("select",{value:O,onChange:z=>R(z.target.value),className:"mt-2 w-full bg-black border border-dashed border-white/20 text-white px-3 py-2 text-sm focus:outline-none",children:[r.jsx("option",{value:"SHA-256",children:"SHA-256"}),r.jsx("option",{value:"SHA-384",children:"SHA-384"}),r.jsx("option",{value:"SHA-512",children:"SHA-512"})]})]}),r.jsxs("div",{children:[r.jsx(pe,{className:"text-xs uppercase font-mono text-gray-400",children:"Encoding"}),r.jsxs("select",{value:I,onChange:z=>F(z.target.value),className:"mt-2 w-full bg-black border border-dashed border-white/20 text-white px-3 py-2 text-sm focus:outline-none",children:[r.jsx("option",{value:"hex",children:"Hex"}),r.jsx("option",{value:"base64",children:"Base64"}),r.jsx("option",{value:"base64url",children:"Base64 URL"})]})]})]}),r.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[r.jsxs("div",{children:[r.jsx(pe,{className:"text-xs uppercase font-mono text-gray-400",children:"Salt (optional)"}),r.jsx(Te,{value:E,onChange:z=>k(z.target.value),placeholder:"e.g. project-specific-salt",className:"mt-2 bg-black border border-dashed border-white/20 text-white rounded-none"}),r.jsxs("p",{className:"text-[11px] text-gray-500 mt-1 font-mono",children:["Salt is prepended (",r.jsx("span",{className:"text-white/80",children:"salt:password"}),")"]})]}),r.jsxs("div",{children:[r.jsx(pe,{className:"text-xs uppercase font-mono text-gray-400",children:"Password"}),r.jsxs("div",{className:"relative mt-2",children:[r.jsx(Te,{type:A?"text":"password",value:C,onChange:z=>T(z.target.value),placeholder:"Enter password",className:"bg-black border border-dashed border-white/20 text-white rounded-none pr-10"}),r.jsx("button",{type:"button",onClick:()=>D(z=>!z),className:"absolute inset-y-0 right-0 px-3 flex items-center text-gray-400 hover:text-white","aria-label":A?"Hide password":"Show password",children:A?r.jsx(Oh,{className:"w-4 h-4"}):r.jsx(gi,{className:"w-4 h-4"})})]})]})]}),j&&r.jsxs("div",{children:[r.jsx(pe,{className:"text-xs uppercase font-mono text-gray-400",children:"Hash Result"}),r.jsxs("div",{className:"mt-2 flex items-center space-x-2",children:[r.jsx(Te,{value:j,readOnly:!0,className:"flex-1 bg-black border border-dashed border-white/20 text-white rounded-none"}),r.jsx($,{variant:"outline",size:"icon",onClick:()=>j&&Aa(j),className:"border border-dashed border-white/20 text-white hover:bg-white/10 rounded-none",children:r.jsx(aa,{className:"w-4 h-4"})})]})]})]}),r.jsxs("div",{className:"flex justify-end space-x-3 mt-8 border-t border-dashed border-white/10 pt-6",children:[r.jsx($,{variant:"outline",onClick:()=>S(!1),className:"border border-dashed border-white/20 text-white hover:bg-white/10 rounded-none",children:"Close"}),r.jsx($,{onClick:sU,disabled:_,className:"rounded-none",children:_?r.jsxs(r.Fragment,{children:[r.jsx(gn,{className:"w-4 h-4 mr-2 animate-spin"}),"Hashing..."]}):"Hash Password"})]})]})}),c&&r.jsx("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center z-50",children:r.jsxs("div",{className:"bg-black/90 border border-dashed border-white/20 p-8 w-full max-w-2xl rounded-none",children:[r.jsxs("div",{className:"flex items-center justify-between mb-6",children:[r.jsxs("div",{className:"flex items-center space-x-2",children:[r.jsx(Yn,{className:"w-6 h-6 text-white"}),r.jsx("h3",{className:"text-xl text-white font-light",children:"Select OAuth Provider"})]}),r.jsx($,{variant:"ghost",size:"sm",onClick:()=>{u(!1),p("")},className:"text-gray-400 hover:text-white rounded-none",children:r.jsx(xt,{className:"w-5 h-5"})})]}),r.jsx("div",{className:"space-y-4",children:h.length===0?r.jsxs("div",{className:"text-center py-12",children:[r.jsx(Yn,{className:"w-16 h-16 text-gray-400 mx-auto mb-4"}),r.jsx("p",{className:"text-gray-400 mb-2 text-lg",children:"No OAuth providers configured"}),r.jsx("p",{className:"text-sm text-gray-500",children:"Please configure OAuth providers in your Better Auth configuration"})]}):r.jsxs("div",{children:[r.jsxs("label",{className:"block text-sm font-medium text-gray-400 mb-4 uppercase font-mono",children:["Available Providers (",h.length,")"]}),r.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-3 max-h-96 overflow-y-auto",children:h.map(z=>r.jsxs("button",{onClick:()=>{p(z.id),setTimeout(()=>{oU(z.id)},100)},className:`w-full flex items-center space-x-4 p-4 border rounded-none transition-all text-left group ${f===z.id?"border-white/50 bg-white/10":"border-dashed border-white/20 hover:bg-white/5 hover:border-white/30"}`,children:[r.jsx("div",{className:"flex-shrink-0",children:nU(z.id)}),r.jsx("div",{className:"flex-1 min-w-0",children:r.jsx("p",{className:"text-white uppercase font-mono font-light text-base",children:z.name||z.id})}),r.jsx(Xs,{className:`w-5 h-5 transition-colors flex-shrink-0 ${f===z.id?"text-white":"text-gray-400 group-hover:text-white"}`})]},z.id))}),r.jsx("p",{className:"text-xs text-gray-500 mt-4 font-mono uppercase",children:"Click on a provider to start the OAuth test"})]})}),r.jsx("div",{className:"flex justify-end space-x-3 mt-8 pt-6 border-t border-dashed border-white/10",children:r.jsx($,{variant:"outline",onClick:()=>{u(!1),p("")},className:"border border-dashed border-white/20 text-white hover:bg-white/10 rounded-none",children:"Cancel"})})]})}),v&&r.jsx("div",{className:"fixed inset-0 bg-black/60 flex items-center justify-center z-50",children:r.jsxs("div",{className:"bg-black/95 border border-dashed border-white/20 p-8 w-full max-w-5xl rounded-none",children:[r.jsxs("div",{className:"flex items-center justify-between mb-6",children:[r.jsxs("div",{className:"flex items-center space-x-2",children:[r.jsx(ps,{className:"w-6 h-6 text-white"}),r.jsx("h3",{className:"text-xl text-white font-light uppercase tracking-wider",children:"Select Migration"})]}),r.jsx($,{variant:"ghost",size:"sm",onClick:()=>x(!1),className:"text-gray-400 hover:text-white rounded-none",children:r.jsx(xt,{className:"w-5 h-5"})})]}),r.jsxs("div",{className:"grid md:grid-cols-3 gap-4",children:[r.jsx("div",{className:"space-y-3",children:Pc.map(z=>{const Z=(mn==null?void 0:mn.id)===z.id;return r.jsxs("button",{onClick:()=>aU(z.id),disabled:z.disabled,className:`w-full flex items-center space-x-3 p-4 border transition-colors rounded-none text-left ${z.disabled?"border-dashed border-white/10 bg-black/30 cursor-not-allowed opacity-60":Z?"border-white/60 bg-white/10":"border-dashed border-white/20 hover:bg-white/5 hover:border-white/40"}`,children:[r.jsx("div",{className:"flex-shrink-0 w-10 h-10 bg-white/10 flex items-center justify-center",children:z.logo?z.logo:r.jsx(Iw,{className:"w-6 h-6 text-white"})}),r.jsxs("div",{className:"flex-1 min-w-0",children:[r.jsx("p",{className:"text-white uppercase font-mono text-sm",children:z.name}),r.jsx("p",{className:"text-xs uppercase text-gray-400 font-mono mt-1 truncate",children:z.description})]}),z.disabled&&r.jsx("span",{className:"text-[10px] font-mono text-gray-400 uppercase",children:"Coming Soon"})]},z.id)})}),r.jsxs("div",{className:"md:col-span-2 space-y-4",children:[r.jsxs("div",{className:"flex items-start space-x-3",children:[r.jsx("div",{className:"w-12 h-12 bg-white/10 flex items-center justify-center",children:mn.logo?mn.logo:r.jsx(Iw,{className:"w-8 h-8 text-white"})}),r.jsxs("div",{className:"space-y-2",children:[r.jsx("h4",{className:"text-white -mb-2 text-lg font-light uppercase tracking-wider",children:mn.name}),r.jsx("p",{className:"text-sm mt-0 text-gray-400 uppercase font-mono leading-relaxed",children:mn.description}),r.jsx("div",{className:"flex items-center space-x-2",children:mn.docs&&r.jsx($,{variant:"ghost",size:"sm",asChild:!0,className:"rounded-none border border-dashed",children:r.jsx("a",{href:mn.docs,target:"_blank",rel:"noreferrer",children:"View Docs"})})})]})]}),mn.highlights&&r.jsx("ul",{className:"space-y-2 text-xs text-gray-300 font-mono bg-black/40 border border-white/10 p-4",children:mn.highlights.map(z=>r.jsxs("li",{className:"flex items-start space-x-2",children:[r.jsx("span",{className:"text-white/60 mt-0.5",children:"•"}),r.jsx("span",{children:z})]},z))}),mn.disabled?r.jsxs("div",{className:"space-y-4 text-gray-400 font-mono text-xs",children:[r.jsx("p",{children:"This migration provider is coming soon."}),r.jsxs("p",{children:["Subscribe to updates at"," ",r.jsx("a",{href:"https://better-auth.com",target:"_blank",rel:"noreferrer",className:"text-white underline",children:"better-auth.com"}),"."]})]}):mn.custom?r.jsxs("div",{className:"space-y-3",children:[r.jsx("label",{className:"text-xs uppercase font-mono text-gray-400",children:"Custom Migration Script"}),r.jsx("textarea",{value:y,onChange:z=>g(z.target.value),className:"w-full h-64 bg-black/70 border border-white/10 text-xs text-gray-200 font-mono p-3 rounded-none focus:outline-none focus:ring-0"}),r.jsxs("div",{className:"flex items-center justify-end space-x-2",children:[r.jsx($,{variant:"outline",size:"sm",className:"rounded-none",onClick:()=>g(x0),children:"Reset"}),r.jsxs($,{variant:"ghost",size:"sm",className:"rounded-none text-gray-400 hover:text-white",onClick:()=>Aa(y),children:[r.jsx(aa,{className:"w-4 h-4"}),"Copy Script"]}),r.jsx($,{className:"rounded-none",onClick:()=>SS("custom",y),children:"Run Custom Script"})]})]}):r.jsxs("div",{className:"space-y-3",children:[mn.script&&r.jsxs(r.Fragment,{children:[r.jsxs("div",{className:"flex items-center justify-between text-xs uppercase font-mono text-gray-400",children:[r.jsx("span",{children:"Migration Script Preview"}),r.jsxs($,{variant:"ghost",size:"sm",className:"rounded-none text-gray-400 hover:text-white",onClick:()=>Aa(mn.script),children:[r.jsx(aa,{className:"w-4 h-4"}),"Copy Script"]})]}),r.jsx("pre",{className:"bg-black/70 border border-white/10 text-[11px] text-green-200 font-mono p-4 overflow-auto leading-relaxed h-64",children:r.jsx("code",{children:mn.script})})]}),r.jsx("div",{className:"flex items-center justify-end space-x-2",children:r.jsxs($,{className:"rounded-none",onClick:()=>SS(mn.id),children:["Run ",mn.name," Migration"]})})]})]})]})]})}),ne&&r.jsx("div",{className:"fixed inset-0 bg-black/80 flex items-center justify-center z-50",children:r.jsxs("div",{className:"bg-black border border-dashed border-white/20 rounded-none p-6 w-full max-w-3xl max-h-[85vh] overflow-y-auto",children:[r.jsxs("div",{className:"flex items-center justify-between mb-6",children:[r.jsxs("div",{className:"flex items-center space-x-2",children:[r.jsx(ud,{className:"w-5 h-5 text-white"}),r.jsx("h3",{className:"text-xl text-white font-light uppercase tracking-wider",children:"Export Data"})]}),r.jsx($,{variant:"ghost",size:"sm",onClick:()=>te(!1),className:"text-gray-400 hover:text-white rounded-none",children:r.jsx(xt,{className:"w-4 h-4"})})]}),r.jsxs("div",{className:"space-y-6",children:[r.jsxs("div",{children:[r.jsx(pe,{className:"text-xs uppercase font-mono text-gray-400 mb-3 block",children:"Export Format"}),r.jsxs("div",{className:"flex space-x-4",children:[r.jsx("button",{onClick:()=>me("json"),className:`px-4 py-2 border rounded-none transition-colors ${fe==="json"?"border-white/50 bg-white/10 text-white":"border-dashed border-white/20 text-gray-400 hover:border-white/30"}`,children:"JSON"}),r.jsx("button",{onClick:()=>me("csv"),className:`px-4 py-2 border rounded-none transition-colors ${fe==="csv"?"border-white/50 bg-white/10 text-white":"border-dashed border-white/20 text-gray-400 hover:border-white/30"}`,children:"CSV"})]})]}),r.jsxs("div",{children:[r.jsx(pe,{htmlFor:"export-limit",className:"text-xs uppercase font-mono text-gray-400 mb-2 block",children:"Row Limit Per Table"}),r.jsx(Te,{id:"export-limit",type:"number",value:Re,onChange:z=>Me(z.target.value),min:"1",max:"10000",placeholder:"1000",className:"bg-black border border-dashed border-white/20 text-white rounded-none"}),r.jsx("p",{className:"text-[11px] text-gray-500 mt-1 font-mono",children:"Maximum 10,000 rows per table (default: 1000)"})]}),r.jsxs("div",{children:[r.jsxs("div",{className:"flex items-center justify-between mb-3",children:[r.jsxs(pe,{className:"text-xs uppercase font-mono text-gray-400",children:["Select Tables (",ge.size," selected)"]}),r.jsxs("div",{className:"flex space-x-2",children:[r.jsx($,{variant:"ghost",size:"sm",onClick:AU,className:"text-xs text-gray-400 hover:text-white rounded-none",children:"Select All"}),r.jsx($,{variant:"ghost",size:"sm",onClick:jU,className:"text-xs text-gray-400 hover:text-white rounded-none",children:"Deselect All"})]})]}),r.jsx("div",{className:"border border-dashed border-white/20 rounded-none max-h-64 overflow-y-auto",children:ee.length===0?r.jsx("div",{className:"p-4 text-center text-gray-400 text-sm",children:"Loading tables..."}):r.jsx("div",{className:"space-y-0",children:ee.map(z=>{const Z=ge.has(z.name);return r.jsx("button",{onClick:()=>CU(z.name),className:`w-full text-left p-3 border-b border-dashed border-white/10 last:border-b-0 transition-colors ${Z?"bg-white/10 border-white/30":"hover:bg-white/5"}`,children:r.jsxs("div",{className:"flex items-center justify-between",children:[r.jsxs("div",{children:[r.jsx("span",{className:"text-white text-sm font-mono",children:z.displayName}),r.jsxs("span",{className:"text-xs text-gray-400 ml-2 font-mono",children:["(",z.name,")"]})]}),Z&&r.jsx(ch,{className:"w-4 h-4 text-white"})]})},z.name)})})})]})]}),r.jsxs("div",{className:"flex justify-end space-x-3 mt-8 border-t border-dashed border-white/10 pt-6",children:[r.jsx($,{variant:"outline",onClick:()=>te(!1),className:"border border-dashed border-white/20 text-white hover:bg-white/10 rounded-none",children:"Cancel"}),r.jsx($,{onClick:RU,disabled:Ue||ge.size===0,className:"rounded-none",children:Ue?r.jsxs(r.Fragment,{children:[r.jsx(gn,{className:"w-4 h-4 mr-2 animate-spin"}),"Exporting..."]}):r.jsxs(r.Fragment,{children:[r.jsx(ud,{className:"w-4 h-4 mr-2"}),"Export"]})})]})]})}),pt&&r.jsx("div",{className:"fixed inset-0 bg-black/80 flex items-center justify-center z-[60]",children:r.jsxs("div",{className:"bg-black border border-dashed border-white/20 rounded-none p-6 w-full max-w-4xl max-h-[90vh] overflow-y-auto",children:[r.jsxs("div",{className:"flex items-center justify-between mb-6",children:[r.jsxs("div",{className:"flex items-center space-x-2",children:[r.jsx(Cn,{className:"w-5 h-5 text-white"}),r.jsx("h3",{className:"text-xl text-white font-light uppercase tracking-wider",children:"JWT Decoder"})]}),r.jsx($,{variant:"ghost",size:"sm",onClick:()=>Ge(!1),className:"text-gray-400 hover:text-white rounded-none",children:r.jsx(xt,{className:"w-4 h-4"})})]}),r.jsxs("div",{className:"space-y-4",children:[r.jsxs("div",{children:[r.jsx(pe,{className:"text-xs uppercase font-mono text-gray-400 mb-2 block",children:"JWT Token"}),r.jsx("textarea",{value:jt,onChange:z=>St(z.target.value),placeholder:"Paste JWT here",className:"w-full min-h-[120px] bg-black border border-dashed border-white/20 text-white font-mono text-xs p-3 rounded-none focus:outline-none"})]}),r.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[r.jsxs("div",{children:[r.jsx(pe,{className:"text-xs uppercase font-mono text-gray-400 mb-2 block",children:"HMAC Secret (optional)"}),r.jsx(Te,{value:We,onChange:z=>et(z.target.value),placeholder:"Defaults to Better Auth secret if omitted",className:"bg-black border border-dashed border-white/20 text-white rounded-none"})]}),r.jsxs("div",{className:"flex items-end justify-end space-x-2",children:[r.jsx($,{variant:"outline",onClick:()=>{St(""),et(""),Et(null),se(null)},className:"border border-dashed border-white/20 text-white hover:bg-white/10 rounded-none",children:"Clear"}),r.jsx($,{onClick:kU,disabled:Tt,className:"rounded-none",children:Tt?r.jsxs(r.Fragment,{children:[r.jsx(gn,{className:"w-4 h-4 mr-2 animate-spin"}),"Decoding..."]}):"Decode JWT"})]})]}),Wt&&r.jsx("div",{className:"border border-dashed border-red-500/30 bg-red-500/10 text-red-300 text-xs font-mono p-3 rounded-none",children:Wt}),Ze&&r.jsxs("div",{className:"space-y-4",children:[r.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-4 text-xs font-mono",children:[r.jsxs("div",{className:"border border-dashed border-white/10 p-3 space-y-2",children:[r.jsx("div",{className:"text-gray-400 uppercase tracking-wider",children:"Signature"}),r.jsx("p",{className:`text-sm ${Ze.verified?"text-green-400":"text-yellow-300"}`,children:Ze.verified?"Verified (HS256)":"Not verified"}),r.jsx("p",{className:"text-gray-400 break-all",children:Ze.signature||"None"})]}),r.jsxs("div",{className:"border border-dashed border-white/10 p-3 space-y-2",children:[r.jsx("div",{className:"text-gray-400 uppercase tracking-wider",children:"Issued"}),r.jsx("p",{className:"text-white",children:Ze.issuedAtFormatted||"Unknown"}),r.jsx("p",{className:"text-gray-500",children:Ze.issuedAgo||""})]}),r.jsxs("div",{className:"border border-dashed border-white/10 p-3 space-y-2",children:[r.jsx("div",{className:"text-gray-400 uppercase tracking-wider",children:"Expires"}),r.jsx("p",{className:`text-white ${Ze.expired?"text-red-300":""}`,children:Ze.expiresAtFormatted||"No expiry"}),r.jsx("p",{className:"text-gray-500",children:Ze.expiresIn||""})]})]}),r.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[r.jsxs("div",{className:"border border-dashed border-white/10 p-3",children:[r.jsxs("div",{className:"flex items-center justify-between mb-2",children:[r.jsx("span",{className:"text-xs uppercase font-mono text-gray-400",children:"Header"}),r.jsx($,{variant:"ghost",size:"sm",onClick:()=>Aa(JSON.stringify(Ze.header,null,2)),className:"text-gray-400 hover:text-white rounded-none",children:r.jsx(aa,{className:"w-4 h-4"})})]}),r.jsx("pre",{className:"text-[11px] text-gray-100 font-mono bg-black/40 p-3 overflow-x-auto max-h-64",children:JSON.stringify(Ze.header,null,2)})]}),r.jsxs("div",{className:"border border-dashed border-white/10 p-3",children:[r.jsxs("div",{className:"flex items-center justify-between mb-2",children:[r.jsx("span",{className:"text-xs uppercase font-mono text-gray-400",children:"Payload"}),r.jsx($,{variant:"ghost",size:"sm",onClick:()=>Aa(JSON.stringify(Ze.payload,null,2)),className:"text-gray-400 hover:text-white rounded-none",children:r.jsx(aa,{className:"w-4 h-4"})})]}),r.jsx("pre",{className:"text-[11px] text-gray-100 font-mono bg-black/40 p-3 overflow-x-auto max-h-64",children:JSON.stringify(Ze.payload,null,2)})]})]}),Ze.customClaims&&Object.keys(Ze.customClaims).length>0&&r.jsxs("div",{className:"border border-dashed border-white/10 p-3",children:[r.jsx("div",{className:"text-xs uppercase font-mono text-gray-400 mb-2",children:"Custom Claims"}),r.jsx("pre",{className:"text-[11px] text-gray-100 font-mono bg-black/40 p-3 overflow-x-auto max-h-64",children:JSON.stringify(Ze.customClaims,null,2)})]})]})]})]})}),we&&r.jsx("div",{className:"fixed inset-0 bg-black/70 flex items-center justify-center z-[60]",children:r.jsxs("div",{className:"bg-black border border-dashed border-white/20 rounded-none p-6 w-full max-w-4xl max-h-[90vh] overflow-y-auto",children:[r.jsxs("div",{className:"flex items-center justify-between mb-6",children:[r.jsxs("div",{className:"flex items-center space-x-2",children:[r.jsx(hd,{className:"w-5 h-5 text-white"}),r.jsx("h3",{className:"text-xl text-white font-light uppercase tracking-wider",children:"Token Generator"})]}),r.jsx($,{variant:"ghost",size:"sm",onClick:()=>Be(!1),className:"text-gray-400 hover:text-white rounded-none",children:r.jsx(xt,{className:"w-4 h-4"})})]}),r.jsxs("div",{className:"space-y-6",children:[r.jsxs("div",{children:[r.jsx(pe,{className:"text-xs uppercase font-mono text-gray-400 mb-3 block",children:"Token Type"}),r.jsx("div",{className:"flex flex-wrap gap-3",children:[{id:"api_key",label:"API Key"},{id:"jwt",label:"JWT"}].map(z=>r.jsx("button",{onClick:()=>ce(z.id),className:`px-4 py-2 border rounded-none text-sm uppercase font-mono transition-colors ${V===z.id?"border-white/60 bg-white/10 text-white":"border-dashed border-white/20 text-gray-400 hover:border-white/40"}`,children:z.label},z.id))})]}),r.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[r.jsxs("div",{children:[r.jsx(pe,{className:"text-xs uppercase font-mono text-gray-400 mb-2 block",children:"Subject / User ID (optional)"}),r.jsx(Te,{value:he,onChange:z=>xe(z.target.value),placeholder:"User identifier or email",className:"bg-black border border-dashed border-white/20 text-white rounded-none"})]}),r.jsxs("div",{children:[r.jsx(pe,{className:"text-xs uppercase font-mono text-gray-400 mb-2 block",children:"Audience (optional)"}),r.jsx(Te,{value:De,onChange:z=>Ye(z.target.value),placeholder:"Audience / app id",className:"bg-black border border-dashed border-white/20 text-white rounded-none"})]}),r.jsxs("div",{children:[r.jsx(pe,{className:"text-xs uppercase font-mono text-gray-400 mb-2 block",children:"Expires In (minutes)"}),r.jsx(Te,{type:"number",value:Q,onChange:z=>ie(z.target.value),min:"1",max:"1440",className:"bg-black border border-dashed border-white/20 text-white rounded-none"})]}),V==="jwt"&&r.jsxs("div",{children:[r.jsx(pe,{className:"text-xs uppercase font-mono text-gray-400 mb-2 block",children:"Override Secret (optional)"}),r.jsx(Te,{value:Ne,onChange:z=>ue(z.target.value),placeholder:"Defaults to Better Auth secret",className:"bg-black border border-dashed border-white/20 text-white rounded-none"})]})]}),V==="jwt"&&r.jsxs("div",{children:[r.jsx(pe,{className:"text-xs uppercase font-mono text-gray-400 mb-2 block",children:"Custom Claims (JSON)"}),r.jsx("textarea",{value:ke,onChange:z=>X(z.target.value),placeholder:'{"role":"admin"}',className:"w-full min-h-[120px] bg-black border border-dashed border-white/20 text-white font-mono text-xs p-3 rounded-none focus:outline-none"}),r.jsx("p",{className:"text-[11px] text-gray-500 mt-1 font-mono",children:"Leave empty to include only default claims (iss, sub, aud, exp, iat, jti)."})]}),r.jsxs("div",{className:"flex items-center justify-end space-x-2",children:[r.jsx($,{variant:"outline",onClick:()=>{be(null),xe(""),Ye(""),X(`{
1088
1088
 
1089
1089
  }`)},className:"border border-dashed border-white/20 text-white hover:bg-white/10 rounded-none",children:"Reset"}),r.jsx($,{onClick:_U,disabled:He,className:"rounded-none",children:He?r.jsxs(r.Fragment,{children:[r.jsx(gn,{className:"w-4 h-4 mr-2 animate-spin"}),"Generating..."]}):"Generate Token"})]}),Y&&r.jsxs("div",{className:"space-y-4 border border-dashed border-white/15 p-4",children:[r.jsxs("div",{className:"flex items-center justify-between",children:[r.jsxs("div",{children:[r.jsx("p",{className:"text-xs uppercase font-mono text-gray-400",children:"Generated Token"}),r.jsx("p",{className:"text-white font-mono text-sm break-all mt-1",children:Y.token})]}),r.jsx($,{variant:"ghost",size:"sm",onClick:()=>Aa(Y.token),className:"text-gray-400 hover:text-white rounded-none",children:r.jsx(aa,{className:"w-4 h-4"})})]}),r.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-4 text-xs font-mono",children:[r.jsxs("div",{children:[r.jsx("p",{className:"text-gray-400 uppercase tracking-wider",children:"Type"}),r.jsx("p",{className:"text-white mt-1 capitalize",children:Y.type.replace("_"," ")})]}),r.jsxs("div",{children:[r.jsx("p",{className:"text-gray-400 uppercase tracking-wider",children:"Expires"}),r.jsx("p",{className:"text-white mt-1",children:uU(Y.expiresAt)})]}),Y.url&&r.jsxs("div",{className:"col-span-1",children:[r.jsx("p",{className:"text-gray-400 uppercase tracking-wider",children:"URL"}),r.jsx("p",{className:"text-white mt-1 break-all",children:Y.url})]})]}),Y.metadata&&r.jsxs("div",{className:"border border-dashed border-white/10 p-3",children:[r.jsx("p",{className:"text-xs uppercase font-mono text-gray-400 mb-2",children:"Metadata"}),r.jsx("pre",{className:"text-[11px] text-gray-100 font-mono bg-black/40 p-3 overflow-x-auto",children:JSON.stringify(Y.metadata,null,2)})]})]})]})]})}),B&&L&&r.jsx("div",{className:"fixed inset-0 bg-black/80 flex items-center justify-center z-50 overflow-hidden",onClick:z=>{z.target===z.currentTarget&&(G(!1),q(null))},children:r.jsxs("div",{className:"bg-black border border-dashed border-white/20 rounded-none p-6 w-full max-w-4xl max-h-[90vh] overflow-y-auto",onClick:z=>z.stopPropagation(),children:[r.jsxs("div",{className:"flex items-center justify-between mb-6",children:[r.jsxs("div",{className:"flex items-center space-x-2",children:[r.jsx(Bf,{className:"w-5 h-5 text-white"}),r.jsx("h3",{className:"text-xl text-white font-light uppercase tracking-wider",children:"Configuration Validator"})]}),r.jsx($,{variant:"ghost",size:"sm",onClick:()=>{G(!1),q(null)},className:"text-gray-400 hover:text-white rounded-none",children:r.jsx(xt,{className:"w-4 h-4"})})]}),r.jsxs("div",{className:"mb-6 p-4 border border-dashed border-white/10",children:[r.jsx("div",{className:"text-xs uppercase font-mono text-gray-400 mb-3",children:"Summary"}),r.jsxs("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-4",children:[r.jsxs("div",{className:"text-left border-r border-dashed border-white/10 pr-4 last:border-r-0",children:[r.jsx("div",{className:"text-2xl font-mono text-white",children:L.summary.total}),r.jsx("div",{className:"text-xs text-gray-400 uppercase mt-1 font-mono",children:"Total Checks"})]}),r.jsxs("div",{className:"text-left border-r border-dashed border-white/10 pr-4 last:border-r-0",children:[r.jsx("div",{className:"text-2xl font-mono text-white",children:L.summary.passes}),r.jsx("div",{className:"text-xs text-gray-400 uppercase mt-1 font-mono",children:"Passed"})]}),r.jsxs("div",{className:"text-left border-r border-dashed border-white/10 pr-4 last:border-r-0",children:[r.jsx("div",{className:"text-2xl font-mono text-white",children:L.summary.errors}),r.jsx("div",{className:"text-xs text-gray-400 uppercase mt-1 font-mono",children:"Errors"})]}),r.jsxs("div",{className:"text-left",children:[r.jsx("div",{className:"text-2xl font-mono text-white",children:L.summary.warnings}),r.jsx("div",{className:"text-xs text-gray-400 uppercase mt-1 font-mono",children:"Warnings"})]})]})]}),r.jsx("div",{className:"space-y-4",children:Object.entries(L.results.reduce((z,Z)=>(z[Z.category]||(z[Z.category]=[]),z[Z.category].push(Z),z),{})).map(([z,Z])=>{if(z==="OAuth Providers"){const oe=Z.reduce((Se,ze)=>{const ct=ze.check.match(/^(.+?)\s*-\s*(.+)$/);if(ct){const Kt=ct[1],Tn=ct[2];Se[Kt]||(Se[Kt]=[]),Se[Kt].push({...ze,check:Tn})}else Se.General||(Se.General=[]),Se.General.push(ze);return Se},{});return r.jsxs("div",{className:"border border-dashed border-white/10 p-4",children:[r.jsxs("h4",{className:"text-white font-mono uppercase text-xs mb-4 text-left",children:[z,r.jsxs("span",{className:"text-gray-500 font-normal ml-2",children:["(",Z.length," check",Z.length!==1?"s":"",")"]})]}),r.jsx("div",{className:"space-y-2",children:Object.entries(oe).map(([Se,ze])=>{const ct=W.has(Se),Kt=ze.some(ft=>ft.severity==="error"),Tn=ze.some(ft=>ft.severity==="warning"),Ms=ze.every(ft=>ft.status==="pass");return r.jsxs("div",{className:"border border-dashed border-white/10",children:[r.jsxs("button",{onClick:()=>{K(ft=>{const Ot=new Set(ft);return Ot.has(Se)?Ot.delete(Se):Ot.add(Se),Ot})},className:"w-full flex items-center justify-between p-3 hover:bg-white/5 transition-colors text-left",children:[r.jsxs("div",{className:"flex items-center space-x-2",children:[r.jsx(dC,{className:`w-4 h-4 text-white/60 transition-transform ${ct?"rotate-90":""}`}),r.jsx("span",{className:"text-white font-mono text-sm",children:Se}),r.jsxs("span",{className:"text-xs text-gray-500 font-mono",children:["(",ze.length," check",ze.length!==1?"s":"",")"]})]}),r.jsxs("div",{className:"flex items-center space-x-2",children:[Kt&&r.jsx("span",{className:"text-xs text-white/60 font-mono",children:"Error"}),Tn&&!Kt&&r.jsx("span",{className:"text-xs text-white/60 font-mono",children:"Warning"}),Ms&&!Kt&&!Tn&&r.jsx(ch,{className:"w-4 h-4 text-white/60"})]})]}),ct&&r.jsx("div",{className:"border-t border-dashed border-white/10 space-y-2 p-2",children:ze.map((ft,Ot)=>r.jsx("div",{className:`p-3 border-l border-dashed border-white/15 ${ft.status==="pass"?"bg-green-600/[8%]":"bg-red-600/[8%]"}`,children:r.jsxs("div",{className:"flex items-start space-x-3",children:[r.jsx("div",{className:"mt-0.5",children:ft.severity==="error"?r.jsx(ss,{className:"w-4 h-4 text-white/60"}):ft.severity==="warning"?r.jsx(Ju,{className:"w-4 h-4 text-white/60"}):ft.status==="pass"?r.jsx(ch,{className:"w-4 h-4 text-white/60"}):r.jsx(fl,{className:"w-4 h-4 text-white/40"})}),r.jsxs("div",{className:"flex-1 text-left",children:[r.jsxs("div",{className:"flex items-center space-x-2 mb-1",children:[r.jsx("span",{className:"text-white font-mono text-sm",children:ft.check}),r.jsx("span",{className:"text-xs px-2 py-0.5 border border-dashed border-white/20 text-white/60 font-mono",children:ft.status.toUpperCase()})]}),r.jsx("p",{className:"text-gray-300 text-sm",children:ft.message}),ft.suggestion&&r.jsxs("div",{className:"mt-2 p-2 bg-black/40 border border-dashed border-white/10",children:[r.jsx("p",{className:"text-xs text-gray-400 uppercase mb-1 font-mono",children:"Suggestion"}),r.jsx("p",{className:"text-xs text-gray-300",children:ft.suggestion})]})]})]})},`${Se}-${ft.check}-${Ot}`))})]},Se)})})]},z)}return r.jsxs("div",{className:"border border-dashed border-white/10 p-4",children:[r.jsxs("h4",{className:"text-white font-mono uppercase text-xs mb-4 text-left",children:[z,r.jsxs("span",{className:"text-gray-500 font-normal ml-2",children:["(",Z.length," check",Z.length!==1?"s":"",")"]})]}),r.jsx("div",{className:"space-y-3",children:Z.map((oe,Se)=>r.jsx("div",{className:`p-3 border-l border-dashed border-white/15 ${oe.status==="pass"?"bg-green-600/[8%]":"bg-red-600/[8%]"}`,children:r.jsxs("div",{className:"flex items-start space-x-3",children:[r.jsx("div",{className:"mt-0.5",children:oe.severity==="error"?r.jsx(ss,{className:"w-4 h-4 text-white/60"}):oe.severity==="warning"?r.jsx(Ju,{className:"w-4 h-4 text-white/60"}):oe.status==="pass"?r.jsx(ch,{className:"w-4 h-4 text-white/60"}):r.jsx(fl,{className:"w-4 h-4 text-white/40"})}),r.jsxs("div",{className:"flex-1 text-left",children:[r.jsxs("div",{className:"flex items-center space-x-2 mb-1",children:[r.jsx("span",{className:"text-white font-mono text-sm",children:oe.check}),r.jsx("span",{className:"text-xs px-2 py-0.5 border border-dashed border-white/20 text-white/60 font-mono",children:oe.status.toUpperCase()})]}),r.jsx("p",{className:"text-gray-300 text-sm",children:oe.message}),oe.suggestion&&r.jsxs("div",{className:"mt-2 p-2 bg-black/40 border border-dashed border-white/10",children:[r.jsx("p",{className:"text-xs text-gray-400 uppercase mb-1 font-mono",children:"Suggestion"}),r.jsx("p",{className:"text-xs text-gray-300",children:oe.suggestion})]})]})]})},`${oe.category}-${oe.check}-${Se}`))})]},z)})}),r.jsx("div",{className:"mt-6 flex justify-end",children:r.jsx($,{variant:"outline",onClick:()=>{G(!1),q(null)},className:"border border-dashed border-white/20 text-white hover:bg-white/10 rounded-none",children:"Close"})})]})}),rt&&r.jsx("div",{className:"fixed inset-0 bg-black/80 flex items-center justify-center z-[60] overflow-hidden",onClick:z=>{z.target===z.currentTarget&&Qe(!1)},children:r.jsxs("div",{className:"bg-black border border-dashed border-white/20 rounded-none p-6 w-full max-w-4xl max-h-[90vh] overflow-y-auto",onClick:z=>z.stopPropagation(),children:[r.jsxs("div",{className:"flex items-center justify-between mb-6",children:[r.jsxs("div",{className:"flex items-center space-x-2",children:[r.jsx(zm,{className:"w-5 h-5 text-white"}),r.jsx("h3",{className:"text-xl text-white font-light uppercase tracking-wider",children:"UUID Generator"})]}),r.jsx($,{variant:"ghost",size:"sm",onClick:()=>Qe(!1),className:"text-gray-400 hover:text-white rounded-none",children:r.jsx(xt,{className:"w-4 h-4"})})]}),r.jsxs("div",{className:"space-y-4",children:[r.jsxs("div",{children:[r.jsx(pe,{className:"text-xs uppercase font-mono text-gray-400 mb-2 block",children:"Generate UUIDs"}),r.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[r.jsxs("div",{children:[r.jsx(pe,{className:"text-xs uppercase font-mono text-gray-400 mb-2 block",children:"Count (1-100)"}),r.jsx(Te,{type:"number",value:Jt,onChange:z=>{const Z=z.target.value;if(Z===""){pn("");return}const oe=parseInt(Z);isNaN(oe)||pn(Z)},onBlur:z=>{const Z=z.target.value,oe=parseInt(Z);isNaN(oe)||oe<1?pn("1"):oe>100?pn("100"):pn(String(oe))},min:"1",max:"100",className:"bg-black border border-dashed border-white/20 text-white rounded-none"})]}),r.jsxs("div",{className:"flex items-end justify-end space-x-2",children:[r.jsx($,{variant:"outline",onClick:()=>{pn("1"),Xt([])},className:"border border-dashed border-white/20 text-white hover:bg-white/10 rounded-none",children:"Clear"}),r.jsx($,{onClick:NU,className:"rounded-none",children:"Generate UUIDs"})]})]})]}),r.jsxs("div",{children:[r.jsx(pe,{className:"text-xs uppercase font-mono text-gray-400 mb-2 block",children:"Validate UUID"}),r.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[r.jsx("div",{children:r.jsx(Te,{value:Gr,onChange:z=>{wn(z.target.value)},onBlur:SU,placeholder:"Paste UUID to validate",className:"bg-black border border-dashed border-white/20 text-white font-mono text-xs rounded-none"})}),r.jsx("div",{className:"flex items-end justify-end space-x-2",children:r.jsx($,{variant:"outline",onClick:()=>{wn(""),Va(null)},className:"border border-dashed border-white/20 text-white hover:bg-white/10 rounded-none",children:"Clear"})})]}),Rn&&r.jsx("div",{className:`mt-2 border border-dashed p-3 rounded-none ${Rn.isValid?"border-white/10 bg-black/40":"border-red-500/30 bg-red-500/10"}`,children:r.jsxs("div",{className:"text-xs font-mono space-y-1",children:[r.jsx("div",{className:`${Rn.isValid?"text-green-400":"text-red-300"}`,children:Rn.isValid?"✓ Valid UUID":"✗ Invalid UUID"}),Rn.isValid&&Rn.version&&r.jsxs("div",{className:"text-gray-400",children:["Version: ",Rn.version]}),Rn.isValid&&Rn.variant&&r.jsxs("div",{className:"text-gray-400",children:["Variant: ",Rn.variant]})]})})]}),ln.length>0&&r.jsxs("div",{className:"space-y-4",children:[r.jsxs("div",{className:"flex items-center justify-between",children:[r.jsx(pe,{className:"text-xs uppercase font-mono text-gray-400",children:"Generated UUIDs"}),r.jsxs($,{variant:"ghost",size:"sm",onClick:()=>Aa(ln.join(`
1090
- `)),className:"text-gray-400 hover:text-white rounded-none",children:[r.jsx(aa,{className:"w-4 h-4 mr-1"}),"Copy All"]})]}),r.jsx("div",{className:"border border-dashed border-white/10 p-3",children:r.jsx("div",{className:"space-y-2 max-h-64 overflow-y-auto",children:ln.map((z,Z)=>r.jsxs("div",{className:"flex items-center justify-between p-2 bg-black/40 border border-dashed border-white/10",children:[r.jsx("span",{className:"text-white font-mono text-xs break-all",children:z}),r.jsx($,{variant:"ghost",size:"sm",onClick:()=>Aa(z),className:"text-gray-400 hover:text-white rounded-none ml-2",children:r.jsx(aa,{className:"w-3 h-3"})})]},Z))})})]}),r.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-4 text-xs font-mono",children:[r.jsxs("div",{className:"border border-dashed border-white/10 p-3 space-y-2",children:[r.jsx("div",{className:"text-gray-400 uppercase tracking-wider",children:"Version"}),r.jsx("p",{className:"text-white text-sm",children:"v4 (Random)"}),r.jsx("p",{className:"text-gray-500 text-xs",children:"Cryptographically random"})]}),r.jsxs("div",{className:"border border-dashed border-white/10 p-3 space-y-2",children:[r.jsx("div",{className:"text-gray-400 uppercase tracking-wider",children:"Format"}),r.jsx("p",{className:"text-white text-sm",children:"8-4-4-4-12"}),r.jsx("p",{className:"text-gray-500 text-xs",children:"36 characters"})]}),r.jsxs("div",{className:"border border-dashed border-white/10 p-3 space-y-2",children:[r.jsx("div",{className:"text-gray-400 uppercase tracking-wider",children:"Standard"}),r.jsx("p",{className:"text-white text-sm",children:"RFC 4122"}),r.jsx("p",{className:"text-gray-500 text-xs",children:"Universally unique"})]})]})]})]})}),Vr&&r.jsx("div",{className:"fixed inset-0 bg-black/80 flex items-center justify-center z-[60] overflow-hidden",children:r.jsxs("div",{className:"bg-black border border-dashed border-white/20 rounded-none p-6 w-full max-w-4xl max-h-[90vh] overflow-y-auto",children:[r.jsxs("div",{className:"flex items-center justify-between mb-6",children:[r.jsxs("div",{className:"flex items-center space-x-2",children:[r.jsx(Tl,{className:"w-5 h-5 text-white"}),r.jsx("h3",{className:"text-xl text-white font-light uppercase tracking-wider",children:"Password Strength Checker"})]}),r.jsx($,{variant:"ghost",size:"sm",onClick:()=>Do(!1),className:"text-gray-400 hover:text-white rounded-none",children:r.jsx(xt,{className:"w-4 h-4"})})]}),r.jsxs("div",{className:"space-y-4",children:[r.jsxs("div",{children:[r.jsx(pe,{className:"text-xs uppercase font-mono text-gray-400 mb-2 block",children:"Password"}),r.jsxs("div",{className:"relative",children:[r.jsx(Te,{type:pr?"text":"password",value:As,onChange:z=>Ya(z.target.value),placeholder:"Enter password to check",className:"w-full bg-black border border-dashed border-white/20 text-white font-mono text-xs pr-10 rounded-none"}),r.jsx($,{variant:"ghost",size:"sm",onClick:()=>Kr(!pr),className:"absolute right-0 top-0 h-full px-3 text-gray-400 hover:text-white rounded-none",children:pr?r.jsx(Oh,{className:"w-4 h-4"}):r.jsx(gi,{className:"w-4 h-4"})})]})]}),r.jsxs("div",{className:"flex items-end justify-end space-x-2",children:[r.jsx($,{variant:"outline",onClick:()=>{Ya(""),Yr(null),Kr(!1)},className:"border border-dashed border-white/20 text-white hover:bg-white/10 rounded-none",children:"Clear"}),r.jsx($,{onClick:gU,disabled:Wr||!As.trim(),className:"rounded-none",children:Wr?r.jsxs(r.Fragment,{children:[r.jsx(gn,{className:"w-4 h-4 mr-2 animate-spin"}),"Checking..."]}):"Check Strength"})]}),kt&&r.jsxs("div",{className:"space-y-4",children:[r.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-4 text-xs font-mono",children:[r.jsxs("div",{className:"border border-dashed border-white/10 p-3 space-y-2",children:[r.jsx("div",{className:"text-gray-400 uppercase tracking-wider",children:"Strength"}),r.jsx("p",{className:`text-sm font-medium ${kt.strength==="very-strong"?"text-green-400":kt.strength==="strong"?"text-green-300":kt.strength==="good"?"text-yellow-300":kt.strength==="fair"?"text-orange-300":"text-red-300"}`,children:kt.strength.split("-").map(z=>z.charAt(0).toUpperCase()+z.slice(1)).join(" ")}),r.jsx("div",{className:"w-full bg-black/40 h-2 rounded-none",children:r.jsx("div",{className:`h-full transition-all ${kt.strength==="very-strong"?"bg-green-400 w-full":kt.strength==="strong"?"bg-green-300 w-4/5":kt.strength==="good"?"bg-yellow-300 w-3/5":kt.strength==="fair"?"bg-orange-300 w-2/5":"bg-red-300 w-1/5"}`})})]}),r.jsxs("div",{className:"border border-dashed border-white/10 p-3 space-y-2",children:[r.jsx("div",{className:"text-gray-400 uppercase tracking-wider",children:"Score"}),r.jsxs("p",{className:"text-white text-sm",children:[kt.score," / 5"]}),r.jsx("p",{className:"text-gray-500 text-xs",children:kt.score===5?"Excellent":kt.score===4?"Very Good":kt.score===3?"Good":kt.score===2?"Fair":"Weak"})]}),r.jsxs("div",{className:"border border-dashed border-white/10 p-3 space-y-2",children:[r.jsx("div",{className:"text-gray-400 uppercase tracking-wider",children:"Config Match"}),r.jsx("p",{className:`text-sm ${kt.meetsConfig?"text-green-400":"text-red-300"}`,children:kt.meetsConfig?"✓ Meets Requirements":"✗ Fails Requirements"}),r.jsxs("p",{className:"text-gray-500 text-xs",children:[kt.configRequirements.minLength," -"," ",kt.configRequirements.maxLength," chars"]})]})]}),r.jsxs("div",{className:"border border-dashed border-white/10 p-3",children:[r.jsx("div",{className:"text-xs uppercase font-mono text-gray-400 mb-3",children:"Checks"}),r.jsx("div",{className:"space-y-2",children:kt.checks.map((z,Z)=>r.jsxs("div",{className:"flex items-center justify-between p-2 bg-black/40 border border-dashed border-white/10",children:[r.jsx("span",{className:"text-white font-mono text-xs",children:z.name}),r.jsxs("div",{className:"flex items-center space-x-2",children:[r.jsx("span",{className:`text-xs font-mono ${z.passed?"text-green-400":"text-red-300"}`,children:z.passed?"✓":"✗"}),r.jsx("span",{className:"text-xs text-gray-400 font-mono",children:z.message})]})]},Z))})]})]})]})]})}),mr&&r.jsx("div",{className:"fixed inset-0 bg-black/80 flex items-center justify-center z-[60] overflow-hidden",children:r.jsxs("div",{className:"bg-black border border-dashed border-white/20 rounded-none p-6 w-full max-w-4xl max-h-[90vh] overflow-y-auto",children:[r.jsxs("div",{className:"flex items-center justify-between mb-6",children:[r.jsxs("div",{className:"flex items-center space-x-2",children:[r.jsx(Yn,{className:"w-5 h-5 text-white"}),r.jsx("h3",{className:"text-xl text-white font-light uppercase tracking-wider",children:"OAuth Credentials"})]}),r.jsx($,{variant:"ghost",size:"sm",onClick:()=>Wa(!1),className:"text-gray-400 hover:text-white rounded-none",children:r.jsx(xt,{className:"w-4 h-4"})})]}),r.jsxs("div",{className:"space-y-4",children:[r.jsxs("div",{children:[r.jsx(pe,{className:"text-xs uppercase font-mono text-gray-400 mb-2 block",children:"Select Provider"}),r.jsx("div",{className:"flex flex-wrap gap-3",children:["google","github"].map(z=>{const Z=f===z;return r.jsx("button",{onClick:()=>p(z),className:`px-4 py-2 border rounded-none text-sm uppercase font-mono transition-colors ${Z?"border-white/60 bg-white/10 text-white":"border-dashed border-white/20 text-gray-400 hover:border-white/40"}`,children:z.charAt(0).toUpperCase()+z.slice(1)},z)})})]}),r.jsxs("div",{children:[r.jsx(pe,{className:"text-xs uppercase font-mono text-gray-400 mb-2 block",children:"Origin"}),r.jsx(Te,{value:Fn,onChange:z=>Bn(z.target.value),placeholder:`http://${Ea}`,className:"bg-black border border-dashed border-white/20 text-white font-mono text-xs rounded-none"}),r.jsxs("p",{className:"text-[11px] text-gray-500 font-mono mt-1",children:["The default will be http://",Ea]})]}),r.jsxs("div",{className:"flex items-end justify-end space-x-2",children:[r.jsx($,{variant:"outline",onClick:()=>{Jn(null),Bn(Ea)},className:"border border-dashed border-white/20 text-white hover:bg-white/10 rounded-none",children:"Clear"}),r.jsx($,{onClick:vU,disabled:Xa||!f||!Fn.trim()&&!Ea,className:"rounded-none",children:Xa?r.jsxs(r.Fragment,{children:[r.jsx(gn,{className:"w-4 h-4 mr-2 animate-spin"}),"Fetching..."]}):"Fetch Credentials"})]}),Qn&&r.jsxs("div",{className:"space-y-4",children:[r.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[r.jsxs("div",{children:[r.jsx(pe,{className:"text-xs uppercase font-mono text-gray-400 mb-2 block",children:"Client ID"}),r.jsxs("div",{className:"relative",children:[r.jsx(Te,{value:Qn.clientId,readOnly:!0,className:"bg-black border border-dashed border-white/20 text-white font-mono text-xs pr-10 rounded-none"}),r.jsx($,{variant:"ghost",size:"sm",onClick:()=>Aa(Qn.clientId),className:"absolute right-0 top-0 h-full px-3 text-gray-400 hover:text-white rounded-none",children:r.jsx(aa,{className:"w-4 h-4"})})]})]}),r.jsxs("div",{children:[r.jsx(pe,{className:"text-xs uppercase font-mono text-gray-400 mb-2 block",children:"Client Secret"}),r.jsxs("div",{className:"relative",children:[r.jsx(Te,{type:_s?"text":"password",value:Qn.clientSecret,readOnly:!0,className:"bg-black border border-dashed border-white/20 text-white font-mono text-xs pr-20 rounded-none"}),r.jsxs("div",{className:"absolute right-0 top-0 h-full flex items-center",children:[r.jsx($,{variant:"ghost",size:"sm",onClick:()=>Io(!_s),className:"px-2 text-gray-400 hover:text-white rounded-none",children:_s?r.jsx(Oh,{className:"w-4 h-4"}):r.jsx(gi,{className:"w-4 h-4"})}),r.jsx($,{variant:"ghost",size:"sm",onClick:()=>Aa(Qn.clientSecret),className:"px-2 text-gray-400 hover:text-white rounded-none",children:r.jsx(aa,{className:"w-4 h-4"})})]})]})]})]}),r.jsxs("div",{className:"flex items-center justify-between pt-2 border-t border-dashed border-white/10",children:[r.jsx("div",{className:"flex-1",children:dt&&r.jsx("div",{className:"text-xs font-mono",children:dt.success?r.jsxs("span",{className:"text-green-400 uppercase",children:["✓ ",dt.message.toLowerCase(),r.jsxs("span",{className:"block normal-case text-gray-400",children:[r.jsx("span",{className:"text-gray-400 mr-1",children:">"})," ",dt.path]})]}):r.jsxs("span",{className:"text-red-300",children:["✗ ",dt.message]})})}),r.jsx($,{onClick:wU,disabled:Rs||Mo,className:"rounded-none",children:Mo?r.jsxs(r.Fragment,{children:[r.jsx(gn,{className:"w-4 h-4 mr-2 animate-spin"}),"Checking..."]}):Rs?r.jsxs(r.Fragment,{children:[r.jsx(gn,{className:"w-4 h-4 mr-2 animate-spin"}),"Writing..."]}):r.jsxs(r.Fragment,{children:[r.jsx(zm,{className:"w-4 h-4 mr-2"}),"Write to .env"]})})]})]})]})]})}),Ds&&r.jsx("div",{className:"fixed inset-0 bg-black/80 flex items-center justify-center z-[60] overflow-hidden",children:r.jsxs("div",{className:"bg-black border border-dashed border-white/20 rounded-none p-6 w-full max-w-4xl max-h-[90vh] overflow-y-auto",children:[r.jsxs("div",{className:"flex items-center justify-between mb-6",children:[r.jsxs("div",{className:"flex items-center space-x-2",children:[r.jsx(Zi,{className:"w-5 h-5 text-white"}),r.jsx("h3",{className:"text-xl text-white font-light uppercase tracking-wider",children:"Secret Generator"})]}),r.jsx($,{variant:"ghost",size:"sm",onClick:()=>ye(!1),className:"text-gray-400 hover:text-white rounded-none",children:r.jsx(xt,{className:"w-4 h-4"})})]}),r.jsxs("div",{className:"space-y-6",children:[r.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[r.jsxs("div",{children:[r.jsx(pe,{className:"text-xs uppercase font-mono text-gray-400 mb-2 block",children:"Length (bytes)"}),r.jsx(Te,{type:"number",value:Le,onChange:z=>{const Z=parseInt(z.target.value,10);Z>=16&&Z<=128&&Oe(Z)},min:"16",max:"128",className:"bg-black border border-dashed border-white/20 text-white font-mono text-xs rounded-none"}),r.jsx("p",{className:"text-[11px] text-gray-500 font-mono mt-1",children:"Recommended: 32 bytes (256 bits)"})]}),r.jsxs("div",{children:[r.jsx(pe,{className:"text-xs uppercase font-mono text-gray-400 mb-2 block",children:"Format"}),r.jsx("div",{className:"flex gap-3",children:[{id:"hex",label:"Hex"},{id:"base64",label:"Base64"}].map(z=>r.jsx("button",{onClick:()=>nt(z.id),className:`px-4 py-2 border rounded-none text-sm uppercase font-mono transition-colors flex-1 ${Ce===z.id?"border-white/60 bg-white/10 text-white":"border-dashed border-white/20 text-gray-400 hover:border-white/40"}`,children:z.label},z.id))})]})]}),r.jsxs("div",{className:"flex justify-end space-x-2",children:[r.jsx($,{variant:"outline",onClick:()=>{Ee(null),Oe(32),nt("hex")},className:"border border-dashed border-white/20 text-white hover:bg-white/10 rounded-none",children:"Clear"}),r.jsx($,{onClick:xU,disabled:de,className:"rounded-none",children:de?r.jsxs(r.Fragment,{children:[r.jsx(gn,{className:"w-4 h-4 mr-2 animate-spin"}),"Generating..."]}):"Generate Secret"})]}),ve&&r.jsxs("div",{className:"space-y-4",children:[r.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-4 text-xs font-mono",children:[r.jsxs("div",{className:"border border-dashed border-white/10 p-3 space-y-2",children:[r.jsx("div",{className:"text-gray-400 uppercase tracking-wider",children:"Length"}),r.jsxs("p",{className:"text-white text-sm",children:[ve.length," bytes"]})]}),r.jsxs("div",{className:"border border-dashed border-white/10 p-3 space-y-2",children:[r.jsx("div",{className:"text-gray-400 uppercase tracking-wider",children:"Entropy"}),r.jsxs("p",{className:"text-white text-sm",children:[ve.entropy," bits"]})]}),r.jsxs("div",{className:"border border-dashed border-white/10 p-3 space-y-2",children:[r.jsx("div",{className:"text-gray-400 uppercase tracking-wider",children:"Format"}),r.jsx("p",{className:"text-white text-sm uppercase",children:ve.format})]})]}),r.jsxs("div",{children:[r.jsx(pe,{className:"text-xs uppercase font-mono text-gray-400 mb-2 block",children:"Generated Secret"}),r.jsxs("div",{className:"relative",children:[r.jsx(Te,{value:ve.secret,readOnly:!0,className:"bg-black border border-dashed border-white/20 text-white font-mono text-xs pr-10 rounded-none"}),r.jsx($,{variant:"ghost",size:"sm",onClick:()=>Aa(ve.secret),className:"absolute right-0 top-0 h-full px-3 text-gray-400 hover:text-white rounded-none",children:r.jsx(aa,{className:"w-4 h-4"})})]})]}),r.jsxs("div",{children:[r.jsx(pe,{className:"text-xs uppercase font-mono text-gray-400 mb-2 block",children:"Environment Variable Format"}),r.jsxs("div",{className:"relative",children:[r.jsx(Te,{value:ve.envFormat,readOnly:!0,className:"bg-black border border-dashed border-white/20 text-white font-mono text-xs pr-10 rounded-none"}),r.jsx($,{variant:"ghost",size:"sm",onClick:()=>Aa(ve.envFormat),className:"absolute right-0 top-0 h-full px-3 text-gray-400 hover:text-white rounded-none",children:r.jsx(aa,{className:"w-4 h-4"})})]}),r.jsxs("p",{className:"text-[11px] text-gray-500 font-mono mt-2",children:["Add this to your ",r.jsx("code",{className:"text-gray-400",children:".env"})," file. Keep it secret and never commit it to version control."]})]}),r.jsx("div",{className:"border border-dashed border-white/20 bg-black text-gray-300 text-xs font-mono p-3 rounded-none",children:r.jsxs("div",{className:"flex items-start space-x-2",children:[r.jsx(Ju,{className:"w-4 h-4 mt-0.5 flex-shrink-0 text-gray-400"}),r.jsxs("div",{children:[r.jsx("div",{className:"uppercase font-mono mb-2 text-gray-400 tracking-wider",children:"Security Best Practices"}),r.jsxs("ul",{className:"list-disc list-inside space-y-1 text-[11px] text-gray-300",children:[r.jsx("li",{children:"Use a minimum of 32 bytes (256 bits) for production"}),r.jsx("li",{children:"Store secrets in environment variables, never in code"}),r.jsx("li",{children:"Use different secrets for development and production"}),r.jsx("li",{children:"Rotate secrets periodically for enhanced security"})]})]})]})})]})]})]})}),br&&Zr&&r.jsx("div",{className:"fixed inset-0 bg-black/80 flex items-center justify-center z-[70] overflow-hidden",children:r.jsxs("div",{className:"bg-black border border-dashed border-white/20 rounded-none p-6 w-full max-w-2xl",children:[r.jsxs("div",{className:"flex items-center justify-between mb-6",children:[r.jsxs("div",{className:"flex items-center space-x-2",children:[r.jsx(Ju,{className:"w-5 h-5 text-yellow-400"}),r.jsx("h3",{className:"text-xl text-white font-light uppercase tracking-wider",children:"Overwrite Existing Credentials?"})]}),r.jsx($,{variant:"ghost",size:"sm",onClick:()=>{Os(!1),Ta(null),xr(!1)},className:"text-gray-400 hover:text-white rounded-none",children:r.jsx(xt,{className:"w-4 h-4"})})]}),r.jsxs("div",{className:"space-y-4",children:[r.jsxs("div",{className:"border border-dashed border-white/20 p-4",children:[r.jsxs("p",{className:"text-sm border-b border-dashed border-white/20 pb-5 text-gray-300 font-mono mb-3",children:["The following"," ",r.jsx("span",{className:"text-white uppercase",children:(f==null?void 0:f.charAt(0).toUpperCase())+(f==null?void 0:f.slice(1))})," ","credentials already exist in"," ",r.jsx("span",{className:"text-gray-400 normal-case",children:Zr.path}),":"]}),r.jsx("div",{className:"space-y-2 pt-2",children:Object.entries(Zr.credentials).map(([z,Z])=>r.jsxs("div",{className:"flex items-center justify-between text-xs font-mono",children:[r.jsx("span",{className:"text-gray-400 uppercase",children:z}),r.jsx("span",{className:"text-gray-500",children:Z.length>20?`${Z.substring(0,20)}...`:Z})]},z))})]}),r.jsxs("div",{className:"flex items-center justify-end space-x-3 pt-4 border-t border-dashed border-white/10",children:[r.jsx($,{variant:"outline",onClick:()=>{Os(!1),Ta(null),xr(!1)},className:"border border-dashed border-white/20 text-white hover:bg-white/10 rounded-none",children:"No, Cancel"}),r.jsx($,{variant:"outline",onClick:()=>Vp("append"),disabled:Rs,className:"border border-dashed border-white/20 text-white hover:bg-white/10 rounded-none",children:"Append"}),r.jsx($,{onClick:()=>Vp("override"),disabled:Rs,className:"rounded-none",children:Rs?r.jsxs(r.Fragment,{children:[r.jsx(gn,{className:"w-4 h-4 mr-2 animate-spin"}),"Writing..."]}):"Yes, Overwrite"})]})]})]})})]})}function Aue(){const{userId:e}=s1(),t=ur(),[n,a]=m.useState(null),[s,i]=m.useState([]),[o,l]=m.useState([]),[c,u]=m.useState([]),[h,d]=m.useState([]),[f,p]=m.useState(!0),[v,x]=m.useState("details"),[N,b]=m.useState(!1),[y,g]=m.useState(!1),[w,S]=m.useState(!1),[C,T]=m.useState(!1),[E,k]=m.useState(!1),[O,R]=m.useState("random"),[I,F]=m.useState(!1),[j,U]=m.useState(!1),[_,M]=m.useState(!1),[A,D]=m.useState(""),[B,G]=m.useState(),[L,q]=m.useState(!1),[W,K]=m.useState(""),[ne,te]=m.useState([]),[ee,ae]=m.useState(!1),[ge,re]=m.useState({}),fe=m.useRef({}),me=m.useCallback(async()=>{try{const ce=await(await fetch("/api/admin/status")).json();q(ce.enabled)}catch{q(!1)}},[]),Re=m.useCallback(async V=>{try{const ce=await fetch("/api/geo/resolve",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({ipAddress:V})});if(ce.ok){const he=await ce.json();if(he.success&&he.location)return he.location}return null}catch{return null}},[]),Me=m.useCallback(async V=>{const ce=V.filter(De=>!fe.current[De.id]);if(ce.length===0)return;const he=await Promise.all(ce.map(async De=>{const Ye=await Re(De.ipAddress);return Ye?{sessionId:De.id,location:Ye}:null})),xe={};he.forEach(De=>{De&&(xe[De.sessionId]=De.location)}),Object.keys(xe).length>0&&(fe.current={...fe.current,...xe},re(fe.current))},[Re]),Ue=V=>{if(!V)return"🌍";const ce=V.toUpperCase().split("").map(he=>127397+he.charCodeAt(0));return String.fromCodePoint(...ce)},$e=V=>V?V.replace(/[_-]/g," ").replace(/\b\w/g,ce=>ce.toUpperCase()):"Unknown Provider",pt=V=>{if(!V)return"Unknown";const ce=new Date(V);return Number.isNaN(ce.getTime())?"Unknown":ce.toLocaleString("en-US",{year:"numeric",month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"})},Ge=m.useCallback(async()=>{try{const V=await fetch(`/api/users/${e}`);if(V.ok){const ce=await V.json();a(ce.user)}else H.error("Failed to fetch user details"),t("/users")}catch{H.error("Failed to fetch user details"),t("/users")}finally{p(!1)}},[e,t]),jt=m.useCallback(async()=>{try{const[V,ce,he]=await Promise.all([fetch(`/api/users/${e}/organizations`),fetch(`/api/users/${e}/teams`),fetch(`/api/users/${e}/sessions`)]);if(V.ok){const xe=await V.json();i(xe.memberships||[])}if(ce.ok){const xe=await ce.json();l(xe.memberships||[])}if(he.ok){const De=(await he.json()).sessions||[];u(De),Me(De)}}catch{}},[e,Me]),St=m.useCallback(async()=>{try{const V=await fetch(`/api/users/${e}/accounts`);if(V.ok){const ce=await V.json();d(ce.accounts||[])}}catch{}},[e]),We=async()=>{var xe,De;if(!n)return;const V=(xe=document.getElementById("edit-name"))==null?void 0:xe.value,ce=(De=document.getElementById("edit-email"))==null?void 0:De.value;if(!V||!ce){H.error("Please fill in all fields");return}const he=H.loading("Updating user...");try{const Q=await(await fetch(`/api/users/${e}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:V,email:ce,role:W||null})})).json();Q.success?(a({...n,name:V,email:ce,role:W||void 0}),b(!1),K(""),H.success("User updated successfully!",{id:he})):H.error(`Error updating user: ${Q.error||"Unknown error"}`,{id:he})}catch{H.error("Error updating user",{id:he})}},et=async()=>{if(!n)return;const V=H.loading("Deleting user...");try{const he=await(await fetch(`/api/users/${e}`,{method:"DELETE",headers:{"Content-Type":"application/json"}})).json();he.success?(H.success("User deleted successfully!",{id:V}),t("/users")):H.error(`Error deleting user: ${he.error||"Unknown error"}`,{id:V})}catch{H.error("Error deleting user",{id:V})}},Ze=async()=>{if(!n)return;if(!L){H.error("Admin plugin is not enabled. Please enable the admin plugin in your Better Auth configuration to use ban functionality.");return}const V=H.loading("Banning user...");try{const ce=await fetch("/api/admin/ban-user",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({userId:e,banReason:A||"No reason provided",banExpiresIn:B})}),he=await ce.json();ce.ok?(H.success("User banned successfully!",{id:V}),g(!1),D(""),G(void 0),Ge()):ce.status===403?H.error("You do not have permission to ban users. Admin role required.",{id:V}):he.adminPluginEnabled&&he.instructions?H.error(`${he.error}`,{id:V,duration:6e3,description:`Use: ${he.instructions.example}`}):H.error(`Error banning user: ${he.error||he.message||"Unknown error"}`,{id:V})}catch{H.error("Error banning user",{id:V})}},Et=async()=>{if(!n)return;if(!L){H.error("Admin plugin is not enabled. Please enable the admin plugin in your Better Auth configuration to use unban functionality.");return}const V=H.loading("Unbanning user...");try{const ce=await fetch("/api/admin/unban-user",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({userId:e})}),he=await ce.json();ce.ok?(H.success("User unbanned successfully!",{id:V}),S(!1),Ge()):ce.status===403?H.error("You do not have permission to unban users. Admin role required.",{id:V}):he.adminPluginEnabled&&he.instructions?H.error(`${he.error}`,{id:V,duration:6e3,description:`Use: ${he.instructions.example}`}):H.error(`Error unbanning user: ${he.error||he.message||"Unknown error"}`,{id:V})}catch{H.error("Error unbanning user",{id:V})}},Tt=async V=>{const ce=H.loading("Removing user from organization...");try{const xe=await(await fetch(`/api/organizations/members/${V}`,{method:"DELETE"})).json();xe.success?(i(De=>De.filter(Ye=>Ye.id!==V)),jt(),H.success("User removed from organization!",{id:ce})):H.error(`Error removing user: ${xe.error||"Unknown error"}`,{id:ce})}catch{H.error("Error removing user from organization",{id:ce})}},qt=async V=>{const ce=H.loading("Removing user from team...");try{const xe=await(await fetch(`/api/teams/members/${V}`,{method:"DELETE"})).json();xe.success?(l(De=>De.filter(Ye=>Ye.id!==V)),jt(),H.success("User removed from team!",{id:ce})):H.error(`Error removing user: ${xe.error||"Unknown error"}`,{id:ce})}catch{H.error("Error removing user from team",{id:ce})}},Wt=async V=>{const ce=H.loading("Deleting session...");try{const xe=await(await fetch(`/api/sessions/${V}`,{method:"DELETE"})).json();xe.success?(u(De=>De.filter(Ye=>Ye.id!==V)),H.success("Session deleted successfully!",{id:ce})):H.error(`Error deleting session: ${xe.error||"Unknown error"}`,{id:ce})}catch{H.error("Error deleting session",{id:ce})}},se=async V=>{if(!e)return;const ce=H.loading("Unlinking account...");try{const he=await fetch(`/api/users/${e}/accounts/${V}`,{method:"DELETE"}),xe=await he.json();he.ok&&xe.success?(d(De=>De.filter(Ye=>Ye.id!==V)),await St(),H.success("Account unlinked successfully",{id:ce})):H.error(xe.error||"Failed to unlink account",{id:ce})}catch{H.error("Failed to unlink account",{id:ce})}};m.useEffect(()=>{e&&(Ge(),jt(),St(),me())},[e,me,Ge,jt,St]);const we=async(V=3)=>{if(e){te([]),ae(!0),te([{id:"start",type:"info",message:`Starting session seeding process for ${V} sessions...`,timestamp:new Date}]);try{const he=await(await fetch(`/api/users/${e}/seed-sessions`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({count:V})})).json();if(he.success){const xe=he.results.map((Ye,Q)=>Ye.success?{id:`session-${Q}`,type:"progress",message:`Creating session ${Q+1}: ${Ye.session.token.substring(0,20)}... from ${Ye.session.ipAddress}`,timestamp:new Date,status:"completed"}:{id:`session-${Q}`,type:"error",message:`Failed to create session ${Q+1}: ${Ye.error}`,timestamp:new Date});te(Ye=>[...Ye,...xe]);const De=he.results.filter(Ye=>Ye.success).length;te(Ye=>[...Ye,{id:"complete",type:"success",message:`✅ Session seeding completed! Created ${De}/${V} sessions successfully`,timestamp:new Date}]),jt()}else te(xe=>[...xe,{id:"error",type:"error",message:`❌ Session seeding failed: ${he.error||"Unknown error"}`,timestamp:new Date}])}catch(ce){te(he=>[...he,{id:"error",type:"error",message:`❌ Network error: ${ce}`,timestamp:new Date}])}finally{ae(!1)}}},Be=async(V=3,ce="random")=>{if(e){te([]),ae(!0),te([{id:"start",type:"info",message:`Starting account seeding process for ${V} accounts...`,timestamp:new Date}]);try{const xe=await(await fetch(`/api/users/${e}/seed-accounts`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({count:V,providerId:ce})})).json();if(xe.success){const De=xe.results.map((Q,ie)=>{var Ne;return Q.success?{id:`account-${ie}`,type:"progress",message:`Creating account ${ie+1}: ${Q.account.providerId||Q.account.provider} (${((Ne=Q.account.accountId)==null?void 0:Ne.substring(0,20))||Q.account.id.substring(0,20)}...)`,timestamp:new Date,status:"completed"}:{id:`account-${ie}`,type:"error",message:`Failed to create account ${ie+1}: ${Q.error}`,timestamp:new Date}});te(Q=>[...Q,...De]);const Ye=xe.results.filter(Q=>Q.success).length;te(Q=>[...Q,{id:"complete",type:"success",message:`✅ Account seeding completed! Created ${Ye}/${V} accounts successfully`,timestamp:new Date}]),St()}else te(De=>[...De,{id:"error",type:"error",message:`❌ Account seeding failed: ${xe.error||"Unknown error"}`,timestamp:new Date}])}catch(he){te(xe=>[...xe,{id:"error",type:"error",message:`❌ Network error: ${he}`,timestamp:new Date}])}finally{ae(!1)}}};return f?r.jsx("div",{className:"min-h-screen bg-black flex items-center justify-center",children:r.jsx("div",{className:"text-white text-lg",children:"Loading user details..."})}):n?r.jsxs("div",{className:"space-y-6 p-6 bg-black w-full",children:[r.jsxs("div",{className:"w-full flex flex-col",children:[r.jsx("span",{className:"mb-4 ml-0 flex justify-start items-start text-left border-none text-white",children:r.jsxs("span",{className:"font-light",children:[r.jsxs("span",{onClick:()=>t("/users"),className:"uppercase cursor-pointer text-white/80 font-mono text-sm",children:["users /"," "]}),r.jsx("span",{className:"text-white font-mono text-sm",children:n.id})]})}),r.jsx("div",{className:"mb-8 mt-4",children:r.jsxs("div",{className:"flex items-center justify-between",children:[r.jsxs("div",{className:"flex items-center space-x-4",children:[r.jsx("div",{className:"w-16 h-16 bg-gray-800 border border-dashed border-white/20 flex items-center justify-center",children:n.image?r.jsx("img",{src:n.image,alt:n.name,className:"w-16 h-16 object-cover"}):r.jsx(Mc,{className:"w-8 h-8 text-white"})}),r.jsxs("div",{children:[r.jsxs("h1",{className:"text-3xl font-light text-white inline-flex items-center",children:[n.name,r.jsx(Ln,{id:n.id,variant:"subscript"}),n.role&&r.jsx("sup",{className:"ml-2 px-2 pt-2 pb-2 -mt-1 py-0.5 text-[10px] font-mono uppercase border border-dashed border-white/15 bg-white/5 text-white/80 rounded-none",children:n.role}),n.banned&&r.jsxs("sup",{className:"relative group inline-block ml-2 px-2 pt-2 pb-2 -mt-1 py-0.5 text-[10px] font-mono uppercase border border-dashed border-red-500/30 bg-red-500/10 text-red-400/80 rounded-none cursor-help",children:["Banned",n.banReason&&r.jsxs("span",{className:"absolute lowercase left-1/2 -translate-x-1/2 bottom-full mb-3 px-2 py-2 text-[10px] font-mono text-gray-300 bg-black border border-dashed border-white/20 rounded-none whitespace-nowrap opacity-0 invisible group-hover:opacity-100 group-hover:visible transition-all duration-150 pointer-events-none z-50",children:[r.jsx("span",{className:"text-gray-400 font-mono text-xs uppercase mr-1",children:"Banned Reason:"}),n.banReason,r.jsx("span",{className:"absolute left-1/2 -translate-x-1/2 top-full w-0 h-0 border-l-[4px] border-r-[4px] border-t-[4px] border-transparent border-t-white/20"})]})]})]}),r.jsx("p",{className:"text-gray-400 font-mono text-sm",children:n.email})]})]}),r.jsx("div",{className:"flex items-center space-x-2",children:r.jsxs("div",{className:"relative",children:[r.jsx($,{variant:"ghost",size:"sm",className:"text-gray-400 hover:text-white rounded-none",onClick:V=>{V.stopPropagation(),M(!_)},children:r.jsx(YM,{className:"w-4 h-4"})}),_&&r.jsxs("div",{className:"absolute z-[999] right-0 top-full mt-1 w-48 bg-black border border-white/20 rounded-none shadow-lg",onClick:V=>V.stopPropagation(),children:[r.jsxs("button",{className:"w-full px-4 py-2 text-left text-sm text-white hover:bg-white/10 flex items-center space-x-2",onClick:V=>{V.stopPropagation(),M(!1),b(!0),K(n.role||"")},children:[r.jsx(bo,{className:"w-4 h-4"}),r.jsx("span",{children:"Edit User"})]}),r.jsxs("button",{className:"w-full px-4 py-2 text-left text-sm text-white hover:bg-white/10 flex items-center space-x-2",onClick:V=>{V.stopPropagation(),M(!1),F(!0)},children:[r.jsx(Cn,{className:"w-4 h-4"}),r.jsx("span",{children:"Update Password"})]}),L&&(n.banned?r.jsxs("button",{className:"w-full px-4 py-2 text-left text-sm text-green-400 hover:bg-white/10 flex items-center space-x-2",onClick:V=>{V.stopPropagation(),M(!1),S(!0)},children:[r.jsx(ug,{className:"w-4 h-4"}),r.jsx("span",{children:"Unban User"})]}):r.jsxs("button",{className:"w-full px-4 py-2 text-left text-sm text-yellow-400 hover:bg-white/10 flex items-center space-x-2",onClick:V=>{V.stopPropagation(),M(!1),g(!0)},children:[r.jsx(ug,{className:"w-4 h-4"}),r.jsx("span",{children:"Ban User"})]})),r.jsx("div",{className:"border-t border-white/10 my-1"}),r.jsxs("button",{className:"w-full px-4 py-2 text-left text-sm text-red-400 hover:bg-white/10 flex items-center space-x-2",onClick:V=>{V.stopPropagation(),M(!1),U(!0)},children:[r.jsx(bu,{className:"w-4 h-4"}),r.jsx("span",{children:"Delete User"})]})]})]})})]})}),r.jsxs("div",{className:"border border-dashed border-white/20 rounded-none",children:[r.jsx("div",{className:"border-b border-dashed border-white/20",children:r.jsx("nav",{className:"flex space-x-8 px-6",children:[{id:"details",name:"Details",icon:Mc},{id:"organizations",name:"Organizations",icon:ha,count:s.length},{id:"teams",name:"Teams",icon:Ct,count:o.length},{id:"accounts",name:"Accounts",icon:Xi,count:h.length},{id:"sessions",name:"Sessions",icon:Dw,count:c.length}].map(V=>r.jsxs("button",{onClick:()=>x(V.id),className:`flex items-center space-x-2 py-4 px-2 border-b-2 font-medium text-sm ${v===V.id?"border-white text-white":"border-transparent text-gray-400 hover:text-white hover:border-white/50"}`,children:[r.jsx(V.icon,{className:"w-4 h-4 text-white/90"}),r.jsxs("span",{className:"inline-flex items-start",children:[r.jsx("span",{className:"",children:V.name}),V.count!==void 0&&r.jsx("sup",{className:"text-xs text-gray-500 ml-1 inline-flex items-baseline",children:r.jsx(rr,{value:V.count,className:"text-white/80 font-mono text-xs",prefix:r.jsx("span",{className:"mr-0.5 text-gray-500",children:"["}),suffix:r.jsx("span",{className:"ml-0.5 text-gray-500",children:"]"}),format:{notation:"standard",maximumFractionDigits:0}})})]})]},V.id))})}),r.jsxs("div",{className:"p-6",children:[v==="details"&&r.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-6",children:[r.jsxs("div",{className:"overflow-x-hidden bg-white/[3%] border border-white/10 p-6 rounded-none",children:[r.jsx("h3",{className:"text-sm uppercase font-mono text-gray-400 mb-4 tracking-wider",children:"BASIC INFORMATION"}),r.jsx("hr",{className:"border-white/10 -mx-10 border-dashed my-4"}),r.jsxs("div",{className:"space-y-4",children:[r.jsxs("div",{className:"flex items-start space-x-3",children:[r.jsx(Mc,{className:"w-4 h-4 text-gray-400 mt-1"}),r.jsxs("div",{className:"flex-1",children:[r.jsx("div",{className:"text-xs uppercase font-mono text-gray-500 mb-1",children:"Name"}),r.jsx("div",{className:"text-white font-sans text-sm",children:n.name})]})]}),r.jsxs("div",{className:"flex items-start space-x-3",children:[r.jsx(as,{className:"w-4 h-4 text-gray-400 mt-1"}),r.jsxs("div",{className:"flex-1",children:[r.jsx("div",{className:"text-xs uppercase font-mono text-gray-500 mb-1",children:"Email"}),r.jsx("div",{className:"text-white font-mono text-sm",children:n.email})]})]}),n.username&&r.jsxs("div",{className:"flex items-start space-x-3",children:[r.jsx(gte,{className:"w-4 h-4 text-gray-400 mt-1"}),r.jsxs("div",{className:"flex-1",children:[r.jsx("div",{className:"text-xs uppercase font-mono text-gray-500 mb-1",children:"Username"}),r.jsx("div",{className:"text-white font-mono text-sm",children:n.username})]})]}),n.phoneNumber&&r.jsxs("div",{className:"flex items-start space-x-3",children:[r.jsx(mte,{className:"w-4 h-4 text-gray-400 mt-1"}),r.jsxs("div",{className:"flex-1",children:[r.jsx("div",{className:"text-xs uppercase font-mono text-gray-500 mb-1",children:"Phone"}),r.jsx("div",{className:"text-white font-mono text-sm",children:"+251 91 234 5678"})]})]}),r.jsxs("div",{className:"flex items-start space-x-3",children:[r.jsx(Za,{className:"w-4 h-4 text-gray-400 mt-1"}),r.jsxs("div",{className:"flex-1",children:[r.jsx("div",{className:"text-xs uppercase font-mono text-gray-500 mb-1",children:"Member Since"}),r.jsx("div",{className:"text-white font-mono text-sm",children:new Date(n.createdAt).toLocaleDateString("en-US",{month:"short",day:"numeric",year:"numeric",hour:"2-digit",minute:"2-digit"})})]})]})]})]}),r.jsxs("div",{className:"overflow-x-hidden bg-white/[3%] border border-white/10 p-6 rounded-none",children:[r.jsx("h3",{className:"text-sm uppercase font-mono text-gray-400 mb-4 tracking-wider",children:"SECURITY"}),r.jsx("hr",{className:"border-white/10 -mx-10 border-dashed my-4"}),r.jsxs("div",{className:"space-y-4",children:[r.jsxs("div",{className:"flex items-center justify-between p-3 bg-black/30 border border-white/10 rounded-none",children:[r.jsxs("div",{className:"flex items-center space-x-3",children:[r.jsx(as,{className:"w-4 h-4 text-gray-400"}),r.jsx("div",{children:r.jsx("div",{className:"text-xs uppercase font-mono text-gray-500",children:"Email Verification"})})]}),r.jsx("div",{className:`px-2 rounded-none border border-dashed border-white/20 uppercase py-1 text-xs font-mono ${n.emailVerified?"bg-green-500/20 text-green-400":"bg-red-500/20 text-red-400"}`,children:n.emailVerified?"Verified":"Unverified"})]}),r.jsxs("div",{className:"flex items-center justify-between p-3 bg-black/30 border border-white/10 rounded-none",children:[r.jsxs("div",{className:"flex items-center space-x-3",children:[r.jsx(ps,{className:"w-4 h-4 text-gray-400"}),r.jsx("div",{children:r.jsx("div",{className:"text-xs uppercase font-mono text-gray-500",children:"Two-Factor Authentication"})})]}),r.jsx("div",{className:`px-2 rounded-none border border-dashed border-white/20 uppercase py-1 text-xs font-mono ${n.twoFactorEnabled?"bg-green-500/20 text-green-400":"bg-red-500/20 text-red-400"}`,children:n.twoFactorEnabled?"Enabled":"Disabled"})]})]})]})]}),v==="organizations"&&r.jsx("div",{className:"space-y-4",children:s.length===0?r.jsxs("div",{className:"text-center py-12",children:[r.jsx(ha,{className:"w-12 h-12 text-gray-400 mx-auto mb-4"}),r.jsx("h3",{className:"text-lg font-medium text-white mb-2",children:"No Organizations"}),r.jsx("p",{className:"text-gray-400",children:"This user is not a member of any organizations."})]}):r.jsx("div",{className:"grid gap-4",children:s.map(V=>r.jsxs("div",{className:"border border-dashed border-white/10 rounded-none p-4 hover:bg-white/5 transition-colors",children:[r.jsxs("div",{className:"flex items-start justify-between mb-3",children:[r.jsxs("div",{className:"flex items-center space-x-4 flex-1",children:[r.jsx("div",{className:"w-12 h-12 bg-black/80 border border-dashed border-white/20 flex items-center justify-center rounded-none",children:V.organization.image?r.jsx("img",{src:V.organization.image,alt:V.organization.name,className:"w-12 h-12 object-cover"}):r.jsx(ha,{className:"w-6 h-6 text-white"})}),r.jsxs("div",{className:"flex-1",children:[r.jsxs("h3",{className:"text-white font-light inline-flex items-start",children:[V.organization.name,r.jsxs("sup",{className:"text-xs text-gray-500 ml-2 mt-0.5",children:[r.jsx("span",{className:"mr-1",children:"["}),r.jsx("span",{className:"text-white/80 font-mono text-xs",children:V.organization.slug}),r.jsx("span",{className:"ml-1",children:"]"})]})]}),r.jsxs("p",{className:"text-gray-400 text-sm font-sans mt-1",children:["in ",V.organization.slug]})]})]}),r.jsx("div",{className:"flex flex-col items-end space-y-2",children:r.jsxs("div",{className:"flex items-center space-x-2",children:[r.jsxs("span",{className:"text-gray-500 font-mono text-xs uppercase",children:["Joined:"," "]}),r.jsxs("span",{className:"text-white font-mono text-xs",children:[new Date(V.joinedAt).toLocaleDateString("en-US",{year:"numeric",month:"short",day:"numeric"}),","," ",new Date(V.joinedAt).toLocaleTimeString("en-US",{hour:"numeric",minute:"2-digit",hour12:!0})]})]})})]}),r.jsx("div",{className:"flex items-center justify-end",children:r.jsxs($,{variant:"outline",size:"sm",onClick:()=>Tt(V.id),className:"border border-dashed border-red-400/20 text-red-400 hover:bg-red-400/10 rounded-none",children:[r.jsx(dg,{className:"w-4 h-4 mr-1"}),"Remove"]})})]},V.id))})}),v==="teams"&&r.jsx("div",{className:"space-y-4",children:o.length===0?r.jsxs("div",{className:"text-center py-12",children:[r.jsx(Ct,{className:"w-12 h-12 text-gray-400 mx-auto mb-4"}),r.jsx("h3",{className:"text-lg font-medium text-white mb-2",children:"No Teams"}),r.jsx("p",{className:"text-gray-400",children:"This user is not a member of any teams."})]}):r.jsx("div",{className:"grid gap-4",children:o.map(V=>r.jsxs("div",{className:"border border-dashed border-white/10 rounded-none p-4 hover:bg-white/5 transition-colors",children:[r.jsxs("div",{className:"flex items-start justify-between mb-3",children:[r.jsxs("div",{className:"flex items-center space-x-4 flex-1",children:[r.jsx("div",{className:"w-12 h-12 bg-black/80 border border-dashed border-white/20 flex items-center justify-center rounded-none",children:r.jsx(Ct,{className:"w-6 h-6 text-white"})}),r.jsxs("div",{className:"flex-1",children:[r.jsxs("h3",{className:"text-white font-light inline-flex items-start",children:[V.team.name,r.jsx(Ln,{id:V.team.id,variant:"subscript",nonSliced:!!(V.team.organizationSlug||V.team.organizationName)})]}),r.jsxs("p",{className:"text-gray-400 text-sm font-sans mt-1",children:["in"," ",V.team.organizationSlug||V.team.organizationName]})]})]}),r.jsx("div",{className:"flex flex-col items-end space-y-2",children:r.jsxs("div",{className:"flex items-center space-x-2",children:[r.jsxs("span",{className:"text-gray-500 font-mono text-xs uppercase",children:["Joined:"," "]}),r.jsxs("span",{className:"text-white font-mono text-xs",children:[new Date(V.joinedAt).toLocaleDateString("en-US",{year:"numeric",month:"short",day:"numeric"}),","," ",new Date(V.joinedAt).toLocaleTimeString("en-US",{hour:"numeric",minute:"2-digit",hour12:!0})]})]})})]}),r.jsx("div",{className:"flex items-center justify-end",children:r.jsxs($,{variant:"outline",size:"sm",onClick:()=>qt(V.id),className:"border border-dashed border-red-400/20 text-red-400 hover:bg-red-400/10 rounded-none",children:[r.jsx(dg,{className:"w-4 h-4 mr-1"}),"Remove"]})})]},V.id))})}),v==="accounts"&&r.jsxs("div",{className:"space-y-4",children:[r.jsxs("div",{className:"flex items-center justify-between mb-4",children:[r.jsxs("div",{children:[r.jsx("h3",{className:"text-lg font-medium text-white",children:"Linked Accounts"}),r.jsx("p",{className:"text-gray-400 text-sm",children:"Manage user OAuth account connections"})]}),r.jsxs($,{variant:"outline",onClick:()=>{te([]),ae(!1),k(!0)},className:"border border-dashed border-white/20 text-white hover:bg-white/10 rounded-none",children:[r.jsx(Xi,{className:"w-4 h-4 mr-2"}),"Seed Accounts"]})]}),h.length===0?r.jsxs("div",{className:"text-center py-12",children:[r.jsx(Xi,{className:"w-12 h-12 text-gray-400 mx-auto mb-4"}),r.jsx("h3",{className:"text-lg font-medium text-white mb-2",children:"No Linked Accounts"}),r.jsx("p",{className:"text-gray-400",children:"This user has not connected any accounts yet."})]}):r.jsx("div",{className:"grid gap-4",children:h.map(V=>r.jsxs("div",{className:"border border-dashed border-white/10 rounded-none p-4 hover:bg-white/5 transition-colors",children:[r.jsxs("div",{className:"flex items-start justify-between mb-3",children:[r.jsxs("div",{className:"flex items-center space-x-4 flex-1",children:[r.jsx("div",{className:"w-12 h-12 bg-black/80 border border-dashed border-white/20 flex items-center justify-center rounded-none",children:nU(V.providerId)}),r.jsxs("div",{className:"flex-1",children:[r.jsxs("h3",{className:"text-white font-light inline-flex items-start",children:[$e(V.providerId),r.jsx(Ln,{id:V.accountId,variant:"subscript",nonSliced:!!(V.email||n.email)})]}),r.jsx("p",{className:"text-gray-400 tracking-tight uppercase text-xs font-mono mt-1",children:`ID: ${V.id}`})]})]}),r.jsx("div",{className:"flex flex-col items-end space-y-2 text-right",children:r.jsxs("div",{className:"flex items-center space-x-2 text-xs font-mono text-gray-400",children:[r.jsx("span",{children:"Linked:"}),r.jsx("span",{className:"text-white",children:pt(V.createdAt||V.updatedAt)})]})})]}),r.jsx("div",{className:"flex items-center justify-end",children:r.jsxs($,{variant:"outline",size:"sm",onClick:()=>se(V.id),className:"border border-dashed border-red-400/20 text-red-400 hover:bg-red-400/10 rounded-none",children:[r.jsx(dg,{className:"w-4 h-4 mr-1"}),"Unlink"]})})]},V.id))})]}),v==="sessions"&&r.jsxs("div",{className:"space-y-4",children:[r.jsxs("div",{className:"flex items-center justify-between mb-4",children:[r.jsxs("div",{children:[r.jsx("h3",{className:"text-lg font-medium text-white",children:"Sessions"}),r.jsx("p",{className:"text-gray-400 text-sm",children:"Manage user authentication sessions"})]}),r.jsxs($,{variant:"outline",onClick:()=>{te([]),ae(!1),T(!0)},className:"border border-dashed border-white/20 text-white hover:bg-white/10 rounded-none",children:[r.jsx(ps,{className:"w-4 h-4 mr-2"}),"Seed Sessions"]})]}),c.length===0?r.jsxs("div",{className:"text-center py-12",children:[r.jsx(Dw,{className:"w-12 h-12 text-gray-400 mx-auto mb-4"}),r.jsx("h3",{className:"text-lg font-medium text-white mb-2",children:"No Sessions"}),r.jsx("p",{className:"text-gray-400",children:"This user has no active sessions."})]}):r.jsx("div",{className:"grid gap-4",children:c.map(V=>{var ce,he,xe,De;return r.jsxs("div",{className:"border border-dashed border-white/10 rounded-none p-4 hover:bg-white/5 transition-colors",children:[r.jsxs("div",{className:"flex items-start justify-between mb-3",children:[r.jsxs("div",{className:"flex items-center space-x-4 flex-1",children:[r.jsx("div",{className:"w-12 h-12 bg-black/80 border border-dashed border-white/20 flex items-center justify-center rounded-none",children:r.jsx(cC,{className:"w-6 h-6 text-white"})}),r.jsxs("div",{className:"flex-1",children:[r.jsxs("h3",{className:"text-white font-light inline-flex items-start",children:["Session ",V.id.substring(0,8),"...",r.jsxs("sup",{className:"text-xs text-gray-500 ml-2 mt-0.5",children:[r.jsx("span",{className:"mr-1",children:"["}),r.jsx("span",{className:"text-white/80 font-mono text-xs",children:V.ipAddress}),r.jsx("span",{className:"ml-1",children:"]"})]})]}),r.jsxs("div",{className:"flex items-center space-x-2 mt-2",children:[r.jsx(pte,{className:"w-3.5 h-3.5 text-gray-400"}),r.jsxs("span",{className:"text-gray-400 uppercase font-mono text-xs",children:[((ce=ge[V.id])==null?void 0:ce.city)||"...",","," ",((he=ge[V.id])==null?void 0:he.country)||"..."]}),((xe=ge[V.id])==null?void 0:xe.countryCode)&&r.jsx("span",{className:"text-xs ml-1",children:Ue((De=ge[V.id])==null?void 0:De.countryCode)})]})]})]}),r.jsx("div",{className:"flex flex-col items-end space-y-2",children:r.jsxs("div",{className:"flex items-center space-x-2",children:[r.jsxs("span",{className:"text-gray-500 font-mono text-xs uppercase",children:["Expires:"," "]}),r.jsxs("span",{className:"text-white font-mono text-xs",children:[new Date(V.expiresAt).toLocaleDateString("en-US",{year:"numeric",month:"short",day:"numeric"}),","," ",new Date(V.expiresAt).toLocaleTimeString("en-US",{hour:"numeric",minute:"2-digit",hour12:!0})]})]})})]}),r.jsx("div",{className:"flex items-center justify-end",children:r.jsxs($,{variant:"outline",size:"sm",onClick:()=>Wt(V.id),className:"border border-dashed border-red-400/20 text-red-400 hover:bg-red-400/10 rounded-none",children:[r.jsx(ug,{className:"w-4 h-4 mr-1"}),"Revoke"]})})]},V.id)})})]})]})]})]}),N&&r.jsx("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center z-50",children:r.jsxs("div",{className:"bg-black/90 border border-dashed border-white/20 rounded-none p-6 w-full max-w-md",children:[r.jsxs("div",{className:"flex items-center justify-between mb-4",children:[r.jsx("h3",{className:"text-lg text-white font-light",children:"Edit User"}),r.jsx($,{variant:"ghost",size:"sm",onClick:()=>{b(!1),K("")},className:"text-gray-400 hover:text-white rounded-none",children:"×"})]}),r.jsxs("div",{className:"space-y-4",children:[r.jsxs("div",{className:"flex items-center space-x-3",children:[r.jsx("div",{className:"w-16 h-16 bg-black/80 border border-dashed border-white/20 flex items-center justify-center",children:n!=null&&n.image?r.jsx("img",{src:n.image,alt:n.name,className:"w-16 h-16 object-cover"}):r.jsx(Mc,{className:"w-8 h-8 text-white"})}),r.jsxs("div",{className:"flex-1",children:[r.jsx("h4",{className:"text-white font-medium",children:n==null?void 0:n.name}),r.jsx("p",{className:"text-gray-400 text-sm",children:n==null?void 0:n.email})]})]}),r.jsxs("div",{children:[r.jsx("label",{className:"block text-sm font-medium text-gray-400 mb-2",children:"Name"}),r.jsx("input",{id:"edit-name",type:"text",defaultValue:(n==null?void 0:n.name)||"",className:"w-full px-3 py-2 bg-gray-800 border border-dashed border-white/20 rounded-none text-white placeholder-gray-400 focus:outline-none focus:border-white/50"})]}),r.jsxs("div",{children:[r.jsx("label",{className:"block text-sm font-medium text-gray-400 mb-2",children:"Email"}),r.jsx("input",{id:"edit-email",type:"email",defaultValue:(n==null?void 0:n.email)||"",className:"w-full px-3 py-2 bg-gray-800 border border-dashed border-white/20 rounded-none text-white placeholder-gray-400 focus:outline-none focus:border-white/50"})]}),r.jsxs("div",{children:[r.jsx("label",{className:"block text-sm font-medium text-gray-400 mb-2",children:"Role"}),r.jsxs(Ua,{className:"bg-black text-white",value:W,onValueChange:K,children:[r.jsx(Pa,{className:"w-full border border-dashed border-white/20 bg-black text-white rounded-none",children:r.jsx(yi,{placeholder:"Select role"})}),r.jsxs(Fa,{children:[r.jsx(Ve,{value:"",children:"None"}),r.jsx(Ve,{value:"admin",children:"Admin"}),r.jsx(Ve,{value:"user",children:"User"})]})]})]})]}),r.jsxs("div",{className:"flex justify-end space-x-2 mt-6",children:[r.jsx($,{variant:"outline",onClick:()=>{b(!1),K("")},className:"border border-dashed border-white/20 text-white hover:bg-white/10 rounded-none",children:"Cancel"}),r.jsx($,{onClick:We,className:"bg-white hover:bg-white/90 text-black border border-white/20 rounded-none",children:"Update"})]})]})}),y&&r.jsx("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center z-50",children:r.jsxs("div",{className:"bg-black border border-red-400/20 rounded-none p-6 w-full max-w-md",children:[r.jsx("h2",{className:"text-xl font-bold text-white mb-4",children:"Ban User"}),r.jsxs("p",{className:"text-gray-400 mb-4",children:["Ban ",r.jsx("strong",{children:n.name})," from accessing the system."]}),r.jsxs("div",{className:"space-y-4 mb-6",children:[r.jsxs("div",{children:[r.jsx(pe,{htmlFor:"banReason",className:"text-white",children:"Ban Reason"}),r.jsx(Te,{id:"banReason",value:A,onChange:V=>D(V.target.value),placeholder:"Enter reason for ban (optional)",className:"bg-black border border-dashed border-white/20 text-white rounded-none"})]}),r.jsxs("div",{children:[r.jsx(pe,{htmlFor:"banExpires",className:"text-white",children:"Ban Duration (seconds)"}),r.jsx(Te,{id:"banExpires",type:"number",value:B||"",onChange:V=>G(V.target.value?Number(V.target.value):void 0),placeholder:"Leave empty for permanent ban",className:"bg-black border border-dashed border-white/20 text-white rounded-none"}),r.jsx("p",{className:"text-xs text-gray-400 mt-1",children:"Examples: 3600 (1 hour), 86400 (1 day), 604800 (1 week)"})]})]}),r.jsxs("div",{className:"flex justify-end space-x-2",children:[r.jsx($,{variant:"outline",onClick:()=>{g(!1),D(""),G(void 0)},className:"border border-dashed border-white/20 text-white hover:bg-white/10 rounded-none",children:"Cancel"}),r.jsx($,{onClick:Ze,className:"bg-red-600 text-white hover:bg-red-700 rounded-none",children:"Ban User"})]})]})}),w&&r.jsx("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center z-50",children:r.jsxs("div",{className:"bg-black border border-green-400/20 rounded-none p-6 w-full max-w-md",children:[r.jsx("h2",{className:"text-xl font-bold text-white mb-4",children:"Unban User"}),r.jsxs("p",{className:"text-gray-400 mb-6",children:["Are you sure you want to unban ",r.jsx("strong",{children:n.name}),"? This will restore their access to the system."]}),r.jsxs("div",{className:"flex justify-end space-x-2",children:[r.jsx($,{variant:"outline",onClick:()=>S(!1),className:"border border-dashed border-white/20 text-white hover:bg-white/10 rounded-none",children:"Cancel"}),r.jsx($,{onClick:Et,className:"bg-green-400 text-white hover:bg-green-700 rounded-none",children:"Unban User"})]})]})}),j&&n&&r.jsx("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center z-50",children:r.jsxs("div",{className:"bg-black/90 border border-dashed border-white/20 p-6 w-full max-w-md rounded-none",children:[r.jsxs("div",{className:"flex items-center justify-between mb-4",children:[r.jsx("h3",{className:"text-lg text-white font-light",children:"Delete User"}),r.jsx($,{variant:"ghost",size:"sm",onClick:()=>U(!1),className:"text-gray-400 hover:text-white rounded-none",children:r.jsx(xt,{className:"w-4 h-4"})})]}),r.jsxs("div",{className:"space-y-4",children:[r.jsxs("div",{className:"flex items-center space-x-3",children:[r.jsx("div",{className:"w-16 h-16 bg-black/80 border border-dashed border-white/20 flex items-center justify-center",children:n.image?r.jsx("img",{src:n.image,alt:n.name,className:"w-16 h-16 object-cover"}):r.jsx(Mc,{className:"w-8 h-8 text-white"})}),r.jsxs("div",{children:[r.jsx("div",{className:"text-white font-light",children:n.name}),r.jsx("div",{className:"text-sm text-gray-400",children:n.email})]})]}),r.jsx("p",{className:"text-gray-400",children:"Are you sure you want to delete this user? This action cannot be undone."})]}),r.jsxs("div",{className:"flex justify-end space-x-3 mt-6",children:[r.jsx($,{variant:"outline",onClick:()=>U(!1),className:"border border-dashed border-white/20 text-white hover:bg-white/10 rounded-none",children:"Cancel"}),r.jsx($,{onClick:et,className:"bg-red-500 hover:bg-red-600 text-white border border-red-500 rounded-none",children:"Delete"})]})]})}),I&&n&&r.jsx("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center z-50",children:r.jsxs("div",{className:"bg-black/90 border border-dashed border-white/20 p-6 w-full max-w-md rounded-none",children:[r.jsxs("div",{className:"flex items-center justify-between mb-4",children:[r.jsx("h3",{className:"text-lg text-white font-light",children:"Update Password"}),r.jsx($,{variant:"ghost",size:"sm",onClick:()=>F(!1),className:"text-gray-400 hover:text-white rounded-none",children:r.jsx(xt,{className:"w-4 h-4"})})]}),r.jsx("div",{className:"space-y-4",children:r.jsxs("div",{children:[r.jsx(pe,{htmlFor:"new-password",className:"text-sm text-gray-400 font-light",children:"New Password"}),r.jsx(Te,{id:"new-password",type:"password",className:"mt-1 border border-dashed border-white/20 bg-black/30 text-white rounded-none"})]})}),r.jsxs("div",{className:"flex justify-end space-x-3 mt-6",children:[r.jsx($,{variant:"outline",onClick:()=>F(!1),className:"border border-dashed border-white/20 text-white hover:bg-white/10 rounded-none",children:"Cancel"}),r.jsx($,{onClick:async()=>{var he;const V=(he=document.getElementById("new-password"))==null?void 0:he.value;if(!V){H.error("Please enter a password");return}const ce=H.loading("Updating password...");try{const De=await(await fetch(`/api/users/${e}/password`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({password:V})})).json();De.success?(F(!1),document.getElementById("new-password").value="",H.success("Password updated successfully!",{id:ce})):H.error(`Error updating password: ${De.error||"Unknown error"}`,{id:ce})}catch{H.error("Error updating password",{id:ce})}},className:"bg-white hover:bg-white/90 text-black border border-white/20 rounded-none",children:"Update"})]})]})}),C&&r.jsx("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center z-50 overflow-hidden",children:r.jsxs("div",{className:"overflow-x-hidden overflow-y-auto bg-black/90 border border-white/10 p-6 w-full pt-4 max-w-2xl rounded-none max-h-[90vh]",children:[r.jsxs("div",{className:"flex items-center justify-between mb-6",children:[r.jsxs("h3",{className:"text-sm text-white flex items-center justify-center font-light uppercase",children:[r.jsx("span",{className:"text-white/50 mr-2",children:"["}),r.jsx(cC,{className:"inline mr-2 w-3 h-3 text-white"}),r.jsx("span",{className:"font-mono text-white/70 uppercase",children:"Seed Sessions"}),r.jsx("span",{className:"text-white/50 ml-2",children:"]"})]}),r.jsx($,{variant:"ghost",size:"sm",onClick:()=>T(!1),className:"text-gray-400 hover:text-white rounded-none",children:r.jsx(xt,{className:"w-4 h-4"})})]}),r.jsx("hr",{className:"border-white/10 -mx-10 border-dashed -mt-4 mb-4"}),r.jsxs("div",{className:"space-y-6",children:[r.jsx("div",{className:"space-y-4",children:r.jsxs("div",{className:"flex items-center space-x-3",children:[r.jsxs("div",{className:"flex-1",children:[r.jsx(pe,{htmlFor:"session-count",className:"text-sm text-gray-400 font-light",children:"Number of sessions"}),r.jsx(Te,{id:"session-count",type:"number",min:"1",max:"50",defaultValue:"3",className:"mt-1 border border-dashed border-white/20 bg-black/30 text-white rounded-none"})]}),r.jsx($,{onClick:()=>{var ce;const V=parseInt(((ce=document.getElementById("session-count"))==null?void 0:ce.value)||"3",10);we(V)},disabled:ee,className:"bg-transparent hover:bg-white/90 bg-white text-black border border-white/20 rounded-none mt-6 disabled:opacity-50",children:ee?r.jsxs(r.Fragment,{children:[r.jsx(gn,{className:"w-3 h-3 mr-2 animate-spin"}),"Seeding..."]}):r.jsxs(r.Fragment,{children:[r.jsx(ps,{className:"w-3 h-3 mr-2"}),"Seed Sessions"]})})]})}),ne.length>0&&r.jsx("div",{className:"mt-6",children:r.jsx(ji,{title:"Session Seeding Terminal",lines:ne,isRunning:ee,className:"w-full",defaultCollapsed:!0})})]}),r.jsx("hr",{className:"border-white/10 -mx-10 border-dashed mt-10"}),r.jsx("div",{className:"flex justify-end mt-6 pt-6",children:r.jsx($,{variant:"outline",onClick:()=>T(!1),className:"border border-dashed border-white/20 text-white hover:bg-white/10 rounded-none",children:"Close"})})]})}),E&&r.jsx("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center z-50 overflow-hidden",children:r.jsxs("div",{className:"overflow-x-hidden overflow-y-auto bg-black/90 border border-white/10 p-6 w-full pt-4 max-w-2xl rounded-none max-h-[90vh]",children:[r.jsxs("div",{className:"flex items-center justify-between mb-6",children:[r.jsxs("h3",{className:"text-sm text-white flex items-center justify-center font-light uppercase",children:[r.jsx("span",{className:"text-white/50 mr-2",children:"["}),r.jsx(Xi,{className:"inline mr-2 w-3 h-3 text-white"}),r.jsx("span",{className:"font-mono text-white/70 uppercase",children:"Seed Accounts"}),r.jsx("span",{className:"text-white/50 ml-2",children:"]"})]}),r.jsx($,{variant:"ghost",size:"sm",onClick:()=>k(!1),className:"text-gray-400 hover:text-white rounded-none",children:r.jsx(xt,{className:"w-4 h-4"})})]}),r.jsx("hr",{className:"border-white/10 -mx-10 border-dashed -mt-4 mb-4"}),r.jsxs("div",{className:"space-y-6",children:[r.jsxs("div",{className:"space-y-4",children:[r.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[r.jsxs("div",{children:[r.jsx(pe,{htmlFor:"account-count",className:"text-sm text-gray-400 font-light",children:"Number of accounts"}),r.jsx(Te,{id:"account-count",type:"number",min:"1",max:"50",defaultValue:"3",className:"mt-1 border border-dashed border-white/20 bg-black/30 text-white rounded-none"})]}),r.jsxs("div",{children:[r.jsx(pe,{htmlFor:"account-provider",className:"text-sm text-gray-400 font-light",children:"Provider"}),r.jsxs(Ua,{value:O,onValueChange:R,children:[r.jsx(Pa,{className:"mt-1 border border-dashed border-white/20 bg-black/30 text-white rounded-none",children:r.jsx(yi,{placeholder:"Select provider"})}),r.jsxs(Fa,{className:"bg-black border border-dashed border-white/20",children:[r.jsx(Ve,{value:"random",children:"Mix (Random)"}),r.jsx(Ve,{value:"github",children:"GitHub"}),r.jsx(Ve,{value:"google",children:"Google"}),r.jsx(Ve,{value:"discord",children:"Discord"}),r.jsx(Ve,{value:"facebook",children:"Facebook"}),r.jsx(Ve,{value:"twitter",children:"Twitter"}),r.jsx(Ve,{value:"linkedin",children:"LinkedIn"}),r.jsx(Ve,{value:"apple",children:"Apple"}),r.jsx(Ve,{value:"microsoft",children:"Microsoft"}),r.jsx(Ve,{value:"gitlab",children:"GitLab"}),r.jsx(Ve,{value:"bitbucket",children:"Bitbucket"}),r.jsx(Ve,{value:"spotify",children:"Spotify"}),r.jsx(Ve,{value:"twitch",children:"Twitch"}),r.jsx(Ve,{value:"reddit",children:"Reddit"}),r.jsx(Ve,{value:"slack",children:"Slack"}),r.jsx(Ve,{value:"notion",children:"Notion"}),r.jsx(Ve,{value:"tiktok",children:"TikTok"}),r.jsx(Ve,{value:"zoom",children:"Zoom"})]})]})]})]}),r.jsx($,{onClick:()=>{var ce;const V=parseInt(((ce=document.getElementById("account-count"))==null?void 0:ce.value)||"3",10);Be(V,O)},disabled:ee,className:"bg-white hover:bg-white/90 text-black border border-white/20 rounded-none disabled:opacity-50",children:ee?r.jsxs(r.Fragment,{children:[r.jsx(gn,{className:"w-3 h-3 mr-2 animate-spin"}),"Seeding..."]}):r.jsxs(r.Fragment,{children:[r.jsx(Xi,{className:"w-3 h-3 mr-2"}),"Seed Accounts"]})})]}),ne.length>0&&r.jsx("div",{className:"mt-6",children:r.jsx(ji,{title:"Account Seeding Terminal",lines:ne,isRunning:ee,className:"w-full",defaultCollapsed:!0})})]}),r.jsx("hr",{className:"border-white/10 -mx-10 border-dashed mt-10"}),r.jsx("div",{className:"flex justify-end mt-6 pt-6",children:r.jsx($,{variant:"outline",onClick:()=>k(!1),className:"border border-dashed border-white/20 text-white hover:bg-white/10 rounded-none",children:"Close"})})]})})]}):r.jsx("div",{className:"min-h-screen bg-black flex items-center justify-center",children:r.jsx("div",{className:"text-white text-lg",children:"User not found"})})}function jue(){return r.jsx(YW,{children:r.jsxs(OB,{children:[r.jsx(zK,{children:r.jsxs(EB,{children:[r.jsx(Dn,{path:"/",element:r.jsx(Pte,{})}),r.jsx(Dn,{path:"/users",element:r.jsx(x5,{})}),r.jsx(Dn,{path:"/users/:userId",element:r.jsx(Aue,{})}),r.jsx(Dn,{path:"/organizations",element:r.jsx(b5,{})}),r.jsx(Dn,{path:"/organizations/:orgId",element:r.jsx(xue,{})}),r.jsx(Dn,{path:"/teams",element:r.jsx(wue,{})}),r.jsx(Dn,{path:"/teams/:teamId",element:r.jsx(qR,{})}),r.jsx(Dn,{path:"/organizations/:orgId/teams/:teamId",element:r.jsx(qR,{})}),r.jsx(Dn,{path:"/sessions",element:r.jsx(yue,{})}),r.jsx(Dn,{path:"/database",element:r.jsx(zte,{})}),r.jsx(Dn,{path:"/database/demo",element:r.jsx(VW,{})}),r.jsx(Dn,{path:"/emails",element:r.jsx(gue,{})}),r.jsx(Dn,{path:"/tools",element:r.jsx(Cue,{})}),r.jsx(Dn,{path:"/settings",element:r.jsx(vue,{})})]})}),r.jsx(cz,{className:"rounded-none border-dashed border-white/20",theme:"dark",position:"top-right",richColors:!0,toastOptions:{style:{border:"dashed 1px #ffffff20",borderRadius:"0"},className:"font-mono uppercase"},closeButton:!0})]})})}OF.createRoot(document.getElementById("root")).render(r.jsx(J.StrictMode,{children:r.jsx(jue,{})}));
1090
+ `)),className:"text-gray-400 hover:text-white rounded-none",children:[r.jsx(aa,{className:"w-4 h-4 mr-1"}),"Copy All"]})]}),r.jsx("div",{className:"border border-dashed border-white/10 p-3",children:r.jsx("div",{className:"space-y-2 max-h-64 overflow-y-auto",children:ln.map((z,Z)=>r.jsxs("div",{className:"flex items-center justify-between p-2 bg-black/40 border border-dashed border-white/10",children:[r.jsx("span",{className:"text-white font-mono text-xs break-all",children:z}),r.jsx($,{variant:"ghost",size:"sm",onClick:()=>Aa(z),className:"text-gray-400 hover:text-white rounded-none ml-2",children:r.jsx(aa,{className:"w-3 h-3"})})]},Z))})})]}),r.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-4 text-xs font-mono",children:[r.jsxs("div",{className:"border border-dashed border-white/10 p-3 space-y-2",children:[r.jsx("div",{className:"text-gray-400 uppercase tracking-wider",children:"Version"}),r.jsx("p",{className:"text-white text-sm",children:"v4 (Random)"}),r.jsx("p",{className:"text-gray-500 text-xs",children:"Cryptographically random"})]}),r.jsxs("div",{className:"border border-dashed border-white/10 p-3 space-y-2",children:[r.jsx("div",{className:"text-gray-400 uppercase tracking-wider",children:"Format"}),r.jsx("p",{className:"text-white text-sm",children:"8-4-4-4-12"}),r.jsx("p",{className:"text-gray-500 text-xs",children:"36 characters"})]}),r.jsxs("div",{className:"border border-dashed border-white/10 p-3 space-y-2",children:[r.jsx("div",{className:"text-gray-400 uppercase tracking-wider",children:"Standard"}),r.jsx("p",{className:"text-white text-sm",children:"RFC 4122"}),r.jsx("p",{className:"text-gray-500 text-xs",children:"Universally unique"})]})]})]})]})}),Vr&&r.jsx("div",{className:"fixed inset-0 bg-black/80 flex items-center justify-center z-[60] overflow-hidden",children:r.jsxs("div",{className:"bg-black border border-dashed border-white/20 rounded-none p-6 w-full max-w-4xl max-h-[90vh] overflow-y-auto",children:[r.jsxs("div",{className:"flex items-center justify-between mb-6",children:[r.jsxs("div",{className:"flex items-center space-x-2",children:[r.jsx(Tl,{className:"w-5 h-5 text-white"}),r.jsx("h3",{className:"text-xl text-white font-light uppercase tracking-wider",children:"Password Strength Checker"})]}),r.jsx($,{variant:"ghost",size:"sm",onClick:()=>Do(!1),className:"text-gray-400 hover:text-white rounded-none",children:r.jsx(xt,{className:"w-4 h-4"})})]}),r.jsxs("div",{className:"space-y-4",children:[r.jsxs("div",{children:[r.jsx(pe,{className:"text-xs uppercase font-mono text-gray-400 mb-2 block",children:"Password"}),r.jsxs("div",{className:"relative",children:[r.jsx(Te,{type:pr?"text":"password",value:As,onChange:z=>Ya(z.target.value),placeholder:"Enter password to check",className:"w-full bg-black border border-dashed border-white/20 text-white font-mono text-xs pr-10 rounded-none"}),r.jsx($,{variant:"ghost",size:"sm",onClick:()=>Kr(!pr),className:"absolute right-0 top-0 h-full px-3 text-gray-400 hover:text-white rounded-none",children:pr?r.jsx(Oh,{className:"w-4 h-4"}):r.jsx(gi,{className:"w-4 h-4"})})]})]}),r.jsxs("div",{className:"flex items-end justify-end space-x-2",children:[r.jsx($,{variant:"outline",onClick:()=>{Ya(""),Yr(null),Kr(!1)},className:"border border-dashed border-white/20 text-white hover:bg-white/10 rounded-none",children:"Clear"}),r.jsx($,{onClick:gU,disabled:Wr||!As.trim(),className:"rounded-none",children:Wr?r.jsxs(r.Fragment,{children:[r.jsx(gn,{className:"w-4 h-4 mr-2 animate-spin"}),"Checking..."]}):"Check Strength"})]}),kt&&r.jsxs("div",{className:"space-y-4",children:[r.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-4 text-xs font-mono",children:[r.jsxs("div",{className:"border border-dashed border-white/10 p-3 space-y-2",children:[r.jsx("div",{className:"text-gray-400 uppercase tracking-wider",children:"Strength"}),r.jsx("p",{className:`text-sm font-medium ${kt.strength==="very-strong"?"text-green-400":kt.strength==="strong"?"text-green-300":kt.strength==="good"?"text-yellow-300":kt.strength==="fair"?"text-orange-300":"text-red-300"}`,children:kt.strength.split("-").map(z=>z.charAt(0).toUpperCase()+z.slice(1)).join(" ")}),r.jsx("div",{className:"w-full bg-black/40 h-2 rounded-none",children:r.jsx("div",{className:`h-full transition-all ${kt.strength==="very-strong"?"bg-green-400 w-full":kt.strength==="strong"?"bg-green-300 w-4/5":kt.strength==="good"?"bg-yellow-300 w-3/5":kt.strength==="fair"?"bg-orange-300 w-2/5":"bg-red-300 w-1/5"}`})})]}),r.jsxs("div",{className:"border border-dashed border-white/10 p-3 space-y-2",children:[r.jsx("div",{className:"text-gray-400 uppercase tracking-wider",children:"Score"}),r.jsxs("p",{className:"text-white text-sm",children:[kt.score," / 5"]}),r.jsx("p",{className:"text-gray-500 text-xs",children:kt.score===5?"Excellent":kt.score===4?"Very Good":kt.score===3?"Good":kt.score===2?"Fair":"Weak"})]}),r.jsxs("div",{className:"border border-dashed border-white/10 p-3 space-y-2",children:[r.jsx("div",{className:"text-gray-400 uppercase tracking-wider",children:"Config Match"}),r.jsx("p",{className:`text-sm ${kt.meetsConfig?"text-green-400":"text-red-300"}`,children:kt.meetsConfig?"✓ Meets Requirements":"✗ Fails Requirements"}),r.jsxs("p",{className:"text-gray-500 text-xs",children:[kt.configRequirements.minLength," -"," ",kt.configRequirements.maxLength," chars"]})]})]}),r.jsxs("div",{className:"border border-dashed border-white/10 p-3",children:[r.jsx("div",{className:"text-xs uppercase font-mono text-gray-400 mb-3",children:"Checks"}),r.jsx("div",{className:"space-y-2",children:kt.checks.map((z,Z)=>r.jsxs("div",{className:"flex items-center justify-between p-2 bg-black/40 border border-dashed border-white/10",children:[r.jsx("span",{className:"text-white font-mono text-xs",children:z.name}),r.jsxs("div",{className:"flex items-center space-x-2",children:[r.jsx("span",{className:`text-xs font-mono ${z.passed?"text-green-400":"text-red-300"}`,children:z.passed?"✓":"✗"}),r.jsx("span",{className:"text-xs text-gray-400 font-mono",children:z.message})]})]},Z))})]})]})]})]})}),mr&&r.jsx("div",{className:"fixed inset-0 bg-black/80 flex items-center justify-center z-[60] overflow-hidden",children:r.jsxs("div",{className:"bg-black border border-dashed border-white/20 rounded-none p-6 w-full max-w-4xl max-h-[90vh] overflow-y-auto",children:[r.jsxs("div",{className:"flex items-center justify-between mb-6",children:[r.jsxs("div",{className:"flex items-center space-x-2",children:[r.jsx(Yn,{className:"w-5 h-5 text-white"}),r.jsx("h3",{className:"text-xl text-white font-light uppercase tracking-wider",children:"OAuth Credentials"})]}),r.jsx($,{variant:"ghost",size:"sm",onClick:()=>Wa(!1),className:"text-gray-400 hover:text-white rounded-none",children:r.jsx(xt,{className:"w-4 h-4"})})]}),r.jsxs("div",{className:"space-y-4",children:[r.jsxs("div",{children:[r.jsx(pe,{className:"text-xs uppercase font-mono text-gray-400 mb-2 block",children:"Select Provider"}),r.jsx("div",{className:"flex flex-wrap gap-3",children:["google","github"].map(z=>{const Z=f===z;return r.jsx("button",{onClick:()=>p(z),className:`px-4 py-2 border rounded-none text-sm uppercase font-mono transition-colors ${Z?"border-white/60 bg-white/10 text-white":"border-dashed border-white/20 text-gray-400 hover:border-white/40"}`,children:z.charAt(0).toUpperCase()+z.slice(1)},z)})})]}),r.jsxs("div",{children:[r.jsx(pe,{className:"text-xs uppercase font-mono text-gray-400 mb-2 block",children:"Origin"}),r.jsx(Te,{value:Fn,onChange:z=>Bn(z.target.value),placeholder:`http://${Ea}`,className:"bg-black border border-dashed border-white/20 text-white font-mono text-xs rounded-none"}),r.jsxs("p",{className:"text-[11px] text-gray-500 font-mono mt-1",children:["The default will be http://",Ea]})]}),r.jsxs("div",{className:"flex items-end justify-end space-x-2",children:[r.jsx($,{variant:"outline",onClick:()=>{Jn(null),Bn(Ea)},className:"border border-dashed border-white/20 text-white hover:bg-white/10 rounded-none",children:"Clear"}),r.jsx($,{onClick:vU,disabled:Xa||!f||!Fn.trim()&&!Ea,className:"rounded-none",children:Xa?r.jsxs(r.Fragment,{children:[r.jsx(gn,{className:"w-4 h-4 mr-2 animate-spin"}),"Fetching..."]}):"Fetch Credentials"})]}),Qn&&r.jsxs("div",{className:"space-y-4",children:[r.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[r.jsxs("div",{children:[r.jsx(pe,{className:"text-xs uppercase font-mono text-gray-400 mb-2 block",children:"Client ID"}),r.jsxs("div",{className:"relative",children:[r.jsx(Te,{value:Qn.clientId,readOnly:!0,className:"bg-black border border-dashed border-white/20 text-white font-mono text-xs pr-10 rounded-none"}),r.jsx($,{variant:"ghost",size:"sm",onClick:()=>Aa(Qn.clientId),className:"absolute right-0 top-0 h-full px-3 text-gray-400 hover:text-white rounded-none",children:r.jsx(aa,{className:"w-4 h-4"})})]})]}),r.jsxs("div",{children:[r.jsx(pe,{className:"text-xs uppercase font-mono text-gray-400 mb-2 block",children:"Client Secret"}),r.jsxs("div",{className:"relative",children:[r.jsx(Te,{type:_s?"text":"password",value:Qn.clientSecret,readOnly:!0,className:"bg-black border border-dashed border-white/20 text-white font-mono text-xs pr-20 rounded-none"}),r.jsxs("div",{className:"absolute right-0 top-0 h-full flex items-center",children:[r.jsx($,{variant:"ghost",size:"sm",onClick:()=>Io(!_s),className:"px-2 text-gray-400 hover:text-white rounded-none",children:_s?r.jsx(Oh,{className:"w-4 h-4"}):r.jsx(gi,{className:"w-4 h-4"})}),r.jsx($,{variant:"ghost",size:"sm",onClick:()=>Aa(Qn.clientSecret),className:"px-2 text-gray-400 hover:text-white rounded-none",children:r.jsx(aa,{className:"w-4 h-4"})})]})]})]})]}),r.jsxs("div",{className:"flex items-center justify-between pt-2 border-t border-dashed border-white/10",children:[r.jsx("div",{className:"flex-1",children:dt&&r.jsx("div",{className:"text-xs font-mono",children:dt.success?r.jsxs("span",{className:"text-green-400 uppercase",children:["✓ ",dt.message.toLowerCase(),r.jsxs("span",{className:"block normal-case text-gray-400",children:[r.jsx("span",{className:"text-gray-400 mr-1",children:">"})," ",dt.path]})]}):r.jsxs("span",{className:"text-red-300",children:["✗ ",dt.message]})})}),r.jsx($,{onClick:wU,disabled:Rs||Mo,className:"rounded-none",children:Mo?r.jsxs(r.Fragment,{children:[r.jsx(gn,{className:"w-4 h-4 mr-2 animate-spin"}),"Checking..."]}):Rs?r.jsxs(r.Fragment,{children:[r.jsx(gn,{className:"w-4 h-4 mr-2 animate-spin"}),"Writing..."]}):r.jsxs(r.Fragment,{children:[r.jsx(zm,{className:"w-4 h-4 mr-2"}),"Write to .env"]})})]})]})]})]})}),Ds&&r.jsx("div",{className:"fixed inset-0 bg-black/80 flex items-center justify-center z-[60] overflow-hidden",children:r.jsxs("div",{className:"bg-black border border-dashed border-white/20 rounded-none p-6 w-full max-w-4xl max-h-[90vh] overflow-y-auto",children:[r.jsxs("div",{className:"flex items-center justify-between mb-6",children:[r.jsxs("div",{className:"flex items-center space-x-2",children:[r.jsx(Zi,{className:"w-5 h-5 text-white"}),r.jsx("h3",{className:"text-xl text-white font-light uppercase tracking-wider",children:"Secret Generator"})]}),r.jsx($,{variant:"ghost",size:"sm",onClick:()=>ye(!1),className:"text-gray-400 hover:text-white rounded-none",children:r.jsx(xt,{className:"w-4 h-4"})})]}),r.jsxs("div",{className:"space-y-6",children:[r.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[r.jsxs("div",{children:[r.jsx(pe,{className:"text-xs uppercase font-mono text-gray-400 mb-2 block",children:"Length (bytes)"}),r.jsx(Te,{type:"number",value:Le,onChange:z=>{const Z=parseInt(z.target.value,10);Z>=16&&Z<=128&&Oe(Z)},min:"16",max:"128",className:"bg-black border border-dashed border-white/20 text-white font-mono text-xs rounded-none"}),r.jsx("p",{className:"text-[11px] text-gray-500 font-mono mt-1",children:"Recommended: 32 bytes (256 bits)"})]}),r.jsxs("div",{children:[r.jsx(pe,{className:"text-xs uppercase font-mono text-gray-400 mb-2 block",children:"Format"}),r.jsx("div",{className:"flex gap-3",children:[{id:"hex",label:"Hex"},{id:"base64",label:"Base64"}].map(z=>r.jsx("button",{onClick:()=>nt(z.id),className:`px-4 py-2 border rounded-none text-sm uppercase font-mono transition-colors flex-1 ${Ce===z.id?"border-white/60 bg-white/10 text-white":"border-dashed border-white/20 text-gray-400 hover:border-white/40"}`,children:z.label},z.id))})]})]}),r.jsxs("div",{className:"flex justify-end space-x-2",children:[r.jsx($,{variant:"outline",onClick:()=>{Ee(null),Oe(32),nt("hex")},className:"border border-dashed border-white/20 text-white hover:bg-white/10 rounded-none",children:"Clear"}),r.jsx($,{onClick:xU,disabled:de,className:"rounded-none",children:de?r.jsxs(r.Fragment,{children:[r.jsx(gn,{className:"w-4 h-4 mr-2 animate-spin"}),"Generating..."]}):"Generate Secret"})]}),ve&&r.jsxs("div",{className:"space-y-4",children:[r.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-4 text-xs font-mono",children:[r.jsxs("div",{className:"border border-dashed border-white/10 p-3 space-y-2",children:[r.jsx("div",{className:"text-gray-400 uppercase tracking-wider",children:"Length"}),r.jsxs("p",{className:"text-white text-sm",children:[ve.length," bytes"]})]}),r.jsxs("div",{className:"border border-dashed border-white/10 p-3 space-y-2",children:[r.jsx("div",{className:"text-gray-400 uppercase tracking-wider",children:"Entropy"}),r.jsxs("p",{className:"text-white text-sm",children:[ve.entropy," bits"]})]}),r.jsxs("div",{className:"border border-dashed border-white/10 p-3 space-y-2",children:[r.jsx("div",{className:"text-gray-400 uppercase tracking-wider",children:"Format"}),r.jsx("p",{className:"text-white text-sm uppercase",children:ve.format})]})]}),r.jsxs("div",{children:[r.jsx(pe,{className:"text-xs uppercase font-mono text-gray-400 mb-2 block",children:"Generated Secret"}),r.jsxs("div",{className:"relative",children:[r.jsx(Te,{value:ve.secret,readOnly:!0,className:"bg-black border border-dashed border-white/20 text-white font-mono text-xs pr-10 rounded-none"}),r.jsx($,{variant:"ghost",size:"sm",onClick:()=>Aa(ve.secret),className:"absolute right-0 top-0 h-full px-3 text-gray-400 hover:text-white rounded-none",children:r.jsx(aa,{className:"w-4 h-4"})})]})]}),r.jsxs("div",{children:[r.jsx(pe,{className:"text-xs uppercase font-mono text-gray-400 mb-2 block",children:"Environment Variable Format"}),r.jsxs("div",{className:"relative",children:[r.jsx(Te,{value:ve.envFormat,readOnly:!0,className:"bg-black border border-dashed border-white/20 text-white font-mono text-xs pr-10 rounded-none"}),r.jsx($,{variant:"ghost",size:"sm",onClick:()=>Aa(ve.envFormat),className:"absolute right-0 top-0 h-full px-3 text-gray-400 hover:text-white rounded-none",children:r.jsx(aa,{className:"w-4 h-4"})})]}),r.jsxs("p",{className:"text-[11px] text-gray-500 font-mono mt-2",children:["Add this to your ",r.jsx("code",{className:"text-gray-400",children:".env"})," file. Keep it secret and never commit it to version control."]})]}),r.jsx("div",{className:"border border-dashed border-white/20 bg-black text-gray-300 text-xs font-mono p-3 rounded-none",children:r.jsxs("div",{className:"flex items-start space-x-2",children:[r.jsx(Ju,{className:"w-4 h-4 mt-0.5 flex-shrink-0 text-gray-400"}),r.jsxs("div",{children:[r.jsx("div",{className:"uppercase font-mono mb-2 text-gray-400 tracking-wider",children:"Security Best Practices"}),r.jsxs("ul",{className:"list-disc list-inside space-y-1 text-[11px] text-gray-300",children:[r.jsx("li",{children:"Use a minimum of 32 bytes (256 bits) for production"}),r.jsx("li",{children:"Store secrets in environment variables, never in code"}),r.jsx("li",{children:"Use different secrets for development and production"}),r.jsx("li",{children:"Rotate secrets periodically for enhanced security"})]})]})]})})]})]})]})}),br&&Zr&&r.jsx("div",{className:"fixed inset-0 bg-black/80 flex items-center justify-center z-[70] overflow-hidden",children:r.jsxs("div",{className:"bg-black border border-dashed border-white/20 rounded-none p-6 w-full max-w-2xl",children:[r.jsxs("div",{className:"flex items-center justify-between mb-6",children:[r.jsxs("div",{className:"flex items-center space-x-2",children:[r.jsx(Ju,{className:"w-5 h-5 text-yellow-400"}),r.jsx("h3",{className:"text-xl text-white font-light uppercase tracking-wider",children:"Overwrite Existing Credentials?"})]}),r.jsx($,{variant:"ghost",size:"sm",onClick:()=>{Os(!1),Ta(null),xr(!1)},className:"text-gray-400 hover:text-white rounded-none",children:r.jsx(xt,{className:"w-4 h-4"})})]}),r.jsxs("div",{className:"space-y-4",children:[r.jsxs("div",{className:"border border-dashed border-white/20 p-4",children:[r.jsxs("p",{className:"text-sm border-b border-dashed border-white/20 pb-5 text-gray-300 font-mono mb-3",children:["The following"," ",r.jsx("span",{className:"text-white uppercase",children:(f==null?void 0:f.charAt(0).toUpperCase())+(f==null?void 0:f.slice(1))})," ","credentials already exist in"," ",r.jsx("span",{className:"text-gray-400 normal-case",children:Zr.path}),":"]}),r.jsx("div",{className:"space-y-2 pt-2",children:Object.entries(Zr.credentials).map(([z,Z])=>r.jsxs("div",{className:"flex items-center justify-between text-xs font-mono",children:[r.jsx("span",{className:"text-gray-400 uppercase",children:z}),r.jsx("span",{className:"text-gray-500",children:Z.length>20?`${Z.substring(0,20)}...`:Z})]},z))})]}),r.jsxs("div",{className:"flex items-center justify-end space-x-3 pt-4 border-t border-dashed border-white/10",children:[r.jsx($,{variant:"outline",onClick:()=>{Os(!1),Ta(null),xr(!1)},className:"border border-dashed border-white/20 text-white hover:bg-white/10 rounded-none",children:"No, Cancel"}),r.jsx($,{variant:"outline",onClick:()=>Vp("append"),disabled:Rs,className:"border border-dashed border-white/20 text-white hover:bg-white/10 rounded-none",children:"Append"}),r.jsx($,{onClick:()=>Vp("override"),disabled:Rs,className:"rounded-none",children:Rs?r.jsxs(r.Fragment,{children:[r.jsx(gn,{className:"w-4 h-4 mr-2 animate-spin"}),"Writing..."]}):"Yes, Overwrite"})]})]})]})})]})}function Aue(){const{userId:e}=s1(),t=ur(),[n,a]=m.useState(null),[s,i]=m.useState([]),[o,l]=m.useState([]),[c,u]=m.useState([]),[h,d]=m.useState([]),[f,p]=m.useState(!0),[v,x]=m.useState("details"),[N,b]=m.useState(!1),[y,g]=m.useState(!1),[w,S]=m.useState(!1),[C,T]=m.useState(!1),[E,k]=m.useState(!1),[O,R]=m.useState("random"),[I,F]=m.useState(!1),[j,U]=m.useState(!1),[_,M]=m.useState(!1),[A,D]=m.useState(""),[B,G]=m.useState(),[L,q]=m.useState(!1),[W,K]=m.useState(""),[ne,te]=m.useState([]),[ee,ae]=m.useState(!1),[ge,re]=m.useState({}),fe=m.useRef({}),me=m.useCallback(async()=>{try{const ce=await(await fetch("/api/admin/status")).json();q(ce.enabled)}catch{q(!1)}},[]),Re=m.useCallback(async V=>{try{const ce=await fetch("/api/geo/resolve",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({ipAddress:V})});if(ce.ok){const he=await ce.json();if(he.success&&he.location)return he.location}return null}catch{return null}},[]),Me=m.useCallback(async V=>{const ce=V.filter(De=>!fe.current[De.id]);if(ce.length===0)return;const he=await Promise.all(ce.map(async De=>{const Ye=await Re(De.ipAddress);return Ye?{sessionId:De.id,location:Ye}:null})),xe={};he.forEach(De=>{De&&(xe[De.sessionId]=De.location)}),Object.keys(xe).length>0&&(fe.current={...fe.current,...xe},re(fe.current))},[Re]),Ue=V=>{if(!V)return"🌍";const ce=V.toUpperCase().split("").map(he=>127397+he.charCodeAt(0));return String.fromCodePoint(...ce)},$e=V=>V?V.replace(/[_-]/g," ").replace(/\b\w/g,ce=>ce.toUpperCase()):"Unknown Provider",pt=V=>{if(!V)return"Unknown";const ce=new Date(V);return Number.isNaN(ce.getTime())?"Unknown":ce.toLocaleString("en-US",{year:"numeric",month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"})},Ge=m.useCallback(async()=>{try{const V=await fetch(`/api/users/${e}`);if(V.ok){const ce=await V.json();a(ce.user)}else H.error("Failed to fetch user details"),t("/users")}catch{H.error("Failed to fetch user details"),t("/users")}finally{p(!1)}},[e,t]),jt=m.useCallback(async()=>{try{const[V,ce,he]=await Promise.all([fetch(`/api/users/${e}/organizations`),fetch(`/api/users/${e}/teams`),fetch(`/api/users/${e}/sessions`)]);if(V.ok){const xe=await V.json();i(xe.memberships||[])}if(ce.ok){const xe=await ce.json();l(xe.memberships||[])}if(he.ok){const De=(await he.json()).sessions||[];u(De),Me(De)}}catch{}},[e,Me]),St=m.useCallback(async()=>{try{const V=await fetch(`/api/users/${e}/accounts`);if(V.ok){const ce=await V.json();d(ce.accounts||[])}}catch{}},[e]),We=async()=>{var xe,De;if(!n)return;const V=(xe=document.getElementById("edit-name"))==null?void 0:xe.value,ce=(De=document.getElementById("edit-email"))==null?void 0:De.value;if(!V||!ce){H.error("Please fill in all fields");return}const he=H.loading("Updating user...");try{const Q=await(await fetch(`/api/users/${e}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:V,email:ce,role:W||null})})).json();Q.success?(a({...n,name:V,email:ce,role:W||void 0}),b(!1),K(""),H.success("User updated successfully!",{id:he})):H.error(`Error updating user: ${Q.error||"Unknown error"}`,{id:he})}catch{H.error("Error updating user",{id:he})}},et=async()=>{if(!n)return;const V=H.loading("Deleting user...");try{const he=await(await fetch(`/api/users/${e}`,{method:"DELETE",headers:{"Content-Type":"application/json"}})).json();he.success?(H.success("User deleted successfully!",{id:V}),t("/users")):H.error(`Error deleting user: ${he.error||"Unknown error"}`,{id:V})}catch{H.error("Error deleting user",{id:V})}},Ze=async()=>{if(!n)return;if(!L){H.error("Admin plugin is not enabled. Please enable the admin plugin in your Better Auth configuration to use ban functionality.");return}const V=H.loading("Banning user...");try{const ce=await fetch("/api/admin/ban-user",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({userId:e,banReason:A||"No reason provided",banExpiresIn:B})}),he=await ce.json();ce.ok?(H.success("User banned successfully!",{id:V}),g(!1),D(""),G(void 0),Ge()):ce.status===403?H.error("You do not have permission to ban users. Admin role required.",{id:V}):he.adminPluginEnabled&&he.instructions?H.error(`${he.error}`,{id:V,duration:6e3,description:`Use: ${he.instructions.example}`}):H.error(`Error banning user: ${he.error||he.message||"Unknown error"}`,{id:V})}catch{H.error("Error banning user",{id:V})}},Et=async()=>{if(!n)return;if(!L){H.error("Admin plugin is not enabled. Please enable the admin plugin in your Better Auth configuration to use unban functionality.");return}const V=H.loading("Unbanning user...");try{const ce=await fetch("/api/admin/unban-user",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({userId:e})}),he=await ce.json();ce.ok?(H.success("User unbanned successfully!",{id:V}),S(!1),Ge()):ce.status===403?H.error("You do not have permission to unban users. Admin role required.",{id:V}):he.adminPluginEnabled&&he.instructions?H.error(`${he.error}`,{id:V,duration:6e3,description:`Use: ${he.instructions.example}`}):H.error(`Error unbanning user: ${he.error||he.message||"Unknown error"}`,{id:V})}catch{H.error("Error unbanning user",{id:V})}},Tt=async V=>{const ce=H.loading("Removing user from organization...");try{const xe=await(await fetch(`/api/organizations/members/${V}`,{method:"DELETE"})).json();xe.success?(i(De=>De.filter(Ye=>Ye.id!==V)),jt(),H.success("User removed from organization!",{id:ce})):H.error(`Error removing user: ${xe.error||"Unknown error"}`,{id:ce})}catch{H.error("Error removing user from organization",{id:ce})}},qt=async V=>{const ce=H.loading("Removing user from team...");try{const xe=await(await fetch(`/api/teams/members/${V}`,{method:"DELETE"})).json();xe.success?(l(De=>De.filter(Ye=>Ye.id!==V)),jt(),H.success("User removed from team!",{id:ce})):H.error(`Error removing user: ${xe.error||"Unknown error"}`,{id:ce})}catch{H.error("Error removing user from team",{id:ce})}},Wt=async V=>{const ce=H.loading("Deleting session...");try{const xe=await(await fetch(`/api/sessions/${V}`,{method:"DELETE"})).json();xe.success?(u(De=>De.filter(Ye=>Ye.id!==V)),H.success("Session deleted successfully!",{id:ce})):H.error(`Error deleting session: ${xe.error||"Unknown error"}`,{id:ce})}catch{H.error("Error deleting session",{id:ce})}},se=async V=>{if(!e)return;const ce=H.loading("Unlinking account...");try{const he=await fetch(`/api/users/${e}/accounts/${V}`,{method:"DELETE"}),xe=await he.json();he.ok&&xe.success?(d(De=>De.filter(Ye=>Ye.id!==V)),await St(),H.success("Account unlinked successfully",{id:ce})):H.error(xe.error||"Failed to unlink account",{id:ce})}catch{H.error("Failed to unlink account",{id:ce})}};m.useEffect(()=>{e&&(Ge(),jt(),St(),me())},[e,me,Ge,jt,St]);const we=async(V=3)=>{if(e){te([]),ae(!0),te([{id:"start",type:"info",message:`Starting session seeding process for ${V} sessions...`,timestamp:new Date}]);try{const he=await(await fetch(`/api/users/${e}/seed-sessions`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({count:V})})).json();if(he.success){const xe=he.results.map((Ye,Q)=>Ye.success?{id:`session-${Q}`,type:"progress",message:`Creating session ${Q+1}: ${Ye.session.token.substring(0,20)}... from ${Ye.session.ipAddress}`,timestamp:new Date,status:"completed"}:{id:`session-${Q}`,type:"error",message:`Failed to create session ${Q+1}: ${Ye.error}`,timestamp:new Date});te(Ye=>[...Ye,...xe]);const De=he.results.filter(Ye=>Ye.success).length;te(Ye=>[...Ye,{id:"complete",type:"success",message:`✅ Session seeding completed! Created ${De}/${V} sessions successfully`,timestamp:new Date}]),jt()}else te(xe=>[...xe,{id:"error",type:"error",message:`❌ Session seeding failed: ${he.error||"Unknown error"}`,timestamp:new Date}])}catch(ce){te(he=>[...he,{id:"error",type:"error",message:`❌ Network error: ${ce}`,timestamp:new Date}])}finally{ae(!1)}}},Be=async(V=3,ce="random")=>{if(e){te([]),ae(!0),te([{id:"start",type:"info",message:`Starting account seeding process for ${V} accounts...`,timestamp:new Date}]);try{const xe=await(await fetch(`/api/users/${e}/seed-accounts`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({count:V,providerId:ce})})).json();if(xe.success){const De=xe.results.map((Q,ie)=>{var Ne;return Q.success?{id:`account-${ie}`,type:"progress",message:`Creating account ${ie+1}: ${Q.account.providerId||Q.account.provider} (${((Ne=Q.account.accountId)==null?void 0:Ne.substring(0,20))||Q.account.id.substring(0,20)}...)`,timestamp:new Date,status:"completed"}:{id:`account-${ie}`,type:"error",message:`Failed to create account ${ie+1}: ${Q.error}`,timestamp:new Date}});te(Q=>[...Q,...De]);const Ye=xe.results.filter(Q=>Q.success).length;te(Q=>[...Q,{id:"complete",type:"success",message:`✅ Account seeding completed! Created ${Ye}/${V} accounts successfully`,timestamp:new Date}]),St()}else te(De=>[...De,{id:"error",type:"error",message:`❌ Account seeding failed: ${xe.error||"Unknown error"}`,timestamp:new Date}])}catch(he){te(xe=>[...xe,{id:"error",type:"error",message:`❌ Network error: ${he}`,timestamp:new Date}])}finally{ae(!1)}}};return f?r.jsx("div",{className:"min-h-screen bg-black flex items-center justify-center",children:r.jsx("div",{className:"text-white text-lg",children:"Loading user details..."})}):n?r.jsxs("div",{className:"space-y-6 p-6 bg-black w-full",children:[r.jsxs("div",{className:"w-full flex flex-col",children:[r.jsx("span",{className:"mb-4 ml-0 flex justify-start items-start text-left border-none text-white",children:r.jsxs("span",{className:"font-light",children:[r.jsxs("span",{onClick:()=>t("/users"),className:"uppercase cursor-pointer text-white/80 font-mono text-sm",children:["users /"," "]}),r.jsx("span",{className:"text-white font-mono text-sm",children:n.id})]})}),r.jsx("div",{className:"mb-8 mt-4",children:r.jsxs("div",{className:"flex items-center justify-between",children:[r.jsxs("div",{className:"flex items-center space-x-4",children:[r.jsx("div",{className:"w-16 h-16 bg-gray-800 border border-dashed border-white/20 flex items-center justify-center",children:n.image?r.jsx("img",{src:n.image,alt:n.name,className:"w-16 h-16 object-cover"}):r.jsx(Mc,{className:"w-8 h-8 text-white"})}),r.jsxs("div",{children:[r.jsxs("h1",{className:"text-3xl font-light text-white inline-flex items-center",children:[n.name,r.jsx(Ln,{id:n.id,variant:"subscript"}),n.role&&r.jsx("sup",{className:"ml-2 px-2 pt-2 pb-2 -mt-1 py-0.5 text-[10px] font-mono uppercase border border-dashed border-white/15 bg-white/5 text-white/80 rounded-none",children:n.role}),n.banned&&r.jsxs("sup",{className:"relative group inline-block ml-2 px-2 pt-2 pb-2 -mt-1 py-0.5 text-[10px] font-mono uppercase border border-dashed border-red-500/30 bg-red-500/10 text-red-400/80 rounded-none cursor-help",children:["Banned",n.banReason&&r.jsxs("span",{className:"absolute lowercase left-1/2 -translate-x-1/2 bottom-full mb-3 px-2 py-2 text-[10px] font-mono text-gray-300 bg-black border border-dashed border-white/20 rounded-none whitespace-nowrap opacity-0 invisible group-hover:opacity-100 group-hover:visible transition-all duration-150 pointer-events-none z-50",children:[r.jsx("span",{className:"text-gray-400 font-mono text-xs uppercase mr-1",children:"Banned Reason:"}),n.banReason,r.jsx("span",{className:"absolute left-1/2 -translate-x-1/2 top-full w-0 h-0 border-l-[4px] border-r-[4px] border-t-[4px] border-transparent border-t-white/20"})]})]})]}),r.jsx("p",{className:"text-gray-400 font-mono text-sm",children:n.email})]})]}),r.jsx("div",{className:"flex items-center space-x-2",children:r.jsxs("div",{className:"relative",children:[r.jsx($,{variant:"ghost",size:"sm",className:"text-gray-400 hover:text-white rounded-none",onClick:V=>{V.stopPropagation(),M(!_)},children:r.jsx(YM,{className:"w-4 h-4"})}),_&&r.jsxs("div",{className:"absolute z-[999] right-0 top-full mt-1 w-48 bg-black border border-white/20 rounded-none shadow-lg",onClick:V=>V.stopPropagation(),children:[r.jsxs("button",{className:"w-full px-4 py-2 text-left text-sm text-white hover:bg-white/10 flex items-center space-x-2",onClick:V=>{V.stopPropagation(),M(!1),b(!0),K(n.role||"")},children:[r.jsx(bo,{className:"w-4 h-4"}),r.jsx("span",{children:"Edit User"})]}),r.jsxs("button",{className:"w-full px-4 py-2 text-left text-sm text-white hover:bg-white/10 flex items-center space-x-2",onClick:V=>{V.stopPropagation(),M(!1),F(!0)},children:[r.jsx(Cn,{className:"w-4 h-4"}),r.jsx("span",{children:"Update Password"})]}),L&&(n.banned?r.jsxs("button",{className:"w-full px-4 py-2 text-left text-sm text-green-400 hover:bg-white/10 flex items-center space-x-2",onClick:V=>{V.stopPropagation(),M(!1),S(!0)},children:[r.jsx(ug,{className:"w-4 h-4"}),r.jsx("span",{children:"Unban User"})]}):r.jsxs("button",{className:"w-full px-4 py-2 text-left text-sm text-yellow-400 hover:bg-white/10 flex items-center space-x-2",onClick:V=>{V.stopPropagation(),M(!1),g(!0)},children:[r.jsx(ug,{className:"w-4 h-4"}),r.jsx("span",{children:"Ban User"})]})),r.jsx("div",{className:"border-t border-white/10 my-1"}),r.jsxs("button",{className:"w-full px-4 py-2 text-left text-sm text-red-400 hover:bg-white/10 flex items-center space-x-2",onClick:V=>{V.stopPropagation(),M(!1),U(!0)},children:[r.jsx(bu,{className:"w-4 h-4"}),r.jsx("span",{children:"Delete User"})]})]})]})})]})}),r.jsxs("div",{className:"border border-dashed border-white/20 rounded-none",children:[r.jsx("div",{className:"border-b border-dashed border-white/20",children:r.jsx("nav",{className:"flex space-x-8 px-6",children:[{id:"details",name:"Details",icon:Mc},{id:"organizations",name:"Organizations",icon:ha,count:s.length},{id:"teams",name:"Teams",icon:Ct,count:o.length},{id:"accounts",name:"Accounts",icon:Xi,count:h.length},{id:"sessions",name:"Sessions",icon:Dw,count:c.length}].map(V=>r.jsxs("button",{onClick:()=>x(V.id),className:`flex items-center space-x-2 py-4 px-2 border-b-2 font-medium text-sm ${v===V.id?"border-white text-white":"border-transparent text-gray-400 hover:text-white hover:border-white/50"}`,children:[r.jsx(V.icon,{className:"w-4 h-4 text-white/90"}),r.jsxs("span",{className:"inline-flex items-start",children:[r.jsx("span",{className:"",children:V.name}),V.count!==void 0&&r.jsx("sup",{className:"text-xs text-gray-500 ml-1 inline-flex items-baseline",children:r.jsx(rr,{value:V.count,className:"text-white/80 font-mono text-xs",prefix:r.jsx("span",{className:"mr-0.5 text-gray-500",children:"["}),suffix:r.jsx("span",{className:"ml-0.5 text-gray-500",children:"]"}),format:{notation:"standard",maximumFractionDigits:0}})})]})]},V.id))})}),r.jsxs("div",{className:"p-6",children:[v==="details"&&r.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-6",children:[r.jsxs("div",{className:"overflow-x-hidden bg-white/[3%] border border-white/10 p-6 rounded-none",children:[r.jsx("h3",{className:"text-sm uppercase font-mono text-gray-400 mb-4 tracking-wider",children:"BASIC INFORMATION"}),r.jsx("hr",{className:"border-white/10 -mx-10 border-dashed my-4"}),r.jsxs("div",{className:"space-y-4",children:[r.jsxs("div",{className:"flex items-start space-x-3",children:[r.jsx(Mc,{className:"w-4 h-4 text-gray-400 mt-1"}),r.jsxs("div",{className:"flex-1",children:[r.jsx("div",{className:"text-xs uppercase font-mono text-gray-500 mb-1",children:"Name"}),r.jsx("div",{className:"text-white font-sans text-sm",children:n.name})]})]}),r.jsxs("div",{className:"flex items-start space-x-3",children:[r.jsx(as,{className:"w-4 h-4 text-gray-400 mt-1"}),r.jsxs("div",{className:"flex-1",children:[r.jsx("div",{className:"text-xs uppercase font-mono text-gray-500 mb-1",children:"Email"}),r.jsx("div",{className:"text-white font-mono text-sm",children:n.email})]})]}),n.username&&r.jsxs("div",{className:"flex items-start space-x-3",children:[r.jsx(gte,{className:"w-4 h-4 text-gray-400 mt-1"}),r.jsxs("div",{className:"flex-1",children:[r.jsx("div",{className:"text-xs uppercase font-mono text-gray-500 mb-1",children:"Username"}),r.jsx("div",{className:"text-white font-mono text-sm",children:n.username})]})]}),n.phoneNumber&&r.jsxs("div",{className:"flex items-start space-x-3",children:[r.jsx(mte,{className:"w-4 h-4 text-gray-400 mt-1"}),r.jsxs("div",{className:"flex-1",children:[r.jsx("div",{className:"text-xs uppercase font-mono text-gray-500 mb-1",children:"Phone"}),r.jsx("div",{className:"text-white font-mono text-sm",children:"+251 91 234 5678"})]})]}),r.jsxs("div",{className:"flex items-start space-x-3",children:[r.jsx(Za,{className:"w-4 h-4 text-gray-400 mt-1"}),r.jsxs("div",{className:"flex-1",children:[r.jsx("div",{className:"text-xs uppercase font-mono text-gray-500 mb-1",children:"Member Since"}),r.jsx("div",{className:"text-white font-mono text-sm",children:new Date(n.createdAt).toLocaleDateString("en-US",{month:"short",day:"numeric",year:"numeric",hour:"2-digit",minute:"2-digit"})})]})]})]})]}),r.jsxs("div",{className:"overflow-x-hidden bg-white/[3%] border border-white/10 p-6 rounded-none",children:[r.jsx("h3",{className:"text-sm uppercase font-mono text-gray-400 mb-4 tracking-wider",children:"SECURITY"}),r.jsx("hr",{className:"border-white/10 -mx-10 border-dashed my-4"}),r.jsxs("div",{className:"space-y-4",children:[r.jsxs("div",{className:"flex items-center justify-between p-3 bg-black/30 border border-white/10 rounded-none",children:[r.jsxs("div",{className:"flex items-center space-x-3",children:[r.jsx(as,{className:"w-4 h-4 text-gray-400"}),r.jsx("div",{children:r.jsx("div",{className:"text-xs uppercase font-mono text-gray-500",children:"Email Verification"})})]}),r.jsx("div",{className:`px-2 rounded-none border border-dashed border-white/20 uppercase py-1 text-xs font-mono ${n.emailVerified?"bg-green-500/20 text-green-400":"bg-red-500/20 text-red-400"}`,children:n.emailVerified?"Verified":"Unverified"})]}),r.jsxs("div",{className:"flex items-center justify-between p-3 bg-black/30 border border-white/10 rounded-none",children:[r.jsxs("div",{className:"flex items-center space-x-3",children:[r.jsx(ps,{className:"w-4 h-4 text-gray-400"}),r.jsx("div",{children:r.jsx("div",{className:"text-xs uppercase font-mono text-gray-500",children:"Two-Factor Authentication"})})]}),r.jsx("div",{className:`px-2 rounded-none border border-dashed border-white/20 uppercase py-1 text-xs font-mono ${n.twoFactorEnabled?"bg-green-500/20 text-green-400":"bg-red-500/20 text-red-400"}`,children:n.twoFactorEnabled?"Enabled":"Disabled"})]})]})]})]}),v==="organizations"&&r.jsx("div",{className:"space-y-4",children:s.length===0?r.jsxs("div",{className:"text-center py-12",children:[r.jsx(ha,{className:"w-12 h-12 text-gray-400 mx-auto mb-4"}),r.jsx("h3",{className:"text-lg font-medium text-white mb-2",children:"No Organizations"}),r.jsx("p",{className:"text-gray-400",children:"This user is not a member of any organizations."})]}):r.jsx("div",{className:"grid gap-4",children:s.map(V=>r.jsxs("div",{className:"border border-dashed border-white/10 rounded-none p-4 hover:bg-white/5 transition-colors",children:[r.jsxs("div",{className:"flex items-start justify-between mb-3",children:[r.jsxs("div",{className:"flex items-center space-x-4 flex-1",children:[r.jsx("div",{className:"w-12 h-12 bg-black/80 border border-dashed border-white/20 flex items-center justify-center rounded-none",children:V.organization.image?r.jsx("img",{src:V.organization.image,alt:V.organization.name,className:"w-12 h-12 object-cover"}):r.jsx(ha,{className:"w-6 h-6 text-white"})}),r.jsxs("div",{className:"flex-1",children:[r.jsxs("h3",{className:"text-white font-light inline-flex items-start",children:[V.organization.name,r.jsxs("sup",{className:"text-xs text-gray-500 ml-2 mt-0.5",children:[r.jsx("span",{className:"mr-1",children:"["}),r.jsx("span",{className:"text-white/80 font-mono text-xs",children:V.organization.slug}),r.jsx("span",{className:"ml-1",children:"]"})]})]}),r.jsxs("p",{className:"text-gray-400 text-sm font-sans mt-1",children:["in ",V.organization.slug]})]})]}),r.jsx("div",{className:"flex flex-col items-end space-y-2",children:r.jsxs("div",{className:"flex items-center space-x-2",children:[r.jsxs("span",{className:"text-gray-500 font-mono text-xs uppercase",children:["Joined:"," "]}),r.jsxs("span",{className:"text-white font-mono text-xs",children:[new Date(V.joinedAt).toLocaleDateString("en-US",{year:"numeric",month:"short",day:"numeric"}),","," ",new Date(V.joinedAt).toLocaleTimeString("en-US",{hour:"numeric",minute:"2-digit",hour12:!0})]})]})})]}),r.jsx("div",{className:"flex items-center justify-end",children:r.jsxs($,{variant:"outline",size:"sm",onClick:()=>Tt(V.id),className:"border border-dashed border-red-400/20 text-red-400 hover:bg-red-400/10 rounded-none",children:[r.jsx(dg,{className:"w-4 h-4 mr-1"}),"Remove"]})})]},V.id))})}),v==="teams"&&r.jsx("div",{className:"space-y-4",children:o.length===0?r.jsxs("div",{className:"text-center py-12",children:[r.jsx(Ct,{className:"w-12 h-12 text-gray-400 mx-auto mb-4"}),r.jsx("h3",{className:"text-lg font-medium text-white mb-2",children:"No Teams"}),r.jsx("p",{className:"text-gray-400",children:"This user is not a member of any teams."})]}):r.jsx("div",{className:"grid gap-4",children:o.map(V=>r.jsxs("div",{className:"border border-dashed border-white/10 rounded-none p-4 hover:bg-white/5 transition-colors",children:[r.jsxs("div",{className:"flex items-start justify-between mb-3",children:[r.jsxs("div",{className:"flex items-center space-x-4 flex-1",children:[r.jsx("div",{className:"w-12 h-12 bg-black/80 border border-dashed border-white/20 flex items-center justify-center rounded-none",children:r.jsx(Ct,{className:"w-6 h-6 text-white"})}),r.jsxs("div",{className:"flex-1",children:[r.jsxs("h3",{className:"text-white font-light inline-flex items-start",children:[V.team.name,r.jsx(Ln,{id:V.team.id,variant:"subscript",nonSliced:!!(V.team.organizationSlug||V.team.organizationName)})]}),r.jsxs("p",{className:"text-gray-400 text-sm font-sans mt-1",children:["in"," ",V.team.organizationSlug||V.team.organizationName]})]})]}),r.jsx("div",{className:"flex flex-col items-end space-y-2",children:r.jsxs("div",{className:"flex items-center space-x-2",children:[r.jsxs("span",{className:"text-gray-500 font-mono text-xs uppercase",children:["Joined:"," "]}),r.jsxs("span",{className:"text-white font-mono text-xs",children:[new Date(V.joinedAt).toLocaleDateString("en-US",{year:"numeric",month:"short",day:"numeric"}),","," ",new Date(V.joinedAt).toLocaleTimeString("en-US",{hour:"numeric",minute:"2-digit",hour12:!0})]})]})})]}),r.jsx("div",{className:"flex items-center justify-end",children:r.jsxs($,{variant:"outline",size:"sm",onClick:()=>qt(V.id),className:"border border-dashed border-red-400/20 text-red-400 hover:bg-red-400/10 rounded-none",children:[r.jsx(dg,{className:"w-4 h-4 mr-1"}),"Remove"]})})]},V.id))})}),v==="accounts"&&r.jsxs("div",{className:"space-y-4",children:[r.jsxs("div",{className:"flex items-center justify-between mb-4",children:[r.jsxs("div",{children:[r.jsx("h3",{className:"text-lg font-medium text-white",children:"Linked Accounts"}),r.jsx("p",{className:"text-gray-400 text-sm",children:"Manage user OAuth account connections"})]}),r.jsxs($,{variant:"outline",onClick:()=>{te([]),ae(!1),k(!0)},className:"border border-dashed border-white/20 text-white hover:bg-white/10 rounded-none",children:[r.jsx(Xi,{className:"w-4 h-4 mr-2"}),"Seed Accounts"]})]}),h.length===0?r.jsxs("div",{className:"text-center py-12",children:[r.jsx(Xi,{className:"w-12 h-12 text-gray-400 mx-auto mb-4"}),r.jsx("h3",{className:"text-lg font-medium text-white mb-2",children:"No Linked Accounts"}),r.jsx("p",{className:"text-gray-400",children:"This user has not connected any accounts yet."})]}):r.jsx("div",{className:"grid gap-4",children:h.map(V=>r.jsxs("div",{className:"border border-dashed border-white/10 rounded-none p-4 hover:bg-white/5 transition-colors",children:[r.jsxs("div",{className:"flex items-start justify-between mb-3",children:[r.jsxs("div",{className:"flex items-center space-x-4 flex-1",children:[r.jsx("div",{className:"w-12 h-12 bg-black/80 border border-dashed border-white/20 flex items-center justify-center rounded-none",children:nU(V.providerId)}),r.jsxs("div",{className:"flex-1",children:[r.jsxs("h3",{className:"text-white font-light inline-flex items-start",children:[$e(V.providerId),r.jsx(Ln,{id:V.accountId,variant:"subscript",nonSliced:!!(V.email||n.email)})]}),r.jsx("p",{className:"text-gray-400 tracking-tight uppercase text-xs font-mono mt-1",children:`ID: ${V.id}`})]})]}),r.jsx("div",{className:"flex flex-col items-end space-y-2 text-right",children:r.jsxs("div",{className:"flex items-center space-x-2 text-xs font-mono text-gray-400",children:[r.jsx("span",{children:"Linked:"}),r.jsx("span",{className:"text-white",children:pt(V.createdAt||V.updatedAt)})]})})]}),r.jsx("div",{className:"flex items-center justify-end",children:r.jsxs($,{variant:"outline",size:"sm",onClick:()=>se(V.id),className:"border border-dashed border-red-400/20 text-red-400 hover:bg-red-400/10 rounded-none",children:[r.jsx(dg,{className:"w-4 h-4 mr-1"}),"Unlink"]})})]},V.id))})]}),v==="sessions"&&r.jsxs("div",{className:"space-y-4",children:[r.jsxs("div",{className:"flex items-center justify-between mb-4",children:[r.jsxs("div",{children:[r.jsx("h3",{className:"text-lg font-medium text-white",children:"Sessions"}),r.jsx("p",{className:"text-gray-400 text-sm",children:"Manage user authentication sessions"})]}),r.jsxs($,{variant:"outline",onClick:()=>{te([]),ae(!1),T(!0)},className:"border border-dashed border-white/20 text-white hover:bg-white/10 rounded-none",children:[r.jsx(ps,{className:"w-4 h-4 mr-2"}),"Seed Sessions"]})]}),c.length===0?r.jsxs("div",{className:"text-center py-12",children:[r.jsx(Dw,{className:"w-12 h-12 text-gray-400 mx-auto mb-4"}),r.jsx("h3",{className:"text-lg font-medium text-white mb-2",children:"No Sessions"}),r.jsx("p",{className:"text-gray-400",children:"This user has no active sessions."})]}):r.jsx("div",{className:"grid gap-4",children:c.map(V=>{var ce,he,xe,De;return r.jsxs("div",{className:"border border-dashed border-white/10 rounded-none p-4 hover:bg-white/5 transition-colors",children:[r.jsxs("div",{className:"flex items-start justify-between mb-3",children:[r.jsxs("div",{className:"flex items-center space-x-4 flex-1",children:[r.jsx("div",{className:"w-12 h-12 bg-black/80 border border-dashed border-white/20 flex items-center justify-center rounded-none",children:r.jsx(cC,{className:"w-6 h-6 text-white"})}),r.jsxs("div",{className:"flex-1",children:[r.jsxs("h3",{className:"text-white font-light inline-flex items-start",children:["Session ",V.id.substring(0,8),"...",r.jsxs("sup",{className:"text-xs text-gray-500 ml-2 mt-0.5",children:[r.jsx("span",{className:"mr-1",children:"["}),r.jsx("span",{className:"text-white/80 font-mono text-xs",children:V.ipAddress}),r.jsx("span",{className:"ml-1",children:"]"})]})]}),r.jsxs("div",{className:"flex items-center space-x-2 mt-2",children:[r.jsx(pte,{className:"w-3.5 h-3.5 text-gray-400"}),r.jsxs("span",{className:"text-gray-400 uppercase font-mono text-xs",children:[((ce=ge[V.id])==null?void 0:ce.city)||"...",","," ",((he=ge[V.id])==null?void 0:he.country)||"..."]}),((xe=ge[V.id])==null?void 0:xe.countryCode)&&r.jsx("span",{className:"text-xs ml-1",children:Ue((De=ge[V.id])==null?void 0:De.countryCode)})]})]})]}),r.jsx("div",{className:"flex flex-col items-end space-y-2",children:r.jsxs("div",{className:"flex items-center space-x-2",children:[r.jsxs("span",{className:"text-gray-500 font-mono text-xs uppercase",children:["Expires:"," "]}),r.jsxs("span",{className:"text-white font-mono text-xs",children:[new Date(V.expiresAt).toLocaleDateString("en-US",{year:"numeric",month:"short",day:"numeric"}),","," ",new Date(V.expiresAt).toLocaleTimeString("en-US",{hour:"numeric",minute:"2-digit",hour12:!0})]})]})})]}),r.jsx("div",{className:"flex items-center justify-end",children:r.jsxs($,{variant:"outline",size:"sm",onClick:()=>Wt(V.id),className:"border border-dashed border-red-400/20 text-red-400 hover:bg-red-400/10 rounded-none",children:[r.jsx(ug,{className:"w-4 h-4 mr-1"}),"Revoke"]})})]},V.id)})})]})]})]})]}),N&&r.jsx("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center z-50",children:r.jsxs("div",{className:"bg-black/90 border border-dashed border-white/20 rounded-none p-6 w-full max-w-md",children:[r.jsxs("div",{className:"flex items-center justify-between mb-4",children:[r.jsx("h3",{className:"text-lg text-white font-light",children:"Edit User"}),r.jsx($,{variant:"ghost",size:"sm",onClick:()=>{b(!1),K("")},className:"text-gray-400 hover:text-white rounded-none",children:"×"})]}),r.jsxs("div",{className:"space-y-4",children:[r.jsxs("div",{className:"flex items-center space-x-3",children:[r.jsx("div",{className:"w-16 h-16 bg-black/80 border border-dashed border-white/20 flex items-center justify-center",children:n!=null&&n.image?r.jsx("img",{src:n.image,alt:n.name,className:"w-16 h-16 object-cover"}):r.jsx(Mc,{className:"w-8 h-8 text-white"})}),r.jsxs("div",{className:"flex-1",children:[r.jsx("h4",{className:"text-white font-medium",children:n==null?void 0:n.name}),r.jsx("p",{className:"text-gray-400 text-sm",children:n==null?void 0:n.email})]})]}),r.jsxs("div",{children:[r.jsx("label",{className:"block text-sm font-medium text-gray-400 mb-2",children:"Name"}),r.jsx("input",{id:"edit-name",type:"text",defaultValue:(n==null?void 0:n.name)||"",className:"w-full px-3 py-2 bg-gray-800 border border-dashed border-white/20 rounded-none text-white placeholder-gray-400 focus:outline-none focus:border-white/50"})]}),r.jsxs("div",{children:[r.jsx("label",{className:"block text-sm font-medium text-gray-400 mb-2",children:"Email"}),r.jsx("input",{id:"edit-email",type:"email",defaultValue:(n==null?void 0:n.email)||"",className:"w-full px-3 py-2 bg-gray-800 border border-dashed border-white/20 rounded-none text-white placeholder-gray-400 focus:outline-none focus:border-white/50"})]}),r.jsxs("div",{children:[r.jsx("label",{className:"block text-sm font-medium text-gray-400 mb-2",children:"Role"}),r.jsxs(Ua,{className:"bg-black text-white",value:W,onValueChange:K,children:[r.jsx(Pa,{className:"w-full border border-dashed border-white/20 bg-black text-white rounded-none",children:r.jsx(yi,{placeholder:"Select role"})}),r.jsxs(Fa,{children:[r.jsx(Ve,{value:"",children:"None"}),r.jsx(Ve,{value:"admin",children:"Admin"}),r.jsx(Ve,{value:"user",children:"User"})]})]})]})]}),r.jsxs("div",{className:"flex justify-end space-x-2 mt-6",children:[r.jsx($,{variant:"outline",onClick:()=>{b(!1),K("")},className:"border border-dashed border-white/20 text-white hover:bg-white/10 rounded-none",children:"Cancel"}),r.jsx($,{onClick:We,className:"bg-white hover:bg-white/90 text-black border border-white/20 rounded-none",children:"Update"})]})]})}),y&&r.jsx("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center z-50",children:r.jsxs("div",{className:"bg-black border border-red-400/20 rounded-none p-6 w-full max-w-md",children:[r.jsx("h2",{className:"text-xl font-bold text-white mb-4",children:"Ban User"}),r.jsxs("p",{className:"text-gray-400 mb-4",children:["Ban ",r.jsx("strong",{children:n.name})," from accessing the system."]}),r.jsxs("div",{className:"space-y-4 mb-6",children:[r.jsxs("div",{children:[r.jsx(pe,{htmlFor:"banReason",className:"text-white",children:"Ban Reason"}),r.jsx(Te,{id:"banReason",value:A,onChange:V=>D(V.target.value),placeholder:"Enter reason for ban (optional)",className:"bg-black border border-dashed border-white/20 text-white rounded-none"})]}),r.jsxs("div",{children:[r.jsx(pe,{htmlFor:"banExpires",className:"text-white",children:"Ban Duration (seconds)"}),r.jsx(Te,{id:"banExpires",type:"number",value:B||"",onChange:V=>G(V.target.value?Number(V.target.value):void 0),placeholder:"Leave empty for permanent ban",className:"bg-black border border-dashed border-white/20 text-white rounded-none"}),r.jsx("p",{className:"text-xs text-gray-400 mt-1",children:"Examples: 3600 (1 hour), 86400 (1 day), 604800 (1 week)"})]})]}),r.jsxs("div",{className:"flex justify-end space-x-2",children:[r.jsx($,{variant:"outline",onClick:()=>{g(!1),D(""),G(void 0)},className:"border border-dashed border-white/20 text-white hover:bg-white/10 rounded-none",children:"Cancel"}),r.jsx($,{onClick:Ze,className:"bg-red-600 text-white hover:bg-red-700 rounded-none",children:"Ban User"})]})]})}),w&&r.jsx("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center z-50",children:r.jsxs("div",{className:"bg-black border border-green-400/20 rounded-none p-6 w-full max-w-md",children:[r.jsx("h2",{className:"text-xl font-bold text-white mb-4",children:"Unban User"}),r.jsxs("p",{className:"text-gray-400 mb-6",children:["Are you sure you want to unban ",r.jsx("strong",{children:n.name}),"? This will restore their access to the system."]}),r.jsxs("div",{className:"flex justify-end space-x-2",children:[r.jsx($,{variant:"outline",onClick:()=>S(!1),className:"border border-dashed border-white/20 text-white hover:bg-white/10 rounded-none",children:"Cancel"}),r.jsx($,{onClick:Et,className:"bg-green-400 text-white hover:bg-green-700 rounded-none",children:"Unban User"})]})]})}),j&&n&&r.jsx("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center z-50",children:r.jsxs("div",{className:"bg-black/90 border border-dashed border-white/20 p-6 w-full max-w-md rounded-none",children:[r.jsxs("div",{className:"flex items-center justify-between mb-4",children:[r.jsx("h3",{className:"text-lg text-white font-light",children:"Delete User"}),r.jsx($,{variant:"ghost",size:"sm",onClick:()=>U(!1),className:"text-gray-400 hover:text-white rounded-none",children:r.jsx(xt,{className:"w-4 h-4"})})]}),r.jsxs("div",{className:"space-y-4",children:[r.jsxs("div",{className:"flex items-center space-x-3",children:[r.jsx("div",{className:"w-16 h-16 bg-black/80 border border-dashed border-white/20 flex items-center justify-center",children:n.image?r.jsx("img",{src:n.image,alt:n.name,className:"w-16 h-16 object-cover"}):r.jsx(Mc,{className:"w-8 h-8 text-white"})}),r.jsxs("div",{children:[r.jsx("div",{className:"text-white font-light",children:n.name}),r.jsx("div",{className:"text-sm text-gray-400",children:n.email})]})]}),r.jsx("p",{className:"text-gray-400",children:"Are you sure you want to delete this user? This action cannot be undone."})]}),r.jsxs("div",{className:"flex justify-end space-x-3 mt-6",children:[r.jsx($,{variant:"outline",onClick:()=>U(!1),className:"border border-dashed border-white/20 text-white hover:bg-white/10 rounded-none",children:"Cancel"}),r.jsx($,{onClick:et,className:"bg-red-500 hover:bg-red-600 text-white border border-red-500 rounded-none",children:"Delete"})]})]})}),I&&n&&r.jsx("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center z-50",children:r.jsxs("div",{className:"bg-black/90 border border-dashed border-white/20 p-6 w-full max-w-md rounded-none",children:[r.jsxs("div",{className:"flex items-center justify-between mb-4",children:[r.jsx("h3",{className:"text-lg text-white font-light",children:"Update Password"}),r.jsx($,{variant:"ghost",size:"sm",onClick:()=>F(!1),className:"text-gray-400 hover:text-white rounded-none",children:r.jsx(xt,{className:"w-4 h-4"})})]}),r.jsx("div",{className:"space-y-4",children:r.jsxs("div",{children:[r.jsx(pe,{htmlFor:"new-password",className:"text-sm text-gray-400 font-light",children:"New Password"}),r.jsx(Te,{id:"new-password",type:"password",className:"mt-1 border border-dashed border-white/20 bg-black/30 text-white rounded-none"})]})}),r.jsxs("div",{className:"flex justify-end space-x-3 mt-6",children:[r.jsx($,{variant:"outline",onClick:()=>F(!1),className:"border border-dashed border-white/20 text-white hover:bg-white/10 rounded-none",children:"Cancel"}),r.jsx($,{onClick:async()=>{var he;const V=(he=document.getElementById("new-password"))==null?void 0:he.value;if(!V){H.error("Please enter a password");return}const ce=H.loading("Updating password...");try{const De=await(await fetch(`/api/users/${e}/password`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({password:V})})).json();De.success?(F(!1),document.getElementById("new-password").value="",H.success("Password updated successfully!",{id:ce})):H.error(`Error updating password: ${De.error||"Unknown error"}`,{id:ce})}catch{H.error("Error updating password",{id:ce})}},className:"bg-white hover:bg-white/90 text-black border border-white/20 rounded-none",children:"Update"})]})]})}),C&&r.jsx("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center z-50 overflow-hidden",children:r.jsxs("div",{className:"overflow-x-hidden overflow-y-auto bg-black/90 border border-white/10 p-6 w-full pt-4 max-w-2xl rounded-none max-h-[90vh]",children:[r.jsxs("div",{className:"flex items-center justify-between mb-6",children:[r.jsxs("h3",{className:"text-sm text-white flex items-center justify-center font-light uppercase",children:[r.jsx("span",{className:"text-white/50 mr-2",children:"["}),r.jsx(cC,{className:"inline mr-2 w-3 h-3 text-white"}),r.jsx("span",{className:"font-mono text-white/70 uppercase",children:"Seed Sessions"}),r.jsx("span",{className:"text-white/50 ml-2",children:"]"})]}),r.jsx($,{variant:"ghost",size:"sm",onClick:()=>T(!1),className:"text-gray-400 hover:text-white rounded-none",children:r.jsx(xt,{className:"w-4 h-4"})})]}),r.jsx("hr",{className:"border-white/10 -mx-10 border-dashed -mt-4 mb-4"}),r.jsxs("div",{className:"space-y-6",children:[r.jsx("div",{className:"space-y-4",children:r.jsxs("div",{className:"flex items-center space-x-3",children:[r.jsxs("div",{className:"flex-1",children:[r.jsx(pe,{htmlFor:"session-count",className:"text-sm text-gray-400 font-light",children:"Number of sessions"}),r.jsx(Te,{id:"session-count",type:"number",min:"1",max:"50",defaultValue:"3",className:"mt-1 border border-dashed border-white/20 bg-black/30 text-white rounded-none"})]}),r.jsx($,{onClick:()=>{var ce;const V=parseInt(((ce=document.getElementById("session-count"))==null?void 0:ce.value)||"3",10);we(V)},disabled:ee,className:"bg-transparent hover:bg-white/90 bg-white text-black border border-white/20 rounded-none mt-6 disabled:opacity-50",children:ee?r.jsxs(r.Fragment,{children:[r.jsx(gn,{className:"w-3 h-3 mr-2 animate-spin"}),"Seeding..."]}):r.jsxs(r.Fragment,{children:[r.jsx(ps,{className:"w-3 h-3 mr-2"}),"Seed Sessions"]})})]})}),ne.length>0&&r.jsx("div",{className:"mt-6",children:r.jsx(ji,{title:"Session Seeding Terminal",lines:ne,isRunning:ee,className:"w-full",defaultCollapsed:!0})})]}),r.jsx("hr",{className:"border-white/10 -mx-10 border-dashed mt-10"}),r.jsx("div",{className:"flex justify-end mt-6 pt-6",children:r.jsx($,{variant:"outline",onClick:()=>T(!1),className:"border border-dashed border-white/20 text-white hover:bg-white/10 rounded-none",children:"Close"})})]})}),E&&r.jsx("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center z-50 overflow-hidden",children:r.jsxs("div",{className:"overflow-x-hidden overflow-y-auto bg-black/90 border border-white/10 p-6 w-full pt-4 max-w-2xl rounded-none max-h-[90vh]",children:[r.jsxs("div",{className:"flex items-center justify-between mb-6",children:[r.jsxs("h3",{className:"text-sm text-white flex items-center justify-center font-light uppercase",children:[r.jsx("span",{className:"text-white/50 mr-2",children:"["}),r.jsx(Xi,{className:"inline mr-2 w-3 h-3 text-white"}),r.jsx("span",{className:"font-mono text-white/70 uppercase",children:"Seed Accounts"}),r.jsx("span",{className:"text-white/50 ml-2",children:"]"})]}),r.jsx($,{variant:"ghost",size:"sm",onClick:()=>k(!1),className:"text-gray-400 hover:text-white rounded-none",children:r.jsx(xt,{className:"w-4 h-4"})})]}),r.jsx("hr",{className:"border-white/10 -mx-10 border-dashed -mt-4 mb-4"}),r.jsxs("div",{className:"space-y-6",children:[r.jsxs("div",{className:"space-y-4",children:[r.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[r.jsxs("div",{children:[r.jsx(pe,{htmlFor:"account-count",className:"text-sm text-gray-400 font-light",children:"Number of accounts"}),r.jsx(Te,{id:"account-count",type:"number",min:"1",max:"50",defaultValue:"3",className:"mt-1 border border-dashed border-white/20 bg-black/30 text-white rounded-none"})]}),r.jsxs("div",{children:[r.jsx(pe,{htmlFor:"account-provider",className:"text-sm text-gray-400 font-light",children:"Provider"}),r.jsxs(Ua,{value:O,onValueChange:R,children:[r.jsx(Pa,{className:"mt-1 border border-dashed border-white/20 bg-black/30 text-white rounded-none",children:r.jsx(yi,{placeholder:"Select provider"})}),r.jsxs(Fa,{className:"bg-black border border-dashed border-white/20",children:[r.jsx(Ve,{value:"random",children:"Mix (Random)"}),r.jsx(Ve,{value:"github",children:"GitHub"}),r.jsx(Ve,{value:"google",children:"Google"}),r.jsx(Ve,{value:"discord",children:"Discord"}),r.jsx(Ve,{value:"facebook",children:"Facebook"}),r.jsx(Ve,{value:"twitter",children:"Twitter"}),r.jsx(Ve,{value:"linkedin",children:"LinkedIn"}),r.jsx(Ve,{value:"apple",children:"Apple"}),r.jsx(Ve,{value:"microsoft",children:"Microsoft"}),r.jsx(Ve,{value:"gitlab",children:"GitLab"}),r.jsx(Ve,{value:"bitbucket",children:"Bitbucket"}),r.jsx(Ve,{value:"spotify",children:"Spotify"}),r.jsx(Ve,{value:"twitch",children:"Twitch"}),r.jsx(Ve,{value:"reddit",children:"Reddit"}),r.jsx(Ve,{value:"slack",children:"Slack"}),r.jsx(Ve,{value:"notion",children:"Notion"}),r.jsx(Ve,{value:"tiktok",children:"TikTok"}),r.jsx(Ve,{value:"zoom",children:"Zoom"})]})]})]})]}),r.jsx($,{onClick:()=>{var ce;const V=parseInt(((ce=document.getElementById("account-count"))==null?void 0:ce.value)||"3",10);Be(V,O)},disabled:ee,className:"bg-white hover:bg-white/90 text-black border border-white/20 rounded-none disabled:opacity-50",children:ee?r.jsxs(r.Fragment,{children:[r.jsx(gn,{className:"w-3 h-3 mr-2 animate-spin"}),"Seeding..."]}):r.jsxs(r.Fragment,{children:[r.jsx(Xi,{className:"w-3 h-3 mr-2"}),"Seed Accounts"]})})]}),ne.length>0&&r.jsx("div",{className:"mt-6",children:r.jsx(ji,{title:"Account Seeding Terminal",lines:ne,isRunning:ee,className:"w-full",defaultCollapsed:!0})})]}),r.jsx("hr",{className:"border-white/10 -mx-10 border-dashed mt-10"}),r.jsx("div",{className:"flex justify-end mt-6 pt-6",children:r.jsx($,{variant:"outline",onClick:()=>k(!1),className:"border border-dashed border-white/20 text-white hover:bg-white/10 rounded-none",children:"Close"})})]})})]}):r.jsx("div",{className:"min-h-screen bg-black flex items-center justify-center",children:r.jsx("div",{className:"text-white text-lg",children:"User not found"})})}function jue(){return r.jsx(YW,{children:r.jsxs(OB,{children:[r.jsx(zK,{children:r.jsxs(EB,{children:[r.jsx(Dn,{path:"/",element:r.jsx(Pte,{})}),r.jsx(Dn,{path:"/users",element:r.jsx(x5,{})}),r.jsx(Dn,{path:"/users/:userId",element:r.jsx(Aue,{})}),r.jsx(Dn,{path:"/organizations",element:r.jsx(b5,{})}),r.jsx(Dn,{path:"/organizations/:orgId",element:r.jsx(xue,{})}),r.jsx(Dn,{path:"/teams",element:r.jsx(wue,{})}),r.jsx(Dn,{path:"/teams/:teamId",element:r.jsx(qR,{})}),r.jsx(Dn,{path:"/organizations/:orgId/teams/:teamId",element:r.jsx(qR,{})}),r.jsx(Dn,{path:"/sessions",element:r.jsx(yue,{})}),r.jsx(Dn,{path:"/database",element:r.jsx(zte,{})}),r.jsx(Dn,{path:"/database/demo",element:r.jsx(VW,{})}),r.jsx(Dn,{path:"/emails",element:r.jsx(gue,{})}),r.jsx(Dn,{path:"/tools",element:r.jsx(Cue,{})}),r.jsx(Dn,{path:"/settings",element:r.jsx(vue,{})})]})}),r.jsx(cz,{className:"rounded-none border-dashed border-white/20",theme:"dark",position:"top-right",richColors:!0,toastOptions:{style:{border:"dashed 1px #ffffff20",borderRadius:"0"},className:"font-mono uppercase"},closeButton:!0})]})})}OF.createRoot(document.getElementById("root")).render(r.jsx(J.StrictMode,{children:r.jsx(jue,{})}));
package/public/index.html CHANGED
@@ -5,7 +5,7 @@
5
5
  <link rel="icon" type="image/svg+xml" href="/vite.svg" />
6
6
  <meta name="viewport" content="width=device-width, initial-scale=1.0" />
7
7
  <title>Better Auth Studio</title>
8
- <script type="module" crossorigin src="/assets/main-DGjVB3rc.js"></script>
8
+ <script type="module" crossorigin src="/assets/main-Opvi4-R9.js"></script>
9
9
  <link rel="stylesheet" crossorigin href="/assets/main-CvEhI3bC.css">
10
10
  </head>
11
11
  <body>