1const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["index.zeRBWPW7.js","app.C9rH3Nfe.js","vendor.kmuNf4Gr.js","css/styles.BuZ8GZAp.css","index.CRLvso-D.js","input-mixin.BU399U4z.js","TwoFactor.-N5dQ6W3.js","index.Bfo01JqR.js"])))=>i.map(i=>d[i]); 2import{_ as k,a as d,r as t,e as F,m as _,b as v,c as C}from"./app.C9rH3Nfe.js";import{r as c,d as u,y as p,u as a,x as l,h as m,w,B as S,f,C as I,e as P,D as N,E as M,G as V,H as D,z as h,A as x}from"./vendor.kmuNf4Gr.js";/* empty css */C(["LoginForm.mounted"]);const A="app_portal_login",R={name:"LoginForm",emits:["hideForm","logged"],props:{dataForTwoFactor:{type:Object,default:()=>{}}},data(){return{url:"/portal/login",loading:!1,formData:{login:"",code:""},errorName:"",password:"",security_code_1:"",security_code_2:"",showTwoFactorForm:!1,hideMainFormForInsertTwoFactorCode:!1,dataForTwoFactorProcess:{},permissionResendCode:!1}},mounted(...r){return t("LoginForm.mounted",()=>{this.security_code_1=this.model.security_code_1,this.security_code_2=this.model.security_code_2},this,r)},methods:{submitForm(...r){return t("LoginForm.submitForm",()=>{if(this.$refs.form.$el.reportValidity())if(this.two_factor_authentication_status&&F(this.formData.code))this.processTwoFactorStep();else{const e=this.getParamsForReturn("return");e!==null&&(this.url+=`?return=${e}`),this.$nextTick(()=>{this.$refs.form.submit()})}},this,r)},processTwoFactorStep(...r){return t("LoginForm.processTwoFactorStep",()=>{this.loading=!0,this.dataForTwoFactorProcess={login:this.formData.login,security_code_1:this.security_code_1,security_code_2:this.password_hash(this.password,this.security_code_2)},this.$refs.twoFactor.onTwoFactorGenerate(this.dataForTwoFactorProcess)},this,r)},getParamsForReturn(...r){return t("LoginForm.getParamsForReturn",e=>{let i={};return window.location.href.replace(window.location.hash,"").replace(/[?&]+([^=&]+)=?([^&]*)?/gi,(g,s,o)=>{i[s]=o!==void 0?o:""}),i[e]?i[e]:null},this,r)},password_hash(...r){return t("LoginForm.password_hash",(e,i)=>_(v(_(e)+_(i))),this,r)},beforeSend(...r){return t("LoginForm.beforeSend",e=>(e.security_code_1=this.security_code_1,e.security_code_2=this.password_hash(this.password,this.security_code_2),e),this,r)},onFormSuccess(...r){return t("LoginForm.onFormSuccess",e=>{this.loading=!1,e.result==="success"?this.successHandler(e):e.result==="new_codes"?(this.setNewCodes(e),this.submitForm()):e.result==="error"?this.errorName=e.data:e.result==="regenerate_csrf"?(this.setNewCodes(e),window.csrf.setCsrfToken("_csrf_token",e.csrf_token),this.errorName=e.data):this.errorName=e.data},this,r)},successHandler(...r){return t("LoginForm.successHandler",e=>{if(this.isIframe){window.open(`${window.location.origin}/portal/dashboard`,"_blank"),this.$emit("logged");return}if(e.return){let{hash:i}=document.location;window.top.location.href=e.return+(i||"")}else window.top.location.href="/portal/dashboard"},this,r)},setNewCodes(...r){return t("LoginForm.setNewCodes",e=>{this.security_code_1=e.security_code_1,this.security_code_2=e.security_code_2},this,r)},errorTwoFactor(...r){return t("LoginForm.errorTwoFactor",e=>{this.loading=!1,this.errorName=e.data},this,r)},successTwoFactor(...r){return t("LoginForm.successTwoFactor",e=>{this.loading=!1,e.permission_resend_code&&(this.permissionResendCode=e.permission_resend_code),this.hideMainFormForInsertTwoFactorCode=!0,this.errorName=e.data},this,r)},setEnteredCode(...r){return t("LoginForm.setEnteredCode",e=>{this.formData.code=e,this.submitForm()},this,r)},changeModelValue(...r){return t("LoginForm.changeModelValue",()=>{this.errorName=""},this,r)}},computed:{...x(A,["auth_by","isIframe","model","attributes_meta","two_factor_authentication_status","reset_password"]),errorMessage(...r){return t("LoginForm.errorMessage",()=>{let e="";switch(this.errorName){case"incorrect_login":e=this.$t("portal","Login or password incorrect");break;case"incorrect_code":e=this.$t("portal","Incorrect code");break;case"incorrect_csrf":e=this.$t("common","The session has expired. Please re-login.");break;case"incorrect_data":e=this.$t("common","The data is incorrect. Please contact our technical support.");break;case"code_not_sent":e=this.$t("portal","The one-time code could not be sent to your contact details. Please contact our technical support.");break;default:e="";break}return e},this,r)},attributesMeta(...r){return t("LoginForm.attributesMeta",()=>this.attributes_meta.attributes,this,r)},placeholderForAuthBy(...r){return t("LoginForm.placeholderForAuthBy",()=>this.auth_by==="email"?this.$t("portal","Enter email"):this.$t("portal","Enter login"),this,r)},labelForAuthBy(...r){return t("LoginForm.labelForAuthBy",()=>this.auth_by==="email"?this.$t("portal","Email"):this.$t("portal","Login"),this,r)},formTitle(...r){return t("LoginForm.formTitle",()=>this.isIframe?this.$t("portal","Customer portal"):this.hideMainFormForInsertTwoFactorCode?this.$t("portal","Two-factor authentication"):this.$t("portal","Sign in"),this,r)},hasError(...r){return t("LoginForm.hasError",()=>!F(this.errorName),this,r)}},components:{XForm:h(()=>d(()=>import("./index.zeRBWPW7.js"),__vite__mapDeps([0,1,2,3]))),XTextField:h(()=>d(()=>import("./index.CRLvso-D.js"),__vite__mapDeps([4,1,2,3,5]))),TwoFactor:h(()=>d(()=>import("./TwoFactor.-N5dQ6W3.js"),__vite__mapDeps([6,1,2,3]))),XInputPassword:h(()=>d(()=>import("./index.Bfo01JqR.js"),__vite__mapDeps([7,1,2,3,5])))}},B={class:"form-holder"},O={class:"login-portal-heading"},H={class:"form-input-group"},G={class:"col-form-label"},U={class:"form-input-group"},X={class:"col-form-label"},q={key:0,id:"error"},z={id:"static",class:"login-error"},j={class:"login-footer"},W=["value"];function J(r,e,i,g,s,o){const b=c("x-text-field"),y=c("x-input-password"),T=c("RouterLink"),L=c("two-factor"),E=c("x-form");return u(),p("div",B,[a("div",O,l(o.formTitle),1),m(E,{id:"loginForm",ref:"form",method:"POST",role:"form",autocomplete:"on",data:s.formData,class:D(["form-signin",{"has-error":o.hasError}]),"form-data-send":!0,url:s.url,"attributes-meta":o.attributesMeta,"check-unsaved-data-before-leave-page":!1,"before-send":o.beforeSend,onSuccess:o.onFormSuccess},{default:w(()=>[s.hideMainFormForInsertTwoFactorCode?f("",!0):(u(),p(S,{key:0},[a("div",H,[a("label",G,l(o.labelForAuthBy),1),m(b,{id:"login",ref:"loginInput","model-value":s.formData.login,options:{tabindex:"1",autocomplete:"username",placeholder:o.placeholderForAuthBy,disabled:s.loading,autofocus:!0,required:!0},"onUpdate:modelValue":e[0]||(e[0]=n=>s.formData.login=n),onInput:o.changeModelValue}
2,null,8,["model-value","options","onInput"])]),a("div",U,[a("label",X,l(r.$t("portal","Password")),1),m(y,{"model-value":s.password,"generate-password":!1,"allow-autocomplete":!0,options:{tabindex:"2",id:"password",name:"LoginForm[password]",autocomplete:"old-password",disabled:s.loading,autofocus:!0,required:!0,placeholder:r.$t("portal","Enter password")},"onUpdate:modelValue":e[1]||(e[1]=n=>s.password=n),onInput:o.changeModelValue},null,8,["model-value","options","onInput"])]),s.errorName?(u(),p("div",q,[a("div",z,l(o.errorMessage),1)])):f("",!0),a("div",j,[a("input",{id:"submit",type:"submit",class:"btn btn-primary",value:r.$t("portal","Sign in"),onClick:e[2]||(e[2]=I((...n)=>o.submitForm&&o.submitForm(...n),["prevent"]))},null,8,W),r.reset_password&&!r.isIframe?(u(),P(T,{key:0,to:{name:"portal.reset_password"},class:"link reset-password-link"},{default:w(()=>[N(l(r.$t("portal","Forgot your password?")),1)]),_:1})):f("",!0)])],64)),M(m(L,{ref:"twoFactor","data-for-two-factor":s.dataForTwoFactorProcess,"permission-resend-code":s.permissionResendCode,"error-message":o.errorMessage,onError:o.errorTwoFactor,onSuccess:o.successTwoFactor,onSubmit:o.setEnteredCode},null,8,["data-for-two-factor","permission-resend-code","error-message","onError","onSuccess","onSubmit"]),[[V,s.hideMainFormForInsertTwoFactorCode]])]),_:1},8,["data","class","url","attributes-meta","before-send","onSuccess"])])}const Z=k(R,[["render",J]]);export{Z as default}; 3//# sourceMappingURL=LoginForm.DW-F8N1G.js.map
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.