import{aD as u,an as l,ap as c,aH as d,x as p,k as x,b3 as j,a2 as g,j as s,a1 as w,T as e,am as b,a3 as n,B as f,L as h}from"./main-TIUJvpaR.js";import{G as y,A as N}from"./auth-layout-DWQg2Sxo.js";import{L as F}from"./external-link-DvqU4uvd.js";function P(t){return x.post("auth/reset-password",t).then(a=>a.data)}function R(t){const a=u();return l({mutationFn:P,onSuccess:()=>{a("/login",{replace:!0}),d(p("Your password has been reset!"))},onError:r=>c(r,t)})}function S(){const{token:t}=j(),a=g({defaultValues:{token:t}}),r=R(a),m=s.jsx(e,{message:"Reset your account password"}),i=s.jsx(e,{values:{a:o=>s.jsx(h,{className:F,to:"/register",children:o})},message:"Don't have an account? <a>Sign up.</a>"});return s.jsx(y,{children:s.jsxs(N,{heading:m,message:i,children:[s.jsx(w,{children:s.jsx(e,{message:"Reset Password"})}),s.jsxs(b,{form:a,onSubmit:o=>{r.mutate(o)},children:[s.jsx(n,{className:"mb-32",name:"email",type:"email",label:s.jsx(e,{message:"Email"}),required:!0}),s.jsx(n,{className:"mb-32",name:"password",type:"password",label:s.jsx(e,{message:"New password"}),required:!0}),s.jsx(n,{className:"mb-32",name:"password_confirmation",type:"password",label:s.jsx(e,{message:"Confirm password"}),required:!0}),s.jsx(f,{className:"block w-full",type:"submit",variant:"flat",color:"primary",size:"md",disabled:r.isPending,children:s.jsx(e,{message:"Reset password"})})]})]})})}export{S as Component};
