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