@neuctra/authix 1.1.25 → 1.1.26

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.
@@ -204,7 +204,7 @@ React keys must be passed directly to JSX without using spread:
204
204
  from { transform: rotate(0deg); }
205
205
  to { transform: rotate(360deg); }
206
206
  }
207
- `})]})},es=async(t,e)=>{const{email:r,password:s,appId:o}=t,{baseUrl:a,apiKey:i}=e;if(!i)throw new Error("API key is required for login");try{const l=await W.post(`${a}/users/login`,{email:r,password:s,appId:o},{headers:{"Content-Type":"application/json","x-api-key":i}});return l.data?.user&&localStorage.setItem("userInfo",JSON.stringify(l.data.user)),l.data.user}catch(l){const h=l.response?.data?.message||l.message||"Login failed";throw console.error("Login API Error:",h),{success:!1,message:h,status:l.response?.status||500}}},ts=({logoUrl:t,logoLinkUrl:e,title:r="Sign In to Your Account",subtitle:s="Welcome back! Please enter your details",footerText:o="Secure authentication powered by Neuctra Authix",primaryColor:a="#00C214",gradient:i="linear-gradient(135deg, #22c55e, #00C214)",darkMode:l=!0,signupUrl:h,onSuccess:d,onError:u})=>{const{baseUrl:b,apiKey:y,appId:S}=ue(),[c,j]=w.useState("login"),[m,A]=w.useState(1),[P,_]=w.useState(!1),[T,M]=w.useState(!1),[g,O]=w.useState(null),[v,U]=w.useState(""),[q,F]=w.useState(""),[V,Z]=w.useState({email:"",otp:"",newPassword:"",appId:S}),[I,J]=w.useState(!1),z=l?"#ffffff":"#111827",R=l?"#a1a1aa":"#6b7280",K=l?"rgba(255,255,255,0.05)":"rgba(0,0,0,0.02)",te=l?"rgba(255,255,255,0.1)":"rgba(0,0,0,0.1)";w.useEffect(()=>{if(typeof window<"u"){const $=()=>J(window.innerWidth<768);return $(),window.addEventListener("resize",$),()=>window.removeEventListener("resize",$)}},[]);const X=async $=>{$.preventDefault(),M(!0),O(null);try{const N=await es({email:v,password:q,appId:S},{baseUrl:b,apiKey:y});O({type:"success",text:`Welcome ${N.name}`}),d?.(N)}catch(N){const Y=N.message||"Login failed";O({type:"error",text:Y}),u?.(N)}finally{M(!1)}},f=$=>{Z({...V,[$.target.name]:$.target.value})},k=async $=>{$.preventDefault(),M(!0),O(null);try{const N=await W.post(`${b}/users/forgot-password`,{email:V.email,appId:S},{headers:{"x-api-key":y}});N.data.success?(A(2),O({type:"success",text:"OTP sent to your email"})):O({type:"error",text:N.data.message||"Failed to send OTP"})}catch(N){O({type:"error",text:N.response?.data?.message||"Something went wrong"})}finally{M(!1)}},x=async $=>{$.preventDefault(),M(!0),O(null);try{const N=await W.post(`${b}/users/reset-password`,V,{headers:{"x-api-key":y}});N.data.success?(O({type:"success",text:"Password reset successfully!"}),A(1),Z({email:"",otp:"",newPassword:"",appId:S}),j("login")):O({type:"error",text:N.data.message||"Reset failed"})}catch(N){O({type:"error",text:N.response?.data?.message||"Something went wrong"})}finally{M(!1)}},E={width:"100%",padding:I?"10px 14px 10px 44px":"10px 16px 10px 44px",backgroundColor:K,border:`1px solid ${te}`,borderRadius:"10px",color:z,fontSize:"15px",outline:"none",transition:"all 0.2s ease"};return n.jsx("div",{style:{display:"flex",justifyContent:"center",alignItems:"center"},children:n.jsxs("div",{style:{minWidth:I?"320px":"380px",maxWidth:I?"340px":"390px",width:"100%",display:"flex",flexDirection:"column",borderRadius:"10px",fontFamily:"'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif",backgroundColor:l?"#000000":"#ffffff",padding:I?"30px 24px":"18px 28px"},children:[n.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:"center",marginBottom:"10px"},children:[t?n.jsx("a",{href:e||"/",target:"_self",rel:"noopener noreferrer",children:n.jsx("img",{src:t,alt:"Logo",style:{height:"50px",width:"50px",marginBottom:"10px"}})}):n.jsx(Se,{size:40,color:a,style:{marginBottom:"10px"}}),n.jsx("h2",{style:{fontSize:"24px",fontWeight:700,color:z,margin:0},children:c==="login"?r:m===1?"Forgot Password":"Reset Password"}),n.jsx("p",{style:{fontSize:"14px",color:R},children:c==="login"?s:"Follow the steps to reset your password"})]}),c==="login"&&n.jsxs("form",{onSubmit:X,style:{display:"flex",flexDirection:"column",gap:"14px"},children:[n.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"4px"},children:[n.jsx("label",{htmlFor:"login-email",style:{fontSize:"14px",fontWeight:500,color:l?"#ffffff":"#000000"},children:"Email Address"}),n.jsxs("div",{style:{position:"relative"},children:[n.jsx(ce,{size:20,style:{position:"absolute",left:"14px",top:"50%",transform:"translateY(-50%)",color:R}}),n.jsx("input",{id:"login-email",type:"email",placeholder:"Enter your email",value:v,onChange:$=>U($.target.value),style:E})]})]}),n.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"4px"},children:[n.jsx("label",{htmlFor:"login-password",style:{fontSize:"14px",fontWeight:500,color:l?"#ffffff":"#000000"},children:"Password"}),n.jsxs("div",{style:{position:"relative"},children:[n.jsx(we,{size:20,style:{position:"absolute",left:"14px",top:"50%",transform:"translateY(-50%)",color:R}}),n.jsx("input",{id:"login-password",type:P?"text":"password",placeholder:"Enter your password",value:q,onChange:$=>F($.target.value),style:E}),n.jsx("button",{type:"button",onClick:()=>_(!P),style:{position:"absolute",right:"14px",padding:"4px",top:"50%",transform:"translateY(-50%)",background:"transparent",border:"none",color:R,cursor:"pointer"},children:P?n.jsx(nt,{size:20}):n.jsx(st,{size:20})})]})]}),n.jsxs("div",{style:{display:"flex",justifyContent:"space-between",fontSize:"13px"},children:[h&&n.jsx("a",{href:h,style:{color:a,textDecoration:"none",fontWeight:500},children:"Create new account"}),n.jsx("button",{type:"button",onClick:()=>j("forgot"),style:{background:"none",border:"none",color:a,fontWeight:500,cursor:"pointer"},children:"Forgot password?"})]}),n.jsx("button",{type:"submit",disabled:T,style:{padding:"12px",background:i,color:"#fff",border:"none",borderRadius:"10px",fontSize:"14px",fontWeight:600},children:T?"Signing In...":"Sign In"})]}),c==="forgot"&&n.jsxs("form",{onSubmit:m===1?k:x,style:{display:"flex",flexDirection:"column",gap:"14px"},children:[m===1?n.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"4px"},children:[n.jsx("label",{htmlFor:"forgot-email",style:{fontSize:"14px",fontWeight:500,color:l?"#ffffff":"#000000"},children:"Email Address"}),n.jsxs("div",{style:{position:"relative"},children:[n.jsx(ce,{size:20,style:{position:"absolute",left:"14px",top:"50%",transform:"translateY(-50%)",color:R}}),n.jsx("input",{id:"forgot-email",type:"email",name:"email",placeholder:"Enter your email",value:V.email,onChange:f,style:E})]})]}):n.jsxs(n.Fragment,{children:[n.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"6px"},children:[n.jsx("label",{htmlFor:"otp",style:{fontSize:"14px",fontWeight:500,color:l?"#ffffff":"#000000"},children:"One-Time Password (OTP)"}),n.jsxs("div",{style:{position:"relative"},children:[n.jsx(tr,{size:20,style:{position:"absolute",left:"14px",top:"50%",transform:"translateY(-50%)",color:R}}),n.jsx("input",{id:"otp",type:"text",name:"otp",placeholder:"Enter OTP",value:V.otp,onChange:f,style:E})]})]}),n.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"6px"},children:[n.jsx("label",{htmlFor:"newPassword",style:{fontSize:"14px",fontWeight:500,color:l?"#ffffff":"#000000"},children:"New Password"}),n.jsxs("div",{style:{position:"relative"},children:[n.jsx(we,{size:20,style:{position:"absolute",left:"14px",top:"50%",transform:"translateY(-50%)",color:R}}),n.jsx("input",{id:"newPassword",type:"password",name:"newPassword",placeholder:"Enter new password",value:V.newPassword,onChange:f,style:E})]})]})]}),n.jsx("button",{type:"submit",disabled:T,style:{padding:"12px",background:i,color:"#fff",border:"none",fontSize:"14px",borderRadius:"10px",fontWeight:600},children:T?"Please wait...":m===1?"Send Reset OTP":"Reset Password"}),n.jsx("button",{type:"button",onClick:()=>{j("login"),A(1)},style:{background:"none",border:"none",fontSize:"14px",color:R,marginTop:"6px",cursor:"pointer"},children:"Back to Login"})]}),g&&n.jsxs("div",{style:{marginTop:"16px",padding:"12px",borderRadius:"12px",fontSize:"14px",display:"flex",alignItems:"center",gap:"10px",backgroundColor:g.type==="success"?`${a}15`:"rgba(239,68,68,0.1)",border:g.type==="success"?`1px solid ${a}30`:"1px solid rgba(239,68,68,0.3)",color:g.type==="success"?a:"#ef4444"},children:[g.type==="success"?n.jsx(de,{size:20}):n.jsx(le,{size:20}),n.jsx("span",{children:g.text})]}),n.jsxs("div",{style:{textAlign:"center",fontSize:"12px",color:R,marginTop:"16px",padding:"0 4px"},children:["Secure authentication powered by"," ",n.jsx("span",{style:{color:a,fontWeight:600},children:"Neuctra Authix"})]})]})})},rs=({children:t,fallback:e=null,className:r,width:s,height:o})=>{const[a,i]=w.useState(!1);return w.useEffect(()=>{const l=()=>{if(typeof window>"u")return!1;try{const d=localStorage.getItem("userInfo");return!!(d&&d!=="undefined"&&d!=="null")}catch{return!1}},h=()=>i(l());return h(),typeof window<"u"&&window.addEventListener("storage",h),()=>{typeof window<"u"&&window.removeEventListener("storage",h)}},[]),a?n.jsx("span",{className:r,style:{display:"inline-flex",alignItems:"center",verticalAlign:"middle",width:s,height:o},children:t}):n.jsx(n.Fragment,{children:e})},ns=({children:t,fallback:e=null,className:r,width:s,height:o})=>{const[a,i]=w.useState(!0);return w.useEffect(()=>{const l=()=>{try{const d=localStorage.getItem("userInfo");return!!(d&&d!=="undefined"&&d!=="null")}catch{return!1}},h=()=>i(!l());return h(),window.addEventListener("storage",h),()=>window.removeEventListener("storage",h)},[]),a?n.jsx("span",{className:r,style:{display:"inline-flex",alignItems:"center",verticalAlign:"middle",width:s,height:o},children:t}):n.jsx(n.Fragment,{children:e})},ss=({isOpen:t,onClose:e,onSuccess:r,onError:s,userId:o,token:a,colors:i})=>{const{baseUrl:l,apiKey:h,appId:d}=ue(),[u,b]=w.useState(!1),[y,S]=w.useState(""),[c,j]=w.useState("warning"),[m,A]=w.useState(!1);if(w.useEffect(()=>{if(typeof window>"u")return;const g=()=>{A(window.innerWidth<640)};return g(),window.addEventListener("resize",g),()=>window.removeEventListener("resize",g)},[]),!t)return null;const P=async()=>{b(!0),j("processing");try{const{data:g}=await W.delete(`${l}/users/delete/${o}`,{data:{appId:d},headers:{"x-api-key":h}});g.success?(r(g.message||"Account deleted successfully"),j("success"),setTimeout(()=>{localStorage.removeItem("userInfo"),localStorage.removeItem("userToken"),window.location.href="/"},2e3)):(s(g.message||"Failed to delete account"),j("warning"))}catch(g){s(g.response?.data?.message||"Something went wrong"),j("warning")}finally{b(!1)}},_=y.toLowerCase()==="delete my account",T=g=>{g.target===g.currentTarget&&c!=="processing"&&c!=="success"&&e()},M=()=>{switch(c){case"warning":return n.jsxs(n.Fragment,{children:[n.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",marginBottom:"24px",gap:"16px"},children:[n.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"12px",flex:1},children:[n.jsx("div",{style:{width:"40px",height:"40px",borderRadius:"12px",background:"linear-gradient(135deg, #ef4444, #dc2626)",display:"flex",alignItems:"center",justifyContent:"center",color:"white",flexShrink:0},children:n.jsx(We,{size:20})}),n.jsx("div",{children:n.jsx("h3",{style:{color:i.textPrimary,margin:0,fontSize:"20px",fontWeight:700,lineHeight:"1.3"},children:"Delete Account"})})]}),n.jsx("button",{onClick:e,"aria-label":"Close modal",style:{background:"transparent",border:"none",color:i.textTertiary,cursor:"pointer",padding:"8px",borderRadius:"8px",width:"36px",height:"36px",display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0,transition:"all 0.2s ease"},onMouseOver:g=>{g.currentTarget.style.backgroundColor=i.border,g.currentTarget.style.color=i.textPrimary},onMouseOut:g=>{g.currentTarget.style.backgroundColor="transparent",g.currentTarget.style.color=i.textTertiary},children:n.jsx(Pe,{size:20})})]}),n.jsxs("div",{style:{display:"flex",gap:"16px",padding:"20px",background:`${i.error}15`,border:`1px solid ${i.error}30`,borderRadius:"12px",marginBottom:"20px"},children:[n.jsx("div",{style:{color:i.error,flexShrink:0,display:"flex",alignItems:"flex-start"},children:n.jsx(nr,{size:24})}),n.jsxs("div",{style:{flex:1},children:[n.jsx("h4",{style:{color:i.textPrimary,margin:"0 0 12px 0",fontSize:"16px",fontWeight:600},children:"Before you proceed..."}),n.jsx("div",{style:{display:"flex",flexDirection:"column",gap:"10px"},children:[{icon:n.jsx(Mn,{size:16}),text:"All your data will be permanently deleted"},{icon:n.jsx(Gn,{size:16}),text:"This action cannot be reversed"},{icon:n.jsx(it,{size:16}),text:"You will lose access to all services"}].map((g,O)=>n.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"10px",fontSize:"14px",color:i.textSecondary},children:[n.jsx("div",{style:{color:i.error,flexShrink:0},children:g.icon}),n.jsx("span",{children:g.text})]},O))})]})]}),n.jsxs("div",{style:{display:"flex",gap:"12px",flexDirection:m?"column-reverse":"row",justifyContent:"flex-end",alignItems:"stretch"},children:[n.jsx("button",{onClick:e,style:{padding:"10px 24px",borderRadius:"10px",border:`1.5px solid ${i.border}`,background:"transparent",color:i.textPrimary,fontSize:"14px",fontWeight:500,cursor:"pointer",flex:m?"none":1,minWidth:m?"100%":"120px",transition:"all 0.2s ease"},onMouseOver:g=>{g.currentTarget.style.backgroundColor=i.border,g.currentTarget.style.transform="translateY(-1px)"},onMouseOut:g=>{g.currentTarget.style.backgroundColor="transparent",g.currentTarget.style.transform="translateY(0)"},children:"Cancel"}),n.jsxs("button",{onClick:()=>j("confirmation"),style:{padding:"10px 24px",borderRadius:"10px",border:"none",background:"linear-gradient(135deg, #ef4444, #dc2626)",color:"white",fontSize:"14px",fontWeight:600,cursor:"pointer",flex:m?"none":1,minWidth:m?"100%":"140px",display:"flex",alignItems:"center",justifyContent:"center",gap:"8px",transition:"all 0.2s ease",boxShadow:"0 4px 12px rgba(239, 68, 68, 0.4)"},onMouseOver:g=>{g.currentTarget.style.transform="translateY(-1px)",g.currentTarget.style.boxShadow="0 6px 20px rgba(239, 68, 68, 0.5)"},onMouseOut:g=>{g.currentTarget.style.transform="translateY(0)",g.currentTarget.style.boxShadow="0 4px 12px rgba(239, 68, 68, 0.4)"},children:[n.jsx(We,{size:16}),"Continue to Delete"]})]})]});case"confirmation":return n.jsxs(n.Fragment,{children:[n.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"12px",marginBottom:"24px"},children:[n.jsx("div",{style:{width:"40px",height:"40px",borderRadius:"12px",background:"linear-gradient(135deg, #f59e0b, #d97706)",display:"flex",alignItems:"center",justifyContent:"center",color:"white",flexShrink:0},children:n.jsx(nr,{size:24})}),n.jsx("div",{style:{flex:1},children:n.jsx("h3",{style:{color:i.textPrimary,margin:0,fontSize:"20px",fontWeight:700,lineHeight:"1.3"},children:"Confirm Deletion"})})]}),n.jsxs("div",{style:{marginBottom:"24px"},children:[n.jsxs("p",{style:{color:i.textSecondary,marginBottom:"16px",fontSize:"14px",lineHeight:"1.5"},children:["Type"," ",n.jsx("strong",{style:{color:i.textPrimary},children:'"delete my account"'})," ","to confirm:"]}),n.jsx("input",{type:"text",value:y,onChange:g=>S(g.target.value),placeholder:"delete my account",style:{width:"100%",padding:"14px 16px",borderRadius:"10px",border:`2px solid ${_?i.success:i.error}`,backgroundColor:"transparent",color:i.textPrimary,fontSize:"15px",outline:"none",transition:"all 0.2s ease",boxSizing:"border-box"},onFocus:g=>{g.target.style.boxShadow=`0 0 0 3px ${i.accent}20`},onBlur:g=>{g.target.style.boxShadow="none"},autoFocus:!0}),_&&n.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"8px",marginTop:"10px",color:i.success,fontSize:"14px",fontWeight:500},children:[n.jsx(rt,{size:16}),n.jsx("span",{children:"Confirmation accepted"})]})]}),n.jsxs("div",{style:{display:"flex",gap:"12px",flexDirection:"column-reverse",justifyContent:"flex-end",alignItems:"stretch"},children:[n.jsx("button",{onClick:()=>{j("warning"),S("")},style:{padding:"10px 24px",borderRadius:"10px",border:`1.5px solid ${i.border}`,background:"transparent",color:i.textPrimary,fontSize:"14px",fontWeight:500,cursor:"pointer",flex:m?"none":1,minWidth:m?"100%":"120px",transition:"all 0.2s ease"},onMouseOver:g=>{g.currentTarget.style.backgroundColor=i.border,g.currentTarget.style.transform="translateY(-1px)"},onMouseOut:g=>{g.currentTarget.style.backgroundColor="transparent",g.currentTarget.style.transform="translateY(0)"},children:"Go Back"}),n.jsxs("button",{onClick:P,disabled:!_||u,style:{padding:"10px 24px",borderRadius:"10px",border:"none",background:"linear-gradient(135deg, #ef4444, #dc2626)",color:"white",fontSize:"14px",fontWeight:600,cursor:!_||u?"not-allowed":"pointer",flex:m?"none":1,minWidth:m?"100%":"140px",opacity:!_||u?.6:1,display:"flex",alignItems:"center",justifyContent:"center",gap:"8px",transition:"all 0.2s ease",boxShadow:!_||u?"none":"0 4px 12px rgba(239, 68, 68, 0.4)"},onMouseOver:g=>{_&&!u&&(g.currentTarget.style.transform="translateY(-1px)",g.currentTarget.style.boxShadow="0 6px 20px rgba(239, 68, 68, 0.5)")},onMouseOut:g=>{_&&!u&&(g.currentTarget.style.transform="translateY(0)",g.currentTarget.style.boxShadow="0 4px 12px rgba(239, 68, 68, 0.4)")},children:[n.jsx(We,{size:16}),"Yes, Delete My Account"]})]})]});case"processing":return n.jsxs(n.Fragment,{children:[n.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"12px",marginBottom:"24px"},children:[n.jsx("div",{style:{width:"40px",height:"40px",borderRadius:"12px",background:"linear-gradient(135deg, #6b7280, #4b5563)",display:"flex",alignItems:"center",justifyContent:"center",color:"white",flexShrink:0},children:n.jsx(oe,{size:20,style:{animation:"spin 1s linear infinite"}})}),n.jsxs("div",{style:{flex:1},children:[n.jsx("h3",{style:{color:i.textPrimary,margin:0,fontSize:"20px",fontWeight:700,lineHeight:"1.3"},children:"Deleting Account"}),n.jsx("p",{style:{color:i.textTertiary,margin:"4px 0 0 0",fontSize:"14px",lineHeight:"1.4"},children:"Please wait while we process your request"})]})]}),n.jsx("div",{style:{marginBottom:"20px"},children:n.jsx("div",{style:{display:"flex",flexDirection:"column",gap:"12px"},children:[{text:"Removing your data",active:!0},{text:"Closing active sessions",active:!1},{text:"Finalizing deletion",active:!1}].map((g,O)=>n.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"12px",padding:"12px",borderRadius:"8px",transition:"all 0.2s ease",backgroundColor:g.active?`${i.accent}10`:"transparent"},children:[n.jsx("div",{style:{width:"8px",height:"8px",borderRadius:"50%",backgroundColor:g.active?i.accent:i.textTertiary,transition:"all 0.3s ease",boxShadow:g.active?`0 0 0 4px ${i.accent}20`:"none"}}),n.jsx("span",{style:{fontSize:"14px",color:g.active?i.textPrimary:i.textSecondary,fontWeight:g.active?500:400},children:g.text})]},O))})}),n.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"10px",padding:"16px",background:`${i.accent}10`,borderRadius:"10px",fontSize:"14px",color:i.textSecondary},children:[n.jsx(rr,{size:18,style:{color:i.accent,flexShrink:0}}),n.jsx("span",{children:"You will be redirected to the login page shortly"})]})]});case"success":return n.jsxs(n.Fragment,{children:[n.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"12px",marginBottom:"24px"},children:[n.jsx("div",{style:{width:"40px",height:"40px",borderRadius:"12px",background:"linear-gradient(135deg, #10b981, #059669)",display:"flex",alignItems:"center",justifyContent:"center",color:"white",flexShrink:0},children:n.jsx(rt,{size:20})}),n.jsxs("div",{style:{flex:1},children:[n.jsx("h3",{style:{color:i.textPrimary,margin:0,fontSize:"20px",fontWeight:700,lineHeight:"1.3"},children:"Account Deleted"}),n.jsx("p",{style:{color:i.textTertiary,margin:"4px 0 0 0",fontSize:"14px",lineHeight:"1.4"},children:"Your account has been successfully deleted"})]})]}),n.jsxs("div",{style:{textAlign:"center",padding:"20px",background:`${i.success}10`,border:`1px solid ${i.success}20`,borderRadius:"12px",marginBottom:"24px"},children:[n.jsx(rt,{size:48,style:{color:i.success,marginBottom:"12px",display:"block",margin:"0 auto 12px auto"}}),n.jsx("p",{style:{color:i.textPrimary,fontSize:"16px",fontWeight:600,margin:"0 0 8px 0"},children:"Goodbye!"}),n.jsx("p",{style:{color:i.textSecondary,fontSize:"14px",margin:0,lineHeight:"1.5"},children:"Your account and all associated data have been permanently removed from our systems."})]}),n.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"10px",padding:"16px",background:`${i.accent}10`,borderRadius:"10px",fontSize:"14px",color:i.textSecondary,justifyContent:"center"},children:[n.jsx(oe,{size:16,style:{animation:"spin 1s linear infinite",color:i.accent}}),n.jsx("span",{children:"Redirecting to login page..."})]})]})}};return n.jsxs("div",{style:{position:"fixed",inset:0,background:"rgba(0,0,0,0.8)",backdropFilter:"blur(8px)",display:"flex",alignItems:"center",justifyContent:"center",padding:"16px",zIndex:1e4,animation:"fadeIn 0.3s ease-out"},onClick:T,children:[n.jsx("div",{style:{backgroundColor:i.surface,border:`1px solid ${i.border}`,borderRadius:"20px",width:"100%",maxWidth:"480px",padding:"24px",boxShadow:"0 32px 64px rgba(0,0,0,0.4)",animation:"scaleIn 0.3s ease-out"},className:"delete-modal-container",children:M()}),n.jsx("style",{children:`
207
+ `})]})},es=async(t,e)=>{const{email:r,password:s,appId:o}=t,{baseUrl:a,apiKey:i}=e;if(!i)throw new Error("API key is required for login");try{const l=await W.post(`${a}/users/login`,{email:r,password:s,appId:o},{headers:{"Content-Type":"application/json","x-api-key":i}});return l.data?.user&&localStorage.setItem("userInfo",JSON.stringify(l.data.user)),l.data.user}catch(l){const h=l.response?.data?.message||l.message||"Login failed";throw console.error("Login API Error:",h),{success:!1,message:h,status:l.response?.status||500}}},ts=({logoUrl:t,logoLinkUrl:e,title:r="Sign In to Your Account",subtitle:s="Welcome back! Please enter your details",footerText:o="Secure authentication powered by Neuctra Authix",primaryColor:a="#00C214",gradient:i="linear-gradient(135deg, #22c55e, #00C214)",darkMode:l=!0,signupUrl:h,onSuccess:d,onError:u})=>{const{baseUrl:b,apiKey:y,appId:S}=ue(),[c,j]=w.useState("login"),[m,A]=w.useState(1),[P,_]=w.useState(!1),[T,M]=w.useState(!1),[g,O]=w.useState(null),[v,U]=w.useState(""),[q,F]=w.useState(""),[V,Z]=w.useState({email:"",otp:"",newPassword:"",appId:S}),[I,J]=w.useState(!1),z=l?"#ffffff":"#111827",R=l?"#a1a1aa":"#6b7280",K=l?"rgba(255,255,255,0.05)":"rgba(0,0,0,0.02)",te=l?"rgba(255,255,255,0.1)":"rgba(0,0,0,0.1)";w.useEffect(()=>{if(typeof window<"u"){const $=()=>J(window.innerWidth<768);return $(),window.addEventListener("resize",$),()=>window.removeEventListener("resize",$)}},[]);const X=async $=>{$.preventDefault(),M(!0),O(null);try{const N=await es({email:v,password:q,appId:S},{baseUrl:b,apiKey:y});O({type:"success",text:`Welcome ${N.name}`}),d?.(N)}catch(N){const Y=N.message||"Login failed";O({type:"error",text:Y}),u?.(N)}finally{M(!1)}},f=$=>{Z({...V,[$.target.name]:$.target.value})},k=async $=>{$.preventDefault(),M(!0),O(null);try{const N=await W.post(`${b}/users/forgot-password`,{email:V.email,appId:S},{headers:{"x-api-key":y}});N.data.success?(A(2),O({type:"success",text:"OTP sent to your email"})):O({type:"error",text:N.data.message||"Failed to send OTP"})}catch(N){O({type:"error",text:N.response?.data?.message||"Something went wrong"})}finally{M(!1)}},x=async $=>{$.preventDefault(),M(!0),O(null);try{const N=await W.post(`${b}/users/reset-password`,V,{headers:{"x-api-key":y}});N.data.success?(O({type:"success",text:"Password reset successfully!"}),A(1),Z({email:"",otp:"",newPassword:"",appId:S}),j("login")):O({type:"error",text:N.data.message||"Reset failed"})}catch(N){O({type:"error",text:N.response?.data?.message||"Something went wrong"})}finally{M(!1)}},E={width:"100%",padding:I?"10px 14px 10px 44px":"10px 16px 10px 44px",backgroundColor:K,border:`1px solid ${te}`,borderRadius:"10px",color:z,fontSize:"15px",outline:"none",transition:"all 0.2s ease"};return n.jsx("div",{style:{display:"flex",justifyContent:"center",alignItems:"center"},children:n.jsxs("div",{style:{minWidth:I?"320px":"380px",maxWidth:I?"340px":"390px",width:"100%",display:"flex",flexDirection:"column",borderRadius:"10px",fontFamily:"'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif",backgroundColor:l?"#000000":"#ffffff",padding:I?"30px 24px":"18px 28px"},children:[n.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:"center",marginBottom:"10px"},children:[t?n.jsx("a",{href:e||"/",target:"_self",rel:"noopener noreferrer",children:n.jsx("img",{src:t,alt:"Logo",style:{height:"50px",width:"50px",marginBottom:"10px"}})}):n.jsx(Se,{size:40,color:a,style:{marginBottom:"10px"}}),n.jsx("h2",{style:{fontSize:"24px",fontWeight:700,color:z,margin:0},children:c==="login"?r:m===1?"Forgot Password":"Reset Password"}),n.jsx("p",{style:{fontSize:"14px",color:R},children:c==="login"?s:"Follow the steps to reset your password"})]}),c==="login"&&n.jsxs("form",{onSubmit:X,style:{display:"flex",flexDirection:"column",gap:"14px"},children:[n.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"4px"},children:[n.jsx("label",{htmlFor:"login-email",style:{fontSize:"14px",fontWeight:500,color:l?"#ffffff":"#000000"},children:"Email Address"}),n.jsxs("div",{style:{position:"relative"},children:[n.jsx(ce,{size:20,style:{position:"absolute",left:"14px",top:"50%",transform:"translateY(-50%)",color:R}}),n.jsx("input",{id:"login-email",type:"email",placeholder:"Enter your email",value:v,onChange:$=>U($.target.value),style:E})]})]}),n.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"4px"},children:[n.jsx("label",{htmlFor:"login-password",style:{fontSize:"14px",fontWeight:500,color:l?"#ffffff":"#000000"},children:"Password"}),n.jsxs("div",{style:{position:"relative"},children:[n.jsx(we,{size:20,style:{position:"absolute",left:"14px",top:"50%",transform:"translateY(-50%)",color:R}}),n.jsx("input",{id:"login-password",type:P?"text":"password",placeholder:"Enter your password",value:q,onChange:$=>F($.target.value),style:E}),n.jsx("button",{type:"button",onClick:()=>_(!P),style:{position:"absolute",right:"14px",padding:"4px",top:"50%",transform:"translateY(-50%)",background:"transparent",border:"none",color:R,cursor:"pointer"},children:P?n.jsx(nt,{size:20}):n.jsx(st,{size:20})})]})]}),n.jsxs("div",{style:{display:"flex",justifyContent:"space-between",fontSize:"13px"},children:[h&&n.jsx("a",{href:h,style:{color:a,textDecoration:"none",fontWeight:500},children:"Create new account"}),n.jsx("button",{type:"button",onClick:()=>j("forgot"),style:{background:"none",border:"none",color:a,fontWeight:500,cursor:"pointer"},children:"Forgot password?"})]}),n.jsx("button",{type:"submit",disabled:T,style:{padding:"12px",background:i,color:"#fff",border:"none",borderRadius:"10px",fontSize:"14px",fontWeight:600},children:T?"Signing In...":"Sign In"})]}),c==="forgot"&&n.jsxs("form",{onSubmit:m===1?k:x,style:{display:"flex",flexDirection:"column",gap:"14px"},children:[m===1?n.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"4px"},children:[n.jsx("label",{htmlFor:"forgot-email",style:{fontSize:"14px",fontWeight:500,color:l?"#ffffff":"#000000"},children:"Email Address"}),n.jsxs("div",{style:{position:"relative"},children:[n.jsx(ce,{size:20,style:{position:"absolute",left:"14px",top:"50%",transform:"translateY(-50%)",color:R}}),n.jsx("input",{id:"forgot-email",type:"email",name:"email",placeholder:"Enter your email",value:V.email,onChange:f,style:E})]})]}):n.jsxs(n.Fragment,{children:[n.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"6px"},children:[n.jsx("label",{htmlFor:"otp",style:{fontSize:"14px",fontWeight:500,color:l?"#ffffff":"#000000"},children:"One-Time Password (OTP)"}),n.jsxs("div",{style:{position:"relative"},children:[n.jsx(tr,{size:20,style:{position:"absolute",left:"14px",top:"50%",transform:"translateY(-50%)",color:R}}),n.jsx("input",{id:"otp",type:"text",name:"otp",placeholder:"Enter OTP",value:V.otp,onChange:f,style:E})]})]}),n.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"6px"},children:[n.jsx("label",{htmlFor:"newPassword",style:{fontSize:"14px",fontWeight:500,color:l?"#ffffff":"#000000"},children:"New Password"}),n.jsxs("div",{style:{position:"relative"},children:[n.jsx(we,{size:20,style:{position:"absolute",left:"14px",top:"50%",transform:"translateY(-50%)",color:R}}),n.jsx("input",{id:"newPassword",type:"password",name:"newPassword",placeholder:"Enter new password",value:V.newPassword,onChange:f,style:E})]})]})]}),n.jsx("button",{type:"submit",disabled:T,style:{padding:"12px",background:i,color:"#fff",border:"none",fontSize:"14px",borderRadius:"10px",fontWeight:600},children:T?"Please wait...":m===1?"Send Reset OTP":"Reset Password"}),n.jsx("button",{type:"button",onClick:()=>{j("login"),A(1)},style:{background:"none",border:"none",fontSize:"14px",color:R,marginTop:"6px",cursor:"pointer"},children:"Back to Login"})]}),g&&n.jsxs("div",{style:{marginTop:"16px",padding:"12px",borderRadius:"12px",fontSize:"14px",display:"flex",alignItems:"center",gap:"10px",backgroundColor:g.type==="success"?`${a}15`:"rgba(239,68,68,0.1)",border:g.type==="success"?`1px solid ${a}30`:"1px solid rgba(239,68,68,0.3)",color:g.type==="success"?a:"#ef4444"},children:[g.type==="success"?n.jsx(de,{size:20}):n.jsx(le,{size:20}),n.jsx("span",{children:g.text})]}),n.jsxs("div",{style:{textAlign:"center",fontSize:"12px",color:R,marginTop:"16px",padding:"0 4px"},children:["Secure authentication powered by"," ",n.jsx("span",{style:{color:a,fontWeight:600},children:"Neuctra Authix"})]})]})})},rs=({children:t,fallback:e=null,className:r,width:s,height:o})=>{const[a,i]=w.useState(()=>{if(typeof window>"u")return!1;try{const l=localStorage.getItem("userInfo");return!!(l&&l!=="undefined"&&l!=="null")}catch{return!1}});return w.useEffect(()=>{const l=()=>{if(!(typeof window>"u"))try{const h=localStorage.getItem("userInfo");i(!!(h&&h!=="undefined"&&h!=="null"))}catch{i(!1)}};return window.addEventListener("storage",l),()=>{window.removeEventListener("storage",l)}},[]),a?n.jsx("div",{className:r,style:{display:"flex",alignItems:"center",width:s,height:o},children:t}):typeof e=="function"?e():e},ns=({children:t,fallback:e=null,className:r,width:s,height:o})=>{const[a,i]=w.useState(()=>{if(typeof window>"u")return!0;try{const l=localStorage.getItem("userInfo");return!l||l==="undefined"||l==="null"}catch{return!0}});return w.useEffect(()=>{const l=()=>{try{const h=localStorage.getItem("userInfo");i(!h||h==="undefined"||h==="null")}catch{i(!0)}};return l(),window.addEventListener("storage",l),()=>window.removeEventListener("storage",l)},[]),a?n.jsx("div",{className:r,style:{display:"flex",alignItems:"center",width:s,height:o},children:t}):typeof e=="function"?e():e},ss=({isOpen:t,onClose:e,onSuccess:r,onError:s,userId:o,token:a,colors:i})=>{const{baseUrl:l,apiKey:h,appId:d}=ue(),[u,b]=w.useState(!1),[y,S]=w.useState(""),[c,j]=w.useState("warning"),[m,A]=w.useState(!1);if(w.useEffect(()=>{if(typeof window>"u")return;const g=()=>{A(window.innerWidth<640)};return g(),window.addEventListener("resize",g),()=>window.removeEventListener("resize",g)},[]),!t)return null;const P=async()=>{b(!0),j("processing");try{const{data:g}=await W.delete(`${l}/users/delete/${o}`,{data:{appId:d},headers:{"x-api-key":h}});g.success?(r(g.message||"Account deleted successfully"),j("success"),setTimeout(()=>{localStorage.removeItem("userInfo"),localStorage.removeItem("userToken"),window.location.href="/"},2e3)):(s(g.message||"Failed to delete account"),j("warning"))}catch(g){s(g.response?.data?.message||"Something went wrong"),j("warning")}finally{b(!1)}},_=y.toLowerCase()==="delete my account",T=g=>{g.target===g.currentTarget&&c!=="processing"&&c!=="success"&&e()},M=()=>{switch(c){case"warning":return n.jsxs(n.Fragment,{children:[n.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",marginBottom:"24px",gap:"16px"},children:[n.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"12px",flex:1},children:[n.jsx("div",{style:{width:"40px",height:"40px",borderRadius:"12px",background:"linear-gradient(135deg, #ef4444, #dc2626)",display:"flex",alignItems:"center",justifyContent:"center",color:"white",flexShrink:0},children:n.jsx(We,{size:20})}),n.jsx("div",{children:n.jsx("h3",{style:{color:i.textPrimary,margin:0,fontSize:"20px",fontWeight:700,lineHeight:"1.3"},children:"Delete Account"})})]}),n.jsx("button",{onClick:e,"aria-label":"Close modal",style:{background:"transparent",border:"none",color:i.textTertiary,cursor:"pointer",padding:"8px",borderRadius:"8px",width:"36px",height:"36px",display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0,transition:"all 0.2s ease"},onMouseOver:g=>{g.currentTarget.style.backgroundColor=i.border,g.currentTarget.style.color=i.textPrimary},onMouseOut:g=>{g.currentTarget.style.backgroundColor="transparent",g.currentTarget.style.color=i.textTertiary},children:n.jsx(Pe,{size:20})})]}),n.jsxs("div",{style:{display:"flex",gap:"16px",padding:"20px",background:`${i.error}15`,border:`1px solid ${i.error}30`,borderRadius:"12px",marginBottom:"20px"},children:[n.jsx("div",{style:{color:i.error,flexShrink:0,display:"flex",alignItems:"flex-start"},children:n.jsx(nr,{size:24})}),n.jsxs("div",{style:{flex:1},children:[n.jsx("h4",{style:{color:i.textPrimary,margin:"0 0 12px 0",fontSize:"16px",fontWeight:600},children:"Before you proceed..."}),n.jsx("div",{style:{display:"flex",flexDirection:"column",gap:"10px"},children:[{icon:n.jsx(Mn,{size:16}),text:"All your data will be permanently deleted"},{icon:n.jsx(Gn,{size:16}),text:"This action cannot be reversed"},{icon:n.jsx(it,{size:16}),text:"You will lose access to all services"}].map((g,O)=>n.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"10px",fontSize:"14px",color:i.textSecondary},children:[n.jsx("div",{style:{color:i.error,flexShrink:0},children:g.icon}),n.jsx("span",{children:g.text})]},O))})]})]}),n.jsxs("div",{style:{display:"flex",gap:"12px",flexDirection:m?"column-reverse":"row",justifyContent:"flex-end",alignItems:"stretch"},children:[n.jsx("button",{onClick:e,style:{padding:"10px 24px",borderRadius:"10px",border:`1.5px solid ${i.border}`,background:"transparent",color:i.textPrimary,fontSize:"14px",fontWeight:500,cursor:"pointer",flex:m?"none":1,minWidth:m?"100%":"120px",transition:"all 0.2s ease"},onMouseOver:g=>{g.currentTarget.style.backgroundColor=i.border,g.currentTarget.style.transform="translateY(-1px)"},onMouseOut:g=>{g.currentTarget.style.backgroundColor="transparent",g.currentTarget.style.transform="translateY(0)"},children:"Cancel"}),n.jsxs("button",{onClick:()=>j("confirmation"),style:{padding:"10px 24px",borderRadius:"10px",border:"none",background:"linear-gradient(135deg, #ef4444, #dc2626)",color:"white",fontSize:"14px",fontWeight:600,cursor:"pointer",flex:m?"none":1,minWidth:m?"100%":"140px",display:"flex",alignItems:"center",justifyContent:"center",gap:"8px",transition:"all 0.2s ease",boxShadow:"0 4px 12px rgba(239, 68, 68, 0.4)"},onMouseOver:g=>{g.currentTarget.style.transform="translateY(-1px)",g.currentTarget.style.boxShadow="0 6px 20px rgba(239, 68, 68, 0.5)"},onMouseOut:g=>{g.currentTarget.style.transform="translateY(0)",g.currentTarget.style.boxShadow="0 4px 12px rgba(239, 68, 68, 0.4)"},children:[n.jsx(We,{size:16}),"Continue to Delete"]})]})]});case"confirmation":return n.jsxs(n.Fragment,{children:[n.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"12px",marginBottom:"24px"},children:[n.jsx("div",{style:{width:"40px",height:"40px",borderRadius:"12px",background:"linear-gradient(135deg, #f59e0b, #d97706)",display:"flex",alignItems:"center",justifyContent:"center",color:"white",flexShrink:0},children:n.jsx(nr,{size:24})}),n.jsx("div",{style:{flex:1},children:n.jsx("h3",{style:{color:i.textPrimary,margin:0,fontSize:"20px",fontWeight:700,lineHeight:"1.3"},children:"Confirm Deletion"})})]}),n.jsxs("div",{style:{marginBottom:"24px"},children:[n.jsxs("p",{style:{color:i.textSecondary,marginBottom:"16px",fontSize:"14px",lineHeight:"1.5"},children:["Type"," ",n.jsx("strong",{style:{color:i.textPrimary},children:'"delete my account"'})," ","to confirm:"]}),n.jsx("input",{type:"text",value:y,onChange:g=>S(g.target.value),placeholder:"delete my account",style:{width:"100%",padding:"14px 16px",borderRadius:"10px",border:`2px solid ${_?i.success:i.error}`,backgroundColor:"transparent",color:i.textPrimary,fontSize:"15px",outline:"none",transition:"all 0.2s ease",boxSizing:"border-box"},onFocus:g=>{g.target.style.boxShadow=`0 0 0 3px ${i.accent}20`},onBlur:g=>{g.target.style.boxShadow="none"},autoFocus:!0}),_&&n.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"8px",marginTop:"10px",color:i.success,fontSize:"14px",fontWeight:500},children:[n.jsx(rt,{size:16}),n.jsx("span",{children:"Confirmation accepted"})]})]}),n.jsxs("div",{style:{display:"flex",gap:"12px",flexDirection:"column-reverse",justifyContent:"flex-end",alignItems:"stretch"},children:[n.jsx("button",{onClick:()=>{j("warning"),S("")},style:{padding:"10px 24px",borderRadius:"10px",border:`1.5px solid ${i.border}`,background:"transparent",color:i.textPrimary,fontSize:"14px",fontWeight:500,cursor:"pointer",flex:m?"none":1,minWidth:m?"100%":"120px",transition:"all 0.2s ease"},onMouseOver:g=>{g.currentTarget.style.backgroundColor=i.border,g.currentTarget.style.transform="translateY(-1px)"},onMouseOut:g=>{g.currentTarget.style.backgroundColor="transparent",g.currentTarget.style.transform="translateY(0)"},children:"Go Back"}),n.jsxs("button",{onClick:P,disabled:!_||u,style:{padding:"10px 24px",borderRadius:"10px",border:"none",background:"linear-gradient(135deg, #ef4444, #dc2626)",color:"white",fontSize:"14px",fontWeight:600,cursor:!_||u?"not-allowed":"pointer",flex:m?"none":1,minWidth:m?"100%":"140px",opacity:!_||u?.6:1,display:"flex",alignItems:"center",justifyContent:"center",gap:"8px",transition:"all 0.2s ease",boxShadow:!_||u?"none":"0 4px 12px rgba(239, 68, 68, 0.4)"},onMouseOver:g=>{_&&!u&&(g.currentTarget.style.transform="translateY(-1px)",g.currentTarget.style.boxShadow="0 6px 20px rgba(239, 68, 68, 0.5)")},onMouseOut:g=>{_&&!u&&(g.currentTarget.style.transform="translateY(0)",g.currentTarget.style.boxShadow="0 4px 12px rgba(239, 68, 68, 0.4)")},children:[n.jsx(We,{size:16}),"Yes, Delete My Account"]})]})]});case"processing":return n.jsxs(n.Fragment,{children:[n.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"12px",marginBottom:"24px"},children:[n.jsx("div",{style:{width:"40px",height:"40px",borderRadius:"12px",background:"linear-gradient(135deg, #6b7280, #4b5563)",display:"flex",alignItems:"center",justifyContent:"center",color:"white",flexShrink:0},children:n.jsx(oe,{size:20,style:{animation:"spin 1s linear infinite"}})}),n.jsxs("div",{style:{flex:1},children:[n.jsx("h3",{style:{color:i.textPrimary,margin:0,fontSize:"20px",fontWeight:700,lineHeight:"1.3"},children:"Deleting Account"}),n.jsx("p",{style:{color:i.textTertiary,margin:"4px 0 0 0",fontSize:"14px",lineHeight:"1.4"},children:"Please wait while we process your request"})]})]}),n.jsx("div",{style:{marginBottom:"20px"},children:n.jsx("div",{style:{display:"flex",flexDirection:"column",gap:"12px"},children:[{text:"Removing your data",active:!0},{text:"Closing active sessions",active:!1},{text:"Finalizing deletion",active:!1}].map((g,O)=>n.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"12px",padding:"12px",borderRadius:"8px",transition:"all 0.2s ease",backgroundColor:g.active?`${i.accent}10`:"transparent"},children:[n.jsx("div",{style:{width:"8px",height:"8px",borderRadius:"50%",backgroundColor:g.active?i.accent:i.textTertiary,transition:"all 0.3s ease",boxShadow:g.active?`0 0 0 4px ${i.accent}20`:"none"}}),n.jsx("span",{style:{fontSize:"14px",color:g.active?i.textPrimary:i.textSecondary,fontWeight:g.active?500:400},children:g.text})]},O))})}),n.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"10px",padding:"16px",background:`${i.accent}10`,borderRadius:"10px",fontSize:"14px",color:i.textSecondary},children:[n.jsx(rr,{size:18,style:{color:i.accent,flexShrink:0}}),n.jsx("span",{children:"You will be redirected to the login page shortly"})]})]});case"success":return n.jsxs(n.Fragment,{children:[n.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"12px",marginBottom:"24px"},children:[n.jsx("div",{style:{width:"40px",height:"40px",borderRadius:"12px",background:"linear-gradient(135deg, #10b981, #059669)",display:"flex",alignItems:"center",justifyContent:"center",color:"white",flexShrink:0},children:n.jsx(rt,{size:20})}),n.jsxs("div",{style:{flex:1},children:[n.jsx("h3",{style:{color:i.textPrimary,margin:0,fontSize:"20px",fontWeight:700,lineHeight:"1.3"},children:"Account Deleted"}),n.jsx("p",{style:{color:i.textTertiary,margin:"4px 0 0 0",fontSize:"14px",lineHeight:"1.4"},children:"Your account has been successfully deleted"})]})]}),n.jsxs("div",{style:{textAlign:"center",padding:"20px",background:`${i.success}10`,border:`1px solid ${i.success}20`,borderRadius:"12px",marginBottom:"24px"},children:[n.jsx(rt,{size:48,style:{color:i.success,marginBottom:"12px",display:"block",margin:"0 auto 12px auto"}}),n.jsx("p",{style:{color:i.textPrimary,fontSize:"16px",fontWeight:600,margin:"0 0 8px 0"},children:"Goodbye!"}),n.jsx("p",{style:{color:i.textSecondary,fontSize:"14px",margin:0,lineHeight:"1.5"},children:"Your account and all associated data have been permanently removed from our systems."})]}),n.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"10px",padding:"16px",background:`${i.accent}10`,borderRadius:"10px",fontSize:"14px",color:i.textSecondary,justifyContent:"center"},children:[n.jsx(oe,{size:16,style:{animation:"spin 1s linear infinite",color:i.accent}}),n.jsx("span",{children:"Redirecting to login page..."})]})]})}};return n.jsxs("div",{style:{position:"fixed",inset:0,background:"rgba(0,0,0,0.8)",backdropFilter:"blur(8px)",display:"flex",alignItems:"center",justifyContent:"center",padding:"16px",zIndex:1e4,animation:"fadeIn 0.3s ease-out"},onClick:T,children:[n.jsx("div",{style:{backgroundColor:i.surface,border:`1px solid ${i.border}`,borderRadius:"20px",width:"100%",maxWidth:"480px",padding:"24px",boxShadow:"0 32px 64px rgba(0,0,0,0.4)",animation:"scaleIn 0.3s ease-out"},className:"delete-modal-container",children:M()}),n.jsx("style",{children:`
208
208
  @keyframes fadeIn {
209
209
  from { opacity: 0; }
210
210
  to { opacity: 1; }
@@ -1,7 +1,7 @@
1
1
  import React, { ReactNode } from "react";
2
2
  interface ReactSignedInProps {
3
3
  children: ReactNode;
4
- fallback?: ReactNode;
4
+ fallback?: ReactNode | (() => ReactNode);
5
5
  className?: string;
6
6
  width?: string;
7
7
  height?: string;
@@ -1 +1 @@
1
- {"version":3,"file":"SignedIn.d.ts","sourceRoot":"","sources":["../../src/react/SignedIn.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,EAAE,SAAS,EAAuB,MAAM,OAAO,CAAC;AAE9D,UAAU,kBAAkB;IAC1B,QAAQ,EAAE,SAAS,CAAC;IACpB,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,eAAO,MAAM,aAAa,EAAE,KAAK,CAAC,EAAE,CAAC,kBAAkB,CAqDtD,CAAC"}
1
+ {"version":3,"file":"SignedIn.d.ts","sourceRoot":"","sources":["../../src/react/SignedIn.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,EAAE,SAAS,EAAuB,MAAM,OAAO,CAAC;AAE9D,UAAU,kBAAkB;IAC1B,QAAQ,EAAE,SAAS,CAAC;IACpB,QAAQ,CAAC,EAAE,SAAS,GAAG,CAAC,MAAM,SAAS,CAAC,CAAC;IACzC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,eAAO,MAAM,aAAa,EAAE,KAAK,CAAC,EAAE,CAAC,kBAAkB,CAsDtD,CAAC"}
@@ -1,16 +1,11 @@
1
1
  import React, { ReactNode } from "react";
2
2
  interface ReactSignedOutProps {
3
3
  children: ReactNode;
4
- fallback?: ReactNode;
4
+ fallback?: ReactNode | (() => ReactNode);
5
5
  className?: string;
6
6
  width?: string;
7
7
  height?: string;
8
8
  }
9
- /**
10
- * ReactSignedOut
11
- * Renders children ONLY when user is NOT signed in.
12
- * Fully SSR-safe and window-safe.
13
- */
14
9
  export declare const ReactSignedOut: React.FC<ReactSignedOutProps>;
15
10
  export {};
16
11
  //# sourceMappingURL=SignedOut.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"SignedOut.d.ts","sourceRoot":"","sources":["../../src/react/SignedOut.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,EAAE,SAAS,EAAuB,MAAM,OAAO,CAAC;AAE9D,UAAU,mBAAmB;IAC3B,QAAQ,EAAE,SAAS,CAAC;IACpB,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED;;;;GAIG;AACH,eAAO,MAAM,cAAc,EAAE,KAAK,CAAC,EAAE,CAAC,mBAAmB,CA+CxD,CAAC"}
1
+ {"version":3,"file":"SignedOut.d.ts","sourceRoot":"","sources":["../../src/react/SignedOut.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,EAAE,SAAS,EAAuB,MAAM,OAAO,CAAC;AAE9D,UAAU,mBAAmB;IAC3B,QAAQ,EAAE,SAAS,CAAC;IACpB,QAAQ,CAAC,EAAE,SAAS,GAAG,CAAC,MAAM,SAAS,CAAC,CAAC;IACzC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,eAAO,MAAM,cAAc,EAAE,KAAK,CAAC,EAAE,CAAC,mBAAmB,CAiDxD,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@neuctra/authix",
3
- "version": "1.1.25",
3
+ "version": "1.1.26",
4
4
  "description": "Universal authentication SDK and UI components for React (v16–v19) with TailwindCSS.",
5
5
  "author": "Taha Asif",
6
6
  "license": "MIT",