filer/dist/filer.min.js

90 lines
239 KiB
JavaScript
Raw Normal View History

<<<<<<< HEAD
2018-06-25 12:27:14 +00:00
/*! filer 0.0.44 2018-06-25 */
2018-05-29 18:03:59 +00:00
!function(a){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=a();else if("function"==typeof define&&define.amd)define([],a);else{var b;b="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this,b.Filer=a()}}(function(){var a;return function a(b,c,d){function e(g,h){if(!c[g]){if(!b[g]){var i="function"==typeof require&&require;if(!h&&i)return i(g,!0);if(f)return f(g,!0);var j=new Error("Cannot find module '"+g+"'");throw j.code="MODULE_NOT_FOUND",j}var k=c[g]={exports:{}};b[g][0].call(k.exports,function(a){var c=b[g][1][a];return e(c||a)},k,k.exports,a,b,c,d)}return c[g].exports}for(var f="function"==typeof require&&require,g=0;g<d.length;g++)e(d[g]);return e}({1:[function(b,c,d){!function(){var b={};"undefined"!=typeof process&&process.nextTick?(b.nextTick=process.nextTick,"undefined"!=typeof setImmediate?b.setImmediate=function(a){setImmediate(a)}:b.setImmediate=b.nextTick):"function"==typeof setImmediate?(b.nextTick=function(a){setImmediate(a)},b.setImmediate=b.nextTick):(b.nextTick=function(a){setTimeout(a,0)},b.setImmediate=b.nextTick),b.eachSeries=function(a,b,c){if(c=c||function(){},!a.length)return c();var d=0,e=function(){b(a[d],function(b){b?(c(b),c=function(){}):(d+=1,d>=a.length?c():e())})};e()},b.forEachSeries=b.eachSeries,void 0!==a&&a.amd?a([],function(){return b}):void 0!==c&&c.exports?c.exports=b:root.async=b}()},{}],2:[function(a,b,c){function d(a,b){for(var c=b.length-1;c>=0;c--)b[c]===a&&b.splice(c,1);return b}var e=function(){};e.createInterface=function(a){var b={};return b.on=function(b,c){void 0===this[a]&&(this[a]={}),this[a].hasOwnProperty(b)||(this[a][b]=[]),this[a][b].push(c)},b.off=function(b,c){void 0!==this[a]&&this[a].hasOwnProperty(b)&&d(c,this[a][b])},b.trigger=function(b){if(void 0!==this[a]&&this[a].hasOwnProperty(b))for(var c=Array.prototype.slice.call(arguments,1),d=0;d<this[a][b].length;d++)this[a][b][d].apply(this[a][b][d],c)},b.removeAllListeners=function(b){if(void 0!==this[a]){var c=this;c[a][b].forEach(function(a){c.off(b,a)})}},b};var f=e.createInterface("_handlers");e.prototype._on=f.on,e.prototype._off=f.off,e.prototype._trigger=f.trigger;var g=e.createInterface("handlers");e.prototype.on=function(){g.on.apply(this,arguments),Array.prototype.unshift.call(arguments,"on"),this._trigger.apply(this,arguments)},e.prototype.off=g.off,e.prototype.trigger=g.trigger,e.prototype.removeAllListeners=g.removeAllListeners,b.exports=e},{}],3:[function(a,b,c){(function(c){function d(a,b){var c=0;return function(){var d=Date.now();d-c>a&&(c=d,b.apply(this,arguments))}}function e(a,b){if(void 0!==a&&a||(a={}),"object"==typeof b)for(var c in b)b.hasOwnProperty(c)&&(a[c]=b[c]);return a}function f(){var a=this,b=Date.now();this.origin=h(),this.lastMessage=b,this.receivedIDs={},this.previousValues={};var d=function(){a._onStorageEvent.apply(a,arguments)};"undefined"!=typeof document&&(document.attachEvent?document.attachEvent("onstorage",d):c.addEventListener("storage",d,!1))}var g=a("./eventemitter.js"),h=a("../src/shared.js").guid,i=function(a){return void 0===a||void 0===a.localStorage?{getItem:function(){},setItem:function(){},removeItem:function(){}}:a.localStorage}(c);f.prototype._transaction=function(a){function b(){if(!g){var k=Date.now(),m=0|i.getItem(l);if(m&&k-m<d)return h||(f._on("storage",b),h=!0),void(j=setTimeout(b,e));g=!0,i.setItem(l,k),a(),c()}}function c(){h&&f._off("storage",b),j&&clearTimeout(j),i.removeItem(l)}var d=1e3,e=20,f=this,g=!1,h=!1,j=null;b()},f.prototype._cleanup_emit=d(100,function(){this._transaction(function(){var a,b=Date.now(),c=b-m,d=0;try{a=JSON.parse(i.getItem(j)||"[]")}catch(f){a=[]}for(var e=a.length-1;e>=0;e--)a[e].timestamp<c&&(a.splice(e,1),d++);d>0&&i.setItem(j,JSON.stringify(a))})}),f.prototype._cleanup_once=d(100,function(){var a=this;a._transaction(function(){var b,c,d=(Date.now(),0);try{c=JSON.parse(i.getItem(k)||"{}")}catch(e){c={}}for(b in c)a._once_expired(b,c)&&(delete c[b],d++);d>0&&i.setItem(k,JSON.stringify(c))})}),f.prototype._once_expired=function(a,b){if(!b)return!0;if
2018-06-25 12:27:14 +00:00
;this._cache=Object.create(null),this._lruList=Object.create(null),this._mru=0,this._lru=0,this._length=0,this._itemCount=0},d.prototype.dump=function(){return this._cache},d.prototype.dumpLru=function(){return this._lruList},d.prototype.set=function(b,c){if(a(this._cache,b))return this._dispose&&this._dispose(b,this._cache[b].value),this._maxAge&&(this._cache[b].now=Date.now()),this._cache[b].value=c,this.get(b),!0;var d=this._lengthCalculator(c),e=this._maxAge?Date.now():0,f=new j(b,c,this._mru++,d,e);return f.length>this._max?(this._dispose&&this._dispose(b,c),!1):(this._length+=f.length,this._lruList[f.lu]=this._cache[b]=f,this._itemCount++,this._length>this._max&&g(this),!0)},d.prototype.has=function(b){if(!a(this._cache,b))return!1;var c=this._cache[b];return!(this._maxAge&&Date.now()-c.now>this._maxAge)},d.prototype.get=function(a){return e(this,a,!0)},d.prototype.peek=function(a){return e(this,a,!1)},d.prototype.pop=function(){var a=this._lruList[this._lru];return i(this,a),a||null},d.prototype.del=function(a){i(this,this._cache[a])}}()},{}],11:[function(a,b,c){!function(a,b,c,d){function e(a){return a.split("").reduce(function(a,b){return a[b]=!0,a},{})}function f(a,b){return b=b||{},function(c,d,e){return h(c,a,b)}}function g(a,b){a=a||{},b=b||{};var c={};return Object.keys(b).forEach(function(a){c[a]=b[a]}),Object.keys(a).forEach(function(b){c[b]=a[b]}),c}function h(a,b,c){if("string"!=typeof b)throw new TypeError("glob pattern string required");return c||(c={}),!(!c.nocomment&&"#"===b.charAt(0))&&(""===b.trim()?""===a:new i(b,c).match(a))}function i(a,b){if(!(this instanceof i))return new i(a,b,t);if("string"!=typeof a)throw new TypeError("glob pattern string required");b||(b={}),a=a.trim(),"win32"===d&&(a=a.split("\\").join("/"));var c=a+"\n"+v(b),e=h.cache.get(c);if(e)return e;h.cache.set(c,this),this.options=b,this.set=[],this.pattern=a,this.regexp=null,this.negate=!1,this.comment=!1,this.empty=!1,this.make()}function j(){if(!this._made){var a=this.pattern,b=this.options;if(!b.nocomment&&"#"===a.charAt(0))return void(this.comment=!0);if(!a)return void(this.empty=!0);this.parseNegate();var c=this.globSet=this.braceExpand();b.debug&&(this.debug=console.error),this.debug(this.pattern,c),c=this.globParts=c.map(function(a){return a.split(B)}),this.debug(this.pattern,c),c=c.map(function(a,b,c){return a.map(this.parse,this)},this),this.debug(this.pattern,c),c=c.filter(function(a){return-1===a.indexOf(!1)}),this.debug(this.pattern,c),this.set=c}}function k(){var a=this.pattern,b=!1,c=this.options,d=0;if(!c.nonegate){for(var e=0,f=a.length;e<f&&"!"===a.charAt(e);e++)b=!b,d++;d&&(this.pattern=a.substr(d)),this.negate=b}}function l(a,b,c){return c=c||"0",a+="",a.length>=b?a:new Array(b-a.length+1).join(c)+a}function m(a,b){function c(){s.push(w),w=""}if(b=b||this.options,void 0===(a=void 0===a?this.pattern:a))throw new Error("undefined pattern");if(b.nobrace||!a.match(/\{.*\}/))return[a];var d=!1;if("{"!==a.charAt(0)){this.debug(a);for(var e=null,f=0,g=a.length;f<g;f++){var h=a.charAt(f);if(this.debug(f,h),"\\"===h)d=!d;else if("{"===h&&!d){e=a.substr(0,f);break}}if(null===e)return this.debug("no sets"),[a];return m.call(this,a.substr(f),b).map(function(a){return e+a})}var i=a.match(/^\{(-?[0-9]+)\.\.(-?[0-9]+)\}/);if(i){this.debug("numset",i[1],i[2]);for(var j,k=m.call(this,a.substr(i[0].length),b),n=+i[1],o="0"===i[1][0],p=i[1].length,q=+i[2],r=n>q?-1:1,s=[],f=n;f!=q+r;f+=r){j=o?l(f,p):f+"";for(var t=0,u=k.length;t<u;t++)s.push(j+k[t])}return s}var f=1,v=1,s=[],w="",d=!1;this.debug("Entering for");a:for(f=1,g=a.length;f<g;f++){var h=a.charAt(f);if(this.debug("",f,h),d)d=!1,w+="\\"+h;else switch(h){case"\\":d=!0;continue;case"{":v++,w+="{";continue;case"}":if(0===--v){c(),f++;break a}w+=h;continue;case",":1===v?c():w+=h;continue;default:w+=h;continue}}if(0!==v)return this.debug("didn't close",a),m.call(this,"\\"+a,b);this.debug("set",s),this.debug("suffix",a.substr(f));var k=m.call(this,a.substr(f),b),x=1===s.length;this.debug("set pre-expanded",s),s=s.map(function(a){return m.call(this,a,b)},this),this.debug("set
b.getNode(a,g)}function ca(a,b,c,d,e){I(c,e)&&C(b,c,d,e)}function da(a,b,c,d,e){var f=a.openFiles[c];f?D(b,f,d,e):e(new Xa.EBADF)}function ea(a,b,c,d,e,f,g){"function"==typeof f&&(g=f,f=null),I(c,g)&&A(b,c,d,e,f,g)}function fa(a,b,c,d,e,f,g){"function"==typeof f&&(g=f,f=null);var h=a.openFiles[c];h?wa(h.flags).contains(Na)?B(b,h,d,e,f,g):g(new Xa.EBADF("descriptor does not permit writing")):g(new Xa.EBADF)}function ga(a,b,c,d,e){I(c,e)&&E(b,c,d,e)}function ha(a,b,c,d,e){var f=a.openFiles[c];f?wa(f.flags).contains(Na)?F(b,f,d,e):e(new Xa.EBADF("descriptor does not permit writing")):e(new Xa.EBADF)}function ia(a,b,c,d,e,f){function g(a,b){a?f(a):b.size+d<0?f(new Xa.EINVAL("resulting file offset would be negative")):(h.position=b.size+d,f(null,h.position))}var h=a.openFiles[c];h||f(new Xa.EBADF),"SET"===e?d<0?f(new Xa.EINVAL("resulting file offset would be negative")):(h.position=d,f(null,h.position)):"CUR"===e?h.position+d<0?f(new Xa.EINVAL("resulting file offset would be negative")):(h.position+=d,f(null,h.position)):"END"===e?p(b,h,g):f(new Xa.EINVAL("whence argument is not a proper value"))}function ja(a,b,c,d){I(c,d)&&t(b,c,d)}function ka(a,b,c,d,e,f){if(I(c,f)){var g=Date.now();d=d||g,e=e||g,y(b,c,d,e,f)}}function la(a,b,c,d,e,f){var g=Date.now();d=d||g,e=e||g;var h=a.openFiles[c];h?wa(h.flags).contains(Na)?z(b,h,d,e,f):f(new Xa.EBADF("descriptor does not permit writing")):f(new Xa.EBADF)}function ma(a,b,c,d,e){I(c,e)&&(d=Z(d,"mode"))&&$(b,c,d,e)}function na(a,b,c,d,e){if(d=Z(d,"mode")){var f=a.openFiles[c];f?wa(f.flags).contains(Na)?_(b,f,d,e):e(new Xa.EBADF("descriptor does not permit writing")):e(new Xa.EBADF)}}function oa(a,b,c,d,e,f){if(I(c,f))return Y(d)?Y(e)?void aa(b,c,d,e,f):f(new Xa.EINVAL("gid must be a valid integer",e)):f(new Xa.EINVAL("uid must be a valid integer",d))}function pa(a,b,c,d,e,f){if(!Y(d))return f(new Xa.EINVAL("uid must be a valid integer",d));if(!Y(e))return f(new Xa.EINVAL("gid must be a valid integer",e));var g=a.openFiles[c];g?wa(g.flags).contains(Na)?ba(b,g,d,e,f):f(new Xa.EBADF("descriptor does not permit writing")):f(new Xa.EBADF)}function qa(a,b,c,e,g){function h(a,c){a?g(a):(y=c,d(b,e,y,{ctime:D},g))}function i(a){a?g(a):b.getObject(x[C].id,h)}function k(a){a?g(a):(u.id===w.id&&(v=x),delete v[B],b.putObject(u.data,v,i))}function l(a){a?g(a):(x[C]=v[B],b.putObject(w.data,x,k))}function m(a,c){a?g(a):(x=c,wa(x).has(C)?j(b,e,l):l())}function n(a,c){a?g(a):(w=c,b.getObject(w.data,m))}function o(a,c){a?g(a):(v=c,f(b,A,n))}function p(a,c){a?g(a):(u=c,b.getObject(c.data,o))}function q(a){a?g(a):s(b,c,g)}function t(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);var u,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)}}function ra(a,b,c,d,e,f){f=arguments[arguments.length-1],I(c,!0,f)&&I(d,f)&&u(b,c,d,f)}function sa(a,b,c,d){I(c,d)&&v(b,c,d)}function ta(a,b,c,d){function e(b,e){if(b)d(b);else{var f=new ab(c,e,a.name);d(null,f)}}I(c,d)&&q(b,c,e)}function ua(a,b,c,d,e){e=arguments[arguments.length-1],d=d||0,I(c,e)&&w(b,c,d,e)}function va(a,b,c,d,e){e=arguments[arguments.length-1],d=d||0;var f=a.openFiles[c];f?wa(f.flags).contains(Na)?x(b,f,d,e):e(new Xa.EBADF("descriptor does not permit writing")):e(new Xa.EBADF)}var wa=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
=======
<<<<<<< HEAD
/*! filer 0.0.44 2017-05-25 */
!function(a){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=a();else if("function"==typeof define&&define.amd)define([],a);else{var b;b="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this,b.Filer=a()}}(function(){var a;return function b(a,c,d){function e(g,h){if(!c[g]){if(!a[g]){var i="function"==typeof require&&require;if(!h&&i)return i(g,!0);if(f)return f(g,!0);var j=new Error("Cannot find module '"+g+"'");throw j.code="MODULE_NOT_FOUND",j}var k=c[g]={exports:{}};a[g][0].call(k.exports,function(b){var c=a[g][1][b];return e(c?c:b)},k,k.exports,b,a,c,d)}return c[g].exports}for(var f="function"==typeof require&&require,g=0;g<d.length;g++)e(d[g]);return e}({1:[function(b,c,d){!function(){var b={};"undefined"!=typeof process&&process.nextTick?(b.nextTick=process.nextTick,"undefined"!=typeof setImmediate?b.setImmediate=function(a){setImmediate(a)}:b.setImmediate=b.nextTick):"function"==typeof setImmediate?(b.nextTick=function(a){setImmediate(a)},b.setImmediate=b.nextTick):(b.nextTick=function(a){setTimeout(a,0)},b.setImmediate=b.nextTick),b.eachSeries=function(a,b,c){if(c=c||function(){},!a.length)return c();var d=0,e=function(){b(a[d],function(b){b?(c(b),c=function(){}):(d+=1,d>=a.length?c():e())})};e()},b.forEachSeries=b.eachSeries,"undefined"!=typeof a&&a.amd?a([],function(){return b}):"undefined"!=typeof c&&c.exports?c.exports=b:root.async=b}()},{}],2:[function(a,b,c){function d(a,b){for(var c=b.length-1;c>=0;c--)b[c]===a&&b.splice(c,1);return b}var e=function(){};e.createInterface=function(a){var b={};return b.on=function(b,c){"undefined"==typeof this[a]&&(this[a]={}),this[a].hasOwnProperty(b)||(this[a][b]=[]),this[a][b].push(c)},b.off=function(b,c){"undefined"!=typeof this[a]&&this[a].hasOwnProperty(b)&&d(c,this[a][b])},b.trigger=function(b){if("undefined"!=typeof this[a]&&this[a].hasOwnProperty(b))for(var c=Array.prototype.slice.call(arguments,1),d=0;d<this[a][b].length;d++)this[a][b][d].apply(this[a][b][d],c)},b.removeAllListeners=function(b){if("undefined"!=typeof this[a]){var c=this;c[a][b].forEach(function(a){c.off(b,a)})}},b};var f=e.createInterface("_handlers");e.prototype._on=f.on,e.prototype._off=f.off,e.prototype._trigger=f.trigger;var g=e.createInterface("handlers");e.prototype.on=function(){g.on.apply(this,arguments),Array.prototype.unshift.call(arguments,"on"),this._trigger.apply(this,arguments)},e.prototype.off=g.off,e.prototype.trigger=g.trigger,e.prototype.removeAllListeners=g.removeAllListeners,b.exports=e},{}],3:[function(a,b,c){(function(c){function d(a,b){var c=0;return function(){var d=Date.now();d-c>a&&(c=d,b.apply(this,arguments))}}function e(a,b){if("undefined"!=typeof a&&a||(a={}),"object"==typeof b)for(var c in b)b.hasOwnProperty(c)&&(a[c]=b[c]);return a}function f(){var a=this,b=Date.now();this.origin=h(),this.lastMessage=b,this.receivedIDs={},this.previousValues={};var d=function(){a._onStorageEvent.apply(a,arguments)};"undefined"!=typeof document&&(document.attachEvent?document.attachEvent("onstorage",d):c.addEventListener("storage",d,!1))}var g=a("./eventemitter.js"),h=a("../src/shared.js").guid,i=function(a){return"undefined"==typeof a||"undefined"==typeof a.localStorage?{getItem:function(){},setItem:function(){},removeItem:function(){}}:a.localStorage}(c);f.prototype._transaction=function(a){function b(){if(!g){var k=Date.now(),m=0|i.getItem(l);if(m&&d>k-m)return h||(f._on("storage",b),h=!0),void(j=setTimeout(b,e));g=!0,i.setItem(l,k),a(),c()}}function c(){h&&f._off("storage",b),j&&clearTimeout(j),i.removeItem(l)}var d=1e3,e=20,f=this,g=!1,h=!1,j=null;b()},f.prototype._cleanup_emit=d(100,function(){var a=this;a._transaction(function(){var a,b=Date.now(),c=b-m,d=0;try{a=JSON.parse(i.getItem(j)||"[]")}catch(e){a=[]}for(var f=a.length-1;f>=0;f--)a[f].timestamp<c&&(a.splice(f,1),d++);d>0&&i.setItem(j,JSON.stringify(a))})}),f.prototype._cleanup_once=d(100,function(){var a=this;a._transaction(function(){var b,c,d=(Date.now(),0);try{c=JSON.parse(i.getItem(k)||"{}")}catch(e){c={}}for(b in c)a._once_expired(b,c)&&(delete
var h=a.charAt(f);if(this.debug(f,h),"\\"===h)d=!d;else if("{"===h&&!d){e=a.substr(0,f);break}}if(null===e)return this.debug("no sets"),[a];var i=m.call(this,a.substr(f),b);return i.map(function(a){return e+a})}var j=a.match(/^\{(-?[0-9]+)\.\.(-?[0-9]+)\}/);if(j){this.debug("numset",j[1],j[2]);for(var k,n=m.call(this,a.substr(j[0].length),b),o=+j[1],p="0"===j[1][0],q=j[1].length,r=+j[2],s=o>r?-1:1,t=[],f=o;f!=r+s;f+=s){k=p?l(f,q):f+"";for(var u=0,v=n.length;v>u;u++)t.push(k+n[u])}return t}var f=1,w=1,t=[],x="",d=!1;this.debug("Entering for");a:for(f=1,g=a.length;g>f;f++){var h=a.charAt(f);if(this.debug("",f,h),d)d=!1,x+="\\"+h;else switch(h){case"\\":d=!0;continue;case"{":w++,x+="{";continue;case"}":if(w--,0===w){c(),f++;break a}x+=h;continue;case",":1===w?c():x+=h;continue;default:x+=h;continue}}if(0!==w)return this.debug("didn't close",a),m.call(this,"\\"+a,b);this.debug("set",t),this.debug("suffix",a.substr(f));var n=m.call(this,a.substr(f),b),y=1===t.length;this.debug("set pre-expanded",t),t=t.map(function(a){return m.call(this,a,b)},this),this.debug("set expanded",t),t=t.reduce(function(a,b){return a.concat(b)}),y&&(t=t.map(function(a){return"{"+a+"}"}));for(var z=[],f=0,g=t.length;g>f;f++)for(var u=0,v=n.length;v>u;u++)z.push(t[f]+n[u]);return z}function n(a,b){function c(){if(f){switch(f){case"*":h+=x,i=!0;break;case"?":h+=w,i=!0;break;default:h+="\\"+f}p.debug("clearStateChar %j %j",f,h),f=!1}}var d=this.options;if(!d.noglobstar&&"**"===a)return u;if(""===a)return"";for(var e,f,g,h="",i=!!d.nocase,j=!1,k=[],l=!1,m=-1,n=-1,o="."===a.charAt(0)?"":d.dot?"(?!(?:^|\\/)\\.{1,2}(?:$|\\/))":"(?!\\.)",p=this,r=0,s=a.length;s>r&&(g=a.charAt(r));r++)if(this.debug("%s %s %s %j",a,r,h,g),j&&A[g])h+="\\"+g,j=!1;else switch(g){case"/":return!1;case"\\":c(),j=!0;continue;case"?":case"*":case"+":case"@":case"!":if(this.debug("%s %s %s %j <-- stateChar",a,r,h,g),l){this.debug(" in class"),"!"===g&&r===n+1&&(g="^"),h+=g;continue}p.debug("call clearStateChar %j",f),c(),f=g,d.noext&&c();continue;case"(":if(l){h+="(";continue}if(!f){h+="\\(";continue}e=f,k.push({type:e,start:r-1,reStart:h.length}),h+="!"===f?"(?:(?!":"(?:",this.debug("plType %j %j",f,h),f=!1;continue;case")":if(l||!k.length){h+="\\)";continue}switch(c(),i=!0,h+=")",e=k.pop().type){case"!":h+="[^/]*?)";break;case"?":case"+":case"*":h+=e;case"@":}continue;case"|":if(l||!k.length||j){h+="\\|",j=!1;continue}c(),h+="|";continue;case"[":if(c(),l){h+="\\"+g;continue}l=!0,n=r,m=h.length,h+=g;continue;case"]":if(r===n+1||!l){h+="\\"+g,j=!1;continue}i=!0,l=!1,h+=g;continue;default:c(),j?j=!1:!A[g]||"^"===g&&l||(h+="\\"),h+=g}if(l){var t=a.substr(n+1),v=this.parse(t,C);h=h.substr(0,m)+"\\["+v[0],i=i||v[1]}for(var y;y=k.pop();){var z=h.slice(y.reStart+3);z=z.replace(/((?:\\{2})*)(\\?)\|/g,function(a,b,c){return c||(c="\\"),b+b+c+"|"}),this.debug("tail=%j\n %s",z,z);var B="*"===y.type?x:"?"===y.type?w:"\\"+y.type;i=!0,h=h.slice(0,y.reStart)+B+"\\("+z}c(),j&&(h+="\\\\");var D=!1;switch(h.charAt(0)){case".":case"[":case"(":D=!0}if(""!==h&&i&&(h="(?=.)"+h),D&&(h=o+h),b===C)return[h,i];if(!i)return q(a);var E=d.nocase?"i":"",F=new RegExp("^"+h+"$",E);return F._glob=a,F._src=h,F}function o(){if(this.regexp||this.regexp===!1)return this.regexp;var a=this.set;if(!a.length)return this.regexp=!1;var b=this.options,c=b.noglobstar?x:b.dot?y:z,d=b.nocase?"i":"",e=a.map(function(a){return a.map(function(a){return a===u?c:"string"==typeof a?r(a):a._src}).join("\\/")}).join("|");e="^(?:"+e+")$",this.negate&&(e="^(?!"+e+").*$");try{return this.regexp=new RegExp(e,d)}catch(f){return this.regexp=!1}}function p(a,b){if(this.debug("match",a,this.pattern),this.comment)return!1;if(this.empty)return""===a;if("/"===a&&b)return!0;var c=this.options;"win32"===d&&(a=a.split("\\").join("/")),a=a.split(B),this.debug(this.pattern,"split",a);var e=this.set;this.debug(this.pattern,"set",e);for(var f,g=a.length-1;g>=0&&!(f=a[g]);g--);for(var g=0,h=e.length;h>g;g++){var i=e[g],j=a;c.matchBase&&1===i.length&&(j=[f]);var k=this.matchOne(j,i,b);if(k)return c.flipNegate?!0:!this.negate}return c.flipNegate?!1:this.
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){function d(a){return"function"==typeof a?a:function(a){if(a)throw a}}function e(a){a&&console.error("Filer error: ",a)}function f(a,b){function c(){I.forEach(function(a){a.call(this)}.bind(F)),I=null}function d(a){return function(b){function c(b){var d=B();a.getObject(d,function(a,e){return a?void b(a):void(e?c(b):b(null,d))})}return g(j).contains(p)?void b(null,B()):void c(b)}}function f(a){if(a.length){var b=s.getInstance();a.forEach(function(a){b.emit(a.event,a.path)})}}a=a||{},b=b||e;var j=a.flags,B=a.guid?a.guid:v,C=a.provider||new q.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(void 0,this);var G={},H=z;Object.defineProperty(this,"openFiles",{get:function(){return G}}),this.allocDescriptor=function(a){var b=H++;return G[b]=a,b},this.releaseDescriptor=function(a){delete G[a]};var I=[];this.queueOrRun=function(a){var b;return m==F.readyState?a.call(F):o==F.readyState?b=new u.EFILESYSTEMERROR("unknown error"):I.push(a),b},this.watch=function(a,b,c){if(h(a))throw new Error("Path must be a string without null bytes.");"function"==typeof b&&(c=b,b={}),b=b||{},c=c||i;var d=new t;return d.start(a,!1,b.recursive),d.on("change",c),d},C.open(function(a){function e(a){function e(a){var b=C[a]();return b.flags=j,b.changes=[],b.guid=d(b),b.close=function(){var a=b.changes;f(a),a.length=0},b}F.provider={openReadWriteContext:function(){return e("getReadWriteContext")},openReadOnlyContext:function(){return e("getReadOnlyContext")}},a?F.readyState=o:F.readyState=m,c(),b(a,F)}if(a)return e(a);var g=C.getReadWriteContext();g.guid=d(g),E?g.clear(function(a){return a?e(a):void A.ensureRootDirectory(g,e)}):A.ensureRootDirectory(g,e)})}var g=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(){var b=this,c=Array.prototype.slice.call(arguments,0),e=c.length-1,f="function"!=typeof c[e],g=d(c[e]),h=b.queueOrRun(function(){function d(){h.close(),g.apply(b,arguments)}var h=b.provider.openReadWriteContext();if(o===b.readyState){var i=new u.EFILESYSTEMERROR("filesystem unavailable, operation canceled");return g.call(b,i)}f?c.push(d):c[e]=d;var j=[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(
=======
parcelRequire=function(e,r,n,t){var i="function"==typeof parcelRequire&&parcelRequire,o="function"==typeof require&&require;function u(n,t){if(!r[n]){if(!e[n]){var f="function"==typeof parcelRequire&&parcelRequire;if(!t&&f)return f(n,!0);if(i)return i(n,!0);if(o&&"string"==typeof n)return o(n);var c=new Error("Cannot find module '"+n+"'");throw c.code="MODULE_NOT_FOUND",c}p.resolve=function(r){return e[n][1][r]||r};var l=r[n]=new u.Module(n);e[n][0].call(l.exports,p,l,l.exports,this)}return r[n].exports;function p(e){return u(p.resolve(e))}}u.isParcelRequire=!0,u.Module=function(e){this.id=e,this.bundle=u,this.exports={}},u.modules=e,u.cache=r,u.parent=i,u.register=function(r,n){e[r]=[function(e,r){r.exports=n},{}]};for(var f=0;f<n.length;f++)u(n[f]);if(n.length){var c=u(n[n.length-1]);"object"==typeof exports&&"undefined"!=typeof module?module.exports=c:"function"==typeof define&&define.amd?define(function(){return c}):t&&(this[t]=c)}return u}({13:[function(require,module,exports) {
var n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(n){return typeof n}:function(n){return n&&"function"==typeof Symbol&&n.constructor===Symbol&&n!==Symbol.prototype?"symbol":typeof n},t=Array.prototype,r=t.forEach,e=t.indexOf,o=t.some,u=Object.prototype,l=u.hasOwnProperty,f=Object.keys,i={};function c(n,t){return l.call(n,t)}var a=f||function(n){if(n!==Object(n))throw new TypeError("Invalid object");var t=[];for(var r in n)c(n,r)&&t.push(r);return t};function y(n){return null==n?0:n.length===+n.length?n.length:a(n).length}function p(n){return n}function s(n,t,e){var o,u;if(null!=n)if(r&&n.forEach===r)n.forEach(t,e);else if(n.length===+n.length){for(o=0,u=n.length;o<u;o++)if(t.call(e,n[o],o,n)===i)return}else{var l=l(n);for(o=0,u=l.length;o<u;o++)if(t.call(e,n[l[o]],l[o],n)===i)return}}function h(n,t,r){t||(t=p);var e=!1;return null==n?e:o&&n.some===o?n.some(t,r):(s(n,function(n,o,u){if(e||(e=t.call(r,n,o,u)))return i}),!!e)}function v(n,t){return null!=n&&(e&&n.indexOf===e?-1!=n.indexOf(t):h(n,function(n){return n===t}))}function b(n){this.value=n}function m(t){return t&&"object"==(void 0===t?"undefined":n(t))&&!Array.isArray(t)&&l.call(t,"__wrapped__")?t:new b(t)}b.prototype.has=function(n){return c(this.value,n)},b.prototype.contains=function(n){return v(this.value,n)},b.prototype.size=function(){return y(this.value)},module.exports=m;
},{}],4:[function(require,module,exports) {
function r(r,t){for(var n=0,e=r.length-1;e>=0;e--){var i=r[e];"."===i?r.splice(e,1):".."===i?(r.splice(e,1),n++):n&&(r.splice(e,1),n--)}if(t)for(;n--;n)r.unshift("..");return r}var t=/^(\/?)([\s\S]+\/(?!$)|\/)?((?:\.{1,2}$|[\s\S]+?)?(\.[^.\/]*)?)$/,n=function(r){var n=t.exec(r);return[n[1]||"",n[2]||"",n[3]||"",n[4]||""]};function e(){for(var t="",n=!1,e=arguments.length-1;e>=-1&&!n;e--){var i=e>=0?arguments[e]:"/";"string"==typeof i&&i&&(t=i+"/"+t,n="/"===i.charAt(0))}return(n?"/":"")+(t=r(t.split("/").filter(function(r){return!!r}),!n).join("/"))||"."}function i(t){var n="/"===t.charAt(0);t.substr(-1);return(t=r(t.split("/").filter(function(r){return!!r}),!n).join("/"))||n||(t="."),(n?"/":"")+t}function o(){return i(Array.prototype.slice.call(arguments,0).filter(function(r,t){return r&&"string"==typeof r}).join("/"))}function u(r,t){function n(r){for(var t=0;t<r.length&&""===r[t];t++);for(var n=r.length-1;n>=0&&""===r[n];n--);return t>n?[]:r.slice(t,n-t+1)}r=exports.resolve(r).substr(1),t=exports.resolve(t).substr(1);for(var e=n(r.split("/")),i=n(t.split("/")),o=Math.min(e.length,i.length),u=o,s=0;s<o;s++)if(e[s]!==i[s]){u=s;break}var l=[];for(s=u;s<e.length;s++)l.push("..");return(l=l.concat(i.slice(u))).join("/")}function s(r){var t=n(r),e=t[0],i=t[1];return e||i?(i&&(i=i.substr(0,i.length-1)),e+i):"."}function l(r,t){var e=n(r)[2];return t&&e.substr(-1*t.length)===t&&(e=e.substr(0,e.length-t.length)),""===e?"/":e}function f(r){return n(r)[3]}function c(r){return"/"===r.charAt(0)}function a(r){return-1!==(""+r).indexOf("\0")}module.exports={normalize:i,resolve:e,join:o,relative:u,sep:"/",delimiter:":",dirname:s,basename:l,extname:f,isAbsolute:c,isNull:a};
},{}],14:[function(require,module,exports) {
function x(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(x){var r=16*Math.random()|0;return("x"==x?r:3&r|8).toString(16)}).toUpperCase()}function r(){}function n(x){for(var r=[],n=x.length,t=0;t<n;t++)r[t]=x[t];return r}module.exports={guid:x,u8toArray:n,nop:r};
},{}],15:[function(require,module,exports) {
var E="READ",R="WRITE",_="CREATE",T="EXCLUSIVE",O="TRUNCATE",I="APPEND",S="CREATE",D="REPLACE";module.exports={FILE_SYSTEM_NAME:"local",FILE_STORE_NAME:"files",IDB_RO:"readonly",IDB_RW:"readwrite",WSQL_VERSION:"1",WSQL_SIZE:5242880,WSQL_DESC:"FileSystem Storage",MODE_FILE:"FILE",MODE_DIRECTORY:"DIRECTORY",MODE_SYMBOLIC_LINK:"SYMLINK",MODE_META:"META",SYMLOOP_MAX:10,BINARY_MIME_TYPE:"application/octet-stream",JSON_MIME_TYPE:"application/json",ROOT_DIRECTORY_NAME:"/",FS_FORMAT:"FORMAT",FS_NOCTIME:"NOCTIME",FS_NOMTIME:"NOMTIME",FS_NODUPEIDCHECK:"FS_NODUPEIDCHECK",O_READ:E,O_WRITE:R,O_CREATE:_,O_EXCLUSIVE:T,O_TRUNCATE:O,O_APPEND:I,O_FLAGS:{r:[E],"r+":[E,R],w:[R,_,O],"w+":[R,E,_,O],wx:[R,_,T,O],"wx+":[R,E,_,T,O],a:[R,_,I],"a+":[R,E,_,I],ax:[R,_,T,I],"ax+":[R,E,_,T,I]},XATTR_CREATE:S,XATTR_REPLACE:D,FS_READY:"READY",FS_PENDING:"PENDING",FS_ERROR:"ERROR",SUPER_NODE_ID:"00000000-0000-0000-0000-000000000000",STDIN:0,STDOUT:1,STDERR:2,FIRST_DESCRIPTOR:3,ENVIRONMENT:{TMP:"/tmp",PATH:""}};
},{}],5:[function(require,module,exports) {
var t={};["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){var o=+(e=e.split(":"))[0],r=e[1],s=e[2];function i(t,e){Error.call(this),this.name=r,this.code=r,this.errno=o,this.message=t||s,e&&(this.path=e),this.stack=new Error(this.message).stack}i.prototype=Object.create(Error.prototype),i.prototype.constructor=i,i.prototype.toString=function(){var t=this.path?", '"+this.path+"'":"";return this.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(var r=[],t=[],e="undefined"!=typeof Uint8Array?Uint8Array:Array,n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",o=0,a=n.length;o<a;++o)r[o]=n[o],t[n.charCodeAt(o)]=o;function h(r){var t=r.length;if(t%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var e=r.indexOf("=");return-1===e&&(e=t),[e,e===t?0:4-e%4]}function u(r){var t=h(r),e=t[0],n=t[1];return 3*(e+n)/4-n}function c(r,t,e){return 3*(t+e)/4-e}function i(r){for(var n,o=h(r),a=o[0],u=o[1],i=new e(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;return 2===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}function f(t){return r[t>>18&63]+r[t>>12&63]+r[t>>6&63]+r[63&t]}function A(r,t,e){for(var n,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));return o.join("")}function d(t){for(var e,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));return 1===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;
},{}],30:[function(require,module,exports) {
exports.read=function(a,o,t,r,h){var M,p,w=8*h-r-1,f=(1<<w)-1,e=f>>1,i=-7,N=t?h-1:0,n=t?-1:1,s=a[o+N];for(N+=n,M=s&(1<<-i)-1,s>>=-i,i+=w;i>0;M=256*M+a[o+N],N+=n,i-=8);for(p=M&(1<<-i)-1,M>>=-i,i+=r;i>0;p=256*p+a[o+N],N+=n,i-=8);if(0===M)M=1-e;else{if(M===f)return p?NaN:1/0*(s?-1:1);p+=Math.pow(2,r),M-=e}return(s?-1:1)*p*Math.pow(2,M-r)},exports.write=function(a,o,t,r,h,M){var p,w,f,e=8*M-h-1,i=(1<<e)-1,N=i>>1,n=23===h?Math.pow(2,-24)-Math.pow(2,-77):0,s=r?0:M-1,u=r?1:-1,l=o<0||0===o&&1/o<0?1:0;for(o=Math.abs(o),isNaN(o)||o===1/0?(w=isNaN(o)?1:0,p=i):(p=Math.floor(Math.log(o)/Math.LN2),o*(f=Math.pow(2,-p))<1&&(p--,f*=2),(o+=p+N>=1?n/f:n*Math.pow(2,1-N))*f>=2&&(p++,f/=2),p+N>=i?(w=0,p=i):p+N>=1?(w=(o*f-1)*Math.pow(2,h),p+=N):(w=o*Math.pow(2,N-1)*Math.pow(2,h),p=0));h>=8;a[t+s]=255&w,s+=u,w/=256,h-=8);for(p=p<<h|w,e+=h;e>0;a[t+s]=255&p,s+=u,p/=256,e-=8);a[t+s-u]|=128*l};
},{}],31:[function(require,module,exports) {
var r={}.toString;module.exports=Array.isArray||function(t){return"[object Array]"==r.call(t)};
},{}],11:[function(require,module,exports) {
var global = arguments[3];
var t=arguments[3],r=require("base64-js"),e=require("ieee754"),n=require("isarray");function i(){try{var t=new Uint8Array(1);return t.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},42===t.foo()&&"function"==typeof t.subarray&&0===t.subarray(1,1).byteLength}catch(t){return!1}}function o(){return f.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function u(t,r){if(o()<r)throw new RangeError("Invalid typed array length");return f.TYPED_ARRAY_SUPPORT?(t=new Uint8Array(r)).__proto__=f.prototype:(null===t&&(t=new f(r)),t.length=r),t}function f(t,r,e){if(!(f.TYPED_ARRAY_SUPPORT||this instanceof f))return new f(t,r,e);if("number"==typeof t){if("string"==typeof r)throw new Error("If encoding is specified then the first argument must be a string");return c(this,t)}return s(this,t,r,e)}function s(t,r,e,n){if("number"==typeof r)throw new TypeError('"value" argument must not be a number');return"undefined"!=typeof ArrayBuffer&&r instanceof ArrayBuffer?g(t,r,e,n):"string"==typeof r?l(t,r,e):y(t,r)}function h(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,r,e,n){return h(r),r<=0?u(t,r):void 0!==e?"string"==typeof n?u(t,r).fill(e,n):u(t,r).fill(e):u(t,r)}function c(t,r){if(h(r),t=u(t,r<0?0:0|w(r)),!f.TYPED_ARRAY_SUPPORT)for(var e=0;e<r;++e)t[e]=0;return t}function l(t,r,e){if("string"==typeof e&&""!==e||(e="utf8"),!f.isEncoding(e))throw new TypeError('"encoding" must be a valid string encoding');var n=0|v(r,e),i=(t=u(t,n)).write(r,e);return i!==n&&(t=t.slice(0,i)),t}function p(t,r){var e=r.length<0?0:0|w(r.length);t=u(t,e);for(var n=0;n<e;n+=1)t[n]=255&r[n];return t}function g(t,r,e,n){if(r.byteLength,e<0||r.byteLength<e)throw new RangeError("'offset' is out of bounds");if(r.byteLength<e+(n||0))throw new RangeError("'length' is out of bounds");return r=void 0===e&&void 0===n?new Uint8Array(r):void 0===n?new Uint8Array(r,e):new Uint8Array(r,e,n),f.TYPED_ARRAY_SUPPORT?(t=r).__proto__=f.prototype:t=p(t,r),t}function y(t,r){if(f.isBuffer(r)){var e=0|w(r.length);return 0===(t=u(t,e)).length?t:(r.copy(t,0,0,e),t)}if(r){if("undefined"!=typeof ArrayBuffer&&r.buffer instanceof ArrayBuffer||"length"in r)return"number"!=typeof r.length||W(r.length)?u(t,0):p(t,r);if("Buffer"===r.type&&n(r.data))return p(t,r.data)}throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}function w(t){if(t>=o())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+o().toString(16)+" bytes");return 0|t}function d(t){return+t!=t&&(t=0),f.alloc(+t)}function v(t,r){if(f.isBuffer(t))return t.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(t)||t instanceof ArrayBuffer))return t.byteLength;"string"!=typeof t&&(t=""+t);var e=t.length;if(0===e)return 0;for(var n=!1;;)switch(r){case"ascii":case"latin1":case"binary":return e;case"utf8":case"utf-8":case void 0:return $(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*e;case"hex":return e>>>1;case"base64":return K(t).length;default:if(n)return $(t).length;r=(""+r).toLowerCase(),n=!0}}function E(t,r,e){var n=!1;if((void 0===r||r<0)&&(r=0),r>this.length)return"";if((void 0===e||e>this.length)&&(e=this.length),e<=0)return"";if((e>>>=0)<=(r>>>=0))return"";for(t||(t="utf8");;)switch(t){case"hex":return x(this,r,e);case"utf8":case"utf-8":return Y(this,r,e);case"ascii":return L(this,r,e);case"latin1":case"binary":return D(this,r,e);case"base64":return S(this,r,e);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return C(this,r,e);default:if(n)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),n=!0}}function b(t,r,e){var n=t[r];t[r]=t[e],t[e]=n}function R(t,r,e,n,i){if(0===t.length)return-1;if("string"==typeof e?(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}else if(e<0){if(!i)return-1;e=0}if("string"==typeof r&&(r=f.from(r,n)),f.
},{"base64-js":29,"ieee754":30,"isarray":31,"buffer":11}],3:[function(require,module,exports) {
var Buffer = require("buffer").Buffer;
var r=require("buffer").Buffer;function e(e,t,o){return e instanceof ArrayBuffer&&(e=new Uint8Array(e)),new r(e,t,o)}e.prototype=Object.create(r.prototype),e.prototype.constructor=e,Object.keys(r).forEach(function(t){r.hasOwnProperty(t)&&(e[t]=r[t])}),module.exports=e;
},{"buffer":11}],44:[function(require,module,exports) {
var global = arguments[3];
var t=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;function i(t,e){var r=t.transaction(n,e);this.objectStore=r.objectStore(n)}function a(t,e,n){try{var r=t.get(e);r.onsuccess=function(t){var e=t.target.result;n(null,e)},r.onerror=function(t){n(t)}}catch(t){n(t)}}function f(t,e,n,r){try{var o=t.put(n,e);o.onsuccess=function(t){var e=t.target.result;r(null,e)},o.onerror=function(t){r(t)}}catch(t){r(t)}}function d(t){this.name=t||e,this.db=null}i.prototype.clear=function(t){try{var e=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)return e(t);e(null,new u(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{var n=this.objectStore.delete(t);n.onsuccess=function(t){var n=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){var e=this;if(e.db)return t();var r=s.open(e.name);r.onupgradeneeded=function(t){var e=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(new c.EINVAL("IndexedDB cannot be accessed. If private browsing is enabled, disable it."))}},d.prototype.getReadOnlyContext=function(){return new i(this.db,r)},d.prototype.getReadWriteContext=function(){return new i(this.db,r)},module.exports=d;
},{"../constants.js":15,"../errors.js":5,"../buffer.js":3}],49:[function(require,module,exports) {
!function(){"use strict";for(var r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",e=new Uint8Array(256),t=0;t<r.length;t++)e[r.charCodeAt(t)]=t;exports.encode=function(e){var t,n=new Uint8Array(e),o=n.length,a="";for(t=0;t<o;t+=3)a+=r[n[t]>>2],a+=r[(3&n[t])<<4|n[t+1]>>4],a+=r[(15&n[t+1])<<2|n[t+2]>>6],a+=r[63&n[t+2]];return o%3==2?a=a.substring(0,a.length-1)+"=":o%3==1&&(a=a.substring(0,a.length-2)+"=="),a},exports.decode=function(r){var t,n,o,a,h,c=.75*r.length,g=r.length,i=0;"="===r[r.length-1]&&(c--,"="===r[r.length-2]&&c--);var u=new ArrayBuffer(c),A=new Uint8Array(u);for(t=0;t<g;t+=4)n=e[r.charCodeAt(t)],o=e[r.charCodeAt(t+1)],a=e[r.charCodeAt(t+2)],h=e[r.charCodeAt(t+3)],A[i++]=n<<2|o>>4,A[i++]=(15&o)<<4|a>>2,A[i++]=(3&a)<<6|63&h;return u}}();
},{}],45:[function(require,module,exports) {
var global = arguments[3];
var t=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");function s(t,n){var e=this;this.getTransaction=function(i){e.transaction?i(e.transaction):t[n?"readTransaction":"transaction"](function(t){e.transaction=t,i(t)})}}function f(t,n,i){function o(t,n){var e=0===n.rows.length?null:n.rows.item(0).data;i(null,e)}function r(t,n){i(n)}t(function(t){t.executeSql("SELECT data FROM "+e+" WHERE id = ? LIMIT 1;",[n],o,r)})}function E(t,n,i,o){function r(t,n){o(null)}function u(t,n){o(n)}t(function(t){t.executeSql("INSERT OR REPLACE INTO "+e+" (id, data) VALUES (?, ?);",[n,i],r,u)})}function d(t){this.name=t||n,this.db=null}s.prototype.clear=function(t){function n(n,e){t(e)}function i(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)return n(t);try{e&&(e=JSON.parse(e))}catch(t){return n(t)}n(null,e)})},s.prototype.getBuffer=function(t,n){f(this.getTransaction,t,function(t,e){if(t)return n(t);if(e||""===e){var i=c.decode(e);e=new a(i)}n(null,e)})},s.prototype.putObject=function(t,n,e){var i=JSON.stringify(n);E(this.getTransaction,t,i,e)},s.prototype.putBuffer=function(t,n,e){var i=c.encode(n.buffer);E(this.getTransaction,t,i,e)},s.prototype.delete=function(t,n){function i(t,e){n(null)}function o(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){var a=this;if(a.db)return n();var c=t.openDatabase(a.name,i,r,o);function s(t,e){5===e.code&&n(new u.EINVAL("WebSQL cannot be accessed. If private browsing is enabled, disable it.")),n(e)}function f(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(){return new s(this.db,!0)},d.prototype.getReadWriteContext=function(){return new s(this.db,!1)},module.exports=d;
},{"../constants.js":15,"../errors.js":5,"../buffer.js":3,"base64-arraybuffer":49}],48:[function(require,module,exports) {
var t,e,n=module.exports={};function r(){throw new Error("setTimeout has not been defined")}function o(){throw new Error("clearTimeout has not been defined")}function i(e){if(t===setTimeout)return setTimeout(e,0);if((t===r||!t)&&setTimeout)return t=setTimeout,setTimeout(e,0);try{return t(e,0)}catch(n){try{return t.call(null,e,0)}catch(n){return t.call(this,e,0)}}}function u(t){if(e===clearTimeout)return clearTimeout(t);if((e===o||!e)&&clearTimeout)return e=clearTimeout,clearTimeout(t);try{return e(t)}catch(n){try{return e.call(null,t)}catch(n){return e.call(this,t)}}}!function(){try{t="function"==typeof setTimeout?setTimeout:r}catch(e){t=r}try{e="function"==typeof clearTimeout?clearTimeout:o}catch(t){e=o}}();var c,s=[],l=!1,a=-1;function f(){l&&c&&(l=!1,c.length?s=c.concat(s):a=-1,s.length&&h())}function h(){if(!l){var t=i(f);l=!0;for(var e=s.length;e;){for(c=s,s=[];++a<e;)c&&c[a].run();a=-1,e=s.length}c=null,l=!1,u(t)}}function m(t,e){this.fun=t,this.array=e}function p(){}n.nextTick=function(t){var e=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)e[n-1]=arguments[n];s.push(new m(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){throw new Error("process.binding is not supported")},n.cwd=function(){return"/"},n.chdir=function(t){throw new Error("process.chdir is not supported")},n.umask=function(){return 0};
},{}],43:[function(require,module,exports) {
var process = require("process");
var define;
var e,t=require("process");!function(){var n={};void 0!==t&&t.nextTick?(n.nextTick=t.nextTick,"undefined"!=typeof setImmediate?n.setImmediate=function(e){setImmediate(e)}:n.setImmediate=n.nextTick):"function"==typeof setImmediate?(n.nextTick=function(e){setImmediate(e)},n.setImmediate=n.nextTick):(n.nextTick=function(e){setTimeout(e,0)},n.setImmediate=n.nextTick),n.eachSeries=function(e,t,n){if(n=n||function(){},!e.length)return n();var i=0;!function o(){t(e[i],function(t){t?(n(t),n=function(){}):(i+=1)>=e.length?n():o()})}()},n.forEachSeries=n.eachSeries,void 0!==e&&e.amd?e([],function(){return n}):"undefined"!=typeof module&&module.exports?module.exports=n:root.async=n}();
},{"process":48}],46:[function(require,module,exports) {
var t=require("../constants.js").FILE_SYSTEM_NAME,e=require("../../lib/async.js").setImmediate,o=function(){var t={};return function(e){return t.hasOwnProperty(e)||(t[e]={}),t[e]}}();function n(t,e){this.readOnly=e,this.objectStore=t}function r(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{var o=this.objectStore;Object.keys(o).forEach(function(t){delete o[t]}),e(t)}},n.prototype.getObject=n.prototype.getBuffer=function(t,o){var n=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")}):(delete this.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(){return new n(this.db,!0)},r.prototype.getReadWriteContext=function(){return new n(this.db,!1)},module.exports=r;
},{"../constants.js":15,"../../lib/async.js":43}],18:[function(require,module,exports) {
var r=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())return r;if(e.isSupported())return e;function o(){throw"[Filer Error] Your browser doesn't support IndexedDB or WebSQL."}return o.isSupported=function(){return!1},o}()};
},{"./indexeddb.js":44,"./websql.js":45,"./memory.js":46}],47:[function(require,module,exports) {
var t=require("../constants.js").ENVIRONMENT;module.exports=function(n){(n=n||{}).TMP=n.TMP||t.TMP,n.PATH=n.PATH||t.PATH,this.get=function(t){return n[t]},this.set=function(t,e){n[t]=e}};
},{"../constants.js":15}],37:[function(require,module,exports) {
var Buffer = require("buffer").Buffer;
var e=require("buffer").Buffer;function r(e){return e.toString("utf8")}function u(r){return new e(r,"utf8")}module.exports={encode:u,decode:r};
},{"buffer":11}],19:[function(require,module,exports) {
var n=require("../path.js"),t=require("../errors.js"),e=require("./environment.js"),i=require("../../lib/async.js"),r=require("../encoding.js");function o(i,r){var o=new e((r=r||{}).env),u="/";Object.defineProperty(this,"fs",{get:function(){return i},enumerable:!0}),Object.defineProperty(this,"env",{get:function(){return o},enumerable:!0}),this.cd=function(e,r){e=n.resolve(u,e),i.stat(e,function(n,i){n?r(new t.ENOTDIR(null,e)):"DIRECTORY"===i.type?(u=e,r()):r(new t.ENOTDIR(null,e))})},this.pwd=function(){return u}}o.prototype.exec=function(t,e,i){var r=this.fs;"function"==typeof e&&(i=e,e=[]),e=e||[],i=i||function(){},t=n.resolve(this.pwd(),t),r.readFile(t,"utf8",function(n,t){if(n)i(n);else try{new Function("fs","args","callback",t)(r,e,i)}catch(n){i(n)}})},o.prototype.touch=function(t,e,i){var r=this.fs;"function"==typeof e&&(i=e,e={}),e=e||{},i=i||function(){},t=n.resolve(this.pwd(),t),r.stat(t,function(n,o){n?!0===e.updateOnly?i():function(n){r.writeFile(n,"",i)}(t):function(n){var t=Date.now(),o=e.date||t,u=e.date||t;r.utimes(n,o,u,i)}(t)})},o.prototype.cat=function(e,r){var o=this,u=o.fs,f="";r=r||function(){},e?(e="string"==typeof e?[e]:e,i.eachSeries(e,function(t,e){var i=n.resolve(o.pwd(),t);u.readFile(i,"utf8",function(n,t){n?e(n):(f+=t+"\n",e())})},function(n){n?r(n):r(null,f.replace(/\n$/,""))})):r(new t.EINVAL("Missing files argument"))},o.prototype.ls=function(e,r,o){var u=this,f=u.fs;"function"==typeof r&&(o=r,r={}),r=r||{},o=o||function(){},e?function t(e,o){var s=n.resolve(u.pwd(),e),c=[];f.readdir(s,function(e,u){e?o(e):i.eachSeries(u,function(e,i){e=n.join(s,e),f.stat(e,function(o,u){if(o)i(o);else{var f={path:n.basename(e),links:u.nlinks,size:u.size,modified:u.mtime,type:u.type};r.recursive&&"DIRECTORY"===u.type?t(n.join(s,f.path),function(n,t){n?i(n):(f.contents=t,c.push(f),i())}):(c.push(f),i())}})},function(n){o(n,c)})})}(e,o):o(new t.EINVAL("Missing dir argument"))},o.prototype.rm=function(e,r,o){var u=this,f=u.fs;"function"==typeof r&&(o=r,r={}),r=r||{},o=o||function(){},e?function e(o,s){o=n.resolve(u.pwd(),o),f.stat(o,function(u,c){u?s(u):"FILE"!==c.type?f.readdir(o,function(u,c){u?s(u):0!==c.length?r.recursive?(c=c.map(function(t){return n.join(o,t)}),i.eachSeries(c,e,function(n){n?s(n):f.rmdir(o,s)})):s(new t.ENOTEMPTY(null,o)):f.rmdir(o,s)}):f.unlink(o,s)})}(e,o):o(new t.EINVAL("Missing path argument"))},o.prototype.tempDir=function(n){var t=this.fs,e=this.env.get("TMP");n=n||function(){},t.mkdir(e,function(t){n(null,e)})},o.prototype.mkdirp=function(e,i){var r=this.fs;i=i||function(){},e?"/"!==e?function e(i,o){r.stat(i,function(u,f){if(f){if(f.isDirectory())return void o();if(f.isFile())return void o(new t.ENOTDIR(null,i))}else{if(u&&"ENOENT"!==u.code)return void o(u);var s=n.dirname(i);"/"===s?r.mkdir(i,function(n){n&&"EEXIST"!=n.code?o(n):o()}):e(s,function(n){if(n)return o(n);r.mkdir(i,function(n){n&&"EEXIST"!=n.code?o(n):o()})})}})}(e,i):i():i(new t.EINVAL("Missing path argument"))},module.exports=o;
},{"../path.js":4,"../errors.js":5,"./environment.js":47,"../../lib/async.js":43,"../encoding.js":37}],35:[function(require,module,exports) {
function t(t,r){for(var o=r.length-1;o>=0;o--)r[o]===t&&r.splice(o,1);return r}var r=function(){};r.createInterface=function(r){var o={on:function(t,o){void 0===this[r]&&(this[r]={}),this[r].hasOwnProperty(t)||(this[r][t]=[]),this[r][t].push(o)},off:function(o,e){void 0!==this[r]&&this[r].hasOwnProperty(o)&&t(e,this[r][o])},trigger:function(t){if(void 0!==this[r]&&this[r].hasOwnProperty(t))for(var o=Array.prototype.slice.call(arguments,1),e=0;e<this[r][t].length;e++)this[r][t][e].apply(this[r][t][e],o)},removeAllListeners:function(t){if(void 0!==this[r]){var o=this;o[r][t].forEach(function(r){o.off(t,r)})}}};return o};var o=r.createInterface("_handlers");r.prototype._on=o.on,r.prototype._off=o.off,r.prototype._trigger=o.trigger;var e=r.createInterface("handlers");r.prototype.on=function(){e.on.apply(this,arguments),Array.prototype.unshift.call(arguments,"on"),this._trigger.apply(this,arguments)},r.prototype.off=e.off,r.prototype.trigger=e.trigger,r.prototype.removeAllListeners=e.removeAllListeners,module.exports=r;
},{}],16:[function(require,module,exports) {
var global = arguments[3];
var t=arguments[3],e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},n=require("./eventemitter.js"),o=require("../src/shared.js").guid;function r(t,e){var n=0;return function(){var o=Date.now();o-n>t&&(n=o,e.apply(this,arguments))}}function i(t,n){if(void 0!==t&&t||(t={}),"object"===(void 0===n?"undefined":e(n)))for(var o in n)n.hasOwnProperty(o)&&(t[o]=n[o]);return t}var a=function(t){return void 0===t||void 0===t.localStorage?{getItem:function(){},setItem:function(){},removeItem:function(){}}:t.localStorage}(t);function s(){var e=this,n=Date.now();this.origin=o(),this.lastMessage=n,this.receivedIDs={},this.previousValues={};var r=function(){e._onStorageEvent.apply(e,arguments)};"undefined"!=typeof document&&(document.attachEvent?document.attachEvent("onstorage",r):t.addEventListener("storage",r,!1))}s.prototype._transaction=function(t){var e=1e3,n=20,o=this,r=!1,i=!1,s=null;function c(){if(!r){var u=Date.now(),f=0|a.getItem(p);if(f&&u-f<e)return i||(o._on("storage",c),i=!0),void(s=setTimeout(c,n));r=!0,a.setItem(p,u),t(),function(){i&&o._off("storage",c);s&&clearTimeout(s);a.removeItem(p)}()}}c()},s.prototype._cleanup_emit=r(100,function(){this._transaction(function(){var t,e=Date.now()-f,n=0;try{t=JSON.parse(a.getItem(c)||"[]")}catch(e){t=[]}for(var o=t.length-1;o>=0;o--)t[o].timestamp<e&&(t.splice(o,1),n++);n>0&&a.setItem(c,JSON.stringify(t))})}),s.prototype._cleanup_once=r(100,function(){var t=this;t._transaction(function(){Date.now();var e,n,o=0;try{n=JSON.parse(a.getItem(u)||"{}")}catch(t){n={}}for(e in n)t._once_expired(e,n)&&(delete n[e],o++);o>0&&a.setItem(u,JSON.stringify(n))})}),s.prototype._once_expired=function(t,n){if(!n)return!0;if(!n.hasOwnProperty(t))return!0;if("object"!==e(n[t]))return!0;var o=n[t].ttl||m,r=Date.now();return n[t].timestamp<r-o},s.prototype._localStorageChanged=function(t,e){if(t&&t.key)return t.key===e;var n=a.getItem(e);return n!==this.previousValues[e]&&(this.previousValues[e]=n,!0)},s.prototype._onStorageEvent=function(e){e=e||t.event;var n=this;this._localStorageChanged(e,c)&&this._transaction(function(){var t,e=Date.now(),o=a.getItem(c);try{t=JSON.parse(o||"[]")}catch(e){t=[]}for(var r=0;r<t.length;r++)if(t[r].origin!==n.origin&&!(t[r].timestamp<n.lastMessage)){if(t[r].id){if(n.receivedIDs.hasOwnProperty(t[r].id))continue;n.receivedIDs[t[r].id]=!0}n.trigger(t[r].name,t[r].payload)}n.lastMessage=e}),this._trigger("storage",e)},s.prototype._emit=function(t,e,n){if((n="string"==typeof n||"number"==typeof n?String(n):null)&&n.length){if(this.receivedIDs.hasOwnProperty(n))return;this.receivedIDs[n]=!0}var o={id:n,name:t,origin:this.origin,timestamp:Date.now(),payload:e},r=this;this._transaction(function(){var n=a.getItem(c)||"[]",i="[]"===n?"":",";n=[n.substring(0,n.length-1),i,JSON.stringify(o),"]"].join(""),a.setItem(c,n),r.trigger(t,e),setTimeout(function(){r._cleanup_emit()},50)})},s.prototype.emit=function(t,e){this._emit.apply(this,arguments),this._trigger("emit",t,e)},s.prototype.once=function(t,e,n){if(s.supported){var o=this;this._transaction(function(){var r;try{r=JSON.parse(a.getItem(u)||"{}")}catch(t){r={}}o._once_expired(t,r)&&(r[t]={},r[t].timestamp=Date.now(),"number"==typeof n&&(r[t].ttl=1e3*n),a.setItem(u,JSON.stringify(r)),e(),setTimeout(function(){o._cleanup_once()},50))})}},i(s.prototype,n.prototype),s.supported=void 0!==a;var c="intercom",u="intercom_once",p="intercom_lock",f=5e4,m=36e5;s.destroy=function(){a.removeItem(p),a.removeItem(c),a.removeItem(u)},s.getInstance=function(){var t;return function(){return t||(t=new s),t}}(),module.exports=s;
},{"./eventemitter.js":35,"../src/shared.js":14}],17:[function(require,module,exports) {
var e=require("../lib/eventemitter.js"),t=require("./path.js"),n=require("../lib/intercom.js");function r(){e.call(this);var r,i,o=this,s=!1;function c(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))throw new Error("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=new e,r.prototype.constructor=r,module.exports=r;
},{"../lib/eventemitter.js":35,"./path.js":4,"../lib/intercom.js":16}],38:[function(require,module,exports) {
var t=require("./constants.js").MODE_FILE;module.exports=function(s,e){this.id=s,this.type=e||t};
},{"./constants.js":15}],39:[function(require,module,exports) {
module.exports=function(i,t,s,h){this.path=i,this.id=t,this.flags=s,this.position=h};
},{}],40:[function(require,module,exports) {
var t=require("./constants.js");function e(e){var i=Date.now();this.id=t.SUPER_NODE_ID,this.mode=t.MODE_META,this.atime=e.atime||i,this.ctime=e.ctime||i,this.mtime=e.mtime||i,this.rnode=e.rnode}e.create=function(t,i){t.guid(function(n,o){n?i(n):(t.rnode=t.rnode||o,i(null,new e(t)))})},module.exports=e;
},{"./constants.js":15}],41:[function(require,module,exports) {
var i=require("./constants.js").MODE_FILE;function t(t){var s=Date.now();this.id=t.id,this.mode=t.mode||i,this.size=t.size||0,this.atime=t.atime||s,this.ctime=t.ctime||s,this.mtime=t.mtime||s,this.flags=t.flags||[],this.xattrs=t.xattrs||{},this.nlinks=t.nlinks||0,this.version=t.version||0,this.blksize=void 0,this.nblocks=1,this.data=t.data}function s(i,t,s){i[t]?s(null):i.guid(function(n,e){i[t]=e,s(n)})}t.create=function(i,n){s(i,"id",function(e){e?n(e):s(i,"data",function(s){s?n(s):n(null,new t(i))})})},module.exports=t;
},{"./constants.js":15}],42:[function(require,module,exports) {
var t=require("./constants.js");function i(t,i){this.node=t.id,this.dev=i,this.size=t.size,this.nlinks=t.nlinks,this.atime=t.atime,this.mtime=t.mtime,this.ctime=t.ctime,this.type=t.mode}i.prototype.isFile=function(){return this.type===t.MODE_FILE},i.prototype.isDirectory=function(){return this.type===t.MODE_DIRECTORY},i.prototype.isSymbolicLink=function(){return this.type===t.MODE_SYMBOLIC_LINK},i.prototype.isSocket=i.prototype.isFIFO=i.prototype.isCharacterDevice=i.prototype.isBlockDevice=function(){return!1},module.exports=i;
},{"./constants.js":15}],20:[function(require,module,exports) {
var n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(n){return typeof n}:function(n){return n&&"function"==typeof Symbol&&n.constructor===Symbol&&n!==Symbol.prototype?"symbol":typeof n},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){return function(t,e){t?n(t):n(null,e)}}function S(n,e,i,o,a){var u=n.flags;t(u).contains(y)&&delete o.ctime,t(u).contains(j)&&delete o.mtime;var c=!1;function r(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()}function P(n,t,e,u){if(e!==s&&e!==f)return u(new D.EINVAL("mode must be a directory or file",t));t=i(t);var c,r,l,d=a(t),m=o(t);function p(e,i){!e&&i?u(new D.EEXIST("path name already exists",t)):!e||e instanceof D.ENOENT?n.getObject(c.data,E):u(e)}function E(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))}))}function w(t){if(t)u(t);else{var e=Date.now();S(n,m,l,{mtime:e,ctime:e},u)}}function g(t){t?u(t):(r[d]=new L(l.id,e),n.putObject(c.data,r,w))}k(n,m,function(e,i){e?u(e):i.mode!==s?u(new D.ENOTDIR("a component of the path prefix is not a directory",t)):(c=i,k(n,t,p))})}function k(n,e,u){if(!(e=i(e)))return u(new D.ENOENT("path is an empty string"));var c=a(e),r=o(e),f=0;function w(t,e){t?u(t):e&&e.mode===d&&e.rnode?n.getObject(e.rnode,g):u(new D.EFILESYSTEMERROR)}function g(n,t){n?u(n):t?u(null,t):u(new D.ENOENT)}function O(t,i){t?u(t):i.mode===s&&i.data?n.getObject(i.data,b):u(new D.ENOTDIR("a component of the path prefix is not a directory",e))}function b(i,o){if(i)u(i);else if(t(o).has(c)){var a=o[c].id;n.getObject(a,v)}else u(new D.ENOENT(null,e))}function v(t,s){var d;t?u(t):s.mode==l?++f>E?u(new D.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)}function C(t,e,i,o,a,u){var c;function r(n,r){r&&r.xattrs[i];n?u(n):a===h&&r.xattrs.hasOwnProperty(i)?u(new D.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(new D.ENOATTR(null,e))}"string"==typeof e?(c=e,k(t,e,r)):"object"==(void 0===e?"undefined":n(e))&&"string"==typeof e.id?(c=e.path,t.getObject(e.id,r)):u(new D.EINVAL("path or file descriptor of wrong type",e))}function M(n,t){var e,i,o;function a(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))})}function u(e){e?t(e):(o={},n.putObject(i.data,o,t))}n.getObject(p,function(i,o){!i&&o?t():!i||i instanceof D.ENOENT?x.create({guid:n.guid},function(i,o){i?t(i):(e=o,n.putObject(e.id,e,a))}):t(i)})}function X(n,t,e){t=i(t);var u,c,r,f,l=a(t),d=o(t);function m(t,i){t?e(t):(r=i,n.getObject(r.data,p))}function p(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))}))}function E(t){t?e(t):(c={},n.putObject(u.data,c,g))}function w(t){if(t)e(t);else{var i=Date.now();S(n,d,r,{mtime:i,ctime:i},e)}}function g(t){t?e(t):(f[l]=new L(u.id,s),n.putObject(r.data,f,w))}k(n,t,function(i,o){!i&&o?e(new D.EEXIST(null,t)):!i||i instanceof D.ENOENT?k(n,d,m):e(i)})}function z(n,e,u){e=i(e);var c,r,f,l=a(e),d=o(e);function p(i,o){i?u(i):m==l?u(new D.EBUSY(null,e)):t(o).has(l)?(c=(f=o)[l].id,n.getObject(c,E)):u(new D.ENOENT(null,e))}function E(t,i){t?u(t):i.mode!=s?u(new D.E
},{"../../lib/nodash.js":13,"../path.js":4,"../constants.js":15,"../encoding.js":37,"../errors.js":5,"../directory-entry.js":38,"../open-file-description.js":39,"../super-node.js":40,"../node.js":41,"../stats.js":42,"../buffer.js":3}],6:[function(require,module,exports) {
var e=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");function m(e){return"function"==typeof e?e:function(e){if(e)throw e}}function x(n,f){f=f||r;var m=(n=n||{}).flags,x=n.guid?n.guid:v,w=n.provider||new l.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;var D={},O=E;Object.defineProperty(this,"openFiles",{get:function(){return D}}),this.allocDescriptor=function(e){var t=O++;return D[t]=e,t},this.releaseDescriptor=function(e){delete D[e]};var T=[];function C(t){return function(r){e(m).contains(c)?r(null,x()):function e(r){var n=x();t.getObject(n,function(t,i){t?r(t):i?e(r):r(null,n)})}(r)}}this.queueOrRun=function(e){var t;return a==q.readyState?e.call(q):s==q.readyState?t=new h.EFILESYSTEMERROR("unknown error"):T.push(e),t},this.watch=function(e,n,i){if(t(e))throw new Error("Path must be a string without null bytes.");"function"==typeof n&&(i=n,n={}),n=n||{},i=i||r;var o=new p;return o.start(e,!1,n.recursive),o.on("change",i),o},w.open(function(e){function t(e){function t(e){var t=w[e]();return t.flags=m,t.changes=[],t.guid=C(t),t.close=function(){var e=t.changes;!function(e){if(e.length){var t=d.getInstance();e.forEach(function(e){t.emit(e.event,e.path)})}}(e),e.length=0},t}q.provider={openReadWriteContext:function(){return t("getReadWriteContext")},openReadOnlyContext:function(){return t("getReadOnlyContext")}},q.readyState=e?s:a,T.forEach(function(e){e.call(this)}.bind(q)),T=null,f(e,q)}if(e)return t(e);var r=w.getReadWriteContext();r.guid=C(r),j?r.clear(function(e){if(e)return t(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(){var t=this,r=Array.prototype.slice.call(arguments,0),n=r.length-1,i="function"!=typeof r[n],o=m(r[n]),a=t.queueOrRun(function(){var a=t.provider.openReadWriteContext();if(s===t.readyState){var u=new h.EFILESYSTEMERROR("filesystem unavailable, operation canceled");return o.call(t,u)}function c(){a.close(),o.apply(t,arguments)}i?r.push(c):r[n]=c;var l=[t,a].concat(r);S[e].apply(null,l)});a&&o(a)}}),x.prototype.Shell=function(e){return new f(this,e)},module.exports=x;
},{"../../lib/nodash.js":13,"../path.js":4,"../shared.js":14,"../constants.js":15,"../providers/index.js":18,"../shell/shell.js":19,"../../lib/intercom.js":16,"../fs-watcher.js":17,"../errors.js":5,"./implementation.js":20}],1:[function(require,module,exports) {
module.exports={FileSystem:require("./filesystem/interface.js"),Buffer:require("./buffer.js"),Path:require("./path.js"),Errors:require("./errors.js")};
},{"./filesystem/interface.js":6,"./buffer.js":3,"./path.js":4,"./errors.js":5}]},{},[1], "Filer")
//# sourceMappingURL=/filer.min.map
>>>>>>> Switch to parceljs for bundling, eslint for linting, drop grunt
>>>>>>> Switch to parceljs for bundling, eslint for linting, drop grunt