import{k as M,o as R,x as s}from"./chunk-R3KWJKU7.js";import{l as _}from"./chunk-N7PC5CHF.js";import{z as j}from"./chunk-ZTKV4AIV.js";import{j as L}from"./chunk-MTR2L2TG.js";import{g as Q}from"./chunk-73IMXZSJ.js";import{$ as c,K as v,M as D,aa as w,ca as S,cb as A,ib as C,na as b,p as a,q as g,qa as T,rc as u,sc as l,tc as p,u as d,v as y}from"./chunk-FWZCAEAJ.js";var P=(()=>{let o=class o{get columnsToDisplay(){return this._columnsToDisplay}set columnsToDisplay(i){this._columnsToDisplay=i}constructor(i){this.entitiesService=i,this.lumber=j("AModelsListComponentV2"),this.router=b(_),this.isLoading=A(!0),this._columnsToDisplay=[],this.filter=new L(""),this.dataSource$=a(new s),this._dataSource=new s([])}ngAfterViewInit(){this.dataSource$=this.getDataSource(this.entitiesService.getAll$())}getDataSource(i){return y([this.filter.valueChanges.pipe(c(""),d(t=>t??""),D(250)),i.pipe(v(t=>(t instanceof Q&&t.status===404&&this.router.navigateByUrl("/not-found"),g(()=>t))))]).pipe(w(([t,r])=>{let e=new s(r);return this.sortingDataAccessors&&(e.sortingDataAccessor=(f,h)=>{let m=this.sortingDataAccessors?.get(h);return m?m(f):f[h]}),this.sort&&(e.sort=this.sort),this.paginator&&(e.paginator=this.paginator),e.filter=t??"",this.isLoading.set(!1),a(e)}),S(t=>this._dataSource=t),c(this._dataSource))}};o.\u0275fac=function(t){return new(t||o)(C(null))},o.\u0275cmp=T({type:o,selectors:[["ng-component"]],viewQuery:function(t,r){if(t&1&&(u(M,5),u(R,5)),t&2){let e;l(e=p())&&(r.sort=e.first),l(e=p())&&(r.paginator=e.first)}},decls:0,vars:0,template:function(t,r){},encapsulation:2});let n=o;return n})();export{P as a};
