import{a as r,N as t,i as a}from"./Notification-DvN0JRUo.js";import{R as o}from"./ResourceCard-yOMgNZxg.js";import{a as i}from"./fetch_utils-5_lonpo8.js";import"./SimpleIcon-CSfStBgf.js";import"./file-text-uxXBGtbS.js";let n=r({components:{ResourceCard:o,Notification:t},data(){return{error:null,success:!1,loading:!1,passwordData:{newUsername:"sunshine",newPassword:"",confirmNewPassword:""}}},methods:{save(){this.error=null,this.loading=!0,i("./api/password",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(this.passwordData)}).then(s=>{this.loading=!1,s.status===200?s.json().then(e=>{this.success=e.status,this.success===!0?setTimeout(()=>{document.location.reload()},5e3):this.error=e.error}):this.error="Internal Server Error"})}}});a(n);
