1import{u as m,r as o,j as e,C as j,L as u,e as S}from"./index.BCxWgvzH.js";function k(){const[d]=m(),[n,h]=o.useState(""),[s,p]=o.useState(""),[i,x]=o.useState(""),[a,l]=o.useState(!1),[c,r]=o.useState(""),[f,b]=o.useState(!1);o.useEffect(()=>{const t=d.get("token");t?h(t):r("No reset token provided")},[d]);const y=async()=>{if(r(""),!s||!i){r("Please fill in all fields");return}if(s.length<8){r("Password must be at least 8 characters");return}if(s!==i){r("Passwords do not match");return}l(!0);try{const g=await fetch("https://aayuos-backend-production-fffha0dvbvaahcg4.centralus-01.azurewebsites.net/api/auth/reset-password",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({token:n,newPassword:s})}),w=await g.json();g.ok?b(!0):r(w.error||"Password reset failed")}catch(t){r("Network error. Please try again."),console.error("Reset password error:",t)}finally{l(!1)}};return f?e.jsx("div",{style:{minHeight:"100vh",background:"linear-gradient(135deg, #292C61 0%, #1a1d47 100%)",display:"flex",alignItems:"center",justifyContent:"center",padding:"20px"},children:e.jsxs("div",{style:{background:"white",borderRadius:16,padding:"48px",maxWidth:500,width:"100%",boxShadow:"0 20px 60px rgba(0, 0, 0, 0.3)",textAlign:"center"},children:[e.jsx("div",{style:{width:64,height:64,background:"#d1fae5",borderRadius:"50%",display:"flex",alignItems:"center",justifyContent:"center",margin:"0 auto 24px",color:"#059669"},children:e.jsx(j,{size:32})}),e.jsx("h1",{className:"os-page-title",style:{marginBottom:12},children:"Password Reset Successfully!"}),e.jsx("p",{style:{fontSize:15,color:"#6b7280",marginBottom:32},children:"You can now sign in with your new password."}),e.jsx(u,{to:"/signin",style:{display:"inline-block",padding:"12px 32px",background:"#292C61",color:"white",borderRadius:8,textDecoration:"none",fontWeight:600,fontSize:16},children:"Sign In"})]})}):e.jsx("div",{style:{minHeight:"100vh",background:"linear-gradient(135deg, #292C61 0%, #1a1d47 100%)",display:"flex",alignItems:"center",justifyContent:"center",padding:"20px"},children:e.jsxs("div",{style:{background:"white",borderRadius:16,padding:"48px",maxWidth:450,width:"100%",boxShadow:"0 20px 60px rgba(0, 0, 0, 0.3)"},children:[e.jsx("div",{style:{width:64,height:64,background:"#f3f4f6",borderRadius:12,display:"flex",alignItems:"center",justifyContent:"center",margin:"0 auto 24px"},children:e.jsx("img",{src:S,alt:"Aayu OS",style:{width:40,height:40}})}),e.jsx("h1",{className:"os-page-title",style:{marginBottom:8,textAlign:"center"},children:"Reset Your Password"}),e.jsx("p",{style:{fontSize:15,color:"#6b7280",marginBottom:32,textAlign:"center"},children:"Enter your new password below"}),c&&e.jsx("div",{style:{padding:"12px 16px",background:"#fee2e2",border:"1px solid #fecaca",borderRadius:8,marginBottom:20,fontSize:14,color:"#991b1b"},children:c}),e.jsxs("div",{style:{marginBottom:18},children:[e.jsx("label",{style:{display:"block",marginBottom:8,fontSize:14,fontWeight:600,color:"#374151"},children:"New Password"}),e.jsx("input",{type:"password",value:s,onChange:t=>p(t.target.value),placeholder:"Enter new password",style:{width:"100%",padding:"13px 16px",border:"1.5px solid #e5e7eb",borderRadius:8,fontSize:15,color:"#1f2937",outline:"none",fontFamily:"inherit"},onFocus:t=>{t.currentTarget.style.borderColor="#292C61",t.currentTarget.style.boxShadow="0 0 0 4px rgba(41, 44, 97, 0.08)"},onBlur:t=>{t.currentTarget.style.borderColor="#e5e7eb",t.currentTarget.style.boxShadow="none"}})]}),e.jsxs("div",{style:{marginBottom:24},children:[e.jsx("label",{style:{display:"block",marginBottom:8,fontSize:14,fontWeight:600,color:"#374151"},children:"Confirm Password"}),e.jsx("input",{type:"password",value:i,onChange:t=>x(t.target.value),placeholder:"Confirm new password",style:{width:"100%",padding:"13px 16px",border:"1.5px solid #e5e7eb",borderRadius:8,fontSize:15,color:"#1f2937",outline:"none",fontFamily:"inherit"},onFocus:t=>{t.currentTarget.style.borderColor="#292C61",t.currentTarget.style.boxShadow="0 0 0 4px rgba(41, 44, 97, 0.08)"},onBlur:t=>{t.currentTarget.style.borderColor="#e5e7eb",t.currentTarget.style.boxShadow="none"}})]}),e.jsx("button",{onClick:y,disabled:a||!n,style:{width:"100%",padding:"15px",background:a||!n?"#9ca3af":"#292C61",color:"#ffffff",border:"none",borderRadius:8,fontSize:16,fontWeight:600,cursor:a||!n?"not-allowed":"pointer",marginBottom:20},children:a?"Resetting...":"Reset Password"}),e.jsxs("p",{style:{textAlign:"center",fontSize:14,color:"#6b7280"},children:["Remember your password?"," ",e.jsx(u,{to:"/signin",style:{color:"#292C61",textDecoration:"none",fontWeight:600},children:"Sign in"})]})]})})}export{k as default};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.