import{Ab as R,Ea as s,Lb as C,ad as y,af as a,ba as l,db as d,dd as b,eb as h,jb as f,la as p,ma as g,og as w,rb as m,wg as P,yb as v,zb as S}from"./chunk-QXV2GR6R.js";import{i as o,j as c}from"./chunk-JJ4RDTEF.js";var k=["root"],D=(()=>{let n=class n{constructor(e,t,i,r){o(this,"metaService");o(this,"route");o(this,"router");o(this,"pluginService");o(this,"root");o(this,"urlSub");this.metaService=e,this.route=t,this.router=i,this.pluginService=r}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 i=t.closest("a");if(!i)return;let r=i.getAttribute("href")||"";!i.target&&r.startsWith("/")&&(e.preventDefault(),e.stopPropagation(),this.router.navigateByUrl(r))}loadRoute(){return c(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(i=>i.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})})}};o(n,"\u0275fac",function(t){return new(t||n)(s(P),s(y),s(b),s(w))}),o(n,"\u0275cmp",l({type:n,selectors:[["ng-component"]],viewQuery:function(t,i){if(t&1&&v(k,5),t&2){let r;S(r=R())&&(i.root=r.first)}},standalone:!0,features:[C],decls:2,vars:0,consts:[["root",""],[3,"click"]],template:function(t,i){if(t&1){let r=f();d(0,"div",1,0),m("click",function(_){return p(r),g(i.onRootClick(_))}),h()}},encapsulation:2}));let u=n;return u})();export{D as a};
/**i18n:224bcada6943fe8b17ea60808c2d370cec9507c3bd670ebe71692d099a3befa1*/
//# sourceMappingURL=chunk-BIT7RCEY.js.map
