1import{i as M}from"./chunk-4RNQWIV6.js";import{c as o,m,p as C}from"./chunk-CJHUNIC5.js";import{Ad as y,Hb as d,Ra as c,Ub as u,Vb as p,Z as s,_a as _,lc as g,ld as O,mc as h,ta as i,ub as r,vb as l,wb as f,wd as v,xd as P}from"./chunk-BUIIXSYE.js";var N=(()=>{class n{constructor(){this._authService=i(C),this._searchService=i(M),this._router=i(O),this._tenantKey=localStorage.getItem(m)}ngOnInit(){let t=this._authService.userInfo,e=t.logoutOption??o.GOTO_LOGIN_PAGE,a=t.usedLoginMethod?.toLowerCase()==="passwordlogin";if(this.clearTenant(),this.clearPreviousState(),t.external)return this.logoutWithRouting(`${this._tenantKey}/login/external`);if(a||e===o.GOTO_LOGIN_PAGE)return this.logoutWithRouting(this.buildLoginRoute());if(e===o.GOTO_STANDARD_LOGOUT_PAGE){this._authService.logout().subscribe();return}e===o.GOTO_CUSTOM_LOGOUT_PAGE&&this.logoutWithCustomRedirect(t.logoutUrl)}onNavigateToLogin(){this._router.navigateByUrl(`${this._tenantKey}/login`)}clearTenant(){this._tenantKey&&localStorage.removeItem(m)}clearPreviousState(){this._searchService.clearSearchState()}buildLoginRoute(){return this._tenantKey?`${this._tenantKey}/login`:"/login"}logoutWithCustomRedirect(t){let e=t.startsWith("http://")||t.startsWith("https://")?t:`https://${t}`;this._authService.logout().pipe(s(()=>window.location.replace(e))).subscribe()}logoutWithRouting(t){this._authService.logout().pipe(s(()=>{this._router.navigate([t])})).subscribe()}static{this.\u0275fac=function(e){return new(e||n)}}static{this.\u0275cmp=_({type:n,selectors:[["app-logout"]],decls:8,vars:6,consts:[["sprite","icons-large","name","check-mark-large",1,"icon-success"],["data-cy","logoutInfo"],["type","button","data-cy","backToLogin",1,"btn-primary-outline",3,"click"]],template:function(e,a){e&1&&(f(0,"app-icon",0),r(1,"p",1),u(2),g(3,"transloco"),l(),r(4,"button",2),d("click",function(){return a.onNavigateToLogin()}),r(5,"span"),u(6),g(7,"transloco"),l()()),e&2&&(c(2),p(h(3,2,"sign_up.logout_information")),c(4),p(h(7,4,"sign_up.back_to_login")))},dependencies:[y,P,v],styles:["[_nghost-%COMP%]{display:flex;flex-direction:column;gap:calc(var(--spacer) * 2);justify-content:center;margin:auto;width:min(28rem,100%)}[_nghost-%COMP%] h1[_ngcontent-%COMP%], [_nghost-%COMP%] .text-important[_ngcontent-%COMP%]{text-align:center}[_nghost-%COMP%] form[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:calc(var(--spacer) * 2)}[_nghost-%COMP%] .buttons[_ngcontent-%COMP%]{display:flex;gap:var(--spacer);justify-content:flex-end}[_nghost-%COMP%] .buttons[_ngcontent-%COMP%] > button[_ngcontent-%COMP%]{width:100%}[_nghost-%COMP%] .buttons[_ngcontent-%COMP%] button[_ngcontent-%COMP%]:only-child{width:fit-content}[_nghost-%COMP%]{align-items:center}"]})}}return n})();export{N as LogoutComponent};
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.