system-7/index_files/browserfs.js

14 lines
235 KiB
JavaScript
Raw Normal View History

2018-09-01 05:07:00 +00:00
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.BrowserFS=e():t.BrowserFS=e()}(this,function(){return function(t){function e(r){if(n[r])return n[r].exports;var i=n[r]={exports:{},id:r,loaded:!1};return t[r].call(i.exports,i,i.exports,e),i.loaded=!0,i.exports}var n={};return e.m=t,e.c=n,e.p="",e(0)}([function(t,e,n){(function(t,r,i,o){"use strict";function s(t){if(t)return t;throw new me(ge.EIO,"Initialize BrowserFS with a file system using BrowserFS.initialize(filesystem)")}function a(t,e){switch(typeof t){case"number":return t;case"string":var n=parseInt(t,8);return isNaN(n)?e:n;default:return e}}function c(t){if(t instanceof Date)return t;if("number"==typeof t)return new Date(1e3*t);throw new me(ge.EINVAL,"Invalid time.")}function u(t){if(t.indexOf("\0")>=0)throw new me(ge.EINVAL,"Path must be a string without null bytes.");if(""===t)throw new me(ge.EINVAL,"Path must not be empty.");return ye.resolve(t)}function f(t,e,n,r){switch(typeof t){case"object":return{encoding:"undefined"!=typeof t.encoding?t.encoding:e,flag:"undefined"!=typeof t.flag?t.flag:n,mode:a(t.mode,r)};case"string":return{encoding:t,flag:n,mode:r};default:return{encoding:e,flag:n,mode:r}}}function h(){}function p(){throw new Error("BFS has reached an impossible code path; please file a bug.")}function l(t,e,n){n.existsSync(t)||(l(ye.dirname(t),e,n),n.mkdirSync(t,e))}function d(t){var e=y(t),n=e.byteOffset,r=e.byteLength;return 0===n&&r===e.buffer.byteLength?e.buffer:e.buffer.slice(n,n+r)}function y(t){return t instanceof Uint8Array?t:new Uint8Array(t)}function g(t){return t instanceof r?t:t instanceof Uint8Array?_(t):new r(t)}function _(t){return t instanceof r?t:0===t.byteOffset&&t.byteLength===t.buffer.byteLength?v(t.buffer):new r(t)}function v(t){try{return new r(t)}catch(e){return new r(new Uint8Array(t))}}function w(t,e,n){if(void 0===e&&(e=0),void 0===n&&(n=t.length),e<0||n<0||n>t.length||e>n)throw new TypeError("Invalid slice bounds on buffer of length "+t.length+": ["+e+", "+n+"]");if(0===t.length)return new r(0);var i=y(t),o=t[0],s=(o+1)%255;return t[0]=s,i[0]===s?(i[0]=o,_(i.slice(e,n))):(t[0]=o,_(i.subarray(e,n)))}function m(t,e,n){switch(n.length){case 0:return t.call(e);case 1:return t.call(e,n[0]);case 2:return t.call(e,n[0],n[1]);case 3:return t.call(e,n[0],n[1],n[2])}return t.apply(e,n)}function E(t,e,n){return e=Ve(void 0===e?t.length-1:e,0),function(){for(var r=arguments,i=-1,o=Ve(r.length-e,0),s=Array(o);++i<o;)s[i]=r[e+i];i=-1;for(var a=Array(e+1);++i<e;)a[i]=r[i];return a[e]=n(s),m(t,this,a)}}function S(t){return t}function b(t,e){return E(t,e,S)}function k(t){return b(function(e,n){var r=We(function(n,r){var i=this;return t(e,function(t,e){t.apply(i,n.concat([e]))},r)});return n.length?r.apply(this,n):r})}function I(t){var e=Ge.call(t,Qe),n=t[Qe];try{t[Qe]=void 0;var r=!0}catch(t){}var i=Je.call(t);return r&&(e?t[Qe]=n:delete t[Qe]),i}function O(t){return tn.call(t)}function F(t){return null==t?void 0===t?nn:en:rn&&rn in Object(t)?I(t):O(t)}function R(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)}function N(t){if(!R(t))return!1;var e=F(t);return e==sn||e==an||e==on||e==cn}function L(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=un}function T(t){return null!=t&&L(t.length)&&!N(t)}function x(){}function D(t){return function(){if(null!==t){var e=t;t=null,e.apply(this,arguments)}}}function A(t,e){for(var n=-1,r=Array(t);++n<t;)r[n]=e(n);return r}function P(t){return null!=t&&"object"==typeof t}function C(t){return P(t)&&F(t)==pn}function U(){return!1}function M(t,e){return e=null==e?kn:e,!!e&&("number"==typeof t||In.test(t))&&t>-1&&t%1==0&&t<e}function B(t){return P(t)&&L(t.length)&&!!Gn[F(t)]}function j(t){return function(e){return t(e)}}function z(t,e){var n=_n(t),r=!n&&gn(t),i=!n&&!r&&bn(t),o=!n&&!r&&!i&&rr(t),s=n||r||i||o,a=s?A(t.length,String):[],c=a.length;for(var u in t)!e&&!or.call(t,u)||s&&("length"==u||i&&("offset"==u||"parent"==u)||o&&("buffer"==u||"byteLength"==u||"byteOffset"==u)||M(u,c
}:Re[t]=Fe[t]}),Re.changeFSModule=function(t){Fe=t},Re.getFSModule=function(){return Fe},Re.FS=Oe;var Le="undefined"!=typeof navigator&&!(!/(msie) ([\w.]+)/.exec(navigator.userAgent.toLowerCase())&&navigator.userAgent.indexOf("Trident")===-1),Te="undefined"==typeof window,xe=Object.freeze({isIE:Le,isWebWorker:Te,fail:p,mkdirpSync:l,buffer2ArrayBuffer:d,buffer2Uint8array:y,arrayish2Buffer:g,uint8Array2Buffer:_,arrayBuffer2Buffer:v,copyingSlice:w}),De=function(t){this.fs=t,this.nodefs=t.getNodeFS(),this.FS=t.getFS(),this.PATH=t.getPATH(),this.ERRNO_CODES=t.getERRNO_CODES()};De.prototype.open=function(t){var e=this.fs.realPath(t.node),n=this.FS;try{n.isFile(t.node.mode)&&(t.nfd=this.nodefs.openSync(e,this.fs.flagsToPermissionString(t.flags)))}catch(t){if(!t.code)throw t;throw new n.ErrnoError(this.ERRNO_CODES[t.code])}},De.prototype.close=function(t){var e=this.FS;try{e.isFile(t.node.mode)&&t.nfd&&this.nodefs.closeSync(t.nfd)}catch(t){if(!t.code)throw t;throw new e.ErrnoError(this.ERRNO_CODES[t.code])}},De.prototype.read=function(t,e,n,r,i){try{return this.nodefs.readSync(t.nfd,_(e),n,r,i)}catch(t){throw new this.FS.ErrnoError(this.ERRNO_CODES[t.code])}},De.prototype.write=function(t,e,n,r,i){try{return this.nodefs.writeSync(t.nfd,_(e),n,r,i)}catch(t){throw new this.FS.ErrnoError(this.ERRNO_CODES[t.code])}},De.prototype.llseek=function(t,e,n){var r=e;if(1===n)r+=t.position;else if(2===n&&this.FS.isFile(t.node.mode))try{var i=this.nodefs.fstatSync(t.nfd);r+=i.size}catch(t){throw new this.FS.ErrnoError(this.ERRNO_CODES[t.code])}if(r<0)throw new this.FS.ErrnoError(this.ERRNO_CODES.EINVAL);return t.position=r,r};var Ae=function(t){this.fs=t,this.nodefs=t.getNodeFS(),this.FS=t.getFS(),this.PATH=t.getPATH(),this.ERRNO_CODES=t.getERRNO_CODES()};Ae.prototype.getattr=function(t){var e,n=this.fs.realPath(t);try{e=this.nodefs.lstatSync(n)}catch(t){if(!t.code)throw t;throw new this.FS.ErrnoError(this.ERRNO_CODES[t.code])}return{dev:e.dev,ino:e.ino,mode:e.mode,nlink:e.nlink,uid:e.uid,gid:e.gid,rdev:e.rdev,size:e.size,atime:e.atime,mtime:e.mtime,ctime:e.ctime,blksize:e.blksize,blocks:e.blocks}},Ae.prototype.setattr=function(t,e){var n=this.fs.realPath(t);try{if(void 0!==e.mode&&(this.nodefs.chmodSync(n,e.mode),t.mode=e.mode),void 0!==e.timestamp){var r=new Date(e.timestamp);this.nodefs.utimesSync(n,r,r)}}catch(t){if(!t.code)throw t;if("ENOTSUP"!==t.code)throw new this.FS.ErrnoError(this.ERRNO_CODES[t.code])}if(void 0!==e.size)try{this.nodefs.truncateSync(n,e.size)}catch(t){if(!t.code)throw t;throw new this.FS.ErrnoError(this.ERRNO_CODES[t.code])}},Ae.prototype.lookup=function(t,e){var n=this.PATH.join2(this.fs.realPath(t),e),r=this.fs.getMode(n);return this.fs.createNode(t,e,r)},Ae.prototype.mknod=function(t,e,n,r){var i=this.fs.createNode(t,e,n,r),o=this.fs.realPath(i);try{this.FS.isDir(i.mode)?this.nodefs.mkdirSync(o,i.mode):this.nodefs.writeFileSync(o,"",{mode:i.mode})}catch(t){if(!t.code)throw t;throw new this.FS.ErrnoError(this.ERRNO_CODES[t.code])}return i},Ae.prototype.rename=function(t,e,n){var r=this.fs.realPath(t),i=this.PATH.join2(this.fs.realPath(e),n);try{this.nodefs.renameSync(r,i),t.name=n,t.parent=e}catch(t){if(!t.code)throw t;throw new this.FS.ErrnoError(this.ERRNO_CODES[t.code])}},Ae.prototype.unlink=function(t,e){var n=this.PATH.join2(this.fs.realPath(t),e);try{this.nodefs.unlinkSync(n)}catch(t){if(!t.code)throw t;throw new this.FS.ErrnoError(this.ERRNO_CODES[t.code])}},Ae.prototype.rmdir=function(t,e){var n=this.PATH.join2(this.fs.realPath(t),e);try{this.nodefs.rmdirSync(n)}catch(t){if(!t.code)throw t;throw new this.FS.ErrnoError(this.ERRNO_CODES[t.code])}},Ae.prototype.readdir=function(t){var e=this.fs.realPath(t);try{var n=this.nodefs.readdirSync(e);return n.push(".",".."),n}catch(t){if(!t.code)throw t;throw new this.FS.ErrnoError(this.ERRNO_CODES[t.code])}},Ae.prototype.symlink=function(t,e,n){var r=this.PATH.join2(this.fs.realPath(t),e);try{this.nodefs.symlinkSync(n,r)}catch(t){if(!t.code)throw t;throw new this.FS.ErrnoError(this.ERRNO_CODES[t.code])}},Ae.prototype.readlink=function(t){var e=this.fs.realPath(t);t
this._fs.utimesSync(this._path,t,e)},e}(Me),Vr=function(t){function e(e){t.call(this),this._FS=e}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.isAvailable=function(){return!0},e.prototype.getName=function(){return this._FS.DB_NAME()},e.prototype.isReadOnly=function(){return!1},e.prototype.supportsLinks=function(){return!0},e.prototype.supportsProps=function(){return!0},e.prototype.supportsSynch=function(){return!0},e.prototype.renameSync=function(t,e){try{this._FS.rename(t,e)}catch(n){throw n.errno===ge.ENOENT?gt(n,this.existsSync(t)?e:t):gt(n)}},e.prototype.statSync=function(t,e){try{var n=e?this._FS.lstat(t):this._FS.stat(t),r=this.modeToFileType(n.mode);return new ke(r,n.size,n.mode,n.atime,n.mtime,n.ctime)}catch(e){throw gt(e,t)}},e.prototype.openSync=function(t,e,n){try{var r=this._FS.open(t,e.getFlagString(),n);if(this._FS.isDir(r.node.mode))throw this._FS.close(r),me.EISDIR(t);return new qr(this,this._FS,t,r)}catch(e){throw gt(e,t)}},e.prototype.unlinkSync=function(t){try{this._FS.unlink(t)}catch(e){throw gt(e,t)}},e.prototype.rmdirSync=function(t){try{this._FS.rmdir(t)}catch(e){throw gt(e,t)}},e.prototype.mkdirSync=function(t,e){try{this._FS.mkdir(t,e)}catch(e){throw gt(e,t)}},e.prototype.readdirSync=function(t){try{return this._FS.readdir(t).filter(function(t){return"."!==t&&".."!==t})}catch(e){throw gt(e,t)}},e.prototype.truncateSync=function(t,e){try{this._FS.truncate(t,e)}catch(e){throw gt(e,t)}},e.prototype.readFileSync=function(t,e,n){try{var r=this._FS.readFile(t,{flags:n.getFlagString()}),i=_(r);return e?i.toString(e):i}catch(e){throw gt(e,t)}},e.prototype.writeFileSync=function(t,e,n,i,o){try{n&&(e=new r(e,n));var s=y(e);this._FS.writeFile(t,s,{flags:i.getFlagString(),encoding:"binary"}),this._FS.chmod(t,o)}catch(e){throw gt(e,t)}},e.prototype.chmodSync=function(t,e,n){try{e?this._FS.lchmod(t,n):this._FS.chmod(t,n)}catch(e){throw gt(e,t)}},e.prototype.chownSync=function(t,e,n,r){try{e?this._FS.lchown(t,n,r):this._FS.chown(t,n,r)}catch(e){throw gt(e,t)}},e.prototype.symlinkSync=function(t,e,n){try{this._FS.symlink(t,e)}catch(t){throw gt(t)}},e.prototype.readlinkSync=function(t){try{return this._FS.readlink(t)}catch(e){throw gt(e,t)}},e.prototype.utimesSync=function(t,e,n){try{this._FS.utime(t,e.getTime(),n.getTime())}catch(e){throw gt(e,t)}},e.prototype.modeToFileType=function(t){if(this._FS.isDir(t))return be.DIRECTORY;if(this._FS.isFile(t))return be.FILE;if(this._FS.isLink(t))return be.SYMLINK;throw me.EPERM("Invalid mode: "+t)},e}(Ue),Wr=function(t){function e(e,n){t.call(this),this._folder=e,this._wrapped=n}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.isAvailable=function(){return!0},e.prototype.initialize=function(t){var e=this;this._wrapped.exists(this._folder,function(n){n?t():e._wrapped.isReadOnly()?t(me.ENOENT(e._folder)):e._wrapped.mkdir(e._folder,511,t)})},e.prototype.getName=function(){return this._wrapped.getName()},e.prototype.isReadOnly=function(){return this._wrapped.isReadOnly()},e.prototype.supportsProps=function(){return this._wrapped.supportsProps()},e.prototype.supportsSynch=function(){return this._wrapped.supportsSynch()},e.prototype.supportsLinks=function(){return!1},e}(Ce);["diskSpace","stat","statSync","open","openSync","unlink","unlinkSync","rmdir","rmdirSync","mkdir","mkdirSync","readdir","readdirSync","exists","existsSync","realpath","realpathSync","truncate","truncateSync","readFile","readFileSync","writeFile","writeFileSync","appendFile","appendFileSync","chmod","chmodSync","chown","chownSync","utimes","utimesSync","readlink","readlinkSync"].forEach(function(t){Wr.prototype[t]=wt(t,!0,!1)}),["rename","renameSync","link","linkSync","symlink","symlinkSync"].forEach(function(t){Wr.prototype[t]=wt(t,!0,!0)});var Hr=_e.webkitRequestFileSystem||_e.requestFileSystem||null,Zr=function(t){function e(e,n,r,i,o,s){t.call(this,e,r,i,o,s),this._entry=n}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.sync=function(t){var e=this;retu
this._mu.lock(function(){s._fs.appendFile(t,e,n,r,i,function(t){s._mu.unlock(),o(t)})})},wi.prototype.appendFileSync=function(t,e,n,r,i){if(this._mu.isLocked())throw new Error("invalid sync call");return this._fs.appendFileSync(t,e,n,r,i)},wi.prototype.chmod=function(t,e,n,r){var i=this;this._mu.lock(function(){i._fs.chmod(t,e,n,function(t){i._mu.unlock(),r(t)})})},wi.prototype.chmodSync=function(t,e,n){if(this._mu.isLocked())throw new Error("invalid sync call");return this._fs.chmodSync(t,e,n)},wi.prototype.chown=function(t,e,n,r,i){var o=this;this._mu.lock(function(){o._fs.chown(t,e,n,r,function(t){o._mu.unlock(),i(t)})})},wi.prototype.chownSync=function(t,e,n,r){if(this._mu.isLocked())throw new Error("invalid sync call");return this._fs.chownSync(t,e,n,r)},wi.prototype.utimes=function(t,e,n,r){var i=this;this._mu.lock(function(){i._fs.utimes(t,e,n,function(t){i._mu.unlock(),r(t)})})},wi.prototype.utimesSync=function(t,e,n){if(this._mu.isLocked())throw new Error("invalid sync call");return this._fs.utimesSync(t,e,n)},wi.prototype.link=function(t,e,n){var r=this;this._mu.lock(function(){r._fs.link(t,e,function(t){r._mu.unlock(),n(t)})})},wi.prototype.linkSync=function(t,e){if(this._mu.isLocked())throw new Error("invalid sync call");return this._fs.linkSync(t,e)},wi.prototype.symlink=function(t,e,n,r){var i=this;this._mu.lock(function(){i._fs.symlink(t,e,n,function(t){i._mu.unlock(),r(t)})})},wi.prototype.symlinkSync=function(t,e,n){if(this._mu.isLocked())throw new Error("invalid sync call");return this._fs.symlinkSync(t,e,n)},wi.prototype.readlink=function(t,e){var n=this;this._mu.lock(function(){n._fs.readlink(t,function(t,r){n._mu.unlock(),e(t,r)})})},wi.prototype.readlinkSync=function(t){if(this._mu.isLocked())throw new Error("invalid sync call");return this._fs.readlinkSync(t)};var mi,Ei="/.deletedFiles.log",Si=function(t){function e(e,n,r,i,o){t.call(this,e,n,r,i,o)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.sync=function(t){var e=this;return this.isDirty()?void this._fs._syncAsync(this,function(n){e.resetDirty(),t(n)}):void t(null)},e.prototype.syncSync=function(){this.isDirty()&&(this._fs._syncSync(this),this.resetDirty())},e.prototype.close=function(t){this.sync(t)},e.prototype.closeSync=function(){this.syncSync()},e}(Be),bi=function(t){function e(e,n){if(t.call(this),this._isInitialized=!1,this._initializeCallbacks=[],this._deletedFiles={},this._deleteLog="",this._deleteLogUpdatePending=!1,this._deleteLogUpdateNeeded=!1,this._deleteLogError=null,this._writable=e,this._readable=n,this._writable.isReadOnly())throw new me(ge.EINVAL,"Writable file system must be writable.")}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.isAvailable=function(){return!0},e.prototype.getOverlayedFileSystems=function(){return{readable:this._readable,writable:this._writable}},e.prototype._syncAsync=function(t,e){var n=this;this.createParentDirectoriesAsync(t.getPath(),function(r){return r?e(r):void n._writable.writeFile(t.getPath(),t.getBuffer(),null,Tt("w"),t.getStats().mode,e)})},e.prototype._syncSync=function(t){this.createParentDirectories(t.getPath()),this._writable.writeFileSync(t.getPath(),t.getBuffer(),null,Tt("w"),t.getStats().mode)},e.prototype.getName=function(){return"OverlayFS"},e.prototype.initialize=function(t){var e=this,n=this._initializeCallbacks,r=function(t){e._isInitialized=!t,e._initializeCallbacks=[],n.forEach(function(e){return e(t)})};return this._isInitialized?t():(n.push(t),void(1===n.length&&this._writable.readFile(Ei,"utf8",Tt("r"),function(t,n){if(t){if(t.errno!==ge.ENOENT)return r(t)}else e._deleteLog=n;e._reparseDeletionLog(),r()})))},e.prototype.isReadOnly=function(){return!1},e.prototype.supportsSynch=function(){return this._readable.supportsSynch()&&this._writable.supportsSynch()},e.prototype.supportsLinks=function(){return!1},e.prototype.supportsProps=function(){return this._readable.supportsProps()&&this._writable.supportsProps()},e.prototype.getDeletionLog=function(){return this._deleteLo
var n=Bi[t];throw n||(n="Unknown: "+t),new me(ge.EINVAL,"Invalid compression method on file '"+this.header.fileName()+"': "+n)},zi.prototype.getHeader=function(){return this.header},zi.prototype.getRecord=function(){return this.record},zi.prototype.getRawData=function(){return this.data};var qi=function(t){this.data=t};qi.prototype.crc32=function(){return this.data.readUInt32LE(0)},qi.prototype.compressedSize=function(){return this.data.readUInt32LE(4)},qi.prototype.uncompressedSize=function(){return this.data.readUInt32LE(8)};var Vi=function(t){if(this.data=t,134630224!==this.data.readUInt32LE(0))throw new me(ge.EINVAL,"Invalid archive extra data record signature: "+this.data.readUInt32LE(0))};Vi.prototype.length=function(){return this.data.readUInt32LE(4)},Vi.prototype.extraFieldData=function(){return this.data.slice(8,8+this.length())};var Wi=function(t){if(this.data=t,84233040!==this.data.readUInt32LE(0))throw new me(ge.EINVAL,"Invalid digital signature signature: "+this.data.readUInt32LE(0))};Wi.prototype.size=function(){return this.data.readUInt16LE(4)},Wi.prototype.signatureData=function(){return this.data.slice(6,6+this.size())};var Hi=function(t,e){if(this.zipData=t,this.data=e,33639248!==this.data.readUInt32LE(0))throw new me(ge.EINVAL,"Invalid Zip file: Central directory record has invalid signature: "+this.data.readUInt32LE(0));this._filename=this.produceFilename()};Hi.prototype.versionMadeBy=function(){return this.data.readUInt16LE(4)},Hi.prototype.versionNeeded=function(){return this.data.readUInt16LE(6)},Hi.prototype.flag=function(){return this.data.readUInt16LE(8)},Hi.prototype.compressionMethod=function(){return this.data.readUInt16LE(10)},Hi.prototype.lastModFileTime=function(){return ee(this.data.readUInt16LE(12),this.data.readUInt16LE(14))},Hi.prototype.rawLastModFileTime=function(){return this.data.readUInt32LE(12)},Hi.prototype.crc32=function(){return this.data.readUInt32LE(16)},Hi.prototype.compressedSize=function(){return this.data.readUInt32LE(20)},Hi.prototype.uncompressedSize=function(){return this.data.readUInt32LE(24)},Hi.prototype.fileNameLength=function(){return this.data.readUInt16LE(28)},Hi.prototype.extraFieldLength=function(){return this.data.readUInt16LE(30)},Hi.prototype.fileCommentLength=function(){return this.data.readUInt16LE(32)},Hi.prototype.diskNumberStart=function(){return this.data.readUInt16LE(34)},Hi.prototype.internalAttributes=function(){return this.data.readUInt16LE(36)},Hi.prototype.externalAttributes=function(){return this.data.readUInt32LE(38)},Hi.prototype.headerRelativeOffset=function(){return this.data.readUInt32LE(42)},Hi.prototype.produceFilename=function(){var t=ne(this.data,this.useUTF8(),46,this.fileNameLength());return t.replace(/\\/g,"/")},Hi.prototype.fileName=function(){return this._filename},Hi.prototype.rawFileName=function(){return this.data.slice(46,46+this.fileNameLength())},Hi.prototype.extraField=function(){var t=44+this.fileNameLength();return this.data.slice(t,t+this.extraFieldLength())},Hi.prototype.fileComment=function(){var t=46+this.fileNameLength()+this.extraFieldLength();return ne(this.data,this.useUTF8(),t,this.fileCommentLength())},Hi.prototype.rawFileComment=function(){var t=46+this.fileNameLength()+this.extraFieldLength();return this.data.slice(t,t+this.fileCommentLength())},Hi.prototype.totalSize=function(){return 46+this.fileNameLength()+this.extraFieldLength()+this.fileCommentLength()},Hi.prototype.isDirectory=function(){var t=this.fileName();return!!(16&this.externalAttributes())||"/"===t.charAt(t.length-1)},Hi.prototype.isFile=function(){return!this.isDirectory()},Hi.prototype.useUTF8=function(){return 2048===(2048&this.flag())},Hi.prototype.isEncrypted=function(){return 1===(1&this.flag())},Hi.prototype.getFileData=function(){var t=this.headerRelativeOffset(),e=new ji(this.zipData.slice(t));return new zi(e,this,this.zipData.slice(t+e.totalSize()))},Hi.prototype.getData=function(){return this.getFileData().decompress()},Hi.prototype.getRawData=function(){return this.getFileData().getRawData()},Hi.prototype.getStats=function(){return
* The buffer module from node.js, for the browser.
*
* @author Feross Aboukhadijeh <feross@feross.org> <http://feross.org>
* @license MIT
*/
"use strict";function r(){try{var t=new Uint8Array(1);return t.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},42===t.foo()}catch(t){return!1}}function i(e){if(e>K)throw new RangeError("Invalid typed array length");var n=new Uint8Array(e);return n.__proto__=t.prototype,n}function t(t,e,n){if("number"==typeof t){if("string"==typeof e)throw new Error("If encoding is specified then the first argument must be a string");return c(t)}return o(t,e,n)}function o(t,e,n){if("number"==typeof t)throw new TypeError('"value" argument must not be a number');return"undefined"!=typeof ArrayBuffer&&t instanceof ArrayBuffer?h(t,e,n):"string"==typeof t?u(t,e):p(t)}function s(t){if("number"!=typeof t)throw new TypeError('"size" argument must be a number');if(t<0)throw new RangeError('"size" argument must not be negative')}function a(t,e,n){return s(t),t<=0?i(t):void 0!==e?"string"==typeof n?i(t).fill(e,n):i(t).fill(e):i(t)}function c(t){return s(t),i(t<0?0:0|l(t))}function u(e,n){if("string"==typeof n&&""!==n||(n="utf8"),!t.isEncoding(n))throw new TypeError('"encoding" must be a valid string encoding');var r=0|y(e,n),o=i(r),s=o.write(e,n);return s!==r&&(o=o.slice(0,s)),o}function f(t){for(var e=t.length<0?0:0|l(t.length),n=i(e),r=0;r<e;r+=1)n[r]=255&t[r];return n}function h(e,n,r){if(e.byteLength,n<0||e.byteLength<n)throw new RangeError("'offset' is out of bounds");if(e.byteLength<n+(r||0))throw new RangeError("'length' is out of bounds");var i;return i=void 0===n&&void 0===r?new Uint8Array(e):void 0===r?new Uint8Array(e,n):new Uint8Array(e,n,r),i.__proto__=t.prototype,i}function p(e){if(t.isBuffer(e)){var n=0|l(e.length),r=i(n);return 0===r.length?r:(e.copy(r,0,0,n),r)}if(e){if("undefined"!=typeof ArrayBuffer&&e.buffer instanceof ArrayBuffer||"length"in e)return"number"!=typeof e.length||Z(e.length)?i(0):f(e);if("Buffer"===e.type&&Array.isArray(e.data))return f(e.data)}throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}function l(t){if(t>=K)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+K.toString(16)+" bytes");return 0|t}function d(e){return+e!=e&&(e=0),t.alloc(+e)}function y(e,n){if(t.isBuffer(e))return e.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(e)||e instanceof ArrayBuffer))return e.byteLength;"string"!=typeof e&&(e=""+e);var r=e.length;if(0===r)return 0;for(var i=!1;;)switch(n){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":case void 0:return z(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return W(e).length;default:if(i)return z(e).length;n=(""+n).toLowerCase(),i=!0}}function g(t,e,n){var r=!1;if((void 0===e||e<0)&&(e=0),e>this.length)return"";if((void 0===n||n>this.length)&&(n=this.length),n<=0)return"";if(n>>>=0,e>>>=0,n<=e)return"";for(t||(t="utf8");;)switch(t){case"hex":return T(this,e,n);case"utf8":case"utf-8":return F(this,e,n);case"ascii":return N(this,e,n);case"latin1":case"binary":return L(this,e,n);case"base64":return O(this,e,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return x(this,e,n);default:if(r)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),r=!0}}function _(t,e,n){var r=t[e];t[e]=t[n],t[n]=r}function v(e,n,r,i,o){if(0===e.length)return-1;if("string"==typeof r?(i=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),r=+r,isNaN(r)&&(r=o?0:e.length-1),r<0&&(r=e.length+r),r>=e.length){if(o)return-1;r=e.length-1}else if(r<0){if(!o)return-1;r=0}if("string"==typeof n&&(n=t.from(n,i)),t.isBuffer(n))return 0===n.length?-1:w(e,n,r,i,o);if("number"==typeof n)return n&=255,"function"==typeof Uint8Array.prototype.indexOf?o?Uint8Array.prototype.indexOf.call(e,n,r):Uint8Array.prototype.lastIndexOf.call(e,n,r):w(e,[n],r,i,o);throw new TypeError("val must be string, number or Buffer")}function w(t,e,n,r,i){function o(t,e){return 1===s?t[e]:t.readUInt16BE(e*s)}var s=1,a=t.length,c=e.length;if(void 0!==r&&(r=String(r).toLowerCase(),"ucs2"===r||"u
this.defaultEncoding=t.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(t){d(e,t)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.bufferedRequestCount=0,this.corkedRequestsFree=new S(this)}function s(t){return b=b||n(2),T.call(s,this)||this instanceof b?(this._writableState=new o(t,this),this.writable=!0,t&&("function"==typeof t.write&&(this._write=t.write),"function"==typeof t.writev&&(this._writev=t.writev)),void F.call(this)):new s(t)}function a(t,e){var n=new Error("write after end");t.emit("error",n),k(e,n)}function c(t,e,n,r){var i=!0,o=!1;return null===n?o=new TypeError("May not write null values to stream"):N.isBuffer(n)||"string"==typeof n||void 0===n||e.objectMode||(o=new TypeError("Invalid non-string/buffer chunk")),o&&(t.emit("error",o),k(r,o),i=!1),i}function u(t,e,n){return t.objectMode||t.decodeStrings===!1||"string"!=typeof e||(e=L.from(e,n)),e}function f(t,e,n,r,o){n=u(e,n,r),N.isBuffer(n)&&(r="buffer");var s=e.objectMode?1:n.length;e.length+=s;var a=e.length<e.highWaterMark;if(a||(e.needDrain=!0),e.writing||e.corked){var c=e.lastBufferedRequest;e.lastBufferedRequest=new i(n,r,o),c?c.next=e.lastBufferedRequest:e.bufferedRequest=e.lastBufferedRequest,e.bufferedRequestCount+=1}else h(t,e,!1,s,n,r,o);return a}function h(t,e,n,r,i,o,s){e.writelen=r,e.writecb=s,e.writing=!0,e.sync=!0,n?t._writev(i,e.onwrite):t._write(i,o,e.onwrite),e.sync=!1}function p(t,e,n,r,i){--e.pendingcb,n?k(i,r):i(r),t._writableState.errorEmitted=!0,t.emit("error",r)}function l(t){t.writing=!1,t.writecb=null,t.length-=t.writelen,t.writelen=0}function d(t,e){var n=t._writableState,r=n.sync,i=n.writecb;if(l(n),e)p(t,n,r,e,i);else{var o=v(n);o||n.corked||n.bufferProcessing||!n.bufferedRequest||_(t,n),r?I(y,t,n,o,i):y(t,n,o,i)}}function y(t,e,n,r){n||g(t,e),e.pendingcb--,r(),m(t,e)}function g(t,e){0===e.length&&e.needDrain&&(e.needDrain=!1,t.emit("drain"))}function _(t,e){e.bufferProcessing=!0;var n=e.bufferedRequest;if(t._writev&&n&&n.next){var r=e.bufferedRequestCount,i=new Array(r),o=e.corkedRequestsFree;o.entry=n;for(var s=0;n;)i[s]=n,n=n.next,s+=1;h(t,e,!0,e.length,i,"",o.finish),e.pendingcb++,e.lastBufferedRequest=null,o.next?(e.corkedRequestsFree=o.next,o.next=null):e.corkedRequestsFree=new S(e)}else{for(;n;){var a=n.chunk,c=n.encoding,u=n.callback,f=e.objectMode?1:a.length;if(h(t,e,!1,f,a,c,u),n=n.next,e.writing)break}null===n&&(e.lastBufferedRequest=null)}e.bufferedRequestCount=0,e.bufferedRequest=n,e.bufferProcessing=!1}function v(t){return t.ending&&0===t.length&&null===t.bufferedRequest&&!t.finished&&!t.writing}function w(t,e){e.prefinished||(e.prefinished=!0,t.emit("prefinish"))}function m(t,e){var n=v(e);return n&&(0===e.pendingcb?(w(t,e),e.finished=!0,t.emit("finish")):w(t,e)),n}function E(t,e,n){e.ending=!0,m(t,e),n&&(e.finished?k(n):t.once("finish",n)),e.ended=!0,t.writable=!1}function S(t){var e=this;this.next=null,this.entry=null,this.finish=function(n){var r=e.entry;for(e.entry=null;r;){var i=r.callback;t.pendingcb--,i(n),r=r.next}t.corkedRequestsFree?t.corkedRequestsFree.next=e:t.corkedRequestsFree=e}}t.exports=s;var b,k=n(11),I=!e.browser&&["v0.10","v0.9."].indexOf(e.version.slice(0,5))>-1?setImmediate:k;s.WritableState=o;var O=n(5);O.inherits=n(4);var F,R={deprecate:n(40)};!function(){try{F=n(9)}catch(t){}finally{F||(F=n(6).EventEmitter)}}();var N=n(1).Buffer,L=n(10);O.inherits(s,F),o.prototype.getBuffer=function(){for(var t=this.bufferedRequest,e=[];t;)e.push(t),t=t.next;return e},function(){try{Object.defineProperty(o.prototype,"buffer",{get:R.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.")})}catch(t){}}();var T;"function"==typeof Symbol&&Symbol.hasInstance&&"function"==typeof Function.prototype[Symbol.hasInstance]?(T=Function.prototype[Symbol.hasInstance],Object.defineProperty(s,Symbol.hasInstance,{value:function(t){return!!T.call(this,t)||t&&t._writableSta
u[i++]=56320|1023&o)}return r(u,i)},e.utf8border=function(t,e){var n;for(e=e||t.length,e>t.length&&(e=t.length),n=e-1;n>=0&&128===(192&t[n]);)n--;return n<0?e:0===n?e:n+a[t[n]]>e?n:e}},function(t,e){"use strict";function n(t,e,n,r){for(var i=65535&t|0,o=t>>>16&65535|0,s=0;0!==n;){s=n>2e3?2e3:n,n-=s;do i=i+e[r++]|0,o=o+i|0;while(--s);i%=65521,o%=65521}return i|o<<16|0}t.exports=n},function(t,e){"use strict";t.exports={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8}},function(t,e){"use strict";function n(){for(var t,e=[],n=0;n<256;n++){t=n;for(var r=0;r<8;r++)t=1&t?3988292384^t>>>1:t>>>1;e[n]=t}return e}function r(t,e,n,r){var o=i,s=r+n;t^=-1;for(var a=r;a<s;a++)t=t>>>8^o[255&(t^e[a])];return t^-1}var i=n();t.exports=r},function(t,e){"use strict";function n(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name="",this.comment="",this.hcrc=0,this.done=!1}t.exports=n},function(t,e){"use strict";var n=30,r=12;t.exports=function(t,e){var i,o,s,a,c,u,f,h,p,l,d,y,g,_,v,w,m,E,S,b,k,I,O,F,R;i=t.state,o=t.next_in,F=t.input,s=o+(t.avail_in-5),a=t.next_out,R=t.output,c=a-(e-t.avail_out),u=a+(t.avail_out-257),f=i.dmax,h=i.wsize,p=i.whave,l=i.wnext,d=i.window,y=i.hold,g=i.bits,_=i.lencode,v=i.distcode,w=(1<<i.lenbits)-1,m=(1<<i.distbits)-1;t:do{g<15&&(y+=F[o++]<<g,g+=8,y+=F[o++]<<g,g+=8),E=_[y&w];e:for(;;){if(S=E>>>24,y>>>=S,g-=S,S=E>>>16&255,0===S)R[a++]=65535&E;else{if(!(16&S)){if(0===(64&S)){E=_[(65535&E)+(y&(1<<S)-1)];continue e}if(32&S){i.mode=r;break t}t.msg="invalid literal/length code",i.mode=n;break t}b=65535&E,S&=15,S&&(g<S&&(y+=F[o++]<<g,g+=8),b+=y&(1<<S)-1,y>>>=S,g-=S),g<15&&(y+=F[o++]<<g,g+=8,y+=F[o++]<<g,g+=8),E=v[y&m];n:for(;;){if(S=E>>>24,y>>>=S,g-=S,S=E>>>16&255,!(16&S)){if(0===(64&S)){E=v[(65535&E)+(y&(1<<S)-1)];continue n}t.msg="invalid distance code",i.mode=n;break t}if(k=65535&E,S&=15,g<S&&(y+=F[o++]<<g,g+=8,g<S&&(y+=F[o++]<<g,g+=8)),k+=y&(1<<S)-1,k>f){t.msg="invalid distance too far back",i.mode=n;break t}if(y>>>=S,g-=S,S=a-c,k>S){if(S=k-S,S>p&&i.sane){t.msg="invalid distance too far back",i.mode=n;break t}if(I=0,O=d,0===l){if(I+=h-S,S<b){b-=S;do R[a++]=d[I++];while(--S);I=a-k,O=R}}else if(l<S){if(I+=h+l-S,S-=l,S<b){b-=S;do R[a++]=d[I++];while(--S);if(I=0,l<b){S=l,b-=S;do R[a++]=d[I++];while(--S);I=a-k,O=R}}}else if(I+=l-S,S<b){b-=S;do R[a++]=d[I++];while(--S);I=a-k,O=R}for(;b>2;)R[a++]=O[I++],R[a++]=O[I++],R[a++]=O[I++],b-=3;b&&(R[a++]=O[I++],b>1&&(R[a++]=O[I++]))}else{I=a-k;do R[a++]=R[I++],R[a++]=R[I++],R[a++]=R[I++],b-=3;while(b>2);b&&(R[a++]=R[I++],b>1&&(R[a++]=R[I++]))}break}}break}}while(o<s&&a<u);b=g>>3,o-=b,g-=b<<3,y&=(1<<g)-1,t.next_in=o,t.next_out=a,t.avail_in=o<s?5+(s-o):5-(o-s),t.avail_out=a<u?257+(u-a):257-(a-u),i.hold=y,i.bits=g}},function(t,e,n){"use strict";function r(t){return(t>>>24&255)+(t>>>8&65280)+((65280&t)<<8)+((255&t)<<24)}function i(){this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new v.Buf16(320),this.work=new v.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function o(t){var e;return t&&t.state?(e=t.state,t.total_in=t.total_out=e.total=0,t.msg="",e.wrap&&(t.adler=1&e.wrap),e.mode=U,e.last=0,e.havedict=0,e.dmax=32768,e.head=null,e.hold=0,e.bits=0,e.lencode=e.lendyn=new v.Buf32(yt),e.distcode=e.distdyn=new v.Buf32(gt),e.sane=1,e.back=-1,N):x}function s(t){var e;return t&&t.state?(e=t.state,e.wsize=0,e.whave=0,e.wnext=0,o(t)):x}function a(t,e){
//# sourceMappingURL=browserfs.min.js.map