import{d as p}from"./chunk-WRGPHU2N.js";import{b as E,g as N}from"./chunk-OSIMEBN6.js";import{$ as M,Aa as R,G as w,Ga as P,Ha as _,Ja as j,La as A,M as T,O as D,Ta as B,Z as L,ab as F,bb as O,cb as Y}from"./chunk-CMTPQJ7E.js";import{E as v,Fc as m,Gc as u,Hc as k,L as C,Qc as I,Vc as d,Wc as h,_ as b,ac as l,bc as s,ia as a,ib as c,ob as o,qc as y,u as f,ya as S,yb as x}from"./chunk-AWE6TXVF.js";import"./chunk-2AVGQ2MQ.js";var ie=(()=>{class r{#t;#e;#o;constructor(e,t,n,g,U){this.authService=e,this.router=t,this.apiService=n,this.titleService=g,this.userRoleService=U,this.title="Logout Page",this.#t=a(T),this.#e=a(A),this.colorMode=this.#e.colorMode,this.#o=a(S),this.currentYear=new Date().getFullYear(),this.#e.localStorageItemName.set("theme-default"),this.#e.eventName.set("ColorSchemeChange"),this.#t.queryParams.pipe(C(1),f(i=>i.theme?.match(/^[A-Za-z0-9\s]+/)?.[0]),v(i=>["dark","light","auto"].includes(i)),b(i=>{this.colorMode.set(i)}),M(this.#o)).subscribe(),this.titleService.setTitle(this.title)}ngOnInit(){try{this.logout()}catch(e){console.error("ngOnInit error in LogoutComponent:",e)}}logout(){try{let e=localStorage.getItem("theme-default");this.authService.clearToken(),localStorage.clear(),e&&localStorage.setItem("theme-default",e),this.userRoleService.clear(),this.router.url!=="/logout"&&this.router.navigate(["/logout"])}catch(e){console.error("Logout failed:",e)}}goToLogin(){this.authService.clearToken(),this.router.navigate(["/login"])}static{this.\u0275fac=function(t){return new(t||r)(o(E),o(D),o(p),o(w),o(N))}}static{this.\u0275cmp=x({type:r,selectors:[["app-logout"]],features:[I([p])],decls:19,vars:7,consts:[[1,"bg-light","dark:bg-transparent","min-vh-100","d-flex","flex-row","align-items-center"],["breakpoint","md"],[1,"justify-content-center"],["lg","10","xl","8"],[1,"p-4"],["cForm",""],["xs","6"],["cButton","","color","primary",1,"logout-btn",3,"click"],[1,"text-center"],["href","https://www.crashplan.com","target","_blank",2,"color","#062D4D","text-decoration","none"]],template:function(t,n){t&1&&(l(0,"div",0)(1,"c-container",1)(2,"c-row",2)(3,"c-col",3)(4,"c-card-group")(5,"c-card",4)(6,"c-card-body")(7,"form",5)(8,"h2"),m(9),d(10,"translate"),s(),l(11,"c-row")(12,"c-col",6)(13,"button",7),y("click",function(){return n.goToLogin()}),m(14),d(15,"translate"),s()()()()()()()()()()(),l(16,"div",8)(17,"a",9),m(18),s()()),t&2&&(c(9),u(h(10,3,"You have been successfully logged out")),c(5),u(h(15,5,"Login to Portal")),c(4),k("\xA9 CrashPlan ",n.currentYear," "))},dependencies:[F,Y,O,j,P,_,B,R,L],styles:[".logout-btn[_ngcontent-%COMP%]{color:#fff!important;background-color:#35b7f4!important;border-color:#35b7f4!important;transition:none}.logout-btn[_ngcontent-%COMP%]:hover{transition:background-color .3s ease-in-out,box-shadow .3s ease-in-out;background-color:#35b7f4!important;box-shadow:0 0 5px #0003}"]})}}return r})();export{ie as LogoutComponent};
