CHART_TYPES={LINE:"line",BAR:"bar",HORIZONTAL_BAR:"horizontalBar",RADAR:"radar",POLAR:"polarArea",PIE:"pie",DOUGHNUT:"doughnut",BUBBLE:"bubble",SCATTER:"scatter"};function get_color_types(a){switch(a){case CHART_TYPES.LINE:case CHART_TYPES.SCATTER:case CHART_TYPES.RADAR:return["backgroundColor","borderColor","hoverBackgroundColor","hoverBorderColor","pointBackgroundColor","pointBorderColor","pointHoverBackgroundColor","pointHoverBorderColor"];case CHART_TYPES.BAR:case CHART_TYPES.HORIZONTAL_BAR:case CHART_TYPES.PIE:case CHART_TYPES.DOUGHNUT:case CHART_TYPES.POLAR:case CHART_TYPES.BUBBLE:return["backgroundColor","borderColor","hoverBackgroundColor","hoverBorderColor"]}}function get_color_by_dataset(b,a){if(typeof(a)==="undefined"){switch(b){case CHART_TYPES.LINE:case CHART_TYPES.RADAR:case CHART_TYPES.SCATTER:case CHART_TYPES.BUBBLE:return true;case CHART_TYPES.BAR:case CHART_TYPES.HORIZONTAL_BAR:case CHART_TYPES.DOUGHNUT:case CHART_TYPES.PIE:case CHART_TYPES.POLAR:return false}}return a}function get_color_from_class(c,d){var b="";var a=c.attr("class");c.addClass(d).removeClass(function(e){b=$(this).css("color");return d});c.attr("class",a);return b}function parse_css_colors(d,e,f,b){var c=(typeof(f)=="string");f=c?JSON.parse(f):f;chart_selector=String(d).startsWith("#")?d:"#"+d;chart_selector="canvas"+chart_selector;$(chart_selector).css("color","");var a=f.data.datasets;$.each(a,function(k,j){e=("type" in j)?j.type:e;var h=get_color_types(e);var g=get_color_by_dataset(e,b);$.each(h,function(l,n){if(n in j){return}if(g){var o=e+" "+n+"_"+(k+1);j[n]=get_color_from_class($(chart_selector),o)}else{var m=[];for(i=0;i<j.data.length;i++){var o=e+" "+n+"_"+(i+1);m.push(get_color_from_class($(chart_selector),o))}j[n]=m}})});return c?JSON.stringify(f):f}if(!String.prototype.startsWith){String.prototype.startsWith=function(b,a){a=a||0;return this.indexOf(b,a)===a}};