/*! @source http://purl.eligrey.com/github/FileSaver.js/blob/master/FileSaver.js */ var saveAs=saveAs||(function(h){if(typeof navigator!=="undefined"&&/MSIE [1-9]\./.test(navigator.userAgent)){return}var s=h.document,m=function(){return h.URL||h.webkitURL||h},o=s.createElementNS("http://www.w3.org/1999/xhtml","a"),f="download" in o,k=function(u){var t=new MouseEvent("click");u.dispatchEvent(t)},b=/Version\/[\d\.]+.*Safari/.test(navigator.userAgent),p=h.webkitRequestFileSystem,q=h.requestFileSystem||p||h.mozRequestFileSystem,n=function(t){(h.setImmediate||h.setTimeout)(function(){throw t},0)},c="application/octet-stream",l=0,i=1000*40,j=function(u){var t=function(){if(typeof u==="string"){m().revokeObjectURL(u)}else{u.remove()}};setTimeout(t,i)},r=function(u,t,x){t=[].concat(t);var w=t.length;while(w--){var y=u["on"+t[w]];if(typeof y==="function"){try{y.call(u,x||u)}catch(v){n(v)}}}},g=function(t){if(/^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(t.type)){return new Blob(["\ufeff",t],{type:t.type})}return t},e=function(t,u,v){if(!v){t=g(t)}var w=this,C=t.type,F=false,y,x,B=function(){r(w,"writestart progress write writeend".split(" "))},E=function(){if(x&&b&&typeof FileReader!=="undefined"){var G=new FileReader();G.onloadend=function(){var I=G.result;x.location.href="data:attachment/file"+I.slice(I.search(/[,;]/));w.readyState=w.DONE;B()};G.readAsDataURL(t);w.readyState=w.INIT;return}if(F||!y){y=m().createObjectURL(t)}if(x){x.location.href=y}else{var H=h.open(y,"_blank");if(H===undefined&&b){h.location.href=y}}w.readyState=w.DONE;B();j(y)},A=function(G){return function(){if(w.readyState!==w.DONE){return G.apply(this,arguments)}}},z={create:true,exclusive:false},D;w.readyState=w.INIT;if(!u){u="download"}if(f){y=m().createObjectURL(t);setTimeout(function(){o.href=y;o.download=u;k(o);B();j(y);w.readyState=w.DONE});return}if(h.chrome&&C&&C!==c){D=t.slice||t.webkitSlice;t=D.call(t,0,t.size,c);F=true}if(p&&u!=="download"){u+=".download"}if(C===c||p){x=h}if(!q){E();return}l+=t.size;q(h.TEMPORARY,l,A(function(G){G.root.getDirectory("saved",z,A(function(H){var I=function(){H.getFile(u,z,A(function(J){J.createWriter(A(function(K){K.onwriteend=function(L){x.location.href=J.toURL();w.readyState=w.DONE;r(w,"writeend",L);j(J)};K.onerror=function(){var L=K.error;if(L.code!==L.ABORT_ERR){E()}};"writestart progress write abort".split(" ").forEach(function(L){K["on"+L]=w["on"+L]});K.write(t);w.abort=function(){K.abort();w.readyState=w.DONE};w.readyState=w.WRITING}),E)}),E)};H.getFile(u,{create:false},A(function(J){J.remove();I()}),A(function(J){if(J.code===J.NOT_FOUND_ERR){I()}else{E()}}))}),E)}),E)},d=e.prototype,a=function(u,v,t){return new e(u,v,t)};if(typeof navigator!=="undefined"&&navigator.msSaveOrOpenBlob){return function(u,v,t){if(!t){u=g(u)}return navigator.msSaveOrOpenBlob(u,v||"download")}}d.abort=function(){var t=this;t.readyState=t.DONE;r(t,"abort")};d.readyState=d.INIT=0;d.WRITING=1;d.DONE=2;d.error=d.onwritestart=d.onprogress=d.onwrite=d.onabort=d.onerror=d.onwriteend=null;return a}(typeof self!=="undefined"&&self||typeof window!=="undefined"&&window||this.content));if(typeof module!=="undefined"&&module.exports){module.exports.saveAs=saveAs}else{if((typeof define!=="undefined"&&define!==null)&&(define.amd!==null)){define([],function(){return saveAs})}}; /*! @source http://purl.eligrey.com/github/canvas-toBlob.js/blob/master/canvas-toBlob.js */ (function(a){var b=a.Uint8Array,d=a.HTMLCanvasElement,c=d&&d.prototype,e=/\s*;\s*base64\s*(?:;|$)/i,f="toDataURL",h,g=function(p){var q=p.length,m=new b(q/4*3|0),o=0,s=0,t=[0,0],j=0,r=0,n,k,l;while(q--){k=p.charCodeAt(o++);n=h[k-43];if(n!==255&&n!==l){t[1]=t[0];t[0]=k;r=(r<<6)|n;j++;if(j===4){m[s++]=r>>>16;if(t[1]!==61){m[s++]=r>>>8}if(t[0]!==61){m[s++]=r}j=0}}}return m};if(b){h=new b([62,-1,-1,-1,63,52,53,54,55,56,57,58,59,60,61,-1,-1,-1,0,-1,-1,-1,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,-1,-1,-1,-1,-1,-1,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51])}if(d&&!c.toBlob){c.toBlob=function(p,n){if(!n){n="image/png"}if(this.mozGetAsFile){p(this.mozGetAsFile("canvas",n));return}if(this.msToBlob&&/^\s*image\/png\s*(?:$|;)/i.test(n)){p(this.msToBlob());return}var m=Array.prototype.slice.call(arguments,1),k=this[f].apply(this,m),j=k.indexOf(","),o=k.substring(j+1),i=e.test(k.substring(0,j)),l;if(Blob.fake){l=new Blob;if(i){l.encoding="base64"}else{l.encoding="URI"}l.data=o;l.size=o.length}else{if(b){if(i){l=new Blob([g(o)],{type:n})}else{l=new Blob([decodeURIComponent(o)],{type:n})}}}p(l)};if(c.toDataURLHD){c.toBlobHD=function(){f="toDataURLHD";var i=this.toBlob();f="toDataURL";return i}}else{c.toBlobHD=c.toBlob}}}(typeof self!=="undefined"&&self||typeof window!=="undefined"&&window||this.content||this));