import{q as n,d as u,i,as as c}from"./index-OtVJl4GC.js";import"./vendor-ClLR6ncd.js";import"./lodash-ZyeDnt0e.js";function p(){return n().username}function m(){const{signin:a}=n();return u(async({username:r,currentPassword:t,newPassword:s})=>{const e=new URL(`/users/${r}/password`,window.origin);try{await i({url:e.toString(),method:"POST",data:s,auth:{username:r,password:t}})}catch(o){throw o instanceof c?new Error("Incorrect current password"):o}},{onSuccess:(r,{username:t,newPassword:s})=>{a({username:t,password:s})}})}export{m as a,p as u};
