1import{a as w}from"./chunk-MFY6GL67.js";import"./chunk-FD55Q7R4.js";import"./chunk-LBFZVMBI.js";import{l as d,m as v}from"./chunk-SQXH55RY.js";import"./chunk-FZLMV5FP.js";import"./chunk-2RZNBXEW.js";import"./chunk-WUS6VI32.js";import{sa as g}from"./chunk-LKIBVTZY.js";import"./chunk-IXSVJUWF.js";import"./chunk-VXMZGT4Q.js";import{Ia as p,Ja as c,Ka as u,ha as l,nb as h,p as s}from"./chunk-LZGEQQYD.js";import{b as a}from"./chunk-BW2TMJN6.js";import"./chunk-RNQ7BUHW.js";var C=(()=>{let e=class e{constructor(t,i,o){this.loginService=t,this.globalData=i,this.worldcupAuthFlow=o,this.popupNavigateEventName="login-popup-route-change",this.checkInterval=null,this.subscriptions=new a,this.isLeavingViaPopupNavigation=!1,this.handlePopupNavigationAway=n=>{this.isLeavingViaPopupNavigation=!0,this.clearCheckInterval();let m=this.getPopupTargetUrl(n);if(this.worldcupAuthFlow.isRegisterPage(m)){this.worldcupAuthFlow.startFlow();return}this.worldcupAuthFlow.clearFlow()}}ngOnInit(){if(window.addEventListener(this.popupNavigateEventName,this.handlePopupNavigationAway),this.worldcupAuthFlow.startFlow(),this.subscribeLoginState(),this.globalData.isLogin){this.worldcupAuthFlow.completeIfWorldcupPopup();return}this.openLoginPopup()}ngOnDestroy(){window.removeEventListener(this.popupNavigateEventName,this.handlePopupNavigationAway),this.subscriptions.unsubscribe(),this.clearCheckInterval()}subscribeLoginState(){let t=!0;this.subscriptions.add(this.globalData.loginSub$.subscribe(i=>{if(t){t=!1;return}i&&this.globalData.isLogin&&this.worldcupAuthFlow.completeIfWorldcupPopup()}))}openLoginPopup(){this.loginService.openLoginPopup(),this.startLoginClosePolling()}startLoginClosePolling(){this.clearCheckInterval(),this.checkInterval=setInterval(()=>{!this.loginService.shouldShowLoginPopup&&!this.globalData.isLogin&&!this.isLeavingViaPopupNavigation&&(this.worldcupAuthFlow.cancelIfWorldcupPopup(),this.clearCheckInterval())},200)}getPopupTargetUrl(t){var n;let o=(n=t.detail)==null?void 0:n.url;return typeof o=="string"&&o.trim().length>0?o:null}clearCheckInterval(){this.checkInterval&&(clearInterval(this.checkInterval),this.checkInterval=null)}};e.\u0275fac=function(i){return new(i||e)(l(v),l(g),l(d))},e.\u0275cmp=s({type:e,selectors:[["app-worldcup-login"]],standalone:!0,features:[h],decls:3,vars:0,consts:[[1,"worldcup-login-overlay"],[1,"worldcup-login-container"]],template:function(i,o){i&1&&(p(0,"div",0)(1,"div",1),u(2,"app-login-popup"),c()())},dependencies:[w],styles:["[_nghost-%COMP%]{display:block;width:100%;height:100%}.worldcup-login-overlay[_ngcontent-%COMP%]{position:fixed;top:0;right:0;bottom:0;left:0;background:#000;display:flex;justify-content:center;align-items:center;z-index:1000}.worldcup-login-container[_ngcontent-%COMP%]{position:relative;z-index:1001}.worldcup-login-container[_ngcontent-%COMP%] .mask.popup{display:none}"]});let r=e;return r})();export{C as WorldcupLoginComponent};
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.