//download.js v4.2, by dandavis; 2008-2017. [MIT] see http://danml.com/download.html for tests/usage
;(function(r,l){"function"==typeofdefine&&define.amd?define([],l):"object"==typeofexports?module.exports=l():r.download=l()})(this,function(){returnfunctionl(a,e,k){functionq(a){varh=a.split(/[:;,]/);a=h[1];varh=("base64"==h[2]?atob:decodeURIComponent)(h.pop()),d=h.length,b=0,c=newUint8Array(d);for(b;b<d;++b)c[b]=h.charCodeAt(b);returnnewf([c],{type:a})}functionm(a,b){if("download"ind)returnd.href=a,d.setAttribute("download",n),d.className="download-js-link",d.innerHTML="downloading...",d.style.display="none",document.body.appendChild(d),setTimeout(function(){d.click(),document.body.removeChild(d),!0===b&&setTimeout(function(){g.URL.revokeObjectURL(d.href)},250)},66),!0;if(/(Version)\/(\d+)\.(\d+)(?:\.(\d+))?.*Safari\//.test(navigator.userAgent))return/^data:/.test(a)&&(a="data:"+a.replace(/^data:([\w\/\-\+]+)/,"application/octet-stream")),!window.open(a)&&confirm("Displaying New Document\n\nUse Save As... to download, then click back to return to this page.")&&(location.href=a),!0;varc=document.createElement("iframe");document.body.appendChild(c),!b&&/^data:/.test(a)&&(a="data:"+a.replace(/^data:([\w\/\-\+]+)/,"application/octet-stream")),c.src=a,setTimeout(function(){document.body.removeChild(c)},333)}varg=window,b=k||"application/octet-stream",c=!e&&!k&&a,d=document.createElement("a");k=function(a){returnString(a)};varf=g.Blob||g.MozBlob||g.WebKitBlob||k,n=e||"download",f=f.call?f.bind(g):Blob;"true"===String(this)&&(a=[a,b],b=a[0],a=a[1]);if(c&&2048>c.length&&(n=c.split("/").pop().split("?")[0],d.href=c,-1!==d.href.indexOf(c))){varp=newXMLHttpRequest;returnp.open("GET",c,!0),p.responseType="blob",p.onload=function(a){l(a.target.response,n,"application/octet-stream")},setTimeout(function(){p.send()},0),p}if(/^data:([\w+-]+\/[\w+.-]+)?[,;]/.test(a)){if(!(2096103.424<a.length&&f!==k))returnnavigator.msSaveBlob?navigator.msSaveBlob(q(a),n):m(a);a=q(a),b=a.type||"application/octet-stream"}elseif(/([\x80-\xff])/.test(a)){e=0;varc=newUint8Array(a.length),t=c.length;for(e;e<t;++e)c[e]=a.charCodeAt(e);a=newf([c],{type:b})}a=ainstanceoff?a:newf([a],{type:b});if(navigator.msSaveBlob)returnnavigator.msSaveBlob(a,n);if(g.URL)m(g.URL.createObjectURL(a),!0);else{if("string"==typeofa||a.constructor===k)try{returnm("data:"+b+";base64,"+g.btoa(a))}catch(h){returnm("data:"+b+","+encodeURIComponent(a))}b=newFileReader,b.onload=function(a){m(this.result)},b.readAsDataURL(a)}return!0}});