1import{n as y,r as p,b1 as G,Q as F,b as H,bb as V,bm as $,bl as U,O as A,bi as B,bd as M,be as D,Z as K,ad as q,C as W,H as Q,a7 as z,a6 as S,a5 as Y,bc as Z,a8 as j,bx as J,b7 as X,b8 as x,aB as ee,by as te,K as oe,M as se,bz as ae,br as N,bs as T}from"./index-B184P8Kx.js";import{E as ne}from"./EmailField-DY2q6fiQ.js";import{P as re}from"./PasswordField-BP3XCOEz.js";import{S as ie,_ as le,u as ce}from"./SocialAuthProviders-GQgyE3Xf.js";import{_ as L,q as w,r as ue,R as de,d as me,l as pe,a as ge,u as he}from"./ui-lib-CSML94fI.js";import{s as u,o as m,p as f,D as E,B as g,t as h,b as Ee,aw as fe,ax as Le,a as I,k as d,c as Pe,F as _e,h as P,e as _,E as Ie,b5 as Oe,v as Ae,y as Se,l as Ne}from"./vendors-D_z06TSl.js";import{d as Te}from"./data-test-attrs-CyH4D-m3.js";import{F as C,S as k}from"./metrics-BAeznggB.js";import"./useValidationErrorMessage-DFRIbOQF.js";import"./ErrorKeyHelper-DJqA6PjL.js";const Ce={name:"ForgetPasswordLink",components:{FeLink:w},props:{closeHandler:{type:Function}},emits:["click"],data(){return{FeLinkConfig:ue,routeNames:p}},methods:{async handleClick(){this.$emit("click"),y(this.$route)||await this.closeHandler(),this.$router.push({name:p.remind})}}};function ke(e,t,a,n,o,s){const i=u("FeLink");return m(),f(i,{to:{name:o.routeNames.remind},theme:o.FeLinkConfig.themes.SecondarySmall,"data-test":"forget-password__link",onClick:s.handleClick},{default:E(()=>[g(h(e.$t("RECOVERY.LINK")),1)]),_:1},8,["to","theme","onClick"])}const Fe=L(Ce,[["render",ke]]),we={class:"registration-link"},ve=Ee({__name:"RegistrationLink",props:{closeHandler:{type:Function,required:!0}},setup(e){const t=e,a=F(),n=fe(),o=Le(),{isBettingLayout:s}=G(),i=Pe(()=>{let l=p.registration;return s()?l=p.sportSignUpPage:n.name===p.loginPage&&(l=p.singUpPage),{name:l,query:n.query}});async function c(){a.customTrackEvent({...a.REGISTRATION_EVENTS.CLICK,location:"login"}),await t.closeHandler(),o.push(i.value)}return(l,O)=>(m(),I("div",we,[g(h(l.$t("REGISTRATION.REGISTRATION_LINK"))+" ",1),d(w,{to:i.value,theme:de.SecondarySmall,"data-test":"registration-link","class-link":"text--upper",onClick:c},{default:E(()=>[g(h(l.$t("REGISTRATION.TITLE")),1)]),_:1},8,["to","theme"])]))}}),Re=L(ve,[["__scopeId","data-v-d4879e89"]]),be={name:"LoginMain",components:{UiButton:me,ForgetPasswordLink:Fe,RegistrationLink:Re,EmailField:ne,PasswordField:re,InlineNotification:H,SocialAuthProviders:ie},props:{closeHandler:{type:Function}},setup(){const{validate:e,setErrors:t}=Oe(),{getPlatform:a}=Ae(he()),{showSocialAuthFlow:n}=X(),{socialAuthProviders:o,showSocialAuthProviders:s,setSocialAuthInitiator:i}=x(n()),{challengeNotice:c}=ce();return{challengeNotice:c,getPlatform:a,validate:e,setErrors:t,showSocialAuthProviders:s,socialAuthProviders:o,setSocialAuthInitiator:i,featureFlags:ee}},data(){return{icons:ge,InlineNotificationConfig:J,dataTestAttrs:Te,login:"",password:"",loadingData:!1,serverErrorMessage:"",isShowCaptcha:!1,isGuestUserOnPartialRestrictGeo:j,isGuestUserOnEEGeo:Z}},watch:{login(e){Y(S.GLOBAL,{email:e})}},mounted(){this.setAutocompleteDataToForm(),this.assignCaptchaKey()},methods:{setAutocompleteDataToForm(){const e=z(S.GLOBAL);e!=null&&e.email&&(this.login=e.email)},async assignCaptchaKey(){this.captcha=await Q("login")},async loginHandler(){var n;if(this.isGuestUserOnPartialRestrictGeo)return;const{valid:e,errors:t}=await this.validate();if(!e){A({side:k.frontEnd,component:C.LoginForm,errors:t});return}this.$gtm.customTrackEvent(this.$gtm.LOGIN_EVENTS.POPUP.FORM.SUBMIT);const a={email:this.login,password:this.password,route:this.$route,captcha:this.captcha,custom_login_reg:!1};this.loadingData=!0;try{const o=await B(a);await this.handleSuccessfulLogin(),this.$bus.$emit("user.auth"),this.$gtm.customTrackEvent({...this.$gtm.LOGIN_EVENTS.POPUP.FORM.LOGIN_SUCCESS,userId:o.id,Platform:this.getPlatform&&this.getPlatform.userAgent})}catch(o){const{data:s,status:i}=o;if(s.code===M.EE_LICENSE_BLOCKED){D(s.code);return}const c=s.errors;if(c&&i===422){const l=K(c);this.setErrors(l),A({side:k.backEnd,component:C.LoginForm,errors:q(c)})}else(n=s.required)!=null&&n.includes("one_time_password")&&W.show({name:"two-factor",component:le,props:{closeHandler:this.closeLoginPopup,email:this.login},mobileFriendly:!0,fullScreen:!0});pe.error("Login error",s.errors)}finally{this.loadingData=!1,this.assignCaptchaKey()}},closeLoginPopup(){var e;(e=this.closeHandler)==null||e.call(this)},async handleSuccessfulLogin(){await $({blockedPaths:te,challengeReason:U.Login,closeHandler:this.closeHandler,push:this.$router.push.bind(this.$router),routeName:this.$route.name,routeQuery:this.$route.query})},async handleClickOnForgetPassword(){this.$gtm.customTrackEvent(this.$gtm.LOGIN_EVENTS.POPUP.CLICK.FORGOT_PASS)},sendGAError({eventLabel:e,eventContent:t,errorKey:a}){this.$gtm.customTrackEvent({...this.$gtm.LOGIN_EVENTS.VALIDATION_ERRORS,eventLabel:e,eventContent:t,eventAction:"step1",error_key:a,error_label:this.login.replace("@","||")})},socialAuthAction(e){this.setSocialAuthInitiator(V.login_popup),window.open(e.url,"_self")}}},ye={class:"flex items-center gap-16"};function Ge(e,t,a,n,o,s){const i=u("SocialAuthProviders"),c=u("InlineNotification"),l=u("EmailField"),O=u("PasswordField"),v=u("ForgetPasswordLink"),R=u("UiButton"),b=u("RegistrationLink");return m(),I("form",{class:"login grid gap-y-16 lg:gap-y-24 auto-cols-fr",onSubmit:t[6]||(t[6]=Ie((...r)=>s.loginHandler&&s.loginHandler(...r),["prevent"]))},[n.showSocialAuthProviders?(m(),I(_e,{key:0},[d(i,{providers:n.socialAuthProviders,onOnProviderClick:s.socialAuthAction},{label:E(({provider:r})=>[g(h(e.$t(`SOCIAL_AUTH.PROVIDER.${r.name}.SIGN_IN_LABEL`)),1)]),_:1},8,["providers","onOnProviderClick"]),P("div",ye,[t[7]||(t[7]=P("div",{class:"h-px w-full bg-neutral-200/50"},null,-1)),g(" "+h(e.$t("SEPARATOR"))+" ",1),t[8]||(t[8]=P("div",{class:"h-px w-full bg-neutral-200/50"},null,-1))])],64)):_("",!0),n.challengeNotice?(m(),f(c,{key:1,icon:o.icons.outline.attention3,message:n.challengeNotice,theme:o.InlineNotificationConfig.themes.PrimarySmall},null,8,["icon","message","theme"])):_("",!0),d(l,{modelValue:o.login,"onUpdate:modelValue":t[0]||(t[0]=r=>o.login=r),"data-test":o.dataTestAttrs.loginPopup.EmailInput,label:e.$t("LOGIN.LABELS.EMAIL"),placeholder:e.$t("LOGIN.PLACEHOLDER"),rules:"required|email",name:"email","gtm-validate-name":"LOGIN","onInput:changeOnce":t[1]||(t[1]=r=>e.$gtm.customTrackEvent(e.$gtm.LOGIN_EVENTS.POPUP.CHANGE_FIELD.EMAIL)),"onInput:errorOnce":t[2]||(t[2]=r=>s.sendGAError({eventLabel:"email",eventContent:r.message,errorKey:r.errorKey}))},null,8,["modelValue","data-test","label","placeholder"]),d(O,{modelValue:o.password,"onUpdate:modelValue":t[3]||(t[3]=r=>o.password=r),"data-test":o.dataTestAttrs.loginPopup.PassInput,label:e.$t("LOGIN.LABELS.PASSWORD"),placeholder:e.$t("LOGIN.PASSWORD_PLACEHOLDER"),autocomplete:"current-password",name:"password","onInput:changeOnce":t[4]||(t[4]=r=>e.$gtm.customTrackEvent(e.$gtm.LOGIN_EVENTS.POPUP.CHANGE_FIELD.PASSWORD)),"onInput:errorOnce":t[5]||(t[5]=r=>s.sendGAError({eventLabel:"password",eventContent:r.message,errorKey:r.errorKey}))},null,8,["modelValue","data-test","label","placeholder"]),d(v,{class:"login__forget","close-handler":a.closeHandler,onClick:s.handleClickOnForgetPassword},null,8,["close-handler","onClick"]),d(R,{"data-test":o.dataTestAttrs.loginPopup.Submit,loading:o.loadingData,disabled:o.isGuestUserOnPartialRestrictGeo,class:"login__action","full-width":"",type:"submit"},{default:E(()=>[g(h(e.$t("LOGIN.BUTTON")),1)]),_:1},8,["data-test","loading","disabled"]),o.isGuestUserOnEEGeo?_("",!0):(m(),f(b,{key:2,"close-handler":a.closeHandler},null,8,["close-handler"]))],32)}const He=L(be,[["render",Ge],["__scopeId","data-v-ec32f709"]]),Ve={__name:"LoginPopup",props:{closeHandler:Function},setup(e){const t=F(),a=e,{hideCloseButton:n}=oe();async function o(){if(!ae()){a.closeHandler&&a.closeHandler();return}await N(T.refresh_user,{url:"*"},200),await N(T.close,{url:"*"})}return Se(()=>{t.customTrackEvent(t.LOGIN_EVENTS.POPUP.OPEN)}),(s,i)=>(m(),f(se,{class:"login-popup-container","data-test":"login-popup",title:s.$t("LOGIN.TITLE"),"hide-close-button":Ne(n)},{default:E(()=>[d(He,{"close-handler":o})]),_:1},8,["title","hide-close-button"]))}},Ye=L(Ve,[["__scopeId","data-v-6f1168d0"]]);export{Ye as default}; 2//# sourceMappingURL=LoginPopup-CcsbUxXm.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.