/*
 Highcharts JS v5.0.12 (2017-05-24)
 Client side exporting module

 (c) 2015 Torstein Honsi / Oystein Moseng

 License: www.highcharts.com/license
*/
(function(n){"object"===typeof module&&module.exports?module.exports=n:n(Highcharts)})(function(n){(function(b){function n(c,b){var d=t.getElementsByTagName("head")[0],a=t.createElement("script");a.type="text/javascript";a.src=c;a.onload=b;a.onerror=function(){console.error("Error loading script",c)};d.appendChild(a)}var C=b.merge,e=b.win,r=e.navigator,t=e.document,z=b.each,w=e.URL||e.webkitURL||e,A=/Edge\/|Trident\/|MSIE /.test(r.userAgent),D=/Edge\/\d+/.test(r.userAgent),E=A?150:0;b.CanVGRenderer=
{};b.dataURLtoBlob=function(c){if(e.atob&&e.ArrayBuffer&&e.Uint8Array&&e.Blob&&w.createObjectURL){c=c.match(/data:([^;]*)(;base64)?,([0-9A-Za-z+/]+)/);for(var b=e.atob(c[3]),d=new e.ArrayBuffer(b.length),d=new e.Uint8Array(d),a=0;a<d.length;++a)d[a]=b.charCodeAt(a);c=new e.Blob([d],{type:c[1]});return w.createObjectURL(c)}};b.downloadURL=function(c,f){var d=t.createElement("a"),a;if(r.msSaveOrOpenBlob)r.msSaveOrOpenBlob(c,f);else{if(2E6<c.length&&(c=b.dataURLtoBlob(c),!c))throw"Data URL length limit reached";
if(void 0!==d.download)d.href=c,d.download=f,t.body.appendChild(d),d.click(),t.body.removeChild(d);else try{if(a=e.open(c,"chart"),void 0===a||null===a)throw"Failed to open window";}catch(u){e.location.href=c}}};b.svgToDataUrl=function(c){var b=-1<r.userAgent.indexOf("WebKit")&&0>r.userAgent.indexOf("Chrome");try{if(!b&&0>r.userAgent.toLowerCase().indexOf("firefox"))return w.createObjectURL(new e.Blob([c],{type:"image/svg+xml;charset-utf-16"}))}catch(d){}return"data:image/svg+xml;charset\x3dUTF-8,"+
encodeURIComponent(c)};b.imageToDataUrl=function(c,b,d,a,u,l,k,m,p){var g=new e.Image,h,f=function(){setTimeout(function(){var e=t.createElement("canvas"),f=e.getContext&&e.getContext("2d"),x;try{if(f){e.height=g.height*a;e.width=g.width*a;f.drawImage(g,0,0,e.width,e.height);try{x=e.toDataURL(b),u(x,b,d,a)}catch(F){h(c,b,d,a)}}else k(c,b,d,a)}finally{p&&p(c,b,d,a)}},E)},q=function(){m(c,b,d,a);p&&p(c,b,d,a)};h=function(){g=new e.Image;h=l;g.crossOrigin="Anonymous";g.onload=f;g.onerror=q;g.src=c};
g.onload=f;g.onerror=q;g.src=c};b.downloadSVGLocal=function(c,f,d,a){function u(a,b){b=new e.jsPDF("l","pt",[a.width.baseVal.value+2*b,a.height.baseVal.value+2*b]);e.svg2pdf(a,b,{removeInvalid:!0});return b.output("datauristring")}function l(){y.innerHTML=c;var e=y.getElementsByTagName("text"),g,f=y.getElementsByTagName("svg")[0].style;z(e,function(a){z(["font-family","font-size"],function(b){!a.style[b]&&f[b]&&(a.style[b]=f[b])});a.style["font-family"]=a.style["font-family"]&&a.style["font-family"].split(" ").splice(-1);
g=a.getElementsByTagName("title");z(g,function(b){a.removeChild(b)})});e=u(y.firstChild,0);try{b.downloadURL(e,v),a&&a()}catch(G){d()}}var k,m,p=!0,g,h=f.libURL||b.getOptions().exporting.libURL,y=t.createElement("div"),q=f.type||"image/png",v=(f.filename||"chart")+"."+("image/svg+xml"===q?"svg":q.split("/")[1]),B=f.scale||1,h="/"!==h.slice(-1)?h+"/":h;if("image/svg+xml"===q)try{r.msSaveOrOpenBlob?(m=new MSBlobBuilder,m.append(c),k=m.getBlob("image/svg+xml")):k=b.svgToDataUrl(c),b.downloadURL(k,v),
a&&a()}catch(x){d()}else"application/pdf"===q?e.jsPDF&&e.svg2pdf?l():(p=!0,n(h+"jspdf.js",function(){n(h+"svg2pdf.js",function(){l()})})):(k=b.svgToDataUrl(c),g=function(){try{w.revokeObjectURL(k)}catch(x){}},b.imageToDataUrl(k,q,{},B,function(c){try{b.downloadURL(c,v),a&&a()}catch(F){d()}},function(){var f=t.createElement("canvas"),u=f.getContext("2d"),l=c.match(/^<svg[^>]*width\s*=\s*\"?(\d+)\"?[^>]*>/)[1]*B,k=c.match(/^<svg[^>]*height\s*=\s*\"?(\d+)\"?[^>]*>/)[1]*B,m=function(){u.drawSvg(c,0,0,
l,k);try{b.downloadURL(r.msSaveOrOpenBlob?f.msToBlob():f.toDataURL(q),v),a&&a()}catch(H){d()}finally{g()}};f.width=l;f.height=k;e.canvg?m():(p=!0,n(h+"rgbcolor.js",function(){n(h+"canvg.js",function(){m()})}))},d,d,function(){p&&g()}))};b.Chart.prototype.getSVGForLocalExport=function(c,e,d,a){var f=this,l,k=0,m,p,g,h,n,q=function(b,c,d){++k;d.imageElement.setAttributeNS("http://www.w3.org/1999/xlink","href",b);k===l.length&&a(f.sanitizeSVG(m.innerHTML,p))};b.wrap(b.Chart.prototype,"getChartHTML",
function(a){var b=a.apply(this,Array.prototype.slice.call(arguments,1));p=this.options;m=this.container.cloneNode(!0);return b});f.getSVGForExport(c,e);l=m.getElementsByTagName("image");try{if(l.length)for(h=0,n=l.length;h<n;++h)g=l[h],b.imageToDataUrl(g.getAttributeNS("http://www.w3.org/1999/xlink","href"),"image/png",{imageElement:g},c.scale,q,d,d,d);else a(f.sanitizeSVG(m.innerHTML,p))}catch(v){d()}};b.Chart.prototype.exportChartLocal=function(c,e){var d=this,a=b.merge(d.options.exporting,c),f=
function(){if(!1===a.fallbackToExportServer)if(a.error)a.error(a);else throw"Fallback to export server disabled";else d.exportChart(a)};A&&(b.SVGRenderer.prototype.inlineWhitelist=[/^blockSize/,/^border/,/^caretColor/,/^color/,/^columnRule/,/^columnRuleColor/,/^cssFloat/,/^cursor/,/^fill$/,/^fillOpacity/,/^font/,/^inlineSize/,/^length/,/^lineHeight/,/^opacity/,/^outline/,/^parentRule/,/^rx$/,/^ry$/,/^stroke/,/^textAlign/,/^textAnchor/,/^textDecoration/,/^transform/,/^vectorEffect/,/^visibility/,/^x$/,
/^y$/]);A&&("application/pdf"===a.type||d.container.getElementsByTagName("image").length&&"image/svg+xml"!==a.type)||D&&"image/svg+xml"!==a.type||"application/pdf"===a.type&&d.container.getElementsByTagName("image").length?f():d.getSVGForLocalExport(a,e,f,function(c){-1<c.indexOf("\x3cforeignObject")&&"image/svg+xml"!==a.type?f():b.downloadSVGLocal(c,a,f)})};C(!0,b.getOptions().exporting,{libURL:"https://code.highcharts.com/5.0.12/lib/",buttons:{contextButton:{menuItems:[{textKey:"printChart",onclick:function(){this.print()}},
{separator:!0},{textKey:"downloadPNG",onclick:function(){this.exportChartLocal()}},{textKey:"downloadJPEG",onclick:function(){this.exportChartLocal({type:"image/jpeg"})}},{textKey:"downloadSVG",onclick:function(){this.exportChartLocal({type:"image/svg+xml"})}},{textKey:"downloadPDF",onclick:function(){this.exportChartLocal({type:"application/pdf"})}}]}}})})(n)});
