import{d as g,s as f,x as v,a as V,o as b,w as r,g as a,u as s,i as y,j as t,f as x,l,ar as k,O as I,a2 as $}from"./app-Cb9hmj6k.js";import{_ as u}from"./InputError.vue_vue_type_script_setup_true_lang-C7IEX2zR.js";import{a as S}from"./AppLayout.vue_vue_type_script_setup_true_lang-CteAxl0C.js";import{_ as P,a as T}from"./Layout.vue_vue_type_script_setup_true_lang-BUO1b7TX.js";import{_ as B}from"./AppLogoIcon.vue_vue_type_script_setup_true_lang-DKWl2XLX.js";import{_ as m}from"./Input.vue_vue_type_script_setup_true_lang-t_rUv_4v.js";import{_ as c}from"./Label.vue_vue_type_script_setup_true_lang-CCRw-4E2.js";import"./index-hboZUdbT.js";import"./RovingFocusGroup-CP1IPgEn.js";import"./index-bRFR14ax.js";import"./Separator.vue_vue_type_script_setup_true_lang-BOE17VcD.js";const E={class:"space-y-6"},M={class:"grid gap-2"},N={class:"grid gap-2"},U={class:"grid gap-2"},C={class:"flex items-center gap-4"},H={class:"text-sm text-neutral-600"},Q=g({__name:"Password",setup(L){const _=[{title:"Настройки пароля",href:"/settings/password"}],d=f(null),i=f(null),e=v({current_password:"",password:"",password_confirmation:""}),w=()=>{e.put(route("password.update"),{preserveScroll:!0,onSuccess:()=>e.reset(),onError:p=>{p.password&&(e.reset("password","password_confirmation"),d.value instanceof HTMLInputElement&&d.value.focus()),p.current_password&&(e.reset("current_password"),i.value instanceof HTMLInputElement&&i.value.focus())}})};return(p,o)=>(b(),V(S,{breadcrumbs:_},{default:r(()=>[a(s(y),{title:"Настройки пароля"}),a(P,null,{default:r(()=>[t("div",E,[a(T,{title:"Обновить пароль",description:"Убедитесь, что в вашей учетной записи используется длинный случайный пароль для обеспечения безопасности."}),t("form",{onSubmit:x(w,["prevent"]),class:"space-y-6"},[t("div",M,[a(s(c),{for:"current_password"},{default:r(()=>o[3]||(o[3]=[l("Текущий пароль")])),_:1,__:[3]}),a(s(m),{id:"current_password",ref_key:"currentPasswordInput",ref:i,modelValue:s(e).current_password,"onUpdate:modelValue":o[0]||(o[0]=n=>s(e).current_password=n),type:"password",class:"mt-1 block w-full",autocomplete:"current-password",placeholder:"Текущий пароль"},null,8,["modelValue"]),a(u,{message:s(e).errors.current_password},null,8,["message"])]),t("div",N,[a(s(c),{for:"password"},{default:r(()=>o[4]||(o[4]=[l("Новый пароль")])),_:1,__:[4]}),a(s(m),{id:"password",ref_key:"passwordInput",ref:d,modelValue:s(e).password,"onUpdate:modelValue":o[1]||(o[1]=n=>s(e).password=n),type:"password",class:"mt-1 block w-full",autocomplete:"new-password",placeholder:"Новый пароль"},null,8,["modelValue"]),a(u,{message:s(e).errors.password},null,8,["message"])]),t("div",U,[a(s(c),{for:"password_confirmation"},{default:r(()=>o[5]||(o[5]=[l("Подтвердите пароль")])),_:1,__:[5]}),a(s(m),{id:"password_confirmation",modelValue:s(e).password_confirmation,"onUpdate:modelValue":o[2]||(o[2]=n=>s(e).password_confirmation=n),type:"password",class:"mt-1 block w-full",autocomplete:"new-password",placeholder:"Подтвердите пароль"},null,8,["modelValue"]),a(u,{message:s(e).errors.password_confirmation},null,8,["message"])]),t("div",C,[a(s(B),{disabled:s(e).processing},{default:r(()=>o[6]||(o[6]=[l("Сохранить пароль")])),_:1,__:[6]},8,["disabled"]),a(k,{"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:r(()=>[I(t("p",H,"Сохранено.",512),[[$,s(e).recentlySuccessful]])]),_:1})])],32)])]),_:1})]),_:1}))}});export{Q as default};
