b.getNode(a,g)}functionca(a,b,c,d,e){I(c,e)&&C(b,c,d,e)}functionda(a,b,c,d,e){varf=a.openFiles[c];f?D(b,f,d,e):e(newXa.EBADF)}functionea(a,b,c,d,e,f,g){"function"==typeoff&&(g=f,f=null),I(c,g)&&A(b,c,d,e,f,g)}functionfa(a,b,c,d,e,f,g){"function"==typeoff&&(g=f,f=null);varh=a.openFiles[c];h?wa(h.flags).contains(Na)?B(b,h,d,e,f,g):g(newXa.EBADF("descriptor does not permit writing")):g(newXa.EBADF)}functionga(a,b,c,d,e){I(c,e)&&E(b,c,d,e)}functionha(a,b,c,d,e){varf=a.openFiles[c];f?wa(f.flags).contains(Na)?F(b,f,d,e):e(newXa.EBADF("descriptor does not permit writing")):e(newXa.EBADF)}functionia(a,b,c,d,e,f){functiong(a,b){a?f(a):b.size+d<0?f(newXa.EINVAL("resulting file offset would be negative")):(h.position=b.size+d,f(null,h.position))}varh=a.openFiles[c];h||f(newXa.EBADF),"SET"===e?d<0?f(newXa.EINVAL("resulting file offset would be negative")):(h.position=d,f(null,h.position)):"CUR"===e?h.position+d<0?f(newXa.EINVAL("resulting file offset would be negative")):(h.position+=d,f(null,h.position)):"END"===e?p(b,h,g):f(newXa.EINVAL("whence argument is not a proper value"))}functionja(a,b,c,d){I(c,d)&&t(b,c,d)}functionka(a,b,c,d,e,f){if(I(c,f)){varg=Date.now();d=d||g,e=e||g,y(b,c,d,e,f)}}functionla(a,b,c,d,e,f){varg=Date.now();d=d||g,e=e||g;varh=a.openFiles[c];h?wa(h.flags).contains(Na)?z(b,h,d,e,f):f(newXa.EBADF("descriptor does not permit writing")):f(newXa.EBADF)}functionma(a,b,c,d,e){I(c,e)&&(d=Z(d,"mode"))&&$(b,c,d,e)}functionna(a,b,c,d,e){if(d=Z(d,"mode")){varf=a.openFiles[c];f?wa(f.flags).contains(Na)?_(b,f,d,e):e(newXa.EBADF("descriptor does not permit writing")):e(newXa.EBADF)}}functionoa(a,b,c,d,e,f){if(I(c,f))returnY(d)?Y(e)?voidaa(b,c,d,e,f):f(newXa.EINVAL("gid must be a valid integer",e)):f(newXa.EINVAL("uid must be a valid integer",d))}functionpa(a,b,c,d,e,f){if(!Y(d))returnf(newXa.EINVAL("uid must be a valid integer",d));if(!Y(e))returnf(newXa.EINVAL("gid must be a valid integer",e));varg=a.openFiles[c];g?wa(g.flags).contains(Na)?ba(b,g,d,e,f):f(newXa.EBADF("descriptor does not permit writing")):f(newXa.EBADF)}functionqa(a,b,c,e,g){functionh(a,c){a?g(a):(y=c,d(b,e,y,{ctime:D},g))}functioni(a){a?g(a):b.getObject(x[C].id,h)}functionk(a){a?g(a):(u.id===w.id&&(v=x),deletev[B],b.putObject(u.data,v,i))}functionl(a){a?g(a):(x[C]=v[B],b.putObject(w.data,x,k))}functionm(a,c){a?g(a):(x=c,wa(x).has(C)?j(b,e,l):l())}functionn(a,c){a?g(a):(w=c,b.getObject(w.data,m))}functiono(a,c){a?g(a):(v=c,f(b,A,n))}functionp(a,c){a?g(a):(u=c,b.getObject(c.data,o))}functionq(a){a?g(a):s(b,c,g)}functiont(a,d){a?g(a):d.type===Fa?f(b,z,p):r(b,c,e,q)}if(I(c,g)&&I(e,g)){c=ya(c),e=ya(e);varu,v,w,x,y,z=xa.dirname(c),A=xa.dirname(c),B=xa.basename(c),C=xa.basename(e),D=Date.now();f(b,c,t)}}functionra(a,b,c,d,e,f){f=arguments[arguments.length-1],I(c,!0,f)&&I(d,f)&&u(b,c,d,f)}functionsa(a,b,c,d){I(c,d)&&v(b,c,d)}functionta(a,b,c,d){functione(b,e){if(b)d(b);else{varf=newab(c,e,a.name);d(null,f)}}I(c,d)&&q(b,c,e)}functionua(a,b,c,d,e){e=arguments[arguments.length-1],d=d||0,I(c,e)&&w(b,c,d,e)}functionva(a,b,c,d,e){e=arguments[arguments.length-1],d=d||0;varf=a.openFiles[c];f?wa(f.flags).contains(Na)?x(b,f,d,e):e(newXa.EBADF("descriptor does not permit writing")):e(newXa.EBADF)}varwa=a("../../lib/nodash.js"),xa=a("../path.js"),ya=xa.normalize,za=xa.dirname,Aa=xa.basename,Ba=xa.isAbsolute,Ca=xa.isNull,Da=a("../constants.js"),Ea=Da.NODE_TYPE_FILE,Fa=Da.NODE_TYPE_DIRECTORY,Ga=Da.NODE_TYPE_SYMBOLIC_LINK,Ha=Da.NODE_TYPE_META,Ia=(Da.DEFAULT_FILE_PERMISSIONS,Da.DEFAULT_DIR_PERMISSIONS,Da.FULL_READ_WRITE_EXEC_PERMISSIONS),Ja=Da.ROOT_DIRECTORY_NAME,Ka=Da.SUPER_NODE_ID,La=Da.SYMLOOP_MAX,Ma=Da.O_READ,Na=Da.O_WRITE,Oa=Da.O_CREATE,Pa=Da.O_EXCLUSIVE,Qa=(Da.O_TRUNCATE,Da.O_APPEND),Ra=Da.O_FLAGS,Sa=Da.XATTR_CREATE,Ta=Da.XATTR_REPLACE,Ua=Da.FS_NOMTIME,Va=Da.FS_NOCTIME,Wa=a("../encoding.js"),Xa=a("../errors.js"),Ya=a("../directory-entry.js"),Za=a("../open-file-description.js"),$a=a("../super-node.js"),_a=a("../node.js"),ab=a("../stats.js"),bb=a("../buffer.js"),cb=/^[0-7]+$/;b.exports={ensureRootDi
ta.O_APPEND),Ga=ta.O_FLAGS,Ha=ta.XATTR_CREATE,Ia=ta.XATTR_REPLACE,Ja=ta.FS_NOMTIME,Ka=ta.FS_NOCTIME,La=a("../encoding.js"),Ma=a("../errors.js"),Na=a("../directory-entry.js"),Oa=a("../open-file-description.js"),Pa=a("../super-node.js"),Qa=a("../node.js"),Ra=a("../stats.js"),Sa=a("../buffer.js");b.exports={ensureRootDirectory:h,open:J,close:K,mknod:L,mkdir:M,rmdir:N,unlink:R,stat:O,fstat:P,link:Q,read:S,readFile:T,write:U,writeFile:V,appendFile:W,exists:X,getxattr:Y,fgetxattr:Z,setxattr:$,fsetxattr:_,removexattr:aa,fremovexattr:ba,lseek:ca,readdir:da,utimes:ea,futimes:fa,rename:ga,symlink:ha,readlink:ia,lstat:ja,truncate:ka,ftruncate:la}},{"../../lib/nodash.js":4,"../buffer.js":14,"../constants.js":15,"../directory-entry.js":16,"../encoding.js":17,"../errors.js":18,"../node.js":23,"../open-file-description.js":24,"../path.js":25,"../stats.js":33,"../super-node.js":34}],20:[function(a,b,c){functiond(a){return"function"==typeofa?a:function(a){if(a)throwa}}functione(a){a&&console.error("Filer error: ",a)}functionf(a,b){functionc(){I.forEach(function(a){a.call(this)}.bind(F)),I=null}functiond(a){returnfunction(b){functionc(b){vard=B();a.getObject(d,function(a,e){returna?voidb(a):void(e?c(b):b(null,d))})}returng(j).contains(p)?voidb(null,B()):voidc(b)}}functionf(a){if(a.length){varb=s.getInstance();a.forEach(function(a){b.emit(a.event,a.path)})}}a=a||{},b=b||e;varj=a.flags,B=a.guid?a.guid:v,C=a.provider||newq.Default(a.name||k),D=a.name||C.name,E=g(j).contains(l),F=this;F.readyState=n,F.name=D,F.error=null,F.stdin=w,F.stdout=x,F.stderr=y,this.Shell=r.bind(void0,this);varG={},H=z;Object.defineProperty(this,"openFiles",{get:function(){returnG}}),this.allocDescriptor=function(a){varb=H++;returnG[b]=a,b},this.releaseDescriptor=function(a){deleteG[a]};varI=[];this.queueOrRun=function(a){varb;returnm==F.readyState?a.call(F):o==F.readyState?b=newu.EFILESYSTEMERROR("unknown error"):I.push(a),b},this.watch=function(a,b,c){if(h(a))thrownewError("Path must be a string without null bytes.");"function"==typeofb&&(c=b,b={}),b=b||{},c=c||i;vard=newt;returnd.start(a,!1,b.recursive),d.on("change",c),d},C.open(function(a){functione(a){functione(a){varb=C[a]();returnb.flags=j,b.changes=[],b.guid=d(b),b.close=function(){vara=b.changes;f(a),a.length=0},b}F.provider={openReadWriteContext:function(){returne("getReadWriteContext")},openReadOnlyContext:function(){returne("getReadOnlyContext")}},a?F.readyState=o:F.readyState=m,c(),b(a,F)}if(a)returne(a);varg=C.getReadWriteContext();g.guid=d(g),E?g.clear(function(a){returna?e(a):voidA.ensureRootDirectory(g,e)}):A.ensureRootDirectory(g,e)})}varg=a("../../lib/nodash.js"),h=a("../path.js").isNull,i=a("../shared.js").nop,j=a("../constants.js"),k=j.FILE_SYSTEM_NAME,l=j.FS_FORMAT,m=j.FS_READY,n=j.FS_PENDING,o=j.FS_ERROR,p=j.FS_NODUPEIDCHECK,q=a("../providers/index.js"),r=a("../shell/shell.js"),s=a("../../lib/intercom.js"),t=a("../fs-watcher.js"),u=a("../errors.js"),v=a("../shared.js").guid,w=j.STDIN,x=j.STDOUT,y=j.STDERR,z=j.FIRST_DESCRIPTOR,A=a("./implementation.js");f.providers=q,["open","close","mknod","mkdir","rmdir","stat","fstat","link","unlink","read","readFile","write","writeFile","appendFile","exists","lseek","readdir","rename","readlink","symlink","lstat","truncate","ftruncate","utimes","futimes","setxattr","getxattr","fsetxattr","fgetxattr","removexattr","fremovexattr"].forEach(function(a){f.prototype[a]=function(){varb=this,c=Array.prototype.slice.call(arguments,0),e=c.length-1,f="function"!=typeofc[e],g=d(c[e]),h=b.queueOrRun(function(){functiond(){h.close(),g.apply(b,arguments)}varh=b.provider.openReadWriteContext();if(o===b.readyState){vari=newu.EFILESYSTEMERROR("filesystem unavailable, operation canceled");returng.call(b,i)}f?c.push(d):c[e]=d;varj=[b,h].concat(c);A[a].apply(null,j)});h&&g(h)}}),b.exports=f},{"../../lib/intercom.js":3,"../../lib/nodash.js":4,"../constants.js":15,"../errors.js":18,"../fs-watcher.js":21,"../path.js":25,"../providers/index.js":26,"../shared.js":30,"../shell/shell.js":32,"./implementation.js":19}],21:[function(
vart={};["9:EBADF:bad file descriptor","10:EBUSY:resource busy or locked","18:EINVAL:invalid argument","27:ENOTDIR:not a directory","28:EISDIR:illegal operation on a directory","34:ENOENT:no such file or directory","47:EEXIST:file already exists","51:ELOOP:too many symbolic links encountered","53:ENOTEMPTY:directory not empty","55:EIO:i/o error","1000:ENOTMOUNTED:not mounted","1001:EFILESYSTEMERROR:missing super node, use 'FORMAT' flag to format filesystem.","1002:ENOATTR:attribute does not exist"].forEach(function(e){varo=+(e=e.split(":"))[0],r=e[1],s=e[2];functioni(t,e){Error.call(this),this.name=r,this.code=r,this.errno=o,this.message=t||s,e&&(this.path=e),this.stack=newError(this.message).stack}i.prototype=Object.create(Error.prototype),i.prototype.constructor=i,i.prototype.toString=function(){vart=this.path?", '"+this.path+"'":"";returnthis.name+": "+this.message+t},t[r]=t[o]=i}),module.exports=t;
},{}],29:[function(require,module,exports){
"use strict";exports.byteLength=u,exports.toByteArray=i,exports.fromByteArray=d;for(varr=[],t=[],e="undefined"!=typeofUint8Array?Uint8Array:Array,n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",o=0,a=n.length;o<a;++o)r[o]=n[o],t[n.charCodeAt(o)]=o;functionh(r){vart=r.length;if(t%4>0)thrownewError("Invalid string. Length must be a multiple of 4");vare=r.indexOf("=");return-1===e&&(e=t),[e,e===t?0:4-e%4]}functionu(r){vart=h(r),e=t[0],n=t[1];return3*(e+n)/4-n}functionc(r,t,e){return3*(t+e)/4-e}functioni(r){for(varn,o=h(r),a=o[0],u=o[1],i=newe(c(r,a,u)),f=0,A=u>0?a-4:a,d=0;d<A;d+=4)n=t[r.charCodeAt(d)]<<18|t[r.charCodeAt(d+1)]<<12|t[r.charCodeAt(d+2)]<<6|t[r.charCodeAt(d+3)],i[f++]=n>>16&255,i[f++]=n>>8&255,i[f++]=255&n;return2===u&&(n=t[r.charCodeAt(d)]<<2|t[r.charCodeAt(d+1)]>>4,i[f++]=255&n),1===u&&(n=t[r.charCodeAt(d)]<<10|t[r.charCodeAt(d+1)]<<4|t[r.charCodeAt(d+2)]>>2,i[f++]=n>>8&255,i[f++]=255&n),i}functionf(t){returnr[t>>18&63]+r[t>>12&63]+r[t>>6&63]+r[63&t]}functionA(r,t,e){for(varn,o=[],a=t;a<e;a+=3)n=(r[a]<<16&16711680)+(r[a+1]<<8&65280)+(255&r[a+2]),o.push(f(n));returno.join("")}functiond(t){for(vare,n=t.length,o=n%3,a=[],h=0,u=n-o;h<u;h+=16383)a.push(A(t,h,h+16383>u?u:h+16383));return1===o?(e=t[n-1],a.push(r[e>>2]+r[e<<4&63]+"==")):2===o&&(e=(t[n-2]<<8)+t[n-1],a.push(r[e>>10]+r[e>>4&63]+r[e<<2&63]+"=")),a.join("")}t["-".charCodeAt(0)]=62,t["_".charCodeAt(0)]=63;
vart=arguments[3],r=require("base64-js"),e=require("ieee754"),n=require("isarray");functioni(){try{vart=newUint8Array(1);returnt.__proto__={__proto__:Uint8Array.prototype,foo:function(){return42}},42===t.foo()&&"function"==typeoft.subarray&&0===t.subarray(1,1).byteLength}catch(t){return!1}}functiono(){returnf.TYPED_ARRAY_SUPPORT?2147483647:1073741823}functionu(t,r){if(o()<r)thrownewRangeError("Invalid typed array length");returnf.TYPED_ARRAY_SUPPORT?(t=newUint8Array(r)).__proto__=f.prototype:(null===t&&(t=newf(r)),t.length=r),t}functionf(t,r,e){if(!(f.TYPED_ARRAY_SUPPORT||thisinstanceoff))returnnewf(t,r,e);if("number"==typeoft){if("string"==typeofr)thrownewError("If encoding is specified then the first argument must be a string");returnc(this,t)}returns(this,t,r,e)}functions(t,r,e,n){if("number"==typeofr)thrownewTypeError('"value" argument must not be a number');return"undefined"!=typeofArrayBuffer&&rinstanceofArrayBuffer?g(t,r,e,n):"string"==typeofr?l(t,r,e):y(t,r)}functionh(t){if("number"!=typeoft)thrownewTypeError('"size" argument must be a number');if(t<0)thrownewRangeError('"size" argument must not be negative')}functiona(t,r,e,n){returnh(r),r<=0?u(t,r):void0!==e?"string"==typeofn?u(t,r).fill(e,n):u(t,r).fill(e):u(t,r)}functionc(t,r){if(h(r),t=u(t,r<0?0:0|w(r)),!f.TYPED_ARRAY_SUPPORT)for(vare=0;e<r;++e)t[e]=0;returnt}functionl(t,r,e){if("string"==typeofe&&""!==e||(e="utf8"),!f.isEncoding(e))thrownewTypeError('"encoding" must be a valid string encoding');varn=0|v(r,e),i=(t=u(t,n)).write(r,e);returni!==n&&(t=t.slice(0,i)),t}functionp(t,r){vare=r.length<0?0:0|w(r.length);t=u(t,e);for(varn=0;n<e;n+=1)t[n]=255&r[n];returnt}functiong(t,r,e,n){if(r.byteLength,e<0||r.byteLength<e)thrownewRangeError("'offset' is out of bounds");if(r.byteLength<e+(n||0))thrownewRangeError("'length' is out of bounds");returnr=void0===e&&void0===n?newUint8Array(r):void0===n?newUint8Array(r,e):newUint8Array(r,e,n),f.TYPED_ARRAY_SUPPORT?(t=r).__proto__=f.prototype:t=p(t,r),t}functiony(t,r){if(f.isBuffer(r)){vare=0|w(r.length);return0===(t=u(t,e)).length?t:(r.copy(t,0,0,e),t)}if(r){if("undefined"!=typeofArrayBuffer&&r.bufferinstanceofArrayBuffer||"length"inr)return"number"!=typeofr.length||W(r.length)?u(t,0):p(t,r);if("Buffer"===r.type&&n(r.data))returnp(t,r.data)}thrownewTypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}functionw(t){if(t>=o())thrownewRangeError("Attempt to allocate Buffer larger than maximum size: 0x"+o().toString(16)+" bytes");return0|t}functiond(t){return+t!=t&&(t=0),f.alloc(+t)}functionv(t,r){if(f.isBuffer(t))returnt.length;if("undefined"!=typeofArrayBuffer&&"function"==typeofArrayBuffer.isView&&(ArrayBuffer.isView(t)||tinstanceofArrayBuffer))returnt.byteLength;"string"!=typeoft&&(t=""+t);vare=t.length;if(0===e)return0;for(varn=!1;;)switch(r){case"ascii":case"latin1":case"binary":returne;case"utf8":case"utf-8":casevoid0:return$(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return2*e;case"hex":returne>>>1;case"base64":returnK(t).length;default:if(n)return$(t).length;r=(""+r).toLowerCase(),n=!0}}functionE(t,r,e){varn=!1;if((void0===r||r<0)&&(r=0),r>this.length)return"";if((void0===e||e>this.length)&&(e=this.length),e<=0)return"";if((e>>>=0)<=(r>>>=0))return"";for(t||(t="utf8");;)switch(t){case"hex":returnx(this,r,e);case"utf8":case"utf-8":returnY(this,r,e);case"ascii":returnL(this,r,e);case"latin1":case"binary":returnD(this,r,e);case"base64":returnS(this,r,e);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":returnC(this,r,e);default:if(n)thrownewTypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),n=!0}}functionb(t,r,e){varn=t[r];t[r]=t[e],t[e]=n}functionR(t,r,e,n,i){if(0===t.length)return-1;if("string"==typeofe?(n=e,e=0):e>2147483647?e=2147483647:e<-2147483648&&(e=-2147483648),e=+e,isNaN(e)&&(e=i?0:t.length-1),e<0&&(e=t.length+e),e>=t.length){if(i)return-1;e=t.length-1}elseif(e<0){if(!i)return-1;e=0}if("string"==typeofr&&(r=f.from(r,n)),f.
vart=arguments[3],e=require("../constants.js").FILE_SYSTEM_NAME,n=require("../constants.js").FILE_STORE_NAME,r=require("../constants.js").IDB_RW,o=require("../constants.js").IDB_RO,c=require("../errors.js"),u=require("../buffer.js"),s=t.indexedDB||t.mozIndexedDB||t.webkitIndexedDB||t.msIndexedDB;functioni(t,e){varr=t.transaction(n,e);this.objectStore=r.objectStore(n)}functiona(t,e,n){try{varr=t.get(e);r.onsuccess=function(t){vare=t.target.result;n(null,e)},r.onerror=function(t){n(t)}}catch(t){n(t)}}functionf(t,e,n,r){try{varo=t.put(n,e);o.onsuccess=function(t){vare=t.target.result;r(null,e)},o.onerror=function(t){r(t)}}catch(t){r(t)}}functiond(t){this.name=t||e,this.db=null}i.prototype.clear=function(t){try{vare=this.objectStore.clear();e.onsuccess=function(e){t()},e.onerror=function(e){t(e)}}catch(e){t(e)}},i.prototype.getObject=function(t,e){a(this.objectStore,t,e)},i.prototype.getBuffer=function(t,e){a(this.objectStore,t,function(t,n){if(t)returne(t);e(null,newu(n))})},i.prototype.putObject=function(t,e,n){f(this.objectStore,t,e,n)},i.prototype.putBuffer=function(t,e,n){f(this.objectStore,t,e.buffer,n)},i.prototype.delete=function(t,e){try{varn=this.objectStore.delete(t);n.onsuccess=function(t){varn=t.target.result;e(null,n)},n.onerror=function(t){e(t)}}catch(t){e(t)}},d.isSupported=function(){return!!s},d.prototype.open=function(t){vare=this;if(e.db)returnt();varr=s.open(e.name);r.onupgradeneeded=function(t){vare=t.target.result;e.objectStoreNames.contains(n)&&e.deleteObjectStore(n),e.createObjectStore(n)},r.onsuccess=function(n){e.db=n.target.result,t()},r.onerror=function(e){t(newc.EINVAL("IndexedDB cannot be accessed. If private browsing is enabled, disable it."))}},d.prototype.getReadOnlyContext=function(){returnnewi(this.db,r)},d.prototype.getReadWriteContext=function(){returnnewi(this.db,r)},module.exports=d;
vart=arguments[3],n=require("../constants.js").FILE_SYSTEM_NAME,e=require("../constants.js").FILE_STORE_NAME,i=require("../constants.js").WSQL_VERSION,o=require("../constants.js").WSQL_SIZE,r=require("../constants.js").WSQL_DESC,u=require("../errors.js"),a=require("../buffer.js"),c=require("base64-arraybuffer");functions(t,n){vare=this;this.getTransaction=function(i){e.transaction?i(e.transaction):t[n?"readTransaction":"transaction"](function(t){e.transaction=t,i(t)})}}functionf(t,n,i){functiono(t,n){vare=0===n.rows.length?null:n.rows.item(0).data;i(null,e)}functionr(t,n){i(n)}t(function(t){t.executeSql("SELECT data FROM "+e+" WHERE id = ? LIMIT 1;",[n],o,r)})}functionE(t,n,i,o){functionr(t,n){o(null)}functionu(t,n){o(n)}t(function(t){t.executeSql("INSERT OR REPLACE INTO "+e+" (id, data) VALUES (?, ?);",[n,i],r,u)})}functiond(t){this.name=t||n,this.db=null}s.prototype.clear=function(t){functionn(n,e){t(e)}functioni(n,e){t(null)}this.getTransaction(function(t){t.executeSql("DELETE FROM "+e+";",[],i,n)})},s.prototype.getObject=function(t,n){f(this.getTransaction,t,function(t,e){if(t)returnn(t);try{e&&(e=JSON.parse(e))}catch(t){returnn(t)}n(null,e)})},s.prototype.getBuffer=function(t,n){f(this.getTransaction,t,function(t,e){if(t)returnn(t);if(e||""===e){vari=c.decode(e);e=newa(i)}n(null,e)})},s.prototype.putObject=function(t,n,e){vari=JSON.stringify(n);E(this.getTransaction,t,i,e)},s.prototype.putBuffer=function(t,n,e){vari=c.encode(n.buffer);E(this.getTransaction,t,i,e)},s.prototype.delete=function(t,n){functioni(t,e){n(null)}functiono(t,e){n(e)}this.getTransaction(function(n){n.executeSql("DELETE FROM "+e+" WHERE id = ?;",[t],i,o)})},d.isSupported=function(){return!!t.openDatabase},d.prototype.open=function(n){vara=this;if(a.db)returnn();varc=t.openDatabase(a.name,i,r,o);functions(t,e){5===e.code&&n(newu.EINVAL("WebSQL cannot be accessed. If private browsing is enabled, disable it.")),n(e)}functionf(t,e){a.db=c,n()}c?c.transaction(function(t){t.executeSql("CREATE TABLE IF NOT EXISTS "+e+" (id unique, data TEXT);",[],function(t){t.executeSql("CREATE INDEX IF NOT EXISTS idx_"+e+"_id on "+e+" (id);",[],f,s)},s)}):n("[WebSQL] Unable to open database.")},d.prototype.getReadOnlyContext=function(){returnnews(this.db,!0)},d.prototype.getReadWriteContext=function(){returnnews(this.db,!1)},module.exports=d;
vart,e,n=module.exports={};functionr(){thrownewError("setTimeout has not been defined")}functiono(){thrownewError("clearTimeout has not been defined")}functioni(e){if(t===setTimeout)returnsetTimeout(e,0);if((t===r||!t)&&setTimeout)returnt=setTimeout,setTimeout(e,0);try{returnt(e,0)}catch(n){try{returnt.call(null,e,0)}catch(n){returnt.call(this,e,0)}}}functionu(t){if(e===clearTimeout)returnclearTimeout(t);if((e===o||!e)&&clearTimeout)returne=clearTimeout,clearTimeout(t);try{returne(t)}catch(n){try{returne.call(null,t)}catch(n){returne.call(this,t)}}}!function(){try{t="function"==typeofsetTimeout?setTimeout:r}catch(e){t=r}try{e="function"==typeofclearTimeout?clearTimeout:o}catch(t){e=o}}();varc,s=[],l=!1,a=-1;functionf(){l&&c&&(l=!1,c.length?s=c.concat(s):a=-1,s.length&&h())}functionh(){if(!l){vart=i(f);l=!0;for(vare=s.length;e;){for(c=s,s=[];++a<e;)c&&c[a].run();a=-1,e=s.length}c=null,l=!1,u(t)}}functionm(t,e){this.fun=t,this.array=e}functionp(){}n.nextTick=function(t){vare=newArray(arguments.length-1);if(arguments.length>1)for(varn=1;n<arguments.length;n++)e[n-1]=arguments[n];s.push(newm(t,e)),1!==s.length||l||i(h)},m.prototype.run=function(){this.fun.apply(null,this.array)},n.title="browser",n.browser=!0,n.env={},n.argv=[],n.version="",n.versions={},n.on=p,n.addListener=p,n.once=p,n.off=p,n.removeListener=p,n.removeAllListeners=p,n.emit=p,n.prependListener=p,n.prependOnceListener=p,n.listeners=function(t){return[]},n.binding=function(t){thrownewError("process.binding is not supported")},n.cwd=function(){return"/"},n.chdir=function(t){thrownewError("process.chdir is not supported")},n.umask=function(){return0};
vart=require("../constants.js").FILE_SYSTEM_NAME,e=require("../../lib/async.js").setImmediate,o=function(){vart={};returnfunction(e){returnt.hasOwnProperty(e)||(t[e]={}),t[e]}}();functionn(t,e){this.readOnly=e,this.objectStore=t}functionr(e){this.name=e||t}n.prototype.clear=function(t){if(this.readOnly)e(function(){t("[MemoryContext] Error: write operation on read only context")});else{varo=this.objectStore;Object.keys(o).forEach(function(t){deleteo[t]}),e(t)}},n.prototype.getObject=n.prototype.getBuffer=function(t,o){varn=this;e(function(){o(null,n.objectStore[t])})},n.prototype.putObject=n.prototype.putBuffer=function(t,o,n){this.readOnly?e(function(){n("[MemoryContext] Error: write operation on read only context")}):(this.objectStore[t]=o,e(n))},n.prototype.delete=function(t,o){this.readOnly?e(function(){o("[MemoryContext] Error: write operation on read only context")}):(deletethis.objectStore[t],e(o))},r.isSupported=function(){return!0},r.prototype.open=function(t){this.db=o(this.name),e(t)},r.prototype.getReadOnlyContext=function(){returnnewn(this.db,!0)},r.prototype.getReadWriteContext=function(){returnnewn(this.db,!1)},module.exports=r;
varr=require("./indexeddb.js"),e=require("./websql.js"),o=require("./memory.js");module.exports={IndexedDB:r,WebSQL:e,Memory:o,Default:r,Fallback:function(){if(r.isSupported())returnr;if(e.isSupported())returne;functiono(){throw"[Filer Error] Your browser doesn't support IndexedDB or WebSQL."}returno.isSupported=function(){return!1},o}()};
vare=require("../lib/eventemitter.js"),t=require("./path.js"),n=require("../lib/intercom.js");functionr(){e.call(this);varr,i,o=this,s=!1;functionc(e){(i===e||s&&0===e.indexOf(r))&&o.trigger("change","change",e)}o.start=function(e,o,a){if(!i){if(t.isNull(e))thrownewError("Path must be a string without null bytes.");i=t.normalize(e),(s=!0===a)&&(r="/"===i?"/":i+"/"),n.getInstance().on("change",c)}},o.close=function(){n.getInstance().off("change",c),o.removeAllListeners("change")}}r.prototype=newe,r.prototype.constructor=r,module.exports=r;
varn="function"==typeofSymbol&&"symbol"==typeofSymbol.iterator?function(n){returntypeofn}:function(n){returnn&&"function"==typeofSymbol&&n.constructor===Symbol&&n!==Symbol.prototype?"symbol":typeofn},t=require("../../lib/nodash.js"),e=require("../path.js"),i=e.normalize,o=e.dirname,a=e.basename,u=e.isAbsolute,c=e.isNull,r=require("../constants.js"),f=r.MODE_FILE,s=r.MODE_DIRECTORY,l=r.MODE_SYMBOLIC_LINK,d=r.MODE_META,m=r.ROOT_DIRECTORY_NAME,p=r.SUPER_NODE_ID,E=r.SYMLOOP_MAX,w=r.O_READ,g=r.O_WRITE,O=r.O_CREATE,b=r.O_EXCLUSIVE,v=r.O_TRUNCATE,N=r.O_APPEND,A=r.O_FLAGS,h=r.XATTR_CREATE,I=r.XATTR_REPLACE,j=r.FS_NOMTIME,y=r.FS_NOCTIME,T=require("../encoding.js"),D=require("../errors.js"),L=require("../directory-entry.js"),R=require("../open-file-description.js"),x=require("../super-node.js"),V=require("../node.js"),F=require("../stats.js"),B=require("../buffer.js");function_(n){returnfunction(t,e){t?n(t):n(null,e)}}functionS(n,e,i,o,a){varu=n.flags;t(u).contains(y)&&deleteo.ctime,t(u).contains(j)&&deleteo.mtime;varc=!1;functionr(t){n.changes.push({event:"change",path:e}),a(t)}o.ctime&&(i.ctime=o.ctime,i.atime=o.ctime,c=!0),o.atime&&(i.atime=o.atime,c=!0),o.mtime&&(i.mtime=o.mtime,c=!0),c?n.putObject(i.id,i,r):r()}functionP(n,t,e,u){if(e!==s&&e!==f)returnu(newD.EINVAL("mode must be a directory or file",t));t=i(t);varc,r,l,d=a(t),m=o(t);functionp(e,i){!e&&i?u(newD.EEXIST("path name already exists",t)):!e||einstanceofD.ENOENT?n.getObject(c.data,E):u(e)}functionE(t,i){t?u(t):(r=i,V.create({guid:n.guid,mode:e},function(t,e){t?u(t):((l=e).nlinks+=1,n.putObject(l.id,l,g))}))}functionw(t){if(t)u(t);else{vare=Date.now();S(n,m,l,{mtime:e,ctime:e},u)}}functiong(t){t?u(t):(r[d]=newL(l.id,e),n.putObject(c.data,r,w))}k(n,m,function(e,i){e?u(e):i.mode!==s?u(newD.ENOTDIR("a component of the path prefix is not a directory",t)):(c=i,k(n,t,p))})}functionk(n,e,u){if(!(e=i(e)))returnu(newD.ENOENT("path is an empty string"));varc=a(e),r=o(e),f=0;functionw(t,e){t?u(t):e&&e.mode===d&&e.rnode?n.getObject(e.rnode,g):u(newD.EFILESYSTEMERROR)}functiong(n,t){n?u(n):t?u(null,t):u(newD.ENOENT)}functionO(t,i){t?u(t):i.mode===s&&i.data?n.getObject(i.data,b):u(newD.ENOTDIR("a component of the path prefix is not a directory",e))}functionb(i,o){if(i)u(i);elseif(t(o).has(c)){vara=o[c].id;n.getObject(a,v)}elseu(newD.ENOENT(null,e))}functionv(t,s){vard;t?u(t):s.mode==l?++f>E?u(newD.ELOOP(null,e)):(d=s.data,d=i(d),r=o(d),c=a(d),m==c?n.getObject(p,w):k(n,r,O)):u(null,s)}m==c?n.getObject(p,w):k(n,r,O)}functionC(t,e,i,o,a,u){varc;functionr(n,r){r&&r.xattrs[i];n?u(n):a===h&&r.xattrs.hasOwnProperty(i)?u(newD.EEXIST("attribute already exists",e)):a!==I||r.xattrs.hasOwnProperty(i)?(r.xattrs[i]=o,t.putObject(r.id,r,function(n){n?u(n):S(t,c,r,{ctime:Date.now()},u)})):u(newD.ENOATTR(null,e))}"string"==typeofe?(c=e,k(t,e,r)):"object"==(void0===e?"undefined":n(e))&&"string"==typeofe.id?(c=e.path,t.getObject(e.id,r)):u(newD.EINVAL("path or file descriptor of wrong type",e))}functionM(n,t){vare,i,o;functiona(o){o?t(o):V.create({guid:n.guid,id:e.rnode,mode:s},function(e,o){e?t(e):((i=o).nlinks+=1,n.putObject(i.id,i,u))})}functionu(e){e?t(e):(o={},n.putObject(i.data,o,t))}n.getObject(p,function(i,o){!i&&o?t():!i||iinstanceofD.ENOENT?x.create({guid:n.guid},function(i,o){i?t(i):(e=o,n.putObject(e.id,e,a))}):t(i)})}functionX(n,t,e){t=i(t);varu,c,r,f,l=a(t),d=o(t);functionm(t,i){t?e(t):(r=i,n.getObject(r.data,p))}functionp(t,i){t?e(t):(f=i,V.create({guid:n.guid,mode:s},function(t,i){t?e(t):((u=i).nlinks+=1,n.putObject(u.id,u,E))}))}functionE(t){t?e(t):(c={},n.putObject(u.data,c,g))}functionw(t){if(t)e(t);else{vari=Date.now();S(n,d,r,{mtime:i,ctime:i},e)}}functiong(t){t?e(t):(f[l]=newL(u.id,s),n.putObject(r.data,f,w))}k(n,t,function(i,o){!i&&o?e(newD.EEXIST(null,t)):!i||iinstanceofD.ENOENT?k(n,d,m):e(i)})}functionz(n,e,u){e=i(e);varc,r,f,l=a(e),d=o(e);functionp(i,o){i?u(i):m==l?u(newD.EBUSY(null,e)):t(o).has(l)?(c=(f=o)[l].id,n.getObject(c,E)):u(newD.ENOENT(null,e))}functionE(t,i){t?u(t):i.mode!=s?u(newD.E
vare=require("../../lib/nodash.js"),t=require("../path.js").isNull,r=require("../shared.js").nop,n=require("../constants.js"),i=n.FILE_SYSTEM_NAME,o=n.FS_FORMAT,a=n.FS_READY,u=n.FS_PENDING,s=n.FS_ERROR,c=n.FS_NODUPEIDCHECK,l=require("../providers/index.js"),f=require("../shell/shell.js"),d=require("../../lib/intercom.js"),p=require("../fs-watcher.js"),h=require("../errors.js"),v=require("../shared.js").guid,R=n.STDIN,g=n.STDOUT,y=n.STDERR,E=n.FIRST_DESCRIPTOR,S=require("./implementation.js");functionm(e){return"function"==typeofe?e:function(e){if(e)throwe}}functionx(n,f){f=f||r;varm=(n=n||{}).flags,x=n.guid?n.guid:v,w=n.provider||newl.Default(n.name||i),F=n.name||w.name,j=e(m).contains(o),q=this;q.readyState=u,q.name=F,q.error=null,q.stdin=R,q.stdout=g,q.stderr=y;varD={},O=E;Object.defineProperty(this,"openFiles",{get:function(){returnD}}),this.allocDescriptor=function(e){vart=O++;returnD[t]=e,t},this.releaseDescriptor=function(e){deleteD[e]};varT=[];functionC(t){returnfunction(r){e(m).contains(c)?r(null,x()):functione(r){varn=x();t.getObject(n,function(t,i){t?r(t):i?e(r):r(null,n)})}(r)}}this.queueOrRun=function(e){vart;returna==q.readyState?e.call(q):s==q.readyState?t=newh.EFILESYSTEMERROR("unknown error"):T.push(e),t},this.watch=function(e,n,i){if(t(e))thrownewError("Path must be a string without null bytes.");"function"==typeofn&&(i=n,n={}),n=n||{},i=i||r;varo=newp;returno.start(e,!1,n.recursive),o.on("change",i),o},w.open(function(e){functiont(e){functiont(e){vart=w[e]();returnt.flags=m,t.changes=[],t.guid=C(t),t.close=function(){vare=t.changes;!function(e){if(e.length){vart=d.getInstance();e.forEach(function(e){t.emit(e.event,e.path)})}}(e),e.length=0},t}q.provider={openReadWriteContext:function(){returnt("getReadWriteContext")},openReadOnlyContext:function(){returnt("getReadOnlyContext")}},q.readyState=e?s:a,T.forEach(function(e){e.call(this)}.bind(q)),T=null,f(e,q)}if(e)returnt(e);varr=w.getReadWriteContext();r.guid=C(r),j?r.clear(function(e){if(e)returnt(e);S.ensureRootDirectory(r,t)}):S.ensureRootDirectory(r,t)})}x.providers=l,["open","close","mknod","mkdir","rmdir","stat","fstat","link","unlink","read","readFile","write","writeFile","appendFile","exists","lseek","readdir","rename","readlink","symlink","lstat","truncate","ftruncate","utimes","futimes","setxattr","getxattr","fsetxattr","fgetxattr","removexattr","fremovexattr"].forEach(function(e){x.prototype[e]=function(){vart=this,r=Array.prototype.slice.call(arguments,0),n=r.length-1,i="function"!=typeofr[n],o=m(r[n]),a=t.queueOrRun(function(){vara=t.provider.openReadWriteContext();if(s===t.readyState){varu=newh.EFILESYSTEMERROR("filesystem unavailable, operation canceled");returno.call(t,u)}functionc(){a.close(),o.apply(t,arguments)}i?r.push(c):r[n]=c;varl=[t,a].concat(r);S[e].apply(null,l)});a&&o(a)}}),x.prototype.Shell=function(e){returnnewf(this,e)},module.exports=x;