1import{L as a}from"./GuestLayout.7630fc2d.js";import{n,f as i,a as o}from"./app.ff4df053.js";import{e as l}from"./errors.d68ea6c3.js";import{B as d}from"./BaseCard.a8e9e1ef.js";const c={name:"ResetPassword",components:{BaseCard:d,LoginLayout:a},mixins:[i],data(){return{token:this.$route.query.token,email:this.$route.query.email,form:{password:"",password_confirmation:""},rules:{password:[{required:!0,message:this.$t("Please enter your password.")},{min:8,message:this.$t("Please follow the password rules. (lowercase, uppercase, number and special character)")}],password_confirmation:{required:!0,message:this.$t("Please enter your password.")}},reset:!1}},computed:{isPasswordLinkExpired(){const t=new Date,s=new Date(t.getUTCFullYear(),t.getUTCMonth(),t.getUTCDate(),t.getUTCHours(),t.getUTCMinutes(),t.getUTCSeconds());return new Date(this.$route.query.expires_at)<s}},mounted(){this.isPasswordLinkExpired||this.$refs.password.focus()},methods:{async resetPassword(){this.$validateForm(this.$refs.resetPasswordForm)&&o.get("sanctum/csrf-cookie").then(()=>{this.resetPasswordRequest({email:this.email,password:this.form.password,password_confirmation:this.form.password_confirmation,token:this.token})})},resetPasswordRequest(t){return o.post("/reset-password",t).then(()=>{this.reset=!0}).catch(()=>{this.$msg.err(this.$t("Something went wrong. Try to reset your password again."))})},resendResetPasswordLink(){this.$setLoading(!0),o.get("sanctum/csrf-cookie").then(()=>{o.post("/forgot-password",{email:this.$route.query.email}).then(()=>{this.$msg.ok(this.$t("Password reset link successfully sent")),this.toLogin()}).catch(t=>{l(t)}).finally(()=>{this.$setLoading(!1)})})},toLogin(){this.$router.push({name:"login"})}}};var m=function(){var s=this,e=s._self._c;return e("LoginLayout",[e("BaseCard",{staticClass:"login-form-container py-2 px-4",attrs:{"full-height":!1}},[e("div",{staticClass:"login-title-container"},[e("h3",{staticClass:"login-title"},[s._v(" "+s._s(s.$t("Reset password"))+" ")])]),s.isPasswordLinkExpired?e("div",{staticClass:"form-container"},[e("ElAlert",{staticClass:"mb-4",attrs:{type:"error",closable:!1}},[s._v(" "+s._s(s.$t("This password reset link has already expired."))+" ")]),e("ElButton",{on:{click:s.toLogin}},[s._v(s._s(s.$t("Back to login")))]),e("ElButton",{attrs:{type:"primary"},on:{click:s.resendResetPasswordLink}},[s._v(" "+s._s(s.$t("Resend link"))+" ")])],1):e("div",{staticClass:"form-container"},[s.reset?s._e():e("ElForm",{ref:"resetPasswordForm",attrs:{model:s.form,rules:s.rules},nativeOn:{keydown:function(r){return!r.type.indexOf("key")&&s._k(r.keyCode,"enter",13,r.key,"Enter")?null:s.resetPassword.apply(null,arguments)}}},[e("ElFormItem",{attrs:{label:s.$t("New password"),prop:"password"}},[e("ElInput",{ref:"password",attrs:{id:"validation_new_password",type:"password"},model:{value:s.form.password,callback:function(r){s.$set(s.form,"password",r)},expression:"form.password"}})],1),e("ElFormItem",{attrs:{label:s.$t("Confirm password"),prop:"password_confirmation"}},[e("el-input",{ref:"password_confirmation",attrs:{type:"password"},model:{value:s.form.password_confirmation,callback:function(r){s.$set(s.form,"password_confirmation",r)},expression:"form.password_confirmation"}})],1),e("div",{staticClass:"d-flex justify-content-between align-items-center"},[e("RouterLink",{attrs:{to:{name:"login"}}},[e("ElButton",[s._v(s._s(s.$t("Back to login")))])],1),e("ElButton",{attrs:{type:"primary"},on:{click:s.resetPassword}},[s._v(" "+s._s(s.$t("Next"))+" ")])],1)],1),s.reset?e("div",[e("ElAlert",{staticClass:"mb-4",attrs:{type:"success",closable:!1}},[s._v(" "+s._s(s.$t("The password was successfully reset."))+" ")]),e("RouterLink",{attrs:{to:{name:"login"}}},[e("ElButton",[s._v(s._s(s.$t("Back to login")))])],1)],1):s._e()],1)])],1)},p=[],u=n(c,m,p,!1,null,null,null,null);const g=u.exports;export{g as default};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.