1import{b,R as y,d as e,u as P,c as k,j as o}from"./index-CL5CXY0i.js";import{r as c}from"./react-CryvJVFI.js";import{I as f}from"./InputField-BbZFdrc6.js";import{B as j}from"./react-toastify.esm-BcQ5eTVB.js";const S=()=>{const[s,a]=c.useState(""),[m,r]=c.useState("");return{resetPassword:async t=>{a(""),r("");try{const n=await b.post(`${y}/api/reset-password`,t);return r("Password has been reset successfully."),n.data}catch(n){return console.error("Reset password error:",n),n.response?a(n.response.data.message||"An error occurred. Please try again."):a("An error occurred. Please try again."),null}},error:s,success:m}},C=e.div` 2 display: flex; 3 height: auto; 4`,v=e.div` 5 display: flex; 6 flex-direction: column; 7 align-items: center; 8 justify-content: space-around; 9 width: 50%; 10 padding: 2rem; 11 background-color: #f3f9ff; 12`,M=e.div` 13 width: 50%; 14 background-image: url("/AdminPanel/Signup/image 1.png"); 15 background-size: cover; 16 background-position: center; 17`,R=e.form` 18 display: flex; 19 flex-direction: column; 20 width: 100%; 21 max-width: 450px; 22`,E=e.img` 23 width: 300px; /* Adjust the size as needed */ 24 margin-bottom: 0.5rem; 25 max-width: 100%; 26 display: block; 27 margin-left: auto; 28 margin-right: auto; 29 object-fit: cover; 30`,z=e.h2` 31 margin-bottom: 1rem; 32 text-align: center; 33 font-family: "Montserrat", sans-serif; // Changed to Montserrat 34 font-size: 32px; 35 font-weight: 600; 36 line-height: 40.16px; 37`;e.p` 38 color: #999; 39 margin-bottom: 2rem; 40 text-align: center; 41 font-family: "Montserrat", sans-serif; // Changed to Montserrat 42 font-size: 16px; 43 font-weight: 500; 44 line-height: 20.08px; 45 color: #1c399d; 46`;e.div` 47 position: relative; 48 margin-bottom: 1rem; 49`;e.input` 50 padding: 0.75rem 2rem; 51 width: 100%; 52 border-radius: 8px; 53 font-size: 16px; 54 outline: none; 55 margin-top: 6px; 56 background-color: #e3f2ff; 57 border: 1px solid ${({error:s})=>s?"#ff0000":"none"}; 58 59 &:hover { 60 background-color: #ffffff; 61 border: 1px solid ${({error:s})=>s?"#ff0000":"#1c399d"}; 62 } 63`;e.span` 64 position: absolute; 65 top: 60%; 66 transform: translateY(-40%); 67 left: 12px; 68`;e.img` 69 width: 16px; 70 height: auto; 71`;e.label` 72 color: #000000; 73 font-family: "Montserrat", sans-serif; // Changed to Montserrat 74 font-size: 14px; 75 font-weight: 400; 76 line-height: 17.57px; 77 text-align: left; 78`;const A=e.button` 79 padding: 0.75rem; 80 background-color: #1c399d; 81 color: #fff; 82 border: none; 83 border-radius: 8px; 84 cursor: pointer; 85 font-family: "Montserrat", sans-serif; // Changed to Montserrat 86 font-size: 24px; 87 font-weight: 500; 88 line-height: 30.12px; 89 90 &:hover { 91 background-color: #155ab6; 92 } 93`,L=e.p` 94 margin-top: 0.5rem; 95 cursor: pointer; 96 text-align: center; 97 font-family: "Montserrat", sans-serif; // Changed to Montserrat 98 font-size: 16px; 99 font-weight: 400; 100 line-height: 20.08px; 101 color: #1c399d; 102 cursor: pointer; 103 &:hover { 104 text-decoration: underline; 105 } 106`,T=e.span` 107 font-family: "Montserrat", sans-serif; // Changed to Montserrat 108 font-size: 16px; 109 font-weight: 600; 110 line-height: 20.08px; 111 text-align: right; 112 color: #1c399d; 113 cursor: pointer; 114`;e.h2` 115 color: #ff0000; 116 margin-top: 5px; 117 font-family: "Montserrat", sans-serif; // Changed to Montserrat 118 font-size: 14px; 119 font-weight: 400; 120 line-height: 17.57px; 121 text-align: left; 122`;const U=()=>{const s=P(),a=k(),{resetPassword:m,error:r,success:g}=S(),[t,n]=c.useState({email:"",token:"",password:"",password_confirmation:""}),[h,x]=c.useState(!1);c.useEffect(()=>{const i=new URLSearchParams(a.search),l=i.get("email"),p=i.get("token");l&&p?(n(u=>({...u,email:decodeURIComponent(l),token:p})),x(!0)):x(!1)},[a]);const d=i=>{const{name:l,value:p}=i.target;n(u=>({...u,[l]:p}))},w=async i=>{if(i.preventDefault(),!t.password||!t.password_confirmation||!t.token){alert("Please fill in all fields.");return}if(t.password!==t.password_confirmation){alert("Passwords do not match.");return}await m(t)&&j.success("Password has been reset successfully.")};return o.jsxs(C,{children:[o.jsxs(v,{children:[o.jsx(E,{src:"/AdminPanel/Signup/image 2.png",alt:"Logo"}),o.jsx(z,{children:"Reset Password"}),o.jsxs(R,{onSubmit:w,children:[o.jsx(f,{type:"email",name:"email",value:t.email,onChange:d,placeholder:"Enter your email",label:"Enter Email",iconSrc:"/AdminPanel/Signup/Email.png",altText:"Email Icon",error:r.email,disabled:h}),o.jsx(f,{type:"text",name:"token",value:t.token,onChange:d,placeholder:"Enter your token",label:"Token",iconSrc:"/AdminPanel/Signup/Password.png",altText:"Token Icon",error:r.token,disabled:h}),o.jsx(f,{type:"password",name:"password",value:t.password,onChange:d,placeholder:"Enter new password",label:"Password",iconSrc:"/AdminPanel/Signup/Password.png",altText:"Password Icon",error:r.password}),o.jsx(f,{type:"password",name:"password_confirmation",value:t.password_confirmation,onChange:d,placeholder:"Confirm new password",label:"Confirm Password",iconSrc:"/AdminPanel/Signup/Password.png",altText:"Password Icon",error:r.password_confirmation}),r&&o.jsx("p",{style:{color:"red",fontFamily:"Montserrat",fontSize:"14px",fontWeight:"700",textAlign:"center",padding:"10px"},children:r}),g&&o.jsx("p",{style:{color:"green",fontFamily:"Montserrat",fontSize:"14px",fontWeight:"700",textAlign:"center",padding:"10px"},children:g}),o.jsx(A,{type:"submit",children:"Reset Password"})]}),o.jsxs(L,{children:["Remember your password?"," ",o.jsx(T,{onClick:()=>
122s("/login"),children:"Log in"})]})]}),o.jsx(M,{})]})};export{U 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.