import{d as P,r as f,o as q,g as Q,w as d,b as s,e as t,h as $,f as n,aq as k,N as x,i as u,aA as C,v as N,S as I}from"./app-D9-EssCM.js";import{q as _}from"./index-CMWG4mbA.js";import{_ as l}from"./InputError.vue_vue_type_script_setup_true_lang-C-A2YNVC.js";import{_ as S}from"./AppLayout.vue_vue_type_script_setup_true_lang-C-UlPCqH.js";import{_ as T,a as B}from"./Layout.vue_vue_type_script_setup_true_lang-CmwoXg6i.js";import{e as U}from"./index-BA3WRlAQ.js";import{_ as V}from"./index-CcjNLu6f.js";import{_ as m}from"./Input.vue_vue_type_script_setup_true_lang-nLsESaiq.js";import{_ as p}from"./Label.vue_vue_type_script_setup_true_lang-BRSPv2gn.js";import"./useForwardExpose-MNmriUeS.js";import"./VisuallyHidden-DG35s1YI.js";import"./RovingFocusGroup-Diffidi3.js";import"./useArrowNavigation-C6Y-ieo6.js";import"./x-DwmBYYXD.js";import"./_plugin-vue_export-helper-DmjF0He4.js";import"./index-DnLC8ybD.js";import"./index-CKv6rp-i.js";const r=e=>({url:r.url(e),method:"get"});r.definition={methods:["get","head"],url:"/settings/password"};r.url=e=>r.definition.url+_(e);r.get=e=>({url:r.url(e),method:"get"});r.head=e=>({url:r.url(e),method:"head"});const c=e=>({action:r.url(e),method:"get"});c.get=e=>({action:r.url(e),method:"get"});c.head=e=>({action:r.url({[e?.mergeQuery?"mergeQuery":"query"]:{_method:"HEAD",...e?.query??e?.mergeQuery??{}}}),method:"get"});r.form=c;const o=e=>({url:o.url(e),method:"put"});o.definition={methods:["put"],url:"/settings/password"};o.url=e=>o.definition.url+_(e);o.put=e=>({url:o.url(e),method:"put"});const w=e=>({action:o.url({[e?.mergeQuery?"mergeQuery":"query"]:{_method:"PUT",...e?.query??e?.mergeQuery??{}}}),method:"post"});w.put=e=>({action:o.url({[e?.mergeQuery?"mergeQuery":"query"]:{_method:"PUT",...e?.query??e?.mergeQuery??{}}}),method:"post"});o.form=w;const A={edit:r,update:o},D={class:"space-y-6"},E={class:"grid gap-2"},F={class:"grid gap-2"},H={class:"grid gap-2"},j={class:"flex items-center gap-4"},z={class:"text-sm text-neutral-600"},ne=P({__name:"Password",setup(e){const g=[{title:"Password settings",href:U().url}],h=f(null),y=f(null);return(G,a)=>(q(),Q(S,{breadcrumbs:g},{default:d(()=>[s(t($),{title:"Password settings"}),s(T,null,{default:d(()=>[n("div",D,[s(B,{title:"Update password",description:"Ensure your account is using a long, random password to stay secure"}),s(t(k),x(t(A).update.form(),{options:{preserveScroll:!0},"reset-on-success":"","reset-on-error":["password","password_confirmation","current_password"],class:"space-y-6"}),{default:d(({errors:i,processing:v,recentlySuccessful:b})=>[n("div",E,[s(t(p),{for:"current_password"},{default:d(()=>[...a[0]||(a[0]=[u("Current password",-1)])]),_:1}),s(t(m),{id:"current_password",ref_key:"currentPasswordInput",ref:y,name:"current_password",type:"password",class:"mt-1 block w-full",autocomplete:"current-password",placeholder:"Current password"},null,512),s(l,{message:i.current_password},null,8,["message"])]),n("div",F,[s(t(p),{for:"password"},{default:d(()=>[...a[1]||(a[1]=[u("New password",-1)])]),_:1}),s(t(m),{id:"password",ref_key:"passwordInput",ref:h,name:"password",type:"password",class:"mt-1 block w-full",autocomplete:"new-password",placeholder:"New password"},null,512),s(l,{message:i.password},null,8,["message"])]),n("div",H,[s(t(p),{for:"password_confirmation"},{default:d(()=>[...a[2]||(a[2]=[u("Confirm password",-1)])]),_:1}),s(t(m),{id:"password_confirmation",name:"password_confirmation",type:"password",class:"mt-1 block w-full",autocomplete:"new-password",placeholder:"Confirm password"}),s(l,{message:i.password_confirmation},null,8,["message"])]),n("div",j,[s(t(V),{disabled:v,"data-test":"update-password-button"},{default:d(()=>[...a[3]||(a[3]=[u("Save password",-1)])]),_:1},8,["disabled"]),s(C,{"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(()=>[N(n("p",z," Saved. ",512),[[I,b]])]),_:2},1024)])]),_:1},16)])]),_:1})]),_:1}))}});export{ne as default};
