/*
 Highcharts JS v6.0.4 (2017-12-15)
 Exporting module

 (c) 2010-2017 Torstein Honsi

 License: www.highcharts.com/license
*/
(function(v){"object"===typeof module&&module.exports?module.exports=v:v(Highcharts)})(function(v){(function(a){var v=a.defined,w=a.each,x=a.pick,y=a.win,B=y.document,m=a.seriesTypes,E=void 0!==B.createElement("a").download;a.setOptions({exporting:{csv:{columnHeaderFormatter:null,dateFormat:"%Y-%m-%d %H:%M:%S",decimalPoint:null,itemDelimiter:null,lineDelimiter:"\n"},showTable:!1,useMultiLevelHeaders:!0,useRowspanHeaders:!0},lang:{downloadCSV:"Download CSV",downloadXLS:"Download XLS",viewData:"View data table"}});
a.addEvent(a.Chart.prototype,"render",function(){this.options&&this.options.exporting&&this.options.exporting.showTable&&this.viewData()});a.Chart.prototype.setUpKeyToAxis=function(){m.arearange&&(m.arearange.prototype.keyToAxis={low:"y",high:"y"})};a.Chart.prototype.getDataRows=function(e){var z=this.options.exporting&&this.options.exporting.csv||{},g,p=this.xAxis,l={},f=[],k,D=[],r=[],d,n,A,b=function(c,h,b){if(z.columnHeaderFormatter){var g=z.columnHeaderFormatter(c,h,b);if(!1!==g)return g}return c?
c instanceof a.Axis?c.options.title&&c.options.title.text||(c.isDatetimeAxis?"DateTime":"Category"):e?{columnTitle:1<b?h:c.name,topLevelColumnTitle:c.name}:c.name+(1<b?" ("+h+")":""):"Category"},q=[];n=0;this.setUpKeyToAxis();w(this.series,function(c){var h=c.options.keys||c.pointArrayMap||["y"],g=h.length,t=!c.requireSorting&&{},u={},A={},k=a.inArray(c.xAxis,p),f;w(h,function(h){var b=(c.keyToAxis&&c.keyToAxis[h]||h)+"Axis";u[h]=c[b]&&c[b].categories||[];A[h]=c[b]&&c[b].isDatetimeAxis});if(!1!==
c.options.includeInCSVExport&&!1!==c.visible){a.find(q,function(c){return c[0]===k})||q.push([k,n]);for(f=0;f<g;)d=b(c,h[f],h.length),r.push(d.columnTitle||d),e&&D.push(d.topLevelColumnTitle||d),f++;w(c.points,function(b,e){var d=b.x,q;t&&(t[d]&&(d+="|"+e),t[d]=!0);f=0;l[d]||(l[d]=[],l[d].xValues=[]);l[d].x=b.x;l[d].xValues[k]=b.x;c.xAxis&&"name"!==c.exportKey||(l[d].name=b.name);for(;f<g;)e=h[f],q=b[e],l[d][n+f]=x(u[e][q],A[e]?a.dateFormat(z.dateFormat,q):null,q),f++});n+=f}});for(k in l)l.hasOwnProperty(k)&&
f.push(l[k]);var u,t;k=e?[D,r]:[r];for(n=q.length;n--;)u=q[n][0],t=q[n][1],g=p[u],f.sort(function(c,b){return c.xValues[u]-b.xValues[u]}),A=b(g),k[0].splice(t,0,A),e&&k[1]&&k[1].splice(t,0,A),w(f,function(c){var b=c.name;v(b)||(g.isDatetimeAxis?(c.x instanceof Date&&(c.x=c.x.getTime()),b=a.dateFormat(z.dateFormat,c.x)):b=g.categories?x(g.names[c.x],g.categories[c.x],c.x):c.x);c.splice(t,0,b)});return k=k.concat(f)};a.Chart.prototype.getCSV=function(e){var a="",g=this.getDataRows(),p=this.options.exporting.csv,
l=x(p.decimalPoint,e?(1.1).toLocaleString()[1]:"."),f=x(p.itemDelimiter,","===l?";":","),k=p.lineDelimiter;w(g,function(e,z){for(var d,n=e.length;n--;)d=e[n],"string"===typeof d&&(d='"'+d+'"'),"number"===typeof d&&"."!==l&&(d=d.toString().replace(".",l)),e[n]=d;a+=e.join(f);z<g.length-1&&(a+=k)});return a};a.Chart.prototype.getTable=function(e){var a="\x3ctable\x3e",g=this.options,p=e?(1.1).toLocaleString()[1]:".",l=x(g.exporting.useMultiLevelHeaders,!0);e=this.getDataRows(l);var f=0,k=l?e.shift():
null,m=e.shift(),r=function(a,b,e,g){var d=g||"";b="text"+(b?" "+b:"");"number"===typeof d?(d=d.toString(),","===p&&(d=d.replace(".",p)),b="number"):g||(b="empty");return"\x3c"+a+(e?" "+e:"")+' class\x3d"'+b+'"\x3e'+d+"\x3c/"+a+"\x3e"};!1!==g.exporting.tableCaption&&(a+='\x3ccaption class\x3d"highcharts-table-caption"\x3e'+x(g.exporting.tableCaption,g.title.text?g.title.text.replace(/&/g,"\x26amp;").replace(/</g,"\x26lt;").replace(/>/g,"\x26gt;").replace(/"/g,"\x26quot;").replace(/'/g,"\x26#x27;").replace(/\//g,
"\x26#x2F;"):"Chart")+"\x3c/caption\x3e");for(var d=0,n=e.length;d<n;++d)e[d].length>f&&(f=e[d].length);a+=function(a,b,e){var d="\x3cthead\x3e",f=0;e=e||b&&b.length;var c,h,k=0;if(h=l&&a&&b){a:if(h=a.length,b.length===h){for(;h--;)if(a[h]!==b[h]){h=!1;break a}h=!0}else h=!1;h=!h}if(h){for(d+="\x3ctr\x3e";f<e;++f)h=a[f],c=a[f+1],h===c?++k:k?(d+=r("th","highcharts-table-topheading",'scope\x3d"col" colspan\x3d"'+(k+1)+'"',h),k=0):(h===b[f]?g.exporting.useRowspanHeaders?(c=2,delete b[f]):(c=1,b[f]=""):
c=1,d+=r("th","highcharts-table-topheading",'scope\x3d"col"'+(1<c?' valign\x3d"top" rowspan\x3d"'+c+'"':""),h));d+="\x3c/tr\x3e"}if(b){d+="\x3ctr\x3e";f=0;for(e=b.length;f<e;++f)void 0!==b[f]&&(d+=r("th",null,'scope\x3d"col"',b[f]));d+="\x3c/tr\x3e"}return d+"\x3c/thead\x3e"}(k,m,Math.max(f,m.length));a+="\x3ctbody\x3e";w(e,function(d){a+="\x3ctr\x3e";for(var b=0;b<f;b++)a+=r(b?"td":"th",null,b?"":'scope\x3d"row"',d[b]);a+="\x3c/tr\x3e"});return a+="\x3c/tbody\x3e\x3c/table\x3e"};a.Chart.prototype.fileDownload=
function(e,m,g){var p;p=this.options.exporting.filename?this.options.exporting.filename:this.title&&this.title.textStr?this.title.textStr.replace(/ /g,"-").toLowerCase():"chart";y.Blob&&y.navigator.msSaveOrOpenBlob?(e=new y.Blob(["\ufeff"+g],{type:"text/csv"}),y.navigator.msSaveOrOpenBlob(e,p+"."+m)):E?(g=B.createElement("a"),g.href=e,g.download=p+"."+m,this.container.appendChild(g),g.click(),g.remove()):a.error("The browser doesn't support downloading files")};a.Chart.prototype.downloadCSV=function(){var a=
this.getCSV(!0);this.fileDownload("data:text/csv,\ufeff"+encodeURIComponent(a),"csv",a,"text/csv")};a.Chart.prototype.downloadXLS=function(){var a='\x3chtml xmlns:o\x3d"urn:schemas-microsoft-com:office:office" xmlns:x\x3d"urn:schemas-microsoft-com:office:excel" xmlns\x3d"http://www.w3.org/TR/REC-html40"\x3e\x3chead\x3e\x3c!--[if gte mso 9]\x3e\x3cxml\x3e\x3cx:ExcelWorkbook\x3e\x3cx:ExcelWorksheets\x3e\x3cx:ExcelWorksheet\x3e\x3cx:Name\x3eArk1\x3c/x:Name\x3e\x3cx:WorksheetOptions\x3e\x3cx:DisplayGridlines/\x3e\x3c/x:WorksheetOptions\x3e\x3c/x:ExcelWorksheet\x3e\x3c/x:ExcelWorksheets\x3e\x3c/x:ExcelWorkbook\x3e\x3c/xml\x3e\x3c![endif]--\x3e\x3cstyle\x3etd{border:none;font-family: Calibri, sans-serif;} .number{mso-number-format:"0.00";} .text{ mso-number-format:"@";}\x3c/style\x3e\x3cmeta name\x3dProgId content\x3dExcel.Sheet\x3e\x3cmeta charset\x3dUTF-8\x3e\x3c/head\x3e\x3cbody\x3e'+
this.getTable(!0)+"\x3c/body\x3e\x3c/html\x3e";this.fileDownload("data:application/vnd.ms-excel;base64,"+y.btoa(unescape(encodeURIComponent(a))),"xls",a,"application/vnd.ms-excel")};a.Chart.prototype.viewData=function(){this.dataTableDiv||(this.dataTableDiv=B.createElement("div"),this.dataTableDiv.className="highcharts-data-table",this.renderTo.parentNode.insertBefore(this.dataTableDiv,this.renderTo.nextSibling));this.dataTableDiv.innerHTML=this.getTable()};var C=a.getOptions().exporting;C&&(a.extend(C.menuItemDefinitions,
{downloadCSV:{textKey:"downloadCSV",onclick:function(){this.downloadCSV()}},downloadXLS:{textKey:"downloadXLS",onclick:function(){this.downloadXLS()}},viewData:{textKey:"viewData",onclick:function(){this.viewData()}}}),C.buttons.contextButton.menuItems.push("separator","downloadCSV","downloadXLS","viewData"));m.map&&(m.map.prototype.exportKey="name");m.mapbubble&&(m.mapbubble.prototype.exportKey="name");m.treemap&&(m.treemap.prototype.exportKey="name")})(v)});
