1import{r as t,j as e,F as C,B as a,T as v,D as j,k as y,I as E,g as S,i as I,a as R,c as F,e as A,ab as c,H as T,C as B}from"./index-DWQbq_Uo.js";import{C as N}from"./Card-Bc6ZyAVD.js";import{C as k}from"./CircularProgress-DfffzK2t.js";function D(){const[o,m]=t.useState(""),[n,u]=t.useState(""),[l,f]=t.useState(!1),[d,p]=t.useState(!1),[i,x]=t.useState({email:"",password:""}),b=()=>{const s={};return o.trim()?/\S+@\S+\.\S+/.test(o)||(s.email="Invalid email format"):s.email="Customer's email address is required",n.trim()||(s.password="New password is required"),x(s),Object.keys(s).length===0},h=s=>r=>{const{value:w}=r.target;s==="email"?m(w):u(w),x(P=>({...P,[s]:""}))},g=async s=>{if(s.preventDefault(),!!b())try{p(!0);const r=await F(A.admin.passwordReset,"PUT",{email:o,password:n});r&&r.status==="success"?(c.success("Pabbly Customer's Password is updated successfully!"),m(""),u("")):c.error((r==null?void 0:r.message)||"Failed to reset password")}catch(r){console.error("Error resetting password:",r),c.error("Failed to reset password")}finally{p(!1)}};return e.jsx(C,{maxWidth:"sm",children:e.jsxs(N,{children:[e.jsx(a,{sx:{position:"relative",px:2,py:3},children:e.jsx(v,{variant:"h6",children:"Reset Customer Pabbly Account Login Password"})}),e.jsx(j,{}),e.jsxs("form",{onSubmit:g,children:[e.jsx(a,{sx:{px:3,pb:2,mt:3},display:"flex",alignItems:"center",children:e.jsx(a,{width:"100%",children:e.jsx(y,{type:"email",label:"Pabbly Customer's Email",value:o,onChange:h("email"),error:!!i.email,helperText:i.email||"Enter Pabbly customer account email address for which you want to reset Pabbly account login password. E.g. [email protected]",placeholder:"Enter Pabbly customer's Email",fullWidth:!0,variant:"outlined"})})}),e.jsx(a,{sx:{px:3,pb:2},display:"flex",alignItems:"center",children:e.jsx(a,{width:"100%",children:e.jsx(y,{label:"New Password",value:n,onChange:h("password"),error:!!i.password,helperText:i.password,type:l?"text":"password",placeholder:"Enter New Password",fullWidth:!0,variant:"outlined",InputProps:{endAdornment:e.jsx(E,{position:"end",children:e.jsx(S,{onClick:()=>f(!l),edge:"end",children:e.jsx(I,{icon:l?"solar:eye-bold":"solar:eye-closed-bold"})})})}})})}),e.jsx(j,{sx:{borderStyle:"dashed"}}),e.jsx(a,{sx:{p:2,display:"flex",gap:2},children:e.jsx(R,{size:"medium",type:"submit",variant:"contained",color:"primary",disabled:d,startIcon:d&&e.jsx(k,{size:16,color:"inherit"}),children:d?"Resetting...":"Reset Password"})})]})]})})}function H(){return e.jsxs(e.Fragment,{children:[e.jsx(T,{children:e.jsx("title",{children:`Admin - Password Reset - ${B.site.name}`})}),e.jsx(D,{})]})}export{H 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.