From ad42a0d6bad2ac27fe99f03c47065a1e661d6f76 Mon Sep 17 00:00:00 2001 From: Dilan Guneratne Date: Mon, 17 Sep 2018 23:19:55 -0400 Subject: [PATCH] #387 Added unit test for writing data using the Promise API --- dist/filer.js | 589 ++++--- dist/filer.map | 2 +- dist/filer.min.js | 82 +- dist/filer.min.map | 2 +- package-lock.json | 2952 +++++++++++++++++------------------ tests/spec/fs.write.spec.js | 24 + 6 files changed, 1889 insertions(+), 1762 deletions(-) diff --git a/dist/filer.js b/dist/filer.js index 4d7c27e..a737e0a 100644 --- a/dist/filer.js +++ b/dist/filer.js @@ -103,7 +103,7 @@ parcelRequire = (function (modules, cache, entry, globalName) { // Override the current require with this new one return newRequire; -})({"96cB":[function(require,module,exports) { +})({"rwRH":[function(require,module,exports) { var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; // Cherry-picked bits of underscore.js, lodash.js @@ -202,6 +202,91 @@ function nodash(value) { } module.exports = nodash; +},{}],"dRwD":[function(require,module,exports) { +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +// Symbols is a better way to do this, but if we don't have support we'll just +// have to make do with an unlikely token +var customArgumentsToken = Symbol ? Symbol("__ES6-PROMISIFY--CUSTOM-ARGUMENTS__") : "__ES6-PROMISIFY--CUSTOM-ARGUMENTS__"; + +/** + * promisify() + * Transforms callback-based function -- func(arg1, arg2 .. argN, callback) -- into + * an ES6-compatible Promise. Promisify provides a default callback of the form (error, result) + * and rejects when `error` is truthy. + * + * @param {function} original - The function to promisify + * @return {function} A promisified version of `original` + */ +function promisify(original) { + + // Ensure the argument is a function + if (typeof original !== "function") { + throw new TypeError("Argument to promisify must be a function"); + } + + // If the user has asked us to decode argument names for them, honour that + var argumentNames = original[customArgumentsToken]; + + // If the user has supplied a custom Promise implementation, use it. Otherwise + // fall back to whatever we can find on the global object. + var ES6Promise = promisify.Promise || Promise; + + // If we can find no Promise implemention, then fail now. + if (typeof ES6Promise !== "function") { + throw new Error("No Promise implementation found; do you need a polyfill?"); + } + + return function () { + var _this = this; + + for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) { + args[_key] = arguments[_key]; + } + + return new ES6Promise(function (resolve, reject) { + + // Append the callback bound to the context + args.push(function callback(err) { + + if (err) { + return reject(err); + } + + for (var _len2 = arguments.length, values = Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) { + values[_key2 - 1] = arguments[_key2]; + } + + if (values.length === 1 || !argumentNames) { + return resolve(values[0]); + } + + var o = {}; + values.forEach(function (value, index) { + var name = argumentNames[index]; + if (name) { + o[name] = value; + } + }); + + resolve(o); + }); + + // Call the function. + original.call.apply(original, [_this].concat(args)); + }); + }; +} + +// Attach this symbol to the exported function, so users can use it +promisify.argumentNames = customArgumentsToken; +promisify.Promise = undefined; + +// Export the public API +exports.promisify = promisify; },{}],"UzoP":[function(require,module,exports) { // Copyright Joyent, Inc. and other Node contributors. // @@ -258,7 +343,7 @@ function normalizeArray(parts, allowAboveRoot) { // Split a filename into [root, dir, basename, ext], unix version // 'root' is just a slash, or nothing. -var splitPathRe = /^(\/?)([\s\S]+\/(?!$)|\/)?((?:\.{1,2}$|[\s\S]+?)?(\.[^.\/]*)?)$/; +var splitPathRe = /^(\/?)([\s\S]+\/(?!$)|\/)?((?:\.{1,2}$|[\s\S]+?)?(\.[^./]*)?)$/; var splitPath = function splitPath(filename) { var result = splitPathRe.exec(filename); return [result[1] || '', result[2] || '', result[3] || '', result[4] || '']; @@ -295,8 +380,7 @@ function resolve() { // path.normalize(path) function normalize(path) { - var isAbsolute = path.charAt(0) === '/', - trailingSlash = path.substr(-1) === '/'; + var isAbsolute = path.charAt(0) === '/'; // Normalize the path path = normalizeArray(path.split('/').filter(function (p) { @@ -317,7 +401,7 @@ function normalize(path) { function join() { var paths = Array.prototype.slice.call(arguments, 0); - return normalize(paths.filter(function (p, index) { + return normalize(paths.filter(function (p) { return p && typeof p === 'string'; }).join('/')); } @@ -355,7 +439,7 @@ function relative(from, to) { } var outputParts = []; - for (var i = samePartsLength; i < fromParts.length; i++) { + for (i = samePartsLength; i < fromParts.length; i++) { outputParts.push('..'); } @@ -389,7 +473,7 @@ function basename(path, ext) { f = f.substr(0, f.length - ext.length); } // XXXfiler: node.js just does `return f` - return f === "" ? "/" : f; + return f === '' ? '/' : f; } function extname(path) { @@ -487,9 +571,9 @@ module.exports = { IDB_RO: 'readonly', IDB_RW: 'readwrite', - WSQL_VERSION: "1", + WSQL_VERSION: '1', WSQL_SIZE: 5 * 1024 * 1024, - WSQL_DESC: "FileSystem Storage", + WSQL_DESC: 'FileSystem Storage', NODE_TYPE_FILE: 'FILE', NODE_TYPE_DIRECTORY: 'DIRECTORY', @@ -603,105 +687,7 @@ module.exports = { COPYFILE_EXCL: 1 } }; -},{}],"p8GN":[function(require,module,exports) { -var errors = {}; -[ -/** - * node.js errors - we only use some of these, add as needed. - */ -//'-1:UNKNOWN:unknown error', -//'0:OK:success', -//'1:EOF:end of file', -//'2:EADDRINFO:getaddrinfo error', -//'3:EACCES:permission denied', -//'4:EAGAIN:resource temporarily unavailable', -//'5:EADDRINUSE:address already in use', -//'6:EADDRNOTAVAIL:address not available', -//'7:EAFNOSUPPORT:address family not supported', -//'8:EALREADY:connection already in progress', -'9:EBADF:bad file descriptor', '10:EBUSY:resource busy or locked', -//'11:ECONNABORTED:software caused connection abort', -//'12:ECONNREFUSED:connection refused', -//'13:ECONNRESET:connection reset by peer', -//'14:EDESTADDRREQ:destination address required', -//'15:EFAULT:bad address in system call argument', -//'16:EHOSTUNREACH:host is unreachable', -//'17:EINTR:interrupted system call', -'18:EINVAL:invalid argument', -//'19:EISCONN:socket is already connected', -//'20:EMFILE:too many open files', -//'21:EMSGSIZE:message too long', -//'22:ENETDOWN:network is down', -//'23:ENETUNREACH:network is unreachable', -//'24:ENFILE:file table overflow', -//'25:ENOBUFS:no buffer space available', -//'26:ENOMEM:not enough memory', -'27:ENOTDIR:not a directory', '28:EISDIR:illegal operation on a directory', -//'29:ENONET:machine is not on the network', -// errno 30 skipped, as per https://github.com/rvagg/node-errno/blob/master/errno.js -//'31:ENOTCONN:socket is not connected', -//'32:ENOTSOCK:socket operation on non-socket', -//'33:ENOTSUP:operation not supported on socket', -'34:ENOENT:no such file or directory', -//'35:ENOSYS:function not implemented', -//'36:EPIPE:broken pipe', -//'37:EPROTO:protocol error', -//'38:EPROTONOSUPPORT:protocol not supported', -//'39:EPROTOTYPE:protocol wrong type for socket', -//'40:ETIMEDOUT:connection timed out', -//'41:ECHARSET:invalid Unicode character', -//'42:EAIFAMNOSUPPORT:address family for hostname not supported', -// errno 43 skipped, as per https://github.com/rvagg/node-errno/blob/master/errno.js -//'44:EAISERVICE:servname not supported for ai_socktype', -//'45:EAISOCKTYPE:ai_socktype not supported', -//'46:ESHUTDOWN:cannot send after transport endpoint shutdown', -'47:EEXIST:file already exists', -//'48:ESRCH:no such process', -//'49:ENAMETOOLONG:name too long', -'50:EPERM:operation not permitted', '51:ELOOP:too many symbolic links encountered', -//'52:EXDEV:cross-device link not permitted', -'53:ENOTEMPTY:directory not empty', -//'54:ENOSPC:no space left on device', -'55:EIO:i/o error', -//'56:EROFS:read-only file system', -//'57:ENODEV:no such device', -//'58:ESPIPE:invalid seek', -//'59:ECANCELED:operation canceled', - -/** - * Filer specific errors - */ -'1000:ENOTMOUNTED:not mounted', '1001:EFILESYSTEMERROR:missing super node, use \'FORMAT\' flag to format filesystem.', '1002:ENOATTR:attribute does not exist'].forEach(function (e) { - e = e.split(':'); - var errno = +e[0]; - var errName = e[1]; - var defaultMessage = e[2]; - - function FilerError(msg, path) { - Error.call(this); - - this.name = errName; - this.code = errName; - this.errno = errno; - this.message = msg || defaultMessage; - if (path) { - this.path = path; - } - this.stack = new Error(this.message).stack; - } - FilerError.prototype = Object.create(Error.prototype); - FilerError.prototype.constructor = FilerError; - FilerError.prototype.toString = function () { - var pathInfo = this.path ? ', \'' + this.path + '\'' : ''; - return this.name + ': ' + this.message + pathInfo; - }; - - // We expose the error as both Errors.EINVAL and Errors[18] - errors[errName] = errors[errno] = FilerError; -}); - -module.exports = errors; -},{}],"yh9p":[function(require,module,exports) { +},{}],"XV+c":[function(require,module,exports) { 'use strict' exports.byteLength = byteLength @@ -854,7 +840,7 @@ function fromByteArray (uint8) { return parts.join('') } -},{}],"JgNJ":[function(require,module,exports) { +},{}],"QT34":[function(require,module,exports) { exports.read = function (buffer, offset, isLE, mLen, nBytes) { var e, m var eLen = (nBytes * 8) - mLen - 1 @@ -940,14 +926,14 @@ exports.write = function (buffer, value, offset, isLE, mLen, nBytes) { buffer[offset + i - d] |= s * 128 } -},{}],"REa7":[function(require,module,exports) { +},{}],"CWYW":[function(require,module,exports) { var toString = {}.toString; module.exports = Array.isArray || function (arr) { return toString.call(arr) == '[object Array]'; }; -},{}],"dskh":[function(require,module,exports) { +},{}],"D+m+":[function(require,module,exports) { var global = arguments[3]; /*! @@ -2740,7 +2726,7 @@ function isnan (val) { return val !== val // eslint-disable-line no-self-compare } -},{"base64-js":"yh9p","ieee754":"JgNJ","isarray":"REa7","buffer":"dskh"}],"xfwq":[function(require,module,exports) { +},{"base64-js":"XV+c","ieee754":"QT34","isarray":"CWYW","buffer":"D+m+"}],"xfwq":[function(require,module,exports) { var Buffer = require("buffer").Buffer; function FilerBuffer(subject, encoding, nonZero) { @@ -2751,7 +2737,7 @@ function FilerBuffer(subject, encoding, nonZero) { } return new Buffer(subject, encoding, nonZero); -}; +} // Inherit prototype from Buffer FilerBuffer.prototype = Object.create(Buffer.prototype); @@ -2765,13 +2751,12 @@ Object.keys(Buffer).forEach(function (p) { }); module.exports = FilerBuffer; -},{"buffer":"dskh"}],"QO4x":[function(require,module,exports) { +},{"buffer":"D+m+"}],"SvVb":[function(require,module,exports) { var global = arguments[3]; var FILE_SYSTEM_NAME = require('../constants.js').FILE_SYSTEM_NAME; var FILE_STORE_NAME = require('../constants.js').FILE_STORE_NAME; var IDB_RW = require('../constants.js').IDB_RW; var IDB_RO = require('../constants.js').IDB_RO; -var Errors = require('../errors.js'); var FilerBuffer = require('../buffer.js'); var indexedDB = global.indexedDB || global.mozIndexedDB || global.webkitIndexedDB || global.msIndexedDB; @@ -2927,7 +2912,105 @@ IndexedDB.prototype.getReadWriteContext = function () { }; module.exports = IndexedDB; -},{"../constants.js":"iJA9","../errors.js":"p8GN","../buffer.js":"xfwq"}],"vLJO":[function(require,module,exports) { +},{"../constants.js":"iJA9","../buffer.js":"xfwq"}],"p8GN":[function(require,module,exports) { +var errors = {}; +[ +/** + * node.js errors - we only use some of these, add as needed. + */ +//'-1:UNKNOWN:unknown error', +//'0:OK:success', +//'1:EOF:end of file', +//'2:EADDRINFO:getaddrinfo error', +//'3:EACCES:permission denied', +//'4:EAGAIN:resource temporarily unavailable', +//'5:EADDRINUSE:address already in use', +//'6:EADDRNOTAVAIL:address not available', +//'7:EAFNOSUPPORT:address family not supported', +//'8:EALREADY:connection already in progress', +'9:EBADF:bad file descriptor', '10:EBUSY:resource busy or locked', +//'11:ECONNABORTED:software caused connection abort', +//'12:ECONNREFUSED:connection refused', +//'13:ECONNRESET:connection reset by peer', +//'14:EDESTADDRREQ:destination address required', +//'15:EFAULT:bad address in system call argument', +//'16:EHOSTUNREACH:host is unreachable', +//'17:EINTR:interrupted system call', +'18:EINVAL:invalid argument', +//'19:EISCONN:socket is already connected', +//'20:EMFILE:too many open files', +//'21:EMSGSIZE:message too long', +//'22:ENETDOWN:network is down', +//'23:ENETUNREACH:network is unreachable', +//'24:ENFILE:file table overflow', +//'25:ENOBUFS:no buffer space available', +//'26:ENOMEM:not enough memory', +'27:ENOTDIR:not a directory', '28:EISDIR:illegal operation on a directory', +//'29:ENONET:machine is not on the network', +// errno 30 skipped, as per https://github.com/rvagg/node-errno/blob/master/errno.js +//'31:ENOTCONN:socket is not connected', +//'32:ENOTSOCK:socket operation on non-socket', +//'33:ENOTSUP:operation not supported on socket', +'34:ENOENT:no such file or directory', +//'35:ENOSYS:function not implemented', +//'36:EPIPE:broken pipe', +//'37:EPROTO:protocol error', +//'38:EPROTONOSUPPORT:protocol not supported', +//'39:EPROTOTYPE:protocol wrong type for socket', +//'40:ETIMEDOUT:connection timed out', +//'41:ECHARSET:invalid Unicode character', +//'42:EAIFAMNOSUPPORT:address family for hostname not supported', +// errno 43 skipped, as per https://github.com/rvagg/node-errno/blob/master/errno.js +//'44:EAISERVICE:servname not supported for ai_socktype', +//'45:EAISOCKTYPE:ai_socktype not supported', +//'46:ESHUTDOWN:cannot send after transport endpoint shutdown', +'47:EEXIST:file already exists', +//'48:ESRCH:no such process', +//'49:ENAMETOOLONG:name too long', +'50:EPERM:operation not permitted', '51:ELOOP:too many symbolic links encountered', +//'52:EXDEV:cross-device link not permitted', +'53:ENOTEMPTY:directory not empty', +//'54:ENOSPC:no space left on device', +'55:EIO:i/o error', +//'56:EROFS:read-only file system', +//'57:ENODEV:no such device', +//'58:ESPIPE:invalid seek', +//'59:ECANCELED:operation canceled', + +/** + * Filer specific errors + */ +'1000:ENOTMOUNTED:not mounted', '1001:EFILESYSTEMERROR:missing super node, use \'FORMAT\' flag to format filesystem.', '1002:ENOATTR:attribute does not exist'].forEach(function (e) { + e = e.split(':'); + var errno = +e[0]; + var errName = e[1]; + var defaultMessage = e[2]; + + function FilerError(msg, path) { + Error.call(this); + + this.name = errName; + this.code = errName; + this.errno = errno; + this.message = msg || defaultMessage; + if (path) { + this.path = path; + } + this.stack = new Error(this.message).stack; + } + FilerError.prototype = Object.create(Error.prototype); + FilerError.prototype.constructor = FilerError; + FilerError.prototype.toString = function () { + var pathInfo = this.path ? ', \'' + this.path + '\'' : ''; + return this.name + ': ' + this.message + pathInfo; + }; + + // We expose the error as both Errors.EINVAL and Errors[18] + errors[errName] = errors[errno] = FilerError; +}); + +module.exports = errors; +},{}],"U+mA":[function(require,module,exports) { /* * base64-arraybuffer * https://github.com/niklasvh/base64-arraybuffer @@ -3002,7 +3085,7 @@ module.exports = IndexedDB; return arraybuffer; }; })(); -},{}],"hW+K":[function(require,module,exports) { +},{}],"uv02":[function(require,module,exports) { var global = arguments[3]; var FILE_SYSTEM_NAME = require('../constants.js').FILE_SYSTEM_NAME; var FILE_STORE_NAME = require('../constants.js').FILE_STORE_NAME; @@ -3032,11 +3115,11 @@ WebSQLContext.prototype.clear = function (callback) { function onError(transaction, error) { callback(error); } - function onSuccess(transaction, result) { + function onSuccess() { callback(null); } this.getTransaction(function (transaction) { - transaction.executeSql("DELETE FROM " + FILE_STORE_NAME + ";", [], onSuccess, onError); + transaction.executeSql('DELETE FROM ' + FILE_STORE_NAME + ';', [], onSuccess, onError); }); }; @@ -3050,7 +3133,7 @@ function _get(getTransaction, key, callback) { callback(error); } getTransaction(function (transaction) { - transaction.executeSql("SELECT data FROM " + FILE_STORE_NAME + " WHERE id = ? LIMIT 1;", [key], onSuccess, onError); + transaction.executeSql('SELECT data FROM ' + FILE_STORE_NAME + ' WHERE id = ? LIMIT 1;', [key], onSuccess, onError); }); } WebSQLContext.prototype.getObject = function (key, callback) { @@ -3087,14 +3170,14 @@ WebSQLContext.prototype.getBuffer = function (key, callback) { }; function _put(getTransaction, key, value, callback) { - function onSuccess(transaction, result) { + function onSuccess() { callback(null); } function onError(transaction, error) { callback(error); } getTransaction(function (transaction) { - transaction.executeSql("INSERT OR REPLACE INTO " + FILE_STORE_NAME + " (id, data) VALUES (?, ?);", [key, value], onSuccess, onError); + transaction.executeSql('INSERT OR REPLACE INTO ' + FILE_STORE_NAME + ' (id, data) VALUES (?, ?);', [key, value], onSuccess, onError); }); } WebSQLContext.prototype.putObject = function (key, value, callback) { @@ -3107,14 +3190,14 @@ WebSQLContext.prototype.putBuffer = function (key, uint8BackedBuffer, callback) }; WebSQLContext.prototype.delete = function (key, callback) { - function onSuccess(transaction, result) { + function onSuccess() { callback(null); } function onError(transaction, error) { callback(error); } this.getTransaction(function (transaction) { - transaction.executeSql("DELETE FROM " + FILE_STORE_NAME + " WHERE id = ?;", [key], onSuccess, onError); + transaction.executeSql('DELETE FROM ' + FILE_STORE_NAME + ' WHERE id = ?;', [key], onSuccess, onError); }); }; @@ -3136,7 +3219,7 @@ WebSQL.prototype.open = function (callback) { var db = global.openDatabase(that.name, WSQL_VERSION, WSQL_DESC, WSQL_SIZE); if (!db) { - callback("[WebSQL] Unable to open database."); + callback('[WebSQL] Unable to open database.'); return; } @@ -3146,7 +3229,7 @@ WebSQL.prototype.open = function (callback) { } callback(error); } - function onSuccess(transaction, result) { + function onSuccess() { that.db = db; callback(); } @@ -3154,9 +3237,9 @@ WebSQL.prototype.open = function (callback) { // Create the table and index we'll need to store the fs data. db.transaction(function (transaction) { function createIndex(transaction) { - transaction.executeSql("CREATE INDEX IF NOT EXISTS idx_" + FILE_STORE_NAME + "_id" + " on " + FILE_STORE_NAME + " (id);", [], onSuccess, onError); + transaction.executeSql('CREATE INDEX IF NOT EXISTS idx_' + FILE_STORE_NAME + '_id' + ' on ' + FILE_STORE_NAME + ' (id);', [], onSuccess, onError); } - transaction.executeSql("CREATE TABLE IF NOT EXISTS " + FILE_STORE_NAME + " (id unique, data TEXT);", [], createIndex, onError); + transaction.executeSql('CREATE TABLE IF NOT EXISTS ' + FILE_STORE_NAME + ' (id unique, data TEXT);', [], createIndex, onError); }); }; WebSQL.prototype.getReadOnlyContext = function () { @@ -3167,7 +3250,7 @@ WebSQL.prototype.getReadWriteContext = function () { }; module.exports = WebSQL; -},{"../constants.js":"iJA9","../errors.js":"p8GN","../buffer.js":"xfwq","base64-arraybuffer":"vLJO"}],"pBGv":[function(require,module,exports) { +},{"../constants.js":"iJA9","../errors.js":"p8GN","../buffer.js":"xfwq","base64-arraybuffer":"U+mA"}],"qC85":[function(require,module,exports) { // shim for using process in browser var process = module.exports = {}; @@ -3354,7 +3437,7 @@ process.chdir = function (dir) { process.umask = function () { return 0; }; -},{}],"u4Zs":[function(require,module,exports) { +},{}],"AV2T":[function(require,module,exports) { var process = require("process"); var define; /*global setImmediate: false, setTimeout: false, console: false */ @@ -3436,7 +3519,7 @@ var define; root.async = async; } })(); -},{"process":"pBGv"}],"3OWy":[function(require,module,exports) { +},{"process":"qC85"}],"cQUl":[function(require,module,exports) { var FILE_SYSTEM_NAME = require('../constants.js').FILE_SYSTEM_NAME; // NOTE: prefer setImmediate to nextTick for proper recursion yielding. // see https://github.com/js-platform/filer/pull/24 @@ -3463,7 +3546,7 @@ function MemoryContext(db, readOnly) { MemoryContext.prototype.clear = function (callback) { if (this.readOnly) { asyncCallback(function () { - callback("[MemoryContext] Error: write operation on read only context"); + callback('[MemoryContext] Error: write operation on read only context'); }); return; } @@ -3484,7 +3567,7 @@ MemoryContext.prototype.getObject = MemoryContext.prototype.getBuffer = function MemoryContext.prototype.putObject = MemoryContext.prototype.putBuffer = function (key, value, callback) { if (this.readOnly) { asyncCallback(function () { - callback("[MemoryContext] Error: write operation on read only context"); + callback('[MemoryContext] Error: write operation on read only context'); }); return; } @@ -3495,7 +3578,7 @@ MemoryContext.prototype.putObject = MemoryContext.prototype.putBuffer = function MemoryContext.prototype.delete = function (key, callback) { if (this.readOnly) { asyncCallback(function () { - callback("[MemoryContext] Error: write operation on read only context"); + callback('[MemoryContext] Error: write operation on read only context'); }); return; } @@ -3522,7 +3605,7 @@ Memory.prototype.getReadWriteContext = function () { }; module.exports = Memory; -},{"../constants.js":"iJA9","../../lib/async.js":"u4Zs"}],"AiW7":[function(require,module,exports) { +},{"../constants.js":"iJA9","../../lib/async.js":"AV2T"}],"RzzZ":[function(require,module,exports) { var IndexedDB = require('./indexeddb.js'); var WebSQL = require('./websql.js'); var Memory = require('./memory.js'); @@ -3550,7 +3633,7 @@ module.exports = { } function NotSupported() { - throw "[Filer Error] Your browser doesn't support IndexedDB or WebSQL."; + throw '[Filer Error] Your browser doesn\'t support IndexedDB or WebSQL.'; } NotSupported.isSupported = function () { return false; @@ -3558,7 +3641,7 @@ module.exports = { return NotSupported; }() }; -},{"./indexeddb.js":"QO4x","./websql.js":"hW+K","./memory.js":"3OWy"}],"QMiB":[function(require,module,exports) { +},{"./indexeddb.js":"SvVb","./websql.js":"uv02","./memory.js":"cQUl"}],"KPj6":[function(require,module,exports) { var defaults = require('../constants.js').ENVIRONMENT; module.exports = function Environment(env) { @@ -3574,22 +3657,7 @@ module.exports = function Environment(env) { env[name] = value; }; }; -},{"../constants.js":"iJA9"}],"03yF":[function(require,module,exports) { -var Buffer = require("buffer").Buffer; -// Adapt encodings to work with Buffer or Uint8Array, they expect the latter -function decode(buf) { - return buf.toString('utf8'); -} - -function encode(string) { - return new Buffer(string, 'utf8'); -} - -module.exports = { - encode: encode, - decode: decode -}; -},{"buffer":"dskh"}],"UUq2":[function(require,module,exports) { +},{"../constants.js":"iJA9"}],"oS47":[function(require,module,exports) { var process = require("process"); // Copyright Joyent, Inc. and other Node contributors. // @@ -3816,7 +3884,7 @@ var substr = 'ab'.substr(-1) === 'b' } ; -},{"process":"pBGv"}],"bQx9":[function(require,module,exports) { +},{"process":"qC85"}],"Oe3x":[function(require,module,exports) { module.exports = function (xs, fn) { var res = []; for (var i = 0; i < xs.length; i++) { @@ -3831,7 +3899,7 @@ var isArray = Array.isArray || function (xs) { return Object.prototype.toString.call(xs) === '[object Array]'; }; -},{}],"6D9y":[function(require,module,exports) { +},{}],"tPCG":[function(require,module,exports) { 'use strict'; module.exports = balanced; function balanced(a, b, str) { @@ -3892,7 +3960,7 @@ function range(a, b, str) { return result; } -},{}],"dwX/":[function(require,module,exports) { +},{}],"PuLq":[function(require,module,exports) { var concatMap = require('concat-map'); var balanced = require('balanced-match'); @@ -4095,7 +4163,7 @@ function expand(str, isTop) { } -},{"concat-map":"bQx9","balanced-match":"6D9y"}],"Nt/K":[function(require,module,exports) { +},{"concat-map":"Oe3x","balanced-match":"tPCG"}],"Dd0T":[function(require,module,exports) { module.exports = minimatch minimatch.Minimatch = Minimatch @@ -5020,15 +5088,19 @@ function regExpEscape (s) { return s.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, '\\$&') } -},{"path":"UUq2","brace-expansion":"dwX/"}],"D1Ra":[function(require,module,exports) { +},{"path":"oS47","brace-expansion":"PuLq"}],"/TiA":[function(require,module,exports) { +var _require = require('es6-promisify'), + promisify = _require.promisify; + var Path = require('../path.js'); var Errors = require('../errors.js'); var Environment = require('./environment.js'); var async = require('../../lib/async.js'); -var Encoding = require('../encoding.js'); var minimatch = require('minimatch'); function Shell(fs, options) { + var _this = this; + options = options || {}; var env = new Environment(options.env); @@ -5084,6 +5156,14 @@ function Shell(fs, options) { this.pwd = function () { return cwd; }; + + this.promises = {}; + /** + * Public API for Shell converted to Promise based + */ + ['cd', 'exec', 'touch', 'cat', 'ls', 'rm', 'tempDir', 'mkdirp', 'find'].forEach(function (methodName) { + _this.promises[methodName] = promisify(_this[methodName].bind(_this)); + }); } /** @@ -5114,7 +5194,7 @@ Shell.prototype.exec = function (path, args, callback) { callback = callback || function () {}; path = Path.resolve(sh.pwd(), path); - fs.readFile(path, "utf8", function (error, data) { + fs.readFile(path, 'utf8', function (error, data) { if (error) { callback(error); return; @@ -5158,7 +5238,7 @@ Shell.prototype.touch = function (path, options, callback) { fs.utimes(path, atime, mtime, callback); } - fs.stat(path, function (error, stats) { + fs.stat(path, function (error) { if (error) { if (options.updateOnly === true) { callback(); @@ -5375,7 +5455,7 @@ Shell.prototype.tempDir = function (callback) { // Try and create it, and it will either work or fail // but either way it's now there. - fs.mkdir(tmp, function (err) { + fs.mkdir(tmp, function () { callback(null, tmp); }); }; @@ -5562,7 +5642,7 @@ Shell.prototype.find = function (path, options, callback) { }; module.exports = Shell; -},{"../path.js":"UzoP","../errors.js":"p8GN","./environment.js":"QMiB","../../lib/async.js":"u4Zs","../encoding.js":"03yF","minimatch":"Nt/K"}],"J4Qg":[function(require,module,exports) { +},{"es6-promisify":"dRwD","../path.js":"UzoP","../errors.js":"p8GN","./environment.js":"KPj6","../../lib/async.js":"AV2T","minimatch":"Dd0T"}],"eWWT":[function(require,module,exports) { // Based on https://github.com/diy/intercom.js/blob/master/lib/events.js // Copyright 2012 DIY Co Apache License, Version 2.0 // http://www.apache.org/licenses/LICENSE-2.0 @@ -5634,7 +5714,7 @@ EventEmitter.prototype.trigger = pub.trigger; EventEmitter.prototype.removeAllListeners = pub.removeAllListeners; module.exports = EventEmitter; -},{}],"u7Jv":[function(require,module,exports) { +},{}],"cyyu":[function(require,module,exports) { var global = arguments[3]; var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; @@ -5957,7 +6037,7 @@ Intercom.getInstance = function () { }(); module.exports = Intercom; -},{"./eventemitter.js":"J4Qg","../src/shared.js":"3zBM"}],"VLEe":[function(require,module,exports) { +},{"./eventemitter.js":"eWWT","../src/shared.js":"3zBM"}],"VLEe":[function(require,module,exports) { var EventEmitter = require('../lib/eventemitter.js'); var Path = require('./path.js'); var Intercom = require('../lib/intercom.js'); @@ -6020,7 +6100,22 @@ FSWatcher.prototype = new EventEmitter(); FSWatcher.prototype.constructor = FSWatcher; module.exports = FSWatcher; -},{"../lib/eventemitter.js":"J4Qg","./path.js":"UzoP","../lib/intercom.js":"u7Jv"}],"ZECt":[function(require,module,exports) { +},{"../lib/eventemitter.js":"eWWT","./path.js":"UzoP","../lib/intercom.js":"cyyu"}],"03yF":[function(require,module,exports) { +var Buffer = require("buffer").Buffer; +// Adapt encodings to work with Buffer or Uint8Array, they expect the latter +function decode(buf) { + return buf.toString('utf8'); +} + +function encode(string) { + return new Buffer(string, 'utf8'); +} + +module.exports = { + encode: encode, + decode: decode +}; +},{"buffer":"D+m+"}],"ZECt":[function(require,module,exports) { var NODE_TYPE_FILE = require('./constants.js').NODE_TYPE_FILE; module.exports = function DirectoryEntry(id, type) { @@ -6090,9 +6185,6 @@ module.exports = SuperNode; var NODE_TYPE_FILE = require('./constants.js').NODE_TYPE_FILE; var NODE_TYPE_DIRECTORY = require('./constants.js').NODE_TYPE_DIRECTORY; var NODE_TYPE_SYMBOLIC_LINK = require('./constants.js').NODE_TYPE_SYMBOLIC_LINK; -var NODE_TYPE_META = require('./constants.js').NODE_TYPE_META; - -var ROOT_DIRECTORY_NAME = require('./constants.js').ROOT_DIRECTORY_NAME; var S_IFREG = require('./constants.js').S_IFREG; var S_IFDIR = require('./constants.js').S_IFDIR; @@ -6212,7 +6304,7 @@ Stats.prototype.isSocket = Stats.prototype.isFIFO = Stats.prototype.isCharacterD }; module.exports = Stats; -},{"./constants.js":"iJA9","./path.js":"UzoP"}],"bsBG":[function(require,module,exports) { +},{"./constants.js":"iJA9","./path.js":"UzoP"}],"ctIo":[function(require,module,exports) { var _ = require('../../lib/nodash.js'); @@ -6229,8 +6321,6 @@ var NODE_TYPE_DIRECTORY = Constants.NODE_TYPE_DIRECTORY; var NODE_TYPE_SYMBOLIC_LINK = Constants.NODE_TYPE_SYMBOLIC_LINK; var NODE_TYPE_META = Constants.NODE_TYPE_META; -var DEFAULT_FILE_PERMISSIONS = Constants.DEFAULT_FILE_PERMISSIONS; -var DEFAULT_DIR_PERMISSIONS = Constants.DEFAULT_DIR_PERMISSIONS; var FULL_READ_WRITE_EXEC_PERMISSIONS = Constants.FULL_READ_WRITE_EXEC_PERMISSIONS; var ROOT_DIRECTORY_NAME = Constants.ROOT_DIRECTORY_NAME; @@ -6241,7 +6331,6 @@ var O_READ = Constants.O_READ; var O_WRITE = Constants.O_WRITE; var O_CREATE = Constants.O_CREATE; var O_EXCLUSIVE = Constants.O_EXCLUSIVE; -var O_TRUNCATE = Constants.O_TRUNCATE; var O_APPEND = Constants.O_APPEND; var O_FLAGS = Constants.O_FLAGS; @@ -7056,7 +7145,6 @@ function read_data(context, ofd, buffer, offset, length, position, callback) { function stat_file(context, path, callback) { path = normalize(path); - var name = basename(path); find_node(context, path, callback); } @@ -7136,7 +7224,7 @@ function link_node(context, oldpath, newpath, callback) { } } - function read_file_node(error, result) { + function read_file_node(error) { if (error) { callback(error); } else { @@ -7210,8 +7298,12 @@ function unlink_node(context, path, callback) { } else { delete directoryData[name]; context.putObject(directoryNode.data, directoryData, function (error) { - var now = Date.now(); - update_node_times(context, parentPath, directoryNode, { mtime: now, ctime: now }, callback); + if (error) { + callback(error); + } else { + var now = Date.now(); + update_node_times(context, parentPath, directoryNode, { mtime: now, ctime: now }, callback); + } }); } } @@ -7234,7 +7326,11 @@ function unlink_node(context, path, callback) { context.delete(fileNode.id, delete_file_data); } else { context.putObject(fileNode.id, fileNode, function (error) { - update_node_times(context, path, fileNode, { ctime: Date.now() }, update_directory_data); + if (error) { + callback(error); + } else { + update_node_times(context, path, fileNode, { ctime: Date.now() }, update_directory_data); + } }); } } @@ -7277,7 +7373,6 @@ function unlink_node(context, path, callback) { function read_directory(context, path, callback) { path = normalize(path); - var name = basename(path); var directoryNode; var directoryData; @@ -7761,9 +7856,9 @@ function validate_flags(flags) { function validate_file_options(options, enc, fileMode) { if (!options) { options = { encoding: enc, flag: fileMode }; - } else if (typeof options === "function") { + } else if (typeof options === 'function') { options = { encoding: enc, flag: fileMode }; - } else if (typeof options === "string") { + } else if (typeof options === 'string') { options = { encoding: options, flag: fileMode }; } return options; @@ -7972,7 +8067,7 @@ function readFile(fs, context, path, options, callback) { var buffer = new Buffer(size); buffer.fill(0); - read_data(context, ofd, buffer, 0, size, 0, function (err, nbytes) { + read_data(context, ofd, buffer, 0, size, 0, function (err) { cleanup(); if (err) { @@ -8020,10 +8115,10 @@ function writeFile(fs, context, path, data, options, callback) { } data = data || ''; - if (typeof data === "number") { + if (typeof data === 'number') { data = '' + data; } - if (typeof data === "string" && options.encoding === 'utf8') { + if (typeof data === 'string' && options.encoding === 'utf8') { data = Encoding.encode(data); } @@ -8034,7 +8129,7 @@ function writeFile(fs, context, path, data, options, callback) { var ofd = new OpenFileDescription(path, fileNode.id, flags, 0); var fd = fs.allocDescriptor(ofd); - replace_data(context, ofd, data, 0, data.length, function (err, nbytes) { + replace_data(context, ofd, data, 0, data.length, function (err) { fs.releaseDescriptor(fd); if (err) { @@ -8057,10 +8152,10 @@ function appendFile(fs, context, path, data, options, callback) { } data = data || ''; - if (typeof data === "number") { + if (typeof data === 'number') { data = '' + data; } - if (typeof data === "string" && options.encoding === 'utf8') { + if (typeof data === 'string' && options.encoding === 'utf8') { data = Encoding.encode(data); } @@ -8071,7 +8166,7 @@ function appendFile(fs, context, path, data, options, callback) { var ofd = new OpenFileDescription(path, fileNode.id, flags, fileNode.size); var fd = fs.allocDescriptor(ofd); - write_data(context, ofd, data, 0, data.length, ofd.position, function (err, nbytes) { + write_data(context, ofd, data, 0, data.length, ofd.position, function (err) { fs.releaseDescriptor(fd); if (err) { @@ -8083,15 +8178,15 @@ function appendFile(fs, context, path, data, options, callback) { } function exists(fs, context, path, callback) { - function cb(err, stats) { + function cb(err) { callback(err ? false : true); } + console.warn('This method is deprecated. For more details see https://nodejs.org/api/fs.html#fs_fs_exists_path_callback'); // eslint-disable-line no-console stat(fs, context, path, cb); } // Based on https://github.com/nodejs/node/blob/c700cc42da9cf73af9fec2098520a6c0a631d901/lib/internal/validators.js#L21 var octalReg = /^[0-7]+$/; -var modeDesc = 'must be a 32-bit unsigned integer or an octal string'; function isUint32(value) { return value === value >>> 0; } @@ -8590,9 +8685,12 @@ module.exports = { truncate: truncate, ftruncate: ftruncate }; -},{"../../lib/nodash.js":"96cB","../path.js":"UzoP","../constants.js":"iJA9","../encoding.js":"03yF","../errors.js":"p8GN","../directory-entry.js":"ZECt","../open-file-description.js":"XWaV","../super-node.js":"33JE","../node.js":"KKNo","../stats.js":"6dsC","../buffer.js":"xfwq"}],"GMi4":[function(require,module,exports) { +},{"../../lib/nodash.js":"rwRH","../path.js":"UzoP","../constants.js":"iJA9","../encoding.js":"03yF","../errors.js":"p8GN","../directory-entry.js":"ZECt","../open-file-description.js":"XWaV","../super-node.js":"33JE","../node.js":"KKNo","../stats.js":"6dsC","../buffer.js":"xfwq"}],"aWta":[function(require,module,exports) { var _ = require('../../lib/nodash.js'); +var _require = require('es6-promisify'), + promisify = _require.promisify; + var isNullPath = require('../path.js').isNull; var nop = require('../shared.js').nop; @@ -8622,7 +8720,7 @@ var impl = require('./implementation.js'); // node.js supports a calling pattern that leaves off a callback. function maybeCallback(callback) { - if (typeof callback === "function") { + if (typeof callback === 'function') { return callback; } return function (err) { @@ -8635,6 +8733,7 @@ function maybeCallback(callback) { // Default callback that logs an error if passed in function defaultCallback(err) { if (err) { + /* eslint no-console: 0 */ console.error('Filer error: ', err); } } @@ -8697,7 +8796,7 @@ function FileSystem(options, callback) { // descriptor management functions var openFiles = {}; var nextDescriptor = FIRST_DESCRIPTOR; - Object.defineProperty(this, "openFiles", { + Object.defineProperty(this, 'openFiles', { get: function get() { return openFiles; } @@ -8856,62 +8955,64 @@ function FileSystem(options, callback) { impl.ensureRootDirectory(context, complete); } }); + FileSystem.prototype.promises = {}; + /** + * Public API for FileSystem + */ + ['open', 'chmod', 'fchmod', 'chown', 'fchown', '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 (methodName) { + FileSystem.prototype[methodName] = function () { + var fs = this; + var args = Array.prototype.slice.call(arguments, 0); + var lastArgIndex = args.length - 1; + + // We may or may not get a callback, and since node.js supports + // fire-and-forget style fs operations, we have to dance a bit here. + var missingCallback = typeof args[lastArgIndex] !== 'function'; + var callback = maybeCallback(args[lastArgIndex]); + + var error = fs.queueOrRun(function () { + var context = fs.provider.openReadWriteContext(); + + // Fail early if the filesystem is in an error state (e.g., + // provider failed to open. + if (FS_ERROR === fs.readyState) { + var err = new Errors.EFILESYSTEMERROR('filesystem unavailable, operation canceled'); + return callback.call(fs, err); + } + + // Wrap the callback so we can explicitly close the context + function complete() { + context.close(); + callback.apply(fs, arguments); + } + + // Either add or replace the callback with our wrapper complete() + if (missingCallback) { + args.push(complete); + } else { + args[lastArgIndex] = complete; + } + + // Forward this call to the impl's version, using the following + // call signature, with complete() as the callback/last-arg now: + // fn(fs, context, arg0, arg1, ... , complete); + var fnArgs = [fs, context].concat(args); + impl[methodName].apply(null, fnArgs); + }); + if (error) { + callback(error); + } + }; + + FileSystem.prototype.promises[methodName] = promisify(FileSystem.prototype[methodName].bind(fs)); + }); } // Expose storage providers on FileSystem constructor FileSystem.providers = providers; -/** - * Public API for FileSystem - */ -['open', 'chmod', 'fchmod', 'chown', 'fchown', '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 (methodName) { - FileSystem.prototype[methodName] = function () { - var fs = this; - var args = Array.prototype.slice.call(arguments, 0); - var lastArgIndex = args.length - 1; - - // We may or may not get a callback, and since node.js supports - // fire-and-forget style fs operations, we have to dance a bit here. - var missingCallback = typeof args[lastArgIndex] !== 'function'; - var callback = maybeCallback(args[lastArgIndex]); - - var error = fs.queueOrRun(function () { - var context = fs.provider.openReadWriteContext(); - - // Fail early if the filesystem is in an error state (e.g., - // provider failed to open. - if (FS_ERROR === fs.readyState) { - var err = new Errors.EFILESYSTEMERROR('filesystem unavailable, operation canceled'); - return callback.call(fs, err); - } - - // Wrap the callback so we can explicitly close the context - function complete() { - context.close(); - callback.apply(fs, arguments); - } - - // Either add or replace the callback with our wrapper complete() - if (missingCallback) { - args.push(complete); - } else { - args[lastArgIndex] = complete; - } - - // Forward this call to the impl's version, using the following - // call signature, with complete() as the callback/last-arg now: - // fn(fs, context, arg0, arg1, ... , complete); - var fnArgs = [fs, context].concat(args); - impl[methodName].apply(null, fnArgs); - }); - if (error) { - callback(error); - } - }; -}); - module.exports = FileSystem; -},{"../../lib/nodash.js":"96cB","../path.js":"UzoP","../shared.js":"3zBM","../constants.js":"iJA9","../providers/index.js":"AiW7","../shell/shell.js":"D1Ra","../../lib/intercom.js":"u7Jv","../fs-watcher.js":"VLEe","../errors.js":"p8GN","./implementation.js":"bsBG"}],"Focm":[function(require,module,exports) { +},{"../../lib/nodash.js":"rwRH","es6-promisify":"dRwD","../path.js":"UzoP","../shared.js":"3zBM","../constants.js":"iJA9","../providers/index.js":"RzzZ","../shell/shell.js":"/TiA","../../lib/intercom.js":"cyyu","../fs-watcher.js":"VLEe","../errors.js":"p8GN","./implementation.js":"ctIo"}],"Focm":[function(require,module,exports) { module.exports = { FileSystem: require('./filesystem/interface.js'), Buffer: require('./buffer.js'), @@ -8919,5 +9020,5 @@ module.exports = { Errors: require('./errors.js'), Shell: require('./shell/shell.js') }; -},{"./filesystem/interface.js":"GMi4","./buffer.js":"xfwq","./path.js":"UzoP","./errors.js":"p8GN","./shell/shell.js":"D1Ra"}]},{},["Focm"], "Filer") +},{"./filesystem/interface.js":"aWta","./buffer.js":"xfwq","./path.js":"UzoP","./errors.js":"p8GN","./shell/shell.js":"/TiA"}]},{},["Focm"], "Filer") //# sourceMappingURL=/filer.map \ No newline at end of file diff --git a/dist/filer.map b/dist/filer.map index 857d4ff..9bb0952 100644 --- a/dist/filer.map +++ b/dist/filer.map @@ -1 +1 @@ -{"version":3,"sources":["../lib/nodash.js","path.js","shared.js","constants.js","errors.js","../node_modules/base64-js/index.js","../node_modules/ieee754/index.js","../node_modules/isarray/index.js","../node_modules/buffer/index.js","buffer.js","providers/indexeddb.js","../node_modules/base64-arraybuffer/lib/base64-arraybuffer.js","providers/websql.js","../node_modules/process/browser.js","../lib/async.js","providers/memory.js","providers/index.js","shell/environment.js","encoding.js","../node_modules/path-browserify/index.js","../node_modules/concat-map/index.js","../node_modules/balanced-match/index.js","../node_modules/brace-expansion/index.js","../node_modules/minimatch/minimatch.js","shell/shell.js","../lib/eventemitter.js","../lib/intercom.js","fs-watcher.js","directory-entry.js","open-file-description.js","super-node.js","node.js","stats.js","filesystem/implementation.js","filesystem/interface.js","index.js"],"names":["ArrayProto","Array","prototype","nativeForEach","forEach","nativeIndexOf","indexOf","nativeSome","some","ObjProto","Object","hasOwnProperty","nativeKeys","keys","breaker","has","obj","key","call","TypeError","push","size","length","identity","value","each","iterator","context","i","any","result","index","list","contains","target","Wrapped","nodash","isArray","module","exports","normalizeArray","parts","allowAboveRoot","up","last","splice","unshift","splitPathRe","splitPath","filename","exec","resolve","resolvedPath","resolvedAbsolute","arguments","path","charAt","split","filter","p","join","normalize","isAbsolute","trailingSlash","substr","paths","slice","relative","from","to","trim","arr","start","end","fromParts","toParts","Math","min","samePartsLength","outputParts","concat","dirname","root","dir","basename","ext","f","extname","isNull","addTrailing","replace","removeTrailing","sep","delimiter","guid","c","r","random","v","toString","toUpperCase","nop","u8toArray","u8","array","len","O_READ","O_WRITE","O_CREATE","O_EXCLUSIVE","O_TRUNCATE","O_APPEND","XATTR_CREATE","XATTR_REPLACE","FILE_SYSTEM_NAME","FILE_STORE_NAME","IDB_RO","IDB_RW","WSQL_VERSION","WSQL_SIZE","WSQL_DESC","NODE_TYPE_FILE","NODE_TYPE_DIRECTORY","NODE_TYPE_SYMBOLIC_LINK","NODE_TYPE_META","S_IFREG","S_IFDIR","S_IFLNK","DEFAULT_DIR_PERMISSIONS","DEFAULT_FILE_PERMISSIONS","FULL_READ_WRITE_EXEC_PERMISSIONS","READ_WRITE_PERMISSIONS","SYMLOOP_MAX","BINARY_MIME_TYPE","JSON_MIME_TYPE","ROOT_DIRECTORY_NAME","FS_FORMAT","FS_NOCTIME","FS_NOMTIME","FS_NODUPEIDCHECK","O_FLAGS","FS_READY","FS_PENDING","FS_ERROR","SUPER_NODE_ID","STDIN","STDOUT","STDERR","FIRST_DESCRIPTOR","ENVIRONMENT","TMP","PATH","fsConstants","O_RDONLY","O_WRONLY","O_RDWR","S_IFMT","S_IFCHR","S_IFBLK","S_IFIFO","S_IFSOCK","O_CREAT","O_EXCL","O_NOCTTY","O_TRUNC","O_DIRECTORY","O_NOFOLLOW","O_SYNC","O_DSYNC","O_SYMLINK","O_NONBLOCK","S_IRWXU","S_IRUSR","S_IWUSR","S_IXUSR","S_IRWXG","S_IRGRP","S_IWGRP","S_IXGRP","S_IRWXO","S_IROTH","S_IWOTH","S_IXOTH","F_OK","R_OK","W_OK","X_OK","UV_FS_COPYFILE_EXCL","COPYFILE_EXCL","errors","e","errno","errName","defaultMessage","FilerError","msg","Error","name","code","message","stack","create","constructor","pathInfo","FilerBuffer","subject","encoding","nonZero","ArrayBuffer","Uint8Array","Buffer","require","Errors","indexedDB","global","mozIndexedDB","webkitIndexedDB","msIndexedDB","IndexedDBContext","db","mode","_getObjectStore","objectStore","transaction","clear","callback","request","onsuccess","onerror","event","preventDefault","error","err","_get","get","getObject","getBuffer","arrayBuffer","_put","put","putObject","putBuffer","uint8BackedBuffer","buf","buffer","delete","IndexedDB","isSupported","open","that","openRequest","onupgradeneeded","objectStoreNames","deleteObjectStore","createObjectStore","getReadOnlyContext","getReadWriteContext","chars","lookup","charCodeAt","encode","arraybuffer","bytes","base64","substring","decode","bufferLength","encoded1","encoded2","encoded3","encoded4","base64ArrayBuffer","WebSQLContext","isReadOnly","getTransaction","onError","onSuccess","executeSql","rows","item","data","JSON","parse","json","stringify","WebSQL","openDatabase","EINVAL","createIndex","process","cachedSetTimeout","cachedClearTimeout","defaultSetTimout","defaultClearTimeout","setTimeout","clearTimeout","runTimeout","fun","runClearTimeout","marker","queue","draining","currentQueue","queueIndex","cleanUpNextTick","drainQueue","timeout","run","nextTick","args","Item","apply","title","browser","env","argv","version","versions","noop","on","addListener","once","off","removeListener","removeAllListeners","emit","prependListener","prependOnceListener","listeners","binding","cwd","chdir","umask","async","setImmediate","fn","eachSeries","completed","iterate","forEachSeries","define","amd","asyncCallback","createDB","pool","getOrCreate","MemoryContext","readOnly","Memory","Default","Fallback","NotSupported","defaults","Environment","set","string","Path","Encoding","minimatch","Shell","fs","options","defineProperty","enumerable","cd","stat","stats","ENOTDIR","type","pwd","sh","readFile","cmd","Function","touch","createFile","writeFile","updateTimes","now","Date","atime","date","mtime","utimes","updateOnly","cat","files","all","append","ls","pathname","readdir","entries","getDirEntry","entry","recursive","items","contents","rm","remove","unlink","rmdir","ENOTEMPTY","map","tempDir","tmp","mkdir","mkdirp","_mkdirp","isDirectory","isFile","parent","find","next","found","processPath","maybeProcessPath","rawPath","regex","test","walk","removeItem","EventEmitter","createInterface","space","methods","trigger","self","pvt","_on","_off","_trigger","pub","throttle","delay","extend","a","b","localStorage","window","getItem","setItem","Intercom","origin","lastMessage","receivedIDs","previousValues","storageHandler","_onStorageEvent","document","attachEvent","addEventListener","_transaction","TIMEOUT","WAIT","executed","listening","waitTimer","lock","activeLock","INDEX_LOCK","unlock","_cleanup_emit","threshold","THRESHOLD_TTL_EMIT","changed","messages","INDEX_EMIT","timestamp","_cleanup_once","ttl","table","INDEX_ONCE","_once_expired","THRESHOLD_TTL_ONCE","_localStorageChanged","field","currentValue","id","payload","_emit","String","packet","supported","destroy","getInstance","intercom","FSWatcher","recursivePathPrefix","onchange","filename_","persistent_","recursive_","close","DirectoryEntry","OpenFileDescription","flags","position","getNode","check_if_node_exists","node","EBADF","Constants","SuperNode","ctime","rnode","getMode","Node","xattrs","nlinks","uid","gid","ensureID","prop","setMode","Stats","fileNode","devName","dev","isSymbolicLink","isSocket","isFIFO","isCharacterDevice","isBlockDevice","_","isAbsolutePath","isNullPath","update_node_times","times","update","complete","changes","make_node","parentPath","parentNode","parentNodeData","create_node_in_parent","parentDirectoryNode","find_node","EEXIST","ENOENT","create_node","update_parent_node_data","update_time","followedCount","read_root_directory_node","superNode","EFILESYSTEMERROR","check_root_directory_node","rootDirectoryNode","read_parent_directory_data","get_node_from_parent_directory_data","parentDirectoryData","nodeId","is_symbolic_link","ELOOP","follow_symbolic_link","set_extended_attribute","flag","ENOATTR","ensure_root_directory","directoryNode","directoryData","ensure_super_node","existingNode","write_directory_node","write_directory_data","make_directory","check_if_directory_exists","update_parent_directory_data","remove_directory","EBUSY","check_if_node_is_directory","check_if_directory_is_empty","remove_directory_entry_from_parent_directory_node","remove_directory_node","remove_directory_data","open_file","directoryEntry","fileData","EISDIR","set_file_node","read_directory_data","check_if_file_exists","check_if_symbolic_link","write_file_node","undefined","write_file_data","fill","update_directory_data","handle_update_result","replace_data","ofd","offset","return_nbytes","update_file_node","newData","copy","write_data","update_file_data","EIO","_position","newSize","max","read_file_data","read_data","handle_file_data","stat_file","fstat_file","lstat_file","link_node","oldpath","newpath","oldname","oldParentPath","newname","newParentPath","oldDirectoryNode","oldDirectoryData","newDirectoryNode","newDirectoryData","fileNodeID","read_file_node","check_if_new_file_exists","read_new_directory_data","check_if_old_file_exists","EPERM","read_old_directory_data","unlink_node","delete_file_data","read_directory","handle_directory_data","make_symbolic_link","srcpath","dstpath","symlink_relpath","read_link","check_if_symbolic","truncate_file","truncate_file_data","ftruncate_file","utimes_file","update_times","futimes_file","setxattr_file","setxattr","fsetxattr_file","getxattr_file","get_xattr","fgetxattr_file","removexattr_file","remove_xattr","fremovexattr_file","validate_flags","validate_file_options","enc","fileMode","pathCheck","allowRelative","check_result","openFileDescription","fd","allocDescriptor","openFiles","releaseDescriptor","mknod","validateAndMaskMode","fstat","link","read","wrapped_cb","bytesRead","cleanup","fstatResult","nbytes","write","appendFile","exists","cb","octalReg","modeDesc","isUint32","def","Number","isInteger","parsed","parseInt","chmod_file","update_mode","fchmod_file","chown_file","update_owner","fchown_file","getxattr","fgetxattr","fsetxattr","removexattr","fremovexattr","lseek","whence","update_descriptor_position","currentTime","futimes","chmod","fchmod","chown","fchown","rename","oldName","newName","oldParentDirectory","oldParentData","newParentDirectory","newParentData","read_new_directory","update_old_parent_directory_data","update_new_parent_directory_data","check_if_new_directory_exists","read_new_parent_directory_data","get_new_parent_directory","unlink_old_file","check_node_type","symlink","readlink","lstat","truncate","ftruncate","ensureRootDirectory","providers","defaultGuidFn","impl","maybeCallback","defaultCallback","console","FileSystem","provider","forceFormatting","readyState","stdin","stdout","stderr","constants","bind","nextDescriptor","queueOrRun","operation","runQueued","watch","listener","watcher","wrappedGuidFn","guidWithCheck","broadcastChanges","change","wrappedContext","methodName","openReadWriteContext","openReadOnlyContext","lastArgIndex","missingCallback","fnArgs"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;AAEA;;;;;;;AAOA,IAAIA,aAAaC,MAAMC,SAAvB;AACA,IAAIC,gBAAgBH,WAAWI,OAA/B;AACA,IAAIC,gBAAgBL,WAAWM,OAA/B;AACA,IAAIC,aAAaP,WAAWQ,IAA5B;;AAEA,IAAIC,WAAWC,OAAOR,SAAtB;AACA,IAAIS,iBAAiBF,SAASE,cAA9B;AACA,IAAIC,aAAaF,OAAOG,IAAxB;;AAEA,IAAIC,UAAU,EAAd;;AAEA,SAASC,GAAT,CAAaC,GAAb,EAAkBC,GAAlB,EAAuB;AACrB,SAAON,eAAeO,IAAf,CAAoBF,GAApB,EAAyBC,GAAzB,CAAP;AACD;;AAED,IAAIJ,OAAOD,cAAc,UAASI,GAAT,EAAc;AACrC,MAAIA,QAAQN,OAAOM,GAAP,CAAZ,EAAyB,MAAM,IAAIG,SAAJ,CAAc,gBAAd,CAAN;AACzB,MAAIN,OAAO,EAAX;AACA,OAAK,IAAII,GAAT,IAAgBD,GAAhB;AAAqB,QAAID,IAAIC,GAAJ,EAASC,GAAT,CAAJ,EAAmBJ,KAAKO,IAAL,CAAUH,GAAV;AAAxC,GACA,OAAOJ,IAAP;AACD,CALD;;AAOA,SAASQ,IAAT,CAAcL,GAAd,EAAmB;AACjB,MAAIA,OAAO,IAAX,EAAiB,OAA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C;AACD,GAHD;;AAKA;AACAd,SAAOG,OAAP,IAAkBH,OAAOE,KAAP,IAAgBG,UAAlC;AACD,CApGD;;AAsGA5J,OAAOC,OAAP,GAAiBsJ,MAAjB;;ACvGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACvJA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACpFA;AACA;AACA;AACA;AACA;AACA;;;;ACLA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA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GAAW,UAASrC,IAAT,EAAe;AACxB,WAAOqH,IAAIrH,IAAJ,CAAP;AACD,GAFD;;AAIA,OAAK6J,GAAL,GAAW,UAAS7J,IAAT,EAAe7K,KAAf,EAAsB;AAC/BkS,QAAIrH,IAAJ,IAAY7K,KAAZ;AACD,GAFD;AAGD,CAZD;;;ACFA;AACA,SAASiP,MAAT,CAAgBtB,GAAhB,EAAqB;AACnB,SAAOA,IAAIhJ,QAAJ,CAAa,MAAb,CAAP;AACD;;AAED,SAASiK,MAAT,CAAgB+F,MAAhB,EAAwB;AACtB,SAAO,IAAIjJ,MAAJ,CAAWiJ,MAAX,EAAmB,MAAnB,CAAP;AACD;;AAED7T,OAAOC,OAAP,GAAiB;AACf6N,UAAQA,MADO;AAEfK,UAAQA;AAFO,CAAjB;;;ACTA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AChOA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACbA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC3DA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACzMA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC35BA,IAAI2F,OAAOjJ,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V;AACA,eAAOlU,SAAS/M,IAAT,CAAcsV,EAAd,EAAkBhI,GAAlB,CAAP;AACD;;AAED;AACA,eAAS0S,QAAT,GAAoB;AAClBvf,gBAAQkd,KAAR;AACA5Q,iBAASsF,KAAT,CAAeiD,EAAf,EAAmBlT,SAAnB;AACD;;AAED;AACA,UAAGisB,eAAH,EAAoB;AAClBlc,aAAKjS,IAAL,CAAU8f,QAAV;AACD,OAFD,MAEO;AACL7N,aAAKic,YAAL,IAAqBpO,QAArB;AACD;;AAED;AACA;AACA;AACA,UAAIsO,SAAS,CAAChZ,EAAD,EAAK7U,OAAL,EAAcqD,MAAd,CAAqBqO,IAArB,CAAb;AACAqa,WAAKyB,UAAL,EAAiB5b,KAAjB,CAAuB,IAAvB,EAA6Bic,MAA7B;AACD,KA5BW,CAAZ;AA6BA,QAAGjhB,KAAH,EAAU;AACRN,eAASM,KAAT;AACD;AACF,GA1CD;AA2CD,CAhFD;;AAkFAjM,OAAOC,OAAP,GAAiBurB,UAAjB;;ACjWAxrB,OAAOC,OAAP,GAAiB;AACfurB,cAAY3gB,QAAQ,2BAAR,CADG;AAEfD,UAAQC,QAAQ,aAAR,CAFO;AAGfiJ,QAAMjJ,QAAQ,WAAR,CAHS;AAIfC,UAAQD,QAAQ,aAAR,CAJO;AAKfoJ,SAAOpJ,QAAQ,kBAAR;AALQ,CAAjB","file":"filer.map","sourceRoot":"../src","sourcesContent":["// Cherry-picked bits of underscore.js, lodash.js\n\n/**\n * Lo-Dash 2.4.0 \n * Copyright 2012-2013 The Dojo Foundation \n * Based on Underscore.js 1.5.2 \n * Copyright 2009-2013 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors\n * Available under MIT license \n */\nvar ArrayProto = Array.prototype;\nvar nativeForEach = ArrayProto.forEach;\nvar nativeIndexOf = ArrayProto.indexOf;\nvar nativeSome = ArrayProto.some;\n\nvar ObjProto = Object.prototype;\nvar hasOwnProperty = ObjProto.hasOwnProperty;\nvar nativeKeys = Object.keys;\n\nvar breaker = {};\n\nfunction has(obj, key) {\n return hasOwnProperty.call(obj, key);\n}\n\nvar keys = nativeKeys || function(obj) {\n if (obj !== Object(obj)) throw new TypeError('Invalid object');\n var keys = [];\n for (var key in obj) if (has(obj, key)) keys.push(key);\n return keys;\n};\n\nfunction size(obj) {\n if (obj == null) return 0;\n return (obj.length === +obj.length) ? obj.length : keys(obj).length;\n}\n\nfunction identity(value) {\n return value;\n}\n\nfunction each(obj, iterator, context) {\n var i, length;\n if (obj == null) return;\n if (nativeForEach && obj.forEach === nativeForEach) {\n obj.forEach(iterator, context);\n } else if (obj.length === +obj.length) {\n for (i = 0, length = obj.length; i < length; i++) {\n if (iterator.call(context, obj[i], i, obj) === breaker) return;\n }\n } else {\n var keys = keys(obj);\n for (i = 0, length = keys.length; i < length; i++) {\n if (iterator.call(context, obj[keys[i]], keys[i], obj) === breaker) return;\n }\n }\n};\n\nfunction any(obj, iterator, context) {\n iterator || (iterator = identity);\n var result = false;\n if (obj == null) return result;\n if (nativeSome && obj.some === nativeSome) return obj.some(iterator, context);\n each(obj, function(value, index, list) {\n if (result || (result = iterator.call(context, value, index, list))) return breaker;\n });\n return !!result;\n};\n\nfunction contains(obj, target) {\n if (obj == null) return false;\n if (nativeIndexOf && obj.indexOf === nativeIndexOf) return obj.indexOf(target) != -1;\n return any(obj, function(value) {\n return value === target;\n });\n};\n\nfunction Wrapped(value) {\n this.value = value;\n}\nWrapped.prototype.has = function(key) {\n return has(this.value, key);\n};\nWrapped.prototype.contains = function(target) {\n return contains(this.value, target);\n};\nWrapped.prototype.size = function() {\n return size(this.value);\n};\n\nfunction nodash(value) {\n // don't wrap if already wrapped, even if wrapped by a different `lodash` constructor\n return (value && typeof value == 'object' && !Array.isArray(value) && hasOwnProperty.call(value, '__wrapped__'))\n ? value\n : new Wrapped(value);\n}\n\nmodule.exports = nodash;\n","// Copyright Joyent, Inc. and other Node contributors.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a\n// copy of this software and associated documentation files (the\n// \"Software\"), to deal in the Software without restriction, including\n// without limitation the rights to use, copy, modify, merge, publish,\n// distribute, sublicense, and/or sell copies of the Software, and to permit\n// persons to whom the Software is furnished to do so, subject to the\n// following conditions:\n//\n// The above copyright notice and this permission notice shall be included\n// in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\n// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN\n// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,\n// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE\n// USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n// Based on https://github.com/joyent/node/blob/41e53e557992a7d552a8e23de035f9463da25c99/lib/path.js\n\n// resolves . and .. elements in a path array with directory names there\n// must be no slashes, empty elements, or device names (c:\\) in the array\n// (so also no leading and trailing slashes - it does not distinguish\n// relative and absolute paths)\nfunction normalizeArray(parts, allowAboveRoot) {\n // if the path tries to go above the root, `up` ends up > 0\n var up = 0;\n for (var i = parts.length - 1; i >= 0; i--) {\n var last = parts[i];\n if (last === '.') {\n parts.splice(i, 1);\n } else if (last === '..') {\n parts.splice(i, 1);\n up++;\n } else if (up) {\n parts.splice(i, 1);\n up--;\n }\n }\n\n // if the path is allowed to go above the root, restore leading ..s\n if (allowAboveRoot) {\n for (; up--; up) {\n parts.unshift('..');\n }\n }\n\n return parts;\n}\n\n// Split a filename into [root, dir, basename, ext], unix version\n// 'root' is just a slash, or nothing.\nvar splitPathRe =\n /^(\\/?)([\\s\\S]+\\/(?!$)|\\/)?((?:\\.{1,2}$|[\\s\\S]+?)?(\\.[^.\\/]*)?)$/;\nvar splitPath = function(filename) {\n var result = splitPathRe.exec(filename);\n return [result[1] || '', result[2] || '', result[3] || '', result[4] || ''];\n};\n\n// path.resolve([from ...], to)\nfunction resolve() {\n var resolvedPath = '',\n resolvedAbsolute = false;\n\n for (var i = arguments.length - 1; i >= -1 && !resolvedAbsolute; i--) {\n // XXXfiler: we don't have process.cwd() so we use '/' as a fallback\n var path = (i >= 0) ? arguments[i] : '/';\n\n // Skip empty and invalid entries\n if (typeof path !== 'string' || !path) {\n continue;\n }\n\n resolvedPath = path + '/' + resolvedPath;\n resolvedAbsolute = path.charAt(0) === '/';\n }\n\n // At this point the path should be resolved to a full absolute path, but\n // handle relative paths to be safe (might happen when process.cwd() fails)\n\n // Normalize the path\n resolvedPath = normalizeArray(resolvedPath.split('/').filter(function(p) {\n return !!p;\n }), !resolvedAbsolute).join('/');\n\n return ((resolvedAbsolute ? '/' : '') + resolvedPath) || '.';\n}\n\n// path.normalize(path)\nfunction normalize(path) {\n var isAbsolute = path.charAt(0) === '/',\n trailingSlash = path.substr(-1) === '/';\n\n // Normalize the path\n path = normalizeArray(path.split('/').filter(function(p) {\n return !!p;\n }), !isAbsolute).join('/');\n\n if (!path && !isAbsolute) {\n path = '.';\n }\n /*\n if (path && trailingSlash) {\n path += '/';\n }\n */\n\n return (isAbsolute ? '/' : '') + path;\n}\n\nfunction join() {\n var paths = Array.prototype.slice.call(arguments, 0);\n return normalize(paths.filter(function(p, index) {\n return p && typeof p === 'string';\n }).join('/'));\n}\n\n// path.relative(from, to)\nfunction relative(from, to) {\n from = resolve(from).substr(1);\n to = resolve(to).substr(1);\n\n function trim(arr) {\n var start = 0;\n for (; start < arr.length; start++) {\n if (arr[start] !== '') break;\n }\n\n var end = arr.length - 1;\n for (; end >= 0; end--) {\n if (arr[end] !== '') break;\n }\n\n if (start > end) return [];\n return arr.slice(start, end - start + 1);\n }\n\n var fromParts = trim(from.split('/'));\n var toParts = trim(to.split('/'));\n\n var length = Math.min(fromParts.length, toParts.length);\n var samePartsLength = length;\n for (var i = 0; i < length; i++) {\n if (fromParts[i] !== toParts[i]) {\n samePartsLength = i;\n break;\n }\n }\n\n var outputParts = [];\n for (var i = samePartsLength; i < fromParts.length; i++) {\n outputParts.push('..');\n }\n\n outputParts = outputParts.concat(toParts.slice(samePartsLength));\n\n return outputParts.join('/');\n}\n\nfunction dirname(path) {\n var result = splitPath(path),\n root = result[0],\n dir = result[1];\n\n if (!root && !dir) {\n // No dirname whatsoever\n return '.';\n }\n\n if (dir) {\n // It has a dirname, strip trailing slash\n dir = dir.substr(0, dir.length - 1);\n }\n\n return root + dir;\n}\n\nfunction basename(path, ext) {\n var f = splitPath(path)[2];\n // TODO: make this comparison case-insensitive on windows?\n if (ext && f.substr(-1 * ext.length) === ext) {\n f = f.substr(0, f.length - ext.length);\n }\n // XXXfiler: node.js just does `return f`\n return f === \"\" ? \"/\" : f;\n}\n\nfunction extname(path) {\n return splitPath(path)[3];\n}\n\nfunction isAbsolute(path) {\n if(path.charAt(0) === '/') {\n return true;\n }\n return false;\n}\n\nfunction isNull(path) {\n if (('' + path).indexOf('\\u0000') !== -1) {\n return true;\n }\n return false;\n}\n\n// Make sure we don't double-add a trailing slash (e.g., '/' -> '//')\nfunction addTrailing(path) {\n return path.replace(/\\/*$/, '/');\n}\n\n// Deal with multiple slashes at the end, one, or none\n// and make sure we don't return the empty string.\nfunction removeTrailing(path) {\n path = path.replace(/\\/*$/, '');\n return path === '' ? '/' : path;\n}\n\n// XXXfiler: we don't support path.exists() or path.existsSync(), which\n// are deprecated, and need a FileSystem instance to work. Use fs.stat().\n\nmodule.exports = {\n normalize: normalize,\n resolve: resolve,\n join: join,\n relative: relative,\n sep: '/',\n delimiter: ':',\n dirname: dirname,\n basename: basename,\n extname: extname,\n isAbsolute: isAbsolute,\n isNull: isNull,\n // Non-node but useful...\n addTrailing: addTrailing,\n removeTrailing: removeTrailing\n};\n","function guid() {\n return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function(c) {\n var r = Math.random()*16|0, v = c == 'x' ? r : (r&0x3|0x8);\n return v.toString(16);\n }).toUpperCase();\n}\n\nfunction nop() {}\n\n/**\n * Convert a Uint8Array to a regular array\n */\nfunction u8toArray(u8) {\n var array = [];\n var len = u8.length;\n for(var i = 0; i < len; i++) {\n array[i] = u8[i];\n }\n return array;\n}\n\nmodule.exports = {\n guid: guid,\n u8toArray: u8toArray,\n nop: nop\n};\n","var O_READ = 'READ';\nvar O_WRITE = 'WRITE';\nvar O_CREATE = 'CREATE';\nvar O_EXCLUSIVE = 'EXCLUSIVE';\nvar O_TRUNCATE = 'TRUNCATE';\nvar O_APPEND = 'APPEND';\nvar XATTR_CREATE = 'CREATE';\nvar XATTR_REPLACE = 'REPLACE';\n\nmodule.exports = {\n FILE_SYSTEM_NAME: 'local',\n\n FILE_STORE_NAME: 'files',\n\n IDB_RO: 'readonly',\n IDB_RW: 'readwrite',\n\n WSQL_VERSION: \"1\",\n WSQL_SIZE: 5 * 1024 * 1024,\n WSQL_DESC: \"FileSystem Storage\",\n\n NODE_TYPE_FILE: 'FILE',\n NODE_TYPE_DIRECTORY: 'DIRECTORY',\n NODE_TYPE_SYMBOLIC_LINK: 'SYMLINK',\n NODE_TYPE_META: 'META',\n\n S_IFREG: 0x8000,\n S_IFDIR: 0x4000,\n S_IFLNK: 0xA000,\n\n DEFAULT_DIR_PERMISSIONS: 0x1ED, // 755\n DEFAULT_FILE_PERMISSIONS: 0x1A4, // 644\n FULL_READ_WRITE_EXEC_PERMISSIONS: 0x1FF, // 777\n READ_WRITE_PERMISSIONS: 0x1B6, /// 666\n \n SYMLOOP_MAX: 10,\n\n BINARY_MIME_TYPE: 'application/octet-stream',\n JSON_MIME_TYPE: 'application/json',\n\n ROOT_DIRECTORY_NAME: '/', // basename(normalize(path))\n\n // FS Mount Flags\n FS_FORMAT: 'FORMAT',\n FS_NOCTIME: 'NOCTIME',\n FS_NOMTIME: 'NOMTIME',\n FS_NODUPEIDCHECK: 'FS_NODUPEIDCHECK',\n\n // FS File Open Flags\n O_READ: O_READ,\n O_WRITE: O_WRITE,\n O_CREATE: O_CREATE,\n O_EXCLUSIVE: O_EXCLUSIVE,\n O_TRUNCATE: O_TRUNCATE,\n O_APPEND: O_APPEND,\n\n O_FLAGS: {\n 'r': [O_READ],\n 'r+': [O_READ, O_WRITE],\n 'w': [O_WRITE, O_CREATE, O_TRUNCATE],\n 'w+': [O_WRITE, O_READ, O_CREATE, O_TRUNCATE],\n 'wx': [O_WRITE, O_CREATE, O_EXCLUSIVE, O_TRUNCATE],\n 'wx+': [O_WRITE, O_READ, O_CREATE, O_EXCLUSIVE, O_TRUNCATE],\n 'a': [O_WRITE, O_CREATE, O_APPEND],\n 'a+': [O_WRITE, O_READ, O_CREATE, O_APPEND],\n 'ax': [O_WRITE, O_CREATE, O_EXCLUSIVE, O_APPEND],\n 'ax+': [O_WRITE, O_READ, O_CREATE, O_EXCLUSIVE, O_APPEND]\n },\n\n XATTR_CREATE: XATTR_CREATE,\n XATTR_REPLACE: XATTR_REPLACE,\n\n FS_READY: 'READY',\n FS_PENDING: 'PENDING',\n FS_ERROR: 'ERROR',\n\n SUPER_NODE_ID: '00000000-0000-0000-0000-000000000000',\n\n // Reserved File Descriptors for streams\n STDIN: 0,\n STDOUT: 1,\n STDERR: 2,\n FIRST_DESCRIPTOR: 3,\n\n ENVIRONMENT: {\n TMP: '/tmp',\n PATH: ''\n },\n\n // Duplicate Node's fs.constants\n fsConstants: {\n O_RDONLY: 0,\n O_WRONLY: 1,\n O_RDWR: 2,\n S_IFMT: 61440,\n S_IFREG: 32768,\n S_IFDIR: 16384,\n S_IFCHR: 8192,\n S_IFBLK: 24576,\n S_IFIFO: 4096,\n S_IFLNK: 40960,\n S_IFSOCK: 49152,\n O_CREAT: 512,\n O_EXCL: 2048,\n O_NOCTTY: 131072,\n O_TRUNC: 1024,\n O_APPEND: 8,\n O_DIRECTORY: 1048576,\n O_NOFOLLOW: 256,\n O_SYNC: 128,\n O_DSYNC: 4194304,\n O_SYMLINK: 2097152,\n O_NONBLOCK: 4,\n S_IRWXU: 448,\n S_IRUSR: 256,\n S_IWUSR: 128,\n S_IXUSR: 64,\n S_IRWXG: 56,\n S_IRGRP: 32,\n S_IWGRP: 16,\n S_IXGRP: 8,\n S_IRWXO: 7,\n S_IROTH: 4,\n S_IWOTH: 2,\n S_IXOTH: 1,\n F_OK: 0,\n R_OK: 4,\n W_OK: 2,\n X_OK: 1,\n UV_FS_COPYFILE_EXCL: 1,\n COPYFILE_EXCL: 1\n }\n};\n","var errors = {};\n[\n /**\n * node.js errors - we only use some of these, add as needed.\n */\n //'-1:UNKNOWN:unknown error',\n //'0:OK:success',\n //'1:EOF:end of file',\n //'2:EADDRINFO:getaddrinfo error',\n //'3:EACCES:permission denied',\n //'4:EAGAIN:resource temporarily unavailable',\n //'5:EADDRINUSE:address already in use',\n //'6:EADDRNOTAVAIL:address not available',\n //'7:EAFNOSUPPORT:address family not supported',\n //'8:EALREADY:connection already in progress',\n '9:EBADF:bad file descriptor',\n '10:EBUSY:resource busy or locked',\n //'11:ECONNABORTED:software caused connection abort',\n //'12:ECONNREFUSED:connection refused',\n //'13:ECONNRESET:connection reset by peer',\n //'14:EDESTADDRREQ:destination address required',\n //'15:EFAULT:bad address in system call argument',\n //'16:EHOSTUNREACH:host is unreachable',\n //'17:EINTR:interrupted system call',\n '18:EINVAL:invalid argument',\n //'19:EISCONN:socket is already connected',\n //'20:EMFILE:too many open files',\n //'21:EMSGSIZE:message too long',\n //'22:ENETDOWN:network is down',\n //'23:ENETUNREACH:network is unreachable',\n //'24:ENFILE:file table overflow',\n //'25:ENOBUFS:no buffer space available',\n //'26:ENOMEM:not enough memory',\n '27:ENOTDIR:not a directory',\n '28:EISDIR:illegal operation on a directory',\n //'29:ENONET:machine is not on the network',\n // errno 30 skipped, as per https://github.com/rvagg/node-errno/blob/master/errno.js\n //'31:ENOTCONN:socket is not connected',\n //'32:ENOTSOCK:socket operation on non-socket',\n //'33:ENOTSUP:operation not supported on socket',\n '34:ENOENT:no such file or directory',\n //'35:ENOSYS:function not implemented',\n //'36:EPIPE:broken pipe',\n //'37:EPROTO:protocol error',\n //'38:EPROTONOSUPPORT:protocol not supported',\n //'39:EPROTOTYPE:protocol wrong type for socket',\n //'40:ETIMEDOUT:connection timed out',\n //'41:ECHARSET:invalid Unicode character',\n //'42:EAIFAMNOSUPPORT:address family for hostname not supported',\n // errno 43 skipped, as per https://github.com/rvagg/node-errno/blob/master/errno.js\n //'44:EAISERVICE:servname not supported for ai_socktype',\n //'45:EAISOCKTYPE:ai_socktype not supported',\n //'46:ESHUTDOWN:cannot send after transport endpoint shutdown',\n '47:EEXIST:file already exists',\n //'48:ESRCH:no such process',\n //'49:ENAMETOOLONG:name too long',\n '50:EPERM:operation not permitted',\n '51:ELOOP:too many symbolic links encountered',\n //'52:EXDEV:cross-device link not permitted',\n '53:ENOTEMPTY:directory not empty',\n //'54:ENOSPC:no space left on device',\n '55:EIO:i/o error',\n //'56:EROFS:read-only file system',\n //'57:ENODEV:no such device',\n //'58:ESPIPE:invalid seek',\n //'59:ECANCELED:operation canceled',\n\n /**\n * Filer specific errors\n */\n '1000:ENOTMOUNTED:not mounted',\n '1001:EFILESYSTEMERROR:missing super node, use \\'FORMAT\\' flag to format filesystem.',\n '1002:ENOATTR:attribute does not exist'\n\n].forEach(function(e) {\n e = e.split(':');\n var errno = +e[0];\n var errName = e[1];\n var defaultMessage = e[2];\n\n function FilerError(msg, path) {\n Error.call(this);\n\n this.name = errName;\n this.code = errName;\n this.errno = errno;\n this.message = msg || defaultMessage;\n if(path) {\n this.path = path;\n }\n this.stack = (new Error(this.message)).stack;\n }\n FilerError.prototype = Object.create(Error.prototype);\n FilerError.prototype.constructor = FilerError;\n FilerError.prototype.toString = function() {\n var pathInfo = this.path ? (', \\'' + this.path + '\\'') : '';\n return this.name + ': ' + this.message + pathInfo;\n };\n\n // We expose the error as both Errors.EINVAL and Errors[18]\n errors[errName] = errors[errno] = FilerError;\n});\n\nmodule.exports = errors;\n","'use strict'\n\nexports.byteLength = byteLength\nexports.toByteArray = toByteArray\nexports.fromByteArray = fromByteArray\n\nvar lookup = []\nvar revLookup = []\nvar Arr = typeof Uint8Array !== 'undefined' ? Uint8Array : Array\n\nvar code = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'\nfor (var i = 0, len = code.length; i < len; ++i) {\n lookup[i] = code[i]\n revLookup[code.charCodeAt(i)] = i\n}\n\n// Support decoding URL-safe base64 strings, as Node.js does.\n// See: https://en.wikipedia.org/wiki/Base64#URL_applications\nrevLookup['-'.charCodeAt(0)] = 62\nrevLookup['_'.charCodeAt(0)] = 63\n\nfunction getLens (b64) {\n var len = b64.length\n\n if (len % 4 > 0) {\n throw new Error('Invalid string. Length must be a multiple of 4')\n }\n\n // Trim off extra bytes after placeholder bytes are found\n // See: https://github.com/beatgammit/base64-js/issues/42\n var validLen = b64.indexOf('=')\n if (validLen === -1) validLen = len\n\n var placeHoldersLen = validLen === len\n ? 0\n : 4 - (validLen % 4)\n\n return [validLen, placeHoldersLen]\n}\n\n// base64 is 4/3 + up to two characters of the original data\nfunction byteLength (b64) {\n var lens = getLens(b64)\n var validLen = lens[0]\n var placeHoldersLen = lens[1]\n return ((validLen + placeHoldersLen) * 3 / 4) - placeHoldersLen\n}\n\nfunction _byteLength (b64, validLen, placeHoldersLen) {\n return ((validLen + placeHoldersLen) * 3 / 4) - placeHoldersLen\n}\n\nfunction toByteArray (b64) {\n var tmp\n var lens = getLens(b64)\n var validLen = lens[0]\n var placeHoldersLen = lens[1]\n\n var arr = new Arr(_byteLength(b64, validLen, placeHoldersLen))\n\n var curByte = 0\n\n // if there are placeholders, only get up to the last complete 4 chars\n var len = placeHoldersLen > 0\n ? validLen - 4\n : validLen\n\n for (var i = 0; i < len; i += 4) {\n tmp =\n (revLookup[b64.charCodeAt(i)] << 18) |\n (revLookup[b64.charCodeAt(i + 1)] << 12) |\n (revLookup[b64.charCodeAt(i + 2)] << 6) |\n revLookup[b64.charCodeAt(i + 3)]\n arr[curByte++] = (tmp >> 16) & 0xFF\n arr[curByte++] = (tmp >> 8) & 0xFF\n arr[curByte++] = tmp & 0xFF\n }\n\n if (placeHoldersLen === 2) {\n tmp =\n (revLookup[b64.charCodeAt(i)] << 2) |\n (revLookup[b64.charCodeAt(i + 1)] >> 4)\n arr[curByte++] = tmp & 0xFF\n }\n\n if (placeHoldersLen === 1) {\n tmp =\n (revLookup[b64.charCodeAt(i)] << 10) |\n (revLookup[b64.charCodeAt(i + 1)] << 4) |\n (revLookup[b64.charCodeAt(i + 2)] >> 2)\n arr[curByte++] = (tmp >> 8) & 0xFF\n arr[curByte++] = tmp & 0xFF\n }\n\n return arr\n}\n\nfunction tripletToBase64 (num) {\n return lookup[num >> 18 & 0x3F] +\n lookup[num >> 12 & 0x3F] +\n lookup[num >> 6 & 0x3F] +\n lookup[num & 0x3F]\n}\n\nfunction encodeChunk (uint8, start, end) {\n var tmp\n var output = []\n for (var i = start; i < end; i += 3) {\n tmp =\n ((uint8[i] << 16) & 0xFF0000) +\n ((uint8[i + 1] << 8) & 0xFF00) +\n (uint8[i + 2] & 0xFF)\n output.push(tripletToBase64(tmp))\n }\n return output.join('')\n}\n\nfunction fromByteArray (uint8) {\n var tmp\n var len = uint8.length\n var extraBytes = len % 3 // if we have 1 byte left, pad 2 bytes\n var parts = []\n var maxChunkLength = 16383 // must be multiple of 3\n\n // go through the array every three bytes, we'll deal with trailing stuff later\n for (var i = 0, len2 = len - extraBytes; i < len2; i += maxChunkLength) {\n parts.push(encodeChunk(\n uint8, i, (i + maxChunkLength) > len2 ? len2 : (i + maxChunkLength)\n ))\n }\n\n // pad the end with zeros, but make sure to not forget the extra bytes\n if (extraBytes === 1) {\n tmp = uint8[len - 1]\n parts.push(\n lookup[tmp >> 2] +\n lookup[(tmp << 4) & 0x3F] +\n '=='\n )\n } else if (extraBytes === 2) {\n tmp = (uint8[len - 2] << 8) + uint8[len - 1]\n parts.push(\n lookup[tmp >> 10] +\n lookup[(tmp >> 4) & 0x3F] +\n lookup[(tmp << 2) & 0x3F] +\n '='\n )\n }\n\n return parts.join('')\n}\n","exports.read = function (buffer, offset, isLE, mLen, nBytes) {\n var e, m\n var eLen = (nBytes * 8) - mLen - 1\n var eMax = (1 << eLen) - 1\n var eBias = eMax >> 1\n var nBits = -7\n var i = isLE ? (nBytes - 1) : 0\n var d = isLE ? -1 : 1\n var s = buffer[offset + i]\n\n i += d\n\n e = s & ((1 << (-nBits)) - 1)\n s >>= (-nBits)\n nBits += eLen\n for (; nBits > 0; e = (e * 256) + buffer[offset + i], i += d, nBits -= 8) {}\n\n m = e & ((1 << (-nBits)) - 1)\n e >>= (-nBits)\n nBits += mLen\n for (; nBits > 0; m = (m * 256) + buffer[offset + i], i += d, nBits -= 8) {}\n\n if (e === 0) {\n e = 1 - eBias\n } else if (e === eMax) {\n return m ? NaN : ((s ? -1 : 1) * Infinity)\n } else {\n m = m + Math.pow(2, mLen)\n e = e - eBias\n }\n return (s ? -1 : 1) * m * Math.pow(2, e - mLen)\n}\n\nexports.write = function (buffer, value, offset, isLE, mLen, nBytes) {\n var e, m, c\n var eLen = (nBytes * 8) - mLen - 1\n var eMax = (1 << eLen) - 1\n var eBias = eMax >> 1\n var rt = (mLen === 23 ? Math.pow(2, -24) - Math.pow(2, -77) : 0)\n var i = isLE ? 0 : (nBytes - 1)\n var d = isLE ? 1 : -1\n var s = value < 0 || (value === 0 && 1 / value < 0) ? 1 : 0\n\n value = Math.abs(value)\n\n if (isNaN(value) || value === Infinity) {\n m = isNaN(value) ? 1 : 0\n e = eMax\n } else {\n e = Math.floor(Math.log(value) / Math.LN2)\n if (value * (c = Math.pow(2, -e)) < 1) {\n e--\n c *= 2\n }\n if (e + eBias >= 1) {\n value += rt / c\n } else {\n value += rt * Math.pow(2, 1 - eBias)\n }\n if (value * c >= 2) {\n e++\n c /= 2\n }\n\n if (e + eBias >= eMax) {\n m = 0\n e = eMax\n } else if (e + eBias >= 1) {\n m = ((value * c) - 1) * Math.pow(2, mLen)\n e = e + eBias\n } else {\n m = value * Math.pow(2, eBias - 1) * Math.pow(2, mLen)\n e = 0\n }\n }\n\n for (; mLen >= 8; buffer[offset + i] = m & 0xff, i += d, m /= 256, mLen -= 8) {}\n\n e = (e << mLen) | m\n eLen += mLen\n for (; eLen > 0; buffer[offset + i] = e & 0xff, i += d, e /= 256, eLen -= 8) {}\n\n buffer[offset + i - d] |= s * 128\n}\n","var toString = {}.toString;\n\nmodule.exports = Array.isArray || function (arr) {\n return toString.call(arr) == '[object Array]';\n};\n","/*!\n * The buffer module from node.js, for the browser.\n *\n * @author Feross Aboukhadijeh \n * @license MIT\n */\n/* eslint-disable no-proto */\n\n'use strict'\n\nvar base64 = require('base64-js')\nvar ieee754 = require('ieee754')\nvar isArray = require('isarray')\n\nexports.Buffer = Buffer\nexports.SlowBuffer = SlowBuffer\nexports.INSPECT_MAX_BYTES = 50\n\n/**\n * If `Buffer.TYPED_ARRAY_SUPPORT`:\n * === true Use Uint8Array implementation (fastest)\n * === false Use Object implementation (most compatible, even IE6)\n *\n * Browsers that support typed arrays are IE 10+, Firefox 4+, Chrome 7+, Safari 5.1+,\n * Opera 11.6+, iOS 4.2+.\n *\n * Due to various browser bugs, sometimes the Object implementation will be used even\n * when the browser supports typed arrays.\n *\n * Note:\n *\n * - Firefox 4-29 lacks support for adding new properties to `Uint8Array` instances,\n * See: https://bugzilla.mozilla.org/show_bug.cgi?id=695438.\n *\n * - Chrome 9-10 is missing the `TypedArray.prototype.subarray` function.\n *\n * - IE10 has a broken `TypedArray.prototype.subarray` function which returns arrays of\n * incorrect length in some situations.\n\n * We detect these buggy browsers and set `Buffer.TYPED_ARRAY_SUPPORT` to `false` so they\n * get the Object implementation, which is slower but behaves correctly.\n */\nBuffer.TYPED_ARRAY_SUPPORT = global.TYPED_ARRAY_SUPPORT !== undefined\n ? global.TYPED_ARRAY_SUPPORT\n : typedArraySupport()\n\n/*\n * Export kMaxLength after typed array support is determined.\n */\nexports.kMaxLength = kMaxLength()\n\nfunction typedArraySupport () {\n try {\n var arr = new Uint8Array(1)\n arr.__proto__ = {__proto__: Uint8Array.prototype, foo: function () { return 42 }}\n return arr.foo() === 42 && // typed array instances can be augmented\n typeof arr.subarray === 'function' && // chrome 9-10 lack `subarray`\n arr.subarray(1, 1).byteLength === 0 // ie10 has broken `subarray`\n } catch (e) {\n return false\n }\n}\n\nfunction kMaxLength () {\n return Buffer.TYPED_ARRAY_SUPPORT\n ? 0x7fffffff\n : 0x3fffffff\n}\n\nfunction createBuffer (that, length) {\n if (kMaxLength() < length) {\n throw new RangeError('Invalid typed array length')\n }\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n // Return an augmented `Uint8Array` instance, for best performance\n that = new Uint8Array(length)\n that.__proto__ = Buffer.prototype\n } else {\n // Fallback: Return an object instance of the Buffer class\n if (that === null) {\n that = new Buffer(length)\n }\n that.length = length\n }\n\n return that\n}\n\n/**\n * The Buffer constructor returns instances of `Uint8Array` that have their\n * prototype changed to `Buffer.prototype`. Furthermore, `Buffer` is a subclass of\n * `Uint8Array`, so the returned instances will have all the node `Buffer` methods\n * and the `Uint8Array` methods. Square bracket notation works as expected -- it\n * returns a single octet.\n *\n * The `Uint8Array` prototype remains unmodified.\n */\n\nfunction Buffer (arg, encodingOrOffset, length) {\n if (!Buffer.TYPED_ARRAY_SUPPORT && !(this instanceof Buffer)) {\n return new Buffer(arg, encodingOrOffset, length)\n }\n\n // Common case.\n if (typeof arg === 'number') {\n if (typeof encodingOrOffset === 'string') {\n throw new Error(\n 'If encoding is specified then the first argument must be a string'\n )\n }\n return allocUnsafe(this, arg)\n }\n return from(this, arg, encodingOrOffset, length)\n}\n\nBuffer.poolSize = 8192 // not used by this implementation\n\n// TODO: Legacy, not needed anymore. Remove in next major version.\nBuffer._augment = function (arr) {\n arr.__proto__ = Buffer.prototype\n return arr\n}\n\nfunction from (that, value, encodingOrOffset, length) {\n if (typeof value === 'number') {\n throw new TypeError('\"value\" argument must not be a number')\n }\n\n if (typeof ArrayBuffer !== 'undefined' && value instanceof ArrayBuffer) {\n return fromArrayBuffer(that, value, encodingOrOffset, length)\n }\n\n if (typeof value === 'string') {\n return fromString(that, value, encodingOrOffset)\n }\n\n return fromObject(that, value)\n}\n\n/**\n * Functionally equivalent to Buffer(arg, encoding) but throws a TypeError\n * if value is a number.\n * Buffer.from(str[, encoding])\n * Buffer.from(array)\n * Buffer.from(buffer)\n * Buffer.from(arrayBuffer[, byteOffset[, length]])\n **/\nBuffer.from = function (value, encodingOrOffset, length) {\n return from(null, value, encodingOrOffset, length)\n}\n\nif (Buffer.TYPED_ARRAY_SUPPORT) {\n Buffer.prototype.__proto__ = Uint8Array.prototype\n Buffer.__proto__ = Uint8Array\n if (typeof Symbol !== 'undefined' && Symbol.species &&\n Buffer[Symbol.species] === Buffer) {\n // Fix subarray() in ES2016. See: https://github.com/feross/buffer/pull/97\n Object.defineProperty(Buffer, Symbol.species, {\n value: null,\n configurable: true\n })\n }\n}\n\nfunction assertSize (size) {\n if (typeof size !== 'number') {\n throw new TypeError('\"size\" argument must be a number')\n } else if (size < 0) {\n throw new RangeError('\"size\" argument must not be negative')\n }\n}\n\nfunction alloc (that, size, fill, encoding) {\n assertSize(size)\n if (size <= 0) {\n return createBuffer(that, size)\n }\n if (fill !== undefined) {\n // Only pay attention to encoding if it's a string. This\n // prevents accidentally sending in a number that would\n // be interpretted as a start offset.\n return typeof encoding === 'string'\n ? createBuffer(that, size).fill(fill, encoding)\n : createBuffer(that, size).fill(fill)\n }\n return createBuffer(that, size)\n}\n\n/**\n * Creates a new filled Buffer instance.\n * alloc(size[, fill[, encoding]])\n **/\nBuffer.alloc = function (size, fill, encoding) {\n return alloc(null, size, fill, encoding)\n}\n\nfunction allocUnsafe (that, size) {\n assertSize(size)\n that = createBuffer(that, size < 0 ? 0 : checked(size) | 0)\n if (!Buffer.TYPED_ARRAY_SUPPORT) {\n for (var i = 0; i < size; ++i) {\n that[i] = 0\n }\n }\n return that\n}\n\n/**\n * Equivalent to Buffer(num), by default creates a non-zero-filled Buffer instance.\n * */\nBuffer.allocUnsafe = function (size) {\n return allocUnsafe(null, size)\n}\n/**\n * Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance.\n */\nBuffer.allocUnsafeSlow = function (size) {\n return allocUnsafe(null, size)\n}\n\nfunction fromString (that, string, encoding) {\n if (typeof encoding !== 'string' || encoding === '') {\n encoding = 'utf8'\n }\n\n if (!Buffer.isEncoding(encoding)) {\n throw new TypeError('\"encoding\" must be a valid string encoding')\n }\n\n var length = byteLength(string, encoding) | 0\n that = createBuffer(that, length)\n\n var actual = that.write(string, encoding)\n\n if (actual !== length) {\n // Writing a hex string, for example, that contains invalid characters will\n // cause everything after the first invalid character to be ignored. (e.g.\n // 'abxxcd' will be treated as 'ab')\n that = that.slice(0, actual)\n }\n\n return that\n}\n\nfunction fromArrayLike (that, array) {\n var length = array.length < 0 ? 0 : checked(array.length) | 0\n that = createBuffer(that, length)\n for (var i = 0; i < length; i += 1) {\n that[i] = array[i] & 255\n }\n return that\n}\n\nfunction fromArrayBuffer (that, array, byteOffset, length) {\n array.byteLength // this throws if `array` is not a valid ArrayBuffer\n\n if (byteOffset < 0 || array.byteLength < byteOffset) {\n throw new RangeError('\\'offset\\' is out of bounds')\n }\n\n if (array.byteLength < byteOffset + (length || 0)) {\n throw new RangeError('\\'length\\' is out of bounds')\n }\n\n if (byteOffset === undefined && length === undefined) {\n array = new Uint8Array(array)\n } else if (length === undefined) {\n array = new Uint8Array(array, byteOffset)\n } else {\n array = new Uint8Array(array, byteOffset, length)\n }\n\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n // Return an augmented `Uint8Array` instance, for best performance\n that = array\n that.__proto__ = Buffer.prototype\n } else {\n // Fallback: Return an object instance of the Buffer class\n that = fromArrayLike(that, array)\n }\n return that\n}\n\nfunction fromObject (that, obj) {\n if (Buffer.isBuffer(obj)) {\n var len = checked(obj.length) | 0\n that = createBuffer(that, len)\n\n if (that.length === 0) {\n return that\n }\n\n obj.copy(that, 0, 0, len)\n return that\n }\n\n if (obj) {\n if ((typeof ArrayBuffer !== 'undefined' &&\n obj.buffer instanceof ArrayBuffer) || 'length' in obj) {\n if (typeof obj.length !== 'number' || isnan(obj.length)) {\n return createBuffer(that, 0)\n }\n return fromArrayLike(that, obj)\n }\n\n if (obj.type === 'Buffer' && isArray(obj.data)) {\n return fromArrayLike(that, obj.data)\n }\n }\n\n throw new TypeError('First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.')\n}\n\nfunction checked (length) {\n // Note: cannot use `length < kMaxLength()` here because that fails when\n // length is NaN (which is otherwise coerced to zero.)\n if (length >= kMaxLength()) {\n throw new RangeError('Attempt to allocate Buffer larger than maximum ' +\n 'size: 0x' + kMaxLength().toString(16) + ' bytes')\n }\n return length | 0\n}\n\nfunction SlowBuffer (length) {\n if (+length != length) { // eslint-disable-line eqeqeq\n length = 0\n }\n return Buffer.alloc(+length)\n}\n\nBuffer.isBuffer = function isBuffer (b) {\n return !!(b != null && b._isBuffer)\n}\n\nBuffer.compare = function compare (a, b) {\n if (!Buffer.isBuffer(a) || !Buffer.isBuffer(b)) {\n throw new TypeError('Arguments must be Buffers')\n }\n\n if (a === b) return 0\n\n var x = a.length\n var y = b.length\n\n for (var i = 0, len = Math.min(x, y); i < len; ++i) {\n if (a[i] !== b[i]) {\n x = a[i]\n y = b[i]\n break\n }\n }\n\n if (x < y) return -1\n if (y < x) return 1\n return 0\n}\n\nBuffer.isEncoding = function isEncoding (encoding) {\n switch (String(encoding).toLowerCase()) {\n case 'hex':\n case 'utf8':\n case 'utf-8':\n case 'ascii':\n case 'latin1':\n case 'binary':\n case 'base64':\n case 'ucs2':\n case 'ucs-2':\n case 'utf16le':\n case 'utf-16le':\n return true\n default:\n return false\n }\n}\n\nBuffer.concat = function concat (list, length) {\n if (!isArray(list)) {\n throw new TypeError('\"list\" argument must be an Array of Buffers')\n }\n\n if (list.length === 0) {\n return Buffer.alloc(0)\n }\n\n var i\n if (length === undefined) {\n length = 0\n for (i = 0; i < list.length; ++i) {\n length += list[i].length\n }\n }\n\n var buffer = Buffer.allocUnsafe(length)\n var pos = 0\n for (i = 0; i < list.length; ++i) {\n var buf = list[i]\n if (!Buffer.isBuffer(buf)) {\n throw new TypeError('\"list\" argument must be an Array of Buffers')\n }\n buf.copy(buffer, pos)\n pos += buf.length\n }\n return buffer\n}\n\nfunction byteLength (string, encoding) {\n if (Buffer.isBuffer(string)) {\n return string.length\n }\n if (typeof ArrayBuffer !== 'undefined' && typeof ArrayBuffer.isView === 'function' &&\n (ArrayBuffer.isView(string) || string instanceof ArrayBuffer)) {\n return string.byteLength\n }\n if (typeof string !== 'string') {\n string = '' + string\n }\n\n var len = string.length\n if (len === 0) return 0\n\n // Use a for loop to avoid recursion\n var loweredCase = false\n for (;;) {\n switch (encoding) {\n case 'ascii':\n case 'latin1':\n case 'binary':\n return len\n case 'utf8':\n case 'utf-8':\n case undefined:\n return utf8ToBytes(string).length\n case 'ucs2':\n case 'ucs-2':\n case 'utf16le':\n case 'utf-16le':\n return len * 2\n case 'hex':\n return len >>> 1\n case 'base64':\n return base64ToBytes(string).length\n default:\n if (loweredCase) return utf8ToBytes(string).length // assume utf8\n encoding = ('' + encoding).toLowerCase()\n loweredCase = true\n }\n }\n}\nBuffer.byteLength = byteLength\n\nfunction slowToString (encoding, start, end) {\n var loweredCase = false\n\n // No need to verify that \"this.length <= MAX_UINT32\" since it's a read-only\n // property of a typed array.\n\n // This behaves neither like String nor Uint8Array in that we set start/end\n // to their upper/lower bounds if the value passed is out of range.\n // undefined is handled specially as per ECMA-262 6th Edition,\n // Section 13.3.3.7 Runtime Semantics: KeyedBindingInitialization.\n if (start === undefined || start < 0) {\n start = 0\n }\n // Return early if start > this.length. Done here to prevent potential uint32\n // coercion fail below.\n if (start > this.length) {\n return ''\n }\n\n if (end === undefined || end > this.length) {\n end = this.length\n }\n\n if (end <= 0) {\n return ''\n }\n\n // Force coersion to uint32. This will also coerce falsey/NaN values to 0.\n end >>>= 0\n start >>>= 0\n\n if (end <= start) {\n return ''\n }\n\n if (!encoding) encoding = 'utf8'\n\n while (true) {\n switch (encoding) {\n case 'hex':\n return hexSlice(this, start, end)\n\n case 'utf8':\n case 'utf-8':\n return utf8Slice(this, start, end)\n\n case 'ascii':\n return asciiSlice(this, start, end)\n\n case 'latin1':\n case 'binary':\n return latin1Slice(this, start, end)\n\n case 'base64':\n return base64Slice(this, start, end)\n\n case 'ucs2':\n case 'ucs-2':\n case 'utf16le':\n case 'utf-16le':\n return utf16leSlice(this, start, end)\n\n default:\n if (loweredCase) throw new TypeError('Unknown encoding: ' + encoding)\n encoding = (encoding + '').toLowerCase()\n loweredCase = true\n }\n }\n}\n\n// The property is used by `Buffer.isBuffer` and `is-buffer` (in Safari 5-7) to detect\n// Buffer instances.\nBuffer.prototype._isBuffer = true\n\nfunction swap (b, n, m) {\n var i = b[n]\n b[n] = b[m]\n b[m] = i\n}\n\nBuffer.prototype.swap16 = function swap16 () {\n var len = this.length\n if (len % 2 !== 0) {\n throw new RangeError('Buffer size must be a multiple of 16-bits')\n }\n for (var i = 0; i < len; i += 2) {\n swap(this, i, i + 1)\n }\n return this\n}\n\nBuffer.prototype.swap32 = function swap32 () {\n var len = this.length\n if (len % 4 !== 0) {\n throw new RangeError('Buffer size must be a multiple of 32-bits')\n }\n for (var i = 0; i < len; i += 4) {\n swap(this, i, i + 3)\n swap(this, i + 1, i + 2)\n }\n return this\n}\n\nBuffer.prototype.swap64 = function swap64 () {\n var len = this.length\n if (len % 8 !== 0) {\n throw new RangeError('Buffer size must be a multiple of 64-bits')\n }\n for (var i = 0; i < len; i += 8) {\n swap(this, i, i + 7)\n swap(this, i + 1, i + 6)\n swap(this, i + 2, i + 5)\n swap(this, i + 3, i + 4)\n }\n return this\n}\n\nBuffer.prototype.toString = function toString () {\n var length = this.length | 0\n if (length === 0) return ''\n if (arguments.length === 0) return utf8Slice(this, 0, length)\n return slowToString.apply(this, arguments)\n}\n\nBuffer.prototype.equals = function equals (b) {\n if (!Buffer.isBuffer(b)) throw new TypeError('Argument must be a Buffer')\n if (this === b) return true\n return Buffer.compare(this, b) === 0\n}\n\nBuffer.prototype.inspect = function inspect () {\n var str = ''\n var max = exports.INSPECT_MAX_BYTES\n if (this.length > 0) {\n str = this.toString('hex', 0, max).match(/.{2}/g).join(' ')\n if (this.length > max) str += ' ... '\n }\n return ''\n}\n\nBuffer.prototype.compare = function compare (target, start, end, thisStart, thisEnd) {\n if (!Buffer.isBuffer(target)) {\n throw new TypeError('Argument must be a Buffer')\n }\n\n if (start === undefined) {\n start = 0\n }\n if (end === undefined) {\n end = target ? target.length : 0\n }\n if (thisStart === undefined) {\n thisStart = 0\n }\n if (thisEnd === undefined) {\n thisEnd = this.length\n }\n\n if (start < 0 || end > target.length || thisStart < 0 || thisEnd > this.length) {\n throw new RangeError('out of range index')\n }\n\n if (thisStart >= thisEnd && start >= end) {\n return 0\n }\n if (thisStart >= thisEnd) {\n return -1\n }\n if (start >= end) {\n return 1\n }\n\n start >>>= 0\n end >>>= 0\n thisStart >>>= 0\n thisEnd >>>= 0\n\n if (this === target) return 0\n\n var x = thisEnd - thisStart\n var y = end - start\n var len = Math.min(x, y)\n\n var thisCopy = this.slice(thisStart, thisEnd)\n var targetCopy = target.slice(start, end)\n\n for (var i = 0; i < len; ++i) {\n if (thisCopy[i] !== targetCopy[i]) {\n x = thisCopy[i]\n y = targetCopy[i]\n break\n }\n }\n\n if (x < y) return -1\n if (y < x) return 1\n return 0\n}\n\n// Finds either the first index of `val` in `buffer` at offset >= `byteOffset`,\n// OR the last index of `val` in `buffer` at offset <= `byteOffset`.\n//\n// Arguments:\n// - buffer - a Buffer to search\n// - val - a string, Buffer, or number\n// - byteOffset - an index into `buffer`; will be clamped to an int32\n// - encoding - an optional encoding, relevant is val is a string\n// - dir - true for indexOf, false for lastIndexOf\nfunction bidirectionalIndexOf (buffer, val, byteOffset, encoding, dir) {\n // Empty buffer means no match\n if (buffer.length === 0) return -1\n\n // Normalize byteOffset\n if (typeof byteOffset === 'string') {\n encoding = byteOffset\n byteOffset = 0\n } else if (byteOffset > 0x7fffffff) {\n byteOffset = 0x7fffffff\n } else if (byteOffset < -0x80000000) {\n byteOffset = -0x80000000\n }\n byteOffset = +byteOffset // Coerce to Number.\n if (isNaN(byteOffset)) {\n // byteOffset: it it's undefined, null, NaN, \"foo\", etc, search whole buffer\n byteOffset = dir ? 0 : (buffer.length - 1)\n }\n\n // Normalize byteOffset: negative offsets start from the end of the buffer\n if (byteOffset < 0) byteOffset = buffer.length + byteOffset\n if (byteOffset >= buffer.length) {\n if (dir) return -1\n else byteOffset = buffer.length - 1\n } else if (byteOffset < 0) {\n if (dir) byteOffset = 0\n else return -1\n }\n\n // Normalize val\n if (typeof val === 'string') {\n val = Buffer.from(val, encoding)\n }\n\n // Finally, search either indexOf (if dir is true) or lastIndexOf\n if (Buffer.isBuffer(val)) {\n // Special case: looking for empty string/buffer always fails\n if (val.length === 0) {\n return -1\n }\n return arrayIndexOf(buffer, val, byteOffset, encoding, dir)\n } else if (typeof val === 'number') {\n val = val & 0xFF // Search for a byte value [0-255]\n if (Buffer.TYPED_ARRAY_SUPPORT &&\n typeof Uint8Array.prototype.indexOf === 'function') {\n if (dir) {\n return Uint8Array.prototype.indexOf.call(buffer, val, byteOffset)\n } else {\n return Uint8Array.prototype.lastIndexOf.call(buffer, val, byteOffset)\n }\n }\n return arrayIndexOf(buffer, [ val ], byteOffset, encoding, dir)\n }\n\n throw new TypeError('val must be string, number or Buffer')\n}\n\nfunction arrayIndexOf (arr, val, byteOffset, encoding, dir) {\n var indexSize = 1\n var arrLength = arr.length\n var valLength = val.length\n\n if (encoding !== undefined) {\n encoding = String(encoding).toLowerCase()\n if (encoding === 'ucs2' || encoding === 'ucs-2' ||\n encoding === 'utf16le' || encoding === 'utf-16le') {\n if (arr.length < 2 || val.length < 2) {\n return -1\n }\n indexSize = 2\n arrLength /= 2\n valLength /= 2\n byteOffset /= 2\n }\n }\n\n function read (buf, i) {\n if (indexSize === 1) {\n return buf[i]\n } else {\n return buf.readUInt16BE(i * indexSize)\n }\n }\n\n var i\n if (dir) {\n var foundIndex = -1\n for (i = byteOffset; i < arrLength; i++) {\n if (read(arr, i) === read(val, foundIndex === -1 ? 0 : i - foundIndex)) {\n if (foundIndex === -1) foundIndex = i\n if (i - foundIndex + 1 === valLength) return foundIndex * indexSize\n } else {\n if (foundIndex !== -1) i -= i - foundIndex\n foundIndex = -1\n }\n }\n } else {\n if (byteOffset + valLength > arrLength) byteOffset = arrLength - valLength\n for (i = byteOffset; i >= 0; i--) {\n var found = true\n for (var j = 0; j < valLength; j++) {\n if (read(arr, i + j) !== read(val, j)) {\n found = false\n break\n }\n }\n if (found) return i\n }\n }\n\n return -1\n}\n\nBuffer.prototype.includes = function includes (val, byteOffset, encoding) {\n return this.indexOf(val, byteOffset, encoding) !== -1\n}\n\nBuffer.prototype.indexOf = function indexOf (val, byteOffset, encoding) {\n return bidirectionalIndexOf(this, val, byteOffset, encoding, true)\n}\n\nBuffer.prototype.lastIndexOf = function lastIndexOf (val, byteOffset, encoding) {\n return bidirectionalIndexOf(this, val, byteOffset, encoding, false)\n}\n\nfunction hexWrite (buf, string, offset, length) {\n offset = Number(offset) || 0\n var remaining = buf.length - offset\n if (!length) {\n length = remaining\n } else {\n length = Number(length)\n if (length > remaining) {\n length = remaining\n }\n }\n\n // must be an even number of digits\n var strLen = string.length\n if (strLen % 2 !== 0) throw new TypeError('Invalid hex string')\n\n if (length > strLen / 2) {\n length = strLen / 2\n }\n for (var i = 0; i < length; ++i) {\n var parsed = parseInt(string.substr(i * 2, 2), 16)\n if (isNaN(parsed)) return i\n buf[offset + i] = parsed\n }\n return i\n}\n\nfunction utf8Write (buf, string, offset, length) {\n return blitBuffer(utf8ToBytes(string, buf.length - offset), buf, offset, length)\n}\n\nfunction asciiWrite (buf, string, offset, length) {\n return blitBuffer(asciiToBytes(string), buf, offset, length)\n}\n\nfunction latin1Write (buf, string, offset, length) {\n return asciiWrite(buf, string, offset, length)\n}\n\nfunction base64Write (buf, string, offset, length) {\n return blitBuffer(base64ToBytes(string), buf, offset, length)\n}\n\nfunction ucs2Write (buf, string, offset, length) {\n return blitBuffer(utf16leToBytes(string, buf.length - offset), buf, offset, length)\n}\n\nBuffer.prototype.write = function write (string, offset, length, encoding) {\n // Buffer#write(string)\n if (offset === undefined) {\n encoding = 'utf8'\n length = this.length\n offset = 0\n // Buffer#write(string, encoding)\n } else if (length === undefined && typeof offset === 'string') {\n encoding = offset\n length = this.length\n offset = 0\n // Buffer#write(string, offset[, length][, encoding])\n } else if (isFinite(offset)) {\n offset = offset | 0\n if (isFinite(length)) {\n length = length | 0\n if (encoding === undefined) encoding = 'utf8'\n } else {\n encoding = length\n length = undefined\n }\n // legacy write(string, encoding, offset, length) - remove in v0.13\n } else {\n throw new Error(\n 'Buffer.write(string, encoding, offset[, length]) is no longer supported'\n )\n }\n\n var remaining = this.length - offset\n if (length === undefined || length > remaining) length = remaining\n\n if ((string.length > 0 && (length < 0 || offset < 0)) || offset > this.length) {\n throw new RangeError('Attempt to write outside buffer bounds')\n }\n\n if (!encoding) encoding = 'utf8'\n\n var loweredCase = false\n for (;;) {\n switch (encoding) {\n case 'hex':\n return hexWrite(this, string, offset, length)\n\n case 'utf8':\n case 'utf-8':\n return utf8Write(this, string, offset, length)\n\n case 'ascii':\n return asciiWrite(this, string, offset, length)\n\n case 'latin1':\n case 'binary':\n return latin1Write(this, string, offset, length)\n\n case 'base64':\n // Warning: maxLength not taken into account in base64Write\n return base64Write(this, string, offset, length)\n\n case 'ucs2':\n case 'ucs-2':\n case 'utf16le':\n case 'utf-16le':\n return ucs2Write(this, string, offset, length)\n\n default:\n if (loweredCase) throw new TypeError('Unknown encoding: ' + encoding)\n encoding = ('' + encoding).toLowerCase()\n loweredCase = true\n }\n }\n}\n\nBuffer.prototype.toJSON = function toJSON () {\n return {\n type: 'Buffer',\n data: Array.prototype.slice.call(this._arr || this, 0)\n }\n}\n\nfunction base64Slice (buf, start, end) {\n if (start === 0 && end === buf.length) {\n return base64.fromByteArray(buf)\n } else {\n return base64.fromByteArray(buf.slice(start, end))\n }\n}\n\nfunction utf8Slice (buf, start, end) {\n end = Math.min(buf.length, end)\n var res = []\n\n var i = start\n while (i < end) {\n var firstByte = buf[i]\n var codePoint = null\n var bytesPerSequence = (firstByte > 0xEF) ? 4\n : (firstByte > 0xDF) ? 3\n : (firstByte > 0xBF) ? 2\n : 1\n\n if (i + bytesPerSequence <= end) {\n var secondByte, thirdByte, fourthByte, tempCodePoint\n\n switch (bytesPerSequence) {\n case 1:\n if (firstByte < 0x80) {\n codePoint = firstByte\n }\n break\n case 2:\n secondByte = buf[i + 1]\n if ((secondByte & 0xC0) === 0x80) {\n tempCodePoint = (firstByte & 0x1F) << 0x6 | (secondByte & 0x3F)\n if (tempCodePoint > 0x7F) {\n codePoint = tempCodePoint\n }\n }\n break\n case 3:\n secondByte = buf[i + 1]\n thirdByte = buf[i + 2]\n if ((secondByte & 0xC0) === 0x80 && (thirdByte & 0xC0) === 0x80) {\n tempCodePoint = (firstByte & 0xF) << 0xC | (secondByte & 0x3F) << 0x6 | (thirdByte & 0x3F)\n if (tempCodePoint > 0x7FF && (tempCodePoint < 0xD800 || tempCodePoint > 0xDFFF)) {\n codePoint = tempCodePoint\n }\n }\n break\n case 4:\n secondByte = buf[i + 1]\n thirdByte = buf[i + 2]\n fourthByte = buf[i + 3]\n if ((secondByte & 0xC0) === 0x80 && (thirdByte & 0xC0) === 0x80 && (fourthByte & 0xC0) === 0x80) {\n tempCodePoint = (firstByte & 0xF) << 0x12 | (secondByte & 0x3F) << 0xC | (thirdByte & 0x3F) << 0x6 | (fourthByte & 0x3F)\n if (tempCodePoint > 0xFFFF && tempCodePoint < 0x110000) {\n codePoint = tempCodePoint\n }\n }\n }\n }\n\n if (codePoint === null) {\n // we did not generate a valid codePoint so insert a\n // replacement char (U+FFFD) and advance only 1 byte\n codePoint = 0xFFFD\n bytesPerSequence = 1\n } else if (codePoint > 0xFFFF) {\n // encode to utf16 (surrogate pair dance)\n codePoint -= 0x10000\n res.push(codePoint >>> 10 & 0x3FF | 0xD800)\n codePoint = 0xDC00 | codePoint & 0x3FF\n }\n\n res.push(codePoint)\n i += bytesPerSequence\n }\n\n return decodeCodePointsArray(res)\n}\n\n// Based on http://stackoverflow.com/a/22747272/680742, the browser with\n// the lowest limit is Chrome, with 0x10000 args.\n// We go 1 magnitude less, for safety\nvar MAX_ARGUMENTS_LENGTH = 0x1000\n\nfunction decodeCodePointsArray (codePoints) {\n var len = codePoints.length\n if (len <= MAX_ARGUMENTS_LENGTH) {\n return String.fromCharCode.apply(String, codePoints) // avoid extra slice()\n }\n\n // Decode in chunks to avoid \"call stack size exceeded\".\n var res = ''\n var i = 0\n while (i < len) {\n res += String.fromCharCode.apply(\n String,\n codePoints.slice(i, i += MAX_ARGUMENTS_LENGTH)\n )\n }\n return res\n}\n\nfunction asciiSlice (buf, start, end) {\n var ret = ''\n end = Math.min(buf.length, end)\n\n for (var i = start; i < end; ++i) {\n ret += String.fromCharCode(buf[i] & 0x7F)\n }\n return ret\n}\n\nfunction latin1Slice (buf, start, end) {\n var ret = ''\n end = Math.min(buf.length, end)\n\n for (var i = start; i < end; ++i) {\n ret += String.fromCharCode(buf[i])\n }\n return ret\n}\n\nfunction hexSlice (buf, start, end) {\n var len = buf.length\n\n if (!start || start < 0) start = 0\n if (!end || end < 0 || end > len) end = len\n\n var out = ''\n for (var i = start; i < end; ++i) {\n out += toHex(buf[i])\n }\n return out\n}\n\nfunction utf16leSlice (buf, start, end) {\n var bytes = buf.slice(start, end)\n var res = ''\n for (var i = 0; i < bytes.length; i += 2) {\n res += String.fromCharCode(bytes[i] + bytes[i + 1] * 256)\n }\n return res\n}\n\nBuffer.prototype.slice = function slice (start, end) {\n var len = this.length\n start = ~~start\n end = end === undefined ? len : ~~end\n\n if (start < 0) {\n start += len\n if (start < 0) start = 0\n } else if (start > len) {\n start = len\n }\n\n if (end < 0) {\n end += len\n if (end < 0) end = 0\n } else if (end > len) {\n end = len\n }\n\n if (end < start) end = start\n\n var newBuf\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n newBuf = this.subarray(start, end)\n newBuf.__proto__ = Buffer.prototype\n } else {\n var sliceLen = end - start\n newBuf = new Buffer(sliceLen, undefined)\n for (var i = 0; i < sliceLen; ++i) {\n newBuf[i] = this[i + start]\n }\n }\n\n return newBuf\n}\n\n/*\n * Need to make sure that buffer isn't trying to write out of bounds.\n */\nfunction checkOffset (offset, ext, length) {\n if ((offset % 1) !== 0 || offset < 0) throw new RangeError('offset is not uint')\n if (offset + ext > length) throw new RangeError('Trying to access beyond buffer length')\n}\n\nBuffer.prototype.readUIntLE = function readUIntLE (offset, byteLength, noAssert) {\n offset = offset | 0\n byteLength = byteLength | 0\n if (!noAssert) checkOffset(offset, byteLength, this.length)\n\n var val = this[offset]\n var mul = 1\n var i = 0\n while (++i < byteLength && (mul *= 0x100)) {\n val += this[offset + i] * mul\n }\n\n return val\n}\n\nBuffer.prototype.readUIntBE = function readUIntBE (offset, byteLength, noAssert) {\n offset = offset | 0\n byteLength = byteLength | 0\n if (!noAssert) {\n checkOffset(offset, byteLength, this.length)\n }\n\n var val = this[offset + --byteLength]\n var mul = 1\n while (byteLength > 0 && (mul *= 0x100)) {\n val += this[offset + --byteLength] * mul\n }\n\n return val\n}\n\nBuffer.prototype.readUInt8 = function readUInt8 (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 1, this.length)\n return this[offset]\n}\n\nBuffer.prototype.readUInt16LE = function readUInt16LE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 2, this.length)\n return this[offset] | (this[offset + 1] << 8)\n}\n\nBuffer.prototype.readUInt16BE = function readUInt16BE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 2, this.length)\n return (this[offset] << 8) | this[offset + 1]\n}\n\nBuffer.prototype.readUInt32LE = function readUInt32LE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 4, this.length)\n\n return ((this[offset]) |\n (this[offset + 1] << 8) |\n (this[offset + 2] << 16)) +\n (this[offset + 3] * 0x1000000)\n}\n\nBuffer.prototype.readUInt32BE = function readUInt32BE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 4, this.length)\n\n return (this[offset] * 0x1000000) +\n ((this[offset + 1] << 16) |\n (this[offset + 2] << 8) |\n this[offset + 3])\n}\n\nBuffer.prototype.readIntLE = function readIntLE (offset, byteLength, noAssert) {\n offset = offset | 0\n byteLength = byteLength | 0\n if (!noAssert) checkOffset(offset, byteLength, this.length)\n\n var val = this[offset]\n var mul = 1\n var i = 0\n while (++i < byteLength && (mul *= 0x100)) {\n val += this[offset + i] * mul\n }\n mul *= 0x80\n\n if (val >= mul) val -= Math.pow(2, 8 * byteLength)\n\n return val\n}\n\nBuffer.prototype.readIntBE = function readIntBE (offset, byteLength, noAssert) {\n offset = offset | 0\n byteLength = byteLength | 0\n if (!noAssert) checkOffset(offset, byteLength, this.length)\n\n var i = byteLength\n var mul = 1\n var val = this[offset + --i]\n while (i > 0 && (mul *= 0x100)) {\n val += this[offset + --i] * mul\n }\n mul *= 0x80\n\n if (val >= mul) val -= Math.pow(2, 8 * byteLength)\n\n return val\n}\n\nBuffer.prototype.readInt8 = function readInt8 (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 1, this.length)\n if (!(this[offset] & 0x80)) return (this[offset])\n return ((0xff - this[offset] + 1) * -1)\n}\n\nBuffer.prototype.readInt16LE = function readInt16LE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 2, this.length)\n var val = this[offset] | (this[offset + 1] << 8)\n return (val & 0x8000) ? val | 0xFFFF0000 : val\n}\n\nBuffer.prototype.readInt16BE = function readInt16BE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 2, this.length)\n var val = this[offset + 1] | (this[offset] << 8)\n return (val & 0x8000) ? val | 0xFFFF0000 : val\n}\n\nBuffer.prototype.readInt32LE = function readInt32LE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 4, this.length)\n\n return (this[offset]) |\n (this[offset + 1] << 8) |\n (this[offset + 2] << 16) |\n (this[offset + 3] << 24)\n}\n\nBuffer.prototype.readInt32BE = function readInt32BE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 4, this.length)\n\n return (this[offset] << 24) |\n (this[offset + 1] << 16) |\n (this[offset + 2] << 8) |\n (this[offset + 3])\n}\n\nBuffer.prototype.readFloatLE = function readFloatLE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 4, this.length)\n return ieee754.read(this, offset, true, 23, 4)\n}\n\nBuffer.prototype.readFloatBE = function readFloatBE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 4, this.length)\n return ieee754.read(this, offset, false, 23, 4)\n}\n\nBuffer.prototype.readDoubleLE = function readDoubleLE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 8, this.length)\n return ieee754.read(this, offset, true, 52, 8)\n}\n\nBuffer.prototype.readDoubleBE = function readDoubleBE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 8, this.length)\n return ieee754.read(this, offset, false, 52, 8)\n}\n\nfunction checkInt (buf, value, offset, ext, max, min) {\n if (!Buffer.isBuffer(buf)) throw new TypeError('\"buffer\" argument must be a Buffer instance')\n if (value > max || value < min) throw new RangeError('\"value\" argument is out of bounds')\n if (offset + ext > buf.length) throw new RangeError('Index out of range')\n}\n\nBuffer.prototype.writeUIntLE = function writeUIntLE (value, offset, byteLength, noAssert) {\n value = +value\n offset = offset | 0\n byteLength = byteLength | 0\n if (!noAssert) {\n var maxBytes = Math.pow(2, 8 * byteLength) - 1\n checkInt(this, value, offset, byteLength, maxBytes, 0)\n }\n\n var mul = 1\n var i = 0\n this[offset] = value & 0xFF\n while (++i < byteLength && (mul *= 0x100)) {\n this[offset + i] = (value / mul) & 0xFF\n }\n\n return offset + byteLength\n}\n\nBuffer.prototype.writeUIntBE = function writeUIntBE (value, offset, byteLength, noAssert) {\n value = +value\n offset = offset | 0\n byteLength = byteLength | 0\n if (!noAssert) {\n var maxBytes = Math.pow(2, 8 * byteLength) - 1\n checkInt(this, value, offset, byteLength, maxBytes, 0)\n }\n\n var i = byteLength - 1\n var mul = 1\n this[offset + i] = value & 0xFF\n while (--i >= 0 && (mul *= 0x100)) {\n this[offset + i] = (value / mul) & 0xFF\n }\n\n return offset + byteLength\n}\n\nBuffer.prototype.writeUInt8 = function writeUInt8 (value, offset, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) checkInt(this, value, offset, 1, 0xff, 0)\n if (!Buffer.TYPED_ARRAY_SUPPORT) value = Math.floor(value)\n this[offset] = (value & 0xff)\n return offset + 1\n}\n\nfunction objectWriteUInt16 (buf, value, offset, littleEndian) {\n if (value < 0) value = 0xffff + value + 1\n for (var i = 0, j = Math.min(buf.length - offset, 2); i < j; ++i) {\n buf[offset + i] = (value & (0xff << (8 * (littleEndian ? i : 1 - i)))) >>>\n (littleEndian ? i : 1 - i) * 8\n }\n}\n\nBuffer.prototype.writeUInt16LE = function writeUInt16LE (value, offset, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) checkInt(this, value, offset, 2, 0xffff, 0)\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n this[offset] = (value & 0xff)\n this[offset + 1] = (value >>> 8)\n } else {\n objectWriteUInt16(this, value, offset, true)\n }\n return offset + 2\n}\n\nBuffer.prototype.writeUInt16BE = function writeUInt16BE (value, offset, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) checkInt(this, value, offset, 2, 0xffff, 0)\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n this[offset] = (value >>> 8)\n this[offset + 1] = (value & 0xff)\n } else {\n objectWriteUInt16(this, value, offset, false)\n }\n return offset + 2\n}\n\nfunction objectWriteUInt32 (buf, value, offset, littleEndian) {\n if (value < 0) value = 0xffffffff + value + 1\n for (var i = 0, j = Math.min(buf.length - offset, 4); i < j; ++i) {\n buf[offset + i] = (value >>> (littleEndian ? i : 3 - i) * 8) & 0xff\n }\n}\n\nBuffer.prototype.writeUInt32LE = function writeUInt32LE (value, offset, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) checkInt(this, value, offset, 4, 0xffffffff, 0)\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n this[offset + 3] = (value >>> 24)\n this[offset + 2] = (value >>> 16)\n this[offset + 1] = (value >>> 8)\n this[offset] = (value & 0xff)\n } else {\n objectWriteUInt32(this, value, offset, true)\n }\n return offset + 4\n}\n\nBuffer.prototype.writeUInt32BE = function writeUInt32BE (value, offset, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) checkInt(this, value, offset, 4, 0xffffffff, 0)\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n this[offset] = (value >>> 24)\n this[offset + 1] = (value >>> 16)\n this[offset + 2] = (value >>> 8)\n this[offset + 3] = (value & 0xff)\n } else {\n objectWriteUInt32(this, value, offset, false)\n }\n return offset + 4\n}\n\nBuffer.prototype.writeIntLE = function writeIntLE (value, offset, byteLength, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) {\n var limit = Math.pow(2, 8 * byteLength - 1)\n\n checkInt(this, value, offset, byteLength, limit - 1, -limit)\n }\n\n var i = 0\n var mul = 1\n var sub = 0\n this[offset] = value & 0xFF\n while (++i < byteLength && (mul *= 0x100)) {\n if (value < 0 && sub === 0 && this[offset + i - 1] !== 0) {\n sub = 1\n }\n this[offset + i] = ((value / mul) >> 0) - sub & 0xFF\n }\n\n return offset + byteLength\n}\n\nBuffer.prototype.writeIntBE = function writeIntBE (value, offset, byteLength, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) {\n var limit = Math.pow(2, 8 * byteLength - 1)\n\n checkInt(this, value, offset, byteLength, limit - 1, -limit)\n }\n\n var i = byteLength - 1\n var mul = 1\n var sub = 0\n this[offset + i] = value & 0xFF\n while (--i >= 0 && (mul *= 0x100)) {\n if (value < 0 && sub === 0 && this[offset + i + 1] !== 0) {\n sub = 1\n }\n this[offset + i] = ((value / mul) >> 0) - sub & 0xFF\n }\n\n return offset + byteLength\n}\n\nBuffer.prototype.writeInt8 = function writeInt8 (value, offset, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) checkInt(this, value, offset, 1, 0x7f, -0x80)\n if (!Buffer.TYPED_ARRAY_SUPPORT) value = Math.floor(value)\n if (value < 0) value = 0xff + value + 1\n this[offset] = (value & 0xff)\n return offset + 1\n}\n\nBuffer.prototype.writeInt16LE = function writeInt16LE (value, offset, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) checkInt(this, value, offset, 2, 0x7fff, -0x8000)\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n this[offset] = (value & 0xff)\n this[offset + 1] = (value >>> 8)\n } else {\n objectWriteUInt16(this, value, offset, true)\n }\n return offset + 2\n}\n\nBuffer.prototype.writeInt16BE = function writeInt16BE (value, offset, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) checkInt(this, value, offset, 2, 0x7fff, -0x8000)\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n this[offset] = (value >>> 8)\n this[offset + 1] = (value & 0xff)\n } else {\n objectWriteUInt16(this, value, offset, false)\n }\n return offset + 2\n}\n\nBuffer.prototype.writeInt32LE = function writeInt32LE (value, offset, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) checkInt(this, value, offset, 4, 0x7fffffff, -0x80000000)\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n this[offset] = (value & 0xff)\n this[offset + 1] = (value >>> 8)\n this[offset + 2] = (value >>> 16)\n this[offset + 3] = (value >>> 24)\n } else {\n objectWriteUInt32(this, value, offset, true)\n }\n return offset + 4\n}\n\nBuffer.prototype.writeInt32BE = function writeInt32BE (value, offset, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) checkInt(this, value, offset, 4, 0x7fffffff, -0x80000000)\n if (value < 0) value = 0xffffffff + value + 1\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n this[offset] = (value >>> 24)\n this[offset + 1] = (value >>> 16)\n this[offset + 2] = (value >>> 8)\n this[offset + 3] = (value & 0xff)\n } else {\n objectWriteUInt32(this, value, offset, false)\n }\n return offset + 4\n}\n\nfunction checkIEEE754 (buf, value, offset, ext, max, min) {\n if (offset + ext > buf.length) throw new RangeError('Index out of range')\n if (offset < 0) throw new RangeError('Index out of range')\n}\n\nfunction writeFloat (buf, value, offset, littleEndian, noAssert) {\n if (!noAssert) {\n checkIEEE754(buf, value, offset, 4, 3.4028234663852886e+38, -3.4028234663852886e+38)\n }\n ieee754.write(buf, value, offset, littleEndian, 23, 4)\n return offset + 4\n}\n\nBuffer.prototype.writeFloatLE = function writeFloatLE (value, offset, noAssert) {\n return writeFloat(this, value, offset, true, noAssert)\n}\n\nBuffer.prototype.writeFloatBE = function writeFloatBE (value, offset, noAssert) {\n return writeFloat(this, value, offset, false, noAssert)\n}\n\nfunction writeDouble (buf, value, offset, littleEndian, noAssert) {\n if (!noAssert) {\n checkIEEE754(buf, value, offset, 8, 1.7976931348623157E+308, -1.7976931348623157E+308)\n }\n ieee754.write(buf, value, offset, littleEndian, 52, 8)\n return offset + 8\n}\n\nBuffer.prototype.writeDoubleLE = function writeDoubleLE (value, offset, noAssert) {\n return writeDouble(this, value, offset, true, noAssert)\n}\n\nBuffer.prototype.writeDoubleBE = function writeDoubleBE (value, offset, noAssert) {\n return writeDouble(this, value, offset, false, noAssert)\n}\n\n// copy(targetBuffer, targetStart=0, sourceStart=0, sourceEnd=buffer.length)\nBuffer.prototype.copy = function copy (target, targetStart, start, end) {\n if (!start) start = 0\n if (!end && end !== 0) end = this.length\n if (targetStart >= target.length) targetStart = target.length\n if (!targetStart) targetStart = 0\n if (end > 0 && end < start) end = start\n\n // Copy 0 bytes; we're done\n if (end === start) return 0\n if (target.length === 0 || this.length === 0) return 0\n\n // Fatal error conditions\n if (targetStart < 0) {\n throw new RangeError('targetStart out of bounds')\n }\n if (start < 0 || start >= this.length) throw new RangeError('sourceStart out of bounds')\n if (end < 0) throw new RangeError('sourceEnd out of bounds')\n\n // Are we oob?\n if (end > this.length) end = this.length\n if (target.length - targetStart < end - start) {\n end = target.length - targetStart + start\n }\n\n var len = end - start\n var i\n\n if (this === target && start < targetStart && targetStart < end) {\n // descending copy from end\n for (i = len - 1; i >= 0; --i) {\n target[i + targetStart] = this[i + start]\n }\n } else if (len < 1000 || !Buffer.TYPED_ARRAY_SUPPORT) {\n // ascending copy from start\n for (i = 0; i < len; ++i) {\n target[i + targetStart] = this[i + start]\n }\n } else {\n Uint8Array.prototype.set.call(\n target,\n this.subarray(start, start + len),\n targetStart\n )\n }\n\n return len\n}\n\n// Usage:\n// buffer.fill(number[, offset[, end]])\n// buffer.fill(buffer[, offset[, end]])\n// buffer.fill(string[, offset[, end]][, encoding])\nBuffer.prototype.fill = function fill (val, start, end, encoding) {\n // Handle string cases:\n if (typeof val === 'string') {\n if (typeof start === 'string') {\n encoding = start\n start = 0\n end = this.length\n } else if (typeof end === 'string') {\n encoding = end\n end = this.length\n }\n if (val.length === 1) {\n var code = val.charCodeAt(0)\n if (code < 256) {\n val = code\n }\n }\n if (encoding !== undefined && typeof encoding !== 'string') {\n throw new TypeError('encoding must be a string')\n }\n if (typeof encoding === 'string' && !Buffer.isEncoding(encoding)) {\n throw new TypeError('Unknown encoding: ' + encoding)\n }\n } else if (typeof val === 'number') {\n val = val & 255\n }\n\n // Invalid ranges are not set to a default, so can range check early.\n if (start < 0 || this.length < start || this.length < end) {\n throw new RangeError('Out of range index')\n }\n\n if (end <= start) {\n return this\n }\n\n start = start >>> 0\n end = end === undefined ? this.length : end >>> 0\n\n if (!val) val = 0\n\n var i\n if (typeof val === 'number') {\n for (i = start; i < end; ++i) {\n this[i] = val\n }\n } else {\n var bytes = Buffer.isBuffer(val)\n ? val\n : utf8ToBytes(new Buffer(val, encoding).toString())\n var len = bytes.length\n for (i = 0; i < end - start; ++i) {\n this[i + start] = bytes[i % len]\n }\n }\n\n return this\n}\n\n// HELPER FUNCTIONS\n// ================\n\nvar INVALID_BASE64_RE = /[^+\\/0-9A-Za-z-_]/g\n\nfunction base64clean (str) {\n // Node strips out invalid characters like \\n and \\t from the string, base64-js does not\n str = stringtrim(str).replace(INVALID_BASE64_RE, '')\n // Node converts strings with length < 2 to ''\n if (str.length < 2) return ''\n // Node allows for non-padded base64 strings (missing trailing ===), base64-js does not\n while (str.length % 4 !== 0) {\n str = str + '='\n }\n return str\n}\n\nfunction stringtrim (str) {\n if (str.trim) return str.trim()\n return str.replace(/^\\s+|\\s+$/g, '')\n}\n\nfunction toHex (n) {\n if (n < 16) return '0' + n.toString(16)\n return n.toString(16)\n}\n\nfunction utf8ToBytes (string, units) {\n units = units || Infinity\n var codePoint\n var length = string.length\n var leadSurrogate = null\n var bytes = []\n\n for (var i = 0; i < length; ++i) {\n codePoint = string.charCodeAt(i)\n\n // is surrogate component\n if (codePoint > 0xD7FF && codePoint < 0xE000) {\n // last char was a lead\n if (!leadSurrogate) {\n // no lead yet\n if (codePoint > 0xDBFF) {\n // unexpected trail\n if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)\n continue\n } else if (i + 1 === length) {\n // unpaired lead\n if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)\n continue\n }\n\n // valid lead\n leadSurrogate = codePoint\n\n continue\n }\n\n // 2 leads in a row\n if (codePoint < 0xDC00) {\n if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)\n leadSurrogate = codePoint\n continue\n }\n\n // valid surrogate pair\n codePoint = (leadSurrogate - 0xD800 << 10 | codePoint - 0xDC00) + 0x10000\n } else if (leadSurrogate) {\n // valid bmp char, but last char was a lead\n if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)\n }\n\n leadSurrogate = null\n\n // encode utf8\n if (codePoint < 0x80) {\n if ((units -= 1) < 0) break\n bytes.push(codePoint)\n } else if (codePoint < 0x800) {\n if ((units -= 2) < 0) break\n bytes.push(\n codePoint >> 0x6 | 0xC0,\n codePoint & 0x3F | 0x80\n )\n } else if (codePoint < 0x10000) {\n if ((units -= 3) < 0) break\n bytes.push(\n codePoint >> 0xC | 0xE0,\n codePoint >> 0x6 & 0x3F | 0x80,\n codePoint & 0x3F | 0x80\n )\n } else if (codePoint < 0x110000) {\n if ((units -= 4) < 0) break\n bytes.push(\n codePoint >> 0x12 | 0xF0,\n codePoint >> 0xC & 0x3F | 0x80,\n codePoint >> 0x6 & 0x3F | 0x80,\n codePoint & 0x3F | 0x80\n )\n } else {\n throw new Error('Invalid code point')\n }\n }\n\n return bytes\n}\n\nfunction asciiToBytes (str) {\n var byteArray = []\n for (var i = 0; i < str.length; ++i) {\n // Node's code seems to be doing this and not & 0x7F..\n byteArray.push(str.charCodeAt(i) & 0xFF)\n }\n return byteArray\n}\n\nfunction utf16leToBytes (str, units) {\n var c, hi, lo\n var byteArray = []\n for (var i = 0; i < str.length; ++i) {\n if ((units -= 2) < 0) break\n\n c = str.charCodeAt(i)\n hi = c >> 8\n lo = c % 256\n byteArray.push(lo)\n byteArray.push(hi)\n }\n\n return byteArray\n}\n\nfunction base64ToBytes (str) {\n return base64.toByteArray(base64clean(str))\n}\n\nfunction blitBuffer (src, dst, offset, length) {\n for (var i = 0; i < length; ++i) {\n if ((i + offset >= dst.length) || (i >= src.length)) break\n dst[i + offset] = src[i]\n }\n return i\n}\n\nfunction isnan (val) {\n return val !== val // eslint-disable-line no-self-compare\n}\n","function FilerBuffer (subject, encoding, nonZero) {\n\n // Automatically turn ArrayBuffer into Uint8Array so that underlying\n // Buffer code doesn't just throw away and ignore ArrayBuffer data.\n if (subject instanceof ArrayBuffer) {\n subject = new Uint8Array(subject);\n }\n\n return new Buffer(subject, encoding, nonZero);\n};\n\n// Inherit prototype from Buffer\nFilerBuffer.prototype = Object.create(Buffer.prototype);\nFilerBuffer.prototype.constructor = FilerBuffer;\n\n// Also copy static methods onto FilerBuffer ctor\nObject.keys(Buffer).forEach(function (p) {\n if (Buffer.hasOwnProperty(p)) {\n FilerBuffer[p] = Buffer[p];\n }\n});\n\nmodule.exports = FilerBuffer;\n","var FILE_SYSTEM_NAME = require('../constants.js').FILE_SYSTEM_NAME;\nvar FILE_STORE_NAME = require('../constants.js').FILE_STORE_NAME;\nvar IDB_RW = require('../constants.js').IDB_RW;\nvar IDB_RO = require('../constants.js').IDB_RO;\nvar Errors = require('../errors.js');\nvar FilerBuffer = require('../buffer.js');\n\nvar indexedDB = global.indexedDB ||\n global.mozIndexedDB ||\n global.webkitIndexedDB ||\n global.msIndexedDB;\n\nfunction IndexedDBContext(db, mode) {\n this.db = db;\n this.mode = mode;\n}\n\nIndexedDBContext.prototype._getObjectStore = function() {\n if(this.objectStore) {\n return this.objectStore;\n }\n\n var transaction = this.db.transaction(FILE_STORE_NAME, this.mode);\n this.objectStore = transaction.objectStore(FILE_STORE_NAME);\n return this.objectStore;\n};\n\nIndexedDBContext.prototype.clear = function(callback) {\n try {\n var objectStore = this._getObjectStore();\n var request = objectStore.clear();\n request.onsuccess = function() {\n callback();\n };\n request.onerror = function(event) {\n event.preventDefault();\n callback(event.error);\n };\n } catch(err) {\n callback(err);\n }\n};\n\nIndexedDBContext.prototype._get = function(key, callback) {\n try {\n var objectStore = this._getObjectStore();\n var request = objectStore.get(key);\n request.onsuccess = function onsuccess(event) {\n var result = event.target.result;\n callback(null, result);\n };\n request.onerror = function(event) {\n event.preventDefault();\n callback(event.error);\n };\n } catch(err) {\n callback(err);\n }\n};\nIndexedDBContext.prototype.getObject = function(key, callback) {\n this._get(key, callback);\n};\nIndexedDBContext.prototype.getBuffer = function(key, callback) {\n this._get(key, function(err, arrayBuffer) {\n if(err) {\n return callback(err);\n }\n callback(null, new FilerBuffer(arrayBuffer));\n });\n};\n\nIndexedDBContext.prototype._put = function(key, value, callback) {\n try {\n var objectStore = this._getObjectStore();\n var request = objectStore.put(value, key);\n request.onsuccess = function onsuccess(event) {\n var result = event.target.result;\n callback(null, result);\n };\n request.onerror = function(event) {\n event.preventDefault();\n callback(event.error);\n };\n } catch(err) {\n callback(err);\n }\n};\nIndexedDBContext.prototype.putObject = function(key, value, callback) {\n this._put(key, value, callback);\n};\nIndexedDBContext.prototype.putBuffer = function(key, uint8BackedBuffer, callback) {\n var buf = uint8BackedBuffer.buffer;\n this._put(key, buf, callback);\n};\n\nIndexedDBContext.prototype.delete = function(key, callback) {\n try {\n var objectStore = this._getObjectStore();\n var request = objectStore.delete(key);\n request.onsuccess = function onsuccess(event) {\n var result = event.target.result;\n callback(null, result);\n };\n request.onerror = function(event) {\n event.preventDefault();\n callback(event.error);\n };\n } catch(err) {\n callback(err);\n }\n};\n\n\nfunction IndexedDB(name) {\n this.name = name || FILE_SYSTEM_NAME;\n this.db = null;\n}\nIndexedDB.isSupported = function() {\n return !!indexedDB;\n};\n\nIndexedDB.prototype.open = function(callback) {\n var that = this;\n\n // Bail if we already have a db open\n if(that.db) {\n return callback();\n }\n\n try {\n // NOTE: we're not using versioned databases.\n var openRequest = indexedDB.open(that.name);\n\n // If the db doesn't exist, we'll create it\n openRequest.onupgradeneeded = function onupgradeneeded(event) {\n var db = event.target.result;\n\n if(db.objectStoreNames.contains(FILE_STORE_NAME)) {\n db.deleteObjectStore(FILE_STORE_NAME);\n }\n db.createObjectStore(FILE_STORE_NAME);\n };\n\n openRequest.onsuccess = function onsuccess(event) {\n that.db = event.target.result;\n callback();\n };\n openRequest.onerror = function onerror(event) {\n event.preventDefault();\n callback(event.error);\n };\n } catch(err) {\n callback(err);\n }\n};\n\nIndexedDB.prototype.getReadOnlyContext = function() {\n return new IndexedDBContext(this.db, IDB_RO);\n};\nIndexedDB.prototype.getReadWriteContext = function() {\n return new IndexedDBContext(this.db, IDB_RW);\n};\n\nmodule.exports = IndexedDB;\n","/*\n * base64-arraybuffer\n * https://github.com/niklasvh/base64-arraybuffer\n *\n * Copyright (c) 2012 Niklas von Hertzen\n * Licensed under the MIT license.\n */\n(function(){\n \"use strict\";\n\n var chars = \"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/\";\n\n // Use a lookup table to find the index.\n var lookup = new Uint8Array(256);\n for (var i = 0; i < chars.length; i++) {\n lookup[chars.charCodeAt(i)] = i;\n }\n\n exports.encode = function(arraybuffer) {\n var bytes = new Uint8Array(arraybuffer),\n i, len = bytes.length, base64 = \"\";\n\n for (i = 0; i < len; i+=3) {\n base64 += chars[bytes[i] >> 2];\n base64 += chars[((bytes[i] & 3) << 4) | (bytes[i + 1] >> 4)];\n base64 += chars[((bytes[i + 1] & 15) << 2) | (bytes[i + 2] >> 6)];\n base64 += chars[bytes[i + 2] & 63];\n }\n\n if ((len % 3) === 2) {\n base64 = base64.substring(0, base64.length - 1) + \"=\";\n } else if (len % 3 === 1) {\n base64 = base64.substring(0, base64.length - 2) + \"==\";\n }\n\n return base64;\n };\n\n exports.decode = function(base64) {\n var bufferLength = base64.length * 0.75,\n len = base64.length, i, p = 0,\n encoded1, encoded2, encoded3, encoded4;\n\n if (base64[base64.length - 1] === \"=\") {\n bufferLength--;\n if (base64[base64.length - 2] === \"=\") {\n bufferLength--;\n }\n }\n\n var arraybuffer = new ArrayBuffer(bufferLength),\n bytes = new Uint8Array(arraybuffer);\n\n for (i = 0; i < len; i+=4) {\n encoded1 = lookup[base64.charCodeAt(i)];\n encoded2 = lookup[base64.charCodeAt(i+1)];\n encoded3 = lookup[base64.charCodeAt(i+2)];\n encoded4 = lookup[base64.charCodeAt(i+3)];\n\n bytes[p++] = (encoded1 << 2) | (encoded2 >> 4);\n bytes[p++] = ((encoded2 & 15) << 4) | (encoded3 >> 2);\n bytes[p++] = ((encoded3 & 3) << 6) | (encoded4 & 63);\n }\n\n return arraybuffer;\n };\n})();\n","var FILE_SYSTEM_NAME = require('../constants.js').FILE_SYSTEM_NAME;\nvar FILE_STORE_NAME = require('../constants.js').FILE_STORE_NAME;\nvar WSQL_VERSION = require('../constants.js').WSQL_VERSION;\nvar WSQL_SIZE = require('../constants.js').WSQL_SIZE;\nvar WSQL_DESC = require('../constants.js').WSQL_DESC;\nvar Errors = require('../errors.js');\nvar FilerBuffer = require('../buffer.js');\nvar base64ArrayBuffer = require('base64-arraybuffer');\n\nfunction WebSQLContext(db, isReadOnly) {\n var that = this;\n this.getTransaction = function(callback) {\n if(that.transaction) {\n callback(that.transaction);\n return;\n }\n // Either do readTransaction() (read-only) or transaction() (read/write)\n db[isReadOnly ? 'readTransaction' : 'transaction'](function(transaction) {\n that.transaction = transaction;\n callback(transaction);\n });\n };\n}\n\nWebSQLContext.prototype.clear = function(callback) {\n function onError(transaction, error) {\n callback(error);\n }\n function onSuccess(transaction, result) {\n callback(null);\n }\n this.getTransaction(function(transaction) {\n transaction.executeSql(\"DELETE FROM \" + FILE_STORE_NAME + \";\",\n [], onSuccess, onError);\n });\n};\n\nfunction _get(getTransaction, key, callback) {\n function onSuccess(transaction, result) {\n // If the key isn't found, return null\n var value = result.rows.length === 0 ? null : result.rows.item(0).data;\n callback(null, value);\n }\n function onError(transaction, error) {\n callback(error);\n }\n getTransaction(function(transaction) {\n transaction.executeSql(\"SELECT data FROM \" + FILE_STORE_NAME + \" WHERE id = ? LIMIT 1;\",\n [key], onSuccess, onError);\n });\n}\nWebSQLContext.prototype.getObject = function(key, callback) {\n _get(this.getTransaction, key, function(err, result) {\n if(err) {\n return callback(err);\n }\n\n try {\n if(result) {\n result = JSON.parse(result);\n }\n } catch(e) {\n return callback(e);\n }\n\n callback(null, result);\n });\n};\nWebSQLContext.prototype.getBuffer = function(key, callback) {\n _get(this.getTransaction, key, function(err, result) {\n if(err) {\n return callback(err);\n }\n\n // Deal with zero-length ArrayBuffers, which will be encoded as ''\n if(result || result === '') {\n var arrayBuffer = base64ArrayBuffer.decode(result);\n result = new FilerBuffer(arrayBuffer);\n }\n\n callback(null, result);\n });\n};\n\nfunction _put(getTransaction, key, value, callback) {\n function onSuccess(transaction, result) {\n callback(null);\n }\n function onError(transaction, error) {\n callback(error);\n }\n getTransaction(function(transaction) {\n transaction.executeSql(\"INSERT OR REPLACE INTO \" + FILE_STORE_NAME + \" (id, data) VALUES (?, ?);\",\n [key, value], onSuccess, onError);\n });\n}\nWebSQLContext.prototype.putObject = function(key, value, callback) {\n var json = JSON.stringify(value);\n _put(this.getTransaction, key, json, callback);\n};\nWebSQLContext.prototype.putBuffer = function(key, uint8BackedBuffer, callback) {\n var base64 = base64ArrayBuffer.encode(uint8BackedBuffer.buffer);\n _put(this.getTransaction, key, base64, callback);\n};\n\nWebSQLContext.prototype.delete = function(key, callback) {\n function onSuccess(transaction, result) {\n callback(null);\n }\n function onError(transaction, error) {\n callback(error);\n }\n this.getTransaction(function(transaction) {\n transaction.executeSql(\"DELETE FROM \" + FILE_STORE_NAME + \" WHERE id = ?;\",\n [key], onSuccess, onError);\n });\n};\n\n\nfunction WebSQL(name) {\n this.name = name || FILE_SYSTEM_NAME;\n this.db = null;\n}\nWebSQL.isSupported = function() {\n return !!global.openDatabase;\n};\n\nWebSQL.prototype.open = function(callback) {\n var that = this;\n\n // Bail if we already have a db open\n if(that.db) {\n return callback();\n }\n\n var db = global.openDatabase(that.name, WSQL_VERSION, WSQL_DESC, WSQL_SIZE);\n if(!db) {\n callback(\"[WebSQL] Unable to open database.\");\n return;\n }\n\n function onError(transaction, error) {\n if (error.code === 5) {\n callback(new Errors.EINVAL('WebSQL cannot be accessed. If private browsing is enabled, disable it.'));\n }\n callback(error);\n }\n function onSuccess(transaction, result) {\n that.db = db;\n callback();\n }\n\n // Create the table and index we'll need to store the fs data.\n db.transaction(function(transaction) {\n function createIndex(transaction) {\n transaction.executeSql(\"CREATE INDEX IF NOT EXISTS idx_\" + FILE_STORE_NAME + \"_id\" +\n \" on \" + FILE_STORE_NAME + \" (id);\",\n [], onSuccess, onError);\n }\n transaction.executeSql(\"CREATE TABLE IF NOT EXISTS \" + FILE_STORE_NAME + \" (id unique, data TEXT);\",\n [], createIndex, onError);\n });\n};\nWebSQL.prototype.getReadOnlyContext = function() {\n return new WebSQLContext(this.db, true);\n};\nWebSQL.prototype.getReadWriteContext = function() {\n return new WebSQLContext(this.db, false);\n};\n\nmodule.exports = WebSQL;\n","// shim for using process in browser\nvar process = module.exports = {};\n\n// cached from whatever global is present so that test runners that stub it\n// don't break things. But we need to wrap it in a try catch in case it is\n// wrapped in strict mode code which doesn't define any globals. It's inside a\n// function because try/catches deoptimize in certain engines.\n\nvar cachedSetTimeout;\nvar cachedClearTimeout;\n\nfunction defaultSetTimout() {\n throw new Error('setTimeout has not been defined');\n}\nfunction defaultClearTimeout () {\n throw new Error('clearTimeout has not been defined');\n}\n(function () {\n try {\n if (typeof setTimeout === 'function') {\n cachedSetTimeout = setTimeout;\n } else {\n cachedSetTimeout = defaultSetTimout;\n }\n } catch (e) {\n cachedSetTimeout = defaultSetTimout;\n }\n try {\n if (typeof clearTimeout === 'function') {\n cachedClearTimeout = clearTimeout;\n } else {\n cachedClearTimeout = defaultClearTimeout;\n }\n } catch (e) {\n cachedClearTimeout = defaultClearTimeout;\n }\n} ())\nfunction runTimeout(fun) {\n if (cachedSetTimeout === setTimeout) {\n //normal enviroments in sane situations\n return setTimeout(fun, 0);\n }\n // if setTimeout wasn't available but was latter defined\n if ((cachedSetTimeout === defaultSetTimout || !cachedSetTimeout) && setTimeout) {\n cachedSetTimeout = setTimeout;\n return setTimeout(fun, 0);\n }\n try {\n // when when somebody has screwed with setTimeout but no I.E. maddness\n return cachedSetTimeout(fun, 0);\n } catch(e){\n try {\n // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally\n return cachedSetTimeout.call(null, fun, 0);\n } catch(e){\n // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error\n return cachedSetTimeout.call(this, fun, 0);\n }\n }\n\n\n}\nfunction runClearTimeout(marker) {\n if (cachedClearTimeout === clearTimeout) {\n //normal enviroments in sane situations\n return clearTimeout(marker);\n }\n // if clearTimeout wasn't available but was latter defined\n if ((cachedClearTimeout === defaultClearTimeout || !cachedClearTimeout) && clearTimeout) {\n cachedClearTimeout = clearTimeout;\n return clearTimeout(marker);\n }\n try {\n // when when somebody has screwed with setTimeout but no I.E. maddness\n return cachedClearTimeout(marker);\n } catch (e){\n try {\n // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally\n return cachedClearTimeout.call(null, marker);\n } catch (e){\n // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error.\n // Some versions of I.E. have different rules for clearTimeout vs setTimeout\n return cachedClearTimeout.call(this, marker);\n }\n }\n\n\n\n}\nvar queue = [];\nvar draining = false;\nvar currentQueue;\nvar queueIndex = -1;\n\nfunction cleanUpNextTick() {\n if (!draining || !currentQueue) {\n return;\n }\n draining = false;\n if (currentQueue.length) {\n queue = currentQueue.concat(queue);\n } else {\n queueIndex = -1;\n }\n if (queue.length) {\n drainQueue();\n }\n}\n\nfunction drainQueue() {\n if (draining) {\n return;\n }\n var timeout = runTimeout(cleanUpNextTick);\n draining = true;\n\n var len = queue.length;\n while(len) {\n currentQueue = queue;\n queue = [];\n while (++queueIndex < len) {\n if (currentQueue) {\n currentQueue[queueIndex].run();\n }\n }\n queueIndex = -1;\n len = queue.length;\n }\n currentQueue = null;\n draining = false;\n runClearTimeout(timeout);\n}\n\nprocess.nextTick = function (fun) {\n var args = new Array(arguments.length - 1);\n if (arguments.length > 1) {\n for (var i = 1; i < arguments.length; i++) {\n args[i - 1] = arguments[i];\n }\n }\n queue.push(new Item(fun, args));\n if (queue.length === 1 && !draining) {\n runTimeout(drainQueue);\n }\n};\n\n// v8 likes predictible objects\nfunction Item(fun, array) {\n this.fun = fun;\n this.array = array;\n}\nItem.prototype.run = function () {\n this.fun.apply(null, this.array);\n};\nprocess.title = 'browser';\nprocess.browser = true;\nprocess.env = {};\nprocess.argv = [];\nprocess.version = ''; // empty string to avoid regexp issues\nprocess.versions = {};\n\nfunction noop() {}\n\nprocess.on = noop;\nprocess.addListener = noop;\nprocess.once = noop;\nprocess.off = noop;\nprocess.removeListener = noop;\nprocess.removeAllListeners = noop;\nprocess.emit = noop;\nprocess.prependListener = noop;\nprocess.prependOnceListener = noop;\n\nprocess.listeners = function (name) { return [] }\n\nprocess.binding = function (name) {\n throw new Error('process.binding is not supported');\n};\n\nprocess.cwd = function () { return '/' };\nprocess.chdir = function (dir) {\n throw new Error('process.chdir is not supported');\n};\nprocess.umask = function() { return 0; };\n","/*global setImmediate: false, setTimeout: false, console: false */\n\n/**\n * async.js shim, based on https://raw.github.com/caolan/async/master/lib/async.js Feb 18, 2014\n * Used under MIT - https://github.com/caolan/async/blob/master/LICENSE\n */\n\n(function () {\n\n var async = {};\n\n // async.js functions used in Filer\n\n //// nextTick implementation with browser-compatible fallback ////\n if (typeof process === 'undefined' || !(process.nextTick)) {\n if (typeof setImmediate === 'function') {\n async.nextTick = function (fn) {\n // not a direct alias for IE10 compatibility\n setImmediate(fn);\n };\n async.setImmediate = async.nextTick;\n }\n else {\n async.nextTick = function (fn) {\n setTimeout(fn, 0);\n };\n async.setImmediate = async.nextTick;\n }\n }\n else {\n async.nextTick = process.nextTick;\n if (typeof setImmediate !== 'undefined') {\n async.setImmediate = function (fn) {\n // not a direct alias for IE10 compatibility\n setImmediate(fn);\n };\n }\n else {\n async.setImmediate = async.nextTick;\n }\n }\n\n async.eachSeries = function (arr, iterator, callback) {\n callback = callback || function () {};\n if (!arr.length) {\n return callback();\n }\n var completed = 0;\n var iterate = function () {\n iterator(arr[completed], function (err) {\n if (err) {\n callback(err);\n callback = function () {};\n }\n else {\n completed += 1;\n if (completed >= arr.length) {\n callback();\n }\n else {\n iterate();\n }\n }\n });\n };\n iterate();\n };\n async.forEachSeries = async.eachSeries;\n\n // AMD / RequireJS\n if (typeof define !== 'undefined' && define.amd) {\n define([], function () {\n return async;\n });\n }\n // Node.js\n else if (typeof module !== 'undefined' && module.exports) {\n module.exports = async;\n }\n // included directly via