var S=Object.defineProperty;var m=(t,e,a)=>e in t?S(t,e,{enumerable:!0,configurable:!0,writable:!0,value:a}):t[e]=a;var r=(t,e,a)=>m(t,typeof e!="symbol"?e+"":e,a);import{h as p,z as b,M as N,N as R,R as v,T as y,a0 as x,Q as L,O as w,V as k,x as f,a1 as d}from"./DnREidt8.js";import{f as P,a as E,s as g}from"./tr3w0TjV.js";function I(t){var e,a,s="";if(typeof t=="string"||typeof t=="number")s+=t;else if(typeof t=="object")if(Array.isArray(t)){var i=t.length;for(e=0;e<i;e++)t[e]&&(a=I(t[e]))&&(s&&(s+=" "),s+=a)}else for(a in t)t[a]&&(s&&(s+=" "),s+=a);return s}function W(){for(var t,e,a=0,s="",i=arguments.length;a<i;a++)(t=arguments[a])&&(e=I(t))&&(s&&(s+=" "),s+=e);return s}function Q(t){return typeof t=="object"?W(t):t??""}function _(t,e,a){var s=t==null?"":""+t;return e&&(s=s?s+" "+e:e),s===""?null:s}function V(t,e){return t==null?null:String(t)}function j(t,e,a,s,i,u){var n=t.__className;if(p||n!==a||n===void 0){var o=_(a,s);(!p||o!==t.getAttribute("class"))&&(o==null?t.removeAttribute("class"):t.className=o),t.__className=a}return u}class G{constructor(e,a,s,i,u,n,o,c,h){r(this,"Id");r(this,"Code");r(this,"Title");r(this,"Description");r(this,"Status");r(this,"Info");r(this,"LastReported");r(this,"NextReportDeadline");r(this,"Percentage");r(this,"BranchCode");switch(this.Id=Number.parseInt(e),this.Code=a,this.Title=s,this.Description=i,this.Info=n,this.Status="Ok",u){case"Warning":this.Status="Warning";break;case"Error":this.Status="Error";break}this.LastReported=new Date(o),this.NextReportDeadline=new Date(c),this.Percentage=Number.parseInt(h),this.BranchCode=this.Code}IsPastDuedate(){let e=new Date;return this.NextReportDeadline<e}NeedsAttention(){return this.Status!="Ok"?!0:this.IsPastDuedate()}}var C=(t=>(t.Ok="Ok",t.Warning="Warning",t.Error="Error",t))(C||{}),D=(t=>(t.Icons="Icons",t.List="List",t))(D||{}),O=(t=>(t.Ok="Ok",t.Warning="Warning",t.Error="Error",t.PastDuedate="PastDuedate",t))(O||{});class K{constructor(e,a,s,i){r(this,"Id");r(this,"ReportDateTime");r(this,"Status");r(this,"Info");r(this,"Duplicates");switch(this.Id=Number.parseInt(e),this.ReportDateTime=new Date(a),this.Status="Ok",s){case"Warning":this.Status="Warning";break;case"Error":this.Status="Error";break}this.Info=i,this.Duplicates=[]}IsDuplicate(e){return this.Status==e.Status&&this.Info==e.Info}AddDuplicate(e){this.Duplicates.push(e)}HasDuplicates(){return this.Duplicates.length>0}}class z{constructor(e,a,s,i,u,n){r(this,"Code");r(this,"Status");r(this,"Info");r(this,"NextReportDeadline");r(this,"Result");r(this,"Percentage");switch(this.Code=e,this.Status="Ok",a){case"Warning":this.Status="Warning";break;case"Error":this.Status="Error";break}this.Info=s,this.NextReportDeadline=new Date(i),this.Result=Number.parseInt(u),this.Percentage=Number.parseInt(n)}}class U{constructor(e,a,s,i,u,n,o,c){r(this,"Id");r(this,"FetchingType");r(this,"FetchingArgs");r(this,"Intervall");r(this,"NextFetch");r(this,"NextReportDeadlineDelay");r(this,"FailedCount");r(this,"LastKeyValue");this.Id=Number.parseInt(e),this.FetchingType=a=="SQL"?"SQL":"PowerShell",this.FetchingArgs=s,this.Intervall=i,this.NextFetch=new Date(u),this.NextReportDeadlineDelay=n,this.FailedCount=Number.parseInt(o),this.LastKeyValue=c}}var A=(t=>(t.SQL="SQL",t.PowerShell="PowerShell",t))(A||{});class Y{constructor(e,a,s,i){r(this,"Id");r(this,"ResultLimit");r(this,"HourLimit");r(this,"Info");this.Id=Number.parseInt(e),this.ResultLimit=Number.parseInt(a),this.HourLimit=Number.parseInt(s),this.Info=i}}const q=b({LastMonitorUpdate:new Date,LoggedIn:!1,DisplayType:D.Icons,showOnlyWarningsErrorsAndInactives:!1});var F=P(" <i> </i>",1);function B(t,e){N(e,!0);let a=d(()=>i(e.item)),s=d(()=>u(e.item));function i(l){return l.getFullYear()+"-"+(l.getMonth()+1).toString().padStart(2,"0")+"-"+l.getDate().toString().padStart(2,"0")}function u(l){return l.getHours().toString().padStart(2,"0")+":"+l.getMinutes().toString().padStart(2,"0")+":"+l.getSeconds().toString().padStart(2,"0")}x();var n=F(),o=R(n),c=L(o),h=w(c,!0);k(c),v(()=>{g(o,`${f(a)??""} `),g(h,f(s))}),E(t,n),y()}export{O as B,U as C,B as D,G as M,Y as P,z as R,C as a,A as b,K as c,Q as d,D as e,q as g,j as s,V as t};
