1import{j as e}from"./vendor-maps-C15praqj.js";import{r as s,g as t,u as a}from"./vendor-router-DA6yNf3X.js";import{i as r,r as l,V as n}from"./index-CjCZp4kG.js";import{B as o}from"./Banner-Dsw4O-6Q.js";import"./vendor-react-LjgIiSM1.js";import"./vendor-redux-CLO4XTwJ.js";import"./vendor-stripe-Dn1b00Ho.js";function d({title:e,titleId:t,...a},r){return s.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",fill:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":t},a),e?s.createElement("title",{id:t},e):null,s.createElement("path",{fillRule:"evenodd",d:"M3.28 2.22a.75.75 0 0 0-1.06 1.06l10.5 10.5a.75.75 0 1 0 1.06-1.06l-1.322-1.323a7.012 7.012 0 0 0 2.16-3.11.87.87 0 0 0 0-.567A7.003 7.003 0 0 0 4.82 3.76l-1.54-1.54Zm3.196 3.195 1.135 1.136A1.502 1.502 0 0 1 9.45 8.389l1.136 1.135a3 3 0 0 0-4.109-4.109Z",clipRule:"evenodd"}),s.createElement("path",{d:"m7.812 10.994 1.816 1.816A7.003 7.003 0 0 1 1.38 8.28a.87.87 0 0 1 0-.566 6.985 6.985 0 0 1 1.113-2.039l2.513 2.513a3 3 0 0 0 2.806 2.806Z"}))}const i=s.forwardRef(d);function c({title:e,titleId:t,...a},r){return s.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",fill:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":t},a),e?s.createElement("title",{id:t},e):null,s.createElement("path",{d:"M8 9.5a1.5 1.5 0 1 0 0-3 1.5 1.5 0 0 0 0 3Z"}),s.createElement("path",{fillRule:"evenodd",d:"M1.38 8.28a.87.87 0 0 1 0-.566 7.003 7.003 0 0 1 13.238.006.87.87 0 0 1 0 .566A7.003 7.003 0 0 1 1.379 8.28ZM11 8a3 3 0 1 1-6 0 3 3 0 0 1 6 0Z",clipRule:"evenodd"}))}const m=s.forwardRef(c),w=()=>{const[d,c]=s.useState({email:"",otp:Array(6).fill(""),new_password:"",confirm_password:""}),{code:w}=t(),[u,p]=s.useState({}),[x,f]=s.useState(""),[g,h]=s.useState(!1),[v,j]=s.useState(!1),y=a();s.useEffect(()=>{const e=navigator.userAgent;let s=/android/i.test(e)?"Android":/iPhone|iPad|iPod/i.test(e)?"iOS":"Desktop";c(e=>({...e,device_type:s}))},[]);return e.jsx("div",{className:"flex justify-center items-center min-h-screen bg-gradient-to-b from-blue-100 to-white bg-cover",style:{backgroundImage:`url(${o})`},children:e.jsxs("div",{className:"bg-white p-8 rounded-2xl shadow-lg max-w-sm w-full text-center",children:[e.jsx("h2",{className:"text-xl font-semibold pb-4 text-[var(--text-heading)]",children:"Set New Password"}),e.jsxs("form",{onSubmit:async e=>{var s,t;if(e.preventDefault(),!(()=>{let e={};return d.new_password?d.new_password.length<6&&(e.new_password="Password must be at least 6 characters"):e.new_password="Password is required",d.new_password!==d.confirm_password&&(e.confirm_password="Passwords must match"),p(e),0===Object.keys(e).length})())return;Number(d.otp.join(""));const a={token:w,new_password:d.new_password,password_confirmation:d.confirm_password};try{const e=await l({payload:a});200===(null==e?void 0:e.status)&&(n.success("Password reset successfully. Please sign in."),y("/signin"))}catch(r){const e=(null==(s=null==r?void 0:r.data)?void 0:s.error)||(null==(t=null==r?void 0:r.data)?void 0:t.message)||"Something went wrong. Please try again.";n.error(e),f("Error resetting password. Please try again.")}},className:"space-y-3",children:[e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"flex flex-col",children:[e.jsxs("div",{className:"flex items-center border border-gray-300 rounded-lg px-3 py-2",children:[e.jsx(r,{className:"h-5 w-5 text-gray-400 mr-2"}),e.jsx("input",{type:g?"text":"password",placeholder:"New Password",className:"w-full outline-none text-sm",value:d.new_password,onChange:e=>c({...d,new_password:e.target.value})}),e.jsx("button",{type:"button",onClick:()=>h(!g),className:"ml-2 focus:outline-none",children:g?e.jsx(i,{className:"h-5 w-5 text-gray-500"}):e.jsx(m,{className:"h-5 w-5 text-gray-500"})})]}),u.new_password&&e.jsx("p",{className:"text-red-500 text-sm mt-1",children:u.new_password})]}),e.jsxs("div",{className:"flex flex-col",children:[e.jsxs("div",{className:"flex items-center border border-gray-300 rounded-lg px-3 py-2",children:[e.jsx(r,{className:"h-5 w-5 text-gray-400 mr-2"}),e.jsx("input",{type:v?"text":"password",placeholder:"Confirm Password",className:"w-full outline-none text-sm",value:d.confirm_password,onChange:e=>c({...d,confirm_password:e.target.value})}),e.jsx("button",{type:"button",onClick:()=>j(!v),className:"ml-2 focus:outline-none",children:v?e.jsx(i,{className:"h-5 w-5 text-gray-500"}):e.jsx(m,{className:"h-5 w-5 text-gray-500"})})]}),u.confirm_password&&e.jsx("p",{className:"text-red-500 text-sm mt-1",children:u.confirm_password})]})]}),x&&e.jsx("p",{className:"text-red-500 text-sm mt-2",children:x}),e.jsx("button",{type:"submit",className:"my-4 w-full bg-[var(--primary-color)] py-2 rounded-lg font-semibold",children:"Reset Password"})]})]})})};export{w 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.