/*! filer 0.0.41 2015-06-01 */ !function(t){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{var e;"undefined"!=typeof window?e=window:"undefined"!=typeof global?e=global:"undefined"!=typeof self&&(e=self),e.Filer=t()}}(function(){var t;return function e(t,n,r){function i(a,s){if(!n[a]){if(!t[a]){var u="function"==typeof require&&require;if(!s&&u)return u(a,!0);if(o)return o(a,!0);throw Error("Cannot find module '"+a+"'")}var c=n[a]={exports:{}};t[a][0].call(c.exports,function(e){var n=t[a][1][e];return i(n?n:e)},c,c.exports,e,t,n,r)}return n[a].exports}for(var o="function"==typeof require&&require,a=0;r.length>a;a++)i(r[a]);return i}({1:[function(e,n){(function(){var e={};"undefined"!=typeof process&&process.nextTick?(e.nextTick=process.nextTick,e.setImmediate="undefined"!=typeof setImmediate?function(t){setImmediate(t)}:e.nextTick):"function"==typeof setImmediate?(e.nextTick=function(t){setImmediate(t)},e.setImmediate=e.nextTick):(e.nextTick=function(t){setTimeout(t,0)},e.setImmediate=e.nextTick),e.eachSeries=function(t,e,n){if(n=n||function(){},!t.length)return n();var r=0,i=function(){e(t[r],function(e){e?(n(e),n=function(){}):(r+=1,r>=t.length?n():i())})};i()},e.forEachSeries=e.eachSeries,t!==void 0&&t.amd?t([],function(){return e}):n!==void 0&&n.exports?n.exports=e:root.async=e})()},{}],2:[function(t,e){function n(t,e){for(var n=e.length-1;n>=0;n--)e[n]===t&&e.splice(n,1);return e}var r=function(){};r.createInterface=function(t){var e={};return e.on=function(e,n){this[t]===void 0&&(this[t]={}),this[t].hasOwnProperty(e)||(this[t][e]=[]),this[t][e].push(n)},e.off=function(e,r){void 0!==this[t]&&this[t].hasOwnProperty(e)&&n(r,this[t][e])},e.trigger=function(e){if(this[t]!==void 0&&this[t].hasOwnProperty(e))for(var n=Array.prototype.slice.call(arguments,1),r=0;this[t][e].length>r;r++)this[t][e][r].apply(this[t][e][r],n)},e.removeAllListeners=function(e){if(void 0!==this[t]){var n=this;n[t][e].forEach(function(t){n.off(e,t)})}},e};var i=r.createInterface("_handlers");r.prototype._on=i.on,r.prototype._off=i.off,r.prototype._trigger=i.trigger;var o=r.createInterface("handlers");r.prototype.on=function(){o.on.apply(this,arguments),Array.prototype.unshift.call(arguments,"on"),this._trigger.apply(this,arguments)},r.prototype.off=o.off,r.prototype.trigger=o.trigger,r.prototype.removeAllListeners=o.removeAllListeners,e.exports=r},{}],3:[function(t,e){(function(n){function r(t,e){var n=0;return function(){var r=Date.now();r-n>t&&(n=r,e.apply(this,arguments))}}function i(t,e){if(void 0!==t&&t||(t={}),"object"==typeof e)for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);return t}function o(){var t=this,e=Date.now();this.origin=s(),this.lastMessage=e,this.receivedIDs={},this.previousValues={};var r=function(){t._onStorageEvent.apply(t,arguments)};"undefined"!=typeof document&&(document.attachEvent?document.attachEvent("onstorage",r):n.addEventListener("storage",r,!1))}var a=t("./eventemitter.js"),s=t("../src/shared.js").guid,u=function(t){return t===void 0||t.localStorage===void 0?{getItem:function(){},setItem:function(){},removeItem:function(){}}:t.localStorage}(n);o.prototype._transaction=function(t){function e(){if(!a){var f=Date.now(),h=0|u.getItem(l);if(h&&r>f-h)return s||(o._on("storage",e),s=!0),c=setTimeout(e,i),void 0;a=!0,u.setItem(l,f),t(),n()}}function n(){s&&o._off("storage",e),c&&clearTimeout(c),u.removeItem(l)}var r=1e3,i=20,o=this,a=!1,s=!1,c=null;e()},o.prototype._cleanup_emit=r(100,function(){var t=this;t._transaction(function(){var t,e=Date.now(),n=e-h,r=0;try{t=JSON.parse(u.getItem(c)||"[]")}catch(i){t=[]}for(var o=t.length-1;o>=0;o--)n>t[o].timestamp&&(t.splice(o,1),r++);r>0&&u.setItem(c,JSON.stringify(t))})}),o.prototype._cleanup_once=r(100,function(){var t=this;t._transaction(function(){var e,n;Date.now();var r=0;try{n=JSON.parse(u.getItem(f)||"{}")}catch(i){n={}}for(e in n)t._once_expired(e,n)&&(delete n[e],r++);r>0&&u.setItem(f,JSON.stringify(n))})}),o.prototype._once_expired=function(t,e){if(!e)return!0;if(!e.hasOwnProperty(t))return!0;if("object"!=typeof e[t])return!0;var n=e[t].ttl||p,r=Date.now(),i=e[t].timestamp;return r-n>i},o.prototype._localStorageChanged=function(t,e){if(t&&t.key)return t.key===e;var n=u.getItem(e);return n===this.previousValues[e]?!1:(this.previousValues[e]=n,!0)},o.prototype._onStorageEvent=function(t){t=t||n.event;var e=this;this._localStorageChanged(t,c)&&this._transaction(function(){var t,n=Date.now(),r=u.getItem(c);try{t=JSON.parse(r||"[]")}catch(i){t=[]}for(var o=0;t.length>o;o++)if(t[o].origin!==e.origin&&!(t[o].timestampr;r++)if(e.call(n,t[r],r,t)===m)return}else{var o=o(t);for(r=0,i=o.length;i>r;r++)if(e.call(n,t[o[r]],o[r],t)===m)return}}function a(t,e,n){e||(e=i);var r=!1;return null==t?r:p&&t.some===p?t.some(e,n):(o(t,function(t,i,o){return r||(r=e.call(n,t,i,o))?m:void 0}),!!r)}function s(t,e){return null==t?!1:h&&t.indexOf===h?-1!=t.indexOf(e):a(t,function(t){return t===e})}function u(t){this.value=t}function c(t){return t&&"object"==typeof t&&!Array.isArray(t)&&g.call(t,"__wrapped__")?t:new u(t)}var f=Array.prototype,l=f.forEach,h=f.indexOf,p=f.some,d=Object.prototype,g=d.hasOwnProperty,v=Object.keys,m={},E=v||function(t){if(t!==Object(t))throw new TypeError("Invalid object");var e=[];for(var r in t)n(t,r)&&e.push(r);return e};u.prototype.has=function(t){return n(this.value,t)},u.prototype.contains=function(t){return s(this.value,t)},u.prototype.size=function(){return r(this.value)},e.exports=c},{}],5:[function(t,e,n){(function(t){"use strict";n.encode=function(e){var n,r=new Uint8Array(e),i=r.length,o="";for(n=0;i>n;n+=3)o+=t[r[n]>>2],o+=t[(3&r[n])<<4|r[n+1]>>4],o+=t[(15&r[n+1])<<2|r[n+2]>>6],o+=t[63&r[n+2]];return 2===i%3?o=o.substring(0,o.length-1)+"=":1===i%3&&(o=o.substring(0,o.length-2)+"=="),o},n.decode=function(e){var n,r,i,o,a,s=.75*e.length,u=e.length,c=0;"="===e[e.length-1]&&(s--,"="===e[e.length-2]&&s--);var f=new ArrayBuffer(s),l=new Uint8Array(f);for(n=0;u>n;n+=4)r=t.indexOf(e[n]),i=t.indexOf(e[n+1]),o=t.indexOf(e[n+2]),a=t.indexOf(e[n+3]),l[c++]=r<<2|i>>4,l[c++]=(15&i)<<4|o>>2,l[c++]=(3&o)<<6|63&a;return f}})("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/")},{}],6:[function(t,e,n){function r(t,e,n){if(!(this instanceof r))return new r(t,e,n);var i,o=typeof t;if("number"===o)i=t>0?t>>>0:0;else if("string"===o)"base64"===e&&(t=I(t)),i=r.byteLength(t,e);else{if("object"!==o||null===t)throw new TypeError("must start with number, buffer, array or string");"Buffer"===t.type&&M(t.data)&&(t=t.data),i=+t.length>0?Math.floor(+t.length):0}if(this.length>P)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+P.toString(16)+" bytes");var a;r.TYPED_ARRAY_SUPPORT?a=r._augment(new Uint8Array(i)):(a=this,a.length=i,a._isBuffer=!0);var s;if(r.TYPED_ARRAY_SUPPORT&&"number"==typeof t.byteLength)a._set(t);else if(T(t))if(r.isBuffer(t))for(s=0;i>s;s++)a[s]=t.readUInt8(s);else for(s=0;i>s;s++)a[s]=(t[s]%256+256)%256;else if("string"===o)a.write(t,0,e);else if("number"===o&&!r.TYPED_ARRAY_SUPPORT&&!n)for(s=0;i>s;s++)a[s]=0;return a}function i(t,e,n,r){n=Number(n)||0;var i=t.length-n;r?(r=Number(r),r>i&&(r=i)):r=i;var o=e.length;if(0!==o%2)throw Error("Invalid hex string");r>o/2&&(r=o/2);for(var a=0;r>a;a++){var s=parseInt(e.substr(2*a,2),16);if(isNaN(s))throw Error("Invalid hex string");t[n+a]=s}return a}function o(t,e,n,r){var i=_(R(e),t,n,r);return i}function a(t,e,n,r){var i=_(S(e),t,n,r);return i}function s(t,e,n,r){return a(t,e,n,r)}function u(t,e,n,r){var i=_(D(e),t,n,r);return i}function c(t,e,n,r){var i=_(x(e),t,n,r,2);return i}function f(t,e,n){return 0===e&&n===t.length?L.fromByteArray(t):L.fromByteArray(t.slice(e,n))}function l(t,e,n){var r="",i="";n=Math.min(t.length,n);for(var o=e;n>o;o++)127>=t[o]?(r+=N(i)+String.fromCharCode(t[o]),i=""):i+="%"+t[o].toString(16);return r+N(i)}function h(t,e,n){var r="";n=Math.min(t.length,n);for(var i=e;n>i;i++)r+=String.fromCharCode(t[i]);return r}function p(t,e,n){return h(t,e,n)}function d(t,e,n){var r=t.length;(!e||0>e)&&(e=0),(!n||0>n||n>r)&&(n=r);for(var i="",o=e;n>o;o++)i+=j(t[o]);return i}function g(t,e,n){for(var r=t.slice(e,n),i="",o=0;r.length>o;o+=2)i+=String.fromCharCode(r[o]+256*r[o+1]);return i}function v(t,e,n){if(0!==t%1||0>t)throw new RangeError("offset is not uint");if(t+e>n)throw new RangeError("Trying to access beyond buffer length")}function m(t,e,n,i,o,a){if(!r.isBuffer(t))throw new TypeError("buffer must be a Buffer instance");if(e>o||a>e)throw new TypeError("value is out of bounds");if(n+i>t.length)throw new TypeError("index out of range")}function E(t,e,n,r){0>e&&(e=65535+e+1);for(var i=0,o=Math.min(t.length-n,2);o>i;i++)t[n+i]=(e&255<<8*(r?i:1-i))>>>8*(r?i:1-i)}function y(t,e,n,r){0>e&&(e=4294967295+e+1);for(var i=0,o=Math.min(t.length-n,4);o>i;i++)t[n+i]=255&e>>>8*(r?i:3-i)}function b(t,e,n,r,i,o){if(e>i||o>e)throw new TypeError("value is out of bounds");if(n+r>t.length)throw new TypeError("index out of range")}function w(t,e,n,r,i){return i||b(t,e,n,4,3.4028234663852886e38,-3.4028234663852886e38),B.write(t,e,n,r,23,4),n+4}function O(t,e,n,r,i){return i||b(t,e,n,8,1.7976931348623157e308,-1.7976931348623157e308),B.write(t,e,n,r,52,8),n+8}function I(t){for(t=A(t).replace(C,"");0!==t.length%4;)t+="=";return t}function A(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")}function T(t){return M(t)||r.isBuffer(t)||t&&"object"==typeof t&&"number"==typeof t.length}function j(t){return 16>t?"0"+t.toString(16):t.toString(16)}function R(t){for(var e=[],n=0;t.length>n;n++){var r=t.charCodeAt(n);if(127>=r)e.push(r);else{var i=n;r>=55296&&57343>=r&&n++;for(var o=encodeURIComponent(t.slice(i,n+1)).substr(1).split("%"),a=0;o.length>a;a++)e.push(parseInt(o[a],16))}}return e}function S(t){for(var e=[],n=0;t.length>n;n++)e.push(255&t.charCodeAt(n));return e}function x(t){for(var e,n,r,i=[],o=0;t.length>o;o++)e=t.charCodeAt(o),n=e>>8,r=e%256,i.push(r),i.push(n);return i}function D(t){return L.toByteArray(t)}function _(t,e,n,r,i){i&&(r-=r%i);for(var o=0;r>o&&!(o+n>=e.length||o>=t.length);o++)e[o+n]=t[o];return o}function N(t){try{return decodeURIComponent(t)}catch(e){return String.fromCharCode(65533)}}var L=t("base64-js"),B=t("ieee754"),M=t("is-array");n.Buffer=r,n.SlowBuffer=r,n.INSPECT_MAX_BYTES=50,r.poolSize=8192;var P=1073741823;r.TYPED_ARRAY_SUPPORT=function(){try{var t=new ArrayBuffer(0),e=new Uint8Array(t);return e.foo=function(){return 42},42===e.foo()&&"function"==typeof e.subarray&&0===new Uint8Array(1).subarray(1,1).byteLength}catch(n){return!1}}(),r.isBuffer=function(t){return!(null==t||!t._isBuffer)},r.compare=function(t,e){if(!r.isBuffer(t)||!r.isBuffer(e))throw new TypeError("Arguments must be Buffers");for(var n=t.length,i=e.length,o=0,a=Math.min(n,i);a>o&&t[o]===e[o];o++);return o!==a&&(n=t[o],i=e[o]),i>n?-1:n>i?1:0},r.isEncoding=function(t){switch((t+"").toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"raw":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},r.concat=function(t,e){if(!M(t))throw new TypeError("Usage: Buffer.concat(list[, length])");if(0===t.length)return new r(0);if(1===t.length)return t[0];var n;if(void 0===e)for(e=0,n=0;t.length>n;n++)e+=t[n].length;var i=new r(e),o=0;for(n=0;t.length>n;n++){var a=t[n];a.copy(i,o),o+=a.length}return i},r.byteLength=function(t,e){var n;switch(t+="",e||"utf8"){case"ascii":case"binary":case"raw":n=t.length;break;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":n=2*t.length;break;case"hex":n=t.length>>>1;break;case"utf8":case"utf-8":n=R(t).length;break;case"base64":n=D(t).length;break;default:n=t.length}return n},r.prototype.length=void 0,r.prototype.parent=void 0,r.prototype.toString=function(t,e,n){var r=!1;if(e>>>=0,n=void 0===n||1/0===n?this.length:n>>>0,t||(t="utf8"),0>e&&(e=0),n>this.length&&(n=this.length),e>=n)return"";for(;;)switch(t){case"hex":return d(this,e,n);case"utf8":case"utf-8":return l(this,e,n);case"ascii":return h(this,e,n);case"binary":return p(this,e,n);case"base64":return f(this,e,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return g(this,e,n);default:if(r)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),r=!0}},r.prototype.equals=function(t){if(!r.isBuffer(t))throw new TypeError("Argument must be a Buffer");return 0===r.compare(this,t)},r.prototype.inspect=function(){var t="",e=n.INSPECT_MAX_BYTES;return this.length>0&&(t=this.toString("hex",0,e).match(/.{2}/g).join(" "),this.length>e&&(t+=" ... ")),""},r.prototype.compare=function(t){if(!r.isBuffer(t))throw new TypeError("Argument must be a Buffer");return r.compare(this,t)},r.prototype.get=function(t){return console.log(".get() is deprecated. Access using array indexes instead."),this.readUInt8(t)},r.prototype.set=function(t,e){return console.log(".set() is deprecated. Access using array indexes instead."),this.writeUInt8(t,e)},r.prototype.write=function(t,e,n,r){if(isFinite(e))isFinite(n)||(r=n,n=void 0);else{var f=r;r=e,e=n,n=f}e=Number(e)||0;var l=this.length-e;n?(n=Number(n),n>l&&(n=l)):n=l,r=((r||"utf8")+"").toLowerCase();var h;switch(r){case"hex":h=i(this,t,e,n);break;case"utf8":case"utf-8":h=o(this,t,e,n);break;case"ascii":h=a(this,t,e,n);break;case"binary":h=s(this,t,e,n);break;case"base64":h=u(this,t,e,n);break;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":h=c(this,t,e,n);break;default:throw new TypeError("Unknown encoding: "+r)}return h},r.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}},r.prototype.slice=function(t,e){var n=this.length;if(t=~~t,e=void 0===e?n:~~e,0>t?(t+=n,0>t&&(t=0)):t>n&&(t=n),0>e?(e+=n,0>e&&(e=0)):e>n&&(e=n),t>e&&(e=t),r.TYPED_ARRAY_SUPPORT)return r._augment(this.subarray(t,e));for(var i=e-t,o=new r(i,void 0,!0),a=0;i>a;a++)o[a]=this[a+t];return o},r.prototype.readUInt8=function(t,e){return e||v(t,1,this.length),this[t]},r.prototype.readUInt16LE=function(t,e){return e||v(t,2,this.length),this[t]|this[t+1]<<8},r.prototype.readUInt16BE=function(t,e){return e||v(t,2,this.length),this[t]<<8|this[t+1]},r.prototype.readUInt32LE=function(t,e){return e||v(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},r.prototype.readUInt32BE=function(t,e){return e||v(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},r.prototype.readInt8=function(t,e){return e||v(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},r.prototype.readInt16LE=function(t,e){e||v(t,2,this.length);var n=this[t]|this[t+1]<<8;return 32768&n?4294901760|n:n},r.prototype.readInt16BE=function(t,e){e||v(t,2,this.length);var n=this[t+1]|this[t]<<8;return 32768&n?4294901760|n:n},r.prototype.readInt32LE=function(t,e){return e||v(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},r.prototype.readInt32BE=function(t,e){return e||v(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},r.prototype.readFloatLE=function(t,e){return e||v(t,4,this.length),B.read(this,t,!0,23,4)},r.prototype.readFloatBE=function(t,e){return e||v(t,4,this.length),B.read(this,t,!1,23,4)},r.prototype.readDoubleLE=function(t,e){return e||v(t,8,this.length),B.read(this,t,!0,52,8)},r.prototype.readDoubleBE=function(t,e){return e||v(t,8,this.length),B.read(this,t,!1,52,8)},r.prototype.writeUInt8=function(t,e,n){return t=+t,e>>>=0,n||m(this,t,e,1,255,0),r.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),this[e]=t,e+1},r.prototype.writeUInt16LE=function(t,e,n){return t=+t,e>>>=0,n||m(this,t,e,2,65535,0),r.TYPED_ARRAY_SUPPORT?(this[e]=t,this[e+1]=t>>>8):E(this,t,e,!0),e+2},r.prototype.writeUInt16BE=function(t,e,n){return t=+t,e>>>=0,n||m(this,t,e,2,65535,0),r.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=t):E(this,t,e,!1),e+2},r.prototype.writeUInt32LE=function(t,e,n){return t=+t,e>>>=0,n||m(this,t,e,4,4294967295,0),r.TYPED_ARRAY_SUPPORT?(this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=t):y(this,t,e,!0),e+4},r.prototype.writeUInt32BE=function(t,e,n){return t=+t,e>>>=0,n||m(this,t,e,4,4294967295,0),r.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=t):y(this,t,e,!1),e+4},r.prototype.writeInt8=function(t,e,n){return t=+t,e>>>=0,n||m(this,t,e,1,127,-128),r.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),0>t&&(t=255+t+1),this[e]=t,e+1},r.prototype.writeInt16LE=function(t,e,n){return t=+t,e>>>=0,n||m(this,t,e,2,32767,-32768),r.TYPED_ARRAY_SUPPORT?(this[e]=t,this[e+1]=t>>>8):E(this,t,e,!0),e+2},r.prototype.writeInt16BE=function(t,e,n){return t=+t,e>>>=0,n||m(this,t,e,2,32767,-32768),r.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=t):E(this,t,e,!1),e+2},r.prototype.writeInt32LE=function(t,e,n){return t=+t,e>>>=0,n||m(this,t,e,4,2147483647,-2147483648),r.TYPED_ARRAY_SUPPORT?(this[e]=t,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24):y(this,t,e,!0),e+4},r.prototype.writeInt32BE=function(t,e,n){return t=+t,e>>>=0,n||m(this,t,e,4,2147483647,-2147483648),0>t&&(t=4294967295+t+1),r.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=t):y(this,t,e,!1),e+4},r.prototype.writeFloatLE=function(t,e,n){return w(this,t,e,!0,n)},r.prototype.writeFloatBE=function(t,e,n){return w(this,t,e,!1,n)},r.prototype.writeDoubleLE=function(t,e,n){return O(this,t,e,!0,n)},r.prototype.writeDoubleBE=function(t,e,n){return O(this,t,e,!1,n)},r.prototype.copy=function(t,e,n,i){var o=this;if(n||(n=0),i||0===i||(i=this.length),e||(e=0),i!==n&&0!==t.length&&0!==o.length){if(n>i)throw new TypeError("sourceEnd < sourceStart");if(0>e||e>=t.length)throw new TypeError("targetStart out of bounds");if(0>n||n>=o.length)throw new TypeError("sourceStart out of bounds");if(0>i||i>o.length)throw new TypeError("sourceEnd out of bounds");i>this.length&&(i=this.length),i-n>t.length-e&&(i=t.length-e+n);var a=i-n;if(1e3>a||!r.TYPED_ARRAY_SUPPORT)for(var s=0;a>s;s++)t[s+e]=this[s+n];else t._set(this.subarray(n,n+a),e)}},r.prototype.fill=function(t,e,n){if(t||(t=0),e||(e=0),n||(n=this.length),e>n)throw new TypeError("end < start");if(n!==e&&0!==this.length){if(0>e||e>=this.length)throw new TypeError("start out of bounds");if(0>n||n>this.length)throw new TypeError("end out of bounds");var r;if("number"==typeof t)for(r=e;n>r;r++)this[r]=t;else{var i=R(""+t),o=i.length;for(r=e;n>r;r++)this[r]=i[r%o]}return this}},r.prototype.toArrayBuffer=function(){if("undefined"!=typeof Uint8Array){if(r.TYPED_ARRAY_SUPPORT)return new r(this).buffer;for(var t=new Uint8Array(this.length),e=0,n=t.length;n>e;e+=1)t[e]=this[e];return t.buffer}throw new TypeError("Buffer.toArrayBuffer not supported in this browser")};var F=r.prototype;r._augment=function(t){return t.constructor=r,t._isBuffer=!0,t._get=t.get,t._set=t.set,t.get=F.get,t.set=F.set,t.write=F.write,t.toString=F.toString,t.toLocaleString=F.toString,t.toJSON=F.toJSON,t.equals=F.equals,t.compare=F.compare,t.copy=F.copy,t.slice=F.slice,t.readUInt8=F.readUInt8,t.readUInt16LE=F.readUInt16LE,t.readUInt16BE=F.readUInt16BE,t.readUInt32LE=F.readUInt32LE,t.readUInt32BE=F.readUInt32BE,t.readInt8=F.readInt8,t.readInt16LE=F.readInt16LE,t.readInt16BE=F.readInt16BE,t.readInt32LE=F.readInt32LE,t.readInt32BE=F.readInt32BE,t.readFloatLE=F.readFloatLE,t.readFloatBE=F.readFloatBE,t.readDoubleLE=F.readDoubleLE,t.readDoubleBE=F.readDoubleBE,t.writeUInt8=F.writeUInt8,t.writeUInt16LE=F.writeUInt16LE,t.writeUInt16BE=F.writeUInt16BE,t.writeUInt32LE=F.writeUInt32LE,t.writeUInt32BE=F.writeUInt32BE,t.writeInt8=F.writeInt8,t.writeInt16LE=F.writeInt16LE,t.writeInt16BE=F.writeInt16BE,t.writeInt32LE=F.writeInt32LE,t.writeInt32BE=F.writeInt32BE,t.writeFloatLE=F.writeFloatLE,t.writeFloatBE=F.writeFloatBE,t.writeDoubleLE=F.writeDoubleLE,t.writeDoubleBE=F.writeDoubleBE,t.fill=F.fill,t.inspect=F.inspect,t.toArrayBuffer=F.toArrayBuffer,t};var C=/[^+\/0-9A-z]/g},{"base64-js":7,ieee754:8,"is-array":9}],7:[function(t,e,n){var r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";(function(t){"use strict";function e(t){var e=t.charCodeAt(0);return e===a?62:e===s?63:u>e?-1:u+10>e?e-u+26+26:f+26>e?e-f:c+26>e?e-c+26:void 0}function n(t){function n(t){c[l++]=t}var r,i,a,s,u,c;if(t.length%4>0)throw Error("Invalid string. Length must be a multiple of 4");var f=t.length;u="="===t.charAt(f-2)?2:"="===t.charAt(f-1)?1:0,c=new o(3*t.length/4-u),a=u>0?t.length-4:t.length;var l=0;for(r=0,i=0;a>r;r+=4,i+=3)s=e(t.charAt(r))<<18|e(t.charAt(r+1))<<12|e(t.charAt(r+2))<<6|e(t.charAt(r+3)),n((16711680&s)>>16),n((65280&s)>>8),n(255&s);return 2===u?(s=e(t.charAt(r))<<2|e(t.charAt(r+1))>>4,n(255&s)):1===u&&(s=e(t.charAt(r))<<10|e(t.charAt(r+1))<<4|e(t.charAt(r+2))>>2,n(255&s>>8),n(255&s)),c}function i(t){function e(t){return r.charAt(t)}function n(t){return e(63&t>>18)+e(63&t>>12)+e(63&t>>6)+e(63&t)}var i,o,a,s=t.length%3,u="";for(i=0,a=t.length-s;a>i;i+=3)o=(t[i]<<16)+(t[i+1]<<8)+t[i+2],u+=n(o);switch(s){case 1:o=t[t.length-1],u+=e(o>>2),u+=e(63&o<<4),u+="==";break;case 2:o=(t[t.length-2]<<8)+t[t.length-1],u+=e(o>>10),u+=e(63&o>>4),u+=e(63&o<<2),u+="="}return u}var o="undefined"!=typeof Uint8Array?Uint8Array:Array,a="+".charCodeAt(0),s="/".charCodeAt(0),u="0".charCodeAt(0),c="a".charCodeAt(0),f="A".charCodeAt(0);t.toByteArray=n,t.fromByteArray=i})(n===void 0?this.base64js={}:n)},{}],8:[function(t,e,n){n.read=function(t,e,n,r,i){var o,a,s=8*i-r-1,u=(1<>1,f=-7,l=n?i-1:0,h=n?-1:1,p=t[e+l];for(l+=h,o=p&(1<<-f)-1,p>>=-f,f+=s;f>0;o=256*o+t[e+l],l+=h,f-=8);for(a=o&(1<<-f)-1,o>>=-f,f+=r;f>0;a=256*a+t[e+l],l+=h,f-=8);if(0===o)o=1-c;else{if(o===u)return a?0/0:1/0*(p?-1:1);a+=Math.pow(2,r),o-=c}return(p?-1:1)*a*Math.pow(2,o-r)},n.write=function(t,e,n,r,i,o){var a,s,u,c=8*o-i-1,f=(1<>1,h=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,p=r?0:o-1,d=r?1:-1,g=0>e||0===e&&0>1/e?1:0;for(e=Math.abs(e),isNaN(e)||1/0===e?(s=isNaN(e)?1:0,a=f):(a=Math.floor(Math.log(e)/Math.LN2),1>e*(u=Math.pow(2,-a))&&(a--,u*=2),e+=a+l>=1?h/u:h*Math.pow(2,1-l),e*u>=2&&(a++,u/=2),a+l>=f?(s=0,a=f):a+l>=1?(s=(e*u-1)*Math.pow(2,i),a+=l):(s=e*Math.pow(2,l-1)*Math.pow(2,i),a=0));i>=8;t[n+p]=255&s,p+=d,s/=256,i-=8);for(a=a<0;t[n+p]=255&a,p+=d,a/=256,c-=8);t[n+p-d]|=128*g}},{}],9:[function(t,e){var n=Array.isArray,r=Object.prototype.toString;e.exports=n||function(t){return!!t&&"[object Array]"==r.call(t)}},{}],10:[function(t,e,n){function r(t,e){for(var n=0,r=t.length-1;r>=0;r--){var i=t[r];"."===i?t.splice(r,1):".."===i?(t.splice(r,1),n++):n&&(t.splice(r,1),n--)}if(e)for(;n--;n)t.unshift("..");return t}function i(t,e){if(t.filter)return t.filter(e);for(var n=[],r=0;t.length>r;r++)e(t[r],r,t)&&n.push(t[r]);return n}var o=/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/,a=function(t){return o.exec(t).slice(1)};n.resolve=function(){for(var t="",e=!1,n=arguments.length-1;n>=-1&&!e;n--){var o=n>=0?arguments[n]:process.cwd();if("string"!=typeof o)throw new TypeError("Arguments to path.resolve must be strings");o&&(t=o+"/"+t,e="/"===o.charAt(0))}return t=r(i(t.split("/"),function(t){return!!t}),!e).join("/"),(e?"/":"")+t||"."},n.normalize=function(t){var e=n.isAbsolute(t),o="/"===s(t,-1);return t=r(i(t.split("/"),function(t){return!!t}),!e).join("/"),t||e||(t="."),t&&o&&(t+="/"),(e?"/":"")+t},n.isAbsolute=function(t){return"/"===t.charAt(0)},n.join=function(){var t=Array.prototype.slice.call(arguments,0);return n.normalize(i(t,function(t){if("string"!=typeof t)throw new TypeError("Arguments to path.join must be strings");return t}).join("/"))},n.relative=function(t,e){function r(t){for(var e=0;t.length>e&&""===t[e];e++);for(var n=t.length-1;n>=0&&""===t[n];n--);return e>n?[]:t.slice(e,n-e+1)}t=n.resolve(t).substr(1),e=n.resolve(e).substr(1);for(var i=r(t.split("/")),o=r(e.split("/")),a=Math.min(i.length,o.length),s=a,u=0;a>u;u++)if(i[u]!==o[u]){s=u;break}for(var c=[],u=s;i.length>u;u++)c.push("..");return c=c.concat(o.slice(s)),c.join("/")},n.sep="/",n.delimiter=":",n.dirname=function(t){var e=a(t),n=e[0],r=e[1];return n||r?(r&&(r=r.substr(0,r.length-1)),n+r):"."},n.basename=function(t,e){var n=a(t)[2];return e&&n.substr(-1*e.length)===e&&(n=n.substr(0,n.length-e.length)),n},n.extname=function(t){return a(t)[3]};var s="b"==="ab".substr(-1)?function(t,e,n){return t.substr(e,n)}:function(t,e,n){return 0>e&&(e=t.length+e),t.substr(e,n)}},{}],11:[function(t,e){function n(t){return t.split("").reduce(function(t,e){return t[e]=!0,t},{})}function r(t,e){return e=e||{},function(n){return o(n,t,e)}}function i(t,e){t=t||{},e=e||{};var n={};return Object.keys(e).forEach(function(t){n[t]=e[t]}),Object.keys(t).forEach(function(e){n[e]=t[e]}),n}function o(t,e,n){if("string"!=typeof e)throw new TypeError("glob pattern string required");return n||(n={}),n.nocomment||"#"!==e.charAt(0)?""===e.trim()?""===t:new a(e,n).match(t):!1}function a(t,e){if(!(this instanceof a))return new a(t,e);if("string"!=typeof t)throw new TypeError("glob pattern string required");e||(e={}),t=t.trim(),"/"!==g.sep&&(t=t.split(g.sep).join("/")),this.options=e,this.set=[],this.pattern=t,this.regexp=null,this.negate=!1,this.comment=!1,this.empty=!1,this.make()}function s(){if(!this._made){var t=this.pattern,e=this.options;if(!e.nocomment&&"#"===t.charAt(0))return this.comment=!0,void 0;if(!t)return this.empty=!0,void 0;this.parseNegate();var n=this.globSet=this.braceExpand();e.debug&&(this.debug=console.error),this.debug(this.pattern,n),n=this.globParts=n.map(function(t){return t.split(A)}),this.debug(this.pattern,n),n=n.map(function(t){return t.map(this.parse,this)},this),this.debug(this.pattern,n),n=n.filter(function(t){return-1===t.indexOf(!1)}),this.debug(this.pattern,n),this.set=n}}function u(){var t=this.pattern,e=!1,n=this.options,r=0;if(!n.nonegate){for(var i=0,o=t.length;o>i&&"!"===t.charAt(i);i++)e=!e,r++;r&&(this.pattern=t.substr(r)),this.negate=e}}function c(t,e){if(e||(e=this instanceof a?this.options:{}),t=t===void 0?this.pattern:t,t===void 0)throw Error("undefined pattern");return e.nobrace||!t.match(/\{.*\}/)?[t]:E(t)}function f(t,e){function n(){if(o){switch(o){case"*":s+=b,u=!0;break;case"?":s+=y,u=!0;break;default:s+="\\"+o}v.debug("clearStateChar %j %j",o,s),o=!1}}var r=this.options;if(!r.noglobstar&&"**"===t)return m;if(""===t)return"";for(var i,o,a,s="",u=!!r.nocase,c=!1,f=[],l=!1,h=-1,d=-1,g="."===t.charAt(0)?"":r.dot?"(?!(?:^|\\/)\\.{1,2}(?:$|\\/))":"(?!\\.)",v=this,E=0,w=t.length;w>E&&(a=t.charAt(E));E++)if(this.debug("%s %s %s %j",t,E,s,a),c&&I[a])s+="\\"+a,c=!1;else switch(a){case"/":return!1;case"\\":n(),c=!0;continue;case"?":case"*":case"+":case"@":case"!":if(this.debug("%s %s %s %j <-- stateChar",t,E,s,a),l){this.debug(" in class"),"!"===a&&E===d+1&&(a="^"),s+=a;continue}v.debug("call clearStateChar %j",o),n(),o=a,r.noext&&n();continue;case"(":if(l){s+="(";continue}if(!o){s+="\\(";continue}i=o,f.push({type:i,start:E-1,reStart:s.length}),s+="!"===o?"(?:(?!":"(?:",this.debug("plType %j %j",o,s),o=!1;continue;case")":if(l||!f.length){s+="\\)";continue}switch(n(),u=!0,s+=")",i=f.pop().type){case"!":s+="[^/]*?)";break;case"?":case"+":case"*":s+=i;break;case"@":}continue;case"|":if(l||!f.length||c){s+="\\|",c=!1;continue}n(),s+="|";continue;case"[":if(n(),l){s+="\\"+a;continue}l=!0,d=E,h=s.length,s+=a;continue;case"]":if(E===d+1||!l){s+="\\"+a,c=!1;continue}if(l){var O=t.substring(d+1,E);try{RegExp("["+O+"]")}catch(A){var j=this.parse(O,T);s=s.substr(0,h)+"\\["+j[0]+"\\]",u=u||j[1],l=!1;continue}}u=!0,l=!1,s+=a;continue;default:n(),c?c=!1:!I[a]||"^"===a&&l||(s+="\\"),s+=a}l&&(O=t.substr(d+1),j=this.parse(O,T),s=s.substr(0,h)+"\\["+j[0],u=u||j[1]);for(var R=f.pop();R;R=f.pop()){var S=s.slice(R.reStart+3);S=S.replace(/((?:\\{2})*)(\\?)\|/g,function(t,e,n){return n||(n="\\"),e+e+n+"|"}),this.debug("tail=%j\n %s",S,S);var x="*"===R.type?b:"?"===R.type?y:"\\"+R.type;u=!0,s=s.slice(0,R.reStart)+x+"\\("+S}n(),c&&(s+="\\\\");var D=!1;switch(s.charAt(0)){case".":case"[":case"(":D=!0}if(""!==s&&u&&(s="(?=.)"+s),D&&(s=g+s),e===T)return[s,u];if(!u)return p(t);var _=r.nocase?"i":"",N=RegExp("^"+s+"$",_);return N._glob=t,N._src=s,N}function l(){if(this.regexp||this.regexp===!1)return this.regexp;var t=this.set;if(!t.length)return this.regexp=!1,this.regexp;var e=this.options,n=e.noglobstar?b:e.dot?w:O,r=e.nocase?"i":"",i=t.map(function(t){return t.map(function(t){return t===m?n:"string"==typeof t?d(t):t._src}).join("\\/")}).join("|");i="^(?:"+i+")$",this.negate&&(i="^(?!"+i+").*$");try{this.regexp=RegExp(i,r)}catch(o){this.regexp=!1}return this.regexp}function h(t,e){if(this.debug("match",t,this.pattern),this.comment)return!1;if(this.empty)return""===t;if("/"===t&&e)return!0;var n=this.options;"/"!==g.sep&&(t=t.split(g.sep).join("/")),t=t.split(A),this.debug(this.pattern,"split",t);var r=this.set;this.debug(this.pattern,"set",r);var i,o;for(o=t.length-1;o>=0&&!(i=t[o]);o--);for(o=0;r.length>o;o++){var a=r[o],s=t;n.matchBase&&1===a.length&&(s=[i]);var u=this.matchOne(s,a,e);if(u)return n.flipNegate?!0:!this.negate}return n.flipNegate?!1:this.negate}function p(t){return t.replace(/\\(.)/g,"$1")}function d(t){return t.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&")}e.exports=o,o.Minimatch=a;var g={sep:"/"};try{g=t("path")}catch(v){}var m=o.GLOBSTAR=a.GLOBSTAR={},E=t("brace-expansion"),y="[^/]",b=y+"*?",w="(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?",O="(?:(?!(?:\\/|^)\\.).)*?",I=n("().*{}+?[]^$\\!"),A=/\/+/;o.filter=r,o.defaults=function(t){if(!t||!Object.keys(t).length)return r;var e=r,n=function r(n,r,o){return e.minimatch(n,r,i(t,o))};return n.Minimatch=function(n,r){return new e.Minimatch(n,i(t,r))},n},a.defaults=function(t){return t&&Object.keys(t).length?o.defaults(t).Minimatch:a},a.prototype.debug=function(){},a.prototype.make=s,a.prototype.parseNegate=u,o.braceExpand=function(t,e){return c(t,e)},a.prototype.braceExpand=c,a.prototype.parse=f;var T={};o.makeRe=function(t,e){return new a(t,e||{}).makeRe()},a.prototype.makeRe=l,o.match=function(t,e,n){n=n||{};var r=new a(e,n);return t=t.filter(function(t){return r.match(t)}),r.options.nonull&&!t.length&&t.push(e),t},a.prototype.match=h,a.prototype.matchOne=function(t,e,n){var r=this.options;this.debug("matchOne",{"this":this,file:t,pattern:e}),this.debug("matchOne",t.length,e.length);for(var i=0,o=0,a=t.length,s=e.length;a>i&&s>o;i++,o++){this.debug("matchOne loop");var u=e[o],c=t[i];if(this.debug(e,u,c),u===!1)return!1;if(u===m){this.debug("GLOBSTAR",[e,u,c]);var f=i,l=o+1;if(l===s){for(this.debug("** at the end");a>i;i++)if("."===t[i]||".."===t[i]||!r.dot&&"."===t[i].charAt(0))return!1; return!0}for(;a>f;){var h=t[f];if(this.debug("\nglobstar while",t,f,e,l,h),this.matchOne(t.slice(f),e.slice(l),n))return this.debug("globstar found match!",f,a,h),!0;if("."===h||".."===h||!r.dot&&"."===h.charAt(0)){this.debug("dot detected!",t,f,e,l);break}this.debug("globstar swallow a segment, and continue"),f++}return n&&(this.debug("\n>>> no match, partial?",t,f,e,l),f===a)?!0:!1}var p;if("string"==typeof u?(p=r.nocase?c.toLowerCase()===u.toLowerCase():c===u,this.debug("string match",u,c,p)):(p=c.match(u),this.debug("pattern match",u,c,p)),!p)return!1}if(i===a&&o===s)return!0;if(i===a)return n;if(o===s){var d=i===a-1&&""===t[i];return d}throw Error("wtf?")}},{"brace-expansion":12,path:10}],12:[function(t,e){function n(t){return parseInt(t,10)==t?parseInt(t,10):t.charCodeAt(0)}function r(t){return t.split("\\\\").join(d).split("\\{").join(g).split("\\}").join(v).split("\\,").join(m).split("\\.").join(E)}function i(t){return t.split(d).join("\\").split(g).join("{").split(v).join("}").split(m).join(",").split(E).join(".")}function o(t){if(!t)return[""];var e=[],n=p("{","}",t);if(!n)return t.split(",");var r=n.pre,i=n.body,a=n.post,s=r.split(",");s[s.length-1]+="{"+i+"}";var u=o(a);return a.length&&(s[s.length-1]+=u.shift(),s.push.apply(s,u)),e.push.apply(e,s),e}function a(t){return t?l(r(t),!0).map(i):[]}function s(t){return"{"+t+"}"}function u(t){return/^-?0\d/.test(t)}function c(t,e){return e>=t}function f(t,e){return t>=e}function l(t,e){var r=[],i=p("{","}",t);if(!i||/\$$/.test(i.pre))return[t];var a=/^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(i.body),d=/^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(i.body),g=a||d,m=/^(.*,)+(.+)?$/.test(i.body);if(!g&&!m)return i.post.match(/,.*}/)?(t=i.pre+"{"+i.body+v+i.post,l(t)):[t];var E;if(g)E=i.body.split(/\.\./);else if(E=o(i.body),1===E.length&&(E=l(E[0],!1).map(s),1===E.length)){var y=i.post.length?l(i.post,!1):[""];return y.map(function(t){return i.pre+E[0]+t})}var b,w=i.pre,y=i.post.length?l(i.post,!1):[""];if(g){var O=n(E[0]),I=n(E[1]),A=Math.max(E[0].length,E[1].length),T=3==E.length?Math.abs(n(E[2])):1,j=c,R=O>I;R&&(T*=-1,j=f);var S=E.some(u);b=[];for(var x=O;j(x,I);x+=T){var D;if(d)D=String.fromCharCode(x),"\\"===D&&(D="");else if(D=x+"",S){var _=A-D.length;if(_>0){var N=Array(_+1).join("0");D=0>x?"-"+N+D.slice(1):N+D}}b.push(D)}}else b=h(E,function(t){return l(t,!1)});for(var L=0;b.length>L;L++)for(var B=0;y.length>B;B++){var M=w+b[L]+y[B];(!e||g||M)&&r.push(M)}return r}var h=t("concat-map"),p=t("balanced-match");e.exports=a;var d="\0SLASH"+Math.random()+"\0",g="\0OPEN"+Math.random()+"\0",v="\0CLOSE"+Math.random()+"\0",m="\0COMMA"+Math.random()+"\0",E="\0PERIOD"+Math.random()+"\0"},{"balanced-match":13,"concat-map":14}],13:[function(t,e){function n(t,e,r){for(var i=0,o={},a=!1,s=0;r.length>s;s++)if(t==r.substr(s,t.length))"start"in o||(o.start=s),i++;else if(e==r.substr(s,e.length)&&"start"in o&&(a=!0,i--,!i))return o.end=s,o.pre=r.substr(0,o.start),o.body=o.end-o.start>1?r.substring(o.start+t.length,o.end):"",o.post=r.slice(o.end+e.length),o;if(i&&a){var u=o.start+t.length;return o=n(t,e,r.substr(u)),o&&(o.start+=u,o.end+=u,o.pre=r.slice(0,u)+o.pre),o}}e.exports=n},{}],14:[function(t,e){e.exports=function(t,e){for(var r=[],i=0;t.length>i;i++){var o=e(t[i],i);n(o)?r.push.apply(r,o):r.push(o)}return r};var n=Array.isArray||function(t){return"[object Array]"===Object.prototype.toString.call(t)}},{}],15:[function(t,e){(function(t){function n(e,n,r){return e instanceof ArrayBuffer&&(e=new Uint8Array(e)),new t(e,n,r)}n.prototype=Object.create(t.prototype),n.prototype.constructor=n,Object.keys(t).forEach(function(e){t.hasOwnProperty(e)&&(n[e]=t[e])}),e.exports=n}).call(this,t("buffer").Buffer)},{buffer:6}],16:[function(t,e){var n="READ",r="WRITE",i="CREATE",o="EXCLUSIVE",a="TRUNCATE",s="APPEND",u="CREATE",c="REPLACE";e.exports={FILE_SYSTEM_NAME:"local",FILE_STORE_NAME:"files",IDB_RO:"readonly",IDB_RW:"readwrite",WSQL_VERSION:"1",WSQL_SIZE:5242880,WSQL_DESC:"FileSystem Storage",MODE_FILE:"FILE",MODE_DIRECTORY:"DIRECTORY",MODE_SYMBOLIC_LINK:"SYMLINK",MODE_META:"META",SYMLOOP_MAX:10,BINARY_MIME_TYPE:"application/octet-stream",JSON_MIME_TYPE:"application/json",ROOT_DIRECTORY_NAME:"/",FS_FORMAT:"FORMAT",FS_NOCTIME:"NOCTIME",FS_NOMTIME:"NOMTIME",FS_NODUPEIDCHECK:"FS_NODUPEIDCHECK",O_READ:n,O_WRITE:r,O_CREATE:i,O_EXCLUSIVE:o,O_TRUNCATE:a,O_APPEND:s,O_FLAGS:{r:[n],"r+":[n,r],w:[r,i,a],"w+":[r,n,i,a],wx:[r,i,o,a],"wx+":[r,n,i,o,a],a:[r,i,s],"a+":[r,n,i,s],ax:[r,i,o,s],"ax+":[r,n,i,o,s]},XATTR_CREATE:u,XATTR_REPLACE:c,FS_READY:"READY",FS_PENDING:"PENDING",FS_ERROR:"ERROR",SUPER_NODE_ID:"00000000-0000-0000-0000-000000000000",STDIN:0,STDOUT:1,STDERR:2,FIRST_DESCRIPTOR:3,ENVIRONMENT:{TMP:"/tmp",PATH:""}}},{}],17:[function(t,e){var n=t("./constants.js").MODE_FILE;e.exports=function(t,e){this.id=t,this.type=e||n}},{"./constants.js":16}],18:[function(t,e){(function(t){function n(t){return t.toString("utf8")}function r(e){return new t(e,"utf8")}e.exports={encode:r,decode:n}}).call(this,t("buffer").Buffer)},{buffer:6}],19:[function(t,e){var n={};["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(t){function e(t,e){Error.call(this),this.name=i,this.code=i,this.errno=r,this.message=t||o,e&&(this.path=e),this.stack=Error(this.message).stack}t=t.split(":");var r=+t[0],i=t[1],o=t[2];e.prototype=Object.create(Error.prototype),e.prototype.constructor=e,e.prototype.toString=function(){var t=this.path?", '"+this.path+"'":"";return this.name+": "+this.message+t},n[i]=n[r]=e}),e.exports=n},{}],20:[function(t,e){function n(t,e,n,r,i){function o(n){t.changes.push({event:"change",path:e}),i(n)}var a=t.flags;le(a).contains(Me)&&delete r.ctime,le(a).contains(Be)&&delete r.mtime;var s=!1;r.ctime&&(n.ctime=r.ctime,n.atime=r.ctime,s=!0),r.atime&&(n.atime=r.atime,s=!0),r.mtime&&(n.mtime=r.mtime,s=!0),s?t.putObject(n.id,n,o):o()}function r(t,e,r,o){function a(n,r){n?o(n):r.mode!==be?o(new Fe.ENOTDIR("a component of the path prefix is not a directory",e)):(l=r,i(t,e,s))}function s(n,r){!n&&r?o(new Fe.EEXIST("path name already exists",e)):!n||n instanceof Fe.ENOENT?t.getObject(l.data,u):o(n)}function u(e,n){e?o(e):(h=n,Ye.create({guid:t.guid,mode:r},function(e,n){return e?(o(e),void 0):(p=n,p.nlinks+=1,t.putObject(p.id,p,f),void 0)}))}function c(e){if(e)o(e);else{var r=Date.now();n(t,g,p,{mtime:r,ctime:r},o)}}function f(e){e?o(e):(h[d]=new Ce(p.id,r),t.putObject(l.data,h,c))}if(r!==be&&r!==ye)return o(new Fe.EINVAL("mode must be a directory or file",e));e=pe(e);var l,h,p,d=ge(e),g=de(e);i(t,g,a)}function i(t,e,n){function r(e,r){e?n(e):r&&r.mode===Oe&&r.rnode?t.getObject(r.rnode,o):n(new Fe.EFILESYSTEMERROR)}function o(t,e){t?n(t):e?n(null,e):n(new Fe.ENOENT)}function a(r,i){r?n(r):i.mode===be&&i.data?t.getObject(i.data,s):n(new Fe.ENOTDIR("a component of the path prefix is not a directory",e))}function s(r,i){if(r)n(r);else if(le(i).has(f)){var o=i[f].id;t.getObject(o,u)}else n(new Fe.ENOENT(null,e))}function u(t,r){t?n(t):r.mode==we?(h++,h>Te?n(new Fe.ELOOP(null,e)):c(r.data)):n(null,r)}function c(e){e=pe(e),l=de(e),f=ge(e),Ie==f?t.getObject(Ae,r):i(t,l,a)}if(e=pe(e),!e)return n(new Fe.ENOENT("path is an empty string"));var f=ge(e),l=de(e),h=0;Ie==f?t.getObject(Ae,r):i(t,l,a)}function o(t,e,r,i,o,a,s){function u(i){i?s(i):n(t,e,r,{ctime:Date.now()},s)}var c=r.xattrs;a===Ne&&c.hasOwnProperty(i)?s(new Fe.EEXIST("attribute already exists",e)):a!==Le||c.hasOwnProperty(i)?(c[i]=o,t.putObject(r.id,r,u)):s(new Fe.ENOATTR(null,e))}function a(t,e){function n(n,i){!n&&i?e():!n||n instanceof Fe.ENOENT?Ue.create({guid:t.guid},function(n,i){return n?(e(n),void 0):(o=i,t.putObject(o.id,o,r),void 0)}):e(n)}function r(n){n?e(n):Ye.create({guid:t.guid,id:o.rnode,mode:be},function(n,r){return n?(e(n),void 0):(a=r,a.nlinks+=1,t.putObject(a.id,a,i),void 0)})}function i(n){n?e(n):(s={},t.putObject(a.data,s,e))}var o,a,s;t.getObject(Ae,n)}function s(t,e,r){function o(n,o){!n&&o?r(new Fe.EEXIST(null,e)):!n||n instanceof Fe.ENOENT?i(t,v,a):r(n)}function a(e,n){e?r(e):(p=n,t.getObject(p.data,s))}function s(e,n){e?r(e):(d=n,Ye.create({guid:t.guid,mode:be},function(e,n){return e?(r(e),void 0):(l=n,l.nlinks+=1,t.putObject(l.id,l,u),void 0)}))}function u(e){e?r(e):(h={},t.putObject(l.data,h,f))}function c(e){if(e)r(e);else{var i=Date.now();n(t,v,p,{mtime:i,ctime:i},r)}}function f(e){e?r(e):(d[g]=new Ce(l.id,be),t.putObject(p.data,d,c))}e=pe(e);var l,h,p,d,g=ge(e),v=de(e);i(t,e,o)}function u(t,e,r){function o(e,n){e?r(e):(g=n,t.getObject(g.data,a))}function a(n,i){n?r(n):Ie==m?r(new Fe.EBUSY(null,e)):le(i).has(m)?(v=i,p=v[m].id,t.getObject(p,s)):r(new Fe.ENOENT(null,e))}function s(n,i){n?r(n):i.mode!=be?r(new Fe.ENOTDIR(null,e)):(p=i,t.getObject(p.data,u))}function u(t,n){t?r(t):(d=n,le(d).size()>0?r(new Fe.ENOTEMPTY(null,e)):f())}function c(e){if(e)r(e);else{var i=Date.now();n(t,E,g,{mtime:i,ctime:i},l)}}function f(){delete v[m],t.putObject(g.data,v,c)}function l(e){e?r(e):t.delete(p.id,h)}function h(e){e?r(e):t.delete(p.data,r)}e=pe(e);var p,d,g,v,m=ge(e),E=de(e);i(t,E,o)}function c(t,e,r,o){function a(n,r){n?o(n):r.mode!==be?o(new Fe.ENOENT(null,e)):(v=r,t.getObject(v.data,s))}function s(n,i){n?o(n):(m=i,le(m).has(w)?le(r).contains(xe)?o(new Fe.ENOENT("O_CREATE and O_EXCLUSIVE are set, and the named file exists",e)):(E=m[w],E.type==be&&le(r).contains(Re)?o(new Fe.EISDIR("the named file is a directory and O_WRITE is set",e)):t.getObject(E.id,u)):le(r).contains(Se)?l():o(new Fe.ENOENT("O_CREATE is not set and the named file does not exist",e)))}function u(t,n){if(t)o(t);else{var r=n;r.mode==we?(I++,I>Te?o(new Fe.ELOOP(null,e)):c(r.data)):f(void 0,r)}}function c(n){n=pe(n),O=de(n),w=ge(n),Ie==w&&(le(r).contains(Re)?o(new Fe.EISDIR("the named file is a directory and O_WRITE is set",e)):i(t,e,f)),i(t,O,a)}function f(t,e){t?o(t):(y=e,o(null,y))}function l(){Ye.create({guid:t.guid,mode:ye},function(e,n){return e?(o(e),void 0):(y=n,y.nlinks+=1,t.putObject(y.id,y,h),void 0)})}function h(e){e?o(e):(b=new ze(0),b.fill(0),t.putBuffer(y.data,b,d))}function p(e){if(e)o(e);else{var r=Date.now();n(t,O,v,{mtime:r,ctime:r},g)}}function d(e){e?o(e):(m[w]=new Ce(y.id,ye),t.putObject(v.data,m,p))}function g(t){t?o(t):o(null,y)}e=pe(e);var v,m,E,y,b,w=ge(e),O=de(e),I=0;Ie==w?le(r).contains(Re)?o(new Fe.EISDIR("the named file is a directory and O_WRITE is set",e)):i(t,e,f):i(t,O,a)}function f(t,e,r,i,o,a){function s(t){t?a(t):a(null,o)}function u(r){if(r)a(r);else{var i=Date.now();n(t,e.path,l,{mtime:i,ctime:i},s)}}function c(e){e?a(e):t.putObject(l.id,l,u)}function f(n,s){if(n)a(n);else{l=s;var u=new ze(o);u.fill(0),r.copy(u,0,i,i+o),e.position=o,l.size=o,l.version+=1,t.putBuffer(l.data,u,c)}}var l;t.getObject(e.id,f)}function l(t,e,r,i,o,a,s){function u(t){t?s(t):s(null,o)}function c(r){if(r)s(r);else{var i=Date.now();n(t,e.path,p,{mtime:i,ctime:i},u)}}function f(e){e?s(e):t.putObject(p.id,p,c)}function l(n,u){if(n)s(n);else{if(d=u,!d)return s(new Fe.EIO("Expected Buffer"));var c=void 0!==a&&null!==a?a:e.position,l=Math.max(d.length,c+o),h=new ze(l);h.fill(0),d&&d.copy(h),r.copy(h,c,i,i+o),void 0===a&&(e.position+=o),p.size=l,p.version+=1,t.putBuffer(p.data,h,f)}}function h(e,n){e?s(e):(p=n,t.getBuffer(p.data,l))}var p,d;t.getObject(e.id,h)}function h(t,e,n,r,i,o,a){function s(t,s){if(t)a(t);else{if(f=s,!f)return a(new Fe.EIO("Expected Buffer"));var u=void 0!==o&&null!==o?o:e.position;i=u+i>n.length?i-u:i,f.copy(n,r,u,u+i),void 0===o&&(e.position+=i),a(null,i)}}function u(n,r){n?a(n):"DIRECTORY"===r.mode?a(new Fe.EISDIR("the named file is a directory",e.path)):(c=r,t.getBuffer(c.data,s))}var c,f;t.getObject(e.id,u)}function p(t,e,n){e=pe(e),ge(e),i(t,e,n)}function d(t,e,n){e.getNode(t,n)}function g(t,e,n){function r(e,r){e?n(e):(a=r,t.getObject(a.data,o))}function o(r,i){r?n(r):(s=i,le(s).has(u)?t.getObject(s[u].id,n):n(new Fe.ENOENT("a component of the path does not name an existing file",e)))}e=pe(e);var a,s,u=ge(e),c=de(e);Ie==u?i(t,e,n):i(t,c,r)}function v(t,e,r,o){function a(e){e?o(e):n(t,r,y,{ctime:Date.now()},o)}function s(e,n){e?o(e):(y=n,y.nlinks+=1,t.putObject(y.id,y,a))}function u(e){e?o(e):t.getObject(E[b].id,s)}function c(e,n){e?o(e):(E=n,le(E).has(b)?o(new Fe.EEXIST("newpath resolves to an existing file",b)):(E[b]=v[p],t.putObject(m.data,E,u)))}function f(e,n){e?o(e):(m=n,t.getObject(m.data,c))}function l(e,n){e?o(e):(v=n,le(v).has(p)?"DIRECTORY"===v[p].type?o(new Fe.EPERM("oldpath refers to a directory")):i(t,w,f):o(new Fe.ENOENT("a component of either path prefix does not exist",p)))}function h(e,n){e?o(e):(g=n,t.getObject(g.data,l))}e=pe(e);var p=ge(e),d=de(e);r=pe(r);var g,v,m,E,y,b=ge(r),w=de(r);i(t,d,h)}function m(t,e,r){function o(e){e?r(e):(delete h[d],t.putObject(l.data,h,function(){var e=Date.now();n(t,g,l,{mtime:e,ctime:e},r)}))}function a(e){e?r(e):t.delete(p.data,o)}function s(i,s){i?r(i):(p=s,p.nlinks-=1,1>p.nlinks?t.delete(p.id,a):t.putObject(p.id,p,function(){n(t,e,p,{ctime:Date.now()},o)}))}function u(t,e){t?r(t):"DIRECTORY"===e.mode?r(new Fe.EPERM("unlink not permitted on directories",d)):s(null,e)}function c(e,n){e?r(e):(h=n,le(h).has(d)?t.getObject(h[d].id,u):r(new Fe.ENOENT("a component of the path does not name an existing file",d)))}function f(e,n){e?r(e):(l=n,t.getObject(l.data,c))}e=pe(e);var l,h,p,d=ge(e),g=de(e);i(t,g,f)}function E(t,e,n){function r(t,e){if(t)n(t);else{s=e;var r=Object.keys(s);n(null,r)}}function o(i,o){i?n(i):o.mode!==be?n(new Fe.ENOTDIR(null,e)):(a=o,t.getObject(a.data,r))}e=pe(e),ge(e);var a,s;i(t,e,o)}function y(t,e,r,o){function a(e,n){e?o(e):(l=n,t.getObject(l.data,s))}function s(t,e){t?o(t):(h=e,le(h).has(d)?o(new Fe.EEXIST(null,d)):u())}function u(){Ye.create({guid:t.guid,mode:we},function(n,r){return n?(o(n),void 0):(p=r,p.nlinks+=1,p.size=e.length,p.data=e,t.putObject(p.id,p,f),void 0)})}function c(e){if(e)o(e);else{var r=Date.now();n(t,g,l,{mtime:r,ctime:r},o)}}function f(e){e?o(e):(h[d]=new Ce(p.id,we),t.putObject(l.data,h,c))}r=pe(r);var l,h,p,d=ge(r),g=de(r);Ie==d?o(new Fe.EEXIST(null,d)):i(t,g,a)}function b(t,e,n){function r(e,r){e?n(e):(s=r,t.getObject(s.data,o))}function o(e,r){e?n(e):(u=r,le(u).has(c)?t.getObject(u[c].id,a):n(new Fe.ENOENT("a component of the path does not name an existing file",c)))}function a(t,r){t?n(t):r.mode!=we?n(new Fe.EINVAL("path not a symbolic link",e)):n(null,r.data)}e=pe(e);var s,u,c=ge(e),f=de(e);i(t,f,r)}function w(t,e,r,o){function a(n,r){n?o(n):r.mode==be?o(new Fe.EISDIR(null,e)):(f=r,t.getBuffer(f.data,s))}function s(e,n){if(e)o(e);else{if(!n)return o(new Fe.EIO("Expected Buffer"));var i=new ze(r);i.fill(0),n&&n.copy(i),t.putBuffer(f.data,i,c)}}function u(r){if(r)o(r);else{var i=Date.now();n(t,e,f,{mtime:i,ctime:i},o)}}function c(e){e?o(e):(f.size=r,f.version+=1,t.putObject(f.id,f,u))}e=pe(e);var f;0>r?o(new Fe.EINVAL("length cannot be negative")):i(t,e,a)}function O(t,e,r,i){function o(e,n){e?i(e):n.mode==be?i(new Fe.EISDIR):(c=n,t.getBuffer(c.data,a))}function a(e,n){if(e)i(e);else{var o;if(!n)return i(new Fe.EIO("Expected Buffer"));n?o=n.slice(0,r):(o=new ze(r),o.fill(0)),t.putBuffer(c.data,o,u)}}function s(r){if(r)i(r);else{var o=Date.now();n(t,e.path,c,{mtime:o,ctime:o},i)}}function u(e){e?i(e):(c.size=r,c.version+=1,t.putObject(c.id,c,s))}var c;0>r?i(new Fe.EINVAL("length cannot be negative")):e.getNode(t,o)}function I(t,e,r,o,a){function s(i,s){i?a(i):n(t,e,s,{atime:r,ctime:o,mtime:o},a)}e=pe(e),"number"!=typeof r||"number"!=typeof o?a(new Fe.EINVAL("atime and mtime must be number",e)):0>r||0>o?a(new Fe.EINVAL("atime and mtime must be positive integers",e)):i(t,e,s)}function A(t,e,r,i,o){function a(a,s){a?o(a):n(t,e.path,s,{atime:r,ctime:i,mtime:i},o)}"number"!=typeof r||"number"!=typeof i?o(new Fe.EINVAL("atime and mtime must be a number")):0>r||0>i?o(new Fe.EINVAL("atime and mtime must be positive integers")):e.getNode(t,a)}function T(t,e,n,r,a,s){function u(i,u){return i?s(i):(o(t,e,u,n,r,a,s),void 0)}e=pe(e),"string"!=typeof n?s(new Fe.EINVAL("attribute name must be a string",e)):n?null!==a&&a!==Ne&&a!==Le?s(new Fe.EINVAL("invalid flag, must be null, XATTR_CREATE or XATTR_REPLACE",e)):i(t,e,u):s(new Fe.EINVAL("attribute name cannot be an empty string",e))}function j(t,e,n,r,i,a){function s(s,u){return s?a(s):(o(t,e.path,u,n,r,i,a),void 0)}"string"!=typeof n?a(new Fe.EINVAL("attribute name must be a string")):n?null!==i&&i!==Ne&&i!==Le?a(new Fe.EINVAL("invalid flag, must be null, XATTR_CREATE or XATTR_REPLACE")):e.getNode(t,s):a(new Fe.EINVAL("attribute name cannot be an empty string"))}function R(t,e,n,r){function o(t,i){if(t)return r(t);var o=i.xattrs;o.hasOwnProperty(n)?r(null,o[n]):r(new Fe.ENOATTR(null,e))}e=pe(e),"string"!=typeof n?r(new Fe.EINVAL("attribute name must be a string",e)):n?i(t,e,o):r(new Fe.EINVAL("attribute name cannot be an empty string",e))}function S(t,e,n,r){function i(t,e){if(t)return r(t);var i=e.xattrs;i.hasOwnProperty(n)?r(null,i[n]):r(new Fe.ENOATTR)}"string"!=typeof n?r(new Fe.EINVAL):n?e.getNode(t,i):r(new Fe.EINVAL("attribute name cannot be an empty string"))}function x(t,e,r,o){function a(i,a){function s(r){r?o(r):n(t,e,a,{ctime:Date.now()},o)}if(i)return o(i);var u=a.xattrs;u.hasOwnProperty(r)?(delete u[r],t.putObject(a.id,a,s)):o(new Fe.ENOATTR(null,e))}e=pe(e),"string"!=typeof r?o(new Fe.EINVAL("attribute name must be a string",e)):r?i(t,e,a):o(new Fe.EINVAL("attribute name cannot be an empty string",e))}function D(t,e,r,i){function o(o,a){function s(r){r?i(r):n(t,e.path,a,{ctime:Date.now()},i)}if(o)return i(o);var u=a.xattrs;u.hasOwnProperty(r)?(delete u[r],t.putObject(a.id,a,s)):i(new Fe.ENOATTR)}"string"!=typeof r?i(new Fe.EINVAL("attribute name must be a string")):r?e.getNode(t,o):i(new Fe.EINVAL("attribute name cannot be an empty string"))}function _(t){return le(_e).has(t)?_e[t]:null}function N(t,e,n){return t?"function"==typeof t?t={encoding:e,flag:n}:"string"==typeof t&&(t={encoding:t,flag:n}):t={encoding:e,flag:n},t}function L(t,e){var n;return t?me(t)?n=new Fe.EINVAL("Path must be a string without null bytes.",t):ve(t)||(n=new Fe.EINVAL("Path must be absolute.",t)):n=new Fe.EINVAL("Path must be a string",t),n?(e(n),!1):!0}function B(t,e,n,r,i,o){function a(e,i){if(e)o(e);else{var a;a=le(r).contains(De)?i.size:0;var s=new ke(n,i.id,r,a),u=t.allocDescriptor(s);o(null,u)}}o=arguments[arguments.length-1],L(n,o)&&(r=_(r),r||o(new Fe.EINVAL("flags is not valid"),n),c(e,n,r,a))}function M(t,e,n,r){le(t.openFiles).has(n)?(t.releaseDescriptor(n),r(null)):r(new Fe.EBADF)}function P(t,e,n,i,o){L(n,o)&&r(e,n,i,o)}function F(t,e,n,r,i){i=arguments[arguments.length-1],L(n,i)&&s(e,n,i)}function C(t,e,n,r){L(n,r)&&u(e,n,r)}function k(t,e,n,r){function i(e,n){if(e)r(e);else{var i=new Ve(n,t.name);r(null,i)}}L(n,r)&&p(e,n,i)}function U(t,e,n,r){function i(e,n){if(e)r(e);else{var i=new Ve(n,t.name);r(null,i)}}var o=t.openFiles[n];o?d(e,o,i):r(new Fe.EBADF)}function Y(t,e,n,r,i){L(n,i)&&L(r,i)&&v(e,n,r,i)}function V(t,e,n,r){L(n,r)&&m(e,n,r)}function z(t,e,n,r,i,o,a,s){function u(t,e){s(t,e||0,r)}i=void 0===i?0:i,o=void 0===o?r.length-i:o,s=arguments[arguments.length-1];var c=t.openFiles[n];c?le(c.flags).contains(je)?h(e,c,r,i,o,a,u):s(new Fe.EBADF("descriptor does not permit reading")):s(new Fe.EBADF)}function X(t,e,n,r,i){if(i=arguments[arguments.length-1],r=N(r,null,"r"),L(n,i)){var o=_(r.flag||"r");return o?(c(e,n,o,function(a,s){function u(){t.releaseDescriptor(f)}if(a)return i(a);var c=new ke(n,s.id,o,0),f=t.allocDescriptor(c);d(e,c,function(o,a){if(o)return u(),i(o);var s=new Ve(a,t.name);if(s.isDirectory())return u(),i(new Fe.EISDIR("illegal operation on directory",n));var f=s.size,l=new ze(f);l.fill(0),h(e,c,l,0,f,0,function(t){if(u(),t)return i(t);var e;e="utf8"===r.encoding?Pe.decode(l):l,i(null,e)})})}),void 0):i(new Fe.EINVAL("flags is not valid",n))}}function W(t,e,n,r,i,o,a,s){s=arguments[arguments.length-1],i=void 0===i?0:i,o=void 0===o?r.length-i:o;var u=t.openFiles[n];u?le(u.flags).contains(Re)?o>r.length-i?s(new Fe.EIO("intput buffer is too small")):l(e,u,r,i,o,a,s):s(new Fe.EBADF("descriptor does not permit writing")):s(new Fe.EBADF)}function q(t,e,n,r,i,o){if(o=arguments[arguments.length-1],i=N(i,"utf8","w"),L(n,o)){var a=_(i.flag||"w");if(!a)return o(new Fe.EINVAL("flags is not valid",n));r=r||"","number"==typeof r&&(r=""+r),"string"==typeof r&&"utf8"===i.encoding&&(r=Pe.encode(r)),c(e,n,a,function(i,s){if(i)return o(i);var u=new ke(n,s.id,a,0),c=t.allocDescriptor(u);f(e,u,r,0,r.length,function(e){return t.releaseDescriptor(c),e?o(e):(o(null),void 0)})})}}function $(t,e,n,r,i,o){if(o=arguments[arguments.length-1],i=N(i,"utf8","a"),L(n,o)){var a=_(i.flag||"a");if(!a)return o(new Fe.EINVAL("flags is not valid",n));r=r||"","number"==typeof r&&(r=""+r),"string"==typeof r&&"utf8"===i.encoding&&(r=Pe.encode(r)),c(e,n,a,function(i,s){if(i)return o(i);var u=new ke(n,s.id,a,s.size),c=t.allocDescriptor(u);l(e,u,r,0,r.length,u.position,function(e){return t.releaseDescriptor(c),e?o(e):(o(null),void 0)})})}}function J(t,e,n,r){function i(t){r(t?!1:!0)}k(t,e,n,i)}function H(t,e,n,r,i){L(n,i)&&R(e,n,r,i)}function Q(t,e,n,r,i){var o=t.openFiles[n];o?S(e,o,r,i):i(new Fe.EBADF)}function G(t,e,n,r,i,o,a){"function"==typeof o&&(a=o,o=null),L(n,a)&&T(e,n,r,i,o,a)}function K(t,e,n,r,i,o,a){"function"==typeof o&&(a=o,o=null);var s=t.openFiles[n];s?le(s.flags).contains(Re)?j(e,s,r,i,o,a):a(new Fe.EBADF("descriptor does not permit writing")):a(new Fe.EBADF)}function Z(t,e,n,r,i){L(n,i)&&x(e,n,r,i)}function te(t,e,n,r,i){var o=t.openFiles[n];o?le(o.flags).contains(Re)?D(e,o,r,i):i(new Fe.EBADF("descriptor does not permit writing")):i(new Fe.EBADF)}function ee(t,e,n,r,i,o){function a(t,e){t?o(t):0>e.size+r?o(new Fe.EINVAL("resulting file offset would be negative")):(s.position=e.size+r,o(null,s.position))}var s=t.openFiles[n];s||o(new Fe.EBADF),"SET"===i?0>r?o(new Fe.EINVAL("resulting file offset would be negative")):(s.position=r,o(null,s.position)):"CUR"===i?0>s.position+r?o(new Fe.EINVAL("resulting file offset would be negative")):(s.position+=r,o(null,s.position)):"END"===i?d(e,s,a):o(new Fe.EINVAL("whence argument is not a proper value"))}function ne(t,e,n,r){L(n,r)&&E(e,n,r)}function re(t,e,n,r,i,o){if(L(n,o)){var a=Date.now();r=r?r:a,i=i?i:a,I(e,n,r,i,o)}}function ie(t,e,n,r,i,o){var a=Date.now();r=r?r:a,i=i?i:a;var s=t.openFiles[n];s?le(s.flags).contains(Re)?A(e,s,r,i,o):o(new Fe.EBADF("descriptor does not permit writing")):o(new Fe.EBADF)}function oe(t,e,r,o,a){function s(t,r){t?a(t):n(e,o,r,{ctime:Date.now()},a)}function c(t){t?a(t):e.getObject(I[R].id,s)}function f(t){t?a(t):(b.id===O.id&&(w=I),delete w[j],e.putObject(b.data,w,c))}function l(t){t?a(t):(I[R]=w[j],e.putObject(O.data,I,f))}function h(t,n){t?a(t):(I=n,le(I).has(R)?u(e,o,l):l())}function p(t,n){t?a(t):(O=n,e.getObject(O.data,h))}function d(t,n){t?a(t):(w=n,i(e,T,p))}function g(t,n){t?a(t):(b=n,e.getObject(n.data,d))}function E(t){t?a(t):m(e,r,a)}function y(t,n){t?a(t):"DIRECTORY"===n.mode?i(e,A,g):v(e,r,o,E)}if(L(r,a)&&L(o,a)){r=pe(r),o=pe(o);var b,w,O,I,A=he.dirname(r),T=he.dirname(r),j=he.basename(r),R=he.basename(o);i(e,r,y)}}function ae(t,e,n,r,i,o){o=arguments[arguments.length-1],L(n,o)&&L(r,o)&&y(e,n,r,o)}function se(t,e,n,r){L(n,r)&&b(e,n,r)}function ue(t,e,n,r){function i(e,n){if(e)r(e);else{var i=new Ve(n,t.name);r(null,i)}}L(n,r)&&g(e,n,i)}function ce(t,e,n,r,i){i=arguments[arguments.length-1],r=r||0,L(n,i)&&w(e,n,r,i)}function fe(t,e,n,r,i){i=arguments[arguments.length-1],r=r||0;var o=t.openFiles[n];o?le(o.flags).contains(Re)?O(e,o,r,i):i(new Fe.EBADF("descriptor does not permit writing")):i(new Fe.EBADF)}var le=t("../../lib/nodash.js"),he=t("../path.js"),pe=he.normalize,de=he.dirname,ge=he.basename,ve=he.isAbsolute,me=he.isNull,Ee=t("../constants.js"),ye=Ee.MODE_FILE,be=Ee.MODE_DIRECTORY,we=Ee.MODE_SYMBOLIC_LINK,Oe=Ee.MODE_META,Ie=Ee.ROOT_DIRECTORY_NAME,Ae=Ee.SUPER_NODE_ID,Te=Ee.SYMLOOP_MAX,je=Ee.O_READ,Re=Ee.O_WRITE,Se=Ee.O_CREATE,xe=Ee.O_EXCLUSIVE;Ee.O_TRUNCATE;var De=Ee.O_APPEND,_e=Ee.O_FLAGS,Ne=Ee.XATTR_CREATE,Le=Ee.XATTR_REPLACE,Be=Ee.FS_NOMTIME,Me=Ee.FS_NOCTIME,Pe=t("../encoding.js"),Fe=t("../errors.js"),Ce=t("../directory-entry.js"),ke=t("../open-file-description.js"),Ue=t("../super-node.js"),Ye=t("../node.js"),Ve=t("../stats.js"),ze=t("../buffer.js");e.exports={ensureRootDirectory:a,open:B,close:M,mknod:P,mkdir:F,rmdir:C,unlink:V,stat:k,fstat:U,link:Y,read:z,readFile:X,write:W,writeFile:q,appendFile:$,exists:J,getxattr:H,fgetxattr:Q,setxattr:G,fsetxattr:K,removexattr:Z,fremovexattr:te,lseek:ee,readdir:ne,utimes:re,futimes:ie,rename:oe,symlink:ae,readlink:se,lstat:ue,truncate:ce,ftruncate:fe}},{"../../lib/nodash.js":4,"../buffer.js":15,"../constants.js":16,"../directory-entry.js":17,"../encoding.js":18,"../errors.js":19,"../node.js":24,"../open-file-description.js":25,"../path.js":26,"../stats.js":34,"../super-node.js":35}],21:[function(t,e){function n(t){return"function"==typeof t?t:function(t){if(t)throw t}}function r(t){t&&console.error("Filer error: ",t)}function i(t,e){function n(){B.forEach(function(t){t.call(this)}.bind(_)),B=null}function i(t){return function(e){function n(e){var r=R();t.getObject(r,function(t,i){return t?(e(t),void 0):(i?n(e):e(null,r),void 0)})}return o(j).contains(d)?(e(null,R()),void 0):(n(e),void 0)}}function u(t){if(t.length){var e=m.getInstance();t.forEach(function(t){e.emit(t.event,t.path)})}}t=t||{},e=e||r;var j=t.flags,R=t.guid?t.guid:b,S=t.provider||new g.Default(t.name||c),x=t.name||S.name,D=o(j).contains(f),_=this;_.readyState=h,_.name=x,_.error=null,_.stdin=w,_.stdout=O,_.stderr=I,this.Shell=v.bind(void 0,this);var N={},L=A;Object.defineProperty(this,"openFiles",{get:function(){return N}}),this.allocDescriptor=function(t){var e=L++;return N[e]=t,e},this.releaseDescriptor=function(t){delete N[t]};var B=[];this.queueOrRun=function(t){var e;return l==_.readyState?t.call(_):p==_.readyState?e=new y.EFILESYSTEMERROR("unknown error"):B.push(t),e},this.watch=function(t,e,n){if(a(t))throw Error("Path must be a string without null bytes.");"function"==typeof e&&(n=e,e={}),e=e||{},n=n||s;var r=new E;return r.start(t,!1,e.recursive),r.on("change",n),r},S.open(function(t){function r(t){function r(t){var e=S[t]();return e.flags=j,e.changes=[],e.guid=i(e),e.close=function(){var t=e.changes;u(t),t.length=0},e}_.provider={openReadWriteContext:function(){return r("getReadWriteContext")},openReadOnlyContext:function(){return r("getReadOnlyContext")}},_.readyState=t?p:l,n(),e(t,_)}if(t)return r(t);var o=S.getReadWriteContext();o.guid=i(o),D?o.clear(function(t){return t?r(t):(T.ensureRootDirectory(o,r),void 0)}):T.ensureRootDirectory(o,r)})}var o=t("../../lib/nodash.js"),a=t("../path.js").isNull,s=t("../shared.js").nop,u=t("../constants.js"),c=u.FILE_SYSTEM_NAME,f=u.FS_FORMAT,l=u.FS_READY,h=u.FS_PENDING,p=u.FS_ERROR,d=u.FS_NODUPEIDCHECK,g=t("../providers/index.js"),v=t("../shell/shell.js"),m=t("../../lib/intercom.js"),E=t("../fs-watcher.js"),y=t("../errors.js"),b=t("../shared.js").guid,w=u.STDIN,O=u.STDOUT,I=u.STDERR,A=u.FIRST_DESCRIPTOR,T=t("./implementation.js");i.providers=g,["open","close","mknod","mkdir","rmdir","stat","fstat","link","unlink","read","readFile","write","writeFile","appendFile","exists","lseek","readdir","rename","readlink","symlink","lstat","truncate","ftruncate","utimes","futimes","setxattr","getxattr","fsetxattr","fgetxattr","removexattr","fremovexattr"].forEach(function(t){i.prototype[t]=function(){var e=this,r=Array.prototype.slice.call(arguments,0),i=r.length-1,o="function"!=typeof r[i],a=n(r[i]),s=e.queueOrRun(function(){function n(){s.close(),a.apply(e,arguments)}var s=e.provider.openReadWriteContext();if(p===e.readyState){var u=new y.EFILESYSTEMERROR("filesystem unavailable, operation canceled");return a.call(e,u)}o?r.push(n):r[i]=n;var c=[e,s].concat(r);T[t].apply(null,c)});s&&a(s)}}),e.exports=i},{"../../lib/intercom.js":3,"../../lib/nodash.js":4,"../constants.js":16,"../errors.js":19,"../fs-watcher.js":22,"../path.js":26,"../providers/index.js":27,"../shared.js":31,"../shell/shell.js":33,"./implementation.js":20}],22:[function(t,e){function n(){function t(t){(n===t||s&&0===t.indexOf(e))&&a.trigger("change","change",t)}r.call(this);var e,n,a=this,s=!1;a.start=function(r,a,u){if(!n){if(i.isNull(r))throw Error("Path must be a string without null bytes.");n=i.normalize(r),s=u===!0,s&&(e="/"===n?"/":n+"/");var c=o.getInstance();c.on("change",t)}},a.close=function(){var e=o.getInstance();e.off("change",t),a.removeAllListeners("change")}}var r=t("../lib/eventemitter.js"),i=t("./path.js"),o=t("../lib/intercom.js");n.prototype=new r,n.prototype.constructor=n,e.exports=n},{"../lib/eventemitter.js":2,"../lib/intercom.js":3,"./path.js":26}],23:[function(t,e){e.exports={FileSystem:t("./filesystem/interface.js"),Buffer:t("./buffer.js"),Path:t("./path.js"),Errors:t("./errors.js"),Shell:t("./shell/shell.js")}},{"./buffer.js":15,"./errors.js":19,"./filesystem/interface.js":21,"./path.js":26,"./shell/shell.js":33}],24:[function(t,e){function n(t){var e=Date.now();this.id=t.id,this.mode=t.mode||i,this.size=t.size||0,this.atime=t.atime||e,this.ctime=t.ctime||e,this.mtime=t.mtime||e,this.flags=t.flags||[],this.xattrs=t.xattrs||{},this.nlinks=t.nlinks||0,this.version=t.version||0,this.blksize=void 0,this.nblocks=1,this.data=t.data}function r(t,e,n){t[e]?n(null):t.guid(function(r,i){t[e]=i,n(r)})}var i=t("./constants.js").MODE_FILE;n.create=function(t,e){r(t,"id",function(i){return i?(e(i),void 0):(r(t,"data",function(r){return r?(e(r),void 0):(e(null,new n(t)),void 0)}),void 0)})},e.exports=n},{"./constants.js":16}],25:[function(t,e){function n(t,e,n,r){this.path=t,this.id=e,this.flags=n,this.position=r}var r=t("./errors.js");n.prototype.getNode=function(t,e){function n(t,n){return t?e(t):n?(e(null,n),void 0):e(new r.EBADF("file descriptor refers to unknown node",o))}var i=this.id,o=this.path;t.getObject(i,n)},e.exports=n},{"./errors.js":19}],26:[function(t,e,n){function r(t,e){for(var n=0,r=t.length-1;r>=0;r--){var i=t[r];"."===i?t.splice(r,1):".."===i?(t.splice(r,1),n++):n&&(t.splice(r,1),n--)}if(e)for(;n--;n)t.unshift("..");return t}function i(){for(var t="",e=!1,n=arguments.length-1;n>=-1&&!e;n--){var i=n>=0?arguments[n]:"/";"string"==typeof i&&i&&(t=i+"/"+t,e="/"===i.charAt(0))}return t=r(t.split("/").filter(function(t){return!!t}),!e).join("/"),(e?"/":"")+t||"."}function o(t){var e="/"===t.charAt(0);return"/"===t.substr(-1),t=r(t.split("/").filter(function(t){return!!t}),!e).join("/"),t||e||(t="."),(e?"/":"")+t}function a(){var t=Array.prototype.slice.call(arguments,0);return o(t.filter(function(t){return t&&"string"==typeof t}).join("/"))}function s(t,e){function r(t){for(var e=0;t.length>e&&""===t[e];e++);for(var n=t.length-1;n>=0&&""===t[n];n--);return e>n?[]:t.slice(e,n-e+1)}t=n.resolve(t).substr(1),e=n.resolve(e).substr(1);for(var i=r(t.split("/")),o=r(e.split("/")),a=Math.min(i.length,o.length),s=a,u=0;a>u;u++)if(i[u]!==o[u]){s=u;break}for(var c=[],u=s;i.length>u;u++)c.push("..");return c=c.concat(o.slice(s)),c.join("/")}function u(t){var e=v(t),n=e[0],r=e[1];return n||r?(r&&(r=r.substr(0,r.length-1)),n+r):"."}function c(t,e){var n=v(t)[2];return e&&n.substr(-1*e.length)===e&&(n=n.substr(0,n.length-e.length)),""===n?"/":n}function f(t){return v(t)[3]}function l(t){return"/"===t.charAt(0)?!0:!1}function h(t){return-1!==(""+t).indexOf("\0")?!0:!1}function p(t){return t.replace(/\/*$/,"/")}function d(t){return t=t.replace(/\/*$/,""),""===t?"/":t}var g=/^(\/?)([\s\S]+\/(?!$)|\/)?((?:\.{1,2}$|[\s\S]+?)?(\.[^.\/]*)?)$/,v=function(t){var e=g.exec(t);return[e[1]||"",e[2]||"",e[3]||"",e[4]||""] };e.exports={normalize:o,resolve:i,join:a,relative:s,sep:"/",delimiter:":",dirname:u,basename:c,extname:f,isAbsolute:l,isNull:h,addTrailing:p,removeTrailing:d}},{}],27:[function(t,e){var n=t("./indexeddb.js"),r=t("./websql.js"),i=t("./memory.js");e.exports={IndexedDB:n,WebSQL:r,Memory:i,Default:n,Fallback:function(){function t(){throw"[Filer Error] Your browser doesn't support IndexedDB or WebSQL."}return n.isSupported()?n:r.isSupported()?r:(t.isSupported=function(){return!1},t)}()}},{"./indexeddb.js":28,"./memory.js":29,"./websql.js":30}],28:[function(t,e){(function(n,r){function i(t,e){var n=t.transaction(c,e);this.objectStore=n.objectStore(c)}function o(t,e,n){try{var r=t.get(e);r.onsuccess=function(t){var e=t.target.result;n(null,e)},r.onerror=function(t){n(t)}}catch(i){n(i)}}function a(t,e,n,r){try{var i=t.put(n,e);i.onsuccess=function(t){var e=t.target.result;r(null,e)},i.onerror=function(t){r(t)}}catch(o){r(o)}}function s(t){this.name=t||u,this.db=null}var u=t("../constants.js").FILE_SYSTEM_NAME,c=t("../constants.js").FILE_STORE_NAME,f=t("../constants.js").IDB_RW;t("../constants.js").IDB_RO;var l=t("../errors.js"),h=t("../buffer.js"),p=n.indexedDB||n.mozIndexedDB||n.webkitIndexedDB||n.msIndexedDB;i.prototype.clear=function(t){try{var e=this.objectStore.clear();e.onsuccess=function(){t()},e.onerror=function(e){t(e)}}catch(n){t(n)}},i.prototype.getObject=function(t,e){o(this.objectStore,t,e)},i.prototype.getBuffer=function(t,e){o(this.objectStore,t,function(t,n){return t?e(t):(e(null,new h(n)),void 0)})},i.prototype.putObject=function(t,e,n){a(this.objectStore,t,e,n)},i.prototype.putBuffer=function(t,e,n){var i;i=r._useTypedArrays?e.buffer:e.toArrayBuffer(),a(this.objectStore,t,i,n)},i.prototype.delete=function(t,e){try{var n=this.objectStore.delete(t);n.onsuccess=function(t){var n=t.target.result;e(null,n)},n.onerror=function(t){e(t)}}catch(r){e(r)}},s.isSupported=function(){return!!p},s.prototype.open=function(t){var e=this;if(e.db)return t();var n=p.open(e.name);n.onupgradeneeded=function(t){var e=t.target.result;e.objectStoreNames.contains(c)&&e.deleteObjectStore(c),e.createObjectStore(c)},n.onsuccess=function(n){e.db=n.target.result,t()},n.onerror=function(){t(new l.EINVAL("IndexedDB cannot be accessed. If private browsing is enabled, disable it."))}},s.prototype.getReadOnlyContext=function(){return new i(this.db,f)},s.prototype.getReadWriteContext=function(){return new i(this.db,f)},e.exports=s}).call(this,"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},t("buffer").Buffer)},{"../buffer.js":15,"../constants.js":16,"../errors.js":19,buffer:6}],29:[function(t,e){function n(t,e){this.readOnly=e,this.objectStore=t}function r(t){this.name=t||i}var i=t("../constants.js").FILE_SYSTEM_NAME,o=t("../../lib/async.js").setImmediate,a=function(){var t={};return function(e){return t.hasOwnProperty(e)||(t[e]={}),t[e]}}();n.prototype.clear=function(t){if(this.readOnly)return o(function(){t("[MemoryContext] Error: write operation on read only context")}),void 0;var e=this.objectStore;Object.keys(e).forEach(function(t){delete e[t]}),o(t)},n.prototype.getObject=n.prototype.getBuffer=function(t,e){var n=this;o(function(){e(null,n.objectStore[t])})},n.prototype.putObject=n.prototype.putBuffer=function(t,e,n){return this.readOnly?(o(function(){n("[MemoryContext] Error: write operation on read only context")}),void 0):(this.objectStore[t]=e,o(n),void 0)},n.prototype.delete=function(t,e){return this.readOnly?(o(function(){e("[MemoryContext] Error: write operation on read only context")}),void 0):(delete this.objectStore[t],o(e),void 0)},r.isSupported=function(){return!0},r.prototype.open=function(t){this.db=a(this.name),o(t)},r.prototype.getReadOnlyContext=function(){return new n(this.db,!0)},r.prototype.getReadWriteContext=function(){return new n(this.db,!1)},e.exports=r},{"../../lib/async.js":1,"../constants.js":16}],30:[function(t,e){(function(n){function r(t,e){var n=this;this.getTransaction=function(r){return n.transaction?(r(n.transaction),void 0):(t[e?"readTransaction":"transaction"](function(t){n.transaction=t,r(t)}),void 0)}}function i(t,e,n){function r(t,e){var r=0===e.rows.length?null:e.rows.item(0).data;n(null,r)}function i(t,e){n(e)}t(function(t){t.executeSql("SELECT data FROM "+u+" WHERE id = ? LIMIT 1;",[e],r,i)})}function o(t,e,n,r){function i(){r(null)}function o(t,e){r(e)}t(function(t){t.executeSql("INSERT OR REPLACE INTO "+u+" (id, data) VALUES (?, ?);",[e,n],i,o)})}function a(t){this.name=t||s,this.db=null}var s=t("../constants.js").FILE_SYSTEM_NAME,u=t("../constants.js").FILE_STORE_NAME,c=t("../constants.js").WSQL_VERSION,f=t("../constants.js").WSQL_SIZE,l=t("../constants.js").WSQL_DESC,h=t("../errors.js"),p=t("../buffer.js"),d=t("base64-arraybuffer");r.prototype.clear=function(t){function e(e,n){t(n)}function n(){t(null)}this.getTransaction(function(t){t.executeSql("DELETE FROM "+u+";",[],n,e)})},r.prototype.getObject=function(t,e){i(this.getTransaction,t,function(t,n){if(t)return e(t);try{n&&(n=JSON.parse(n))}catch(r){return e(r)}e(null,n)})},r.prototype.getBuffer=function(t,e){i(this.getTransaction,t,function(t,n){if(t)return e(t);if(n||""===n){var r=d.decode(n);n=new p(r)}e(null,n)})},r.prototype.putObject=function(t,e,n){var r=JSON.stringify(e);o(this.getTransaction,t,r,n)},r.prototype.putBuffer=function(t,e,n){var r=d.encode(e.buffer);o(this.getTransaction,t,r,n)},r.prototype.delete=function(t,e){function n(){e(null)}function r(t,n){e(n)}this.getTransaction(function(e){e.executeSql("DELETE FROM "+u+" WHERE id = ?;",[t],n,r)})},a.isSupported=function(){return!!n.openDatabase},a.prototype.open=function(t){function e(e,n){5===n.code&&t(new h.EINVAL("WebSQL cannot be accessed. If private browsing is enabled, disable it.")),t(n)}function r(){i.db=o,t()}var i=this;if(i.db)return t();var o=n.openDatabase(i.name,c,l,f);return o?(o.transaction(function(t){function n(t){t.executeSql("CREATE INDEX IF NOT EXISTS idx_"+u+"_id"+" on "+u+" (id);",[],r,e)}t.executeSql("CREATE TABLE IF NOT EXISTS "+u+" (id unique, data TEXT);",[],n,e)}),void 0):(t("[WebSQL] Unable to open database."),void 0)},a.prototype.getReadOnlyContext=function(){return new r(this.db,!0)},a.prototype.getReadWriteContext=function(){return new r(this.db,!1)},e.exports=a}).call(this,"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"../buffer.js":15,"../constants.js":16,"../errors.js":19,"base64-arraybuffer":5}],31:[function(t,e){function n(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(t){var e=0|16*Math.random(),n="x"==t?e:8|3&e;return n.toString(16)}).toUpperCase()}function r(){}function i(t){for(var e=[],n=t.length,r=0;n>r;r++)e[r]=t[r];return e}e.exports={guid:n,u8toArray:i,nop:r}},{}],32:[function(t,e){var n=t("../constants.js").ENVIRONMENT;e.exports=function(t){t=t||{},t.TMP=t.TMP||n.TMP,t.PATH=t.PATH||n.PATH,this.get=function(e){return t[e]},this.set=function(e,n){t[e]=n}}},{"../constants.js":16}],33:[function(t,e){function n(t,e){e=e||{};var n=new o(e.env),a="/";Object.defineProperty(this,"fs",{get:function(){return t},enumerable:!0}),Object.defineProperty(this,"env",{get:function(){return n},enumerable:!0}),this.cd=function(e,n){e=r.resolve(a,e),t.stat(e,function(t,r){return t?(n(new i.ENOTDIR(null,e)),void 0):("DIRECTORY"===r.type?(a=e,n()):n(new i.ENOTDIR(null,e)),void 0)})},this.pwd=function(){return a}}var r=t("../path.js"),i=t("../errors.js"),o=t("./environment.js"),a=t("../../lib/async.js");t("../encoding.js");var s=t("minimatch");n.prototype.exec=function(t,e,n){var i=this,o=i.fs;"function"==typeof e&&(n=e,e=[]),e=e||[],n=n||function(){},t=r.resolve(i.pwd(),t),o.readFile(t,"utf8",function(t,r){if(t)return n(t),void 0;try{var i=Function("fs","args","callback",r);i(o,e,n)}catch(a){n(a)}})},n.prototype.touch=function(t,e,n){function i(t){s.writeFile(t,"",n)}function o(t){var r=Date.now(),i=e.date||r,o=e.date||r;s.utimes(t,i,o,n)}var a=this,s=a.fs;"function"==typeof e&&(n=e,e={}),e=e||{},n=n||function(){},t=r.resolve(a.pwd(),t),s.stat(t,function(r){r?e.updateOnly===!0?n():i(t):o(t)})},n.prototype.cat=function(t,e){function n(t,e){var n=r.resolve(o.pwd(),t);s.readFile(n,"utf8",function(t,n){return t?(e(t),void 0):(u+=n+"\n",e(),void 0)})}var o=this,s=o.fs,u="";return e=e||function(){},t?(t="string"==typeof t?[t]:t,a.eachSeries(t,n,function(t){t?e(t):e(null,u.replace(/\n$/,""))}),void 0):(e(new i.EINVAL("Missing files argument")),void 0)},n.prototype.ls=function(t,e,n){function o(t,n){var i=r.resolve(s.pwd(),t),c=[];u.readdir(i,function(t,s){function f(t,n){t=r.join(i,t),u.stat(t,function(a,s){if(a)return n(a),void 0;var u={path:r.basename(t),links:s.nlinks,size:s.size,modified:s.mtime,type:s.type};e.recursive&&"DIRECTORY"===s.type?o(r.join(i,u.path),function(t,e){return t?(n(t),void 0):(u.contents=e,c.push(u),n(),void 0)}):(c.push(u),n())})}return t?(n(t),void 0):(a.eachSeries(s,f,function(t){n(t,c)}),void 0)})}var s=this,u=s.fs;return"function"==typeof e&&(n=e,e={}),e=e||{},n=n||function(){},t?(o(t,n),void 0):(n(new i.EINVAL("Missing dir argument")),void 0)},n.prototype.rm=function(t,e,n){function o(t,n){t=r.resolve(s.pwd(),t),u.stat(t,function(s,c){return s?(n(s),void 0):"FILE"===c.type?(u.unlink(t,n),void 0):(u.readdir(t,function(s,c){return s?(n(s),void 0):0===c.length?(u.rmdir(t,n),void 0):e.recursive?(c=c.map(function(e){return r.join(t,e)}),a.eachSeries(c,o,function(e){return e?(n(e),void 0):(u.rmdir(t,n),void 0)}),void 0):(n(new i.ENOTEMPTY(null,t)),void 0)}),void 0)})}var s=this,u=s.fs;return"function"==typeof e&&(n=e,e={}),e=e||{},n=n||function(){},t?(o(t,n),void 0):(n(new i.EINVAL("Missing path argument")),void 0)},n.prototype.tempDir=function(t){var e=this,n=e.fs,r=e.env.get("TMP");t=t||function(){},n.mkdir(r,function(){t(null,r)})},n.prototype.mkdirp=function(t,e){function n(t,e){a.stat(t,function(o,s){if(s){if(s.isDirectory())return e(),void 0;if(s.isFile())return e(new i.ENOTDIR(null,t)),void 0}else{if(o&&"ENOENT"!==o.code)return e(o),void 0;var u=r.dirname(t);"/"===u?a.mkdir(t,function(t){return t&&"EEXIST"!=t.code?(e(t),void 0):(e(),void 0)}):n(u,function(n){return n?e(n):(a.mkdir(t,function(t){return t&&"EEXIST"!=t.code?(e(t),void 0):(e(),void 0)}),void 0)})}})}var o=this,a=o.fs;return e=e||function(){},t?"/"===t?(e(),void 0):(n(t,e),void 0):(e(new i.EINVAL("Missing path argument")),void 0)},n.prototype.find=function(t,e,n){function o(t,e){h(t,function(n){return n?(e(n),void 0):(p.push(t),e(),void 0)})}function u(t,n){var i=r.removeTrailing(t);return e.regex&&!e.regex.test(i)?(n(),void 0):e.name&&!s(r.basename(i),e.name)?(n(),void 0):e.path&&!s(r.dirname(i),e.path)?(n(),void 0):(o(t,n),void 0)}function c(t,e){t=r.resolve(f.pwd(),t),l.readdir(t,function(n,i){return n?("ENOTDIR"===n.code?u(t,e):e(n),void 0):(u(r.addTrailing(t),function(n){return n?(e(n),void 0):(i=i.map(function(e){return r.join(t,e)}),a.eachSeries(i,c,function(t){e(t,p)}),void 0)}),void 0)})}var f=this,l=f.fs;"function"==typeof e&&(n=e,e={}),e=e||{},n=n||function(){};var h=e.exec||function(t,e){e()},p=[];return t?(l.stat(t,function(e,r){return e?(n(e),void 0):r.isDirectory()?(c(t,n),void 0):(n(new i.ENOTDIR(null,t)),void 0)}),void 0):(n(new i.EINVAL("Missing path argument")),void 0)},e.exports=n},{"../../lib/async.js":1,"../encoding.js":18,"../errors.js":19,"../path.js":26,"./environment.js":32,minimatch:11}],34:[function(t,e){function n(t,e){this.node=t.id,this.dev=e,this.size=t.size,this.nlinks=t.nlinks,this.atime=t.atime,this.mtime=t.mtime,this.ctime=t.ctime,this.type=t.mode}var r=t("./constants.js");n.prototype.isFile=function(){return this.type===r.MODE_FILE},n.prototype.isDirectory=function(){return this.type===r.MODE_DIRECTORY},n.prototype.isSymbolicLink=function(){return this.type===r.MODE_SYMBOLIC_LINK},n.prototype.isSocket=n.prototype.isFIFO=n.prototype.isCharacterDevice=n.prototype.isBlockDevice=function(){return!1},e.exports=n},{"./constants.js":16}],35:[function(t,e){function n(t){var e=Date.now();this.id=r.SUPER_NODE_ID,this.mode=r.MODE_META,this.atime=t.atime||e,this.ctime=t.ctime||e,this.mtime=t.mtime||e,this.rnode=t.rnode}var r=t("./constants.js");n.create=function(t,e){t.guid(function(r,i){return r?(e(r),void 0):(t.rnode=t.rnode||i,e(null,new n(t)),void 0)})},e.exports=n},{"./constants.js":16}]},{},[23])(23)});