import{Ab as f,Bd as b,Jb as v,Ka as g,Kb as S,Vh as y,aa as r,fa as c,ga as p,gi as w,ib as d,jb as m,of as a,rb as h,xd as C,zc as R}from"./chunk-THW6YIIG.js";import{i as u,l}from"./chunk-PTJGHD3V.js";var k=["root"],Q=(()=>{let i=class i{metaService=r(y);route=r(C);router=r(b);pluginService=r(w);root=R("root");urlSub;ngAfterViewInit(){this.urlSub=this.route.url.subscribe(()=>{this.loadRoute()})}ngOnDestroy(){this.urlSub&&this.urlSub.unsubscribe()}onRootClick(e){let t=e.target;if(!t)return;let o=t.closest("a");if(!o)return;let n=o.getAttribute("href")||"";!o.target&&n.startsWith("/")&&(e.preventDefault(),e.stopPropagation(),this.router.navigateByUrl(n))}loadRoute(){return l(this,null,function*(){if(yield this.pluginService.ensurePluginsAreLoaded(this.route.snapshot.data.pluginScope||"common"),!this.route.snapshot.data.parentRoute){a.error('Missing "parentRoute" URL data to load plugin route '+this.route.snapshot.url);return}let e="/"+this.route.snapshot.url.map(o=>o.path).join("/"),t=this.pluginService.getRegisteredClientRoute(e,this.route.snapshot.data.parentRoute);if(!t)return a.info(`Could not find registered route ${e}`,{routes:this.pluginService.getAllRegisteredClientRoutes()}),this.router.navigate(["/404"],{skipLocationChange:!0});t.title&&this.metaService.setTitle(t.title),t.onMount({rootEl:this.root().nativeElement})})}};u(i,"\u0275fac",function(t){return new(t||i)}),u(i,"\u0275cmp",g({type:i,selectors:[["ng-component"]],viewQuery:function(t,o){t&1&&v(o.root,k,5),t&2&&S()},decls:2,vars:0,consts:[["root",""],[3,"click"]],template:function(t,o){if(t&1){let n=h();d(0,"div",1,0),f("click",function(P){return c(n),p(o.onRootClick(P))}),m()}},encapsulation:2}));let s=i;return s})();export{Q as a};
/**i18n:90f1dd82a779b57eddc91ef20913c88eecaa9632bba8ac04ad50f47ae2b82df7*/
//# sourceMappingURL=chunk-652DGFNR.js.map
