var saveAs=saveAs||"undefined"!=typeof navigator&&navigator.msSaveOrOpenBlob&&navigator.msSaveOrOpenBlob.bind(navigator)||function(e){"use strict";if("undefined"==typeof navigator||!/MSIE [1-9]\./.test(navigator.userAgent)){var t=e.document,n=function(){return e.URL||e.webkitURL||e},o=e.URL||e.webkitURL||e,r=t.createElementNS("http://www.w3.org/1999/xhtml","a"),i=!e.externalHost&&"download"in r,a=e.webkitRequestFileSystem,c=e.requestFileSystem||a||e.mozRequestFileSystem,u=function(t){(e.setImmediate||e.setTimeout)(function(){throw t},0)},d="application/octet-stream",s=0,f=[],l=function(){for(var e=f.length;e--;){var t=f[e];"string"==typeof t?o.revokeObjectURL(t):t.remove()}f.length=0},v=function(e,t,n){t=[].concat(t);for(var o=t.length;o--;){var r=e["on"+t[o]];if("function"==typeof r)try{r.call(e,n||e)}catch(i){u(i)}}},w=function(o,u){var l,w,p,y=this,m=o.type,h=!1,E=function(){var e=n().createObjectURL(o);return f.push(e),e},g=function(){v(y,"writestart progress write writeend".split(" "))},R=function(){!h&&l||(l=E(o)),w?w.location.href=l:window.open(l,"_blank"),y.readyState=y.DONE,g()},S=function(e){return function(){if(y.readyState!==y.DONE)return e.apply(this,arguments)}},O={create:!0,exclusive:!1};if(y.readyState=y.INIT,u||(u="download"),i){l=E(o),t=e.document,r=t.createElementNS("http://www.w3.org/1999/xhtml","a"),r.href=l,r.download=u;var b=t.createEvent("MouseEvents");return b.initMouseEvent("click",!0,!1,e,0,0,0,0,0,!1,!1,!1,!1,0,null),r.dispatchEvent(b),y.readyState=y.DONE,void g()}return e.chrome&&m&&m!==d&&(p=o.slice||o.webkitSlice,o=p.call(o,0,o.size,d),h=!0),a&&"download"!==u&&(u+=".download"),(m===d||a)&&(w=e),c?(s+=o.size,void c(e.TEMPORARY,s,S(function(e){e.root.getDirectory("saved",O,S(function(e){var t=function(){e.getFile(u,O,S(function(e){e.createWriter(S(function(t){t.onwriteend=function(t){w.location.href=e.toURL(),f.push(e),y.readyState=y.DONE,v(y,"writeend",t)},t.onerror=function(){var e=t.error;e.code!==e.ABORT_ERR&&R()},"writestart progress write abort".split(" ").forEach(function(e){t["on"+e]=y["on"+e]}),t.write(o),y.abort=function(){t.abort(),y.readyState=y.DONE},y.readyState=y.WRITING}),R)}),R)};e.getFile(u,{create:!1},S(function(e){e.remove(),t()}),S(function(e){e.code===e.NOT_FOUND_ERR?t():R()}))}),R)}),R)):void R()},p=w.prototype,y=function(e,t){return new w(e,t)};return p.abort=function(){var e=this;e.readyState=e.DONE,v(e,"abort")},p.readyState=p.INIT=0,p.WRITING=1,p.DONE=2,p.error=p.onwritestart=p.onprogress=p.onwrite=p.onabort=p.onerror=p.onwriteend=null,e.addEventListener("unload",l,!1),y.unload=function(){l(),e.removeEventListener("unload",l,!1)},y}}("undefined"!=typeof self&&self||"undefined"!=typeof window&&window||this.content);"undefined"!=typeof module&&(module.exports=saveAs);