import{a as I}from"./chunk-JJGMRGRD.js";import{i as g}from"./chunk-N7PC5CHF.js";import{f as y,o as v}from"./chunk-ZTKV4AIV.js";import{G as p,R as m,Z as u,aa as a,ca as r,cb as l,ib as c,na as d,qa as h,rb as f,u as o}from"./chunk-FWZCAEAJ.js";var b=(()=>{let e=class e extends I{constructor(i,n){super(i),this.entitiesService=i,this.byIdEntityService=n,this.route=d(g),this.entityLoading=l(!0),this.idParam$=this.route.paramMap.pipe(o(t=>t.get("id")),p(t=>t!==null&&v(t)?!0:(this.router.navigateByUrl("/home"),!1)),o(t=>y(t)),m(),r(()=>this.isLoading.set(!0)),u(1)),this.entity$=this.idParam$.pipe(r(()=>this.entityLoading.set(!0)),a(t=>this.byIdEntityService.getSingle$(t)),r(()=>this.entityLoading.set(!1)))}ngAfterViewInit(){this.dataSource$=this.idParam$.pipe(a(i=>this.getDataSource(this.entitiesService.getByParent$(i))))}};e.\u0275fac=function(n){return new(n||e)(c(null),c(null))},e.\u0275cmp=h({type:e,selectors:[["ng-component"]],features:[f],decls:0,vars:0,template:function(n,t){},encapsulation:2});let s=e;return s})();export{b as a};
