import{a as y,b as n,c as f,d as C,e as _,f as v,g as S,h as w,i as D}from"./chunk-U7GJOJWK.js";import{ha as g,ya as u}from"./chunk-KOULBGOK.js";import{Ab as h,Ja as o,Nc as m,Tb as c,cc as p,dc as l,ec as d,mb as a,rb as r}from"./chunk-ZGECHOBP.js";var E=e=>({height:e}),M=(()=>{class e{get datasets(){return this._datasets}set datasets(t){this._datasets=t,this._reinit()}get options(){return this._options}set options(t){this._options=t,this._reinit()}constructor(t){this.el=t,this.type="line",this.id=0,this.height="200px",this.chart=null,this.labels=[]}ngAfterViewInit(){n.register(y,f,C,D,v,w,S,_),this._initChart()}ngOnDestroy(){this.chart&&(this.chart.destroy(),this.chart=null)}_initChart(){this.chart=new n(`new-chart-${this.id}`,{type:this.type,data:this.datasets,options:this.options})}_reinit(){this.chart&&(this.chart.destroy(),this._initChart(),this.chart.update())}static{this.\u0275fac=function(i){return new(i||e)(r(o))}}static{this.\u0275cmp=h({type:e,selectors:[["tis-chart"]],inputs:{type:"type",id:"id",height:"height",datasets:"datasets",options:"options"},decls:2,vars:4,consts:[[1,"dx-custom-chart"],[3,"id","ngStyle"]],template:function(i,s){i&1&&(p(0,"div",0),d(1,"canvas",1),l()),i&2&&(a(),c("id","new-chart-"+s.id)("ngStyle",m(2,E,s.height)))},dependencies:[u,g],styles:[`.dx-custom-chart{margin-bottom:var(--space-vertical-l)}
`],encapsulation:2,changeDetection:0})}}return e})();export{M as a};
