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},p.cache={};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;f1?e-1:0),f=1;f1)for(var n=1;n=0;n--){var s=r[n];"."===s?r.splice(n,1):".."===s?(r.splice(n,1),e++):e&&(r.splice(n,1),e--)}if(t)for(;e--;e)r.unshift("..");return r}var e=/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/,n=function(r){return e.exec(r).slice(1)};function s(r,t){if(r.filter)return r.filter(t);for(var e=[],n=0;n=-1&&!n;o--){var i=o>=0?arguments[o]:r.cwd();if("string"!=typeof i)throw new TypeError("Arguments to path.resolve must be strings");i&&(e=i+"/"+e,n="/"===i.charAt(0))}return(n?"/":"")+(e=t(s(e.split("/"),function(r){return!!r}),!n).join("/"))||"."},exports.normalize=function(r){var e=exports.isAbsolute(r),n="/"===o(r,-1);return(r=t(s(r.split("/"),function(r){return!!r}),!e).join("/"))||e||(r="."),r&&n&&(r+="/"),(e?"/":"")+r},exports.isAbsolute=function(r){return"/"===r.charAt(0)},exports.join=function(){var r=Array.prototype.slice.call(arguments,0);return exports.normalize(s(r,function(r,t){if("string"!=typeof r)throw new TypeError("Arguments to path.join must be strings");return r}).join("/"))},exports.relative=function(r,t){function e(r){for(var t=0;t=0&&""===r[e];e--);return t>e?[]:r.slice(t,e-t+1)}r=exports.resolve(r).substr(1),t=exports.resolve(t).substr(1);for(var n=e(r.split("/")),s=e(t.split("/")),o=Math.min(n.length,s.length),i=o,u=0;u0)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>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;au?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; },{}],"JgNJ":[function(require,module,exports) { exports.read=function(o,t,a,r,h){var M,p,w=8*h-r-1,f=(1<>1,n=-7,i=a?h-1:0,e=a?-1:1,s=o[t+i];for(i+=e,M=s&(1<<-n)-1,s>>=-n,n+=w;n>0;M=256*M+o[t+i],i+=e,n-=8);for(p=M&(1<<-n)-1,M>>=-n,n+=r;n>0;p=256*p+o[t+i],i+=e,n-=8);if(0===M)M=1-N;else{if(M===f)return p?NaN:1/0*(s?-1:1);p+=Math.pow(2,r),M-=N}return(s?-1:1)*p*Math.pow(2,M-r)},exports.write=function(o,t,a,r,h,M){var p,w,f,N=8*M-h-1,n=(1<>1,e=23===h?Math.pow(2,-24)-Math.pow(2,-77):0,s=r?0:M-1,u=r?1:-1,l=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(w=isNaN(t)?1:0,p=n):(p=Math.floor(Math.log(t)/Math.LN2),t*(f=Math.pow(2,-p))<1&&(p--,f*=2),(t+=p+i>=1?e/f:e*Math.pow(2,1-i))*f>=2&&(p++,f/=2),p+i>=n?(w=0,p=n):p+i>=1?(w=(t*f-1)*Math.pow(2,h),p+=i):(w=t*Math.pow(2,i-1)*Math.pow(2,h),p=0));h>=8;o[a+s]=255&w,s+=u,w/=256,h-=8);for(p=p<0;o[a+s]=255&p,s+=u,p/=256,N-=8);o[a+s-u]|=128*l}; },{}],"REa7":[function(require,module,exports) { var r={}.toString;module.exports=Array.isArray||function(t){return"[object Array]"==r.call(t)}; },{}],"dskh":[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(r){return!1}}function o(){return u.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function s(t,r){if(o()=o())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+o().toString(16)+" bytes");return 0|t}function E(t){return+t!=t&&(t=0),u.alloc(+t)}function v(t,r){if(u.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 K(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*e;case"hex":return e>>>1;case"base64":return I(t).length;default:if(n)return K(t).length;r=(""+r).toLowerCase(),n=!0}}function R(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 k(this,r,e);case"utf8":case"utf-8":return O(this,r,e);case"ascii":return L(this,r,e);case"latin1":case"binary":return M(this,r,e);case"base64":return S(this,r,e);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return N(this,r,e);default:if(n)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),n=!0}}function _(t,r,e){var n=t[r];t[r]=t[e],t[e]=n}function A(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=u.from(r,n)),u.isBuffer(r))return 0===r.length?-1:m(t,r,e,n,i);if("number"==typeof r)return r&=255,u.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(t,r,e):Uint8Array.prototype.lastIndexOf.call(t,r,e):m(t,[r],e,n,i);throw new TypeError("val must be string, number or Buffer")}function m(t,r,e,n,i){var o,s=1,u=t.length,h=r.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(t.length<2||r.length<2)return-1;s=2,u/=2,h/=2,e/=2}function f(t,r){return 1===s?t[r]:t.readUInt16BE(r*s)}if(i){var a=-1;for(o=e;ou&&(e=u-h),o=e;o>=0;o--){for(var p=!0,l=0;li&&(n=i):n=i;var o=r.length;if(o%2!=0)throw new TypeError("Invalid hex string");n>o/2&&(n=o/2);for(var s=0;s239?4:f>223?3:f>191?2:1;if(i+p<=e)switch(p){case 1:f<128&&(a=f);break;case 2:128==(192&(o=t[i+1]))&&(h=(31&f)<<6|63&o)>127&&(a=h);break;case 3:o=t[i+1],s=t[i+2],128==(192&o)&&128==(192&s)&&(h=(15&f)<<12|(63&o)<<6|63&s)>2047&&(h<55296||h>57343)&&(a=h);break;case 4:o=t[i+1],s=t[i+2],u=t[i+3],128==(192&o)&&128==(192&s)&&128==(192&u)&&(h=(15&f)<<18|(63&o)<<12|(63&s)<<6|63&u)>65535&&h<1114112&&(a=h)}null===a?(a=65533,p=1):a>65535&&(a-=65536,n.push(a>>>10&1023|55296),a=56320|1023&a),n.push(a),i+=p}return C(n)}exports.Buffer=u,exports.SlowBuffer=E,exports.INSPECT_MAX_BYTES=50,u.TYPED_ARRAY_SUPPORT=void 0!==t.TYPED_ARRAY_SUPPORT?t.TYPED_ARRAY_SUPPORT:i(),exports.kMaxLength=o(),u.poolSize=8192,u._augment=function(t){return t.__proto__=u.prototype,t},u.from=function(t,r,e){return h(null,t,r,e)},u.TYPED_ARRAY_SUPPORT&&(u.prototype.__proto__=Uint8Array.prototype,u.__proto__=Uint8Array,"undefined"!=typeof Symbol&&Symbol.species&&u[Symbol.species]===u&&Object.defineProperty(u,Symbol.species,{value:null,configurable:!0})),u.alloc=function(t,r,e){return a(null,t,r,e)},u.allocUnsafe=function(t){return p(null,t)},u.allocUnsafeSlow=function(t){return p(null,t)},u.isBuffer=function(t){return!(null==t||!t._isBuffer)},u.compare=function(t,r){if(!u.isBuffer(t)||!u.isBuffer(r))throw new TypeError("Arguments must be Buffers");if(t===r)return 0;for(var e=t.length,n=r.length,i=0,o=Math.min(e,n);i0&&(t=this.toString("hex",0,r).match(/.{2}/g).join(" "),this.length>r&&(t+=" ... ")),""},u.prototype.compare=function(t,r,e,n,i){if(!u.isBuffer(t))throw new TypeError("Argument must be a Buffer");if(void 0===r&&(r=0),void 0===e&&(e=t?t.length:0),void 0===n&&(n=0),void 0===i&&(i=this.length),r<0||e>t.length||n<0||i>this.length)throw new RangeError("out of range index");if(n>=i&&r>=e)return 0;if(n>=i)return-1;if(r>=e)return 1;if(this===t)return 0;for(var o=(i>>>=0)-(n>>>=0),s=(e>>>=0)-(r>>>=0),h=Math.min(o,s),f=this.slice(n,i),a=t.slice(r,e),p=0;pi)&&(e=i),t.length>0&&(e<0||r<0)||r>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");for(var o=!1;;)switch(n){case"hex":return b(this,t,r,e);case"utf8":case"utf-8":return T(this,t,r,e);case"ascii":return B(this,t,r,e);case"latin1":case"binary":return U(this,t,r,e);case"base64":return Y(this,t,r,e);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return P(this,t,r,e);default:if(o)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),o=!0}},u.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var D=4096;function C(t){var r=t.length;if(r<=D)return String.fromCharCode.apply(String,t);for(var e="",n=0;nn)&&(e=n);for(var i="",o=r;oe)throw new RangeError("Trying to access beyond buffer length")}function j(t,r,e,n,i,o){if(!u.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(r>i||rt.length)throw new RangeError("Index out of range")}function q(t,r,e,n){r<0&&(r=65535+r+1);for(var i=0,o=Math.min(t.length-e,2);i>>8*(n?i:1-i)}function V(t,r,e,n){r<0&&(r=4294967295+r+1);for(var i=0,o=Math.min(t.length-e,4);i>>8*(n?i:3-i)&255}function X(t,r,e,n,i,o){if(e+n>t.length)throw new RangeError("Index out of range");if(e<0)throw new RangeError("Index out of range")}function J(t,r,n,i,o){return o||X(t,r,n,4,3.4028234663852886e38,-3.4028234663852886e38),e.write(t,r,n,i,23,4),n+4}function Z(t,r,n,i,o){return o||X(t,r,n,8,1.7976931348623157e308,-1.7976931348623157e308),e.write(t,r,n,i,52,8),n+8}u.prototype.slice=function(t,r){var e,n=this.length;if((t=~~t)<0?(t+=n)<0&&(t=0):t>n&&(t=n),(r=void 0===r?n:~~r)<0?(r+=n)<0&&(r=0):r>n&&(r=n),r0&&(i*=256);)n+=this[t+--r]*i;return n},u.prototype.readUInt8=function(t,r){return r||F(t,1,this.length),this[t]},u.prototype.readUInt16LE=function(t,r){return r||F(t,2,this.length),this[t]|this[t+1]<<8},u.prototype.readUInt16BE=function(t,r){return r||F(t,2,this.length),this[t]<<8|this[t+1]},u.prototype.readUInt32LE=function(t,r){return r||F(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},u.prototype.readUInt32BE=function(t,r){return r||F(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},u.prototype.readIntLE=function(t,r,e){t|=0,r|=0,e||F(t,r,this.length);for(var n=this[t],i=1,o=0;++o=(i*=128)&&(n-=Math.pow(2,8*r)),n},u.prototype.readIntBE=function(t,r,e){t|=0,r|=0,e||F(t,r,this.length);for(var n=r,i=1,o=this[t+--n];n>0&&(i*=256);)o+=this[t+--n]*i;return o>=(i*=128)&&(o-=Math.pow(2,8*r)),o},u.prototype.readInt8=function(t,r){return r||F(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},u.prototype.readInt16LE=function(t,r){r||F(t,2,this.length);var e=this[t]|this[t+1]<<8;return 32768&e?4294901760|e:e},u.prototype.readInt16BE=function(t,r){r||F(t,2,this.length);var e=this[t+1]|this[t]<<8;return 32768&e?4294901760|e:e},u.prototype.readInt32LE=function(t,r){return r||F(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},u.prototype.readInt32BE=function(t,r){return r||F(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},u.prototype.readFloatLE=function(t,r){return r||F(t,4,this.length),e.read(this,t,!0,23,4)},u.prototype.readFloatBE=function(t,r){return r||F(t,4,this.length),e.read(this,t,!1,23,4)},u.prototype.readDoubleLE=function(t,r){return r||F(t,8,this.length),e.read(this,t,!0,52,8)},u.prototype.readDoubleBE=function(t,r){return r||F(t,8,this.length),e.read(this,t,!1,52,8)},u.prototype.writeUIntLE=function(t,r,e,n){(t=+t,r|=0,e|=0,n)||j(this,t,r,e,Math.pow(2,8*e)-1,0);var i=1,o=0;for(this[r]=255&t;++o=0&&(o*=256);)this[r+i]=t/o&255;return r+e},u.prototype.writeUInt8=function(t,r,e){return t=+t,r|=0,e||j(this,t,r,1,255,0),u.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),this[r]=255&t,r+1},u.prototype.writeUInt16LE=function(t,r,e){return t=+t,r|=0,e||j(this,t,r,2,65535,0),u.TYPED_ARRAY_SUPPORT?(this[r]=255&t,this[r+1]=t>>>8):q(this,t,r,!0),r+2},u.prototype.writeUInt16BE=function(t,r,e){return t=+t,r|=0,e||j(this,t,r,2,65535,0),u.TYPED_ARRAY_SUPPORT?(this[r]=t>>>8,this[r+1]=255&t):q(this,t,r,!1),r+2},u.prototype.writeUInt32LE=function(t,r,e){return t=+t,r|=0,e||j(this,t,r,4,4294967295,0),u.TYPED_ARRAY_SUPPORT?(this[r+3]=t>>>24,this[r+2]=t>>>16,this[r+1]=t>>>8,this[r]=255&t):V(this,t,r,!0),r+4},u.prototype.writeUInt32BE=function(t,r,e){return t=+t,r|=0,e||j(this,t,r,4,4294967295,0),u.TYPED_ARRAY_SUPPORT?(this[r]=t>>>24,this[r+1]=t>>>16,this[r+2]=t>>>8,this[r+3]=255&t):V(this,t,r,!1),r+4},u.prototype.writeIntLE=function(t,r,e,n){if(t=+t,r|=0,!n){var i=Math.pow(2,8*e-1);j(this,t,r,e,i-1,-i)}var o=0,s=1,u=0;for(this[r]=255&t;++o>0)-u&255;return r+e},u.prototype.writeIntBE=function(t,r,e,n){if(t=+t,r|=0,!n){var i=Math.pow(2,8*e-1);j(this,t,r,e,i-1,-i)}var o=e-1,s=1,u=0;for(this[r+o]=255&t;--o>=0&&(s*=256);)t<0&&0===u&&0!==this[r+o+1]&&(u=1),this[r+o]=(t/s>>0)-u&255;return r+e},u.prototype.writeInt8=function(t,r,e){return t=+t,r|=0,e||j(this,t,r,1,127,-128),u.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),t<0&&(t=255+t+1),this[r]=255&t,r+1},u.prototype.writeInt16LE=function(t,r,e){return t=+t,r|=0,e||j(this,t,r,2,32767,-32768),u.TYPED_ARRAY_SUPPORT?(this[r]=255&t,this[r+1]=t>>>8):q(this,t,r,!0),r+2},u.prototype.writeInt16BE=function(t,r,e){return t=+t,r|=0,e||j(this,t,r,2,32767,-32768),u.TYPED_ARRAY_SUPPORT?(this[r]=t>>>8,this[r+1]=255&t):q(this,t,r,!1),r+2},u.prototype.writeInt32LE=function(t,r,e){return t=+t,r|=0,e||j(this,t,r,4,2147483647,-2147483648),u.TYPED_ARRAY_SUPPORT?(this[r]=255&t,this[r+1]=t>>>8,this[r+2]=t>>>16,this[r+3]=t>>>24):V(this,t,r,!0),r+4},u.prototype.writeInt32BE=function(t,r,e){return t=+t,r|=0,e||j(this,t,r,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),u.TYPED_ARRAY_SUPPORT?(this[r]=t>>>24,this[r+1]=t>>>16,this[r+2]=t>>>8,this[r+3]=255&t):V(this,t,r,!1),r+4},u.prototype.writeFloatLE=function(t,r,e){return J(this,t,r,!0,e)},u.prototype.writeFloatBE=function(t,r,e){return J(this,t,r,!1,e)},u.prototype.writeDoubleLE=function(t,r,e){return Z(this,t,r,!0,e)},u.prototype.writeDoubleBE=function(t,r,e){return Z(this,t,r,!1,e)},u.prototype.copy=function(t,r,e,n){if(e||(e=0),n||0===n||(n=this.length),r>=t.length&&(r=t.length),r||(r=0),n>0&&n=this.length)throw new RangeError("sourceStart out of bounds");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),t.length-r=0;--i)t[i+r]=this[i+e];else if(o<1e3||!u.TYPED_ARRAY_SUPPORT)for(i=0;i>>=0,e=void 0===e?this.length:e>>>0,t||(t=0),"number"==typeof t)for(o=r;o55295&&e<57344){if(!i){if(e>56319){(r-=3)>-1&&o.push(239,191,189);continue}if(s+1===n){(r-=3)>-1&&o.push(239,191,189);continue}i=e;continue}if(e<56320){(r-=3)>-1&&o.push(239,191,189),i=e;continue}e=65536+(i-55296<<10|e-56320)}else i&&(r-=3)>-1&&o.push(239,191,189);if(i=null,e<128){if((r-=1)<0)break;o.push(e)}else if(e<2048){if((r-=2)<0)break;o.push(e>>6|192,63&e|128)}else if(e<65536){if((r-=3)<0)break;o.push(e>>12|224,e>>6&63|128,63&e|128)}else{if(!(e<1114112))throw new Error("Invalid code point");if((r-=4)<0)break;o.push(e>>18|240,e>>12&63|128,e>>6&63|128,63&e|128)}}return o}function Q(t){for(var r=[],e=0;e>8,i=e%256,o.push(i),o.push(n);return o}function I(t){return r.toByteArray(z(t))}function x(t,r,e,n){for(var i=0;i=r.length||i>=t.length);++i)r[i+e]=t[i];return i}function d(t){return t!=t} },{"base64-js":"yh9p","ieee754":"JgNJ","isarray":"REa7","buffer":"dskh"}],"aSGf":[function(require,module,exports) { var global = arguments[3]; var Buffer = require("buffer").Buffer; var t=arguments[3],e=require("buffer").Buffer,r=require("../constants.js").FILE_SYSTEM_NAME,n=require("../constants.js").FILE_STORE_NAME,o=require("../constants.js").IDB_RW,u=require("../constants.js").IDB_RO,c=t.indexedDB||t.mozIndexedDB||t.webkitIndexedDB||t.msIndexedDB;function i(t,e){this.db=t,this.mode=e}function s(t){this.name=t||r,this.db=null}i.prototype._getObjectStore=function(){if(this.objectStore)return this.objectStore;var t=this.db.transaction(n,this.mode);return this.objectStore=t.objectStore(n),this.objectStore},i.prototype.clear=function(t){try{var e=this._getObjectStore().clear();e.onsuccess=function(){t()},e.onerror=function(e){e.preventDefault(),t(e.error)}}catch(r){t(r)}},i.prototype._get=function(t,e){try{var r=this._getObjectStore().get(t);r.onsuccess=function(t){var r=t.target.result;e(null,r)},r.onerror=function(t){t.preventDefault(),e(t.error)}}catch(n){e(n)}},i.prototype.getObject=function(t,e){this._get(t,e)},i.prototype.getBuffer=function(t,r){this._get(t,function(t,n){if(t)return r(t);r(null,e.from(n))})},i.prototype._put=function(t,e,r){try{var n=this._getObjectStore().put(e,t);n.onsuccess=function(t){var e=t.target.result;r(null,e)},n.onerror=function(t){t.preventDefault(),r(t.error)}}catch(o){r(o)}},i.prototype.putObject=function(t,e,r){this._put(t,e,r)},i.prototype.putBuffer=function(t,e,r){var n=e.buffer;this._put(t,n,r)},i.prototype.delete=function(t,e){try{var r=this._getObjectStore().delete(t);r.onsuccess=function(t){var r=t.target.result;e(null,r)},r.onerror=function(t){t.preventDefault(),e(t.error)}}catch(n){e(n)}},s.isSupported=function(){return!!c},s.prototype.open=function(t){var e=this;if(e.db)return t();try{var r=c.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(r){e.db=r.target.result,t()},r.onerror=function(e){e.preventDefault(),t(e.error)}}catch(o){t(o)}},s.prototype.getReadOnlyContext=function(){return new i(this.db,u)},s.prototype.getReadWriteContext=function(){return new i(this.db,o)},module.exports=s; },{"../constants.js":"gCho","buffer":"dskh"}],"u4Zs":[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":"pBGv"}],"Xhog":[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":"gCho","../../lib/async.js":"u4Zs"}],"UCG6":[function(require,module,exports) { var e=require("./indexeddb.js"),r=require("./memory.js");module.exports={IndexedDB:e,Default:e,Memory:r}; },{"./indexeddb.js":"aSGf","./memory.js":"Xhog"}],"Hmaa":[function(require,module,exports) { var t={};["3:EACCES:permission denied","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","50:EPERM:operation not permitted","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],i=e[2];function s(t,e){Error.call(this),this.name=r,this.code=r,this.errno=o,this.message=t||i,e&&(this.path=e),this.stack=new Error(this.message).stack}s.prototype=Object.create(Error.prototype),s.prototype.constructor=s,s.prototype.toString=function(){var t=this.path?", '"+this.path+"'":"";return this.name+": "+this.message+t},t[r]=t[o]=s}),module.exports=t; },{}],"lsut":[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":"gCho"}],"bQx9":[function(require,module,exports) { module.exports=function(t,o){for(var a=[],e=0;e=0&&c>0){for(r=[],o=t.length;p>=0&&!l;)p==s?(r.push(p),s=t.indexOf(e,p+1)):1==r.length?l=[r.pop(),c]:((i=r.pop())=0?s:c;r.length&&(l=[o,f])}return l}module.exports=e,e.range=t; },{}],"dwX/":[function(require,module,exports) { var t=require("concat-map"),r=require("balanced-match");module.exports=h;var o="\0SLASH"+Math.random()+"\0",n="\0OPEN"+Math.random()+"\0",a="\0CLOSE"+Math.random()+"\0",p="\0COMMA"+Math.random()+"\0",s="\0PERIOD"+Math.random()+"\0";function u(t){return parseInt(t,10)==t?parseInt(t,10):t.charCodeAt(0)}function l(t){return t.split("\\\\").join(o).split("\\{").join(n).split("\\}").join(a).split("\\,").join(p).split("\\.").join(s)}function f(t){return t.split(o).join("\\").split(n).join("{").split(a).join("}").split(p).join(",").split(s).join(".")}function e(t){if(!t)return[""];var o=[],n=r("{","}",t);if(!n)return t.split(",");var a=n.pre,p=n.body,s=n.post,u=a.split(",");u[u.length-1]+="{"+p+"}";var l=e(s);return s.length&&(u[u.length-1]+=l.shift(),u.push.apply(u,l)),o.push.apply(o,u),o}function h(t){return t?("{}"===t.substr(0,2)&&(t="\\{\\}"+t.substr(2)),M(l(t),!0).map(f)):[]}function v(t){return t}function i(t){return"{"+t+"}"}function g(t){return/^-?0\d/.test(t)}function b(t,r){return t<=r}function j(t,r){return t>=r}function M(o,n){var p=[],s=r("{","}",o);if(!s||/\$$/.test(s.pre))return[o];var l,f=/^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(s.body),h=/^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(s.body),v=f||h,m=s.body.indexOf(",")>=0;if(!v&&!m)return s.post.match(/,.*\}/)?M(o=s.pre+"{"+s.body+a+s.post):[o];if(v)l=s.body.split(/\.\./);else if(1===(l=e(s.body)).length&&1===(l=M(l[0],!1).map(i)).length)return(y=s.post.length?M(s.post,!1):[""]).map(function(t){return s.pre+l[0]+t});var C,O=s.pre,y=s.post.length?M(s.post,!1):[""];if(v){var A=u(l[0]),$=u(l[1]),E=Math.max(l[0].length,l[1].length),I=3==l.length?Math.abs(u(l[2])):1,S=b;$0){var H=new Array(D+1).join("0");Z=L<0?"-"+H+Z.slice(1):H+Z}}C.push(Z)}}else C=t(l,function(t){return M(t,!1)});for(var R=0;R65536)throw new TypeError("pattern is too long");var o=this.options;if(!o.noglobstar&&"**"===t)return r;if(""===t)return"";var h,u="",p=!!o.nocase,f=!1,g=[],l=[],d=!1,b=-1,m=-1,v="."===t.charAt(0)?"":o.dot?"(?!(?:^|\\/)\\.{1,2}(?:$|\\/))":"(?!\\.)",y=this;function w(){if(h){switch(h){case"*":u+=a,p=!0;break;case"?":u+=i,p=!0;break;default:u+="\\"+h}y.debug("clearStateChar %j %j",h,u),h=!1}}for(var x,j=0,k=t.length;j-1;q--){var B=l[q],M=u.slice(0,B.reStart),N=u.slice(B.reStart,B.reEnd-8),_=u.slice(B.reEnd-8,B.reEnd),G=u.slice(B.reEnd);_+=G;var S=M.split("(").length-1,P=G;for(j=0;j=0&&!(i=r[a]);a--);for(a=0;a>> no match, partial?",t,g,n,l),g!==h))}if("string"==typeof p?(u=i.nocase?f.toLowerCase()===p.toLowerCase():f===p,this.debug("string match",p,f,u)):(u=f.match(p),this.debug("pattern match",p,f,u)),!u)return!1}if(a===h&&o===c)return!0;if(a===h)return e;if(o===c)return a===h-1&&""===t[a];throw new Error("wtf?")}; },{"path":"UUq2","brace-expansion":"dwX/"}],"Kf0M":[function(require,module,exports) { var n=require("es6-promisify"),i=n.promisify,e=require("../path.js"),t=require("../errors.js"),o=require("./environment.js"),r=require("../../lib/async.js"),u=require("minimatch");function f(n,r){var u=this,f=new o((r=r||{}).env),s="/";Object.defineProperty(this,"fs",{get:function(){return n},enumerable:!0}),Object.defineProperty(this,"env",{get:function(){return f},enumerable:!0}),this.cd=function(i,o){i=e.resolve(s,i),n.stat(i,function(n,e){n?o(new t.ENOTDIR(null,i)):"DIRECTORY"===e.type?(s=i,o()):o(new t.ENOTDIR(null,i))})},this.pwd=function(){return s},this.promises={},["cd","exec","touch","cat","ls","rm","tempDir","mkdirp","find"].forEach(function(n){u.promises[n]=i(u[n].bind(u))})}f.prototype.exec=function(n,i,t){var o=this.fs;"function"==typeof i&&(t=i,i=[]),i=i||[],t=t||function(){},n=e.resolve(this.pwd(),n),o.readFile(n,"utf8",function(n,e){if(n)t(n);else try{new Function("fs","args","callback",e)(o,i,t)}catch(r){t(r)}})},f.prototype.touch=function(n,i,t){var o=this.fs;"function"==typeof i&&(t=i,i={}),i=i||{},t=t||function(){},n=e.resolve(this.pwd(),n),o.stat(n,function(e){e?!0===i.updateOnly?t():function(n){o.writeFile(n,"",t)}(n):function(n){var e=Date.now(),r=i.date||e,u=i.date||e;o.utimes(n,r,u,t)}(n)})},f.prototype.cat=function(n,i){var o=this,u=o.fs,f="";i=i||function(){},n?(n="string"==typeof n?[n]:n,r.eachSeries(n,function(n,i){var t=e.resolve(o.pwd(),n);u.readFile(t,"utf8",function(n,e){n?i(n):(f+=e+"\n",i())})},function(n){n?i(n):i(null,f.replace(/\n$/,""))})):i(new t.EINVAL("Missing files argument"))},f.prototype.ls=function(n,i,o){var u=this,f=u.fs;"function"==typeof i&&(o=i,i={}),i=i||{},o=o||function(){},n?function n(t,o){var s=e.resolve(u.pwd(),t),c=[];f.readdir(s,function(t,u){t?o(t):r.eachSeries(u,function(t,o){t=e.join(s,t),f.stat(t,function(t,r){if(t)o(t);else{var u=r;i.recursive&&"DIRECTORY"===r.type?n(e.join(s,u.name),function(n,i){n?o(n):(u.contents=i,c.push(u),o())}):(c.push(u),o())}})},function(n){o(n,c)})})}(n,o):o(new t.EINVAL("Missing dir argument"))},f.prototype.rm=function(n,i,o){var u=this,f=u.fs;"function"==typeof i&&(o=i,i={}),i=i||{},o=o||function(){},n?function n(o,s){o=e.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?i.recursive?(c=c.map(function(n){return e.join(o,n)}),r.eachSeries(c,n,function(n){n?s(n):f.rmdir(o,s)})):s(new t.ENOTEMPTY(null,o)):f.rmdir(o,s)}):f.unlink(o,s)})}(n,o):o(new t.EINVAL("Missing path argument"))},f.prototype.tempDir=function(n){var i=this.fs,e=this.env.get("TMP");n=n||function(){},i.mkdir(e,function(){n(null,e)})},f.prototype.mkdirp=function(n,i){var o=this.fs;i=i||function(){},n?"/"!==n?function n(i,r){o.stat(i,function(u,f){if(f){if(f.isDirectory())return void r();if(f.isFile())return void r(new t.ENOTDIR(null,i))}else{if(u&&"ENOENT"!==u.code)return void r(u);var s=e.dirname(i);"/"===s?o.mkdir(i,function(n){n&&"EEXIST"!==n.code?r(n):r()}):n(s,function(n){if(n)return r(n);o.mkdir(i,function(n){n&&"EEXIST"!==n.code?r(n):r()})})}})}(n,i):i():i(new t.EINVAL("Missing path argument"))},f.prototype.find=function(n,i,o){var f=this,s=f.fs;"function"==typeof i&&(o=i,i={}),o=o||function(){};var c=(i=i||{}).exec||function(n,i){i()},p=[];function a(n,t){var o=e.removeTrailing(n);!i.regex||i.regex.test(o)?i.name&&!u(e.basename(o),i.name)||i.path&&!u(e.dirname(o),i.path)?t():function(n,i){c(n,function(e){e?i(e):(p.push(n),i())})}(n,t):t()}function d(n,i){n=e.resolve(f.pwd(),n),s.readdir(n,function(t,o){t?"ENOTDIR"===t.code?a(n,i):i(t):a(e.addTrailing(n),function(t){t?i(t):(o=o.map(function(i){return e.join(n,i)}),r.eachSeries(o,d,function(n){i(n,p)}))})})}n?s.stat(n,function(i,e){i?o(i):e.isDirectory()?d(n,o):o(new t.ENOTDIR(null,n))}):o(new t.EINVAL("Missing path argument"))},module.exports=f; },{"es6-promisify":"0c0E","../path.js":"8thZ","../errors.js":"Hmaa","./environment.js":"lsut","../../lib/async.js":"u4Zs","minimatch":"Nt/K"}],"J4Qg":[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;et&&(n=o,e.apply(this,arguments))}}function i(t,n){if(void 0!==t&&t||(t={}),"object"===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=0;o--)t[o].timestamp0&&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(r){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].timestampO?e(new b.ELOOP(null,t)):(m=p.data,m=i(m),s=o(m),f=u(m),E===f?n.getObject(w,a):x(n,s,l)):e(null,p)}E===f?n.getObject(w,a):x(n,s,l)}function C(n,t,e,i,o,u,f){var s=e.xattrs;u===D&&s.hasOwnProperty(i)?f(new b.EEXIST("attribute already exists",t)):u!==I||s.hasOwnProperty(i)?(s[i]=o,n.putObject(e.id,e,function(i){i?f(i):S(n,t,e,{ctime:Date.now()},f)})):f(new b.ENOATTR(null,t))}function X(n,t){var e,i,o;function u(o){o?t(o):B.create({guid:n.guid,id:e.rnode,type:c},function(e,o){e?t(e):((i=o).nlinks+=1,n.putObject(i.id,i,f))})}function f(e){e?t(e):(o={},n.putObject(i.data,o,t))}n.getObject(w,function(i,o){!i&&o?t():!i||i instanceof b.ENOENT?V.create({guid:n.guid},function(i,o){i?t(i):(e=o,n.putObject(e.id,e,u))}):t(i)})}function q(n,t,e){t=i(t);var f,s,r,a,d=u(t),p=o(t);function m(t,i){t?e(t):(r=i,n.getObject(r.data,E))}function E(t,i){t?e(t):(a=i,B.create({guid:n.guid,type:c},function(t,i){t?e(t):((f=i).nlinks+=1,n.putObject(f.id,f,w))}))}function w(t){t?e(t):(s={},n.putObject(f.data,s,l))}function O(t){if(t)e(t);else{var i=Date.now();S(n,p,r,{mtime:i,ctime:i},e)}}function l(t){t?e(t):(a[d]=new L(f.id,c),n.putObject(r.data,a,O))}x(n,t,function(i,o){!i&&o?e(new b.EEXIST(null,t)):!i||i instanceof b.ENOENT?x(n,p,m):e(i)})}function M(n,t,e,o){var u=r.fsConstants,f=u.F_OK,s=u.R_OK,a=u.W_OK,c=u.X_OK,d=u.S_IXUSR,p=u.S_IXGRP,m=u.S_IXOTH;x(n,t=i(t),function(n,i){if(n)return o(n);if(e===f)return o(null);var u=Sn(i.mode,o);return u?e&(s|a)?o(null):e&c&&u&(d|p|m)?o(null):void o(new b.EACCES("permission denied",t)):void 0})}function z(n,t,e){t=i(t);var f,s,r,a,d=u(t),p=o(t);function m(i,o){i?e(i):E===d?e(new b.EBUSY(null,t)):o.hasOwnProperty(d)?(f=(a=o)[d].id,n.getObject(f,w)):e(new b.ENOENT(null,t))}function w(i,o){i?e(i):o.type!==c?e(new b.ENOTDIR(null,t)):(f=o,n.getObject(f.data,O))}function O(i,o){i?e(i):(s=o,Object.keys(s).length>0?e(new b.ENOTEMPTY(null,t)):(delete a[d],n.putObject(r.data,a,l)))}function l(t){if(t)e(t);else{var i=Date.now();S(n,p,r,{mtime:i,ctime:i},g)}}function g(t){t?e(t):n.delete(f.id,v)}function v(t){t?e(t):n.delete(f.data,e)}x(n,p,function(t,i){t?e(t):(r=i,n.getObject(r.data,m))})}function Y(t,e,f,s,r){"function"==typeof s&&(r=s,s=null),e=i(e);var p,m,w,l,N,A=u(e),D=o(e),I=0;function j(n,i){n?r(n):i.type!==c?r(new b.ENOENT(null,e)):(p=i,t.getObject(p.data,T))}function T(n,i){n?r(n):(m=i).hasOwnProperty(A)?f.includes(y)?r(new b.ENOENT("O_CREATE and O_EXCLUSIVE are set, and the named file exists",e)):(w=m[A]).type===c&&f.includes(g)?r(new b.EISDIR("the named file is a directory and O_WRITE is set",e)):t.getObject(w.id,h):f.includes(v)?B.create({guid:t.guid,type:a},function(n,e){n?r(n):((l=e).nlinks+=1,s&&(l.mode=s),t.putObject(l.id,l,F))}):r(new b.ENOENT("O_CREATE is not set and the named file does not exist",e))}function h(n,s){if(n)r(n);else{var a=s;a.type===d?++I>O?r(new b.ELOOP(null,e)):function(n){n=i(n),D=o(n),A=u(n),E===A&&(f.includes(g)?r(new b.EISDIR("the named file is a directory and O_WRITE is set",e)):x(t,e,R));x(t,D,j)}(a.data):R(void 0,a)}}function R(n,t){n?r(n):r(null,l=t)}function F(e){e?r(e):(N=n.alloc(0),t.putBuffer(l.data,N,P))}function V(n){if(n)r(n);else{var e=Date.now();S(t,D,p,{mtime:e,ctime:e},_)}}function P(n){n?r(n):(m[A]=new L(l.id,a),t.putObject(p.data,m,V))}function _(n){n?r(n):r(null,l)}E===A?f.includes(g)?r(new b.EISDIR("the named file is a directory and O_WRITE is set",e)):x(t,e,R):x(t,D,j)}function K(t,e,i,o,u,f){var s;function r(n){n?f(n):f(null,u)}function a(n){if(n)f(n);else{var i=Date.now();S(t,e.path,s,{mtime:i,ctime:i},r)}}function c(n){n?f(n):t.putObject(s.id,s,a)}t.getObject(e.id,function(r,a){if(r)f(r);else{s=a;var d=n.alloc(u);i.copy(d,0,o,o+u),e.position=u,s.size=u,s.version+=1,t.putBuffer(s.data,d,c)}})}function U(t,e,i,o,u,f,s){var r,a;function c(n){n?s(n):s(null,u)}function d(n){if(n)s(n);else{var i=Date.now();S(t,e.path,r,{mtime:i,ctime:i},c)}}function p(n){n?s(n):t.putObject(r.id,r,d)}function m(c,d){if(c)s(c);else{if(!(a=d))return s(new b.EIO("Expected Buffer"));var m=null!=f?f:e.position,E=Math.max(a.length,m+u),w=n.alloc(E);a&&a.copy(w),i.copy(w,m,o,o+u),void 0===f&&(e.position+=u),r.size=E,r.version+=1,t.putBuffer(r.data,w,p)}}t.getObject(e.id,function(n,e){n?s(n):(r=e,t.getBuffer(r.data,m))})}function G(n,t,e,i,o,u,f){var s,r;function a(n,s){if(n)f(n);else{if(!(r=s))return f(new b.EIO("Expected Buffer"));var a=null!=u?u:t.position;o=a+o>e.length?o-a:o,r.copy(e,i,a,a+o),void 0===u&&(t.position+=o),f(null,o)}}n.getObject(t.id,function(e,i){e?f(e):i.type===c?f(new b.EISDIR("the named file is a directory",t.path)):(s=i,n.getBuffer(s.data,a))})}function W(n,t,e){x(n,t=i(t),e)}function H(n,t,e){t.getNode(n,e)}function $(n,t,e){t=i(t);var f,s,r=u(t),a=o(t);function c(i,o){i?e(i):(s=o).hasOwnProperty(r)?n.getObject(s[r].id,e):e(new b.ENOENT("a component of the path does not name an existing file",t))}E===r?x(n,t,e):x(n,a,function(t,i){t?e(t):(f=i,n.getObject(f.data,c))})}function J(n,t,e,f){t=i(t);var s=u(t),r=o(t);e=i(e);var a,d,p,m,E,w,O=u(e),l=o(e),g=Date.now();function v(t){t?f(t):S(n,e,w,{ctime:g},f)}function y(t,e){t?f(t):((w=e).nlinks+=1,n.putObject(w.id,w,v))}function N(t){t?f(t):n.getObject(E,y)}function A(t,e){t?f(t):(m=e).hasOwnProperty(O)?f(new b.EEXIST("newpath resolves to an existing file",O)):(m[O]=d[s],E=m[O].id,n.putObject(p.data,m,N))}function D(t,e){t?f(t):(p=e,n.getObject(p.data,A))}function I(t,e){t?f(t):(d=e).hasOwnProperty(s)?d[s].type===c?f(new b.EPERM("oldpath refers to a directory")):x(n,l,D):f(new b.ENOENT("a component of either path prefix does not exist",s))}x(n,r,function(t,e){t?f(t):(a=e,n.getObject(a.data,I))})}function Q(n,t,e){t=i(t);var f,s,r,a=u(t),d=o(t);function p(t){t?e(t):(delete s[a],n.putObject(f.data,s,function(t){if(t)e(t);else{var i=Date.now();S(n,d,f,{mtime:i,ctime:i},e)}}))}function m(t){t?e(t):n.delete(r.data,p)}function E(i,o){i?e(i):o.type===c?e(new b.EPERM("unlink not permitted on directories",a)):function(i,o){i?e(i):((r=o).nlinks-=1,r.nlinks<1?n.delete(r.id,m):n.putObject(r.id,r,function(i){i?e(i):S(n,t,r,{ctime:Date.now()},p)}))}(null,o)}function w(t,i){t?e(t):(s=i).hasOwnProperty(a)?n.getObject(s[a].id,E):e(new b.ENOENT("a component of the path does not name an existing file",a))}x(n,d,function(t,i){t?e(t):(f=i,n.getObject(f.data,w))})}function Z(n,t,e){var o,u;function f(n,t){if(n)e(n);else{u=t;var i=Object.keys(u);e(null,i)}}t=i(t),x(n,t,function(i,u){i?e(i):u.type!==c?e(new b.ENOTDIR(null,t)):(o=u,n.getObject(o.data,f))})}function k(n,t,s,r){s=i(s);var a,c,p,m=u(s),w=o(s);function O(i,o){i?r(i):(c=o).hasOwnProperty(m)?r(new b.EEXIST(null,m)):B.create({guid:n.guid,type:d},function(i,o){i?r(i):((p=o).nlinks+=1,f(t)||(p.symlink_relpath=t,t=e.resolve(w,t)),p.size=t.length,p.data=t,n.putObject(p.id,p,g))})}function l(t){if(t)r(t);else{var e=Date.now();S(n,w,a,{mtime:e,ctime:e},r)}}function g(t){t?r(t):(c[m]=new L(p.id,d),n.putObject(a.data,c,l))}E===m?r(new b.EEXIST(null,m)):x(n,w,function(t,e){t?r(t):(a=e,n.getObject(a.data,O))})}function nn(n,t,e){t=i(t);var f,s,r=u(t),a=o(t);function c(t,i){t?e(t):(s=i).hasOwnProperty(r)?n.getObject(s[r].id,p):e(new b.ENOENT("a component of the path does not name an existing file",r))}function p(n,i){if(n)e(n);else if(i.type!==d)e(new b.EINVAL("path not a symbolic link",t));else{var o=i.symlink_relpath?i.symlink_relpath:i.data;e(null,o)}}x(n,a,function(t,i){t?e(t):(f=i,n.getObject(f.data,c))})}function tn(t,e,o,u){var f;function s(e,i){if(e)u(e);else{if(!i)return u(new b.EIO("Expected Buffer"));var s=n.alloc(o);i&&i.copy(s),t.putBuffer(f.data,s,a)}}function r(n){if(n)u(n);else{var i=Date.now();S(t,e,f,{mtime:i,ctime:i},u)}}function a(n){n?u(n):(f.size=o,f.version+=1,t.putObject(f.id,f,r))}e=i(e),o<0?u(new b.EINVAL("length cannot be negative")):x(t,e,function(n,i){n?u(n):i.type===c?u(new b.EISDIR(null,e)):(f=i,t.getBuffer(f.data,s))})}function en(t,e,i,o){var u;function f(e,f){if(e)o(e);else{var s;if(!f)return o(new b.EIO("Expected Buffer"));s=f?f.slice(0,i):n.alloc(i),t.putBuffer(u.data,s,r)}}function s(n){if(n)o(n);else{var i=Date.now();S(t,e.path,u,{mtime:i,ctime:i},o)}}function r(n){n?o(n):(u.size=i,u.version+=1,t.putObject(u.id,u,s))}i<0?o(new b.EINVAL("length cannot be negative")):e.getNode(t,function(n,e){n?o(n):e.type===c?o(new b.EISDIR):(u=e,t.getBuffer(u.data,f))})}function on(n,t,e,o,u){t=i(t),"number"!=typeof e||"number"!=typeof o?u(new b.EINVAL("atime and mtime must be number",t)):e<0||o<0?u(new b.EINVAL("atime and mtime must be positive integers",t)):x(n,t,function(i,f){i?u(i):S(n,t,f,{atime:e,ctime:o,mtime:o},u)})}function un(n,t,e,i,o){"number"!=typeof e||"number"!=typeof i?o(new b.EINVAL("atime and mtime must be a number")):e<0||i<0?o(new b.EINVAL("atime and mtime must be positive integers")):t.getNode(n,function(u,f){u?o(u):S(n,t.path,f,{atime:e,ctime:i,mtime:i},o)})}function fn(n,t,e,o,u,f){t=i(t),"string"!=typeof e?f(new b.EINVAL("attribute name must be a string",t)):e?null!==u&&u!==D&&u!==I?f(new b.EINVAL("invalid flag, must be null, XATTR_CREATE or XATTR_REPLACE",t)):x(n,t,function(i,s){if(i)return f(i);C(n,t,s,e,o,u,f)}):f(new b.EINVAL("attribute name cannot be an empty string",t))}function sn(n,t,e,i,o,u){"string"!=typeof e?u(new b.EINVAL("attribute name must be a string")):e?null!==o&&o!==D&&o!==I?u(new b.EINVAL("invalid flag, must be null, XATTR_CREATE or XATTR_REPLACE")):t.getNode(n,function(f,s){if(f)return u(f);C(n,t.path,s,e,i,o,u)}):u(new b.EINVAL("attribute name cannot be an empty string"))}function rn(n,t,e,o){t=i(t),"string"!=typeof e?o(new b.EINVAL("attribute name must be a string",t)):e?x(n,t,function(n,i){if(n)return o(n);var u=i.xattrs;u.hasOwnProperty(e)?o(null,u[e]):o(new b.ENOATTR(null,t))}):o(new b.EINVAL("attribute name cannot be an empty string",t))}function an(n,t,e,i){"string"!=typeof e?i(new b.EINVAL):e?t.getNode(n,function(n,t){if(n)return i(n);var o=t.xattrs;o.hasOwnProperty(e)?i(null,o[e]):i(new b.ENOATTR)}):i(new b.EINVAL("attribute name cannot be an empty string"))}function cn(n,t,e,o){t=i(t),"string"!=typeof e?o(new b.EINVAL("attribute name must be a string",t)):e?x(n,t,function(i,u){if(i)return o(i);var f=u.xattrs;f.hasOwnProperty(e)?(delete f[e],n.putObject(u.id,u,function(e){e?o(e):S(n,t,u,{ctime:Date.now()},o)})):o(new b.ENOATTR(null,t))}):o(new b.EINVAL("attribute name cannot be an empty string",t))}function dn(n,t,e,i){"string"!=typeof e?i(new b.EINVAL("attribute name must be a string")):e?t.getNode(n,function(o,u){if(o)return i(o);var f=u.xattrs;f.hasOwnProperty(e)?(delete f[e],n.putObject(u.id,u,function(e){e?i(e):S(n,t.path,u,{ctime:Date.now()},i)})):i(new b.ENOATTR)}):i(new b.EINVAL("attribute name cannot be an empty string"))}function pn(n){return A.hasOwnProperty(n)?A[n]:null}function mn(n,t,e){return n?"function"==typeof n?n={encoding:t,flag:e}:"string"==typeof n&&(n={encoding:n,flag:e}):n={encoding:t,flag:e},n}function En(n,t,e,i,o){if(arguments.length<5?(o=arguments[arguments.length-1],i=420):i=Sn(i,m,o),!(e=pn(e)))return o(new b.EINVAL("flags is not valid"),t);Y(n,t,e,i,function(n,i){if(n)o(n);else{var u;u=e.includes(N)?i.size:0;var f=new F(t,i.id,e,u),s=R.allocDescriptor(f);o(null,s)}})}function wn(n,t,e){R.getOpenFileDescription(t)?(R.releaseDescriptor(t),e(null)):e(new b.EBADF)}function On(n,t,e,i){_(n,t,e,i)}function ln(n,t,e,i){if(arguments.length<4)i=e,e=m;else if(!(e=Sn(e,m,i)))return;q(n,t,i)}function gn(n,t,e,i){"function"==typeof e&&(i=e,e=r.fsConstants.F_OK),M(n,t,e|=r.fsConstants.F_OK,i)}function vn(n,t,e,i){if(i=arguments[arguments.length-1],!t)return i(new Error("filename prefix is required"));var o=t+"-"+s.randomChars(6);q(n,o,function(n){i(n,o)})}function yn(n,t,e){z(n,t,e)}function Nn(n,t,e){W(n,t,function(i,o){if(i)e(i);else{var u=new P(t,o,n.name);e(null,u)}})}function An(n,t,e){var i=R.getOpenFileDescription(t);i?H(n,i,function(t,o){if(t)e(t);else{var u=new P(i.path,o,n.name);e(null,u)}}):e(new b.EBADF)}function Dn(n,t,e,i){J(n,t,e,i)}function In(n,t,e){Q(n,t,e)}function jn(n,t,e,i,o,u,f){i=void 0===i?0:i,o=void 0===o?e.length-i:o,f=arguments[arguments.length-1];var s=R.getOpenFileDescription(t);s?s.flags.includes(l)?G(n,s,e,i,o,u,function(n,t){f(n,t||0,e)}):f(new b.EBADF("descriptor does not permit reading")):f(new b.EBADF)}function Tn(n,t,e){Vn(t,e)===t&&(R.getOpenFileDescription(t)?e():e(new b.EBADF))}function hn(t,e,i,o){o=arguments[arguments.length-1];var u=pn((i=mn(i,null,"r")).flag||"r");if(!u)return o(new b.EINVAL("flags is not valid",e));Y(t,e,u,function(f,s){if(f)return o(f);var r=new F(e,s.id,u,0),a=R.allocDescriptor(r);function c(){R.releaseDescriptor(a)}H(t,r,function(u,f){if(u)return c(),o(u);var s=new P(r.path,f,t.name);if(s.isDirectory())return c(),o(new b.EISDIR("illegal operation on directory",e));var a=s.size,d=n.alloc(a);G(t,r,d,0,a,0,function(n){if(c(),n)return o(n);var t;t="utf8"===i.encoding?h.decode(d):d,o(null,t)})})})}function bn(n,t,e,i,o,u,f){f=arguments[arguments.length-1],i=void 0===i?0:i,o=void 0===o?e.length-i:o;var s=R.getOpenFileDescription(t);s?s.flags.includes(g)?e.length-i>>0}function Sn(n,t,e){return"function"==typeof t&&(e=t,t=void 0),Pn(n)?n&m:"number"==typeof n?(Number.isInteger(n),e(new b.EINVAL("mode not a valid an integer value",n)),!1):"string"==typeof n?Bn.test(n)?parseInt(n,8)&m:(e(new b.EINVAL("mode not a valid octal string",n)),!1):void 0!==t?t:(e(new b.EINVAL("mode not valid",n)),!1)}function _n(n,t,e,o){t=i(t),"number"!=typeof e?o(new b.EINVAL("mode must be number",t)):x(n,t,function(i,u){i?o(i):(u.mode=e,S(n,t,u,{mtime:Date.now()},o))})}function xn(n,t,e,i){"number"!=typeof e?i(new b.EINVAL("mode must be a number")):t.getNode(n,function(o,u){o?i(o):(u.mode=e,S(n,t.path,u,{mtime:Date.now()},i))})}function Cn(n,t,e,o,u){t=i(t),x(n,t,function(i,f){i?u(i):(f.uid=e,f.gid=o,S(n,t,f,{mtime:Date.now()},u))})}function Xn(n,t,e,i,o){t.getNode(n,function(u,f){u?o(u):(f.uid=e,f.gid=i,S(n,t.path,f,{mtime:Date.now()},o))})}function qn(n,t,e,i){rn(n,t,e,i)}function Mn(n,t,e,i){var o=R.getOpenFileDescription(t);o?an(n,o,e,i):i(new b.EBADF)}function zn(n,t,e,i,o,u){"function"==typeof o&&(u=o,o=null),fn(n,t,e,i,o,u)}function Yn(n,t,e,i,o,u){"function"==typeof o&&(u=o,o=null);var f=R.getOpenFileDescription(t);f?f.flags.includes(g)?sn(n,f,e,i,o,u):u(new b.EBADF("descriptor does not permit writing")):u(new b.EBADF)}function Kn(n,t,e,i){cn(n,t,e,i)}function Un(n,t,e,i){var o=R.getOpenFileDescription(t);o?o.flags.includes(g)?dn(n,o,e,i):i(new b.EBADF("descriptor does not permit writing")):i(new b.EBADF)}function Gn(n,t,e,i,o){var u=R.getOpenFileDescription(t);u||o(new b.EBADF),"SET"===i?e<0?o(new b.EINVAL("resulting file offset would be negative")):(u.position=e,o(null,u.position)):"CUR"===i?u.position+e<0?o(new b.EINVAL("resulting file offset would be negative")):(u.position+=e,o(null,u.position)):"END"===i?H(n,u,function(n,t){n?o(n):t.size+e<0?o(new b.EINVAL("resulting file offset would be negative")):(u.position=t.size+e,o(null,u.position))}):o(new b.EINVAL("whence argument is not a proper value"))}function Wn(n,t,e){Z(n,t,e)}function Hn(n){return"number"==typeof n?n:"object"===t(n)&&"function"==typeof n.getTime?n.getTime()/1e3:void 0}function $n(n,t,e,i,o){var u=Date.now();on(n,t,e=Hn(e||u),i=Hn(i||u),o)}function Jn(n,t,e,i,o){var u=Date.now();e=Hn(e||u),i=Hn(i||u);var f=R.getOpenFileDescription(t);f?f.flags.includes(g)?un(n,f,e,i,o):o(new b.EBADF("descriptor does not permit writing")):o(new b.EBADF)}function Qn(n,t,e,i){(e=Sn(e,i))&&_n(n,t,e,i)}function Zn(n,t,e,i){if(e=Sn(e,i)){var o=R.getOpenFileDescription(t);o?o.flags.includes(g)?xn(n,o,e,i):i(new b.EBADF("descriptor does not permit writing")):i(new b.EBADF)}}function kn(n,t,e,i,o){return Pn(e)?Pn(i)?void Cn(n,t,e,i,o):o(new b.EINVAL("gid must be a valid integer",i)):o(new b.EINVAL("uid must be a valid integer",e))}function nt(n,t,e,i,o){if(!Pn(e))return o(new b.EINVAL("uid must be a valid integer",e));if(!Pn(i))return o(new b.EINVAL("gid must be a valid integer",i));var u=R.getOpenFileDescription(t);u?u.flags.includes(g)?Xn(n,u,e,i,o):o(new b.EBADF("descriptor does not permit writing")):o(new b.EBADF)}function tt(n,t,o,u){t=i(t),o=i(o);var f,s,r,a,d=e.dirname(t),p=e.dirname(t),m=e.basename(t),E=e.basename(o),w=Date.now();function O(t,e){t?u(t):S(n,o,e,{ctime:w},u)}function l(t){t?u(t):n.getObject(a[E].id,O)}function g(t){t?u(t):(f.id===r.id&&(s=a),delete s[m],n.putObject(f.data,s,l))}function v(t){t?u(t):(a[E]=s[m],n.putObject(r.data,a,g))}function y(t,e){t?u(t):(a=e).hasOwnProperty(E)?z(n,o,v):v()}function N(t,e){t?u(t):(r=e,n.getObject(r.data,y))}function A(t,e){t?u(t):(s=e,x(n,p,N))}function D(t,e){t?u(t):(f=e,n.getObject(e.data,A))}function I(e){e?u(e):Q(n,t,u)}x(n,t,function(e,i){e?u(e):i.type===c?x(n,d,D):J(n,t,o,I)})}function et(n,t,e,i,o){k(n,t,e,o=arguments[arguments.length-1])}function it(n,t,e){nn(n,t,e)}function ot(n,t,e){$(n,t,function(i,o){if(i)e(i);else{var u=new P(t,o,n.name);e(null,u)}})}function ut(n,t,e,i){Vn(e=e||0,i=arguments[arguments.length-1])===e&&tn(n,t,e,i)}function ft(n,t,e,i){i=arguments[arguments.length-1],e=e||0;var o=R.getOpenFileDescription(t);if(o)if(o.flags.includes(g)){if(Vn(e,i)!==e)return;en(n,o,e,i)}else i(new b.EBADF("descriptor does not permit writing"));else i(new b.EBADF)}module.exports={appendFile:Rn,access:gn,chown:kn,chmod:Qn,close:wn,ensureRootDirectory:X,exists:Fn,fchown:nt,fchmod:Zn,fgetxattr:Mn,fremovexattr:Un,fsetxattr:Yn,fstat:An,fsync:Tn,ftruncate:ft,futimes:Jn,getxattr:qn,link:Dn,lseek:Gn,lstat:ot,mkdir:ln,mkdtemp:vn,mknod:On,open:En,readdir:Wn,read:jn,readFile:hn,readlink:it,removexattr:Kn,rename:tt,rmdir:yn,setxattr:zn,stat:Nn,symlink:et,truncate:ut,unlink:In,utimes:$n,writeFile:Ln,write:bn}; },{"../path.js":"8thZ","../shared.js":"zFPO","../constants.js":"gCho","../encoding.js":"u0zp","../errors.js":"Hmaa","../directory-entry.js":"RlAD","../open-files.js":"U1jA","../open-file-description.js":"E+68","../super-node.js":"3YM/","../node.js":"epsH","../stats.js":"OfGU","buffer":"dskh"}],"Q4+W":[function(require,module,exports) { var Buffer = require("buffer").Buffer; var e=require("buffer").Buffer,r=require("es6-promisify"),t=r.promisify,n=require("../path.js"),s=require("../shared.js").nop,a=require("../constants.js"),o=a.FILE_SYSTEM_NAME,i=a.FS_FORMAT,u=a.FS_READY,m=a.FS_PENDING,c=a.FS_ERROR,f=a.FS_NODUPEIDCHECK,l=require("../providers/index.js"),h=require("../shell/shell.js"),p=require("../../lib/intercom.js"),d=require("../fs-watcher.js"),g=require("../errors.js"),b=require("../shared.js").guid,A=a.STDIN,P=a.STDOUT,v=a.STDERR,y=require("./implementation.js");function E(e){return"function"==typeof e?e:function(e){if(e)throw e}}function R(e){e&&console.error("Filer error: ",e)}function w(e){if(!(e&&e.protocol&&e.pathname))return e;if("file:"!==e.protocol)throw new g.EINVAL("only file: URLs are supported for paths",e);for(var r=e.pathname,t=0;t