better-auth-studio 1.0.79-beta.51 → 1.0.79-beta.53

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.
@@ -1147,4 +1147,4 @@ export const authClient = createAuthClient({
1147
1147
 
1148
1148
  }`)},className:"border border-dashed border-white/20 text-white hover:bg-white/10 rounded-none",children:"Reset"}),a.jsx(H,{onClick:IP,disabled:Et,className:"rounded-none",children:Et?a.jsxs(a.Fragment,{children:[a.jsx(In,{className:"w-4 h-4 mr-2 animate-spin"}),"Generating..."]}):"Generate Token"})]}),we&&a.jsxs("div",{className:"space-y-4 border border-dashed border-white/15 p-4",children:[a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsxs("div",{children:[a.jsx("p",{className:"text-xs uppercase font-mono text-gray-400",children:"Generated Token"}),a.jsx("p",{className:"text-white font-mono text-sm break-all mt-1",children:we.token})]}),a.jsx(H,{variant:"ghost",size:"sm",onClick:()=>ar(we.token),className:"text-gray-400 hover:text-white rounded-none",children:a.jsx(Ma,{className:"w-4 h-4"})})]}),a.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-4 text-xs font-mono",children:[a.jsxs("div",{children:[a.jsx("p",{className:"text-gray-400 uppercase tracking-wider",children:"Type"}),a.jsx("p",{className:"text-white mt-1 capitalize",children:we.type.replace("_"," ")})]}),a.jsxs("div",{children:[a.jsx("p",{className:"text-gray-400 uppercase tracking-wider",children:"Expires"}),a.jsx("p",{className:"text-white mt-1",children:oP(we.expiresAt)})]}),we.url&&a.jsxs("div",{className:"col-span-1",children:[a.jsx("p",{className:"text-gray-400 uppercase tracking-wider",children:"URL"}),a.jsx("p",{className:"text-white mt-1 break-all",children:we.url})]})]}),we.metadata&&a.jsxs("div",{className:"border border-dashed border-white/10 p-3",children:[a.jsx("p",{className:"text-xs uppercase font-mono text-gray-400 mb-2",children:"Metadata"}),a.jsx("pre",{className:"text-[11px] text-gray-100 font-mono bg-black/40 p-3 overflow-x-auto",children:JSON.stringify(we.metadata,null,2)})]})]})]})]})}),Kc&&a.jsx("div",{className:"fixed inset-0 bg-black/80 flex items-center justify-center z-[60]",children:a.jsxs("div",{className:"bg-black border border-dashed border-white/20 rounded-none p-6 w-full max-w-5xl max-h-[90vh] overflow-y-auto",children:[a.jsxs("div",{className:"flex items-center justify-between mb-6",children:[a.jsxs("div",{className:"flex items-center space-x-2",children:[a.jsx(bi,{className:"w-5 h-5 text-white"}),a.jsx("h3",{className:"text-xl text-white font-light uppercase tracking-wider",children:"Plugin Generator"})]}),a.jsx(H,{variant:"ghost",size:"sm",onClick:()=>uh(!1),className:"text-gray-400 hover:text-white rounded-none",children:a.jsx(gt,{className:"w-4 h-4"})})]}),a.jsxs("div",{className:"space-y-6",children:[a.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[a.jsxs("div",{children:[a.jsx(ie,{className:"text-xs uppercase font-mono text-gray-400 mb-2 block",children:"Plugin Name *"}),a.jsx(be,{value:ll,onChange:D=>Om(D.target.value),placeholder:"myPlugin",className:"bg-black border border-dashed border-white/20 text-white rounded-none"}),a.jsx("p",{className:"text-[11px] text-gray-500 mt-1 font-mono",children:"Must to be filled"})]}),a.jsxs("div",{children:[a.jsx(ie,{className:"text-xs uppercase font-mono text-gray-400 mb-2 block",children:"Description (optional)"}),a.jsx(be,{value:kE,onChange:D=>Dm(D.target.value),placeholder:"Plugin description",className:"bg-black border border-dashed border-white/20 text-white rounded-none"}),a.jsx("p",{className:"text-[11px] text-gray-500 mt-1 font-mono",children:"Leave empty to use the default description"})]})]}),a.jsxs("div",{children:[a.jsxs("div",{className:"flex items-center justify-between mb-3",children:[a.jsx(ie,{className:"text-xs uppercase font-mono text-gray-400",children:"Tables (optional)"}),a.jsxs("div",{className:"flex space-x-2",children:[a.jsx(H,{variant:"ghost",size:"sm",onClick:()=>Hn([...Dn,{name:"",isExtending:!1,fields:[{name:"",type:"string",required:!1,unique:!1}]}]),className:"text-xs uppercase font-mono text-gray-400 hover:text-white rounded-none",children:"+ Add Table"}),a.jsx(H,{variant:"ghost",size:"sm",onClick:()=>Hn([...Dn,{name:"",isExtending:!0,extendedTableName:"",fields:[{name:"",type:"string",required:!1,unique:!1}]}]),className:"text-xs uppercase font-mono text-gray-400 hover:text-white rounded-none",children:"+ Extend Table"})]})]}),Dn.length===0?a.jsx("p",{className:"text-xs text-gray-500 font-mono",children:"No tables added"}):a.jsx("div",{className:"space-y-2",children:Dn.map((D,z)=>a.jsxs("div",{className:"border px-5 border-dashed border-white/15 p-3 relative",children:[a.jsxs("div",{className:"flex items-center space-x-2 relative",children:[D.isExtending?a.jsxs(a.Fragment,{children:[a.jsxs(Ln,{value:D.extendedTableName||"",onValueChange:Q=>{const ae=[...Dn];ae[z].extendedTableName=Q,ae[z].name=Q,Hn(ae)},children:[a.jsx(Un,{className:"bg-black sm:w-40 border border-dashed border-white/20 text-white text-xs rounded-none flex-1",children:a.jsx(oa,{className:"sm:text-[11px] text-white/90 font-mono uppercase",placeholder:"Select table"})}),a.jsx(Pn,{children:Z6.map(Q=>a.jsx(Fe,{className:"sm:text-[11px] uppercase font-mono text-white/90 border-b border-dashed last:border-b-0",value:Q.name,children:Q.displayName},Q.name))})]}),a.jsx("span",{className:"text-xs text-gray-400 font-mono uppercase whitespace-nowrap",children:"(Extending)"})]}):a.jsx(be,{value:D.name,onChange:Q=>{const ae=[...Dn];ae[z].name=Q.target.value,Hn(ae)},placeholder:"Table name",className:"bg-black border border-dashed border-white/20 text-white text-xs rounded-none flex-1"}),a.jsx(H,{variant:"ghost",size:"sm",onClick:()=>{Hn(Dn.filter((Q,ae)=>ae!==z))},className:"text-red-400 hover:text-red-300 rounded-none",children:a.jsx(gt,{className:"w-4 h-4"})})]}),D.fields.length>0&&a.jsxs(a.Fragment,{children:[a.jsx("div",{className:"absolute border border-dashed w-px border-white/30",style:{left:"7px",top:"31px",bottom:"12px"}}),a.jsx("div",{className:"absolute border border-dashed h-px w-[11px] border-white/30",style:{left:"9px",top:"31px",bottom:"12px"}}),a.jsx("div",{className:"mt-3 relative",children:a.jsxs("div",{className:"space-y-0 pl-6",children:[D.fields.map((Q,ae)=>a.jsxs("div",{className:"relative",children:[a.jsx("div",{className:"absolute border border-dashed h-px border-white/30 top-1/2 -translate-y-1/2",style:{left:"-36px",width:"36px"}}),a.jsxs("div",{className:"flex items-center space-x-2 py-1",children:[a.jsx(be,{value:Q.name,onChange:le=>{const he=[...Dn];he[z].fields[ae].name=le.target.value,Hn(he)},placeholder:"Field name",className:"bg-black border border-dashed border-white/20 text-white text-xs rounded-none flex-1"}),a.jsxs(Ln,{value:Q.type,onValueChange:le=>{const he=[...Dn];he[z].fields[ae].type=le,Hn(he)},children:[a.jsx(Un,{className:"sm:h-10 sm:w-56 border px-0 border-dashed border-white/20 text-white/90 text-xs rounded-none py-1",children:a.jsx(oa,{className:"font-mono uppercase text-[10px] px-0 text-white/90"})}),a.jsxs(Pn,{className:"font-mono uppercase text-[10px]",children:[a.jsx(Fe,{className:"sm:text-[11px] text-white/90 border-b border-dashed last:border-b-0",value:"string",children:"string"}),a.jsx(Fe,{className:"sm:text-[11px] text-white/90 border-b border-dashed last:border-b-0",value:"number",children:"number"}),a.jsx(Fe,{className:"sm:text-[11px] text-white/90 border-b border-dashed last:border-b-0",value:"boolean",children:"boolean"}),a.jsx(Fe,{className:"sm:text-[11px] text-white/90 border-b border-dashed last:border-b-0",value:"date",children:"date"})]})]}),Q.required&&a.jsxs("div",{className:"flex items-center",children:[Q.type==="string"&&a.jsx(be,{value:Q.defaultValue||"",onChange:le=>{const he=[...Dn];he[z].fields[ae].defaultValue=le.target.value,Hn(he)},placeholder:"Default value",className:"sm:h-10 sm:w-56 border px-0 border-dashed border-white/20 text-white/90 text-xs rounded-none py-1 font-mono uppercase text-[10px]"}),Q.type==="boolean"&&a.jsxs(Ln,{value:Q.defaultValue||"",onValueChange:le=>{const he=[...Dn];he[z].fields[ae].defaultValue=le,Hn(he)},children:[a.jsx(Un,{className:"sm:h-10 sm:w-56 border px-0 border-dashed border-white/20 text-white/90 text-xs rounded-none py-1",children:a.jsx(oa,{className:"font-mono uppercase text-[10px] px-0 text-white/90",placeholder:"Default value"})}),a.jsxs(Pn,{className:"font-mono uppercase text-[10px]",children:[a.jsx(Fe,{className:"sm:text-[11px] text-white/90 border-b border-dashed last:border-b-0",value:"true",children:"true"}),a.jsx(Fe,{className:"sm:text-[11px] text-white/90 border-b border-dashed last:border-b-0",value:"false",children:"false"})]})]}),Q.type==="date"&&a.jsxs("div",{className:"flex items-center space-x-2",children:[a.jsxs(Ln,{value:Q.defaultValue==="now()"?"now()":Q.defaultValue&&Q.defaultValue!=="now()"?"custom":"",onValueChange:le=>{const he=[...Dn];if(le==="now()")he[z].fields[ae].defaultValue="now()";else if(le==="custom"){if(!he[z].fields[ae].defaultValue||he[z].fields[ae].defaultValue==="now()"){const ot=new Date,Lt=ot.getFullYear(),da=String(ot.getMonth()+1).padStart(2,"0"),Tt=String(ot.getDate()).padStart(2,"0"),Ut=String(ot.getHours()).padStart(2,"0"),Es=String(ot.getMinutes()).padStart(2,"0");he[z].fields[ae].defaultValue=`${Lt}-${da}-${Tt}T${Ut}:${Es}`}}else he[z].fields[ae].defaultValue=void 0;Hn(he)},children:[a.jsx(Un,{className:"sm:h-10 sm:w-40 border px-0 border-dashed border-white/20 text-white/90 text-xs rounded-none py-1",children:a.jsx(oa,{className:"font-mono uppercase text-[10px] px-0 text-white/90",placeholder:"Default"})}),a.jsxs(Pn,{className:"font-mono uppercase text-[10px]",children:[a.jsx(Fe,{className:"sm:text-[11px] text-white/90 border-b border-dashed last:border-b-0",value:"now()",children:"now()"}),a.jsx(Fe,{className:"sm:text-[11px] text-white/90 border-b border-dashed last:border-b-0",value:"custom",children:"Custom"})]})]}),Q.defaultValue&&Q.defaultValue!=="now()"&&a.jsx(be,{type:"datetime-local",value:Q.defaultValue,onChange:le=>{const he=[...Dn];he[z].fields[ae].defaultValue=le.target.value,Hn(he)},className:"sm:h-10 sm:w-40 border px-0 border-dashed border-white/20 text-white/90 text-xs rounded-none py-1 font-mono uppercase text-[10px]"})]}),Q.type==="number"&&a.jsx(be,{type:"number",value:Q.defaultValue||"",onChange:le=>{const he=[...Dn];he[z].fields[ae].defaultValue=le.target.value,Hn(he)},placeholder:"Default value",className:"sm:h-10 sm:w-56 border px-0 border-dashed border-white/20 text-white/90 text-xs rounded-none py-1 font-mono uppercase text-[10px]"})]}),a.jsxs("div",{className:"h-8 flex items-end space-x-2",children:[a.jsx(Ef,{id:`required-${z}-${ae}`,checked:Q.required,onCheckedChange:le=>{const he=[...Dn];he[z].fields[ae].required=le===!0,le===!1&&(he[z].fields[ae].defaultValue=void 0),Hn(he)}}),a.jsx(ie,{htmlFor:`required-${z}-${ae}`,className:"text-xs text-gray-400 font-mono uppercase cursor-pointer",children:"Required"})]}),a.jsxs("div",{className:"flex h-8 items-end space-x-2",children:[a.jsx(Ef,{id:`unique-${z}-${ae}`,checked:Q.unique,onCheckedChange:le=>{const he=[...Dn];he[z].fields[ae].unique=le===!0,Hn(he)}}),a.jsx(ie,{htmlFor:`unique-${z}-${ae}`,className:"text-xs text-gray-400 font-mono uppercase cursor-pointer",children:"Unique"})]}),a.jsx(H,{variant:"ghost",size:"sm",onClick:()=>{const le=[...Dn];le[z].fields=le[z].fields.filter((he,ot)=>ot!==ae),Hn(le)},className:"text-red-400 hover:text-red-300 rounded-none",children:a.jsx(gt,{className:"w-3 h-3"})})]})]},ae)),a.jsxs("div",{className:"relative pt-2",children:[a.jsx("div",{className:"absolute border border-dashed h-px border-white/30",style:{left:"-35px",width:"36px",top:"25px"}}),a.jsx(H,{variant:"ghost",size:"sm",onClick:()=>{const Q=[...Dn];Q[z].fields.push({name:"",type:"string",required:!1,unique:!1,defaultValue:void 0}),Hn(Q)},className:"text-xs uppercase font-mono text-gray-400 hover:text-white rounded-none",children:"+ Add Field"})]})]})})]}),D.fields.length===0&&a.jsx("div",{className:"mt-3",children:a.jsx(H,{variant:"ghost",size:"sm",onClick:()=>{const Q=[...Dn];Q[z].fields.push({name:"",type:"string",required:!1,unique:!1,defaultValue:void 0}),Hn(Q)},className:"text-xs text-gray-400 hover:text-white rounded-none",children:"+ Add Field"})})]},z))})]}),a.jsxs("div",{children:[a.jsxs("div",{className:"flex items-center justify-between mb-3",children:[a.jsxs("div",{className:"flex items-center space-x-2",children:[a.jsx(Fh,{className:"w-4 h-4 text-white"}),a.jsx(ie,{className:"text-xs uppercase font-mono text-gray-400",children:"Hooks"})]}),a.jsx(H,{variant:"ghost",size:"sm",onClick:()=>Nr([...nr,{name:"",timing:"before",action:"sign-up",hookLogic:"const context = ctx;",expanded:!0}]),className:"text-xs uppercase font-mono text-gray-400 hover:text-white rounded-none",children:"+ Add Hook"})]}),nr.length===0?a.jsx("p",{className:"text-xs text-gray-500 font-mono",children:"No hooks added"}):a.jsx("div",{className:"space-y-2",children:nr.map((D,z)=>{const Q=`${D.timing} ${D.action==="custom"?"custom":D.action}: ${D.name||`Hook ${z+1}`}`;return a.jsxs("div",{className:"border border-dashed border-white/10",children:[a.jsxs("button",{onClick:()=>EP(z),className:"w-full flex items-center justify-between p-3 hover:bg-white/5 transition-colors text-left",children:[a.jsx("span",{className:"text-xs font-mono text-white px-2 py-1 bg-black/40 border border-dashed border-white/20 rounded-none",children:Q}),a.jsx(yd,{className:`w-4 h-4 text-white/60 transition-transform ${D.expanded?"rotate-90":""}`})]}),D.expanded&&a.jsxs("div",{className:"border-t border-dashed border-white/10 p-4 space-y-4",children:[a.jsxs("div",{children:[a.jsx(ie,{className:"text-xs uppercase font-mono text-gray-400 mb-2 block",children:"Hook Name"}),a.jsx(be,{value:D.name,onChange:ae=>{const le=[...nr];le[z].name=ae.target.value,Nr(le)},placeholder:"e.g., Age Verification, TOS Check",className:"bg-black border border-dashed border-white/20 text-white rounded-none"})]}),a.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[a.jsxs("div",{children:[a.jsx(ie,{className:"text-xs uppercase font-mono text-gray-400 mb-2 block",children:"Timing"}),a.jsxs(n1,{value:D.timing,onValueChange:ae=>{const le=[...nr];le[z].timing=ae,Nr(le)},className:"flex space-x-4",children:[a.jsxs("div",{className:"flex items-center space-x-2",children:[a.jsx(kl,{value:"before",id:`hook-timing-before-${z}`}),a.jsx(ie,{htmlFor:`hook-timing-before-${z}`,className:"text-xs text-white font-mono cursor-pointer",children:"Before"})]}),a.jsxs("div",{className:"flex items-center space-x-2",children:[a.jsx(kl,{value:"after",id:`hook-timing-after-${z}`}),a.jsx(ie,{htmlFor:`hook-timing-after-${z}`,className:"text-xs text-white font-mono cursor-pointer",children:"After"})]})]})]}),a.jsxs("div",{children:[a.jsx(ie,{className:"text-xs uppercase font-mono text-gray-400 mb-2 block",children:"Action"}),a.jsxs(n1,{value:D.action,onValueChange:ae=>{const le=[...nr];le[z].action=ae,Nr(le)},className:"flex space-x-4",children:[a.jsxs("div",{className:"flex items-center space-x-2",children:[a.jsx(kl,{value:"sign-up",id:`hook-action-signup-${z}`}),a.jsx(ie,{htmlFor:`hook-action-signup-${z}`,className:"text-xs text-white font-mono cursor-pointer",children:"Sign-up"})]}),a.jsxs("div",{className:"flex items-center space-x-2",children:[a.jsx(kl,{value:"sign-in",id:`hook-action-signin-${z}`}),a.jsx(ie,{htmlFor:`hook-action-signin-${z}`,className:"text-xs text-white font-mono cursor-pointer",children:"Sign-in"})]}),a.jsxs("div",{className:"flex items-center space-x-2",children:[a.jsx(kl,{value:"custom",id:`hook-action-custom-${z}`}),a.jsx(ie,{htmlFor:`hook-action-custom-${z}`,className:"text-xs text-white font-mono cursor-pointer",children:"Custom"})]})]})]})]}),D.action==="custom"&&a.jsxs("div",{children:[a.jsx(ie,{className:"text-xs uppercase font-mono text-gray-400 mb-2 block",children:"Custom Path"}),a.jsx(be,{value:D.customPath||"",onChange:ae=>{const le=[...nr];le[z].customPath=ae.target.value,Nr(le)},placeholder:"/my-plugin/custom-endpoint",className:"bg-black border border-dashed border-white/20 text-white rounded-none"})]}),a.jsxs("div",{children:[a.jsx(ie,{className:"text-xs uppercase font-mono text-gray-400 mb-2 block",children:"Custom Matcher (optional)"}),a.jsx(be,{value:D.customMatcher||"",onChange:ae=>{const le=[...nr];le[z].customMatcher=ae.target.value,Nr(le)},placeholder:"e.g., context.headers.get('x-custom') === 'value'",className:"bg-black border border-dashed border-white/20 text-white rounded-none"}),a.jsx("p",{className:"text-[11px] text-gray-500 mt-1 font-mono",children:"Leave empty to use default path matching"})]}),a.jsxs("div",{children:[a.jsxs("div",{className:"flex items-center space-x-2 mb-2",children:[a.jsx(bi,{className:"w-4 h-4 text-white"}),a.jsx(ie,{className:"text-xs uppercase font-mono text-gray-400",children:"Hook Logic (TypeScript)"})]}),a.jsx("p",{className:"text-xs text-gray-400 mb-2 font-mono",children:"This is the TypeScript code that will be executed when the hook is triggered. This function has properties like ctx so you can access the request context, headers, body, etc. Here is a simple example of a hook logic:"}),a.jsx(hw,{value:D.hookLogic,onChange:ae=>{const le=[...nr];le[z].hookLogic=ae,Nr(le)},language:"typescript",placeholder:"const context = ctx;",className:"w-full"})]}),a.jsxs(H,{variant:"outline",onClick:()=>{Nr(nr.filter((ae,le)=>le!==z))},className:"w-full border border-dashed border-red-500/50 text-red-400 hover:bg-red-500/10 rounded-none",children:[a.jsx(gt,{className:"w-4 h-4 mr-2"}),"Remove Hook"]})]})]},z)})})]}),a.jsxs("div",{children:[a.jsxs("div",{className:"flex items-center justify-between mb-3",children:[a.jsxs("div",{className:"flex items-center space-x-2",children:[a.jsx(ia,{className:"w-4 h-4 text-white"}),a.jsx(ie,{className:"text-xs uppercase font-mono text-gray-400",children:"Middleware"})]}),a.jsx(H,{variant:"ghost",size:"sm",onClick:()=>ws([...$r,{name:"",path:"/my-plugin/protected",pathType:"exact",middlewareLogic:"const context = ctx;",expanded:!0}]),className:"text-xs uppercase font-mono text-gray-400 hover:text-white rounded-none",children:"+ Add Middleware"})]}),$r.length===0?a.jsx("p",{className:"text-xs text-gray-500 font-mono",children:"No middleware added"}):a.jsx("div",{className:"space-y-2",children:$r.map((D,z)=>{const Q=`${D.path}: ${D.name||`Middleware ${z+1}`}`;return a.jsxs("div",{className:"border border-dashed border-white/10",children:[a.jsxs("button",{onClick:()=>jP(z),className:"w-full flex items-center justify-between p-3 hover:bg-white/5 transition-colors text-left",children:[a.jsx("span",{className:"text-xs font-mono text-white px-2 py-1 bg-black/40 border border-dashed border-white/20 rounded-none",children:Q}),a.jsx(yd,{className:`w-4 h-4 text-white/60 transition-transform ${D.expanded?"rotate-90":""}`})]}),D.expanded&&a.jsxs("div",{className:"border-t border-dashed border-white/10 p-4 space-y-4",children:[a.jsxs("div",{children:[a.jsx(ie,{className:"text-xs uppercase font-mono text-gray-400 mb-2 block",children:"Middleware Name"}),a.jsx(be,{value:D.name,onChange:ae=>{const le=[...$r];le[z].name=ae.target.value,ws(le)},placeholder:"e.g., Auth Check, Rate Limiter",className:"bg-black border border-dashed border-white/20 text-white rounded-none"})]}),a.jsxs("div",{children:[a.jsx(ie,{className:"text-xs uppercase font-mono text-gray-400 mb-2 block",children:"Path"}),a.jsx(be,{value:D.path,onChange:ae=>{const le=[...$r];le[z].path=ae.target.value,ws(le)},placeholder:"/my-plugin/protected",className:"bg-black border border-dashed border-white/20 text-white rounded-none"})]}),a.jsxs("div",{children:[a.jsx(ie,{className:"text-xs uppercase font-mono text-gray-400 mb-2 block",children:"Path Type"}),a.jsxs(Ln,{value:D.pathType,onValueChange:ae=>{const le=[...$r];le[z].pathType=ae,ws(le)},children:[a.jsx(Un,{className:"bg-black border border-dashed border-white/20 text-white rounded-none",children:a.jsx(oa,{})}),a.jsxs(Pn,{children:[a.jsx(Fe,{value:"exact",children:"Exact Match"}),a.jsx(Fe,{value:"prefix",children:"Prefix Match"}),a.jsx(Fe,{value:"regex",children:"Regex Match"})]})]})]}),a.jsxs("div",{children:[a.jsxs("div",{className:"flex items-center space-x-2 mb-2",children:[a.jsx(bi,{className:"w-4 h-4 text-white"}),a.jsx(ie,{className:"text-xs uppercase font-mono text-gray-400",children:"Middleware Logic (TypeScript)"})]}),a.jsx("p",{className:"text-xs text-gray-400 mb-2 font-mono",children:"This is the TypeScript code that will be executed when the middleware is triggered. You can access the request context, headers, body, etc."}),a.jsx(hw,{value:D.middlewareLogic,onChange:ae=>{const le=[...$r];le[z].middlewareLogic=ae,ws(le)},language:"typescript",placeholder:"const context = ctx;",className:"w-full"})]}),a.jsxs(H,{variant:"outline",onClick:()=>{ws($r.filter((ae,le)=>le!==z))},className:"w-full border border-dashed border-red-500/50 text-red-400 hover:bg-red-500/10 rounded-none",children:[a.jsx(gt,{className:"w-4 h-4 mr-2"}),"Remove Middleware"]})]})]},z)})})]}),a.jsxs("div",{children:[a.jsxs("div",{className:"flex items-center justify-between mb-3",children:[a.jsxs("div",{className:"flex items-center space-x-2",children:[a.jsx(sc,{className:"w-4 h-4 text-white"}),a.jsx(ie,{className:"text-xs uppercase font-mono text-gray-400",children:"Endpoints"})]}),a.jsx(H,{variant:"ghost",size:"sm",onClick:()=>{const D="/my-plugin/endpoint",z=Fm(D);fo([...Ns,{name:z,path:D,method:"POST",handlerLogic:`// Endpoint handler logic here
1149
1149
  return ctx.json({ success: true });`,expanded:!0}])},className:"text-xs uppercase font-mono text-gray-400 hover:text-white rounded-none",children:"+ Add Endpoint"})]}),Ns.length===0?a.jsx("p",{className:"text-xs text-gray-500 font-mono",children:"No endpoints added"}):a.jsx("div",{className:"space-y-2",children:Ns.map((D,z)=>{const Q=`${D.method} ${D.path}: ${D.name||Fm(D.path)||`Endpoint ${z+1}`}`;return a.jsxs("div",{className:"border border-dashed border-white/10",children:[a.jsxs("button",{onClick:()=>TP(z),className:"w-full flex items-center justify-between p-3 hover:bg-white/5 transition-colors text-left",children:[a.jsx("span",{className:"text-xs font-mono text-white px-2 py-1 bg-black/40 border border-dashed border-white/20 rounded-none",children:Q}),a.jsx(yd,{className:`w-4 h-4 text-white/60 transition-transform ${D.expanded?"rotate-90":""}`})]}),D.expanded&&a.jsxs("div",{className:"border-t border-dashed border-white/10 p-4 space-y-4",children:[a.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[a.jsxs("div",{children:[a.jsx(ie,{className:"text-xs uppercase font-mono text-gray-400 mb-2 block",children:"Path"}),a.jsx(be,{value:D.path,onChange:ae=>{const le=ae.target.value,he=Fm(le),ot=[...Ns];ot[z].path=le,ot[z].name=he,fo(ot)},placeholder:"/sign-in/anonymous",className:"bg-black border border-dashed border-white/20 text-white rounded-none"})]}),a.jsxs("div",{children:[a.jsx(ie,{className:"text-xs uppercase font-mono text-gray-400 mb-2 block",children:"Endpoint Name (Auto-generated)"}),a.jsx(be,{value:D.name,readOnly:!0,className:"bg-black/50 border border-dashed border-white/10 text-white/70 rounded-none cursor-not-allowed"}),a.jsx("p",{className:"text-[11px] text-gray-500 mt-1 font-mono",children:"Generated from path"})]}),a.jsxs("div",{children:[a.jsx(ie,{className:"text-xs uppercase font-mono text-gray-400 mb-2 block",children:"Method"}),a.jsxs(Ln,{value:D.method,onValueChange:ae=>{const le=[...Ns];le[z].method=ae,fo(le)},children:[a.jsx(Un,{className:"bg-black border border-dashed border-white/20 text-white rounded-none",children:a.jsx(oa,{})}),a.jsxs(Pn,{children:[a.jsx(Fe,{value:"GET",children:"GET"}),a.jsx(Fe,{value:"POST",children:"POST"})]})]})]})]}),a.jsxs("div",{children:[a.jsxs("div",{className:"flex items-center space-x-2 mb-2",children:[a.jsx(bi,{className:"w-4 h-4 text-white"}),a.jsx(ie,{className:"text-xs uppercase font-mono text-gray-400",children:"Handler Logic (TypeScript)"})]}),a.jsx("p",{className:"text-xs text-gray-400 mb-2 font-mono",children:"This is the TypeScript code that will be executed when the endpoint is called. You can access the context via ctx parameter."}),a.jsx(hw,{value:D.handlerLogic,onChange:ae=>{const le=[...Ns];le[z].handlerLogic=ae,fo(le)},language:"typescript",placeholder:"// Endpoint handler logic here\\nreturn ctx.json({ success: true });",className:"w-full"})]}),a.jsxs(H,{variant:"outline",onClick:()=>{fo(Ns.filter((ae,le)=>le!==z))},className:"w-full border border-dashed border-red-500/50 text-red-400 hover:bg-red-500/10 rounded-none",children:[a.jsx(gt,{className:"w-4 h-4 mr-2"}),"Remove Endpoint"]})]})]},z)})})]}),a.jsxs("div",{children:[a.jsxs("div",{className:"flex items-center space-x-2 mb-3",children:[a.jsx(Ef,{id:"rate-limit",checked:Im,onCheckedChange:D=>Mm(D===!0)}),a.jsx(ie,{htmlFor:"rate-limit",className:"text-xs uppercase font-mono text-gray-400 cursor-pointer",children:"Enable Rate Limiting"})]}),Im&&a.jsxs("div",{className:"border border-dashed border-white/10 p-4 space-y-4 mt-3",children:[a.jsxs("div",{children:[a.jsx(ie,{className:"text-xs uppercase font-mono text-gray-400 mb-2 block",children:"Path"}),a.jsx(be,{value:va.path,onChange:D=>{ii({...va,path:D.target.value})},placeholder:"/my-plugin/*",className:"bg-black border border-dashed border-white/20 text-white rounded-none"})]}),a.jsxs("div",{children:[a.jsx(ie,{className:"text-xs uppercase font-mono text-gray-400 mb-2 block",children:"Path Type"}),a.jsxs(Ln,{value:va.pathType,onValueChange:D=>{ii({...va,pathType:D})},children:[a.jsx(Un,{className:"bg-black border border-dashed border-white/20 text-white rounded-none",children:a.jsx(oa,{})}),a.jsxs(Pn,{children:[a.jsx(Fe,{value:"exact",children:"Exact Match"}),a.jsx(Fe,{value:"prefix",children:"Prefix Match"}),a.jsx(Fe,{value:"regex",children:"Regex Match"})]})]})]}),a.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[a.jsxs("div",{children:[a.jsx(ie,{className:"text-xs uppercase font-mono text-gray-400 mb-2 block",children:"Window (ms)"}),a.jsx(be,{type:"number",value:va.window||"",onChange:D=>{const z=D.target.value;ii({...va,window:z===""?0:parseInt(z,10)||0})},onBlur:D=>{(!D.target.value||parseInt(D.target.value,10)<=0)&&ii({...va,window:15*60*1e3})},placeholder:"900000",className:"bg-black border border-dashed border-white/20 text-white rounded-none"}),a.jsx("p",{className:"text-[11px] text-gray-500 mt-1 font-mono",children:"Time window in milliseconds (e.g., 900000 = 15 minutes)"})]}),a.jsxs("div",{children:[a.jsx(ie,{className:"text-xs uppercase font-mono text-gray-400 mb-2 block",children:"Max Requests"}),a.jsx(be,{type:"number",value:va.max||"",onChange:D=>{const z=D.target.value;ii({...va,max:z===""?0:parseInt(z,10)||0})},onBlur:D=>{(!D.target.value||parseInt(D.target.value,10)<=0)&&ii({...va,max:100})},placeholder:"100",className:"bg-black border border-dashed border-white/20 text-white rounded-none"}),a.jsx("p",{className:"text-[11px] text-gray-500 mt-1 font-mono",children:"Maximum requests per window"})]})]})]})]}),a.jsxs("div",{className:"flex items-center justify-end space-x-2",children:[a.jsx(H,{variant:"outline",onClick:()=>{Om(""),Dm(""),Lm("react"),Hn([]),Nr([]),ws([]),fo([]),Mm(!1),ii({path:"/my-plugin/*",pathType:"prefix",window:15*60*1e3,max:100}),Zc(null),Qc(null)},className:"border border-dashed border-white/20 text-white hover:bg-white/10 rounded-none",children:"Reset"}),a.jsx(H,{onClick:kP,disabled:_E||!ll.trim(),className:"rounded-none",children:_E?a.jsxs(a.Fragment,{children:[a.jsx(In,{className:"w-4 h-4 mr-2 animate-spin"}),"Generating..."]}):"Generate Plugin"})]}),OE&&a.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:OE}),Jt&&a.jsxs("div",{ref:AE,className:"space-y-4 border border-dashed border-white/15 p-4",children:[a.jsxs("div",{className:"flex items-center justify-between mb-4",children:[a.jsx("p",{className:"text-xs uppercase font-mono text-gray-400",children:"Generated Code"}),a.jsxs("div",{className:"flex items-center space-x-2",children:[oi==="clientSetup"&&a.jsxs("div",{className:"flex items-center space-x-2 mr-2",children:[a.jsx(ie,{className:"text-xs uppercase font-mono text-gray-400 whitespace-nowrap",children:"Framework:"}),a.jsxs(Ln,{value:IE,onValueChange:D=>{Lm(D),CP(D)},children:[a.jsx(Un,{className:"bg-black sm:w-56 border border-dashed border-white/20 text-white rounded-none w-[220px] h-10 text-xs font-mono uppercase px-4 py-2",children:a.jsx(oa,{className:"font-mono uppercase text-xs text-white"})}),a.jsxs(Pn,{className:"font-mono uppercase text-[10px] bg-black border border-dashed border-white/20",children:[a.jsxs(Fe,{value:"react",className:"sm:text-[11px] text-white/90 border-b border-dashed last:border-b-0",children:[" ","React"]}),a.jsxs(Fe,{value:"svelte",className:"sm:text-[11px] text-white/90 border-b border-dashed last:border-b-0",children:[" ","Svelte"]}),a.jsxs(Fe,{value:"solid",className:"sm:text-[11px] text-white/90 border-b border-dashed last:border-b-0",children:[" ","Solid"]}),a.jsxs(Fe,{value:"vue",className:"sm:text-[11px] text-white/90 border-b border-dashed last:border-b-0",children:[" ","Vue"]})]})]})]}),a.jsxs(H,{variant:"ghost",size:"sm",onClick:()=>{var ot,Lt,da,Tt,Ut;const D=Jt[oi],z=((Ut=[{id:"server",path:((ot=Jt.filePaths)==null?void 0:ot.server)||`plugin/${Jt.name}/index.ts`},{id:"client",path:((Lt=Jt.filePaths)==null?void 0:Lt.client)||`plugin/${Jt.name}/client/index.ts`},{id:"serverSetup",path:((da=Jt.filePaths)==null?void 0:da.serverSetup)||"auth.ts"},{id:"clientSetup",path:((Tt=Jt.filePaths)==null?void 0:Tt.clientSetup)||"auth-client.ts"}].find(Es=>Es.id===oi))==null?void 0:Ut.path)||`${Jt.name}-${oi}.ts`,Q=new Blob([D],{type:"text/plain"}),ae=window.URL.createObjectURL(Q),le=document.createElement("a");le.href=ae;const he=z.split("/").pop()||z;le.download=he,document.body.appendChild(le),le.click(),document.body.removeChild(le),window.URL.revokeObjectURL(ae)},className:"text-gray-400 hover:text-white rounded-none",children:[a.jsx(Hl,{className:"w-4 h-4 mr-1"}),"Download"]})]})]}),a.jsx("div",{className:"flex space-x-2 border-b border-dashed border-white/10",children:[{id:"server",label:"Server Plugin",path:((UE=Jt.filePaths)==null?void 0:UE.server)||`plugin/${Jt.name}/index.ts`},{id:"client",label:"Client Plugin",path:((PE=Jt.filePaths)==null?void 0:PE.client)||`plugin/${Jt.name}/client/index.ts`},{id:"serverSetup",label:"Server Setup",path:((FE=Jt.filePaths)==null?void 0:FE.serverSetup)||"auth.ts"},{id:"clientSetup",label:"Client Setup",path:((zE=Jt.filePaths)==null?void 0:zE.clientSetup)||"auth-client.ts"}].map(D=>a.jsx("button",{onClick:()=>DE(D.id),className:`px-3 py-2 text-xs uppercase font-mono border-b-2 transition-colors ${oi===D.id?"border-white text-white":"border-transparent text-gray-400 hover:text-white"}`,title:D.path,children:D.label},D.id))}),a.jsx("div",{className:"border border-dashed border-white/10",children:a.jsx(v6,{code:Jt[oi],language:"typescript",fileName:((GE=[{id:"server",path:((BE=Jt.filePaths)==null?void 0:BE.server)||`plugin/${Jt.name}/index.ts`},{id:"client",path:(($E=Jt.filePaths)==null?void 0:$E.client)||`plugin/${Jt.name}/client/index.ts`},{id:"serverSetup",path:((HE=Jt.filePaths)==null?void 0:HE.serverSetup)||"auth.ts"},{id:"clientSetup",path:((qE=Jt.filePaths)==null?void 0:qE.clientSetup)||"auth-client.ts"}].find(D=>D.id===oi))==null?void 0:GE.path)||`${Jt.name}-${oi}.ts`})})]})]})]})}),B&&A&&a.jsx("div",{className:"fixed inset-0 bg-black/80 flex items-center justify-center z-50 overflow-hidden",onClick:D=>{D.target===D.currentTarget&&(T(!1),$(null))},children:a.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:D=>D.stopPropagation(),children:[a.jsxs("div",{className:"flex items-center justify-between mb-6",children:[a.jsxs("div",{className:"flex items-center space-x-2",children:[a.jsx(WN,{className:"w-5 h-5 text-white"}),a.jsx("h3",{className:"text-xl text-white font-light uppercase tracking-wider",children:"Configuration Validator"})]}),a.jsx(H,{variant:"ghost",size:"sm",onClick:()=>{T(!1),$(null)},className:"text-gray-400 hover:text-white rounded-none",children:a.jsx(gt,{className:"w-4 h-4"})})]}),a.jsxs("div",{className:"mb-6 p-4 border border-dashed border-white/10",children:[a.jsx("div",{className:"text-xs uppercase font-mono text-gray-400 mb-3",children:"Summary"}),a.jsxs("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-4",children:[a.jsxs("div",{className:"text-left border-r border-dashed border-white/10 pr-4 last:border-r-0",children:[a.jsx("div",{className:"text-2xl font-mono text-white",children:A.summary.total}),a.jsx("div",{className:"text-xs text-gray-400 uppercase mt-1 font-mono",children:"Total Checks"})]}),a.jsxs("div",{className:"text-left border-r border-dashed border-white/10 pr-4 last:border-r-0",children:[a.jsx("div",{className:"text-2xl font-mono text-white",children:A.summary.passes}),a.jsx("div",{className:"text-xs text-gray-400 uppercase mt-1 font-mono",children:"Passed"})]}),a.jsxs("div",{className:"text-left border-r border-dashed border-white/10 pr-4 last:border-r-0",children:[a.jsx("div",{className:"text-2xl font-mono text-white",children:A.summary.errors}),a.jsx("div",{className:"text-xs text-gray-400 uppercase mt-1 font-mono",children:"Errors"})]}),a.jsxs("div",{className:"text-left",children:[a.jsx("div",{className:"text-2xl font-mono text-white",children:A.summary.warnings}),a.jsx("div",{className:"text-xs text-gray-400 uppercase mt-1 font-mono",children:"Warnings"})]})]})]}),a.jsx("div",{className:"space-y-4",children:Object.entries(A.results.reduce((D,z)=>(D[z.category]||(D[z.category]=[]),D[z.category].push(z),D),{})).map(([D,z])=>{if(D==="OAuth Providers"){const Q=z.reduce((ae,le)=>{const he=le.check.match(/^(.+?)\s*-\s*(.+)$/);if(he){const ot=he[1],Lt=he[2];ae[ot]||(ae[ot]=[]),ae[ot].push({...le,check:Lt})}else ae.General||(ae.General=[]),ae.General.push(le);return ae},{});return a.jsxs("div",{className:"border border-dashed border-white/10 p-4",children:[a.jsxs("h4",{className:"text-white font-mono uppercase text-xs mb-4 text-left",children:[D,a.jsxs("span",{className:"text-gray-500 font-normal ml-2",children:["(",z.length," check",z.length!==1?"s":"",")"]})]}),a.jsx("div",{className:"space-y-2",children:Object.entries(Q).map(([ae,le])=>{const he=Y.has(ae),ot=le.some(Tt=>Tt.severity==="error"),Lt=le.some(Tt=>Tt.severity==="warning"),da=le.every(Tt=>Tt.status==="pass");return a.jsxs("div",{className:"border border-dashed border-white/10",children:[a.jsxs("button",{onClick:()=>{X(Tt=>{const Ut=new Set(Tt);return Ut.has(ae)?Ut.delete(ae):Ut.add(ae),Ut})},className:"w-full flex items-center justify-between p-3 hover:bg-white/5 transition-colors text-left",children:[a.jsxs("div",{className:"flex items-center space-x-2",children:[a.jsx(yd,{className:`w-4 h-4 text-white/60 transition-transform ${he?"rotate-90":""}`}),a.jsx("span",{className:"text-white font-mono text-sm",children:ae}),a.jsxs("span",{className:"text-xs text-gray-500 font-mono",children:["(",le.length," check",le.length!==1?"s":"",")"]})]}),a.jsxs("div",{className:"flex items-center space-x-2",children:[ot&&a.jsx("span",{className:"text-xs text-white/60 font-mono",children:"Error"}),Lt&&!ot&&a.jsx("span",{className:"text-xs text-white/60 font-mono",children:"Warning"}),da&&!ot&&!Lt&&a.jsx(Vl,{className:"w-4 h-4 text-white/60"})]})]}),he&&a.jsx("div",{className:"border-t border-dashed border-white/10 space-y-2 p-2",children:le.map((Tt,Ut)=>a.jsx("div",{className:`p-3 border-l border-dashed border-white/15 ${Tt.status==="pass"?"bg-green-600/[8%]":"bg-red-600/[8%]"}`,children:a.jsxs("div",{className:"flex items-start space-x-3",children:[a.jsx("div",{className:"mt-0.5",children:Tt.severity==="error"?a.jsx(Jr,{className:"w-4 h-4 text-white/60"}):Tt.severity==="warning"?a.jsx(El,{className:"w-4 h-4 text-white/60"}):Tt.status==="pass"?a.jsx(Vl,{className:"w-4 h-4 text-white/60"}):a.jsx(ql,{className:"w-4 h-4 text-white/40"})}),a.jsxs("div",{className:"flex-1 text-left",children:[a.jsxs("div",{className:"flex items-center space-x-2 mb-1",children:[a.jsx("span",{className:"text-white font-mono text-sm",children:Tt.check}),a.jsx("span",{className:"text-xs px-2 py-0.5 border border-dashed border-white/20 text-white/60 font-mono",children:Tt.status.toUpperCase()})]}),a.jsx("p",{className:"text-gray-300 text-sm",children:Tt.message}),Tt.suggestion&&a.jsxs("div",{className:"mt-2 p-2 bg-black/40 border border-dashed border-white/10",children:[a.jsx("p",{className:"text-xs text-gray-400 uppercase mb-1 font-mono",children:"Suggestion"}),a.jsx("p",{className:"text-xs text-gray-300",children:Tt.suggestion})]})]})]})},`${ae}-${Tt.check}-${Ut}`))})]},ae)})})]},D)}return a.jsxs("div",{className:"border border-dashed border-white/10 p-4",children:[a.jsxs("h4",{className:"text-white font-mono uppercase text-xs mb-4 text-left",children:[D,a.jsxs("span",{className:"text-gray-500 font-normal ml-2",children:["(",z.length," check",z.length!==1?"s":"",")"]})]}),a.jsx("div",{className:"space-y-3",children:z.map((Q,ae)=>a.jsx("div",{className:`p-3 border-l border-dashed border-white/15 ${Q.status==="pass"?"bg-green-600/[8%]":"bg-red-600/[8%]"}`,children:a.jsxs("div",{className:"flex items-start space-x-3",children:[a.jsx("div",{className:"mt-0.5",children:Q.severity==="error"?a.jsx(Jr,{className:"w-4 h-4 text-white/60"}):Q.severity==="warning"?a.jsx(El,{className:"w-4 h-4 text-white/60"}):Q.status==="pass"?a.jsx(Vl,{className:"w-4 h-4 text-white/60"}):a.jsx(ql,{className:"w-4 h-4 text-white/40"})}),a.jsxs("div",{className:"flex-1 text-left",children:[a.jsxs("div",{className:"flex items-center space-x-2 mb-1",children:[a.jsx("span",{className:"text-white font-mono text-sm",children:Q.check}),a.jsx("span",{className:"text-xs px-2 py-0.5 border border-dashed border-white/20 text-white/60 font-mono",children:Q.status.toUpperCase()})]}),a.jsx("p",{className:"text-gray-300 text-sm",children:Q.message}),Q.suggestion&&a.jsxs("div",{className:"mt-2 p-2 bg-black/40 border border-dashed border-white/10",children:[a.jsx("p",{className:"text-xs text-gray-400 uppercase mb-1 font-mono",children:"Suggestion"}),a.jsx("p",{className:"text-xs text-gray-300",children:Q.suggestion})]})]})]})},`${Q.category}-${Q.check}-${ae}`))})]},D)})}),a.jsx("div",{className:"mt-6 flex justify-end",children:a.jsx(H,{variant:"outline",onClick:()=>{T(!1),$(null)},className:"border border-dashed border-white/20 text-white hover:bg-white/10 rounded-none",children:"Close"})})]})}),Zt&&a.jsx("div",{className:"fixed inset-0 bg-black/80 flex items-center justify-center z-[60] overflow-hidden",onClick:D=>{D.target===D.currentTarget&&vt(!1)},children:a.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:D=>D.stopPropagation(),children:[a.jsxs("div",{className:"flex items-center justify-between mb-6",children:[a.jsxs("div",{className:"flex items-center space-x-2",children:[a.jsx(Fh,{className:"w-5 h-5 text-white"}),a.jsx("h3",{className:"text-xl text-white font-light uppercase tracking-wider",children:"UUID Generator"})]}),a.jsx(H,{variant:"ghost",size:"sm",onClick:()=>vt(!1),className:"text-gray-400 hover:text-white rounded-none",children:a.jsx(gt,{className:"w-4 h-4"})})]}),a.jsxs("div",{className:"space-y-4",children:[a.jsxs("div",{children:[a.jsx(ie,{className:"text-xs uppercase font-mono text-gray-400 mb-2 block",children:"Generate UUIDs"}),a.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[a.jsxs("div",{children:[a.jsx(ie,{className:"text-xs uppercase font-mono text-gray-400 mb-2 block",children:"Count (1-100)"}),a.jsx(be,{type:"number",value:tn,onChange:D=>{const z=D.target.value;if(z===""){ne("");return}const Q=parseInt(z);isNaN(Q)||ne(z)},onBlur:D=>{const z=D.target.value,Q=parseInt(z);isNaN(Q)||Q<1?ne("1"):Q>100?ne("100"):ne(String(Q))},min:"1",max:"100",className:"bg-black border border-dashed border-white/20 text-white rounded-none"})]}),a.jsxs("div",{className:"flex items-end justify-end space-x-2",children:[a.jsx(H,{variant:"outline",onClick:()=>{ne("1"),Ue([])},className:"border border-dashed border-white/20 text-white hover:bg-white/10 rounded-none",children:"Clear"}),a.jsx(H,{onClick:vP,className:"rounded-none",children:"Generate UUIDs"})]})]})]}),a.jsxs("div",{children:[a.jsx(ie,{className:"text-xs uppercase font-mono text-gray-400 mb-2 block",children:"Validate UUID"}),a.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[a.jsx("div",{children:a.jsx(be,{value:Ve,onChange:D=>{at(D.target.value)},onBlur:yP,placeholder:"Paste UUID to validate",className:"bg-black border border-dashed border-white/20 text-white font-mono text-xs rounded-none"})}),a.jsx("div",{className:"flex items-end justify-end space-x-2",children:a.jsx(H,{variant:"outline",onClick:()=>{at(""),Z(null)},className:"border border-dashed border-white/20 text-white hover:bg-white/10 rounded-none",children:"Clear"})})]}),nt&&a.jsx("div",{className:`mt-2 border border-dashed p-3 rounded-none ${nt.isValid?"border-white/10 bg-black/40":"border-red-500/30 bg-red-500/10"}`,children:a.jsxs("div",{className:"text-xs font-mono space-y-1",children:[a.jsx("div",{className:`${nt.isValid?"text-green-400":"text-red-300"}`,children:nt.isValid?"✓ Valid UUID":"✗ Invalid UUID"}),nt.isValid&&nt.version&&a.jsxs("div",{className:"text-gray-400",children:["Version: ",nt.version]}),nt.isValid&&nt.variant&&a.jsxs("div",{className:"text-gray-400",children:["Variant: ",nt.variant]})]})})]}),Ee.length>0&&a.jsxs("div",{className:"space-y-4",children:[a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsx(ie,{className:"text-xs uppercase font-mono text-gray-400",children:"Generated UUIDs"}),a.jsxs(H,{variant:"ghost",size:"sm",onClick:()=>ar(Ee.join(`
1150
- `)),className:"text-gray-400 hover:text-white rounded-none",children:[a.jsx(Ma,{className:"w-4 h-4 mr-1"}),"Copy All"]})]}),a.jsx("div",{className:"border border-dashed border-white/10 p-3",children:a.jsx("div",{className:"space-y-2 max-h-64 overflow-y-auto",children:Ee.map((D,z)=>a.jsxs("div",{className:"flex items-center justify-between p-2 bg-black/40 border border-dashed border-white/10",children:[a.jsx("span",{className:"text-white font-mono text-xs break-all",children:D}),a.jsx(H,{variant:"ghost",size:"sm",onClick:()=>ar(D),className:"text-gray-400 hover:text-white rounded-none ml-2",children:a.jsx(Ma,{className:"w-3 h-3"})})]},z))})})]}),a.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-4 text-xs font-mono",children:[a.jsxs("div",{className:"border border-dashed border-white/10 p-3 space-y-2",children:[a.jsx("div",{className:"text-gray-400 uppercase tracking-wider",children:"Version"}),a.jsx("p",{className:"text-white text-sm",children:"v4 (Random)"}),a.jsx("p",{className:"text-gray-500 text-xs",children:"Cryptographically random"})]}),a.jsxs("div",{className:"border border-dashed border-white/10 p-3 space-y-2",children:[a.jsx("div",{className:"text-gray-400 uppercase tracking-wider",children:"Format"}),a.jsx("p",{className:"text-white text-sm",children:"8-4-4-4-12"}),a.jsx("p",{className:"text-gray-500 text-xs",children:"36 characters"})]}),a.jsxs("div",{className:"border border-dashed border-white/10 p-3 space-y-2",children:[a.jsx("div",{className:"text-gray-400 uppercase tracking-wider",children:"Standard"}),a.jsx("p",{className:"text-white text-sm",children:"RFC 4122"}),a.jsx("p",{className:"text-gray-500 text-xs",children:"Universally unique"})]})]})]})]})}),xe&&a.jsx("div",{className:"fixed inset-0 bg-black/80 flex items-center justify-center z-[60] overflow-hidden",children:a.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:[a.jsxs("div",{className:"flex items-center justify-between mb-6",children:[a.jsxs("div",{className:"flex items-center space-x-2",children:[a.jsx(rc,{className:"w-5 h-5 text-white"}),a.jsx("h3",{className:"text-xl text-white font-light uppercase tracking-wider",children:"Password Strength Checker"})]}),a.jsx(H,{variant:"ghost",size:"sm",onClick:()=>Re(!1),className:"text-gray-400 hover:text-white rounded-none",children:a.jsx(gt,{className:"w-4 h-4"})})]}),a.jsxs("div",{className:"space-y-4",children:[a.jsxs("div",{children:[a.jsx(ie,{className:"text-xs uppercase font-mono text-gray-400 mb-2 block",children:"Password"}),a.jsxs("div",{className:"relative",children:[a.jsx(be,{type:pe?"text":"password",value:dt,onChange:D=>ft(D.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"}),a.jsx(H,{variant:"ghost",size:"sm",onClick:()=>Le(!pe),className:"absolute right-0 top-0 h-full px-3 text-gray-400 hover:text-white rounded-none",children:pe?a.jsx(xf,{className:"w-4 h-4"}):a.jsx(Hs,{className:"w-4 h-4"})})]})]}),a.jsxs("div",{className:"flex items-end justify-end space-x-2",children:[a.jsx(H,{variant:"outline",onClick:()=>{ft(""),Rt(null),Le(!1)},className:"border border-dashed border-white/20 text-white hover:bg-white/10 rounded-none",children:"Clear"}),a.jsx(H,{onClick:hP,disabled:W||!dt.trim(),className:"rounded-none",children:W?a.jsxs(a.Fragment,{children:[a.jsx(In,{className:"w-4 h-4 mr-2 animate-spin"}),"Checking..."]}):"Check Strength"})]}),ze&&a.jsxs("div",{className:"space-y-4",children:[a.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-4 text-xs font-mono",children:[a.jsxs("div",{className:"border border-dashed border-white/10 p-3 space-y-2",children:[a.jsx("div",{className:"text-gray-400 uppercase tracking-wider",children:"Strength"}),a.jsx("p",{className:`text-sm font-medium ${ze.strength==="very-strong"?"text-green-400":ze.strength==="strong"?"text-green-300":ze.strength==="good"?"text-yellow-300":ze.strength==="fair"?"text-orange-300":"text-red-300"}`,children:ze.strength.split("-").map(D=>D.charAt(0).toUpperCase()+D.slice(1)).join(" ")}),a.jsx("div",{className:"w-full bg-black/40 h-2 rounded-none",children:a.jsx("div",{className:`h-full transition-all ${ze.strength==="very-strong"?"bg-green-400 w-full":ze.strength==="strong"?"bg-green-300 w-4/5":ze.strength==="good"?"bg-yellow-300 w-3/5":ze.strength==="fair"?"bg-orange-300 w-2/5":"bg-red-300 w-1/5"}`})})]}),a.jsxs("div",{className:"border border-dashed border-white/10 p-3 space-y-2",children:[a.jsx("div",{className:"text-gray-400 uppercase tracking-wider",children:"Score"}),a.jsxs("p",{className:"text-white text-sm",children:[ze.score," / 5"]}),a.jsx("p",{className:"text-gray-500 text-xs",children:ze.score===5?"Excellent":ze.score===4?"Very Good":ze.score===3?"Good":ze.score===2?"Fair":"Weak"})]}),a.jsxs("div",{className:"border border-dashed border-white/10 p-3 space-y-2",children:[a.jsx("div",{className:"text-gray-400 uppercase tracking-wider",children:"Config Match"}),a.jsx("p",{className:`text-sm ${ze.meetsConfig?"text-green-400":"text-red-300"}`,children:ze.meetsConfig?"✓ Meets Requirements":"✗ Fails Requirements"}),a.jsxs("p",{className:"text-gray-500 text-xs",children:[ze.configRequirements.minLength," -"," ",ze.configRequirements.maxLength," chars"]})]})]}),a.jsxs("div",{className:"border border-dashed border-white/10 p-3",children:[a.jsx("div",{className:"text-xs uppercase font-mono text-gray-400 mb-3",children:"Checks"}),a.jsx("div",{className:"space-y-2",children:ze.checks.map((D,z)=>a.jsxs("div",{className:"flex items-center justify-between p-2 bg-black/40 border border-dashed border-white/10",children:[a.jsx("span",{className:"text-white font-mono text-xs",children:D.name}),a.jsxs("div",{className:"flex items-center space-x-2",children:[a.jsx("span",{className:`text-xs font-mono ${D.passed?"text-green-400":"text-red-300"}`,children:D.passed?"✓":"✗"}),a.jsx("span",{className:"text-xs text-gray-400 font-mono",children:D.message})]})]},z))})]})]})]})]})}),qe&&a.jsx("div",{className:"fixed inset-0 bg-black/80 flex items-center justify-center z-[60] overflow-hidden",children:a.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:[a.jsxs("div",{className:"flex items-center justify-between mb-6",children:[a.jsxs("div",{className:"flex items-center space-x-2",children:[a.jsx(Zr,{className:"w-5 h-5 text-white"}),a.jsx("h3",{className:"text-xl text-white font-light uppercase tracking-wider",children:"OAuth Credentials"})]}),a.jsx(H,{variant:"ghost",size:"sm",onClick:()=>lt(!1),className:"text-gray-400 hover:text-white rounded-none",children:a.jsx(gt,{className:"w-4 h-4"})})]}),a.jsxs("div",{className:"space-y-4",children:[a.jsxs("div",{children:[a.jsx(ie,{className:"text-xs uppercase font-mono text-gray-400 mb-2 block",children:"Select Provider"}),a.jsx("div",{className:"flex flex-wrap gap-3",children:["google","github"].map(D=>{const z=f===D;return a.jsx("button",{onClick:()=>m(D),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:D.charAt(0).toUpperCase()+D.slice(1)},D)})})]}),a.jsxs("div",{children:[a.jsx(ie,{className:"text-xs uppercase font-mono text-gray-400 mb-2 block",children:"Origin"}),a.jsx(be,{value:jt,onChange:D=>hn(D.target.value),placeholder:`http://${Qt}`,className:"bg-black border border-dashed border-white/20 text-white font-mono text-xs rounded-none"}),a.jsxs("p",{className:"text-[11px] text-gray-500 font-mono mt-1",children:["The default will be http://",Qt]})]}),a.jsxs("div",{className:"flex items-end justify-end space-x-2",children:[a.jsx(H,{variant:"outline",onClick:()=>{nn(null),hn(Qt)},className:"border border-dashed border-white/20 text-white hover:bg-white/10 rounded-none",children:"Clear"}),a.jsx(H,{onClick:xP,disabled:fn||!f||!jt.trim()&&!Qt,className:"rounded-none",children:fn?a.jsxs(a.Fragment,{children:[a.jsx(In,{className:"w-4 h-4 mr-2 animate-spin"}),"Fetching..."]}):"Fetch Credentials"})]}),On&&a.jsxs("div",{className:"space-y-4",children:[a.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[a.jsxs("div",{children:[a.jsx(ie,{className:"text-xs uppercase font-mono text-gray-400 mb-2 block",children:"Client ID"}),a.jsxs("div",{className:"relative",children:[a.jsx(be,{value:On.clientId,readOnly:!0,className:"bg-black border border-dashed border-white/20 text-white font-mono text-xs pr-10 rounded-none"}),a.jsx(H,{variant:"ghost",size:"sm",onClick:()=>ar(On.clientId),className:"absolute right-0 top-0 h-full px-3 text-gray-400 hover:text-white rounded-none",children:a.jsx(Ma,{className:"w-4 h-4"})})]})]}),a.jsxs("div",{children:[a.jsx(ie,{className:"text-xs uppercase font-mono text-gray-400 mb-2 block",children:"Client Secret"}),a.jsxs("div",{className:"relative",children:[a.jsx(be,{type:yr?"text":"password",value:On.clientSecret,readOnly:!0,className:"bg-black border border-dashed border-white/20 text-white font-mono text-xs pr-20 rounded-none"}),a.jsxs("div",{className:"absolute right-0 top-0 h-full flex items-center",children:[a.jsx(H,{variant:"ghost",size:"sm",onClick:()=>ai(!yr),className:"px-2 text-gray-400 hover:text-white rounded-none",children:yr?a.jsx(xf,{className:"w-4 h-4"}):a.jsx(Hs,{className:"w-4 h-4"})}),a.jsx(H,{variant:"ghost",size:"sm",onClick:()=>ar(On.clientSecret),className:"px-2 text-gray-400 hover:text-white rounded-none",children:a.jsx(Ma,{className:"w-4 h-4"})})]})]})]})]}),a.jsxs("div",{className:"flex items-center justify-between pt-2 border-t border-dashed border-white/10",children:[a.jsx("div",{className:"flex-1",children:Ot&&a.jsx("div",{className:"text-xs font-mono",children:Ot.success?a.jsxs("span",{className:"text-green-400 uppercase",children:["✓ ",Ot.message.toLowerCase(),a.jsxs("span",{className:"block normal-case text-gray-400",children:[a.jsx("span",{className:"text-gray-400 mr-1",children:">"})," ",Ot.path]})]}):a.jsxs("span",{className:"text-red-300",children:["✗ ",Ot.message]})})}),a.jsx(H,{onClick:bP,disabled:ri||vs,className:"rounded-none",children:vs?a.jsxs(a.Fragment,{children:[a.jsx(In,{className:"w-4 h-4 mr-2 animate-spin"}),"Checking..."]}):ri?a.jsxs(a.Fragment,{children:[a.jsx(In,{className:"w-4 h-4 mr-2 animate-spin"}),"Writing..."]}):a.jsxs(a.Fragment,{children:[a.jsx(Fh,{className:"w-4 h-4 mr-2"}),"Write to .env"]})})]})]})]})]})}),ho&&a.jsx("div",{className:"fixed inset-0 bg-black/80 flex items-center justify-center z-[60] overflow-hidden",children:a.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:[a.jsxs("div",{className:"flex items-center justify-between mb-6",children:[a.jsxs("div",{className:"flex items-center space-x-2",children:[a.jsx(To,{className:"w-5 h-5 text-white"}),a.jsx("h3",{className:"text-xl text-white font-light uppercase tracking-wider",children:"Secret Generator"})]}),a.jsx(H,{variant:"ghost",size:"sm",onClick:()=>ys(!1),className:"text-gray-400 hover:text-white rounded-none",children:a.jsx(gt,{className:"w-4 h-4"})})]}),a.jsxs("div",{className:"space-y-6",children:[a.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[a.jsxs("div",{children:[a.jsx(ie,{className:"text-xs uppercase font-mono text-gray-400 mb-2 block",children:"Length (bytes)"}),a.jsx(be,{type:"number",value:ba===0?"":ba,onChange:D=>{const z=D.target.value;if(z===""){Oa(0);return}const Q=parseInt(z,10);isNaN(Q)||Oa(Q)},onBlur:D=>{const z=parseInt(D.target.value,10);isNaN(z)||z<16?Oa(32):z>128?Oa(128):Oa(z)},min:"16",max:"128",className:"bg-black border border-dashed border-white/20 text-white font-mono text-xs rounded-none"}),a.jsx("p",{className:"text-[11px] text-gray-500 font-mono mt-1",children:"Recommended: 32 bytes (256 bits)"})]}),a.jsxs("div",{children:[a.jsx(ie,{className:"text-xs uppercase font-mono text-gray-400 mb-2 block",children:"Format"}),a.jsx("div",{className:"flex gap-3",children:[{id:"hex",label:"Hex"},{id:"base64",label:"Base64"}].map(D=>a.jsx("button",{onClick:()=>Br(D.id),className:`px-4 py-2 border rounded-none text-sm uppercase font-mono transition-colors flex-1 ${zr===D.id?"border-white/60 bg-white/10 text-white":"border-dashed border-white/20 text-gray-400 hover:border-white/40"}`,children:D.label},D.id))})]})]}),a.jsxs("div",{className:"flex justify-end space-x-2",children:[a.jsx(H,{variant:"outline",onClick:()=>{Ke(null),Oa(32),Br("hex")},className:"border border-dashed border-white/20 text-white hover:bg-white/10 rounded-none",children:"Clear"}),a.jsx(H,{onClick:pP,disabled:rn,className:"rounded-none",children:rn?a.jsxs(a.Fragment,{children:[a.jsx(In,{className:"w-4 h-4 mr-2 animate-spin"}),"Generating..."]}):"Generate Secret"})]}),Se&&a.jsxs("div",{className:"space-y-4",children:[a.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-4 text-xs font-mono",children:[a.jsxs("div",{className:"border border-dashed border-white/10 p-3 space-y-2",children:[a.jsx("div",{className:"text-gray-400 uppercase tracking-wider",children:"Length"}),a.jsxs("p",{className:"text-white text-sm",children:[Se.length," bytes"]})]}),a.jsxs("div",{className:"border border-dashed border-white/10 p-3 space-y-2",children:[a.jsx("div",{className:"text-gray-400 uppercase tracking-wider",children:"Entropy"}),a.jsxs("p",{className:"text-white text-sm",children:[Se.entropy," bits"]})]}),a.jsxs("div",{className:"border border-dashed border-white/10 p-3 space-y-2",children:[a.jsx("div",{className:"text-gray-400 uppercase tracking-wider",children:"Format"}),a.jsx("p",{className:"text-white text-sm uppercase",children:Se.format})]})]}),a.jsxs("div",{children:[a.jsx(ie,{className:"text-xs uppercase font-mono text-gray-400 mb-2 block",children:"Generated Secret"}),a.jsxs("div",{className:"relative",children:[a.jsx(be,{value:Se.secret,readOnly:!0,className:"bg-black border border-dashed border-white/20 text-white font-mono text-xs pr-10 rounded-none"}),a.jsx(H,{variant:"ghost",size:"sm",onClick:()=>ar(Se.secret),className:"absolute right-0 top-0 h-full px-3 text-gray-400 hover:text-white rounded-none",children:a.jsx(Ma,{className:"w-3 h-3"})})]})]}),a.jsxs("div",{children:[a.jsx(ie,{className:"text-xs uppercase font-mono text-gray-400 mb-2 block",children:"Environment Variable Format"}),a.jsxs("div",{className:"relative",children:[a.jsx(be,{value:Se.envFormat,readOnly:!0,className:"bg-black border border-dashed border-white/20 text-white font-mono text-xs pr-10 rounded-none"}),a.jsx(H,{variant:"ghost",size:"sm",onClick:()=>ar(Se.envFormat),className:"absolute right-0 top-0 h-full px-3 text-gray-400 hover:text-white rounded-none",children:a.jsx(Ma,{className:"w-3 h-3"})})]}),a.jsxs("p",{className:"text-[11px] text-gray-500 font-mono mt-2",children:["Add this to your ",a.jsx("code",{className:"text-gray-400",children:".env"})," file. Keep it secret and never commit it to version control."]})]}),a.jsx("div",{className:"flex justify-end space-x-2 pt-2",children:a.jsx(H,{variant:"outline",onClick:mP,disabled:fe||De,className:"border border-dashed border-white/20 text-white hover:bg-white/10 rounded-none",children:fe||De?a.jsxs(a.Fragment,{children:[a.jsx(In,{className:"w-4 h-4 mr-2 animate-spin"}),De?"Writing...":"Checking..."]}):"Write to .env"})}),a.jsx("div",{className:"border border-dashed border-white/20 bg-black text-gray-300 text-xs font-mono p-3 rounded-none",children:a.jsxs("div",{className:"flex items-start space-x-2",children:[a.jsx(El,{className:"w-4 h-4 mt-0.5 flex-shrink-0 text-gray-400"}),a.jsxs("div",{children:[a.jsx("div",{className:"uppercase font-mono mb-2 text-gray-400 tracking-wider",children:"Security Best Practices"}),a.jsxs("ul",{className:"list-disc list-inside space-y-1 text-[11px] text-gray-300",children:[a.jsx("li",{children:"Use a minimum of 32 bytes (256 bits) for production"}),a.jsx("li",{children:"Store secrets in environment variables, never in code"}),a.jsx("li",{children:"Use different secrets for development and production"}),a.jsx("li",{children:"Rotate secrets periodically for enhanced security"})]})]})]})})]})]})]})}),Fr&&bs&&a.jsx("div",{className:"fixed inset-0 bg-black/80 flex items-center justify-center z-[70] overflow-hidden",children:a.jsxs("div",{className:"bg-black border border-dashed border-white/20 rounded-none p-6 w-full max-w-2xl",children:[a.jsxs("div",{className:"flex items-center justify-between mb-6",children:[a.jsxs("div",{className:"flex items-center space-x-2",children:[a.jsx(El,{className:"w-5 h-5 text-yellow-400"}),a.jsx("h3",{className:"text-xl text-white font-light uppercase tracking-wider",children:"Overwrite Existing Credentials?"})]}),a.jsx(H,{variant:"ghost",size:"sm",onClick:()=>{si(!1),wr(null),tr(!1)},className:"text-gray-400 hover:text-white rounded-none",children:a.jsx(gt,{className:"w-4 h-4"})})]}),a.jsxs("div",{className:"space-y-4",children:[a.jsxs("div",{className:"border border-dashed border-white/20 p-4",children:[a.jsxs("p",{className:"text-sm border-b border-dashed border-white/20 pb-5 text-gray-300 font-mono mb-3",children:["The following"," ",a.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"," ",a.jsx("span",{className:"text-gray-400 normal-case",children:bs.path}),":"]}),a.jsx("div",{className:"space-y-2 pt-2",children:Object.entries(bs.credentials).map(([D,z])=>a.jsxs("div",{className:"flex items-center justify-between text-xs font-mono",children:[a.jsx("span",{className:"text-gray-400 uppercase",children:D}),a.jsx("span",{className:"text-gray-500",children:z.length>20?`${z.substring(0,20)}...`:z})]},D))})]}),a.jsxs("div",{className:"flex items-center justify-end space-x-3 pt-4 border-t border-dashed border-white/10",children:[a.jsx(H,{variant:"outline",onClick:()=>{si(!1),wr(null),tr(!1)},className:"border border-dashed border-white/20 text-white hover:bg-white/10 rounded-none",children:"No, Cancel"}),a.jsx(H,{variant:"outline",onClick:()=>Pm("append"),disabled:ri,className:"border border-dashed border-white/20 text-white hover:bg-white/10 rounded-none",children:"Append"}),a.jsx(H,{onClick:()=>Pm("override"),disabled:ri,className:"rounded-none",children:ri?a.jsxs(a.Fragment,{children:[a.jsx(In,{className:"w-4 h-4 mr-2 animate-spin"}),"Writing..."]}):"Yes, Overwrite"})]})]})]})}),ol&&Ne&&a.jsx("div",{className:"fixed inset-0 bg-black/80 flex items-center justify-center z-[70] overflow-hidden",children:a.jsxs("div",{className:"bg-black border border-dashed border-white/20 rounded-none p-6 w-full max-w-2xl",children:[a.jsxs("div",{className:"flex items-center justify-between mb-6",children:[a.jsxs("div",{className:"flex items-center space-x-2",children:[a.jsx(El,{className:"w-5 h-5 text-yellow-400"}),a.jsx("h3",{className:"text-xl text-white font-light uppercase tracking-wider",children:"Overwrite Existing Secret?"})]}),a.jsx(H,{variant:"ghost",size:"sm",onClick:()=>{ye(!1),_e(null),Te(!1)},className:"text-gray-400 hover:text-white rounded-none",children:a.jsx(gt,{className:"w-4 h-4"})})]}),a.jsxs("div",{className:"space-y-4",children:[a.jsxs("div",{className:"border border-dashed border-white/20 p-4",children:[a.jsxs("p",{className:"text-sm border-b border-dashed border-white/20 pb-5 text-gray-300 font-mono mb-3",children:[a.jsx("span",{className:"text-white uppercase",children:"BETTER_AUTH_SECRET"})," already exists in"," ",a.jsx("span",{className:"text-gray-400 normal-case",children:Ne.path}),":"]}),a.jsx("div",{className:"space-y-2 pt-2",children:a.jsxs("div",{className:"flex items-center justify-between text-xs font-mono",children:[a.jsx("span",{className:"text-gray-400 uppercase",children:"BETTER_AUTH_SECRET"}),a.jsx("span",{className:"text-gray-500",children:Ne.secret&&Ne.secret.length>20?`${Ne.secret.substring(0,20)}...`:Ne.secret||"***"})]})})]}),a.jsxs("div",{className:"flex items-center justify-end space-x-3 pt-4 border-t border-dashed border-white/10",children:[a.jsx(H,{variant:"outline",onClick:()=>{ye(!1),_e(null),Te(!1)},className:"border border-dashed border-white/20 text-white hover:bg-white/10 rounded-none",children:"No, Cancel"}),a.jsx(H,{onClick:()=>LE("override"),disabled:De,className:"rounded-none",children:De?a.jsxs(a.Fragment,{children:[a.jsx(In,{className:"w-4 h-4 mr-2 animate-spin"}),"Writing..."]}):"Yes, Overwrite"})]})]})]})})]})}function upe(){const{userId:e}=oS(),t=Aa(),[n,r]=p.useState(null),[s,i]=p.useState([]),[o,l]=p.useState([]),[c,u]=p.useState([]),[h,d]=p.useState([]),[f,m]=p.useState([]),[y,b]=p.useState(!0),[w,x]=p.useState("details"),[v,g]=p.useState(!1),[N,S]=p.useState(!1),[E,j]=p.useState(!1),[_,L]=p.useState(!1),[F,U]=p.useState(!1),[R,G]=p.useState("random"),[O,M]=p.useState(!1),[C,k]=p.useState(!1),[I,P]=p.useState(!1),[B,T]=p.useState(""),[A,$]=p.useState(),[Y,X]=p.useState(!1),[ee,J]=p.useState(""),[K,re]=p.useState([]),[se,ce]=p.useState(!1),[ge,ve]=p.useState(!1),[Be,Ye]=p.useState(!1),[Pe,Ge]=p.useState(!1),[ht,st]=p.useState(!1),[de,$e]=p.useState(!1),[Me,Ae]=p.useState({}),Qe=p.useRef({}),[mt,ct]=p.useState({}),[Ft,Vt]=p.useState({}),[Yt,zt]=p.useState({}),[un,Mt]=p.useState({}),[Tn,Rn]=p.useState({}),[oe,je]=p.useState(null),[et,Xe]=p.useState(null),Oe=p.useCallback(async()=>{try{const ue=await(await fetch("/api/admin/status")).json();X(ue.enabled)}catch{X(!1)}},[]),He=p.useCallback(async W=>{try{const ue=await fetch("/api/geo/resolve",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({ipAddress:W})});if(ue.ok){const pe=await ue.json();if(pe.success&&pe.location)return pe.location}return null}catch{return null}},[]),ke=p.useCallback(async W=>{const ue=W.filter(qe=>!Qe.current[qe.id]);if(ue.length===0)return;const pe=await Promise.all(ue.map(async qe=>{const lt=await He(qe.ipAddress);return lt?{sessionId:qe.id,location:lt}:null})),Le={};pe.forEach(qe=>{qe&&(Le[qe.sessionId]=qe.location)}),Object.keys(Le).length>0&&(Qe.current={...Qe.current,...Le},Ae(Qe.current))},[He]),tt=W=>{if(!W)return"🌍";const ue=W.toUpperCase().split("").map(pe=>127397+pe.charCodeAt(0));return String.fromCodePoint(...ue)},kt=W=>W?W.replace(/[_-]/g," ").replace(/\b\w/g,ue=>ue.toUpperCase()):"Unknown Provider",we=W=>{if(!W)return"Unknown";const ue=new Date(W);return Number.isNaN(ue.getTime())?"Unknown":ue.toLocaleString("en-US",{year:"numeric",month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"})},ut=p.useCallback(async()=>{try{const W=await fetch(`/api/users/${e}`);if(W.ok){const ue=await W.json();r(ue.user)}else V.error("Failed to fetch user details"),t("/users")}catch{V.error("Failed to fetch user details"),t("/users")}finally{b(!1)}},[e,t]),Et=p.useCallback(async()=>{try{const[W,ue,pe]=await Promise.all([fetch(`/api/users/${e}/organizations`),fetch(`/api/users/${e}/teams`),fetch(`/api/users/${e}/sessions`)]);if(W.ok){const Le=await W.json();i(Le.memberships||[])}if(ue.ok){const Le=await ue.json();l(Le.memberships||[])}if(pe.ok){const qe=(await pe.json()).sessions||[];u(qe),ke(qe)}}catch{}},[e,ke]),wt=p.useCallback(async()=>{try{const W=await fetch(`/api/users/${e}/accounts`);if(W.ok){const ue=await W.json();d(ue.accounts||[])}}catch{}},[e]),Zt=p.useCallback(async()=>{try{const W=await fetch(`/api/users/${e}/invitations`);if(W.ok){const ue=await W.json();m(ue.invitations||[])}}catch{}},[e]),vt=(W,ue=800,pe=800,Le=.8)=>new Promise((qe,lt)=>{const jt=new FileReader;jt.onload=hn=>{var Ra;const Qt=new Image;Qt.onload=()=>{const On=document.createElement("canvas");let nn=Qt.width,fn=Qt.height;nn>fn?nn>ue&&(fn=fn*ue/nn,nn=ue):fn>pe&&(nn=nn*pe/fn,fn=pe),On.width=nn,On.height=fn;const vr=On.getContext("2d");if(!vr){lt(new Error("Failed to get canvas context"));return}vr.drawImage(Qt,0,0,nn,fn),On.toBlob(yr=>{if(!yr){lt(new Error("Failed to compress image"));return}const ai=new File([yr],W.name,{type:W.type,lastModified:Date.now()});qe(ai)},W.type,Le)},Qt.onerror=lt,Qt.src=(Ra=hn.target)==null?void 0:Ra.result},jt.onerror=lt,jt.readAsDataURL(W)}),tn=async W=>{var pe;const ue=(pe=W.target.files)==null?void 0:pe[0];if(ue){if(ue.size>5*1024*1024){V.error("Image size must be less than 5MB");return}if(!ue.type.startsWith("image/")){V.error("Please select a valid image file");return}try{const Le=await vt(ue);Xe(Le);const qe=new FileReader;qe.onloadend=()=>{je(qe.result)},qe.readAsDataURL(Le)}catch(Le){V.error("Failed to process image"),console.error("Image compression error:",Le)}}},ne=async()=>{var Le,qe;if(!n)return;const W=(Le=document.getElementById("edit-name"))==null?void 0:Le.value,ue=(qe=document.getElementById("edit-email"))==null?void 0:qe.value;if(!W||!ue){V.error("Please fill in all fields");return}ve(!0);const pe=V.loading("Updating user...");try{const lt={name:W,email:ue,role:ee||null};if(et){const Qt=new FileReader,Ra=await new Promise((On,nn)=>{Qt.onloadend=()=>{const fn=Qt.result;fn&&fn.startsWith("data:image/")?On(fn):nn(new Error("Invalid image data"))},Qt.onerror=nn,Qt.readAsDataURL(et)});lt.image=Ra}else oe===null&&n.image&&(lt.image=null);const hn=await(await fetch(`/api/users/${e}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(lt)})).json();hn.success?(r({...n,name:W,email:ue,role:ee||void 0,image:lt.image!==void 0?lt.image:n.image}),g(!1),J(""),je(null),Xe(null),V.success("User updated successfully!",{id:pe})):V.error(`Error updating user: ${hn.error||"Unknown error"}`,{id:pe})}catch{V.error("Error updating user",{id:pe})}finally{ve(!1)}},Ee=async()=>{if(!n)return;Ye(!0);const W=V.loading("Deleting user...");try{const pe=await(await fetch(`/api/users/${e}`,{method:"DELETE",headers:{"Content-Type":"application/json"}})).json();pe.success?(V.success("User deleted successfully!",{id:W}),t("/users")):V.error(`Error deleting user: ${pe.error||"Unknown error"}`,{id:W})}catch{V.error("Error deleting user",{id:W})}finally{Ye(!1)}},Ue=async()=>{if(!n)return;if(!Y){V.error("Admin plugin is not enabled. Please enable the admin plugin in your Better Auth configuration to use ban functionality.");return}Ge(!0);const W=V.loading("Banning user...");try{const ue=await fetch("/api/admin/ban-user",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({userId:e,banReason:B||"No reason provided",banExpiresIn:A})}),pe=await ue.json();ue.ok?(V.success("User banned successfully!",{id:W}),S(!1),T(""),$(void 0),ut()):ue.status===403?V.error("You do not have permission to ban users. Admin role required.",{id:W}):pe.adminPluginEnabled&&pe.instructions?V.error(`${pe.error}`,{id:W,duration:6e3,description:`Use: ${pe.instructions.example}`}):V.error(`Error banning user: ${pe.error||pe.message||"Unknown error"}`,{id:W})}catch{V.error("Error banning user",{id:W})}finally{Ge(!1)}},Ve=async()=>{if(!n)return;if(!Y){V.error("Admin plugin is not enabled. Please enable the admin plugin in your Better Auth configuration to use unban functionality.");return}st(!0);const W=V.loading("Unbanning user...");try{const ue=await fetch("/api/admin/unban-user",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({userId:e})}),pe=await ue.json();ue.ok?(V.success("User unbanned successfully!",{id:W}),j(!1),ut()):ue.status===403?V.error("You do not have permission to unban users. Admin role required.",{id:W}):pe.adminPluginEnabled&&pe.instructions?V.error(`${pe.error}`,{id:W,duration:6e3,description:`Use: ${pe.instructions.example}`}):V.error(`Error unbanning user: ${pe.error||pe.message||"Unknown error"}`,{id:W})}catch{V.error("Error unbanning user",{id:W})}finally{st(!1)}},at=async W=>{const ue=V.loading("Removing user from organization...");try{const Le=await(await fetch(`/api/organizations/members/${W}`,{method:"DELETE"})).json();Le.success?(i(qe=>qe.filter(lt=>lt.id!==W)),Et(),V.success("User removed from organization!",{id:ue})):V.error(`Error removing user: ${Le.error||"Unknown error"}`,{id:ue})}catch{V.error("Error removing user from organization",{id:ue})}},nt=async W=>{const ue=V.loading("Removing user from team...");try{const Le=await(await fetch(`/api/teams/members/${W}`,{method:"DELETE"})).json();Le.success?(l(qe=>qe.filter(lt=>lt.id!==W)),Et(),V.success("User removed from team!",{id:ue})):V.error(`Error removing user: ${Le.error||"Unknown error"}`,{id:ue})}catch{V.error("Error removing user from team",{id:ue})}},Z=async W=>{Rn(pe=>({...pe,[W]:!0}));const ue=V.loading("Deleting session...");try{const Le=await(await fetch(`/api/sessions/${W}`,{method:"DELETE"})).json();Le.success?(u(qe=>qe.filter(lt=>lt.id!==W)),V.success("Session deleted successfully!",{id:ue})):V.error(`Error deleting session: ${Le.error||"Unknown error"}`,{id:ue})}catch{V.error("Error deleting session",{id:ue})}finally{Rn(pe=>{const{[W]:Le,...qe}=pe;return qe})}},xe=async W=>{if(!e)return;Mt(pe=>({...pe,[W]:!0}));const ue=V.loading("Unlinking account...");try{const pe=await fetch(`/api/users/${e}/accounts/${W}`,{method:"DELETE"}),Le=await pe.json();pe.ok&&Le.success?(d(qe=>qe.filter(lt=>lt.id!==W)),await wt(),V.success("Account unlinked successfully",{id:ue})):V.error(Le.error||"Failed to unlink account",{id:ue})}catch{V.error("Failed to unlink account",{id:ue})}finally{Mt(pe=>{const{[W]:Le,...qe}=pe;return qe})}},Re=async W=>{if(!e)return;ct(pe=>({...pe,[W]:!0}));const ue=V.loading("Accepting invitation...");try{const pe=await fetch(`/api/invitations/${W}/accept`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({userId:e})}),Le=await pe.json();pe.ok&&Le.success?(await Zt(),await Et(),V.success("Invitation accepted successfully",{id:ue})):V.error(Le.error||"Failed to accept invitation",{id:ue})}catch{V.error("Failed to accept invitation",{id:ue})}finally{ct(pe=>{const{[W]:Le,...qe}=pe;return qe})}},dt=async W=>{Vt(pe=>({...pe,[W]:!0}));const ue=V.loading("Rejecting invitation...");try{const pe=await fetch(`/api/invitations/${W}/reject`,{method:"POST",headers:{"Content-Type":"application/json"}}),Le=await pe.json();pe.ok&&Le.success?(await Zt(),V.success("Invitation rejected successfully",{id:ue})):V.error(Le.error||"Failed to reject invitation",{id:ue})}catch{V.error("Failed to reject invitation",{id:ue})}finally{Vt(pe=>{const{[W]:Le,...qe}=pe;return qe})}},ft=async W=>{zt(pe=>({...pe,[W]:!0}));const ue=V.loading("Cancelling invitation...");try{const pe=await fetch(`/api/invitations/${W}`,{method:"DELETE"}),Le=await pe.json();pe.ok&&Le.success?(await Zt(),V.success("Invitation cancelled successfully",{id:ue})):V.error(Le.error||"Failed to cancel invitation",{id:ue})}catch{V.error("Failed to cancel invitation",{id:ue})}finally{zt(pe=>{const{[W]:Le,...qe}=pe;return qe})}};p.useEffect(()=>{e&&(ut(),Et(),wt(),Zt(),Oe())},[e,Oe,ut,Et,wt,Zt]);const ze=async(W=3)=>{if(e){re([]),ce(!0),re([{id:"start",type:"info",message:`Starting session seeding process for ${W} sessions...`,timestamp:new Date}]);try{const pe=await(await fetch(`/api/users/${e}/seed-sessions`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({count:W})})).json();if(pe.success){const Le=pe.results.map((lt,jt)=>lt.success?{id:`session-${jt}`,type:"progress",message:`Creating session ${jt+1}: ${lt.session.token.substring(0,20)}... from ${lt.session.ipAddress}`,timestamp:new Date,status:"completed"}:{id:`session-${jt}`,type:"error",message:`Failed to create session ${jt+1}: ${lt.error}`,timestamp:new Date});re(lt=>[...lt,...Le]);const qe=pe.results.filter(lt=>lt.success).length;re(lt=>[...lt,{id:"complete",type:"success",message:`✅ Session seeding completed! Created ${qe}/${W} sessions successfully`,timestamp:new Date}]),Et()}else re(Le=>[...Le,{id:"error",type:"error",message:`❌ Session seeding failed: ${pe.error||"Unknown error"}`,timestamp:new Date}])}catch(ue){re(pe=>[...pe,{id:"error",type:"error",message:`❌ Network error: ${ue}`,timestamp:new Date}])}finally{ce(!1)}}},Rt=async(W=3,ue="random")=>{if(e){re([]),ce(!0),re([{id:"start",type:"info",message:`Starting account seeding process for ${W} accounts...`,timestamp:new Date}]);try{const Le=await(await fetch(`/api/users/${e}/seed-accounts`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({count:W,providerId:ue})})).json();if(Le.success){const qe=Le.results.map((jt,hn)=>{var Qt;return jt.success?{id:`account-${hn}`,type:"progress",message:`Creating account ${hn+1}: ${jt.account.providerId||jt.account.provider} (${((Qt=jt.account.accountId)==null?void 0:Qt.substring(0,20))||jt.account.id.substring(0,20)}...)`,timestamp:new Date,status:"completed"}:{id:`account-${hn}`,type:"error",message:`Failed to create account ${hn+1}: ${jt.error}`,timestamp:new Date}});re(jt=>[...jt,...qe]);const lt=Le.results.filter(jt=>jt.success).length;re(jt=>[...jt,{id:"complete",type:"success",message:`✅ Account seeding completed! Created ${lt}/${W} accounts successfully`,timestamp:new Date}]),wt()}else re(qe=>[...qe,{id:"error",type:"error",message:`❌ Account seeding failed: ${Le.error||"Unknown error"}`,timestamp:new Date}])}catch(pe){re(Le=>[...Le,{id:"error",type:"error",message:`❌ Network error: ${pe}`,timestamp:new Date}])}finally{ce(!1)}}};return y?a.jsx("div",{className:"min-h-screen bg-black flex items-center justify-center",children:a.jsx("div",{className:"text-white text-lg",children:"Loading user details..."})}):n?a.jsxs("div",{className:"space-y-6 p-6 bg-black w-full",children:[a.jsxs("div",{className:"w-full flex flex-col",children:[a.jsx("span",{className:"mb-4 ml-0 flex justify-start items-start text-left border-none text-white",children:a.jsxs("span",{className:"font-light",children:[a.jsxs("span",{onClick:()=>t("/users"),className:"uppercase cursor-pointer text-white/80 font-mono text-sm",children:["users /"," "]}),a.jsx("span",{className:"text-white font-mono text-sm",children:n.id})]})}),a.jsx("div",{className:"mb-8 mt-4",children:a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsxs("div",{className:"flex items-center space-x-4",children:[a.jsx("div",{className:"w-16 h-16 bg-gray-800 border border-dashed border-white/20 flex items-center justify-center overflow-hidden",children:ha(n==null?void 0:n.image)?a.jsx("img",{src:ha(n==null?void 0:n.image),alt:n==null?void 0:n.name,className:"w-16 h-16 object-cover",onError:W=>{W.target.style.display="none"}}):a.jsx(Vr,{className:"w-8 h-8 text-white"})}),a.jsxs("div",{children:[a.jsxs("h1",{className:"text-3xl font-light text-white inline-flex items-center",children:[n.name,a.jsx(Ct,{id:n.id,nonSliced:!0,variant:"subscript"}),n.role&&a.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&&a.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&&a.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:[a.jsx("span",{className:"text-gray-400 font-mono text-xs uppercase mr-1",children:"Banned Reason:"}),n.banReason,a.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"})]})]})]}),a.jsx("p",{className:"text-gray-400 font-mono text-sm",children:n.email})]})]}),a.jsx("div",{className:"flex items-center space-x-2",children:a.jsxs("div",{className:"relative",children:[a.jsx(H,{variant:"ghost",size:"sm",className:"text-gray-400 hover:text-white rounded-none",onClick:W=>{W.stopPropagation(),P(!I)},children:a.jsx(f3,{className:"w-4 h-4"})}),I&&a.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:W=>W.stopPropagation(),children:[a.jsxs("button",{className:"w-full px-4 py-2 text-left text-[11px] text-white/70 hover:bg-white/10 flex items-center justify-between font-mono uppercase tracking-tight group",onClick:W=>{W.stopPropagation(),P(!1),je((n==null?void 0:n.image)||null),Xe(null),g(!0),J(n.role||"")},children:[a.jsx("span",{children:"Edit User"}),a.jsx(Xs,{className:"w-3 h-3 text-white/10 group-hover:text-white/70 transition-colors"})]}),h.some(W=>W.providerId==="credential")?a.jsxs("button",{className:"w-full px-4 py-2 text-left text-[11px] text-white/70 hover:bg-white/10 flex items-center justify-between font-mono uppercase tracking-tight group",onClick:W=>{W.stopPropagation(),P(!1),M(!0)},children:[a.jsx("span",{children:"Update Password"}),a.jsx(ia,{className:"w-3 h-3 text-white/10 group-hover:text-white/70 transition-colors"})]}):a.jsxs("button",{className:"w-full px-4 py-2 text-left text-[11px] text-white/30 cursor-not-allowed flex items-center justify-between font-mono uppercase tracking-tight opacity-50",disabled:!0,title:"Password update is only available for users with credential accounts",children:[a.jsx("span",{children:"Update Password"}),a.jsx(ia,{className:"w-3 h-3 text-white/10"})]}),Y&&(n.banned?a.jsxs("button",{className:"w-full px-4 py-2 text-left text-[11px] text-green-400 hover:bg-white/10 flex items-center justify-between font-mono uppercase tracking-tight group",onClick:W=>{W.stopPropagation(),P(!1),j(!0)},children:[a.jsx("span",{children:"Unban User"}),a.jsx(rx,{className:"w-3 h-3 text-green-400/10 group-hover:text-green-400/70 transition-colors"})]}):a.jsxs("button",{className:"w-full px-4 py-2 text-left text-[11px] text-yellow-400 hover:bg-white/10 flex items-center justify-between font-mono uppercase tracking-tight group",onClick:W=>{W.stopPropagation(),P(!1),S(!0)},children:[a.jsx("span",{children:"Ban User"}),a.jsx(rx,{className:"w-3 h-3 text-yellow-400/10 group-hover:text-yellow-400/70 transition-colors"})]})),a.jsxs("div",{className:"flex flex-col items-center justify-center",children:[a.jsx("hr",{className:"w-[calc(100%)] border-white/10 h-px"}),a.jsx("div",{className:"relative z-20 h-2 w-[calc(100%)] mx-auto -translate-x-1/2 left-1/2 bg-[repeating-linear-gradient(-45deg,#ffffff,#ffffff_1px,transparent_1px,transparent_6px)] opacity-[7%]"}),a.jsx("hr",{className:"w-[calc(100%)] border-white/10 h-px"})]}),a.jsxs("button",{className:"w-full px-4 py-2 text-left text-[11px] text-red-400 hover:bg-white/10 flex items-center justify-between font-mono uppercase tracking-tight group",onClick:W=>{W.stopPropagation(),P(!1),k(!0)},children:[a.jsx("span",{children:"Delete User"}),a.jsx(eh,{className:"w-3 h-3 text-red-400/10 group-hover:text-red-400/70 transition-colors"})]})]})]})})]})}),a.jsxs("div",{className:"border border-dashed border-white/20 rounded-none",children:[a.jsx("div",{className:"border-b border-dashed border-white/20",children:a.jsx("nav",{className:"flex space-x-8 px-6",children:[{id:"details",name:"Details",icon:Vr},{id:"organizations",name:"Organizations",icon:na,count:s.length},{id:"teams",name:"Teams",icon:Ht,count:o.length},{id:"accounts",name:"Accounts",icon:Gl,count:h.length},{id:"sessions",name:"Sessions",icon:_N,count:c.length},{id:"invitations",name:"Invitations",icon:Cr,count:f.length}].map(W=>a.jsxs("button",{onClick:()=>x(W.id),className:`flex items-center space-x-2 py-4 px-2 border-b-2 font-medium text-sm ${w===W.id?"border-white text-white":"border-transparent text-gray-400 hover:text-white hover:border-white/50"}`,children:[a.jsx(W.icon,{className:"w-4 h-4 text-white/90"}),a.jsxs("span",{className:"inline-flex items-start",children:[a.jsx("span",{className:"font-mono uppercase text-xs font-normal",children:W.name}),W.count!==void 0&&a.jsx("sup",{className:"text-xs text-gray-500 ml-1 inline-flex items-baseline",children:a.jsx(Zn,{value:W.count,className:"text-white/80 font-mono text-xs",prefix:a.jsx("span",{className:"mr-0.5 text-gray-500",children:"["}),suffix:a.jsx("span",{className:"ml-0.5 text-gray-500",children:"]"}),format:{notation:"standard",maximumFractionDigits:0}})})]})]},W.id))})}),a.jsxs("div",{className:"p-6",children:[w==="details"&&a.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-6",children:[a.jsxs("div",{className:"overflow-x-hidden bg-white/[3%] border border-white/10 p-6 rounded-none",children:[a.jsx("h3",{className:"text-sm uppercase font-mono text-gray-400 mb-4 tracking-wider",children:"BASIC INFORMATION"}),a.jsx("hr",{className:"border-white/10 -mx-10 border-dashed my-4"}),a.jsxs("div",{className:"space-y-4",children:[a.jsxs("div",{className:"flex items-start space-x-3",children:[a.jsx(Vr,{className:"w-4 h-4 text-gray-400 mt-1"}),a.jsxs("div",{className:"flex-1",children:[a.jsx("div",{className:"text-xs uppercase font-mono text-gray-500 mb-1",children:"Name"}),a.jsx("div",{className:"text-white font-sans text-sm",children:n.name})]})]}),a.jsxs("div",{className:"flex items-start space-x-3",children:[a.jsx(Cr,{className:"w-4 h-4 text-gray-400 mt-1"}),a.jsxs("div",{className:"flex-1",children:[a.jsx("div",{className:"text-xs uppercase font-mono text-gray-500 mb-1",children:"Email"}),a.jsx("div",{className:"text-white font-mono text-sm",children:n.email})]})]}),n.username&&a.jsxs("div",{className:"flex items-start space-x-3",children:[a.jsx(jae,{className:"w-4 h-4 text-gray-400 mt-1"}),a.jsxs("div",{className:"flex-1",children:[a.jsx("div",{className:"text-xs uppercase font-mono text-gray-500 mb-1",children:"Username"}),a.jsx("div",{className:"text-white font-mono text-sm",children:n.username})]})]}),n.phoneNumber&&a.jsxs("div",{className:"flex items-start space-x-3",children:[a.jsx(Eae,{className:"w-4 h-4 text-gray-400 mt-1"}),a.jsxs("div",{className:"flex-1",children:[a.jsx("div",{className:"text-xs uppercase font-mono text-gray-500 mb-1",children:"Phone"}),a.jsx("div",{className:"text-white font-mono text-sm",children:"+251 91 234 5678"})]})]}),a.jsxs("div",{className:"flex items-start space-x-3",children:[a.jsx(Er,{className:"w-4 h-4 text-gray-400 mt-1"}),a.jsxs("div",{className:"flex-1",children:[a.jsx("div",{className:"text-xs uppercase font-mono text-gray-500 mb-1",children:"Member Since"}),a.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"})})]})]})]})]}),a.jsxs("div",{className:"overflow-x-hidden bg-white/[3%] border border-white/10 p-6 rounded-none",children:[a.jsx("h3",{className:"text-sm uppercase font-mono text-gray-400 mb-4 tracking-wider",children:"SECURITY"}),a.jsx("hr",{className:"border-white/10 -mx-10 border-dashed my-4"}),a.jsxs("div",{className:"space-y-4",children:[a.jsxs("div",{className:"flex items-center justify-between p-3 bg-black/30 border border-white/10 rounded-none",children:[a.jsxs("div",{className:"flex items-center space-x-3",children:[a.jsx(Cr,{className:"w-4 h-4 text-gray-400"}),a.jsx("div",{children:a.jsx("div",{className:"text-xs uppercase font-mono text-gray-500",children:"Email Verification"})})]}),a.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"})]}),a.jsxs("div",{className:"flex items-center justify-between p-3 bg-black/30 border border-white/10 rounded-none",children:[a.jsxs("div",{className:"flex items-center space-x-3",children:[a.jsx(Fs,{className:"w-4 h-4 text-gray-400"}),a.jsx("div",{children:a.jsx("div",{className:"text-xs uppercase font-mono text-gray-500",children:"Two-Factor Authentication"})})]}),a.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"})]})]})]})]}),w==="organizations"&&a.jsxs("div",{className:"space-y-4",children:[a.jsx("div",{className:"flex items-center justify-between mb-4",children:a.jsxs("div",{children:[a.jsxs("h3",{className:"text-lg relative text-white font-light inline-flex items-start",children:["Organizations",a.jsxs("sup",{className:"text-xs text-gray-500 ml-1 mt-0",children:[a.jsx("span",{className:"mr-1",children:"["}),a.jsx("span",{className:"text-white font-mono text-xs",children:s.length}),a.jsx("span",{className:"ml-1",children:"]"})]})]}),a.jsx("p",{className:"text-gray-400 font-light font-mono text-xs uppercase mt-1",children:"Organizations this user belongs to"})]})}),s.length===0?a.jsxs("div",{className:"text-center py-12 border border-dashed border-white/10 rounded-none",children:[a.jsx(na,{className:"w-12 h-12 text-gray-400 mx-auto mb-4"}),a.jsx("p",{className:"text-gray-400 font-mono text-xs uppercase",children:"No organizations found"})]}):a.jsx("div",{className:"grid gap-4",children:s.map(W=>a.jsxs("div",{className:"border border-dashed border-white/10 rounded-none p-4 hover:bg-white/5 transition-colors",children:[a.jsxs("div",{className:"flex items-start justify-between mb-3",children:[a.jsxs("div",{className:"flex items-center space-x-4 flex-1",children:[a.jsx("div",{className:"w-12 h-12 bg-black/80 border border-dashed border-white/20 flex items-center justify-center rounded-none",children:W.organization.image?a.jsx("img",{src:W.organization.image,alt:W.organization.name,className:"w-12 h-12 object-cover"}):a.jsx(na,{className:"w-6 h-6 text-white"})}),a.jsxs("div",{className:"flex-1",children:[a.jsxs("h3",{className:"text-white font-light inline-flex items-start",children:[W.organization.name,a.jsxs("sup",{className:"text-xs text-gray-500 ml-2 mt-0.5",children:[a.jsx("span",{className:"mr-1",children:"["}),a.jsx("span",{className:"text-white/80 font-mono text-xs",children:W.organization.slug}),a.jsx("span",{className:"ml-1",children:"]"})]})]}),a.jsxs("p",{className:"text-gray-400 text-sm font-sans mt-1 flex items-center gap-2",children:[a.jsxs("span",{children:["in ",W.organization.slug]}),a.jsx("button",{onClick:ue=>{ue.stopPropagation(),t(`/organizations/${W.organization.id}`)},className:"text-white/60 hover:text-white transition-colors",title:"View organization details",children:a.jsx(Ii,{className:"w-3.5 h-3.5"})})]})]})]}),a.jsx("div",{className:"flex flex-col items-end space-y-2",children:a.jsxs("div",{className:"flex items-center space-x-2",children:[a.jsxs("span",{className:"text-gray-500 font-mono text-xs uppercase",children:["Joined:"," "]}),a.jsxs("span",{className:"text-white font-mono text-xs",children:[new Date(W.joinedAt).toLocaleDateString("en-US",{year:"numeric",month:"short",day:"numeric"}),","," ",new Date(W.joinedAt).toLocaleTimeString("en-US",{hour:"numeric",minute:"2-digit",hour12:!0})]})]})})]}),a.jsx("div",{className:"flex items-center justify-end",children:a.jsxs(H,{variant:"outline",size:"sm",onClick:()=>at(W.id),className:"border border-dashed border-red-400/20 text-red-400 hover:bg-red-400/10 rounded-none",children:[a.jsx(ax,{className:"w-4 h-4 mr-1"}),"Remove"]})})]},W.id))})]}),w==="teams"&&a.jsxs("div",{className:"space-y-4",children:[a.jsx("div",{className:"flex items-center justify-between mb-4",children:a.jsxs("div",{children:[a.jsxs("h3",{className:"text-lg relative text-white font-light inline-flex items-start",children:["Teams",a.jsxs("sup",{className:"text-xs text-gray-500 ml-1 mt-0",children:[a.jsx("span",{className:"mr-1",children:"["}),a.jsx("span",{className:"text-white font-mono text-xs",children:o.length}),a.jsx("span",{className:"ml-1",children:"]"})]})]}),a.jsx("p",{className:"text-gray-400 font-light font-mono text-xs uppercase mt-1",children:"Teams this user belongs to"})]})}),o.length===0?a.jsxs("div",{className:"text-center py-12 border border-dashed border-white/10 rounded-none",children:[a.jsx(Ht,{className:"w-12 h-12 text-gray-400 mx-auto mb-4"}),a.jsx("p",{className:"text-gray-400 font-mono text-xs uppercase",children:"No teams found"})]}):a.jsx("div",{className:"grid gap-4",children:o.map(W=>a.jsxs("div",{className:"border border-dashed border-white/10 rounded-none p-4 hover:bg-white/5 transition-colors",children:[a.jsxs("div",{className:"flex items-start justify-between mb-3",children:[a.jsxs("div",{className:"flex items-center space-x-4 flex-1",children:[a.jsx("div",{className:"w-12 h-12 bg-black/80 border border-dashed border-white/20 flex items-center justify-center rounded-none",children:a.jsx(Ht,{className:"w-6 h-6 text-white"})}),a.jsxs("div",{className:"flex-1",children:[a.jsxs("h3",{className:"text-white font-light inline-flex items-start",children:[W.team.name,a.jsx(Ct,{id:W.team.id,variant:"subscript",nonSliced:!!(W.team.organizationSlug||W.team.organizationName)})]}),a.jsxs("p",{className:"text-gray-400 text-sm font-sans mt-1 flex items-center gap-2",children:[a.jsxs("span",{children:["in"," ",W.team.organizationSlug||W.team.organizationName]}),a.jsx("button",{onClick:ue=>{ue.stopPropagation(),W.team.organizationId?t(`/organizations/${W.team.organizationId}/teams/${W.team.id}`):t(`/teams/${W.team.id}`)},className:"text-white/60 hover:text-white transition-colors",title:"View team details",children:a.jsx(Ii,{className:"w-3.5 h-3.5"})})]})]})]}),a.jsx("div",{className:"flex flex-col items-end space-y-2",children:a.jsxs("div",{className:"flex items-center space-x-2",children:[a.jsxs("span",{className:"text-gray-500 font-mono text-xs uppercase",children:["Joined:"," "]}),a.jsxs("span",{className:"text-white font-mono text-xs",children:[new Date(W.joinedAt).toLocaleDateString("en-US",{year:"numeric",month:"short",day:"numeric"}),","," ",new Date(W.joinedAt).toLocaleTimeString("en-US",{hour:"numeric",minute:"2-digit",hour12:!0})]})]})})]}),a.jsx("div",{className:"flex items-center justify-end",children:a.jsxs(H,{variant:"outline",size:"sm",onClick:()=>nt(W.id),className:"border border-dashed border-red-400/20 text-red-400 hover:bg-red-400/10 rounded-none",children:[a.jsx(ax,{className:"w-4 h-4 mr-1"}),"Remove"]})})]},W.id))})]}),w==="accounts"&&a.jsxs("div",{className:"space-y-4",children:[a.jsxs("div",{className:"flex items-center justify-between mb-4",children:[a.jsxs("div",{children:[a.jsxs("h3",{className:"text-lg relative text-white font-light inline-flex items-start",children:["Linked Accounts",a.jsxs("sup",{className:"text-xs text-gray-500 ml-1 mt-0",children:[a.jsx("span",{className:"mr-1",children:"["}),a.jsx("span",{className:"text-white font-mono text-xs",children:h.length}),a.jsx("span",{className:"ml-1",children:"]"})]})]}),a.jsx("p",{className:"text-gray-400 font-light font-mono text-xs uppercase mt-1",children:"Manage user OAuth account connections"})]}),a.jsxs(H,{variant:"outline",onClick:()=>{re([]),ce(!1),U(!0)},className:"border border-dashed border-white/20 text-white hover:bg-white/10 rounded-none",children:[a.jsx(Gl,{className:"w-4 h-4 mr-2"}),"Seed Accounts"]})]}),h.length===0?a.jsxs("div",{className:"text-center py-12 border border-dashed border-white/10 rounded-none",children:[a.jsx(Gl,{className:"w-12 h-12 text-gray-400 mx-auto mb-4"}),a.jsx("p",{className:"text-gray-400 font-mono text-xs uppercase",children:"No linked accounts found"})]}):a.jsx("div",{className:"grid gap-4",children:h.map(W=>a.jsxs("div",{className:"border border-dashed border-white/10 rounded-none p-4 hover:bg-white/5 transition-colors",children:[a.jsxs("div",{className:"flex items-start justify-between mb-3",children:[a.jsxs("div",{className:"flex items-center space-x-4 flex-1",children:[a.jsx("div",{className:"w-12 h-12 bg-black/80 border border-dashed border-white/20 flex items-center justify-center rounded-none",children:EE(W.providerId)}),a.jsxs("div",{className:"flex-1",children:[a.jsxs("h3",{className:"text-white font-light inline-flex items-start",children:[kt(W.providerId),a.jsx(Ct,{id:W.accountId,variant:"subscript",nonSliced:!!(W.email||n.email)})]}),a.jsx("p",{className:"text-gray-400 tracking-tight uppercase text-xs font-mono mt-1",children:`ID: ${W.id}`})]})]}),a.jsx("div",{className:"flex flex-col items-end space-y-2 text-right",children:a.jsxs("div",{className:"flex items-center space-x-2 text-xs font-mono text-gray-400",children:[a.jsx("span",{className:"uppercase",children:"Linked:"}),a.jsx("span",{className:"text-white",children:we(W.createdAt||W.updatedAt)})]})})]}),a.jsx("div",{className:"flex items-center justify-end",children:a.jsxs(H,{variant:"outline",size:"sm",onClick:()=>xe(W.id),disabled:un[W.id],className:"border border-dashed border-red-400/20 text-red-400 hover:bg-red-400/10 rounded-none",children:[a.jsx(ax,{className:"w-4 h-4 mr-1"}),"Unlink"]})})]},W.id))})]}),w==="sessions"&&a.jsxs("div",{className:"space-y-4",children:[a.jsxs("div",{className:"flex items-center justify-between mb-4",children:[a.jsxs("div",{children:[a.jsxs("h3",{className:"text-lg relative text-white font-light inline-flex items-start",children:["Sessions",a.jsxs("sup",{className:"text-xs text-gray-500 ml-1 mt-0",children:[a.jsx("span",{className:"mr-1",children:"["}),a.jsx("span",{className:"text-white font-mono text-xs",children:c.length}),a.jsx("span",{className:"ml-1",children:"]"})]})]}),a.jsx("p",{className:"text-gray-400 font-light font-mono text-xs uppercase mt-1",children:"Manage user authentication sessions"})]}),a.jsxs(H,{variant:"outline",onClick:()=>{re([]),ce(!1),L(!0)},className:"border border-dashed border-white/20 text-white hover:bg-white/10 rounded-none",children:[a.jsx(Fs,{className:"w-4 h-4 mr-2"}),"Seed Sessions"]})]}),c.length===0?a.jsxs("div",{className:"text-center py-12 border border-dashed border-white/10 rounded-none",children:[a.jsx(_N,{className:"w-12 h-12 text-gray-400 mx-auto mb-4"}),a.jsx("p",{className:"text-gray-400 font-mono text-xs uppercase",children:"No sessions found"})]}):a.jsx("div",{className:"grid gap-4",children:c.map(W=>{var ue,pe,Le,qe;return a.jsxs("div",{className:"border border-dashed border-white/10 rounded-none p-4 hover:bg-white/5 transition-colors",children:[a.jsxs("div",{className:"flex items-start justify-between mb-3",children:[a.jsxs("div",{className:"flex items-center space-x-4 flex-1",children:[a.jsx("div",{className:"w-12 h-12 bg-black/80 border border-dashed border-white/20 flex items-center justify-center rounded-none",children:a.jsx(vae,{className:"w-6 h-6 text-white"})}),a.jsxs("div",{className:"flex-1",children:[a.jsxs("h3",{className:"text-white font-light inline-flex items-start",children:["Session ",W.id.substring(0,8),"...",a.jsxs("sup",{className:"text-xs text-gray-500 ml-2 mt-0.5",children:[a.jsx("span",{className:"mr-1",children:"["}),a.jsx("span",{className:"text-white/80 font-mono text-xs",children:W.ipAddress}),a.jsx("span",{className:"ml-1",children:"]"})]})]}),a.jsxs("div",{className:"flex items-center space-x-2 mt-2",children:[a.jsx(Sae,{className:"w-3.5 h-3.5 text-gray-400"}),a.jsxs("span",{className:"text-gray-400 uppercase font-mono text-xs",children:[((ue=Me[W.id])==null?void 0:ue.city)||"...",","," ",((pe=Me[W.id])==null?void 0:pe.country)||"..."]}),((Le=Me[W.id])==null?void 0:Le.countryCode)&&a.jsx("span",{className:"text-xs ml-1",children:tt((qe=Me[W.id])==null?void 0:qe.countryCode)})]})]})]}),a.jsxs("div",{className:"flex flex-col items-start space-y-1",children:[a.jsxs("div",{className:"flex items-center space-x-2",children:[a.jsxs("span",{className:"text-gray-500 font-mono text-xs uppercase",children:["Expires:"," "]}),a.jsxs("span",{className:"text-white font-mono text-xs",children:[new Date(W.expiresAt).toLocaleDateString("en-US",{year:"numeric",month:"short",day:"numeric"}),","," ",new Date(W.expiresAt).toLocaleTimeString("en-US",{hour:"numeric",minute:"2-digit",hour12:!0})]})]}),a.jsxs("div",{className:"flex items-center space-x-2",children:[a.jsxs("span",{className:"text-gray-500 font-mono text-xs uppercase",children:["Created:"," "]}),a.jsxs("span",{className:"text-white font-mono text-xs",children:[new Date(W.createdAt).toLocaleDateString("en-US",{year:"numeric",month:"short",day:"numeric"}),","," ",new Date(W.createdAt).toLocaleTimeString("en-US",{hour:"numeric",minute:"2-digit",hour12:!0})]})]})]})]}),a.jsx("div",{className:"flex items-center justify-end",children:a.jsxs(H,{variant:"outline",size:"sm",onClick:()=>Z(W.id),disabled:Tn[W.id],className:"border border-dashed border-red-400/20 text-red-400 hover:bg-red-400/10 rounded-none",children:[a.jsx(rx,{className:"w-4 h-4 mr-1"}),"Revoke"]})})]},W.id)})})]}),w==="invitations"&&a.jsxs("div",{className:"space-y-4",children:[a.jsx("div",{className:"flex items-center justify-between mb-4",children:a.jsxs("div",{children:[a.jsxs("h3",{className:"text-lg relative text-white font-light inline-flex items-start",children:["Invitations",a.jsxs("sup",{className:"text-xs text-gray-500 ml-1 mt-0",children:[a.jsx("span",{className:"mr-1",children:"["}),a.jsx("span",{className:"text-white font-mono text-xs",children:f.length}),a.jsx("span",{className:"ml-1",children:"]"})]})]}),a.jsx("p",{className:"text-gray-400 font-light font-mono text-xs uppercase mt-1",children:"Manage user invitations"})]})}),f.length===0?a.jsxs("div",{className:"text-center py-12 border border-dashed border-white/10 rounded-none",children:[a.jsx(Cr,{className:"w-12 h-12 text-gray-400 mx-auto mb-4"}),a.jsx("p",{className:"text-gray-400 font-mono text-xs uppercase",children:"No invitations found"})]}):a.jsx("div",{className:"border border-white/10 rounded-none overflow-hidden",children:a.jsxs("table",{className:"w-full",children:[a.jsx("thead",{children:a.jsxs("tr",{className:"border-b border-white/10 bg-black/50",children:[a.jsx("th",{className:"text-left py-4 px-4 text-white font-mono uppercase text-xs",children:"Organization"}),a.jsx("th",{className:"text-left py-4 px-4 text-white font-mono uppercase text-xs",children:"Team"}),a.jsx("th",{className:"text-left py-4 px-4 text-white font-mono uppercase text-xs",children:"Role"}),a.jsx("th",{className:"text-left py-4 px-4 text-white font-mono uppercase text-xs",children:"Status"}),a.jsx("th",{className:"text-left py-4 px-4 text-white font-mono uppercase text-xs",children:"Expires"}),a.jsx("th",{className:"text-right py-4 px-4 text-white font-mono uppercase text-xs",children:"Actions"})]})}),a.jsx("tbody",{children:f.map(W=>a.jsxs("tr",{className:"border-b border-white/10 hover:bg-white/5 transition-colors",children:[a.jsx("td",{className:"py-4 px-4",children:a.jsxs("div",{className:"flex items-center space-x-2 group",children:[a.jsx(na,{className:"w-4 h-4 text-gray-400"}),a.jsx("span",{className:"text-white text-sm",children:W.organizationName}),a.jsx("button",{onClick:ue=>{ue.stopPropagation(),t(`/organizations/${W.organizationId}`)},className:"opacity-0 group-hover:opacity-100 text-white/60 hover:text-white transition-all",title:"View organization details",children:a.jsx(Ii,{className:"w-4 h-4"})})]})}),a.jsx("td",{className:"py-4 px-4",children:W.teamName?a.jsxs("div",{className:"flex items-center space-x-2 group",children:[a.jsx(Ht,{className:"w-4 h-4 text-gray-400"}),a.jsx("span",{className:"text-white text-sm",children:W.teamName}),W.teamId&&a.jsx("button",{onClick:ue=>{ue.stopPropagation(),t(`/organizations/${W.organizationId}/teams/${W.teamId}`)},className:"opacity-0 group-hover:opacity-100 text-white/60 hover:text-white transition-all",title:"View team details",children:a.jsx(Ii,{className:"w-4 h-4"})})]}):a.jsx("span",{className:"text-gray-500 text-sm",children:"—"})}),a.jsx("td",{className:"py-4 px-4",children:a.jsx("span",{className:"text-white/80 text-sm font-mono uppercase",children:W.role})}),a.jsx("td",{className:"py-4 px-4",children:a.jsx("span",{className:`text-xs font-mono uppercase px-2 border-dashed py-1 rounded-none ${W.status==="accepted"?"bg-green-900/50 text-green-400 border border-green-500/30":W.status==="rejected"||W.status==="cancelled"?"bg-red-900/50 text-red-400 border border-red-500/30":W.status==="expired"?"bg-yellow-900/50 text-yellow-400 border border-yellow-500/30":"bg-blue-900/50 text-blue-400 border border-blue-500/30"}`,children:W.status})}),a.jsx("td",{className:"py-4 px-4",children:a.jsx("span",{className:"text-gray-400 text-sm font-mono",children:new Date(W.expiresAt).toLocaleDateString("en-US",{month:"short",day:"numeric",year:"numeric"})})}),a.jsx("td",{className:"py-4 px-4",children:a.jsxs("div",{className:"flex items-center justify-end space-x-2",children:[W.status==="pending"&&a.jsxs(a.Fragment,{children:[a.jsxs(H,{variant:"outline",size:"sm",onClick:()=>Re(W.id),disabled:mt[W.id],className:"border border-dashed border-green-400/20 text-white hover:bg-green-400/10 hover:text-green-400 rounded-none font-mono uppercase text-xs tracking-tight",children:[a.jsx(Vl,{className:"w-3.5 h-3.5 mr-1"}),"Accept"]}),a.jsxs(H,{variant:"outline",size:"sm",onClick:()=>dt(W.id),disabled:Ft[W.id],className:"border border-dashed border-red-400/20 text-red-400 hover:text-red-400 hover:bg-red-400/10 rounded-none font-mono uppercase text-xs tracking-tight",children:[a.jsx(Jr,{className:"w-3.5 h-3.5 mr-1"}),"Reject"]}),a.jsxs(H,{variant:"outline",size:"sm",onClick:()=>ft(W.id),disabled:Yt[W.id],className:"border border-dashed border-yellow-400/20 text-white hover:text-yellow-400 hover:bg-yellow-400/10 rounded-none font-mono uppercase text-xs tracking-tight",children:[a.jsx(gt,{className:"w-3.5 h-3.5 mr-1"}),"Cancel"]})]}),(W.status==="accepted"||W.status==="rejected"||W.status==="cancelled"||W.status==="expired")&&a.jsx("span",{className:"text-gray-500 text-xs font-mono uppercase",children:"No actions available"})]})})]},W.id))})]})})]})]})]})]}),v&&a.jsx("div",{className:"fixed inset-0 bg-black/60 flex items-center justify-center z-50",children:a.jsxs("div",{className:"bg-black border border-white/15 rounded-none p-6 w-full max-w-lg shadow-2xl",children:[a.jsxs("div",{className:"flex items-center justify-between mb-4",children:[a.jsx("h3",{className:"text-lg text-white font-light uppercase font-mono",children:"Edit User"}),a.jsx(H,{variant:"ghost",size:"sm",onClick:()=>{g(!1),J(""),je(null),Xe(null)},className:"text-gray-400 -mt-2 hover:text-white rounded-none",children:a.jsx(gt,{className:"w-4 h-4"})})]}),a.jsxs("div",{className:"flex flex-col items-center justify-center mt-2",children:[a.jsx("hr",{className:"w-[calc(100%+3rem)] border-white/10 h-px"}),a.jsx("div",{className:"relative z-20 h-4 w-[calc(100%+3rem)] mx-auto -translate-x-1/2 left-1/2 bg-[repeating-linear-gradient(-45deg,#ffffff,#ffffff_1px,transparent_1px,transparent_6px)] opacity-[7%]"}),a.jsx("hr",{className:"w-[calc(100%+3rem)] border-white/10 h-px"})]}),a.jsxs("div",{className:"space-y-4 mt-4",children:[a.jsxs("div",{className:"flex items-center space-x-3",children:[a.jsxs("div",{className:"relative group",children:[a.jsx("div",{className:"w-14 h-14 rounded-none border border-dashed border-white/15 bg-white/10 flex items-center justify-center overflow-hidden",children:oe?a.jsx("img",{src:oe,alt:n==null?void 0:n.name,className:"w-14 h-14 object-cover"}):a.jsx(Vr,{className:"w-7 h-7 text-white"})}),a.jsx("label",{htmlFor:"image-upload-details",className:"absolute inset-0 flex items-center justify-center bg-black/60 opacity-0 group-hover:opacity-100 transition-opacity cursor-pointer rounded-none",children:a.jsx(Xs,{className:"w-4 h-4 text-white"})}),oe&&a.jsx("button",{type:"button",onClick:W=>{W.preventDefault(),W.stopPropagation(),je(null),Xe(null)},disabled:ge,className:"absolute bottom-0 right-0 w-4 h-4 bg-red-500/90 hover:bg-red-500 text-white flex items-center justify-center rounded-none opacity-0 group-hover:opacity-100 transition-opacity",title:"Remove image",children:a.jsx(gt,{className:"w-3 h-3"})}),a.jsx("input",{id:"image-upload-details",type:"file",accept:"image/*",onChange:tn,className:"hidden",disabled:ge})]}),a.jsxs("div",{className:"space-y-1 flex-1",children:[a.jsxs("div",{className:"text-white font-medium leading-tight flex items-center gap-2",children:[a.jsx("span",{children:n==null?void 0:n.name}),a.jsx(Ct,{id:(n==null?void 0:n.id)||"",variant:"subscript",nonSliced:!0})]}),a.jsx("div",{className:"text-sm text-gray-400",children:n==null?void 0:n.email}),et&&a.jsx("div",{className:"text-xs -mt-1 text-gray-500 font-mono",children:"New image selected"})]})]}),a.jsxs("div",{children:[a.jsx(ie,{htmlFor:"edit-name",className:"text-xs text-white/80 font-mono uppercase",children:"Name"}),a.jsx(be,{id:"edit-name",defaultValue:(n==null?void 0:n.name)||"",placeholder:"e.g. John Doe",disabled:ge,className:"mt-1 border border-dashed border-white/20 bg-black/30 text-white rounded-none"})]}),a.jsxs("div",{children:[a.jsx(ie,{htmlFor:"edit-email",className:"text-xs text-white/80 font-mono uppercase",children:"Email"}),a.jsx(be,{id:"edit-email",type:"email",defaultValue:(n==null?void 0:n.email)||"",placeholder:"e.g. john@example.com",disabled:ge,className:"mt-1 border border-dashed border-white/20 bg-black/30 text-white rounded-none"})]}),a.jsxs("div",{children:[a.jsx(ie,{htmlFor:"edit-role",className:"text-xs text-white/80 font-mono uppercase",children:"Role"}),a.jsxs(Ln,{value:ee,onValueChange:J,children:[a.jsx(Un,{id:"edit-role",className:"mt-1 border border-dashed border-white/20 bg-black/30 text-white rounded-none",disabled:ge,children:a.jsx(oa,{placeholder:"Select role"})}),a.jsxs(Pn,{children:[a.jsx(Fe,{value:"",children:"None"}),a.jsx(Fe,{value:"admin",children:"Admin"}),a.jsx(Fe,{value:"user",children:"User"})]})]})]})]}),a.jsxs("div",{className:"flex justify-end space-x-3 mt-6",children:[a.jsx(H,{variant:"outline",onClick:()=>{g(!1),J(""),je(null),Xe(null)},disabled:ge,className:"border border-dashed border-white/20 text-white hover:bg-white/10 rounded-none font-mono uppercase text-xs tracking-tight",children:"Cancel"}),a.jsx(H,{onClick:ne,disabled:ge,className:"bg-white hover:bg-white/90 text-black border border-white/20 rounded-none disabled:opacity-50 font-mono uppercase text-xs tracking-tight",children:ge?"Updating...":"Update"})]})]})}),N&&n&&a.jsx("div",{className:"fixed inset-0 bg-black/60 flex items-center justify-center z-50",children:a.jsxs("div",{className:"bg-black border border-white/15 rounded-none p-6 w-full max-w-lg shadow-2xl",children:[a.jsxs("div",{className:"flex items-center justify-between mb-4",children:[a.jsx("h3",{className:"text-lg text-white font-light uppercase font-mono",children:"Ban User"}),a.jsx(H,{variant:"ghost",size:"sm",onClick:()=>{S(!1),T(""),$(void 0)},disabled:Pe,className:"text-gray-400 -mt-2 hover:text-white rounded-none",children:a.jsx(gt,{className:"w-4 h-4"})})]}),a.jsxs("div",{className:"flex flex-col items-center justify-center mt-2",children:[a.jsx("hr",{className:"w-[calc(100%+3rem)] border-white/10 h-px"}),a.jsx("div",{className:"relative z-20 h-4 w-[calc(100%+3rem)] mx-auto -translate-x-1/2 left-1/2 bg-[repeating-linear-gradient(-45deg,#ffffff,#ffffff_1px,transparent_1px,transparent_6px)] opacity-[7%]"}),a.jsx("hr",{className:"w-[calc(100%+3rem)] border-white/10 h-px"})]}),a.jsxs("div",{className:"space-y-4 mt-4",children:[a.jsxs("div",{className:"flex items-center space-x-3",children:[a.jsx("div",{className:"w-14 h-14 rounded-none border border-dashed border-white/15 bg-white/10 flex items-center justify-center overflow-hidden",children:ha(n==null?void 0:n.image)?a.jsx("img",{src:ha(n==null?void 0:n.image),alt:n==null?void 0:n.name,className:"w-14 h-14 object-cover",onError:W=>{W.target.style.display="none"}}):a.jsx(Vr,{className:"w-7 h-7 text-white"})}),a.jsxs("div",{className:"space-y-1",children:[a.jsxs("div",{className:"text-white font-medium leading-tight flex items-center gap-2",children:[a.jsx("span",{children:n.name}),a.jsx(Ct,{id:n.id,variant:"subscript",nonSliced:!0})]}),a.jsx("div",{className:"text-sm text-gray-400",children:n.email})]})]}),a.jsxs("div",{children:[a.jsx(ie,{htmlFor:"banReason",className:"text-xs text-white/80 font-mono uppercase",children:"Ban Reason"}),a.jsx(be,{id:"banReason",value:B,onChange:W=>T(W.target.value),placeholder:"Enter reason for ban (optional)",disabled:Pe,className:"mt-1 border border-dashed border-white/20 bg-black/30 text-white rounded-none"})]}),a.jsxs("div",{children:[a.jsx(ie,{htmlFor:"banExpires",className:"text-xs text-white/80 font-mono uppercase",children:"Ban Duration (seconds)"}),a.jsx(be,{id:"banExpires",type:"number",value:A||"",onChange:W=>$(W.target.value?Number(W.target.value):void 0),placeholder:"Leave empty for permanent ban",disabled:Pe,className:"mt-1 border border-dashed border-white/20 bg-black/30 text-white rounded-none"}),a.jsx("p",{className:"text-xs text-gray-400 mt-1 font-mono",children:"Examples: 3600 (1 hour), 86400 (1 day), 604800 (1 week)"})]})]}),a.jsxs("div",{className:"flex justify-end space-x-3 mt-6",children:[a.jsx(H,{variant:"outline",onClick:()=>{S(!1),T(""),$(void 0)},disabled:Pe,className:"border border-dashed border-white/20 text-white hover:bg-white/10 rounded-none font-mono uppercase text-xs tracking-tight",children:"Cancel"}),a.jsx(H,{onClick:Ue,disabled:Pe,className:"bg-red-600 hover:bg-red-700 text-white border border-red-600 rounded-none disabled:opacity-50 font-mono uppercase text-xs tracking-tight",children:Pe?"Banning...":"Ban User"})]})]})}),E&&n&&a.jsx("div",{className:"fixed inset-0 bg-black/60 flex items-center justify-center z-50",children:a.jsxs("div",{className:"bg-black border border-white/15 rounded-none p-6 w-full max-w-lg shadow-2xl",children:[a.jsxs("div",{className:"flex items-center justify-between mb-4",children:[a.jsx("h3",{className:"text-lg text-white font-light uppercase font-mono",children:"Unban User"}),a.jsx(H,{variant:"ghost",size:"sm",onClick:()=>j(!1),disabled:ht,className:"text-gray-400 -mt-2 hover:text-white rounded-none",children:a.jsx(gt,{className:"w-4 h-4"})})]}),a.jsxs("div",{className:"flex flex-col items-center justify-center mt-2",children:[a.jsx("hr",{className:"w-[calc(100%+3rem)] border-white/10 h-px"}),a.jsx("div",{className:"relative z-20 h-4 w-[calc(100%+3rem)] mx-auto -translate-x-1/2 left-1/2 bg-[repeating-linear-gradient(-45deg,#ffffff,#ffffff_1px,transparent_1px,transparent_6px)] opacity-[7%]"}),a.jsx("hr",{className:"w-[calc(100%+3rem)] border-white/10 h-px"})]}),a.jsxs("div",{className:"space-y-4 mt-4",children:[a.jsxs("div",{className:"flex items-center space-x-3",children:[a.jsx("div",{className:"w-14 h-14 rounded-none border border-dashed border-white/15 bg-white/10 flex items-center justify-center overflow-hidden",children:ha(n==null?void 0:n.image)?a.jsx("img",{src:ha(n==null?void 0:n.image),alt:n==null?void 0:n.name,className:"w-14 h-14 object-cover",onError:W=>{W.target.style.display="none"}}):a.jsx(Vr,{className:"w-7 h-7 text-white"})}),a.jsxs("div",{className:"space-y-1",children:[a.jsxs("div",{className:"text-white font-medium leading-tight flex items-center gap-2",children:[a.jsx("span",{children:n.name}),a.jsx(Ct,{id:n.id,variant:"subscript",nonSliced:!0})]}),a.jsx("div",{className:"text-sm text-gray-400",children:n.email})]})]}),a.jsx("p",{className:"text-gray-400",children:"Are you sure you want to unban this user? This will restore their access to the system."})]}),a.jsxs("div",{className:"flex justify-end space-x-3 mt-6",children:[a.jsx(H,{variant:"outline",onClick:()=>j(!1),disabled:ht,className:"border border-dashed border-white/20 text-white hover:bg-white/10 rounded-none font-mono uppercase text-xs tracking-tight",children:"Cancel"}),a.jsx(H,{onClick:Ve,disabled:ht,className:"bg-green-400 hover:bg-green-500 text-white border border-green-400 rounded-none disabled:opacity-50 font-mono uppercase text-xs tracking-tight",children:ht?"Unbanning...":"Unban User"})]})]})}),C&&n&&a.jsx("div",{className:"fixed inset-0 bg-black/60 flex items-center justify-center z-50",children:a.jsxs("div",{className:"bg-black border border-white/15 rounded-none p-6 w-full max-w-lg shadow-2xl",children:[a.jsxs("div",{className:"flex items-center justify-between mb-4",children:[a.jsx("h3",{className:"text-lg text-white font-light uppercase font-mono",children:"Delete User"}),a.jsx(H,{variant:"ghost",size:"sm",onClick:()=>k(!1),className:"text-gray-400 -mt-2 hover:text-white rounded-none",children:a.jsx(gt,{className:"w-4 h-4"})})]}),a.jsxs("div",{className:"flex flex-col items-center justify-center mt-2",children:[a.jsx("hr",{className:"w-[calc(100%+3rem)] border-white/10 h-px"}),a.jsx("div",{className:"relative z-20 h-4 w-[calc(100%+3rem)] mx-auto -translate-x-1/2 left-1/2 bg-[repeating-linear-gradient(-45deg,#ffffff,#ffffff_1px,transparent_1px,transparent_6px)] opacity-[7%]"}),a.jsx("hr",{className:"w-[calc(100%+3rem)] border-white/10 h-px"})]}),a.jsxs("div",{className:"space-y-4 mt-4",children:[a.jsxs("div",{className:"flex items-center space-x-3",children:[a.jsx("div",{className:"w-14 h-14 rounded-none border border-dashed border-white/15 bg-white/10 flex items-center justify-center overflow-hidden",children:ha(n==null?void 0:n.image)?a.jsx("img",{src:ha(n==null?void 0:n.image),alt:n==null?void 0:n.name,className:"w-14 h-14 object-cover",onError:W=>{W.target.style.display="none"}}):a.jsx(Vr,{className:"w-7 h-7 text-white"})}),a.jsxs("div",{className:"space-y-1",children:[a.jsxs("div",{className:"text-white font-medium leading-tight flex items-center gap-2",children:[a.jsx("span",{children:n.name}),a.jsx(Ct,{id:n.id,variant:"subscript",nonSliced:!0})]}),a.jsx("div",{className:"text-sm text-gray-400",children:n.email})]})]}),a.jsx("p",{className:"text-gray-400",children:"Are you sure you want to delete this user? This action cannot be undone."})]}),a.jsxs("div",{className:"flex justify-end space-x-3 mt-6",children:[a.jsx(H,{variant:"outline",onClick:()=>k(!1),disabled:Be,className:"border border-dashed border-white/20 text-white hover:bg-white/10 rounded-none font-mono uppercase text-xs tracking-tight",children:"Cancel"}),a.jsx(H,{onClick:Ee,disabled:Be,className:"bg-red-600 hover:bg-red-700 text-white border border-red-600 rounded-none disabled:opacity-50 font-mono uppercase text-xs tracking-tight",children:Be?"Deleting...":"Delete"})]})]})}),O&&n&&a.jsx("div",{className:"fixed inset-0 bg-black/60 flex items-center justify-center z-50",children:a.jsxs("div",{className:"bg-black border border-white/15 rounded-none p-6 w-full max-w-lg shadow-2xl",children:[a.jsxs("div",{className:"flex items-center justify-between mb-4",children:[a.jsx("h3",{className:"text-lg text-white font-light uppercase font-mono",children:"Update Password"}),a.jsx(H,{variant:"ghost",size:"sm",onClick:()=>M(!1),disabled:de,className:"text-gray-400 -mt-2 hover:text-white rounded-none",children:a.jsx(gt,{className:"w-4 h-4"})})]}),a.jsxs("div",{className:"flex flex-col items-center justify-center mt-2",children:[a.jsx("hr",{className:"w-[calc(100%+3rem)] border-white/10 h-px"}),a.jsx("div",{className:"relative z-20 h-4 w-[calc(100%+3rem)] mx-auto -translate-x-1/2 left-1/2 bg-[repeating-linear-gradient(-45deg,#ffffff,#ffffff_1px,transparent_1px,transparent_6px)] opacity-[7%]"}),a.jsx("hr",{className:"w-[calc(100%+3rem)] border-white/10 h-px"})]}),a.jsxs("div",{className:"space-y-4 mt-4",children:[a.jsxs("div",{className:"flex items-center space-x-3",children:[a.jsx("div",{className:"w-14 h-14 rounded-none border border-dashed border-white/15 bg-white/10 flex items-center justify-center overflow-hidden",children:ha(n==null?void 0:n.image)?a.jsx("img",{src:ha(n==null?void 0:n.image),alt:n==null?void 0:n.name,className:"w-14 h-14 object-cover",onError:W=>{W.target.style.display="none"}}):a.jsx(Vr,{className:"w-7 h-7 text-white"})}),a.jsxs("div",{className:"space-y-1",children:[a.jsxs("div",{className:"text-white font-medium leading-tight flex items-center gap-2",children:[a.jsx("span",{children:n.name}),a.jsx(Ct,{id:n.id,variant:"subscript",nonSliced:!0})]}),a.jsx("div",{className:"text-sm text-gray-400",children:n.email})]})]}),a.jsxs("div",{children:[a.jsx(ie,{htmlFor:"new-password",className:"text-xs text-white/80 font-mono uppercase",children:"New Password"}),a.jsx(be,{id:"new-password",type:"password",disabled:de,className:"mt-1 border border-dashed border-white/20 bg-black/30 text-white rounded-none"})]})]}),a.jsxs("div",{className:"flex justify-end space-x-3 mt-6",children:[a.jsx(H,{variant:"outline",onClick:()=>M(!1),disabled:de,className:"border border-dashed border-white/20 text-white hover:bg-white/10 rounded-none font-mono uppercase text-xs tracking-tight",children:"Cancel"}),a.jsx(H,{onClick:async()=>{var pe;const W=(pe=document.getElementById("new-password"))==null?void 0:pe.value;if(!W){V.error("Please enter a password");return}$e(!0);const ue=V.loading("Updating password...");try{const qe=await(await fetch(`/api/users/${e}/password`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({password:W})})).json();if(qe.success)M(!1),document.getElementById("new-password").value="",V.success("Password updated successfully!",{id:ue});else{const lt=qe.message||qe.error||"Unknown error";V.error(`Error updating password: ${lt}`,{id:ue})}}catch{V.error("Error updating password",{id:ue})}finally{$e(!1)}},disabled:de,className:"bg-white hover:bg-white/90 text-black border border-white/20 rounded-none disabled:opacity-50 font-mono uppercase text-xs tracking-tight",children:de?"Updating...":"Update Password"})]})]})}),_&&n&&a.jsx("div",{className:"fixed inset-0 bg-black/60 flex items-center justify-center z-50",children:a.jsxs("div",{className:"bg-black border border-white/15 rounded-none p-6 w-full max-w-xl shadow-2xl",children:[a.jsxs("div",{className:"flex items-center justify-between mb-4",children:[a.jsx("h3",{className:"text-lg text-white font-light uppercase font-mono",children:"Seed Sessions"}),a.jsx(H,{variant:"ghost",size:"sm",onClick:()=>L(!1),disabled:se,className:"text-gray-400 -mt-2 hover:text-white rounded-none",children:a.jsx(gt,{className:"w-4 h-4"})})]}),a.jsxs("div",{className:"flex flex-col items-center justify-center mt-2",children:[a.jsx("hr",{className:"w-[calc(100%+3rem)] border-white/10 h-px"}),a.jsx("div",{className:"relative z-20 h-4 w-[calc(100%+3rem)] mx-auto -translate-x-1/2 left-1/2 bg-[repeating-linear-gradient(-45deg,#ffffff,#ffffff_1px,transparent_1px,transparent_6px)] opacity-[7%]"}),a.jsx("hr",{className:"w-[calc(100%+3rem)] border-white/10 h-px"})]}),a.jsxs("div",{className:"space-y-4 mt-4",children:[a.jsxs("div",{className:"flex items-center space-x-3",children:[a.jsx("div",{className:"w-14 h-14 rounded-none border border-dashed border-white/15 bg-white/10 flex items-center justify-center overflow-hidden",children:ha(n==null?void 0:n.image)?a.jsx("img",{src:ha(n==null?void 0:n.image),alt:n==null?void 0:n.name,className:"w-14 h-14 object-cover",onError:W=>{W.target.style.display="none"}}):a.jsx(Vr,{className:"w-7 h-7 text-white"})}),a.jsxs("div",{className:"space-y-1",children:[a.jsxs("div",{className:"text-white font-medium leading-tight flex items-center gap-2",children:[a.jsx("span",{children:n.name}),a.jsx(Ct,{id:n.id,variant:"subscript",nonSliced:!0})]}),a.jsx("div",{className:"text-sm text-gray-400",children:n.email})]})]}),a.jsxs("div",{children:[a.jsx(ie,{htmlFor:"session-count",className:"text-xs text-white/80 font-mono uppercase",children:"Number of Sessions"}),a.jsx(be,{id:"session-count",type:"number",min:"1",max:"50",defaultValue:"3",disabled:se,className:"mt-1 border border-dashed border-white/20 bg-black/30 text-white rounded-none"})]}),K.length>0&&a.jsx("div",{className:"mt-4",children:a.jsx(no,{title:"Session Seeding Terminal",lines:K,isRunning:se,className:"w-full",defaultCollapsed:!0})})]}),a.jsxs("div",{className:"flex justify-end space-x-3 mt-6",children:[a.jsx(H,{variant:"outline",onClick:()=>L(!1),disabled:se,className:"border border-dashed border-white/20 text-white hover:bg-white/10 rounded-none font-mono uppercase text-xs tracking-tight",children:"Cancel"}),a.jsx(H,{onClick:()=>{var ue;const W=parseInt(((ue=document.getElementById("session-count"))==null?void 0:ue.value)||"3",10);ze(W)},disabled:se,className:"bg-white hover:bg-white/90 text-black border border-white/20 rounded-none disabled:opacity-50 font-mono uppercase text-xs tracking-tight",children:se?a.jsxs(a.Fragment,{children:[a.jsx(In,{className:"w-3 h-3 mr-2 animate-spin"}),"Seeding..."]}):a.jsxs(a.Fragment,{children:[a.jsx(Fs,{className:"w-3 h-3 mr-2"}),"Seed Sessions"]})})]})]})}),F&&n&&a.jsx("div",{className:"fixed inset-0 bg-black/60 flex items-center justify-center z-50",children:a.jsxs("div",{className:"bg-black border border-white/15 rounded-none p-6 w-full max-w-xl shadow-2xl",children:[a.jsxs("div",{className:"flex items-center justify-between mb-4",children:[a.jsx("h3",{className:"text-lg text-white font-light uppercase font-mono",children:"Seed Accounts"}),a.jsx(H,{variant:"ghost",size:"sm",onClick:()=>U(!1),disabled:se,className:"text-gray-400 -mt-2 hover:text-white rounded-none",children:a.jsx(gt,{className:"w-4 h-4"})})]}),a.jsxs("div",{className:"flex flex-col items-center justify-center mt-2",children:[a.jsx("hr",{className:"w-[calc(100%+3rem)] border-white/10 h-px"}),a.jsx("div",{className:"relative z-20 h-4 w-[calc(100%+3rem)] mx-auto -translate-x-1/2 left-1/2 bg-[repeating-linear-gradient(-45deg,#ffffff,#ffffff_1px,transparent_1px,transparent_6px)] opacity-[7%]"}),a.jsx("hr",{className:"w-[calc(100%+3rem)] border-white/10 h-px"})]}),a.jsxs("div",{className:"space-y-4 mt-4",children:[a.jsxs("div",{className:"flex items-center space-x-3",children:[a.jsx("div",{className:"w-14 h-14 rounded-none border border-dashed border-white/15 bg-white/10 flex items-center justify-center overflow-hidden",children:ha(n==null?void 0:n.image)?a.jsx("img",{src:ha(n==null?void 0:n.image),alt:n==null?void 0:n.name,className:"w-14 h-14 object-cover",onError:W=>{W.target.style.display="none"}}):a.jsx(Vr,{className:"w-7 h-7 text-white"})}),a.jsxs("div",{className:"space-y-1",children:[a.jsxs("div",{className:"text-white font-medium leading-tight flex items-center gap-2",children:[a.jsx("span",{children:n.name}),a.jsx(Ct,{id:n.id,variant:"subscript",nonSliced:!0})]}),a.jsx("div",{className:"text-sm text-gray-400",children:n.email})]})]}),a.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[a.jsxs("div",{children:[a.jsx(ie,{htmlFor:"account-count",className:"text-xs text-white/80 font-mono uppercase",children:"Number of Accounts"}),a.jsx(be,{id:"account-count",type:"number",min:"1",max:"50",defaultValue:"3",disabled:se,className:"mt-1 border border-dashed border-white/20 bg-black/30 text-white rounded-none"})]}),a.jsxs("div",{children:[a.jsx(ie,{htmlFor:"account-provider",className:"text-xs text-white/80 font-mono uppercase",children:"Provider"}),a.jsxs(Ln,{value:R,onValueChange:G,children:[a.jsx(Un,{id:"account-provider",disabled:se,className:"mt-1 border border-dashed border-white/20 bg-black/30 text-white rounded-none",children:a.jsx(oa,{placeholder:"Select provider"})}),a.jsxs(Pn,{className:"bg-black border border-dashed border-white/20",children:[a.jsx(Fe,{value:"random",children:"Mix (Random)"}),a.jsx(Fe,{value:"github",children:"GitHub"}),a.jsx(Fe,{value:"google",children:"Google"}),a.jsx(Fe,{value:"discord",children:"Discord"}),a.jsx(Fe,{value:"facebook",children:"Facebook"}),a.jsx(Fe,{value:"twitter",children:"Twitter"}),a.jsx(Fe,{value:"linkedin",children:"LinkedIn"}),a.jsx(Fe,{value:"apple",children:"Apple"}),a.jsx(Fe,{value:"microsoft",children:"Microsoft"}),a.jsx(Fe,{value:"gitlab",children:"GitLab"}),a.jsx(Fe,{value:"bitbucket",children:"Bitbucket"}),a.jsx(Fe,{value:"spotify",children:"Spotify"}),a.jsx(Fe,{value:"twitch",children:"Twitch"}),a.jsx(Fe,{value:"reddit",children:"Reddit"}),a.jsx(Fe,{value:"slack",children:"Slack"}),a.jsx(Fe,{value:"notion",children:"Notion"}),a.jsx(Fe,{value:"tiktok",children:"TikTok"}),a.jsx(Fe,{value:"zoom",children:"Zoom"})]})]})]})]}),K.length>0&&a.jsx("div",{className:"mt-4",children:a.jsx(no,{title:"Account Seeding Terminal",lines:K,isRunning:se,className:"w-full",defaultCollapsed:!0})})]}),a.jsxs("div",{className:"flex justify-end space-x-3 mt-6",children:[a.jsx(H,{variant:"outline",onClick:()=>U(!1),disabled:se,className:"border border-dashed border-white/20 text-white hover:bg-white/10 rounded-none font-mono uppercase text-xs tracking-tight",children:"Cancel"}),a.jsx(H,{onClick:()=>{var ue;const W=parseInt(((ue=document.getElementById("account-count"))==null?void 0:ue.value)||"3",10);Rt(W,R)},disabled:se,className:"bg-white hover:bg-white/90 text-black border border-white/20 rounded-none disabled:opacity-50 font-mono uppercase text-xs tracking-tight",children:se?a.jsxs(a.Fragment,{children:[a.jsx(In,{className:"w-3 h-3 mr-2 animate-spin"}),"Seeding..."]}):a.jsxs(a.Fragment,{children:[a.jsx(Gl,{className:"w-3 h-3 mr-2"}),"Seed Accounts"]})})]})]})})]}):a.jsx("div",{className:"min-h-screen bg-black flex items-center justify-center",children:a.jsx("div",{className:"text-white text-lg",children:"User not found"})})}const Zh=window.__STUDIO_CONFIG__,kp=(Zh==null?void 0:Zh.basePath)!==void 0?Zh.basePath:"",hpe=!!kp;function fpe({children:e}){const[t,n]=p.useState({loading:!0,authenticated:!1,user:null}),r=io();if(p.useEffect(()=>{(async()=>{try{const i=kp?`${kp}/auth`:"/api/auth",l=await(await fetch(`${i}/session`,{credentials:"include"})).json();n({loading:!1,authenticated:l.authenticated,user:l.user})}catch{n({loading:!1,authenticated:!1,user:null})}})()},[r.pathname]),t.loading)return a.jsx("div",{className:"min-h-screen bg-black flex items-center justify-center",children:a.jsx("div",{className:"w-8 h-8 border border-dashed border-white/30 animate-spin"})});if(!t.authenticated){const s=encodeURIComponent(r.pathname+r.search);return a.jsx(C$,{to:`/login?redirect=${s}`,replace:!0})}return a.jsx(a.Fragment,{children:e})}function uO(){return a.jsx(QK,{children:a.jsx(YQ,{children:a.jsxs(uN,{children:[a.jsx(Gn,{path:"/",element:a.jsx(Xae,{})}),a.jsx(Gn,{path:"/users",element:a.jsx(PU,{})}),a.jsx(Gn,{path:"/users/:userId",element:a.jsx(upe,{})}),a.jsx(Gn,{path:"/organizations",element:a.jsx(UU,{})}),a.jsx(Gn,{path:"/organizations/:orgId",element:a.jsx(Cfe,{})}),a.jsx(Gn,{path:"/teams",element:a.jsx(Rfe,{})}),a.jsx(Gn,{path:"/teams/:teamId",element:a.jsx(dO,{})}),a.jsx(Gn,{path:"/organizations/:orgId/teams/:teamId",element:a.jsx(dO,{})}),a.jsx(Gn,{path:"/sessions",element:a.jsx(kfe,{})}),a.jsx(Gn,{path:"/database",element:a.jsx(Qae,{})}),a.jsx(Gn,{path:"/database/demo",element:a.jsx(ZK,{})}),a.jsx(Gn,{path:"/emails",element:a.jsx(jfe,{})}),a.jsx(Gn,{path:"/tools",element:a.jsx(dpe,{})}),a.jsx(Gn,{path:"/settings",element:a.jsx(_fe,{})})]})})})}function ppe(){return a.jsxs(L$,{basename:kp,children:[hpe?a.jsxs(uN,{children:[a.jsx(Gn,{path:"/login",element:a.jsx(Tfe,{})}),a.jsx(Gn,{path:"/access-denied",element:a.jsx(WQ,{})}),a.jsx(Gn,{path:"/*",element:a.jsx(fpe,{children:a.jsx(uO,{})})})]}):a.jsx(uN,{children:a.jsx(Gn,{path:"/*",element:a.jsx(uO,{})})}),a.jsx(h8,{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})]})}const mpe=window.fetch;window.fetch=(e,t)=>{var i;const n=((i=window.__STUDIO_CONFIG__)==null?void 0:i.basePath)||"";let r;return typeof e=="string"?r=e:e instanceof URL?r=e.toString():e instanceof Request?r=e.url:r="",r.startsWith("/api/")&&!r.startsWith("/api/auth/")&&n&&!r.startsWith(n)&&(r=n+r.slice(4),typeof e=="string"?e=r:e instanceof URL?e=new URL(r,window.location.origin):e instanceof Request&&(e=new Request(r,e))),mpe.call(window,e,t)};LB.createRoot(document.getElementById("root")).render(a.jsx(te.StrictMode,{children:a.jsx(ppe,{})}));
1150
+ `)),className:"text-gray-400 hover:text-white rounded-none",children:[a.jsx(Ma,{className:"w-4 h-4 mr-1"}),"Copy All"]})]}),a.jsx("div",{className:"border border-dashed border-white/10 p-3",children:a.jsx("div",{className:"space-y-2 max-h-64 overflow-y-auto",children:Ee.map((D,z)=>a.jsxs("div",{className:"flex items-center justify-between p-2 bg-black/40 border border-dashed border-white/10",children:[a.jsx("span",{className:"text-white font-mono text-xs break-all",children:D}),a.jsx(H,{variant:"ghost",size:"sm",onClick:()=>ar(D),className:"text-gray-400 hover:text-white rounded-none ml-2",children:a.jsx(Ma,{className:"w-3 h-3"})})]},z))})})]}),a.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-4 text-xs font-mono",children:[a.jsxs("div",{className:"border border-dashed border-white/10 p-3 space-y-2",children:[a.jsx("div",{className:"text-gray-400 uppercase tracking-wider",children:"Version"}),a.jsx("p",{className:"text-white text-sm",children:"v4 (Random)"}),a.jsx("p",{className:"text-gray-500 text-xs",children:"Cryptographically random"})]}),a.jsxs("div",{className:"border border-dashed border-white/10 p-3 space-y-2",children:[a.jsx("div",{className:"text-gray-400 uppercase tracking-wider",children:"Format"}),a.jsx("p",{className:"text-white text-sm",children:"8-4-4-4-12"}),a.jsx("p",{className:"text-gray-500 text-xs",children:"36 characters"})]}),a.jsxs("div",{className:"border border-dashed border-white/10 p-3 space-y-2",children:[a.jsx("div",{className:"text-gray-400 uppercase tracking-wider",children:"Standard"}),a.jsx("p",{className:"text-white text-sm",children:"RFC 4122"}),a.jsx("p",{className:"text-gray-500 text-xs",children:"Universally unique"})]})]})]})]})}),xe&&a.jsx("div",{className:"fixed inset-0 bg-black/80 flex items-center justify-center z-[60] overflow-hidden",children:a.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:[a.jsxs("div",{className:"flex items-center justify-between mb-6",children:[a.jsxs("div",{className:"flex items-center space-x-2",children:[a.jsx(rc,{className:"w-5 h-5 text-white"}),a.jsx("h3",{className:"text-xl text-white font-light uppercase tracking-wider",children:"Password Strength Checker"})]}),a.jsx(H,{variant:"ghost",size:"sm",onClick:()=>Re(!1),className:"text-gray-400 hover:text-white rounded-none",children:a.jsx(gt,{className:"w-4 h-4"})})]}),a.jsxs("div",{className:"space-y-4",children:[a.jsxs("div",{children:[a.jsx(ie,{className:"text-xs uppercase font-mono text-gray-400 mb-2 block",children:"Password"}),a.jsxs("div",{className:"relative",children:[a.jsx(be,{type:pe?"text":"password",value:dt,onChange:D=>ft(D.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"}),a.jsx(H,{variant:"ghost",size:"sm",onClick:()=>Le(!pe),className:"absolute right-0 top-0 h-full px-3 text-gray-400 hover:text-white rounded-none",children:pe?a.jsx(xf,{className:"w-4 h-4"}):a.jsx(Hs,{className:"w-4 h-4"})})]})]}),a.jsxs("div",{className:"flex items-end justify-end space-x-2",children:[a.jsx(H,{variant:"outline",onClick:()=>{ft(""),Rt(null),Le(!1)},className:"border border-dashed border-white/20 text-white hover:bg-white/10 rounded-none",children:"Clear"}),a.jsx(H,{onClick:hP,disabled:W||!dt.trim(),className:"rounded-none",children:W?a.jsxs(a.Fragment,{children:[a.jsx(In,{className:"w-4 h-4 mr-2 animate-spin"}),"Checking..."]}):"Check Strength"})]}),ze&&a.jsxs("div",{className:"space-y-4",children:[a.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-4 text-xs font-mono",children:[a.jsxs("div",{className:"border border-dashed border-white/10 p-3 space-y-2",children:[a.jsx("div",{className:"text-gray-400 uppercase tracking-wider",children:"Strength"}),a.jsx("p",{className:`text-sm font-medium ${ze.strength==="very-strong"?"text-green-400":ze.strength==="strong"?"text-green-300":ze.strength==="good"?"text-yellow-300":ze.strength==="fair"?"text-orange-300":"text-red-300"}`,children:ze.strength.split("-").map(D=>D.charAt(0).toUpperCase()+D.slice(1)).join(" ")}),a.jsx("div",{className:"w-full bg-black/40 h-2 rounded-none",children:a.jsx("div",{className:`h-full transition-all ${ze.strength==="very-strong"?"bg-green-400 w-full":ze.strength==="strong"?"bg-green-300 w-4/5":ze.strength==="good"?"bg-yellow-300 w-3/5":ze.strength==="fair"?"bg-orange-300 w-2/5":"bg-red-300 w-1/5"}`})})]}),a.jsxs("div",{className:"border border-dashed border-white/10 p-3 space-y-2",children:[a.jsx("div",{className:"text-gray-400 uppercase tracking-wider",children:"Score"}),a.jsxs("p",{className:"text-white text-sm",children:[ze.score," / 5"]}),a.jsx("p",{className:"text-gray-500 text-xs",children:ze.score===5?"Excellent":ze.score===4?"Very Good":ze.score===3?"Good":ze.score===2?"Fair":"Weak"})]}),a.jsxs("div",{className:"border border-dashed border-white/10 p-3 space-y-2",children:[a.jsx("div",{className:"text-gray-400 uppercase tracking-wider",children:"Config Match"}),a.jsx("p",{className:`text-sm ${ze.meetsConfig?"text-green-400":"text-red-300"}`,children:ze.meetsConfig?"✓ Meets Requirements":"✗ Fails Requirements"}),a.jsxs("p",{className:"text-gray-500 text-xs",children:[ze.configRequirements.minLength," -"," ",ze.configRequirements.maxLength," chars"]})]})]}),a.jsxs("div",{className:"border border-dashed border-white/10 p-3",children:[a.jsx("div",{className:"text-xs uppercase font-mono text-gray-400 mb-3",children:"Checks"}),a.jsx("div",{className:"space-y-2",children:ze.checks.map((D,z)=>a.jsxs("div",{className:"flex items-center justify-between p-2 bg-black/40 border border-dashed border-white/10",children:[a.jsx("span",{className:"text-white font-mono text-xs",children:D.name}),a.jsxs("div",{className:"flex items-center space-x-2",children:[a.jsx("span",{className:`text-xs font-mono ${D.passed?"text-green-400":"text-red-300"}`,children:D.passed?"✓":"✗"}),a.jsx("span",{className:"text-xs text-gray-400 font-mono",children:D.message})]})]},z))})]})]})]})]})}),qe&&a.jsx("div",{className:"fixed inset-0 bg-black/80 flex items-center justify-center z-[60] overflow-hidden",children:a.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:[a.jsxs("div",{className:"flex items-center justify-between mb-6",children:[a.jsxs("div",{className:"flex items-center space-x-2",children:[a.jsx(Zr,{className:"w-5 h-5 text-white"}),a.jsx("h3",{className:"text-xl text-white font-light uppercase tracking-wider",children:"OAuth Credentials"})]}),a.jsx(H,{variant:"ghost",size:"sm",onClick:()=>lt(!1),className:"text-gray-400 hover:text-white rounded-none",children:a.jsx(gt,{className:"w-4 h-4"})})]}),a.jsxs("div",{className:"space-y-4",children:[a.jsxs("div",{children:[a.jsx(ie,{className:"text-xs uppercase font-mono text-gray-400 mb-2 block",children:"Select Provider"}),a.jsx("div",{className:"flex flex-wrap gap-3",children:["google","github"].map(D=>{const z=f===D;return a.jsx("button",{onClick:()=>m(D),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:D.charAt(0).toUpperCase()+D.slice(1)},D)})})]}),a.jsxs("div",{children:[a.jsx(ie,{className:"text-xs uppercase font-mono text-gray-400 mb-2 block",children:"Origin"}),a.jsx(be,{value:jt,onChange:D=>hn(D.target.value),placeholder:`http://${Qt}`,className:"bg-black border border-dashed border-white/20 text-white font-mono text-xs rounded-none"}),a.jsxs("p",{className:"text-[11px] text-gray-500 font-mono mt-1",children:["The default will be http://",Qt]})]}),a.jsxs("div",{className:"flex items-end justify-end space-x-2",children:[a.jsx(H,{variant:"outline",onClick:()=>{nn(null),hn(Qt)},className:"border border-dashed border-white/20 text-white hover:bg-white/10 rounded-none",children:"Clear"}),a.jsx(H,{onClick:xP,disabled:fn||!f||!jt.trim()&&!Qt,className:"rounded-none",children:fn?a.jsxs(a.Fragment,{children:[a.jsx(In,{className:"w-4 h-4 mr-2 animate-spin"}),"Fetching..."]}):"Fetch Credentials"})]}),On&&a.jsxs("div",{className:"space-y-4",children:[a.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[a.jsxs("div",{children:[a.jsx(ie,{className:"text-xs uppercase font-mono text-gray-400 mb-2 block",children:"Client ID"}),a.jsxs("div",{className:"relative",children:[a.jsx(be,{value:On.clientId,readOnly:!0,className:"bg-black border border-dashed border-white/20 text-white font-mono text-xs pr-10 rounded-none"}),a.jsx(H,{variant:"ghost",size:"sm",onClick:()=>ar(On.clientId),className:"absolute right-0 top-0 h-full px-3 text-gray-400 hover:text-white rounded-none",children:a.jsx(Ma,{className:"w-4 h-4"})})]})]}),a.jsxs("div",{children:[a.jsx(ie,{className:"text-xs uppercase font-mono text-gray-400 mb-2 block",children:"Client Secret"}),a.jsxs("div",{className:"relative",children:[a.jsx(be,{type:yr?"text":"password",value:On.clientSecret,readOnly:!0,className:"bg-black border border-dashed border-white/20 text-white font-mono text-xs pr-20 rounded-none"}),a.jsxs("div",{className:"absolute right-0 top-0 h-full flex items-center",children:[a.jsx(H,{variant:"ghost",size:"sm",onClick:()=>ai(!yr),className:"px-2 text-gray-400 hover:text-white rounded-none",children:yr?a.jsx(xf,{className:"w-4 h-4"}):a.jsx(Hs,{className:"w-4 h-4"})}),a.jsx(H,{variant:"ghost",size:"sm",onClick:()=>ar(On.clientSecret),className:"px-2 text-gray-400 hover:text-white rounded-none",children:a.jsx(Ma,{className:"w-4 h-4"})})]})]})]})]}),a.jsxs("div",{className:"flex items-center justify-between pt-2 border-t border-dashed border-white/10",children:[a.jsx("div",{className:"flex-1",children:Ot&&a.jsx("div",{className:"text-xs font-mono",children:Ot.success?a.jsxs("span",{className:"text-green-400 uppercase",children:["✓ ",Ot.message.toLowerCase(),a.jsxs("span",{className:"block normal-case text-gray-400",children:[a.jsx("span",{className:"text-gray-400 mr-1",children:">"})," ",Ot.path]})]}):a.jsxs("span",{className:"text-red-300",children:["✗ ",Ot.message]})})}),a.jsx(H,{onClick:bP,disabled:ri||vs,className:"rounded-none",children:vs?a.jsxs(a.Fragment,{children:[a.jsx(In,{className:"w-4 h-4 mr-2 animate-spin"}),"Checking..."]}):ri?a.jsxs(a.Fragment,{children:[a.jsx(In,{className:"w-4 h-4 mr-2 animate-spin"}),"Writing..."]}):a.jsxs(a.Fragment,{children:[a.jsx(Fh,{className:"w-4 h-4 mr-2"}),"Write to .env"]})})]})]})]})]})}),ho&&a.jsx("div",{className:"fixed inset-0 bg-black/80 flex items-center justify-center z-[60] overflow-hidden",children:a.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:[a.jsxs("div",{className:"flex items-center justify-between mb-6",children:[a.jsxs("div",{className:"flex items-center space-x-2",children:[a.jsx(To,{className:"w-5 h-5 text-white"}),a.jsx("h3",{className:"text-xl text-white font-light uppercase tracking-wider",children:"Secret Generator"})]}),a.jsx(H,{variant:"ghost",size:"sm",onClick:()=>ys(!1),className:"text-gray-400 hover:text-white rounded-none",children:a.jsx(gt,{className:"w-4 h-4"})})]}),a.jsxs("div",{className:"space-y-6",children:[a.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[a.jsxs("div",{children:[a.jsx(ie,{className:"text-xs uppercase font-mono text-gray-400 mb-2 block",children:"Length (bytes)"}),a.jsx(be,{type:"number",value:ba===0?"":ba,onChange:D=>{const z=D.target.value;if(z===""){Oa(0);return}const Q=parseInt(z,10);isNaN(Q)||Oa(Q)},onBlur:D=>{const z=parseInt(D.target.value,10);isNaN(z)||z<16?Oa(32):z>128?Oa(128):Oa(z)},min:"16",max:"128",className:"bg-black border border-dashed border-white/20 text-white font-mono text-xs rounded-none"}),a.jsx("p",{className:"text-[11px] text-gray-500 font-mono mt-1",children:"Recommended: 32 bytes (256 bits)"})]}),a.jsxs("div",{children:[a.jsx(ie,{className:"text-xs uppercase font-mono text-gray-400 mb-2 block",children:"Format"}),a.jsx("div",{className:"flex gap-3",children:[{id:"hex",label:"Hex"},{id:"base64",label:"Base64"}].map(D=>a.jsx("button",{onClick:()=>Br(D.id),className:`px-4 py-2 border rounded-none text-sm uppercase font-mono transition-colors flex-1 ${zr===D.id?"border-white/60 bg-white/10 text-white":"border-dashed border-white/20 text-gray-400 hover:border-white/40"}`,children:D.label},D.id))})]})]}),a.jsxs("div",{className:"flex justify-end space-x-2",children:[a.jsx(H,{variant:"outline",onClick:()=>{Ke(null),Oa(32),Br("hex")},className:"border border-dashed border-white/20 text-white hover:bg-white/10 rounded-none",children:"Clear"}),a.jsx(H,{onClick:pP,disabled:rn,className:"rounded-none",children:rn?a.jsxs(a.Fragment,{children:[a.jsx(In,{className:"w-4 h-4 mr-2 animate-spin"}),"Generating..."]}):"Generate Secret"})]}),Se&&a.jsxs("div",{className:"space-y-4",children:[a.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-4 text-xs font-mono",children:[a.jsxs("div",{className:"border border-dashed border-white/10 p-3 space-y-2",children:[a.jsx("div",{className:"text-gray-400 uppercase tracking-wider",children:"Length"}),a.jsxs("p",{className:"text-white text-sm",children:[Se.length," bytes"]})]}),a.jsxs("div",{className:"border border-dashed border-white/10 p-3 space-y-2",children:[a.jsx("div",{className:"text-gray-400 uppercase tracking-wider",children:"Entropy"}),a.jsxs("p",{className:"text-white text-sm",children:[Se.entropy," bits"]})]}),a.jsxs("div",{className:"border border-dashed border-white/10 p-3 space-y-2",children:[a.jsx("div",{className:"text-gray-400 uppercase tracking-wider",children:"Format"}),a.jsx("p",{className:"text-white text-sm uppercase",children:Se.format})]})]}),a.jsxs("div",{children:[a.jsx(ie,{className:"text-xs uppercase font-mono text-gray-400 mb-2 block",children:"Generated Secret"}),a.jsxs("div",{className:"relative",children:[a.jsx(be,{value:Se.secret,readOnly:!0,className:"bg-black border border-dashed border-white/20 text-white font-mono text-xs pr-10 rounded-none"}),a.jsx(H,{variant:"ghost",size:"sm",onClick:()=>ar(Se.secret),className:"absolute right-0 top-0 h-full px-3 text-gray-400 hover:text-white rounded-none",children:a.jsx(Ma,{className:"w-3 h-3"})})]})]}),a.jsxs("div",{children:[a.jsx(ie,{className:"text-xs uppercase font-mono text-gray-400 mb-2 block",children:"Environment Variable Format"}),a.jsxs("div",{className:"relative",children:[a.jsx(be,{value:Se.envFormat,readOnly:!0,className:"bg-black border border-dashed border-white/20 text-white font-mono text-xs pr-10 rounded-none"}),a.jsx(H,{variant:"ghost",size:"sm",onClick:()=>ar(Se.envFormat),className:"absolute right-0 top-0 h-full px-3 text-gray-400 hover:text-white rounded-none",children:a.jsx(Ma,{className:"w-3 h-3"})})]}),a.jsxs("p",{className:"text-[11px] text-gray-500 font-mono mt-2",children:["Add this to your ",a.jsx("code",{className:"text-gray-400",children:".env"})," file. Keep it secret and never commit it to version control."]})]}),a.jsx("div",{className:"flex justify-end space-x-2 pt-2",children:a.jsx(H,{variant:"outline",onClick:mP,disabled:fe||De,className:"border border-dashed border-white/20 text-white hover:bg-white/10 rounded-none",children:fe||De?a.jsxs(a.Fragment,{children:[a.jsx(In,{className:"w-4 h-4 mr-2 animate-spin"}),De?"Writing...":"Checking..."]}):"Write to .env"})}),a.jsx("div",{className:"border border-dashed border-white/20 bg-black text-gray-300 text-xs font-mono p-3 rounded-none",children:a.jsxs("div",{className:"flex items-start space-x-2",children:[a.jsx(El,{className:"w-4 h-4 mt-0.5 flex-shrink-0 text-gray-400"}),a.jsxs("div",{children:[a.jsx("div",{className:"uppercase font-mono mb-2 text-gray-400 tracking-wider",children:"Security Best Practices"}),a.jsxs("ul",{className:"list-disc list-inside space-y-1 text-[11px] text-gray-300",children:[a.jsx("li",{children:"Use a minimum of 32 bytes (256 bits) for production"}),a.jsx("li",{children:"Store secrets in environment variables, never in code"}),a.jsx("li",{children:"Use different secrets for development and production"}),a.jsx("li",{children:"Rotate secrets periodically for enhanced security"})]})]})]})})]})]})]})}),Fr&&bs&&a.jsx("div",{className:"fixed inset-0 bg-black/80 flex items-center justify-center z-[70] overflow-hidden",children:a.jsxs("div",{className:"bg-black border border-dashed border-white/20 rounded-none p-6 w-full max-w-2xl",children:[a.jsxs("div",{className:"flex items-center justify-between mb-6",children:[a.jsxs("div",{className:"flex items-center space-x-2",children:[a.jsx(El,{className:"w-5 h-5 text-yellow-400"}),a.jsx("h3",{className:"text-xl text-white font-light uppercase tracking-wider",children:"Overwrite Existing Credentials?"})]}),a.jsx(H,{variant:"ghost",size:"sm",onClick:()=>{si(!1),wr(null),tr(!1)},className:"text-gray-400 hover:text-white rounded-none",children:a.jsx(gt,{className:"w-4 h-4"})})]}),a.jsxs("div",{className:"space-y-4",children:[a.jsxs("div",{className:"border border-dashed border-white/20 p-4",children:[a.jsxs("p",{className:"text-sm border-b border-dashed border-white/20 pb-5 text-gray-300 font-mono mb-3",children:["The following"," ",a.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"," ",a.jsx("span",{className:"text-gray-400 normal-case",children:bs.path}),":"]}),a.jsx("div",{className:"space-y-2 pt-2",children:Object.entries(bs.credentials).map(([D,z])=>a.jsxs("div",{className:"flex items-center justify-between text-xs font-mono",children:[a.jsx("span",{className:"text-gray-400 uppercase",children:D}),a.jsx("span",{className:"text-gray-500",children:z.length>20?`${z.substring(0,20)}...`:z})]},D))})]}),a.jsxs("div",{className:"flex items-center justify-end space-x-3 pt-4 border-t border-dashed border-white/10",children:[a.jsx(H,{variant:"outline",onClick:()=>{si(!1),wr(null),tr(!1)},className:"border border-dashed border-white/20 text-white hover:bg-white/10 rounded-none",children:"No, Cancel"}),a.jsx(H,{variant:"outline",onClick:()=>Pm("append"),disabled:ri,className:"border border-dashed border-white/20 text-white hover:bg-white/10 rounded-none",children:"Append"}),a.jsx(H,{onClick:()=>Pm("override"),disabled:ri,className:"rounded-none",children:ri?a.jsxs(a.Fragment,{children:[a.jsx(In,{className:"w-4 h-4 mr-2 animate-spin"}),"Writing..."]}):"Yes, Overwrite"})]})]})]})}),ol&&Ne&&a.jsx("div",{className:"fixed inset-0 bg-black/80 flex items-center justify-center z-[70] overflow-hidden",children:a.jsxs("div",{className:"bg-black border border-dashed border-white/20 rounded-none p-6 w-full max-w-2xl",children:[a.jsxs("div",{className:"flex items-center justify-between mb-6",children:[a.jsxs("div",{className:"flex items-center space-x-2",children:[a.jsx(El,{className:"w-5 h-5 text-yellow-400"}),a.jsx("h3",{className:"text-xl text-white font-light uppercase tracking-wider",children:"Overwrite Existing Secret?"})]}),a.jsx(H,{variant:"ghost",size:"sm",onClick:()=>{ye(!1),_e(null),Te(!1)},className:"text-gray-400 hover:text-white rounded-none",children:a.jsx(gt,{className:"w-4 h-4"})})]}),a.jsxs("div",{className:"space-y-4",children:[a.jsxs("div",{className:"border border-dashed border-white/20 p-4",children:[a.jsxs("p",{className:"text-sm border-b border-dashed border-white/20 pb-5 text-gray-300 font-mono mb-3",children:[a.jsx("span",{className:"text-white uppercase",children:"BETTER_AUTH_SECRET"})," already exists in"," ",a.jsx("span",{className:"text-gray-400 normal-case",children:Ne.path}),":"]}),a.jsx("div",{className:"space-y-2 pt-2",children:a.jsxs("div",{className:"flex items-center justify-between text-xs font-mono",children:[a.jsx("span",{className:"text-gray-400 uppercase",children:"BETTER_AUTH_SECRET"}),a.jsx("span",{className:"text-gray-500",children:Ne.secret&&Ne.secret.length>20?`${Ne.secret.substring(0,20)}...`:Ne.secret||"***"})]})})]}),a.jsxs("div",{className:"flex items-center justify-end space-x-3 pt-4 border-t border-dashed border-white/10",children:[a.jsx(H,{variant:"outline",onClick:()=>{ye(!1),_e(null),Te(!1)},className:"border border-dashed border-white/20 text-white hover:bg-white/10 rounded-none",children:"No, Cancel"}),a.jsx(H,{onClick:()=>LE("override"),disabled:De,className:"rounded-none",children:De?a.jsxs(a.Fragment,{children:[a.jsx(In,{className:"w-4 h-4 mr-2 animate-spin"}),"Writing..."]}):"Yes, Overwrite"})]})]})]})})]})}function upe(){const{userId:e}=oS(),t=Aa(),[n,r]=p.useState(null),[s,i]=p.useState([]),[o,l]=p.useState([]),[c,u]=p.useState([]),[h,d]=p.useState([]),[f,m]=p.useState([]),[y,b]=p.useState(!0),[w,x]=p.useState("details"),[v,g]=p.useState(!1),[N,S]=p.useState(!1),[E,j]=p.useState(!1),[_,L]=p.useState(!1),[F,U]=p.useState(!1),[R,G]=p.useState("random"),[O,M]=p.useState(!1),[C,k]=p.useState(!1),[I,P]=p.useState(!1),[B,T]=p.useState(""),[A,$]=p.useState(),[Y,X]=p.useState(!1),[ee,J]=p.useState(""),[K,re]=p.useState([]),[se,ce]=p.useState(!1),[ge,ve]=p.useState(!1),[Be,Ye]=p.useState(!1),[Pe,Ge]=p.useState(!1),[ht,st]=p.useState(!1),[de,$e]=p.useState(!1),[Me,Ae]=p.useState({}),Qe=p.useRef({}),[mt,ct]=p.useState({}),[Ft,Vt]=p.useState({}),[Yt,zt]=p.useState({}),[un,Mt]=p.useState({}),[Tn,Rn]=p.useState({}),[oe,je]=p.useState(null),[et,Xe]=p.useState(null),Oe=p.useCallback(async()=>{try{const ue=await(await fetch("/api/admin/status")).json();X(ue.enabled)}catch{X(!1)}},[]),He=p.useCallback(async W=>{try{const ue=await fetch("/api/geo/resolve",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({ipAddress:W})});if(ue.ok){const pe=await ue.json();if(pe.success&&pe.location)return pe.location}return null}catch{return null}},[]),ke=p.useCallback(async W=>{const ue=W.filter(qe=>!Qe.current[qe.id]);if(ue.length===0)return;const pe=await Promise.all(ue.map(async qe=>{const lt=await He(qe.ipAddress);return lt?{sessionId:qe.id,location:lt}:null})),Le={};pe.forEach(qe=>{qe&&(Le[qe.sessionId]=qe.location)}),Object.keys(Le).length>0&&(Qe.current={...Qe.current,...Le},Ae(Qe.current))},[He]),tt=W=>{if(!W)return"🌍";const ue=W.toUpperCase().split("").map(pe=>127397+pe.charCodeAt(0));return String.fromCodePoint(...ue)},kt=W=>W?W.replace(/[_-]/g," ").replace(/\b\w/g,ue=>ue.toUpperCase()):"Unknown Provider",we=W=>{if(!W)return"Unknown";const ue=new Date(W);return Number.isNaN(ue.getTime())?"Unknown":ue.toLocaleString("en-US",{year:"numeric",month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"})},ut=p.useCallback(async()=>{try{const W=await fetch(`/api/users/${e}`);if(W.ok){const ue=await W.json();r(ue.user)}else V.error("Failed to fetch user details"),t("/users")}catch{V.error("Failed to fetch user details"),t("/users")}finally{b(!1)}},[e,t]),Et=p.useCallback(async()=>{try{const[W,ue,pe]=await Promise.all([fetch(`/api/users/${e}/organizations`),fetch(`/api/users/${e}/teams`),fetch(`/api/users/${e}/sessions`)]);if(W.ok){const Le=await W.json();i(Le.memberships||[])}if(ue.ok){const Le=await ue.json();l(Le.memberships||[])}if(pe.ok){const qe=(await pe.json()).sessions||[];u(qe),ke(qe)}}catch{}},[e,ke]),wt=p.useCallback(async()=>{try{const W=await fetch(`/api/users/${e}/accounts`);if(W.ok){const ue=await W.json();d(ue.accounts||[])}}catch{}},[e]),Zt=p.useCallback(async()=>{try{const W=await fetch(`/api/users/${e}/invitations`);if(W.ok){const ue=await W.json();m(ue.invitations||[])}}catch{}},[e]),vt=(W,ue=800,pe=800,Le=.8)=>new Promise((qe,lt)=>{const jt=new FileReader;jt.onload=hn=>{var Ra;const Qt=new Image;Qt.onload=()=>{const On=document.createElement("canvas");let nn=Qt.width,fn=Qt.height;nn>fn?nn>ue&&(fn=fn*ue/nn,nn=ue):fn>pe&&(nn=nn*pe/fn,fn=pe),On.width=nn,On.height=fn;const vr=On.getContext("2d");if(!vr){lt(new Error("Failed to get canvas context"));return}vr.drawImage(Qt,0,0,nn,fn),On.toBlob(yr=>{if(!yr){lt(new Error("Failed to compress image"));return}const ai=new File([yr],W.name,{type:W.type,lastModified:Date.now()});qe(ai)},W.type,Le)},Qt.onerror=lt,Qt.src=(Ra=hn.target)==null?void 0:Ra.result},jt.onerror=lt,jt.readAsDataURL(W)}),tn=async W=>{var pe;const ue=(pe=W.target.files)==null?void 0:pe[0];if(ue){if(ue.size>5*1024*1024){V.error("Image size must be less than 5MB");return}if(!ue.type.startsWith("image/")){V.error("Please select a valid image file");return}try{const Le=await vt(ue);Xe(Le);const qe=new FileReader;qe.onloadend=()=>{je(qe.result)},qe.readAsDataURL(Le)}catch(Le){V.error("Failed to process image"),console.error("Image compression error:",Le)}}},ne=async()=>{var Le,qe;if(!n)return;const W=(Le=document.getElementById("edit-name"))==null?void 0:Le.value,ue=(qe=document.getElementById("edit-email"))==null?void 0:qe.value;if(!W||!ue){V.error("Please fill in all fields");return}ve(!0);const pe=V.loading("Updating user...");try{const lt={name:W,email:ue,role:ee||null};if(et){const Qt=new FileReader,Ra=await new Promise((On,nn)=>{Qt.onloadend=()=>{const fn=Qt.result;fn&&fn.startsWith("data:image/")?On(fn):nn(new Error("Invalid image data"))},Qt.onerror=nn,Qt.readAsDataURL(et)});lt.image=Ra}else oe===null&&n.image&&(lt.image=null);const hn=await(await fetch(`/api/users/${e}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(lt)})).json();hn.success?(r({...n,name:W,email:ue,role:ee||void 0,image:lt.image!==void 0?lt.image:n.image}),g(!1),J(""),je(null),Xe(null),V.success("User updated successfully!",{id:pe})):V.error(`Error updating user: ${hn.error||"Unknown error"}`,{id:pe})}catch{V.error("Error updating user",{id:pe})}finally{ve(!1)}},Ee=async()=>{if(!n)return;Ye(!0);const W=V.loading("Deleting user...");try{const pe=await(await fetch(`/api/users/${e}`,{method:"DELETE",headers:{"Content-Type":"application/json"}})).json();pe.success?(V.success("User deleted successfully!",{id:W}),t("/users")):V.error(`Error deleting user: ${pe.error||"Unknown error"}`,{id:W})}catch{V.error("Error deleting user",{id:W})}finally{Ye(!1)}},Ue=async()=>{if(!n)return;if(!Y){V.error("Admin plugin is not enabled. Please enable the admin plugin in your Better Auth configuration to use ban functionality.");return}Ge(!0);const W=V.loading("Banning user...");try{const ue=await fetch("/api/admin/ban-user",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({userId:e,banReason:B||"No reason provided",banExpiresIn:A})}),pe=await ue.json();ue.ok?(V.success("User banned successfully!",{id:W}),S(!1),T(""),$(void 0),ut()):ue.status===403?V.error("You do not have permission to ban users. Admin role required.",{id:W}):pe.adminPluginEnabled&&pe.instructions?V.error(`${pe.error}`,{id:W,duration:6e3,description:`Use: ${pe.instructions.example}`}):V.error(`Error banning user: ${pe.error||pe.message||"Unknown error"}`,{id:W})}catch{V.error("Error banning user",{id:W})}finally{Ge(!1)}},Ve=async()=>{if(!n)return;if(!Y){V.error("Admin plugin is not enabled. Please enable the admin plugin in your Better Auth configuration to use unban functionality.");return}st(!0);const W=V.loading("Unbanning user...");try{const ue=await fetch("/api/admin/unban-user",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({userId:e})}),pe=await ue.json();ue.ok?(V.success("User unbanned successfully!",{id:W}),j(!1),ut()):ue.status===403?V.error("You do not have permission to unban users. Admin role required.",{id:W}):pe.adminPluginEnabled&&pe.instructions?V.error(`${pe.error}`,{id:W,duration:6e3,description:`Use: ${pe.instructions.example}`}):V.error(`Error unbanning user: ${pe.error||pe.message||"Unknown error"}`,{id:W})}catch{V.error("Error unbanning user",{id:W})}finally{st(!1)}},at=async W=>{const ue=V.loading("Removing user from organization...");try{const Le=await(await fetch(`/api/organizations/members/${W}`,{method:"DELETE"})).json();Le.success?(i(qe=>qe.filter(lt=>lt.id!==W)),Et(),V.success("User removed from organization!",{id:ue})):V.error(`Error removing user: ${Le.error||"Unknown error"}`,{id:ue})}catch{V.error("Error removing user from organization",{id:ue})}},nt=async W=>{const ue=V.loading("Removing user from team...");try{const Le=await(await fetch(`/api/teams/members/${W}`,{method:"DELETE"})).json();Le.success?(l(qe=>qe.filter(lt=>lt.id!==W)),Et(),V.success("User removed from team!",{id:ue})):V.error(`Error removing user: ${Le.error||"Unknown error"}`,{id:ue})}catch{V.error("Error removing user from team",{id:ue})}},Z=async W=>{Rn(pe=>({...pe,[W]:!0}));const ue=V.loading("Deleting session...");try{const Le=await(await fetch(`/api/sessions/${W}`,{method:"DELETE"})).json();Le.success?(u(qe=>qe.filter(lt=>lt.id!==W)),V.success("Session deleted successfully!",{id:ue})):V.error(`Error deleting session: ${Le.error||"Unknown error"}`,{id:ue})}catch{V.error("Error deleting session",{id:ue})}finally{Rn(pe=>{const{[W]:Le,...qe}=pe;return qe})}},xe=async W=>{if(!e)return;Mt(pe=>({...pe,[W]:!0}));const ue=V.loading("Unlinking account...");try{const pe=await fetch(`/api/users/${e}/accounts/${W}`,{method:"DELETE"}),Le=await pe.json();pe.ok&&Le.success?(d(qe=>qe.filter(lt=>lt.id!==W)),await wt(),V.success("Account unlinked successfully",{id:ue})):V.error(Le.error||"Failed to unlink account",{id:ue})}catch{V.error("Failed to unlink account",{id:ue})}finally{Mt(pe=>{const{[W]:Le,...qe}=pe;return qe})}},Re=async W=>{if(!e)return;ct(pe=>({...pe,[W]:!0}));const ue=V.loading("Accepting invitation...");try{const pe=await fetch(`/api/invitations/${W}/accept`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({userId:e})}),Le=await pe.json();pe.ok&&Le.success?(await Zt(),await Et(),V.success("Invitation accepted successfully",{id:ue})):V.error(Le.error||"Failed to accept invitation",{id:ue})}catch{V.error("Failed to accept invitation",{id:ue})}finally{ct(pe=>{const{[W]:Le,...qe}=pe;return qe})}},dt=async W=>{Vt(pe=>({...pe,[W]:!0}));const ue=V.loading("Rejecting invitation...");try{const pe=await fetch(`/api/invitations/${W}/reject`,{method:"POST",headers:{"Content-Type":"application/json"}}),Le=await pe.json();pe.ok&&Le.success?(await Zt(),V.success("Invitation rejected successfully",{id:ue})):V.error(Le.error||"Failed to reject invitation",{id:ue})}catch{V.error("Failed to reject invitation",{id:ue})}finally{Vt(pe=>{const{[W]:Le,...qe}=pe;return qe})}},ft=async W=>{zt(pe=>({...pe,[W]:!0}));const ue=V.loading("Cancelling invitation...");try{const pe=await fetch(`/api/invitations/${W}`,{method:"DELETE"}),Le=await pe.json();pe.ok&&Le.success?(await Zt(),V.success("Invitation cancelled successfully",{id:ue})):V.error(Le.error||"Failed to cancel invitation",{id:ue})}catch{V.error("Failed to cancel invitation",{id:ue})}finally{zt(pe=>{const{[W]:Le,...qe}=pe;return qe})}};p.useEffect(()=>{e&&(ut(),Et(),wt(),Zt(),Oe())},[e,Oe,ut,Et,wt,Zt]);const ze=async(W=3)=>{if(e){re([]),ce(!0),re([{id:"start",type:"info",message:`Starting session seeding process for ${W} sessions...`,timestamp:new Date}]);try{const pe=await(await fetch(`/api/users/${e}/seed-sessions`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({count:W})})).json();if(pe.success){const Le=pe.results.map((lt,jt)=>lt.success?{id:`session-${jt}`,type:"progress",message:`Creating session ${jt+1}: ${lt.session.token.substring(0,20)}... from ${lt.session.ipAddress}`,timestamp:new Date,status:"completed"}:{id:`session-${jt}`,type:"error",message:`Failed to create session ${jt+1}: ${lt.error}`,timestamp:new Date});re(lt=>[...lt,...Le]);const qe=pe.results.filter(lt=>lt.success).length;re(lt=>[...lt,{id:"complete",type:"success",message:`✅ Session seeding completed! Created ${qe}/${W} sessions successfully`,timestamp:new Date}]),Et()}else re(Le=>[...Le,{id:"error",type:"error",message:`❌ Session seeding failed: ${pe.error||"Unknown error"}`,timestamp:new Date}])}catch(ue){re(pe=>[...pe,{id:"error",type:"error",message:`❌ Network error: ${ue}`,timestamp:new Date}])}finally{ce(!1)}}},Rt=async(W=3,ue="random")=>{if(e){re([]),ce(!0),re([{id:"start",type:"info",message:`Starting account seeding process for ${W} accounts...`,timestamp:new Date}]);try{const Le=await(await fetch(`/api/users/${e}/seed-accounts`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({count:W,providerId:ue})})).json();if(Le.success){const qe=Le.results.map((jt,hn)=>{var Qt;return jt.success?{id:`account-${hn}`,type:"progress",message:`Creating account ${hn+1}: ${jt.account.providerId||jt.account.provider} (${((Qt=jt.account.accountId)==null?void 0:Qt.substring(0,20))||jt.account.id.substring(0,20)}...)`,timestamp:new Date,status:"completed"}:{id:`account-${hn}`,type:"error",message:`Failed to create account ${hn+1}: ${jt.error}`,timestamp:new Date}});re(jt=>[...jt,...qe]);const lt=Le.results.filter(jt=>jt.success).length;re(jt=>[...jt,{id:"complete",type:"success",message:`✅ Account seeding completed! Created ${lt}/${W} accounts successfully`,timestamp:new Date}]),wt()}else re(qe=>[...qe,{id:"error",type:"error",message:`❌ Account seeding failed: ${Le.error||"Unknown error"}`,timestamp:new Date}])}catch(pe){re(Le=>[...Le,{id:"error",type:"error",message:`❌ Network error: ${pe}`,timestamp:new Date}])}finally{ce(!1)}}};return y?a.jsx("div",{className:"min-h-screen bg-black flex items-center justify-center",children:a.jsx("div",{className:"text-white text-lg",children:"Loading user details..."})}):n?a.jsxs("div",{className:"space-y-6 p-6 bg-black w-full",children:[a.jsxs("div",{className:"w-full flex flex-col",children:[a.jsx("span",{className:"mb-4 ml-0 flex justify-start items-start text-left border-none text-white",children:a.jsxs("span",{className:"font-light",children:[a.jsxs("span",{onClick:()=>t("/users"),className:"uppercase cursor-pointer text-white/80 font-mono text-sm",children:["users /"," "]}),a.jsx("span",{className:"text-white font-mono text-sm",children:n.id})]})}),a.jsx("div",{className:"mb-8 mt-4",children:a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsxs("div",{className:"flex items-center space-x-4",children:[a.jsx("div",{className:"w-16 h-16 bg-gray-800 border border-dashed border-white/20 flex items-center justify-center overflow-hidden",children:ha(n==null?void 0:n.image)?a.jsx("img",{src:ha(n==null?void 0:n.image),alt:n==null?void 0:n.name,className:"w-16 h-16 object-cover",onError:W=>{W.target.style.display="none"}}):a.jsx(Vr,{className:"w-8 h-8 text-white"})}),a.jsxs("div",{children:[a.jsxs("h1",{className:"text-3xl font-light text-white inline-flex items-center",children:[n.name,a.jsx(Ct,{id:n.id,nonSliced:!0,variant:"subscript"}),n.role&&a.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&&a.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&&a.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:[a.jsx("span",{className:"text-gray-400 font-mono text-xs uppercase mr-1",children:"Banned Reason:"}),n.banReason,a.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"})]})]})]}),a.jsx("p",{className:"text-gray-400 font-mono text-sm",children:n.email})]})]}),a.jsx("div",{className:"flex items-center space-x-2",children:a.jsxs("div",{className:"relative",children:[a.jsx(H,{variant:"ghost",size:"sm",className:"text-gray-400 hover:text-white rounded-none",onClick:W=>{W.stopPropagation(),P(!I)},children:a.jsx(f3,{className:"w-4 h-4"})}),I&&a.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:W=>W.stopPropagation(),children:[a.jsxs("button",{className:"w-full px-4 py-2 text-left border-b border-dashed border-white/20 text-[11px] text-white/70 hover:bg-white/10 flex items-center justify-between font-mono uppercase tracking-tight group",onClick:W=>{W.stopPropagation(),P(!1),je((n==null?void 0:n.image)||null),Xe(null),g(!0),J(n.role||"")},children:[a.jsx("span",{children:"Edit User"}),a.jsx(Xs,{className:"w-3 h-3 text-white/10 group-hover:text-white/70 transition-colors"})]}),h.some(W=>W.providerId==="credential")?a.jsxs("button",{className:"w-full px-4 py-2 text-left border-b border-dashed border-white/20 text-[11px] text-white/70 hover:bg-white/10 flex items-center justify-between font-mono uppercase tracking-tight group",onClick:W=>{W.stopPropagation(),P(!1),M(!0)},children:[a.jsx("span",{children:"Update Password"}),a.jsx(ia,{className:"w-3 h-3 text-white/10 group-hover:text-white/70 transition-colors"})]}):a.jsxs("button",{className:"w-full px-4 py-2 text-left border-b border-dashed border-white/20 text-[11px] text-white/30 cursor-not-allowed flex items-center justify-between font-mono uppercase tracking-tight opacity-50",disabled:!0,title:"Password update is only available for users with credential accounts",children:[a.jsx("span",{children:"Update Password"}),a.jsx(ia,{className:"w-3 h-3 text-white/10"})]}),Y&&(n.banned?a.jsxs("button",{className:"w-full px-4 py-2 text-left border-b border-dashed border-white/20 text-[11px] text-green-400 hover:bg-white/10 flex items-center justify-between font-mono uppercase tracking-tight group",onClick:W=>{W.stopPropagation(),P(!1),j(!0)},children:[a.jsx("span",{children:"Unban User"}),a.jsx(rx,{className:"w-3 h-3 text-green-400/10 group-hover:text-green-400/70 transition-colors"})]}):a.jsxs("button",{className:"w-full px-4 py-2 text-left border-b border-dashed border-white/20 text-[11px] text-yellow-400 hover:bg-white/10 flex items-center justify-between font-mono uppercase tracking-tight group",onClick:W=>{W.stopPropagation(),P(!1),S(!0)},children:[a.jsx("span",{children:"Ban User"}),a.jsx(rx,{className:"w-3 h-3 text-yellow-400/10 group-hover:text-yellow-400/70 transition-colors"})]})),a.jsxs("div",{className:"flex flex-col items-center justify-center",children:[a.jsx("hr",{className:"w-[calc(100%)] border-white/10 h-px"}),a.jsx("div",{className:"relative z-20 h-2 w-[calc(100%)] mx-auto -translate-x-1/2 left-1/2 bg-[repeating-linear-gradient(-45deg,#ffffff,#ffffff_1px,transparent_1px,transparent_6px)] opacity-[7%]"}),a.jsx("hr",{className:"w-[calc(100%)] border-white/10 h-px"})]}),a.jsxs("button",{className:"w-full px-4 py-2 text-left text-[11px] text-red-400 hover:bg-white/10 flex items-center justify-between font-mono uppercase tracking-tight group",onClick:W=>{W.stopPropagation(),P(!1),k(!0)},children:[a.jsx("span",{children:"Delete User"}),a.jsx(eh,{className:"w-3 h-3 text-red-400/10 group-hover:text-red-400/70 transition-colors"})]})]})]})})]})}),a.jsxs("div",{className:"border border-dashed border-white/20 rounded-none",children:[a.jsx("div",{className:"border-b border-dashed border-white/20",children:a.jsx("nav",{className:"flex space-x-8 px-6",children:[{id:"details",name:"Details",icon:Vr},{id:"organizations",name:"Organizations",icon:na,count:s.length},{id:"teams",name:"Teams",icon:Ht,count:o.length},{id:"accounts",name:"Accounts",icon:Gl,count:h.length},{id:"sessions",name:"Sessions",icon:_N,count:c.length},{id:"invitations",name:"Invitations",icon:Cr,count:f.length}].map(W=>a.jsxs("button",{onClick:()=>x(W.id),className:`flex items-center space-x-2 py-4 px-2 border-b-2 font-medium text-sm ${w===W.id?"border-white text-white":"border-transparent text-gray-400 hover:text-white hover:border-white/50"}`,children:[a.jsx(W.icon,{className:"w-4 h-4 text-white/90"}),a.jsxs("span",{className:"inline-flex items-start",children:[a.jsx("span",{className:"font-mono uppercase text-xs font-normal",children:W.name}),W.count!==void 0&&a.jsx("sup",{className:"text-xs text-gray-500 ml-1 inline-flex items-baseline",children:a.jsx(Zn,{value:W.count,className:"text-white/80 font-mono text-xs",prefix:a.jsx("span",{className:"mr-0.5 text-gray-500",children:"["}),suffix:a.jsx("span",{className:"ml-0.5 text-gray-500",children:"]"}),format:{notation:"standard",maximumFractionDigits:0}})})]})]},W.id))})}),a.jsxs("div",{className:"p-6",children:[w==="details"&&a.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-6",children:[a.jsxs("div",{className:"overflow-x-hidden bg-white/[3%] border border-white/10 p-6 rounded-none",children:[a.jsx("h3",{className:"text-sm uppercase font-mono text-gray-400 mb-4 tracking-wider",children:"BASIC INFORMATION"}),a.jsx("hr",{className:"border-white/10 -mx-10 border-dashed my-4"}),a.jsxs("div",{className:"space-y-4",children:[a.jsxs("div",{className:"flex items-start space-x-3",children:[a.jsx(Vr,{className:"w-4 h-4 text-gray-400 mt-1"}),a.jsxs("div",{className:"flex-1",children:[a.jsx("div",{className:"text-xs uppercase font-mono text-gray-500 mb-1",children:"Name"}),a.jsx("div",{className:"text-white font-sans text-sm",children:n.name})]})]}),a.jsxs("div",{className:"flex items-start space-x-3",children:[a.jsx(Cr,{className:"w-4 h-4 text-gray-400 mt-1"}),a.jsxs("div",{className:"flex-1",children:[a.jsx("div",{className:"text-xs uppercase font-mono text-gray-500 mb-1",children:"Email"}),a.jsx("div",{className:"text-white font-mono text-sm",children:n.email})]})]}),n.username&&a.jsxs("div",{className:"flex items-start space-x-3",children:[a.jsx(jae,{className:"w-4 h-4 text-gray-400 mt-1"}),a.jsxs("div",{className:"flex-1",children:[a.jsx("div",{className:"text-xs uppercase font-mono text-gray-500 mb-1",children:"Username"}),a.jsx("div",{className:"text-white font-mono text-sm",children:n.username})]})]}),n.phoneNumber&&a.jsxs("div",{className:"flex items-start space-x-3",children:[a.jsx(Eae,{className:"w-4 h-4 text-gray-400 mt-1"}),a.jsxs("div",{className:"flex-1",children:[a.jsx("div",{className:"text-xs uppercase font-mono text-gray-500 mb-1",children:"Phone"}),a.jsx("div",{className:"text-white font-mono text-sm",children:"+251 91 234 5678"})]})]}),a.jsxs("div",{className:"flex items-start space-x-3",children:[a.jsx(Er,{className:"w-4 h-4 text-gray-400 mt-1"}),a.jsxs("div",{className:"flex-1",children:[a.jsx("div",{className:"text-xs uppercase font-mono text-gray-500 mb-1",children:"Member Since"}),a.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"})})]})]})]})]}),a.jsxs("div",{className:"overflow-x-hidden bg-white/[3%] border border-white/10 p-6 rounded-none",children:[a.jsx("h3",{className:"text-sm uppercase font-mono text-gray-400 mb-4 tracking-wider",children:"SECURITY"}),a.jsx("hr",{className:"border-white/10 -mx-10 border-dashed my-4"}),a.jsxs("div",{className:"space-y-4",children:[a.jsxs("div",{className:"flex items-center justify-between p-3 bg-black/30 border border-white/10 rounded-none",children:[a.jsxs("div",{className:"flex items-center space-x-3",children:[a.jsx(Cr,{className:"w-4 h-4 text-gray-400"}),a.jsx("div",{children:a.jsx("div",{className:"text-xs uppercase font-mono text-gray-500",children:"Email Verification"})})]}),a.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"})]}),a.jsxs("div",{className:"flex items-center justify-between p-3 bg-black/30 border border-white/10 rounded-none",children:[a.jsxs("div",{className:"flex items-center space-x-3",children:[a.jsx(Fs,{className:"w-4 h-4 text-gray-400"}),a.jsx("div",{children:a.jsx("div",{className:"text-xs uppercase font-mono text-gray-500",children:"Two-Factor Authentication"})})]}),a.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"})]})]})]})]}),w==="organizations"&&a.jsxs("div",{className:"space-y-4",children:[a.jsx("div",{className:"flex items-center justify-between mb-4",children:a.jsxs("div",{children:[a.jsxs("h3",{className:"text-lg relative text-white font-light inline-flex items-start",children:["Organizations",a.jsxs("sup",{className:"text-xs text-gray-500 ml-1 mt-0",children:[a.jsx("span",{className:"mr-1",children:"["}),a.jsx("span",{className:"text-white font-mono text-xs",children:s.length}),a.jsx("span",{className:"ml-1",children:"]"})]})]}),a.jsx("p",{className:"text-gray-400 font-light font-mono text-xs uppercase mt-1",children:"Organizations this user belongs to"})]})}),s.length===0?a.jsxs("div",{className:"text-center py-12 border border-dashed border-white/10 rounded-none",children:[a.jsx(na,{className:"w-12 h-12 text-gray-400 mx-auto mb-4"}),a.jsx("p",{className:"text-gray-400 font-mono text-xs uppercase",children:"No organizations found"})]}):a.jsx("div",{className:"grid gap-4",children:s.map(W=>a.jsxs("div",{className:"border border-dashed border-white/10 rounded-none p-4 hover:bg-white/5 transition-colors",children:[a.jsxs("div",{className:"flex items-start justify-between mb-3",children:[a.jsxs("div",{className:"flex items-center space-x-4 flex-1",children:[a.jsx("div",{className:"w-12 h-12 bg-black/80 border border-dashed border-white/20 flex items-center justify-center rounded-none",children:W.organization.image?a.jsx("img",{src:W.organization.image,alt:W.organization.name,className:"w-12 h-12 object-cover"}):a.jsx(na,{className:"w-6 h-6 text-white"})}),a.jsxs("div",{className:"flex-1",children:[a.jsxs("h3",{className:"text-white font-light inline-flex items-start",children:[W.organization.name,a.jsxs("sup",{className:"text-xs text-gray-500 ml-2 mt-0.5",children:[a.jsx("span",{className:"mr-1",children:"["}),a.jsx("span",{className:"text-white/80 font-mono text-xs",children:W.organization.slug}),a.jsx("span",{className:"ml-1",children:"]"})]})]}),a.jsxs("p",{className:"text-gray-400 text-sm font-sans mt-1 flex items-center gap-2",children:[a.jsxs("span",{children:["in ",W.organization.slug]}),a.jsx("button",{onClick:ue=>{ue.stopPropagation(),t(`/organizations/${W.organization.id}`)},className:"text-white/60 hover:text-white transition-colors",title:"View organization details",children:a.jsx(Ii,{className:"w-3.5 h-3.5"})})]})]})]}),a.jsx("div",{className:"flex flex-col items-end space-y-2",children:a.jsxs("div",{className:"flex items-center space-x-2",children:[a.jsxs("span",{className:"text-gray-500 font-mono text-xs uppercase",children:["Joined:"," "]}),a.jsxs("span",{className:"text-white font-mono text-xs",children:[new Date(W.joinedAt).toLocaleDateString("en-US",{year:"numeric",month:"short",day:"numeric"}),","," ",new Date(W.joinedAt).toLocaleTimeString("en-US",{hour:"numeric",minute:"2-digit",hour12:!0})]})]})})]}),a.jsx("div",{className:"flex items-center justify-end",children:a.jsxs(H,{variant:"outline",size:"sm",onClick:()=>at(W.id),className:"border border-dashed border-red-400/20 text-red-400 hover:bg-red-400/10 rounded-none",children:[a.jsx(ax,{className:"w-4 h-4 mr-1"}),"Remove"]})})]},W.id))})]}),w==="teams"&&a.jsxs("div",{className:"space-y-4",children:[a.jsx("div",{className:"flex items-center justify-between mb-4",children:a.jsxs("div",{children:[a.jsxs("h3",{className:"text-lg relative text-white font-light inline-flex items-start",children:["Teams",a.jsxs("sup",{className:"text-xs text-gray-500 ml-1 mt-0",children:[a.jsx("span",{className:"mr-1",children:"["}),a.jsx("span",{className:"text-white font-mono text-xs",children:o.length}),a.jsx("span",{className:"ml-1",children:"]"})]})]}),a.jsx("p",{className:"text-gray-400 font-light font-mono text-xs uppercase mt-1",children:"Teams this user belongs to"})]})}),o.length===0?a.jsxs("div",{className:"text-center py-12 border border-dashed border-white/10 rounded-none",children:[a.jsx(Ht,{className:"w-12 h-12 text-gray-400 mx-auto mb-4"}),a.jsx("p",{className:"text-gray-400 font-mono text-xs uppercase",children:"No teams found"})]}):a.jsx("div",{className:"grid gap-4",children:o.map(W=>a.jsxs("div",{className:"border border-dashed border-white/10 rounded-none p-4 hover:bg-white/5 transition-colors",children:[a.jsxs("div",{className:"flex items-start justify-between mb-3",children:[a.jsxs("div",{className:"flex items-center space-x-4 flex-1",children:[a.jsx("div",{className:"w-12 h-12 bg-black/80 border border-dashed border-white/20 flex items-center justify-center rounded-none",children:a.jsx(Ht,{className:"w-6 h-6 text-white"})}),a.jsxs("div",{className:"flex-1",children:[a.jsxs("h3",{className:"text-white font-light inline-flex items-start",children:[W.team.name,a.jsx(Ct,{id:W.team.id,variant:"subscript",nonSliced:!!(W.team.organizationSlug||W.team.organizationName)})]}),a.jsxs("p",{className:"text-gray-400 text-sm font-sans mt-1 flex items-center gap-2",children:[a.jsxs("span",{children:["in"," ",W.team.organizationSlug||W.team.organizationName]}),a.jsx("button",{onClick:ue=>{ue.stopPropagation(),W.team.organizationId?t(`/organizations/${W.team.organizationId}/teams/${W.team.id}`):t(`/teams/${W.team.id}`)},className:"text-white/60 hover:text-white transition-colors",title:"View team details",children:a.jsx(Ii,{className:"w-3.5 h-3.5"})})]})]})]}),a.jsx("div",{className:"flex flex-col items-end space-y-2",children:a.jsxs("div",{className:"flex items-center space-x-2",children:[a.jsxs("span",{className:"text-gray-500 font-mono text-xs uppercase",children:["Joined:"," "]}),a.jsxs("span",{className:"text-white font-mono text-xs",children:[new Date(W.joinedAt).toLocaleDateString("en-US",{year:"numeric",month:"short",day:"numeric"}),","," ",new Date(W.joinedAt).toLocaleTimeString("en-US",{hour:"numeric",minute:"2-digit",hour12:!0})]})]})})]}),a.jsx("div",{className:"flex items-center justify-end",children:a.jsxs(H,{variant:"outline",size:"sm",onClick:()=>nt(W.id),className:"border border-dashed border-red-400/20 text-red-400 hover:bg-red-400/10 rounded-none",children:[a.jsx(ax,{className:"w-4 h-4 mr-1"}),"Remove"]})})]},W.id))})]}),w==="accounts"&&a.jsxs("div",{className:"space-y-4",children:[a.jsxs("div",{className:"flex items-center justify-between mb-4",children:[a.jsxs("div",{children:[a.jsxs("h3",{className:"text-lg relative text-white font-light inline-flex items-start",children:["Linked Accounts",a.jsxs("sup",{className:"text-xs text-gray-500 ml-1 mt-0",children:[a.jsx("span",{className:"mr-1",children:"["}),a.jsx("span",{className:"text-white font-mono text-xs",children:h.length}),a.jsx("span",{className:"ml-1",children:"]"})]})]}),a.jsx("p",{className:"text-gray-400 font-light font-mono text-xs uppercase mt-1",children:"Manage user OAuth account connections"})]}),a.jsxs(H,{variant:"outline",onClick:()=>{re([]),ce(!1),U(!0)},className:"border border-dashed border-white/20 text-white hover:bg-white/10 rounded-none",children:[a.jsx(Gl,{className:"w-4 h-4 mr-2"}),"Seed Accounts"]})]}),h.length===0?a.jsxs("div",{className:"text-center py-12 border border-dashed border-white/10 rounded-none",children:[a.jsx(Gl,{className:"w-12 h-12 text-gray-400 mx-auto mb-4"}),a.jsx("p",{className:"text-gray-400 font-mono text-xs uppercase",children:"No linked accounts found"})]}):a.jsx("div",{className:"grid gap-4",children:h.map(W=>a.jsxs("div",{className:"border border-dashed border-white/10 rounded-none p-4 hover:bg-white/5 transition-colors",children:[a.jsxs("div",{className:"flex items-start justify-between mb-3",children:[a.jsxs("div",{className:"flex items-center space-x-4 flex-1",children:[a.jsx("div",{className:"w-12 h-12 bg-black/80 border border-dashed border-white/20 flex items-center justify-center rounded-none",children:EE(W.providerId)}),a.jsxs("div",{className:"flex-1",children:[a.jsxs("h3",{className:"text-white font-light inline-flex items-start",children:[kt(W.providerId),a.jsx(Ct,{id:W.accountId,variant:"subscript",nonSliced:!!(W.email||n.email)})]}),a.jsx("p",{className:"text-gray-400 tracking-tight uppercase text-xs font-mono mt-1",children:`ID: ${W.id}`})]})]}),a.jsx("div",{className:"flex flex-col items-end space-y-2 text-right",children:a.jsxs("div",{className:"flex items-center space-x-2 text-xs font-mono text-gray-400",children:[a.jsx("span",{className:"uppercase",children:"Linked:"}),a.jsx("span",{className:"text-white",children:we(W.createdAt||W.updatedAt)})]})})]}),a.jsx("div",{className:"flex items-center justify-end",children:a.jsxs(H,{variant:"outline",size:"sm",onClick:()=>xe(W.id),disabled:un[W.id],className:"border border-dashed border-red-400/20 text-red-400 hover:bg-red-400/10 rounded-none",children:[a.jsx(ax,{className:"w-4 h-4 mr-1"}),"Unlink"]})})]},W.id))})]}),w==="sessions"&&a.jsxs("div",{className:"space-y-4",children:[a.jsxs("div",{className:"flex items-center justify-between mb-4",children:[a.jsxs("div",{children:[a.jsxs("h3",{className:"text-lg relative text-white font-light inline-flex items-start",children:["Sessions",a.jsxs("sup",{className:"text-xs text-gray-500 ml-1 mt-0",children:[a.jsx("span",{className:"mr-1",children:"["}),a.jsx("span",{className:"text-white font-mono text-xs",children:c.length}),a.jsx("span",{className:"ml-1",children:"]"})]})]}),a.jsx("p",{className:"text-gray-400 font-light font-mono text-xs uppercase mt-1",children:"Manage user authentication sessions"})]}),a.jsxs(H,{variant:"outline",onClick:()=>{re([]),ce(!1),L(!0)},className:"border border-dashed border-white/20 text-white hover:bg-white/10 rounded-none",children:[a.jsx(Fs,{className:"w-4 h-4 mr-2"}),"Seed Sessions"]})]}),c.length===0?a.jsxs("div",{className:"text-center py-12 border border-dashed border-white/10 rounded-none",children:[a.jsx(_N,{className:"w-12 h-12 text-gray-400 mx-auto mb-4"}),a.jsx("p",{className:"text-gray-400 font-mono text-xs uppercase",children:"No sessions found"})]}):a.jsx("div",{className:"grid gap-4",children:c.map(W=>{var ue,pe,Le,qe;return a.jsxs("div",{className:"border border-dashed border-white/10 rounded-none p-4 hover:bg-white/5 transition-colors",children:[a.jsxs("div",{className:"flex items-start justify-between mb-3",children:[a.jsxs("div",{className:"flex items-center space-x-4 flex-1",children:[a.jsx("div",{className:"w-12 h-12 bg-black/80 border border-dashed border-white/20 flex items-center justify-center rounded-none",children:a.jsx(vae,{className:"w-6 h-6 text-white"})}),a.jsxs("div",{className:"flex-1",children:[a.jsxs("h3",{className:"text-white font-light inline-flex items-start",children:["Session ",W.id.substring(0,8),"...",a.jsxs("sup",{className:"text-xs text-gray-500 ml-2 mt-0.5",children:[a.jsx("span",{className:"mr-1",children:"["}),a.jsx("span",{className:"text-white/80 font-mono text-xs",children:W.ipAddress}),a.jsx("span",{className:"ml-1",children:"]"})]})]}),a.jsxs("div",{className:"flex items-center space-x-2 mt-2",children:[a.jsx(Sae,{className:"w-3.5 h-3.5 text-gray-400"}),a.jsxs("span",{className:"text-gray-400 uppercase font-mono text-xs",children:[((ue=Me[W.id])==null?void 0:ue.city)||"...",","," ",((pe=Me[W.id])==null?void 0:pe.country)||"..."]}),((Le=Me[W.id])==null?void 0:Le.countryCode)&&a.jsx("span",{className:"text-xs ml-1",children:tt((qe=Me[W.id])==null?void 0:qe.countryCode)})]})]})]}),a.jsxs("div",{className:"flex flex-col items-start space-y-1",children:[a.jsxs("div",{className:"flex items-center space-x-2",children:[a.jsxs("span",{className:"text-gray-500 font-mono text-xs uppercase",children:["Expires:"," "]}),a.jsxs("span",{className:"text-white font-mono text-xs",children:[new Date(W.expiresAt).toLocaleDateString("en-US",{year:"numeric",month:"short",day:"numeric"}),","," ",new Date(W.expiresAt).toLocaleTimeString("en-US",{hour:"numeric",minute:"2-digit",hour12:!0})]})]}),a.jsxs("div",{className:"flex items-center space-x-2",children:[a.jsxs("span",{className:"text-gray-500 font-mono text-xs uppercase",children:["Created:"," "]}),a.jsxs("span",{className:"text-white font-mono text-xs",children:[new Date(W.createdAt).toLocaleDateString("en-US",{year:"numeric",month:"short",day:"numeric"}),","," ",new Date(W.createdAt).toLocaleTimeString("en-US",{hour:"numeric",minute:"2-digit",hour12:!0})]})]})]})]}),a.jsx("div",{className:"flex items-center justify-end",children:a.jsxs(H,{variant:"outline",size:"sm",onClick:()=>Z(W.id),disabled:Tn[W.id],className:"border border-dashed border-red-400/20 text-red-400 hover:bg-red-400/10 rounded-none",children:[a.jsx(rx,{className:"w-4 h-4 mr-1"}),"Revoke"]})})]},W.id)})})]}),w==="invitations"&&a.jsxs("div",{className:"space-y-4",children:[a.jsx("div",{className:"flex items-center justify-between mb-4",children:a.jsxs("div",{children:[a.jsxs("h3",{className:"text-lg relative text-white font-light inline-flex items-start",children:["Invitations",a.jsxs("sup",{className:"text-xs text-gray-500 ml-1 mt-0",children:[a.jsx("span",{className:"mr-1",children:"["}),a.jsx("span",{className:"text-white font-mono text-xs",children:f.length}),a.jsx("span",{className:"ml-1",children:"]"})]})]}),a.jsx("p",{className:"text-gray-400 font-light font-mono text-xs uppercase mt-1",children:"Manage user invitations"})]})}),f.length===0?a.jsxs("div",{className:"text-center py-12 border border-dashed border-white/10 rounded-none",children:[a.jsx(Cr,{className:"w-12 h-12 text-gray-400 mx-auto mb-4"}),a.jsx("p",{className:"text-gray-400 font-mono text-xs uppercase",children:"No invitations found"})]}):a.jsx("div",{className:"border border-white/10 rounded-none overflow-hidden",children:a.jsxs("table",{className:"w-full",children:[a.jsx("thead",{children:a.jsxs("tr",{className:"border-b border-white/10 bg-black/50",children:[a.jsx("th",{className:"text-left py-4 px-4 text-white font-mono uppercase text-xs",children:"Organization"}),a.jsx("th",{className:"text-left py-4 px-4 text-white font-mono uppercase text-xs",children:"Team"}),a.jsx("th",{className:"text-left py-4 px-4 text-white font-mono uppercase text-xs",children:"Role"}),a.jsx("th",{className:"text-left py-4 px-4 text-white font-mono uppercase text-xs",children:"Status"}),a.jsx("th",{className:"text-left py-4 px-4 text-white font-mono uppercase text-xs",children:"Expires"}),a.jsx("th",{className:"text-right py-4 px-4 text-white font-mono uppercase text-xs",children:"Actions"})]})}),a.jsx("tbody",{children:f.map(W=>a.jsxs("tr",{className:"border-b border-white/10 hover:bg-white/5 transition-colors",children:[a.jsx("td",{className:"py-4 px-4",children:a.jsxs("div",{className:"flex items-center space-x-2 group",children:[a.jsx(na,{className:"w-4 h-4 text-gray-400"}),a.jsx("span",{className:"text-white text-sm",children:W.organizationName}),a.jsx("button",{onClick:ue=>{ue.stopPropagation(),t(`/organizations/${W.organizationId}`)},className:"opacity-0 group-hover:opacity-100 text-white/60 hover:text-white transition-all",title:"View organization details",children:a.jsx(Ii,{className:"w-4 h-4"})})]})}),a.jsx("td",{className:"py-4 px-4",children:W.teamName?a.jsxs("div",{className:"flex items-center space-x-2 group",children:[a.jsx(Ht,{className:"w-4 h-4 text-gray-400"}),a.jsx("span",{className:"text-white text-sm",children:W.teamName}),W.teamId&&a.jsx("button",{onClick:ue=>{ue.stopPropagation(),t(`/organizations/${W.organizationId}/teams/${W.teamId}`)},className:"opacity-0 group-hover:opacity-100 text-white/60 hover:text-white transition-all",title:"View team details",children:a.jsx(Ii,{className:"w-4 h-4"})})]}):a.jsx("span",{className:"text-gray-500 text-sm",children:"—"})}),a.jsx("td",{className:"py-4 px-4",children:a.jsx("span",{className:"text-white/80 text-sm font-mono uppercase",children:W.role})}),a.jsx("td",{className:"py-4 px-4",children:a.jsx("span",{className:`text-xs font-mono uppercase px-2 border-dashed py-1 rounded-none ${W.status==="accepted"?"bg-green-900/50 text-green-400 border border-green-500/30":W.status==="rejected"||W.status==="cancelled"?"bg-red-900/50 text-red-400 border border-red-500/30":W.status==="expired"?"bg-yellow-900/50 text-yellow-400 border border-yellow-500/30":"bg-blue-900/50 text-blue-400 border border-blue-500/30"}`,children:W.status})}),a.jsx("td",{className:"py-4 px-4",children:a.jsx("span",{className:"text-gray-400 text-sm font-mono",children:new Date(W.expiresAt).toLocaleDateString("en-US",{month:"short",day:"numeric",year:"numeric"})})}),a.jsx("td",{className:"py-4 px-4",children:a.jsxs("div",{className:"flex items-center justify-end space-x-2",children:[W.status==="pending"&&a.jsxs(a.Fragment,{children:[a.jsxs(H,{variant:"outline",size:"sm",onClick:()=>Re(W.id),disabled:mt[W.id],className:"border border-dashed border-green-400/20 text-white hover:bg-green-400/10 hover:text-green-400 rounded-none font-mono uppercase text-xs tracking-tight",children:[a.jsx(Vl,{className:"w-3.5 h-3.5 mr-1"}),"Accept"]}),a.jsxs(H,{variant:"outline",size:"sm",onClick:()=>dt(W.id),disabled:Ft[W.id],className:"border border-dashed border-red-400/20 text-red-400 hover:text-red-400 hover:bg-red-400/10 rounded-none font-mono uppercase text-xs tracking-tight",children:[a.jsx(Jr,{className:"w-3.5 h-3.5 mr-1"}),"Reject"]}),a.jsxs(H,{variant:"outline",size:"sm",onClick:()=>ft(W.id),disabled:Yt[W.id],className:"border border-dashed border-yellow-400/20 text-white hover:text-yellow-400 hover:bg-yellow-400/10 rounded-none font-mono uppercase text-xs tracking-tight",children:[a.jsx(gt,{className:"w-3.5 h-3.5 mr-1"}),"Cancel"]})]}),(W.status==="accepted"||W.status==="rejected"||W.status==="cancelled"||W.status==="expired")&&a.jsx("span",{className:"text-gray-500 text-xs font-mono uppercase",children:"No actions available"})]})})]},W.id))})]})})]})]})]})]}),v&&a.jsx("div",{className:"fixed inset-0 bg-black/60 flex items-center justify-center z-50",children:a.jsxs("div",{className:"bg-black border border-white/15 rounded-none p-6 w-full max-w-lg shadow-2xl",children:[a.jsxs("div",{className:"flex items-center justify-between mb-4",children:[a.jsx("h3",{className:"text-lg text-white font-light uppercase font-mono",children:"Edit User"}),a.jsx(H,{variant:"ghost",size:"sm",onClick:()=>{g(!1),J(""),je(null),Xe(null)},className:"text-gray-400 -mt-2 hover:text-white rounded-none",children:a.jsx(gt,{className:"w-4 h-4"})})]}),a.jsxs("div",{className:"flex flex-col items-center justify-center mt-2",children:[a.jsx("hr",{className:"w-[calc(100%+3rem)] border-white/10 h-px"}),a.jsx("div",{className:"relative z-20 h-4 w-[calc(100%+3rem)] mx-auto -translate-x-1/2 left-1/2 bg-[repeating-linear-gradient(-45deg,#ffffff,#ffffff_1px,transparent_1px,transparent_6px)] opacity-[7%]"}),a.jsx("hr",{className:"w-[calc(100%+3rem)] border-white/10 h-px"})]}),a.jsxs("div",{className:"space-y-4 mt-4",children:[a.jsxs("div",{className:"flex items-center space-x-3",children:[a.jsxs("div",{className:"relative group",children:[a.jsx("div",{className:"w-14 h-14 rounded-none border border-dashed border-white/15 bg-white/10 flex items-center justify-center overflow-hidden",children:oe?a.jsx("img",{src:oe,alt:n==null?void 0:n.name,className:"w-14 h-14 object-cover"}):a.jsx(Vr,{className:"w-7 h-7 text-white"})}),a.jsx("label",{htmlFor:"image-upload-details",className:"absolute inset-0 flex items-center justify-center bg-black/60 opacity-0 group-hover:opacity-100 transition-opacity cursor-pointer rounded-none",children:a.jsx(Xs,{className:"w-4 h-4 text-white"})}),oe&&a.jsx("button",{type:"button",onClick:W=>{W.preventDefault(),W.stopPropagation(),je(null),Xe(null)},disabled:ge,className:"absolute bottom-0 right-0 w-4 h-4 bg-red-500/90 hover:bg-red-500 text-white flex items-center justify-center rounded-none opacity-0 group-hover:opacity-100 transition-opacity",title:"Remove image",children:a.jsx(gt,{className:"w-3 h-3"})}),a.jsx("input",{id:"image-upload-details",type:"file",accept:"image/*",onChange:tn,className:"hidden",disabled:ge})]}),a.jsxs("div",{className:"space-y-1 flex-1",children:[a.jsxs("div",{className:"text-white font-medium leading-tight flex items-center gap-2",children:[a.jsx("span",{children:n==null?void 0:n.name}),a.jsx(Ct,{id:(n==null?void 0:n.id)||"",variant:"subscript",nonSliced:!0})]}),a.jsx("div",{className:"text-sm text-gray-400",children:n==null?void 0:n.email}),et&&a.jsx("div",{className:"text-xs -mt-1 text-gray-500 font-mono",children:"New image selected"})]})]}),a.jsxs("div",{children:[a.jsx(ie,{htmlFor:"edit-name",className:"text-xs text-white/80 font-mono uppercase",children:"Name"}),a.jsx(be,{id:"edit-name",defaultValue:(n==null?void 0:n.name)||"",placeholder:"e.g. John Doe",disabled:ge,className:"mt-1 border border-dashed border-white/20 bg-black/30 text-white rounded-none"})]}),a.jsxs("div",{children:[a.jsx(ie,{htmlFor:"edit-email",className:"text-xs text-white/80 font-mono uppercase",children:"Email"}),a.jsx(be,{id:"edit-email",type:"email",defaultValue:(n==null?void 0:n.email)||"",placeholder:"e.g. john@example.com",disabled:ge,className:"mt-1 border border-dashed border-white/20 bg-black/30 text-white rounded-none"})]}),a.jsxs("div",{children:[a.jsx(ie,{htmlFor:"edit-role",className:"text-xs text-white/80 font-mono uppercase",children:"Role"}),a.jsxs(Ln,{value:ee,onValueChange:J,children:[a.jsx(Un,{id:"edit-role",className:"mt-1 border border-dashed border-white/20 bg-black/30 text-white rounded-none",disabled:ge,children:a.jsx(oa,{placeholder:"Select role"})}),a.jsxs(Pn,{children:[a.jsx(Fe,{value:"",children:"None"}),a.jsx(Fe,{value:"admin",children:"Admin"}),a.jsx(Fe,{value:"user",children:"User"})]})]})]})]}),a.jsxs("div",{className:"flex justify-end space-x-3 mt-6",children:[a.jsx(H,{variant:"outline",onClick:()=>{g(!1),J(""),je(null),Xe(null)},disabled:ge,className:"border border-dashed border-white/20 text-white hover:bg-white/10 rounded-none font-mono uppercase text-xs tracking-tight",children:"Cancel"}),a.jsx(H,{onClick:ne,disabled:ge,className:"bg-white hover:bg-white/90 text-black border border-white/20 rounded-none disabled:opacity-50 font-mono uppercase text-xs tracking-tight",children:ge?"Updating...":"Update"})]})]})}),N&&n&&a.jsx("div",{className:"fixed inset-0 bg-black/60 flex items-center justify-center z-50",children:a.jsxs("div",{className:"bg-black border border-white/15 rounded-none p-6 w-full max-w-lg shadow-2xl",children:[a.jsxs("div",{className:"flex items-center justify-between mb-4",children:[a.jsx("h3",{className:"text-lg text-white font-light uppercase font-mono",children:"Ban User"}),a.jsx(H,{variant:"ghost",size:"sm",onClick:()=>{S(!1),T(""),$(void 0)},disabled:Pe,className:"text-gray-400 -mt-2 hover:text-white rounded-none",children:a.jsx(gt,{className:"w-4 h-4"})})]}),a.jsxs("div",{className:"flex flex-col items-center justify-center mt-2",children:[a.jsx("hr",{className:"w-[calc(100%+3rem)] border-white/10 h-px"}),a.jsx("div",{className:"relative z-20 h-4 w-[calc(100%+3rem)] mx-auto -translate-x-1/2 left-1/2 bg-[repeating-linear-gradient(-45deg,#ffffff,#ffffff_1px,transparent_1px,transparent_6px)] opacity-[7%]"}),a.jsx("hr",{className:"w-[calc(100%+3rem)] border-white/10 h-px"})]}),a.jsxs("div",{className:"space-y-4 mt-4",children:[a.jsxs("div",{className:"flex items-center space-x-3",children:[a.jsx("div",{className:"w-14 h-14 rounded-none border border-dashed border-white/15 bg-white/10 flex items-center justify-center overflow-hidden",children:ha(n==null?void 0:n.image)?a.jsx("img",{src:ha(n==null?void 0:n.image),alt:n==null?void 0:n.name,className:"w-14 h-14 object-cover",onError:W=>{W.target.style.display="none"}}):a.jsx(Vr,{className:"w-7 h-7 text-white"})}),a.jsxs("div",{className:"space-y-1",children:[a.jsxs("div",{className:"text-white font-medium leading-tight flex items-center gap-2",children:[a.jsx("span",{children:n.name}),a.jsx(Ct,{id:n.id,variant:"subscript",nonSliced:!0})]}),a.jsx("div",{className:"text-sm text-gray-400",children:n.email})]})]}),a.jsxs("div",{children:[a.jsx(ie,{htmlFor:"banReason",className:"text-xs text-white/80 font-mono uppercase",children:"Ban Reason"}),a.jsx(be,{id:"banReason",value:B,onChange:W=>T(W.target.value),placeholder:"Enter reason for ban (optional)",disabled:Pe,className:"mt-1 border border-dashed border-white/20 bg-black/30 text-white rounded-none"})]}),a.jsxs("div",{children:[a.jsx(ie,{htmlFor:"banExpires",className:"text-xs text-white/80 font-mono uppercase",children:"Ban Duration (seconds)"}),a.jsx(be,{id:"banExpires",type:"number",value:A||"",onChange:W=>$(W.target.value?Number(W.target.value):void 0),placeholder:"Leave empty for permanent ban",disabled:Pe,className:"mt-1 border border-dashed border-white/20 bg-black/30 text-white rounded-none"}),a.jsx("p",{className:"text-xs text-gray-400 mt-1 font-mono",children:"Examples: 3600 (1 hour), 86400 (1 day), 604800 (1 week)"})]})]}),a.jsxs("div",{className:"flex justify-end space-x-3 mt-6",children:[a.jsx(H,{variant:"outline",onClick:()=>{S(!1),T(""),$(void 0)},disabled:Pe,className:"border border-dashed border-white/20 text-white hover:bg-white/10 rounded-none font-mono uppercase text-xs tracking-tight",children:"Cancel"}),a.jsx(H,{onClick:Ue,disabled:Pe,className:"bg-red-600 hover:bg-red-700 text-white border border-red-600 rounded-none disabled:opacity-50 font-mono uppercase text-xs tracking-tight",children:Pe?"Banning...":"Ban User"})]})]})}),E&&n&&a.jsx("div",{className:"fixed inset-0 bg-black/60 flex items-center justify-center z-50",children:a.jsxs("div",{className:"bg-black border border-white/15 rounded-none p-6 w-full max-w-lg shadow-2xl",children:[a.jsxs("div",{className:"flex items-center justify-between mb-4",children:[a.jsx("h3",{className:"text-lg text-white font-light uppercase font-mono",children:"Unban User"}),a.jsx(H,{variant:"ghost",size:"sm",onClick:()=>j(!1),disabled:ht,className:"text-gray-400 -mt-2 hover:text-white rounded-none",children:a.jsx(gt,{className:"w-4 h-4"})})]}),a.jsxs("div",{className:"flex flex-col items-center justify-center mt-2",children:[a.jsx("hr",{className:"w-[calc(100%+3rem)] border-white/10 h-px"}),a.jsx("div",{className:"relative z-20 h-4 w-[calc(100%+3rem)] mx-auto -translate-x-1/2 left-1/2 bg-[repeating-linear-gradient(-45deg,#ffffff,#ffffff_1px,transparent_1px,transparent_6px)] opacity-[7%]"}),a.jsx("hr",{className:"w-[calc(100%+3rem)] border-white/10 h-px"})]}),a.jsxs("div",{className:"space-y-4 mt-4",children:[a.jsxs("div",{className:"flex items-center space-x-3",children:[a.jsx("div",{className:"w-14 h-14 rounded-none border border-dashed border-white/15 bg-white/10 flex items-center justify-center overflow-hidden",children:ha(n==null?void 0:n.image)?a.jsx("img",{src:ha(n==null?void 0:n.image),alt:n==null?void 0:n.name,className:"w-14 h-14 object-cover",onError:W=>{W.target.style.display="none"}}):a.jsx(Vr,{className:"w-7 h-7 text-white"})}),a.jsxs("div",{className:"space-y-1",children:[a.jsxs("div",{className:"text-white font-medium leading-tight flex items-center gap-2",children:[a.jsx("span",{children:n.name}),a.jsx(Ct,{id:n.id,variant:"subscript",nonSliced:!0})]}),a.jsx("div",{className:"text-sm text-gray-400",children:n.email})]})]}),a.jsx("p",{className:"text-gray-400",children:"Are you sure you want to unban this user? This will restore their access to the system."})]}),a.jsxs("div",{className:"flex justify-end space-x-3 mt-6",children:[a.jsx(H,{variant:"outline",onClick:()=>j(!1),disabled:ht,className:"border border-dashed border-white/20 text-white hover:bg-white/10 rounded-none font-mono uppercase text-xs tracking-tight",children:"Cancel"}),a.jsx(H,{onClick:Ve,disabled:ht,className:"bg-green-400 hover:bg-green-500 text-white border border-green-400 rounded-none disabled:opacity-50 font-mono uppercase text-xs tracking-tight",children:ht?"Unbanning...":"Unban User"})]})]})}),C&&n&&a.jsx("div",{className:"fixed inset-0 bg-black/60 flex items-center justify-center z-50",children:a.jsxs("div",{className:"bg-black border border-white/15 rounded-none p-6 w-full max-w-lg shadow-2xl",children:[a.jsxs("div",{className:"flex items-center justify-between mb-4",children:[a.jsx("h3",{className:"text-lg text-white font-light uppercase font-mono",children:"Delete User"}),a.jsx(H,{variant:"ghost",size:"sm",onClick:()=>k(!1),className:"text-gray-400 -mt-2 hover:text-white rounded-none",children:a.jsx(gt,{className:"w-4 h-4"})})]}),a.jsxs("div",{className:"flex flex-col items-center justify-center mt-2",children:[a.jsx("hr",{className:"w-[calc(100%+3rem)] border-white/10 h-px"}),a.jsx("div",{className:"relative z-20 h-4 w-[calc(100%+3rem)] mx-auto -translate-x-1/2 left-1/2 bg-[repeating-linear-gradient(-45deg,#ffffff,#ffffff_1px,transparent_1px,transparent_6px)] opacity-[7%]"}),a.jsx("hr",{className:"w-[calc(100%+3rem)] border-white/10 h-px"})]}),a.jsxs("div",{className:"space-y-4 mt-4",children:[a.jsxs("div",{className:"flex items-center space-x-3",children:[a.jsx("div",{className:"w-14 h-14 rounded-none border border-dashed border-white/15 bg-white/10 flex items-center justify-center overflow-hidden",children:ha(n==null?void 0:n.image)?a.jsx("img",{src:ha(n==null?void 0:n.image),alt:n==null?void 0:n.name,className:"w-14 h-14 object-cover",onError:W=>{W.target.style.display="none"}}):a.jsx(Vr,{className:"w-7 h-7 text-white"})}),a.jsxs("div",{className:"space-y-1",children:[a.jsxs("div",{className:"text-white font-medium leading-tight flex items-center gap-2",children:[a.jsx("span",{children:n.name}),a.jsx(Ct,{id:n.id,variant:"subscript",nonSliced:!0})]}),a.jsx("div",{className:"text-sm text-gray-400",children:n.email})]})]}),a.jsx("p",{className:"text-gray-400",children:"Are you sure you want to delete this user? This action cannot be undone."})]}),a.jsxs("div",{className:"flex justify-end space-x-3 mt-6",children:[a.jsx(H,{variant:"outline",onClick:()=>k(!1),disabled:Be,className:"border border-dashed border-white/20 text-white hover:bg-white/10 rounded-none font-mono uppercase text-xs tracking-tight",children:"Cancel"}),a.jsx(H,{onClick:Ee,disabled:Be,className:"bg-red-600 hover:bg-red-700 text-white border border-red-600 rounded-none disabled:opacity-50 font-mono uppercase text-xs tracking-tight",children:Be?"Deleting...":"Delete"})]})]})}),O&&n&&a.jsx("div",{className:"fixed inset-0 bg-black/60 flex items-center justify-center z-50",children:a.jsxs("div",{className:"bg-black border border-white/15 rounded-none p-6 w-full max-w-lg shadow-2xl",children:[a.jsxs("div",{className:"flex items-center justify-between mb-4",children:[a.jsx("h3",{className:"text-lg text-white font-light uppercase font-mono",children:"Update Password"}),a.jsx(H,{variant:"ghost",size:"sm",onClick:()=>M(!1),disabled:de,className:"text-gray-400 -mt-2 hover:text-white rounded-none",children:a.jsx(gt,{className:"w-4 h-4"})})]}),a.jsxs("div",{className:"flex flex-col items-center justify-center mt-2",children:[a.jsx("hr",{className:"w-[calc(100%+3rem)] border-white/10 h-px"}),a.jsx("div",{className:"relative z-20 h-4 w-[calc(100%+3rem)] mx-auto -translate-x-1/2 left-1/2 bg-[repeating-linear-gradient(-45deg,#ffffff,#ffffff_1px,transparent_1px,transparent_6px)] opacity-[7%]"}),a.jsx("hr",{className:"w-[calc(100%+3rem)] border-white/10 h-px"})]}),a.jsxs("div",{className:"space-y-4 mt-4",children:[a.jsxs("div",{className:"flex items-center space-x-3",children:[a.jsx("div",{className:"w-14 h-14 rounded-none border border-dashed border-white/15 bg-white/10 flex items-center justify-center overflow-hidden",children:ha(n==null?void 0:n.image)?a.jsx("img",{src:ha(n==null?void 0:n.image),alt:n==null?void 0:n.name,className:"w-14 h-14 object-cover",onError:W=>{W.target.style.display="none"}}):a.jsx(Vr,{className:"w-7 h-7 text-white"})}),a.jsxs("div",{className:"space-y-1",children:[a.jsxs("div",{className:"text-white font-medium leading-tight flex items-center gap-2",children:[a.jsx("span",{children:n.name}),a.jsx(Ct,{id:n.id,variant:"subscript",nonSliced:!0})]}),a.jsx("div",{className:"text-sm text-gray-400",children:n.email})]})]}),a.jsxs("div",{children:[a.jsx(ie,{htmlFor:"new-password",className:"text-xs text-white/80 font-mono uppercase",children:"New Password"}),a.jsx(be,{id:"new-password",type:"password",disabled:de,className:"mt-1 border border-dashed border-white/20 bg-black/30 text-white rounded-none"})]})]}),a.jsxs("div",{className:"flex justify-end space-x-3 mt-6",children:[a.jsx(H,{variant:"outline",onClick:()=>M(!1),disabled:de,className:"border border-dashed border-white/20 text-white hover:bg-white/10 rounded-none font-mono uppercase text-xs tracking-tight",children:"Cancel"}),a.jsx(H,{onClick:async()=>{var pe;const W=(pe=document.getElementById("new-password"))==null?void 0:pe.value;if(!W){V.error("Please enter a password");return}$e(!0);const ue=V.loading("Updating password...");try{const qe=await(await fetch(`/api/users/${e}/password`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({password:W})})).json();if(qe.success)M(!1),document.getElementById("new-password").value="",V.success("Password updated successfully!",{id:ue});else{const lt=qe.message||qe.error||"Unknown error";V.error(`Error updating password: ${lt}`,{id:ue})}}catch{V.error("Error updating password",{id:ue})}finally{$e(!1)}},disabled:de,className:"bg-white hover:bg-white/90 text-black border border-white/20 rounded-none disabled:opacity-50 font-mono uppercase text-xs tracking-tight",children:de?"Updating...":"Update Password"})]})]})}),_&&n&&a.jsx("div",{className:"fixed inset-0 bg-black/60 flex items-center justify-center z-50",children:a.jsxs("div",{className:"bg-black border border-white/15 rounded-none p-6 w-full max-w-xl shadow-2xl",children:[a.jsxs("div",{className:"flex items-center justify-between mb-4",children:[a.jsx("h3",{className:"text-lg text-white font-light uppercase font-mono",children:"Seed Sessions"}),a.jsx(H,{variant:"ghost",size:"sm",onClick:()=>L(!1),disabled:se,className:"text-gray-400 -mt-2 hover:text-white rounded-none",children:a.jsx(gt,{className:"w-4 h-4"})})]}),a.jsxs("div",{className:"flex flex-col items-center justify-center mt-2",children:[a.jsx("hr",{className:"w-[calc(100%+3rem)] border-white/10 h-px"}),a.jsx("div",{className:"relative z-20 h-4 w-[calc(100%+3rem)] mx-auto -translate-x-1/2 left-1/2 bg-[repeating-linear-gradient(-45deg,#ffffff,#ffffff_1px,transparent_1px,transparent_6px)] opacity-[7%]"}),a.jsx("hr",{className:"w-[calc(100%+3rem)] border-white/10 h-px"})]}),a.jsxs("div",{className:"space-y-4 mt-4",children:[a.jsxs("div",{className:"flex items-center space-x-3",children:[a.jsx("div",{className:"w-14 h-14 rounded-none border border-dashed border-white/15 bg-white/10 flex items-center justify-center overflow-hidden",children:ha(n==null?void 0:n.image)?a.jsx("img",{src:ha(n==null?void 0:n.image),alt:n==null?void 0:n.name,className:"w-14 h-14 object-cover",onError:W=>{W.target.style.display="none"}}):a.jsx(Vr,{className:"w-7 h-7 text-white"})}),a.jsxs("div",{className:"space-y-1",children:[a.jsxs("div",{className:"text-white font-medium leading-tight flex items-center gap-2",children:[a.jsx("span",{children:n.name}),a.jsx(Ct,{id:n.id,variant:"subscript",nonSliced:!0})]}),a.jsx("div",{className:"text-sm text-gray-400",children:n.email})]})]}),a.jsxs("div",{children:[a.jsx(ie,{htmlFor:"session-count",className:"text-xs text-white/80 font-mono uppercase",children:"Number of Sessions"}),a.jsx(be,{id:"session-count",type:"number",min:"1",max:"50",defaultValue:"3",disabled:se,className:"mt-1 border border-dashed border-white/20 bg-black/30 text-white rounded-none"})]}),K.length>0&&a.jsx("div",{className:"mt-4",children:a.jsx(no,{title:"Session Seeding Terminal",lines:K,isRunning:se,className:"w-full",defaultCollapsed:!0})})]}),a.jsxs("div",{className:"flex justify-end space-x-3 mt-6",children:[a.jsx(H,{variant:"outline",onClick:()=>L(!1),disabled:se,className:"border border-dashed border-white/20 text-white hover:bg-white/10 rounded-none font-mono uppercase text-xs tracking-tight",children:"Cancel"}),a.jsx(H,{onClick:()=>{var ue;const W=parseInt(((ue=document.getElementById("session-count"))==null?void 0:ue.value)||"3",10);ze(W)},disabled:se,className:"bg-white hover:bg-white/90 text-black border border-white/20 rounded-none disabled:opacity-50 font-mono uppercase text-xs tracking-tight",children:se?a.jsxs(a.Fragment,{children:[a.jsx(In,{className:"w-3 h-3 mr-2 animate-spin"}),"Seeding..."]}):a.jsxs(a.Fragment,{children:[a.jsx(Fs,{className:"w-3 h-3 mr-2"}),"Seed Sessions"]})})]})]})}),F&&n&&a.jsx("div",{className:"fixed inset-0 bg-black/60 flex items-center justify-center z-50",children:a.jsxs("div",{className:"bg-black border border-white/15 rounded-none p-6 w-full max-w-xl shadow-2xl",children:[a.jsxs("div",{className:"flex items-center justify-between mb-4",children:[a.jsx("h3",{className:"text-lg text-white font-light uppercase font-mono",children:"Seed Accounts"}),a.jsx(H,{variant:"ghost",size:"sm",onClick:()=>U(!1),disabled:se,className:"text-gray-400 -mt-2 hover:text-white rounded-none",children:a.jsx(gt,{className:"w-4 h-4"})})]}),a.jsxs("div",{className:"flex flex-col items-center justify-center mt-2",children:[a.jsx("hr",{className:"w-[calc(100%+3rem)] border-white/10 h-px"}),a.jsx("div",{className:"relative z-20 h-4 w-[calc(100%+3rem)] mx-auto -translate-x-1/2 left-1/2 bg-[repeating-linear-gradient(-45deg,#ffffff,#ffffff_1px,transparent_1px,transparent_6px)] opacity-[7%]"}),a.jsx("hr",{className:"w-[calc(100%+3rem)] border-white/10 h-px"})]}),a.jsxs("div",{className:"space-y-4 mt-4",children:[a.jsxs("div",{className:"flex items-center space-x-3",children:[a.jsx("div",{className:"w-14 h-14 rounded-none border border-dashed border-white/15 bg-white/10 flex items-center justify-center overflow-hidden",children:ha(n==null?void 0:n.image)?a.jsx("img",{src:ha(n==null?void 0:n.image),alt:n==null?void 0:n.name,className:"w-14 h-14 object-cover",onError:W=>{W.target.style.display="none"}}):a.jsx(Vr,{className:"w-7 h-7 text-white"})}),a.jsxs("div",{className:"space-y-1",children:[a.jsxs("div",{className:"text-white font-medium leading-tight flex items-center gap-2",children:[a.jsx("span",{children:n.name}),a.jsx(Ct,{id:n.id,variant:"subscript",nonSliced:!0})]}),a.jsx("div",{className:"text-sm text-gray-400",children:n.email})]})]}),a.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[a.jsxs("div",{children:[a.jsx(ie,{htmlFor:"account-count",className:"text-xs text-white/80 font-mono uppercase",children:"Number of Accounts"}),a.jsx(be,{id:"account-count",type:"number",min:"1",max:"50",defaultValue:"3",disabled:se,className:"mt-1 border border-dashed border-white/20 bg-black/30 text-white rounded-none"})]}),a.jsxs("div",{children:[a.jsx(ie,{htmlFor:"account-provider",className:"text-xs text-white/80 font-mono uppercase",children:"Provider"}),a.jsxs(Ln,{value:R,onValueChange:G,children:[a.jsx(Un,{id:"account-provider",disabled:se,className:"mt-1 border border-dashed border-white/20 bg-black/30 text-white rounded-none",children:a.jsx(oa,{placeholder:"Select provider"})}),a.jsxs(Pn,{className:"bg-black border border-dashed border-white/20",children:[a.jsx(Fe,{value:"random",children:"Mix (Random)"}),a.jsx(Fe,{value:"github",children:"GitHub"}),a.jsx(Fe,{value:"google",children:"Google"}),a.jsx(Fe,{value:"discord",children:"Discord"}),a.jsx(Fe,{value:"facebook",children:"Facebook"}),a.jsx(Fe,{value:"twitter",children:"Twitter"}),a.jsx(Fe,{value:"linkedin",children:"LinkedIn"}),a.jsx(Fe,{value:"apple",children:"Apple"}),a.jsx(Fe,{value:"microsoft",children:"Microsoft"}),a.jsx(Fe,{value:"gitlab",children:"GitLab"}),a.jsx(Fe,{value:"bitbucket",children:"Bitbucket"}),a.jsx(Fe,{value:"spotify",children:"Spotify"}),a.jsx(Fe,{value:"twitch",children:"Twitch"}),a.jsx(Fe,{value:"reddit",children:"Reddit"}),a.jsx(Fe,{value:"slack",children:"Slack"}),a.jsx(Fe,{value:"notion",children:"Notion"}),a.jsx(Fe,{value:"tiktok",children:"TikTok"}),a.jsx(Fe,{value:"zoom",children:"Zoom"})]})]})]})]}),K.length>0&&a.jsx("div",{className:"mt-4",children:a.jsx(no,{title:"Account Seeding Terminal",lines:K,isRunning:se,className:"w-full",defaultCollapsed:!0})})]}),a.jsxs("div",{className:"flex justify-end space-x-3 mt-6",children:[a.jsx(H,{variant:"outline",onClick:()=>U(!1),disabled:se,className:"border border-dashed border-white/20 text-white hover:bg-white/10 rounded-none font-mono uppercase text-xs tracking-tight",children:"Cancel"}),a.jsx(H,{onClick:()=>{var ue;const W=parseInt(((ue=document.getElementById("account-count"))==null?void 0:ue.value)||"3",10);Rt(W,R)},disabled:se,className:"bg-white hover:bg-white/90 text-black border border-white/20 rounded-none disabled:opacity-50 font-mono uppercase text-xs tracking-tight",children:se?a.jsxs(a.Fragment,{children:[a.jsx(In,{className:"w-3 h-3 mr-2 animate-spin"}),"Seeding..."]}):a.jsxs(a.Fragment,{children:[a.jsx(Gl,{className:"w-3 h-3 mr-2"}),"Seed Accounts"]})})]})]})})]}):a.jsx("div",{className:"min-h-screen bg-black flex items-center justify-center",children:a.jsx("div",{className:"text-white text-lg",children:"User not found"})})}const Zh=window.__STUDIO_CONFIG__,kp=(Zh==null?void 0:Zh.basePath)!==void 0?Zh.basePath:"",hpe=!!kp;function fpe({children:e}){const[t,n]=p.useState({loading:!0,authenticated:!1,user:null}),r=io();if(p.useEffect(()=>{(async()=>{try{const i=kp?`${kp}/auth`:"/api/auth",l=await(await fetch(`${i}/session`,{credentials:"include"})).json();n({loading:!1,authenticated:l.authenticated,user:l.user})}catch{n({loading:!1,authenticated:!1,user:null})}})()},[r.pathname]),t.loading)return a.jsx("div",{className:"min-h-screen bg-black flex items-center justify-center",children:a.jsx("div",{className:"w-8 h-8 border border-dashed border-white/30 animate-spin"})});if(!t.authenticated){const s=encodeURIComponent(r.pathname+r.search);return a.jsx(C$,{to:`/login?redirect=${s}`,replace:!0})}return a.jsx(a.Fragment,{children:e})}function uO(){return a.jsx(QK,{children:a.jsx(YQ,{children:a.jsxs(uN,{children:[a.jsx(Gn,{path:"/",element:a.jsx(Xae,{})}),a.jsx(Gn,{path:"/users",element:a.jsx(PU,{})}),a.jsx(Gn,{path:"/users/:userId",element:a.jsx(upe,{})}),a.jsx(Gn,{path:"/organizations",element:a.jsx(UU,{})}),a.jsx(Gn,{path:"/organizations/:orgId",element:a.jsx(Cfe,{})}),a.jsx(Gn,{path:"/teams",element:a.jsx(Rfe,{})}),a.jsx(Gn,{path:"/teams/:teamId",element:a.jsx(dO,{})}),a.jsx(Gn,{path:"/organizations/:orgId/teams/:teamId",element:a.jsx(dO,{})}),a.jsx(Gn,{path:"/sessions",element:a.jsx(kfe,{})}),a.jsx(Gn,{path:"/database",element:a.jsx(Qae,{})}),a.jsx(Gn,{path:"/database/demo",element:a.jsx(ZK,{})}),a.jsx(Gn,{path:"/emails",element:a.jsx(jfe,{})}),a.jsx(Gn,{path:"/tools",element:a.jsx(dpe,{})}),a.jsx(Gn,{path:"/settings",element:a.jsx(_fe,{})})]})})})}function ppe(){return a.jsxs(L$,{basename:kp,children:[hpe?a.jsxs(uN,{children:[a.jsx(Gn,{path:"/login",element:a.jsx(Tfe,{})}),a.jsx(Gn,{path:"/access-denied",element:a.jsx(WQ,{})}),a.jsx(Gn,{path:"/*",element:a.jsx(fpe,{children:a.jsx(uO,{})})})]}):a.jsx(uN,{children:a.jsx(Gn,{path:"/*",element:a.jsx(uO,{})})}),a.jsx(h8,{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})]})}const mpe=window.fetch;window.fetch=(e,t)=>{var i;const n=((i=window.__STUDIO_CONFIG__)==null?void 0:i.basePath)||"";let r;return typeof e=="string"?r=e:e instanceof URL?r=e.toString():e instanceof Request?r=e.url:r="",r.startsWith("/api/")&&!r.startsWith("/api/auth/")&&n&&!r.startsWith(n)&&(r=n+r.slice(4),typeof e=="string"?e=r:e instanceof URL?e=new URL(r,window.location.origin):e instanceof Request&&(e=new Request(r,e))),mpe.call(window,e,t)};LB.createRoot(document.getElementById("root")).render(a.jsx(te.StrictMode,{children:a.jsx(ppe,{})}));