PageSourceSearch

https://review-it.ai/assets/ConfirmPassword-BvR19c0K.js

js review-it.ai collected 2026-10-05 12:33:13 UTC 5,191 bytes, 8 lines download raw bytes

1import{f as x,k as e,U as P,a0 as a,C as w,a1 as S}from"./index-7gweHwcy.js";import{c as _,a as p,F as k}from"./index.esm-DreAZqDR.js";import{I as m}from"./Iconify-CvzOmNWw.js";import{J as R,d as z,e as g,G as t,I as u,H as q,n as B,s as L,S as T}from"./App-D2WufwZa.js";import{T as h}from"./TextField-BpEf02nk.js";import{I as f}from"./InputAdornment-RRpQYNvU.js";import{L as A}from"./LoadingButton-JWyYpZe-.js";import"./CircularProgress-DcqZVj3E.js";const F=()=>{const{code:o}=R(),c=z(),[l,j]=x.useState(!1),[d,y]=x.useState(!1),b={new_password:"",confirm_password:""},C=_().shape({new_password:p().required("Password is required").matches(/^(?=.*?[A-Z])(?=.*?[a-z])(?=.*?[0-9])(?=.*?[#!@{}$%^'<>/().=+-]).{8,}$/,`Should contains at least 8 characters, 
2 one digit, 
3 one upper case, 
4 
5        one lower case and 
6
7        one special character' 
8`),confirm_password:p().required("Confirm password is required").test("confirm_password","Password does not match",(s,r)=>{const n=r.from[0].value.new_password;return s===n})});return e.jsx(g,{sx:{width:{xs:"90%",sm:"650px"},p:4,borderRadius:"16px",background:"white",color:"white",border:"1px solid rgba(0, 0, 0, 0.19)",zIndex:3},children:e.jsx(k,{initialValues:b,validationSchema:C,onSubmit:async s=>{try{console.log("values",s);const r=await B("login/resetPassword",{newPassword:s.new_password,code:o,username:JSON.parse(localStorage.getItem("resetUsername")),hash:JSON.parse(localStorage.getItem("hash"))});console.log("forget password",r),r.status==="ok"?swal("Success","Password reset successfully","success").then(()=>{localStorage.removeItem("resetUsername"),localStorage.removeItem("hash"),c("/login")}):swal("Oops...","This password link is expired","error").then(()=>{})}catch{}},children:({errors:s,handleBlur:r,handleChange:n,handleSubmit:I,setFieldValue:W,isSubmitting:v,touched:i,values:$})=>e.jsxs(t,{xs:12,sm:12,md:12,lg:12,xl:12,container:!0,spacing:2,display:"flex",justifyContent:"center",alignItems:"center",children:[e.jsx(t,{item:!0,xs:12,xl:12,display:"flex",justifyContent:"center",alignItems:"center",children:e.jsxs(P,{variant:"h4",color:"black",children:[" ","Reset Password"]})}),e.jsx(t,{item:!0,xs:12,sm:12,md:12,lg:9,children:e.jsx(h,{size:"large",id:"outlined-12",label:"New Password",variant:"outlined",helperText:i.new_password&&s.new_password,required:!0,error:!!(i.new_password&&s.new_password),fullWidth:!0,name:"new_password",type:l?"text":"password",onBlur:r,onChange:n,InputProps:{endAdornment:e.jsx(f,{position:"end",children:e.jsx(u,{onClick:()=>j(!l),edge:"end",children:e.jsx(m,{icon:l?"eva:eye-fill":"eva:eye-off-fill"})})})}})}),e.jsx(t,{item:!0,xs:12,md:8,lg:9,children:e.jsx(h,{size:"large",id:"outlined-13",label:"Confirm Password",variant:"outlined",fullWidth:!0,helperText:i.confirm_password&&s.confirm_password,required:!0,error:!!(i.confirm_password&&s.confirm_password),name:"confirm_password",onBlur:r,onChange:n,type:d?"text":"password",InputProps:{endAdornment:e.jsx(f,{position:"end",children:e.jsx(u,{onClick:()=>y(!d),edge:"end",children:e.jsx(m,{icon:d?"eva:eye-fill":"eva:eye-off-fill"})})})}})}),e.jsx(t,{item:!0,xs:10,md:8,lg:10,xl:10,display:"flex",justifyContent:"center",alignItems:"center",children:e.jsx(A,{fullWidth:!0,size:"large",type:"submit",variant:"contained",loading:v,onClick:I,sx:{borderRadius:"30px"},children:"Reset Password"})}),e.jsx(t,{item:!0,xs:10,display:"flex",justifyContent:"right",alignItems:"right",children:e.jsx(q,{style:{cursor:"pointer"},variant:"subtitle2",underline:"hover",onClick:()=>c("/login"),children:"Remember your password ?"})})]})})})};w(g)(({theme:o})=>({width:"100%",display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"center",backgroundColor:o.palette.primary.main,height:"100%"}));const N=w("div")(({theme:o})=>({margin:"auto",minHeight:"100vh",display:"flex",justifyContent:"center",flexDirection:"column"}));function Z(){return console.log("am in confirm password"),e.jsxs(a,{title:"Login",sx:{position:"relative",width:"100%",height:"100vh",display:"flex",justifyContent:"center",flexDirection:"column",alignItems:"center",background:"white",overflow:"hidden"},children:[e.jsx(a,{sx:{position:"absolute",top:0,right:0,borderRadius:"50%",width:{xs:"300px",sm:"400px",md:"500px",lg:"700px"},height:{xs:"300px",sm:"400px",md:"500px",lg:"700px"},zIndex:2,background:"rgba(143, 177, 227, 1)",transform:"translate(50%, -50%)",filter:"blur(400px)"}}),e.jsx(a,{sx:{position:"absolute",bottom:0,left:0,borderRadius:"50%",width:{xs:"300px",sm:"400px",md:"500px",lg:"700px"},height:{xs:"300px",sm:"400px",md:"500px",lg:"700px"},zIndex:2,background:"rgba(143, 177, 227, 1)",transform:"translate(-50%, 50%)",filter:"blur(400px)"}}),e.jsx(t,{container:!0,children:e.jsx(t,{item:!0,xs:12,md:12,children:e.jsx(L,{disableGutters:!0,maxWidth:"xxl",children:e.jsx(N,{children:e.jsxs(T,{direction:"column",alignItems:"center",spacing:0,children:[e.jsx(a,{sx:{display:"flex",width:"100%",justifyContent:{xs:"center",md:"flex-start"}
8,alignItems:"center",position:"Absolute",top:40,left:40,zIndex:1},children:e.jsx("img",{style:{width:"220px",height:"80px"},src:S,alt:"Logo"})}),e.jsx(F,{})]})})})})})]})}export{Z 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.