1import{u as S,b as k,d as E,r as t,j as e,L as f}from"./vendor-react-OyOj6DeB.js";import{a as L}from"./vendor-axios-NIGUFBhG.js";function R(){const w=S(),{token:v}=k(),[l]=E(),i=v||l.get("token")||"",b=t.useMemo(()=>l.get("email")||"",[l]),[c,N]=t.useState(b),[n,y]=t.useState(""),[o,C]=t.useState(""),[u,d]=t.useState(!1),[m,r]=t.useState(""),P=async a=>{var h,p,g,x;if(a.preventDefault(),n!==o){r("ÐаÑоли не ÑовпадаÑÑ.");return}if(!i){r("ÐÐµÑ Ñокена ÑбÑоÑа. ÐапÑоÑиÑе ÑÑÑÐ»ÐºÑ Ñнова.");return}d(!0),r("");try{const{data:s}=await L.post("/api/client/reset-password",{token:i,email:c.trim(),password:n,password_confirmation:o});if(s!=null&&s.success){w("/login",{replace:!0,state:{passwordReset:!0}});return}r((s==null?void 0:s.message)||"Ðе ÑдалоÑÑ ÑмениÑÑ Ð¿Ð°ÑолÑ")}catch(s){const j=(p=(h=s==null?void 0:s.response)==null?void 0:h.data)==null?void 0:p.errors;r(j?Object.values(j).flat().filter(Boolean).join(" "):((x=(g=s==null?void 0:s.response)==null?void 0:g.data)==null?void 0:x.message)||"ÐÑибка ÑÐ¼ÐµÐ½Ñ Ð¿Ð°ÑолÑ")}finally{d(!1)}};return e.jsx("div",{className:"auth-page dg-page",children:e.jsx("div",{className:"smk-shell",children:e.jsxs("div",{className:"auth-card",children:[e.jsx("h1",{className:"auth-card__title",children:"ÐовÑй паÑолÑ"}),e.jsxs("form",{onSubmit:P,className:"auth-form",children:[e.jsxs("label",{className:"auth-field",children:[e.jsx("span",{children:"E-mail"}),e.jsx("input",{type:"email",value:c,onChange:a=>N(a.target.value),required:!0,autoComplete:"email",placeholder:"[email protected]"})]}),e.jsxs("label",{className:"auth-field",children:[e.jsx("span",{children:"ÐовÑй паÑолÑ"}),e.jsx("input",{type:"password",value:n,onChange:a=>y(a.target.value),required:!0,minLength:6,autoComplete:"new-password",placeholder:"ÐинимÑм 6 Ñимволов"})]}),e.jsxs("label",{className:"auth-field",children:[e.jsx("span",{children:"ÐовÑÐ¾Ñ Ð¿Ð°ÑолÑ"}),e.jsx("input",{type:"password",value:o,onChange:a=>C(a.target.value),required:!0,minLength:6,autoComplete:"new-password",placeholder:"ÐÑÑ Ñаз"})]}),m?e.jsx("p",{className:"auth-err",children:m}):null,e.jsx("button",{type:"submit",disabled:u,className:"auth-submit btn-hackett-solid",children:u?"СоÑ
Ñанениеâ¦":"СоÑ
ÑаниÑÑ Ð¿Ð°ÑолÑ"}),e.jsxs("p",{className:"auth-hint",children:[e.jsx(f,{to:"/forgot-password",children:"ÐапÑоÑиÑÑ ÑÑÑÐ»ÐºÑ Ñнова"})," · ",e.jsx(f,{to:"/login",children:"ÐÑ
од"})]})]})]})})})}export{R 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.