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 Buffer = require("buffer").Buffer; var global = arguments[3]; var t=require("buffer").Buffer,e=arguments[3],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;function c(t,e){this.db=t,this.mode=e}function i(t){this.name=t||r,this.db=null}c.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},c.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)}},c.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)}},c.prototype.getObject=function(t,e){this._get(t,e)},c.prototype.getBuffer=function(e,r){this._get(e,function(e,n){if(e)return r(e);r(null,t.from(n))})},c.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)}},c.prototype.putObject=function(t,e,r){this._put(t,e,r)},c.prototype.putBuffer=function(t,e,r){var n=e.buffer;this._put(t,n,r)},c.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)}},i.isSupported=function(){return!!(e.indexedDB||e.mozIndexedDB||e.webkitIndexedDB||e.msIndexedDB)},i.prototype.open=function(t){var r=this;if(r.db)return t();try{var o=(e.indexedDB||e.mozIndexedDB||e.webkitIndexedDB||e.msIndexedDB).open(r.name);o.onupgradeneeded=function(t){var e=t.target.result;e.objectStoreNames.contains(n)&&e.deleteObjectStore(n),e.createObjectStore(n)},o.onsuccess=function(e){r.db=e.target.result,t()},o.onerror=function(e){e.preventDefault(),t(e.error)}}catch(u){t(u)}},i.prototype.getReadOnlyContext=function(){return new c(this.db,u)},i.prototype.getReadWriteContext=function(){return new c(this.db,o)},module.exports=i; },{"../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) { "use strict";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,s){n[t]=s}}; },{"../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 h.ELOOP(null,t)):(m=d.data,m=i(m),s=u(m),f=o(m),E===f?n.getObject(w,a):_(n,s,l)):e(null,d)}E===f?n.getObject(w,a):_(n,s,l)}function x(n,t,e,i,u,o,f){var s=e.xattrs;o===D&&s.hasOwnProperty(i)?f(new h.EEXIST("attribute already exists",t)):o!==I||s.hasOwnProperty(i)?(s[i]=u,n.putObject(e.id,e,function(i){i?f(i):P(n,t,e,{ctime:Date.now()},f)})):f(new h.ENOATTR(null,t))}function C(n,t){var e,i,u;function o(u){u?t(u):V.create({guid:n.guid,id:e.rnode,type:c},function(e,u){e?t(e):((i=u).nlinks+=1,n.putObject(i.id,i,f))})}function f(e){e?t(e):(u={},n.putObject(i.data,u,t))}n.getObject(w,function(i,u){!i&&u?t():!i||i instanceof h.ENOENT?F.create({guid:n.guid},function(i,u){i?t(i):(e=u,n.putObject(e.id,e,o))}):t(i)})}function X(n,t,e){t=i(t);var f,s,r,a,p=o(t),d=u(t);function m(t,i){t?e(t):(r=i,n.getObject(r.data,E))}function E(t,i){t?e(t):(a=i,V.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();P(n,d,r,{mtime:i,ctime:i},e)}}function l(t){t?e(t):(a[p]=new b(f.id,c),n.putObject(r.data,a,O))}_(n,t,function(i,u){!i&&u?e(new h.EEXIST(null,t)):!i||i instanceof h.ENOENT?_(n,d,m):e(i)})}function q(n,t,e,u){var o=r.fsConstants,f=o.F_OK,s=o.R_OK,a=o.W_OK,c=o.X_OK,p=o.S_IXUSR,d=o.S_IXGRP,m=o.S_IXOTH;_(n,t=i(t),function(n,i){if(n)return u(n);if(e===f)return u(null);var o=Pn(i.mode,u);return o?e&(s|a)?u(null):e&c&&o&(p|d|m)?u(null):void u(new h.EACCES("permission denied",t)):void 0})}function M(n,t,e){t=i(t);var f,s,r,a,p=o(t),d=u(t);function m(i,u){i?e(i):E===p?e(new h.EBUSY(null,t)):u.hasOwnProperty(p)?(f=(a=u)[p].id,n.getObject(f,w)):e(new h.ENOENT(null,t))}function w(i,u){i?e(i):u.type!==c?e(new h.ENOTDIR(null,t)):(f=u,n.getObject(f.data,O))}function O(i,u){i?e(i):(s=u,Object.keys(s).length>0?e(new h.ENOTEMPTY(null,t)):(delete a[p],n.putObject(r.data,a,l)))}function l(t){if(t)e(t);else{var i=Date.now();P(n,d,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)}_(n,d,function(t,i){t?e(t):(r=i,n.getObject(r.data,m))})}function z(t,e,f,s,r){"function"==typeof s&&(r=s,s=null),e=i(e);var d,m,w,l,N,A=o(e),D=u(e),I=0;function j(n,i){n?r(n):i.type!==c?r(new h.ENOENT(null,e)):(d=i,t.getObject(d.data,T))}function T(n,i){n?r(n):(m=i).hasOwnProperty(A)?f.includes(y)?r(new h.ENOENT("O_CREATE and O_EXCLUSIVE are set, and the named file exists",e)):(w=m[A]).type===c&&f.includes(g)?r(new h.EISDIR("the named file is a directory and O_WRITE is set",e)):t.getObject(w.id,L):f.includes(v)?V.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 h.ENOENT("O_CREATE is not set and the named file does not exist",e))}function L(n,s){if(n)r(n);else{var a=s;a.type===p?++I>O?r(new h.ELOOP(null,e)):function(n){n=i(n),D=u(n),A=o(n),E===A&&(f.includes(g)?r(new h.EISDIR("the named file is a directory and O_WRITE is set",e)):_(t,e,R));_(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,S))}function B(n){if(n)r(n);else{var e=Date.now();P(t,D,d,{mtime:e,ctime:e},x)}}function S(n){n?r(n):(m[A]=new b(l.id,a),t.putObject(d.data,m,B))}function x(n){n?r(n):r(null,l)}E===A?f.includes(g)?r(new h.EISDIR("the named file is a directory and O_WRITE is set",e)):_(t,e,R):_(t,D,j)}function Y(t,e,i,u,o,f){var s;function r(n){n?f(n):f(null,o)}function a(n){if(n)f(n);else{var i=Date.now();P(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 p=n.alloc(o);i.copy(p,0,u,u+o),e.position=o,s.size=o,s.version+=1,t.putBuffer(s.data,p,c)}})}function K(t,e,i,u,o,f,s){var r,a;function c(n){n?s(n):s(null,o)}function p(n){if(n)s(n);else{var i=Date.now();P(t,e.path,r,{mtime:i,ctime:i},c)}}function d(n){n?s(n):t.putObject(r.id,r,p)}function m(c,p){if(c)s(c);else{if(!(a=p))return s(new h.EIO("Expected Buffer"));var m=null!=f?f:e.position,E=Math.max(a.length,m+o),w=n.alloc(E);a&&a.copy(w),i.copy(w,m,u,u+o),void 0===f&&(e.position+=o),r.size=E,r.version+=1,t.putBuffer(r.data,w,d)}}t.getObject(e.id,function(n,e){n?s(n):(r=e,t.getBuffer(r.data,m))})}function U(n,t,e,i,u,o,f){var s,r;function a(n,s){if(n)f(n);else{if(!(r=s))return f(new h.EIO("Expected Buffer"));var a=null!=o?o:t.position;u=a+u>e.length?u-a:u,r.copy(e,i,a,a+u),void 0===o&&(t.position+=u),f(null,u)}}n.getObject(t.id,function(e,i){e?f(e):i.type===c?f(new h.EISDIR("the named file is a directory",t.path)):(s=i,n.getBuffer(s.data,a))})}function G(n,t,e){_(n,t=i(t),e)}function W(n,t,e){t.getNode(n,e)}function H(n,t,e){t=i(t);var f,s,r=o(t),a=u(t);function c(i,u){i?e(i):(s=u).hasOwnProperty(r)?n.getObject(s[r].id,e):e(new h.ENOENT("a component of the path does not name an existing file",t))}E===r?_(n,t,e):_(n,a,function(t,i){t?e(t):(f=i,n.getObject(f.data,c))})}function $(n,t,e,f){t=i(t);var s=o(t),r=u(t);e=i(e);var a,p,d,m,E,w,O=o(e),l=u(e),g=Date.now();function v(t){t?f(t):P(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 h.EEXIST("newpath resolves to an existing file",O)):(m[O]=p[s],E=m[O].id,n.putObject(d.data,m,N))}function D(t,e){t?f(t):(d=e,n.getObject(d.data,A))}function I(t,e){t?f(t):(p=e).hasOwnProperty(s)?p[s].type===c?f(new h.EPERM("oldpath refers to a directory")):_(n,l,D):f(new h.ENOENT("a component of either path prefix does not exist",s))}_(n,r,function(t,e){t?f(t):(a=e,n.getObject(a.data,I))})}function J(n,t,e){t=i(t);var f,s,r,a=o(t),p=u(t);function d(t){t?e(t):(delete s[a],n.putObject(f.data,s,function(t){if(t)e(t);else{var i=Date.now();P(n,p,f,{mtime:i,ctime:i},e)}}))}function m(t){t?e(t):n.delete(r.data,d)}function E(i,u){i?e(i):u.type===c?e(new h.EPERM("unlink not permitted on directories",a)):function(i,u){i?e(i):((r=u).nlinks-=1,r.nlinks<1?n.delete(r.id,m):n.putObject(r.id,r,function(i){i?e(i):P(n,t,r,{ctime:Date.now()},d)}))}(null,u)}function w(t,i){t?e(t):(s=i).hasOwnProperty(a)?n.getObject(s[a].id,E):e(new h.ENOENT("a component of the path does not name an existing file",a))}_(n,p,function(t,i){t?e(t):(f=i,n.getObject(f.data,w))})}function Q(n,t,e){var u,o;function f(n,t){if(n)e(n);else{o=t;var i=Object.keys(o);e(null,i)}}t=i(t),_(n,t,function(i,o){i?e(i):o.type!==c?e(new h.ENOTDIR(null,t)):(u=o,n.getObject(u.data,f))})}function Z(n,t,s,r){s=i(s);var a,c,d,m=o(s),w=u(s);function O(i,u){i?r(i):(c=u).hasOwnProperty(m)?r(new h.EEXIST(null,m)):V.create({guid:n.guid,type:p},function(i,u){i?r(i):((d=u).nlinks+=1,f(t)||(d.symlink_relpath=t,t=e.resolve(w,t)),d.size=t.length,d.data=t,n.putObject(d.id,d,g))})}function l(t){if(t)r(t);else{var e=Date.now();P(n,w,a,{mtime:e,ctime:e},r)}}function g(t){t?r(t):(c[m]=new b(d.id,p),n.putObject(a.data,c,l))}E===m?r(new h.EEXIST(null,m)):_(n,w,function(t,e){t?r(t):(a=e,n.getObject(a.data,O))})}function k(n,t,e){t=i(t);var f,s,r=o(t),a=u(t);function c(t,i){t?e(t):(s=i).hasOwnProperty(r)?n.getObject(s[r].id,d):e(new h.ENOENT("a component of the path does not name an existing file",r))}function d(n,i){if(n)e(n);else if(i.type!==p)e(new h.EINVAL("path not a symbolic link",t));else{var u=i.symlink_relpath?i.symlink_relpath:i.data;e(null,u)}}_(n,a,function(t,i){t?e(t):(f=i,n.getObject(f.data,c))})}function nn(t,e,u,o){var f;function s(e,i){if(e)o(e);else{if(!i)return o(new h.EIO("Expected Buffer"));var s=n.alloc(u);i&&i.copy(s),t.putBuffer(f.data,s,a)}}function r(n){if(n)o(n);else{var i=Date.now();P(t,e,f,{mtime:i,ctime:i},o)}}function a(n){n?o(n):(f.size=u,f.version+=1,t.putObject(f.id,f,r))}e=i(e),u<0?o(new h.EINVAL("length cannot be negative")):_(t,e,function(n,i){n?o(n):i.type===c?o(new h.EISDIR(null,e)):(f=i,t.getBuffer(f.data,s))})}function tn(t,e,i,u){var o;function f(e,f){if(e)u(e);else{var s;if(!f)return u(new h.EIO("Expected Buffer"));s=f?f.slice(0,i):n.alloc(i),t.putBuffer(o.data,s,r)}}function s(n){if(n)u(n);else{var i=Date.now();P(t,e.path,o,{mtime:i,ctime:i},u)}}function r(n){n?u(n):(o.size=i,o.version+=1,t.putObject(o.id,o,s))}i<0?u(new h.EINVAL("length cannot be negative")):e.getNode(t,function(n,e){n?u(n):e.type===c?u(new h.EISDIR):(o=e,t.getBuffer(o.data,f))})}function en(n,t,e,u,o){t=i(t),"number"!=typeof e||"number"!=typeof u?o(new h.EINVAL("atime and mtime must be number",t)):e<0||u<0?o(new h.EINVAL("atime and mtime must be positive integers",t)):_(n,t,function(i,f){i?o(i):P(n,t,f,{atime:e,ctime:u,mtime:u},o)})}function un(n,t,e,i,u){"number"!=typeof e||"number"!=typeof i?u(new h.EINVAL("atime and mtime must be a number")):e<0||i<0?u(new h.EINVAL("atime and mtime must be positive integers")):t.getNode(n,function(o,f){o?u(o):P(n,t.path,f,{atime:e,ctime:i,mtime:i},u)})}function on(n,t,e,u,o,f){t=i(t),"string"!=typeof e?f(new h.EINVAL("attribute name must be a string",t)):e?null!==o&&o!==D&&o!==I?f(new h.EINVAL("invalid flag, must be null, XATTR_CREATE or XATTR_REPLACE",t)):_(n,t,function(i,s){if(i)return f(i);x(n,t,s,e,u,o,f)}):f(new h.EINVAL("attribute name cannot be an empty string",t))}function fn(n,t,e,i,u,o){"string"!=typeof e?o(new h.EINVAL("attribute name must be a string")):e?null!==u&&u!==D&&u!==I?o(new h.EINVAL("invalid flag, must be null, XATTR_CREATE or XATTR_REPLACE")):t.getNode(n,function(f,s){if(f)return o(f);x(n,t.path,s,e,i,u,o)}):o(new h.EINVAL("attribute name cannot be an empty string"))}function sn(n,t,e,u){t=i(t),"string"!=typeof e?u(new h.EINVAL("attribute name must be a string",t)):e?_(n,t,function(n,i){if(n)return u(n);var o=i.xattrs;o.hasOwnProperty(e)?u(null,o[e]):u(new h.ENOATTR(null,t))}):u(new h.EINVAL("attribute name cannot be an empty string",t))}function rn(n,t,e,i){"string"!=typeof e?i(new h.EINVAL):e?t.getNode(n,function(n,t){if(n)return i(n);var u=t.xattrs;u.hasOwnProperty(e)?i(null,u[e]):i(new h.ENOATTR)}):i(new h.EINVAL("attribute name cannot be an empty string"))}function an(n,t,e,u){t=i(t),"string"!=typeof e?u(new h.EINVAL("attribute name must be a string",t)):e?_(n,t,function(i,o){if(i)return u(i);var f=o.xattrs;f.hasOwnProperty(e)?(delete f[e],n.putObject(o.id,o,function(e){e?u(e):P(n,t,o,{ctime:Date.now()},u)})):u(new h.ENOATTR(null,t))}):u(new h.EINVAL("attribute name cannot be an empty string",t))}function cn(n,t,e,i){"string"!=typeof e?i(new h.EINVAL("attribute name must be a string")):e?t.getNode(n,function(u,o){if(u)return i(u);var f=o.xattrs;f.hasOwnProperty(e)?(delete f[e],n.putObject(o.id,o,function(e){e?i(e):P(n,t.path,o,{ctime:Date.now()},i)})):i(new h.ENOATTR)}):i(new h.EINVAL("attribute name cannot be an empty string"))}function pn(n){return A.hasOwnProperty(n)?A[n]:null}function dn(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 mn(n,t,e,i,u){if(arguments.length<5?(u=arguments[arguments.length-1],i=420):i=Pn(i,m,u),!(e=pn(e)))return u(new h.EINVAL("flags is not valid"),t);z(n,t,e,i,function(n,i){if(n)u(n);else{var o;o=e.includes(N)?i.size:0;var f=new R(t,i.id,e,o),s=L.allocDescriptor(f);u(null,s)}})}function En(n,t,e){L.getOpenFileDescription(t)?(L.releaseDescriptor(t),e(null)):e(new h.EBADF)}function wn(n,t,e,i){S(n,t,e,i)}function On(n,t,e,i){if(arguments.length<4)i=e,e=m;else if(!(e=Pn(e,m,i)))return;X(n,t,i)}function ln(n,t,e,i){"function"==typeof e&&(i=e,e=r.fsConstants.F_OK),q(n,t,e|=r.fsConstants.F_OK,i)}function gn(n,t,e,i){if(i=arguments[arguments.length-1],!t)return i(new Error("filename prefix is required"));var u=t+"-"+s.randomChars(6);X(n,u,function(n){i(n,u)})}function vn(n,t,e){M(n,t,e)}function yn(n,t,e){G(n,t,function(i,u){if(i)e(i);else{var o=new B(t,u,n.name);e(null,o)}})}function Nn(n,t,e){var i=L.getOpenFileDescription(t);i?W(n,i,function(t,u){if(t)e(t);else{var o=new B(i.path,u,n.name);e(null,o)}}):e(new h.EBADF)}function An(n,t,e,i){$(n,t,e,i)}function Dn(n,t,e){J(n,t,e)}function In(n,t,e,i,u,o,f){i=void 0===i?0:i,u=void 0===u?e.length-i:u,f=arguments[arguments.length-1];var s=L.getOpenFileDescription(t);s?s.flags.includes(l)?U(n,s,e,i,u,o,function(n,t){f(n,t||0,e)}):f(new h.EBADF("descriptor does not permit reading")):f(new h.EBADF)}function jn(n,t,e){Fn(t,e)===t&&(L.getOpenFileDescription(t)?e():e(new h.EBADF))}function Tn(t,e,i,u){u=arguments[arguments.length-1];var o=pn((i=dn(i,null,"r")).flag||"r");if(!o)return u(new h.EINVAL("flags is not valid",e));z(t,e,o,function(f,s){if(f)return u(f);var r=new R(e,s.id,o,0),a=L.allocDescriptor(r);function c(){L.releaseDescriptor(a)}W(t,r,function(o,f){if(o)return c(),u(o);var s=new B(r.path,f,t.name);if(s.isDirectory())return c(),u(new h.EISDIR("illegal operation on directory",e));var a=s.size,p=n.alloc(a);U(t,r,p,0,a,0,function(n){if(c(),n)return u(n);var t;t="utf8"===i.encoding?p.toString("utf8"):p,u(null,t)})})})}function hn(n,t,e,i,u,o,f){f=arguments[arguments.length-1],i=void 0===i?0:i,u=void 0===u?e.length-i:u;var s=L.getOpenFileDescription(t);s?s.flags.includes(g)?e.length-i>>0}function Pn(n,t,e){return"function"==typeof t&&(e=t,t=void 0),Bn(n)?n&m:"number"==typeof n?(Number.isInteger(n),e(new h.EINVAL("mode not a valid an integer value",n)),!1):"string"==typeof n?Vn.test(n)?parseInt(n,8)&m:(e(new h.EINVAL("mode not a valid octal string",n)),!1):void 0!==t?t:(e(new h.EINVAL("mode not valid",n)),!1)}function Sn(n,t,e,u){t=i(t),"number"!=typeof e?u(new h.EINVAL("mode must be number",t)):_(n,t,function(i,o){i?u(i):(o.mode=e,P(n,t,o,{mtime:Date.now()},u))})}function _n(n,t,e,i){"number"!=typeof e?i(new h.EINVAL("mode must be a number")):t.getNode(n,function(u,o){u?i(u):(o.mode=e,P(n,t.path,o,{mtime:Date.now()},i))})}function xn(n,t,e,u,o){t=i(t),_(n,t,function(i,f){i?o(i):(f.uid=e,f.gid=u,P(n,t,f,{mtime:Date.now()},o))})}function Cn(n,t,e,i,u){t.getNode(n,function(o,f){o?u(o):(f.uid=e,f.gid=i,P(n,t.path,f,{mtime:Date.now()},u))})}function Xn(n,t,e,i){sn(n,t,e,i)}function qn(n,t,e,i){var u=L.getOpenFileDescription(t);u?rn(n,u,e,i):i(new h.EBADF)}function Mn(n,t,e,i,u,o){"function"==typeof u&&(o=u,u=null),on(n,t,e,i,u,o)}function zn(n,t,e,i,u,o){"function"==typeof u&&(o=u,u=null);var f=L.getOpenFileDescription(t);f?f.flags.includes(g)?fn(n,f,e,i,u,o):o(new h.EBADF("descriptor does not permit writing")):o(new h.EBADF)}function Yn(n,t,e,i){an(n,t,e,i)}function Kn(n,t,e,i){var u=L.getOpenFileDescription(t);u?u.flags.includes(g)?cn(n,u,e,i):i(new h.EBADF("descriptor does not permit writing")):i(new h.EBADF)}function Un(n,t,e,i,u){var o=L.getOpenFileDescription(t);o||u(new h.EBADF),"SET"===i?e<0?u(new h.EINVAL("resulting file offset would be negative")):(o.position=e,u(null,o.position)):"CUR"===i?o.position+e<0?u(new h.EINVAL("resulting file offset would be negative")):(o.position+=e,u(null,o.position)):"END"===i?W(n,o,function(n,t){n?u(n):t.size+e<0?u(new h.EINVAL("resulting file offset would be negative")):(o.position=t.size+e,u(null,o.position))}):u(new h.EINVAL("whence argument is not a proper value"))}function Gn(n,t,e){Q(n,t,e)}function Wn(n){return"number"==typeof n?n:"object"===t(n)&&"function"==typeof n.getTime?n.getTime():void 0}function Hn(n,t,e,i,u){var o=Date.now();en(n,t,e=Wn(e||o),i=Wn(i||o),u)}function $n(n,t,e,i,u){var o=Date.now();e=Wn(e||o),i=Wn(i||o);var f=L.getOpenFileDescription(t);f?f.flags.includes(g)?un(n,f,e,i,u):u(new h.EBADF("descriptor does not permit writing")):u(new h.EBADF)}function Jn(n,t,e,i){(e=Pn(e,i))&&Sn(n,t,e,i)}function Qn(n,t,e,i){if(e=Pn(e,i)){var u=L.getOpenFileDescription(t);u?u.flags.includes(g)?_n(n,u,e,i):i(new h.EBADF("descriptor does not permit writing")):i(new h.EBADF)}}function Zn(n,t,e,i,u){return Bn(e)?Bn(i)?void xn(n,t,e,i,u):u(new h.EINVAL("gid must be a valid integer",i)):u(new h.EINVAL("uid must be a valid integer",e))}function kn(n,t,e,i,u){if(!Bn(e))return u(new h.EINVAL("uid must be a valid integer",e));if(!Bn(i))return u(new h.EINVAL("gid must be a valid integer",i));var o=L.getOpenFileDescription(t);o?o.flags.includes(g)?Cn(n,o,e,i,u):u(new h.EBADF("descriptor does not permit writing")):u(new h.EBADF)}function nt(n,t,u,o){t=i(t),u=i(u);var f,s,r,a,p=e.dirname(t),d=e.dirname(t),m=e.basename(t),E=e.basename(u),w=Date.now();function O(t,e){t?o(t):P(n,u,e,{ctime:w},o)}function l(t){t?o(t):n.getObject(a[E].id,O)}function g(t){t?o(t):(f.id===r.id&&(s=a),delete s[m],n.putObject(f.data,s,l))}function v(t){t?o(t):(a[E]=s[m],n.putObject(r.data,a,g))}function y(t,e){t?o(t):(a=e).hasOwnProperty(E)?M(n,u,v):v()}function N(t,e){t?o(t):(r=e,n.getObject(r.data,y))}function A(t,e){t?o(t):(s=e,_(n,d,N))}function D(t,e){t?o(t):(f=e,n.getObject(e.data,A))}function I(e){e?o(e):J(n,t,o)}_(n,t,function(e,i){e?o(e):i.type===c?_(n,p,D):$(n,t,u,I)})}function tt(n,t,e,i,u){Z(n,t,e,u=arguments[arguments.length-1])}function et(n,t,e){k(n,t,e)}function it(n,t,e){H(n,t,function(i,u){if(i)e(i);else{var o=new B(t,u,n.name);e(null,o)}})}function ut(n,t,e,i){Fn(e=e||0,i=arguments[arguments.length-1])===e&&nn(n,t,e,i)}function ot(n,t,e,i){i=arguments[arguments.length-1],e=e||0;var u=L.getOpenFileDescription(t);if(u)if(u.flags.includes(g)){if(Fn(e,i)!==e)return;tn(n,u,e,i)}else i(new h.EBADF("descriptor does not permit writing"));else i(new h.EBADF)}module.exports={appendFile:Ln,access:ln,chown:Zn,chmod:Jn,close:En,ensureRootDirectory:C,exists:Rn,fchown:kn,fchmod:Qn,fgetxattr:qn,fremovexattr:Kn,fsetxattr:zn,fstat:Nn,fsync:jn,ftruncate:ot,futimes:$n,getxattr:Xn,link:An,lseek:Un,lstat:it,mkdir:On,mkdtemp:gn,mknod:wn,open:mn,readdir:Gn,read:In,readFile:Tn,readlink:et,removexattr:Yn,rename:nt,rmdir:vn,setxattr:Mn,stat:yn,symlink:tt,truncate:ut,unlink:Dn,utimes:Hn,writeFile:bn,write:hn}; },{"../path.js":"8thZ","../shared.js":"zFPO","../constants.js":"gCho","../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"),a=require("../providers/index.js"),s=require("../shell/shell.js"),o=require("../../lib/intercom.js"),i=require("../fs-watcher.js"),u=require("../errors.js"),m=require("../shared.js"),c=m.nop,f=m.guid,l=require("../constants.js"),h=l.fsConstants,p=l.FILE_SYSTEM_NAME,d=l.FS_FORMAT,g=l.FS_READY,b=l.FS_PENDING,A=l.FS_ERROR,P=l.FS_NODUPEIDCHECK,v=l.STDIN,y=l.STDOUT,E=l.STDERR,R=require("./implementation.js");function w(e){return"function"==typeof e?e:function(e){if(e)throw e}}function S(e){e&&console.error("Filer error: ",e)}function O(e){if(!(e&&e.protocol&&e.pathname))return e;if("file:"!==e.protocol)throw new u.EINVAL("only file: URLs are supported for paths",e);for(var r=e.pathname,t=0;t