import{Bf as n,Ke as c,pa as a,sa as s,sf as o}from"./chunk-JX7WA573.js";var v=(()=>{class i{constructor(t,r,e){this.securityService=t,this.router=r,this.toastr=e}canActivate(t,r){if(this.securityService.isUserAuthenticate()){let e=t.data.claimType;return e&&!this.securityService.hasClaim(e)?(this.toastr.error("You don't have right to access this page"),this.router.navigate(["/"]),!1):!0}else return this.router.navigate(["/login"]),!1}canActivateChild(t,r){if(this.securityService.isUserAuthenticate()){let e=t.data.claimType;return e&&!this.securityService.hasClaim(e)?(this.toastr.error("You don't have right to access this page "),!1):!0}else return this.router.navigate(["login"],{queryParams:{returnUrl:r.url}}),!1}canLoad(t){return this.securityService.isUserAuthenticate()?!0:(this.router.navigate(["login"]),!1)}static{this.\u0275fac=function(r){return new(r||i)(s(n),s(c),s(o))}}static{this.\u0275prov=a({token:i,factory:i.\u0275fac,providedIn:"root"})}}return i})();export{v as a};
