import{At as e,C as t,D as n,E as r,H as i,S as a,T as o,b as s,ft as c,i as l,m as u,nt as d,o as f,yt as p}from"./app-r2SMcdpu.js";import{n as m,r as h,t as g}from"./TextInput-IAw8Ne2B.js";import{t as _}from"./PrimaryButton-zow5epdV.js";var v={class:`flex items-center gap-4`},y={key:0,class:`text-sm text-gray-600 dark:text-gray-400`},b=n({__name:`UpdatePasswordForm`,setup(e){let n=c(null),b=c(null),x=l({current_password:``,password:``,password_confirmation:``}),S=()=>{x.put(route(`password.update`),{preserveScroll:!0,onSuccess:()=>{x.reset()},onError:()=>{x.errors.password&&(x.reset(`password`,`password_confirmation`),n.value?.focus()),x.errors.current_password&&(x.reset(`current_password`),b.value?.focus())}})};return(e,c)=>(i(),t(`section`,null,[c[4]||=s(`header`,null,[s(`h2`,{class:`text-lg font-medium text-gray-900 dark:text-gray-100`},` Update Password `),s(`p`,{class:`mt-1 text-sm text-gray-600 dark:text-gray-400`},` Ensure your account is using a long, random password to stay secure. `)],-1),s(`form`,{onSubmit:u(S,[`prevent`]),class:`mt-6 space-y-6`},[s(`div`,null,[r(m,{for:`current_password`,value:`Current Password`}),r(g,{id:`current_password`,ref_key:`currentPasswordInput`,ref:b,modelValue:p(x).current_password,"onUpdate:modelValue":c[0]||=e=>p(x).current_password=e,type:`password`,class:`mt-1 block w-full`,autocomplete:`current-password`},null,8,[`modelValue`]),r(h,{message:p(x).errors.current_password,class:`mt-2`},null,8,[`message`])]),s(`div`,null,[r(m,{for:`password`,value:`New Password`}),r(g,{id:`password`,ref_key:`passwordInput`,ref:n,modelValue:p(x).password,"onUpdate:modelValue":c[1]||=e=>p(x).password=e,type:`password`,class:`mt-1 block w-full`,autocomplete:`new-password`},null,8,[`modelValue`]),r(h,{message:p(x).errors.password,class:`mt-2`},null,8,[`message`])]),s(`div`,null,[r(m,{for:`password_confirmation`,value:`Confirm Password`}),r(g,{id:`password_confirmation`,modelValue:p(x).password_confirmation,"onUpdate:modelValue":c[2]||=e=>p(x).password_confirmation=e,type:`password`,class:`mt-1 block w-full`,autocomplete:`new-password`},null,8,[`modelValue`]),r(h,{message:p(x).errors.password_confirmation,class:`mt-2`},null,8,[`message`])]),s(`div`,v,[r(_,{disabled:p(x).processing},{default:d(()=>[...c[3]||=[o(`Save`,-1)]]),_:1},8,[`disabled`]),r(f,{"enter-active-class":`transition ease-in-out`,"enter-from-class":`opacity-0`,"leave-active-class":`transition ease-in-out`,"leave-to-class":`opacity-0`},{default:d(()=>[p(x).recentlySuccessful?(i(),t(`p`,y,` Saved. `)):a(``,!0)]),_:1})])],32)]))}}),x=e({default:()=>S}),S=b;export{x as n,S as t};