import{D as f,o as u,p as h}from"./chunk-EHQVV4XT.js";import{Ca as S,J as g,Za as m}from"./chunk-MV3EFEPQ.js";import{Ib as r,Ic as v,Sb as s,Tb as c,Ub as n,eb as o,kb as l,ub as d,wc as p}from"./chunk-S4LBMTTN.js";import"./chunk-7CGTOI24.js";var b=(()=>{class i{constructor(t,e,a){this.changeDetectorRef=t,this.dashboardService=e,this.toastr=a,this.data=new S}ngAfterContentInit(){this.changeDetectorRef.detectChanges()}ngOnInit(){this.loadStats(),this.refreshIntervalRun=setInterval(()=>{this.loadStats()},5e3)}ngOnDestroy(){this.refreshIntervalRun&&clearInterval(this.refreshIntervalRun)}loadStats(){this.dashboardService.getStats().subscribe(t=>{if(t.succeed)this.data=t.value;else{this.toastr.error(t.error);return}},t=>{let e=t;e!==null&&(console.log("Error: "+e),this.toastr.error(e))})}static{this.\u0275fac=function(e){return new(e||i)(l(v),l(m),l(g))}}static{this.\u0275cmp=d({type:i,selectors:[["dashboard-widget"]],features:[p([m])],decls:21,vars:12,consts:[["widgetStatB1inv","cWidgetStatB"],["widgetStatB2inv","cWidgetStatB"],["widgetStatB3inv","cWidgetStatB"],["widgetStatB4inv","cWidgetStatB"],[1,"g-4"],["xl","3","md","6","sm","6"],["color","primary","inverse","","text","App connected to this SAP Database",3,"title","value"],["color","primary","inverse","","text","Using this interface type",3,"title","value"],["color","primary","inverse","","text","Your Avalara account environment",3,"title","value"],["color","primary","inverse","","text","Your configured Avatax company",3,"title","value"],[2,"display","inline-block","height","10px"],["color","info","inverse","","text","Scheduled jobs to be executed",3,"title","value"],["color","warning","inverse","","text","Jobs running now",3,"title","value"]],template:function(e,a){e&1&&(s(0,"c-row",4)(1,"c-col",5),n(2,"c-widget-stat-b",6,0),c(),s(4,"c-col",5),n(5,"c-widget-stat-b",7,1),c(),s(7,"c-col",5),n(8,"c-widget-stat-b",8,2),c(),s(10,"c-col",5),n(11,"c-widget-stat-b",9,3),c()(),n(13,"span",10),s(14,"c-row",4)(15,"c-col",5),n(16,"c-widget-stat-b",11,0),c(),s(18,"c-col",5),n(19,"c-widget-stat-b",12,1),c()()),e&2&&(o(2),r("title","SAP Company")("value",a.data.SAPCompanyDb),o(3),r("title","SAP Interface")("value",a.data.SAPInterface),o(3),r("title","Avatax Environment")("value",a.data.AvataxEnvironment),o(3),r("title","Avatax Company")("value",a.data.AvataxCompany),o(5),r("title","Scheduled Runs")("value",a.data.RunScheduleCount.toString()),o(3),r("title","In Process Runs")("value",a.data.RunInProcessCount.toString()))},dependencies:[h,u,f],encapsulation:2})}}return i})();var P=(()=>{class i{static{this.\u0275fac=function(e){return new(e||i)}}static{this.\u0275cmp=d({type:i,selectors:[["ng-component"]],decls:1,vars:0,template:function(e,a){e&1&&n(0,"dashboard-widget")},dependencies:[b],styles:["[_nghost-%COMP%]   .legend[_ngcontent-%COMP%]   small[_ngcontent-%COMP%]{font-size:x-small}"]})}}return i})();export{P as DashboardComponent};
