text: function getChartJsConfig(n,t){return{type:"line",data:{datasets:[]},options:{title:{text:n},pan:{enabled:!0,mode:"x"},zoom:{enabled:!1,drag:!1,mode:"x"},responsive:!0,maintainAspectRatio:!1,scales:{xAxes:[{type:"time",distribution:"linear",time:{unit:"hour",displayFormats:{millisecond:"MM DD",second:"MM DD",minute:"MMM DD h:mm a",hour:"MMM DD h:mm a",day:"MM DD",week:"MM DD",month:"MM DD",quarter:"MM DD",year:"MM DD"}},scaleLabel:{display:!0,labelString:""}}],yAxes:[{ticks:{beginAtZero:!0,stepSize:1,min:0,max:1},scaleLabel:{display:!0,labelString:t}}]}}}}function getTimeChartForEnvironment(n,t){for(var f,s,e,o,c,l,r=getChartJsConfig(n+" Usage","Compute Cores"),h=[],i=1,u=0;u<t.length;u++){for(f=t[u],s=[],e=0;e<f.values.length;e++)o=f.values[e],s.push({x:o.timestamp,y:o.totalCores}),i=Math.max(i,o.totalCores);c=colors[u%colors.length];l=getDataSet(f.poolName,c,s);h.push(l)}return r.data.datasets=h,r.options.scales.yAxes[0].ticks.stepSize=Math.max(1,Math.ceil(i/10)),r.options.scales.yAxes[0].ticks.max=i+Math.max(1,Math.ceil(i/20)),r}function getTimeChartForPool(n,t){for(var r,e=[],o=[],i=1,f=0;f<t.length;f++)r=t[f],e.push({x:r.timestamp,y:r.dedicatedCores}),o.push({x:r.timestamp,y:r.lowPriorityCores}),i=Math.max(i,r.dedicatedCores),i=Math.max(i,r.lowPriorityCores);var s=getDataSet("Dedicated Cores",colors[0],e),h=getDataSet("Low Priority Cores",colors[1],o),u=getChartJsConfig(n+" Usage","Compute Cores");return u.data.datasets=[s,h],u.options.scales.yAxes[0].ticks.stepSize=Math.max(1,Math.ceil(i/10)),u.options.scales.yAxes[0].ticks.max=i+Math.max(1,Math.ceil(i/20)),u}function getDataSet(n,t,i){return{label:n,backgroundColor:t.alpha(.5).rgbString(),borderColor:t.rgbString(),data:i,steppedLine:!0,pointRadius:0,fill:!1,lineTension:0,borderWidth:2}}function registerCheckboxEnabledFormSection(n,t,i){var u="#"+t,r="#"+i;$(u).change(function(t){$(u).is(":checked")===!0?(t.currentTarget.id!==n&&($(r+" select").removeAttr("disabled"),$(r+" :input").removeAttr("readonly"),$(r+" :input[type='file']").removeAttr("disabled")),$(r+" :input[type='checkbox']").removeAttr("disabled"),$(".master-component :input").removeAttr("readonly"),$(".master-component :input").removeAttr("disabled")):($(r+" select").attr("disabled","disabled"),$(r+" :input").attr("readonly","readonly"),$(r+" :input[type='file']").attr("disabled","disabled"),t.currentTarget.id===n&&$(".master-component :input[type='checkbox']").attr("disabled","disabled"))});$(u).change()}const colors=[Chart.helpers.color("rgb(255, 99, 132)"),Chart.helpers.color("rgb(255, 159, 64)"),Chart.helpers.color("rgb(255, 205, 86)"),Chart.helpers.color("rgb(75, 192, 192)"),Chart.helpers.color("rgb(54, 162, 235)"),Chart.helpers.color("rgb(153, 102, 255)"),Chart.helpers.color("rgb(201, 203, 207)"),Chart.helpers.color("rgb(112, 138, 144)"),Chart.helpers.color("rgb(25, 25, 112)"),Chart.helpers.color("rgb(100, 149, 237)"),Chart.helpers.color("rgb(106, 90, 205)"),Chart.helpers.color("rgb(65, 105, 225)"),Chart.helpers.color("rgb(0, 191, 255)"),Chart.helpers.color("rgb(176, 196, 222)"),Chart.helpers.color("rgb(173, 216, 230)"),Chart.helpers.color("rgb(102, 205, 170)"),Chart.helpers.color("rgb(32, 178, 170)")];Date.prototype.addDays=function(n){var t=new Date(this.valueOf());return t.setDate(t.getDate()+n),t};Number.prototype.pad=function(){var n=2;return new Array(n).concat([Math.abs(this)]).join("0").slice(-n)};Date.prototype.toYearMonthDayString=function(){var n=new Date(this.valueOf()),t=`20${n.getUTCFullYear().pad()}`,i=`${(n.getUTCMonth()+1).pad()}`,r=`${n.getUTCDate().pad()}`;return`${t}${i}${r}`};