1import{d as E,o as R,q as B,A as F,u as P,c as b,b as A,f as C,j as s,t as I,D as L,B as D,x as T,H as N,h as y,i as W,k as _,J as z,w as f,K as H,r as g,z as J,m as M,T as x,F as U,L as q}from"./index-6arvOuHO.js";const G=({userInfo:r})=>{const n=E(),{register:t,handleSubmit:u,formState:{errors:c,touchedFields:w}}=R({resolver:B(F),mode:"onBlur"}),a=P(),o=b(),i=A(),{mutateAsync:d}=C("user/set-password/",null,!1),p=async e=>{try{const j={...r,password:e?.password},l=await d(j);if(i(l),!l?.success)return;const h=l?.data?.access,m=l?.data?.refresh;if(h&&m){const{exp:S,...k}=y(h),{exp:v}=y(m);W({access:h,refresh:m,accessExp:S,refreshExp:v,rememberMe:!0}),n({type:_,payload:k}),a(z(o.search));return}a(f("/login",o.search))}catch{i()}};return s.jsxs(I,{onSubmit:u(p),children:[L.map(e=>s.jsx(D,{children:s.jsx(T,{fullWidth:!0,type:e.type,label:e.label,id:e.name,register:t,errors:c,icon:e.icon})},e.name)),s.jsx(N,{type:"submit",variant:"contained",size:"lg",fullWidth:!0,children:"Confirm"})]})},O=()=>{const{state:r,search:n}=b(),[t]=H(),[u,c]=g.useState({email:"",otp:""}),w=P();return g.useEffect(()=>{let{email:a,otp:o}=r||{};if(a&&o)c({email:a,otp:o});else if(t.get("token")){const{email:i,otp:d,set_password_type:p}=y(t.get("token"));c({email:i,otp:d,set_password_type:p})}else w(f("/login",n))},[r,t]),s.jsx(J,{children:s.jsxs(M,{children:[s.jsx(x,{variant:"h4-semibold",align:"left",children:"Set new password"}),s.jsx(x,{variant:"body",mt:1,mb:5,children:"Reset your password with just a few click."}),s.jsx(G,{userInfo:u}),s.jsx(U,{justifyContent:"center",mt:2.5,children:s.jsx(q,{to:f("/login",n),children:s.jsx(x,{variant:"body",children:"Back to login"})})})]})})};export{O 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.