import{r as u,b as h,j as s}from"./app-vYFZLebK.js";import{I as n}from"./InputError-Cj3POQLM.js";import{I as c}from"./InputLabel-B7-VnScM.js";import{P as g}from"./PrimaryButton-Byh_hOgr.js";import{T as p}from"./TextInput-BXnk3iOU.js";import{K as j}from"./transition-6I0c9VKA.js";function I({className:m=""}){const d=u.useRef(),i=u.useRef(),{data:r,setData:a,errors:t,put:w,reset:o,processing:x,recentlySuccessful:f}=h({current_password:"",password:"",password_confirmation:""}),v=e=>{e.preventDefault(),w(route("password.update"),{preserveScroll:!0,onSuccess:()=>o(),onError:l=>{l.password&&(o("password","password_confirmation"),d.current.focus()),l.current_password&&(o("current_password"),i.current.focus())}})};return s.jsxs("section",{className:m,children:[s.jsxs("header",{children:[s.jsx("h2",{className:"text-lg font-black uppercase tracking-widest text-[var(--text-main)]",children:"Update_Security_Cipher"}),s.jsx("p",{className:"mt-1 text-xs font-bold uppercase tracking-widest text-[var(--text-muted)]",children:"Ensure your account is using a long, random password to stay secure."})]}),s.jsxs("form",{onSubmit:v,className:"mt-6 space-y-6",children:[s.jsxs("div",{children:[s.jsx(c,{htmlFor:"current_password",value:"Current_Cipher"}),s.jsx(p,{id:"current_password",ref:i,value:r.current_password,onChange:e=>a("current_password",e.target.value),type:"password",className:"mt-1 block w-full bg-[var(--bg-elevated)]",autoComplete:"current-password"}),s.jsx(n,{message:t.current_password,className:"mt-2"})]}),s.jsxs("div",{children:[s.jsx(c,{htmlFor:"password",value:"New_Cipher"}),s.jsx(p,{id:"password",ref:d,value:r.password,onChange:e=>a("password",e.target.value),type:"password",className:"mt-1 block w-full bg-[var(--bg-elevated)]",autoComplete:"new-password"}),s.jsx(n,{message:t.password,className:"mt-2"})]}),s.jsxs("div",{children:[s.jsx(c,{htmlFor:"password_confirmation",value:"Confirm_Cipher"}),s.jsx(p,{id:"password_confirmation",value:r.password_confirmation,onChange:e=>a("password_confirmation",e.target.value),type:"password",className:"mt-1 block w-full bg-[var(--bg-elevated)]",autoComplete:"new-password"}),s.jsx(n,{message:t.password_confirmation,className:"mt-2"})]}),s.jsxs("div",{className:"flex items-center gap-4",children:[s.jsx(g,{disabled:x,children:"Update_Security"}),s.jsx(j,{show:f,enter:"transition ease-in-out",enterFrom:"opacity-0",leave:"transition ease-in-out",leaveTo:"opacity-0",children:s.jsx("p",{className:"text-sm text-emerald-500 font-bold uppercase tracking-widest",children:"Saved_"})})]})]})]})}export{I as default};
