From dd7536827bdb96caa2e7473911ebf8de8bac88a0 Mon Sep 17 00:00:00 2001 From: David Humphrey Date: Wed, 2 Jan 2019 23:12:19 -0500 Subject: [PATCH] Release 1.1.0 --- dist/filer.js | 1117 +++++++++++++++++++-------------------------- dist/filer.map | 2 +- dist/filer.min.js | 43 +- package.json | 2 +- 4 files changed, 488 insertions(+), 676 deletions(-) diff --git a/dist/filer.js b/dist/filer.js index 1ec2776..53a41be 100644 --- a/dist/filer.js +++ b/dist/filer.js @@ -110,9 +110,9 @@ parcelRequire = (function (modules, cache, entry, globalName) { 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__"; +// Symbols is a better way to do this, but not all browsers have good support, +// so instead we'll just make do with a very unlikely string. +var customArgumentsToken = "__ES6-PROMISIFY--CUSTOM-ARGUMENTS__"; /** * promisify() @@ -3059,366 +3059,7 @@ IndexedDB.prototype.getReadWriteContext = function () { }; module.exports = IndexedDB; -},{"../constants.js":"iJA9","buffer":"dskh"}],"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; -},{}],"vLJO":[function(require,module,exports) { -/* - * base64-arraybuffer - * https://github.com/niklasvh/base64-arraybuffer - * - * Copyright (c) 2012 Niklas von Hertzen - * Licensed under the MIT license. - */ -(function () { - "use strict"; - - var chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"; // Use a lookup table to find the index. - - var lookup = new Uint8Array(256); - - for (var i = 0; i < chars.length; i++) { - lookup[chars.charCodeAt(i)] = i; - } - - exports.encode = function (arraybuffer) { - var bytes = new Uint8Array(arraybuffer), - i, - len = bytes.length, - base64 = ""; - - for (i = 0; i < len; i += 3) { - base64 += chars[bytes[i] >> 2]; - base64 += chars[(bytes[i] & 3) << 4 | bytes[i + 1] >> 4]; - base64 += chars[(bytes[i + 1] & 15) << 2 | bytes[i + 2] >> 6]; - base64 += chars[bytes[i + 2] & 63]; - } - - if (len % 3 === 2) { - base64 = base64.substring(0, base64.length - 1) + "="; - } else if (len % 3 === 1) { - base64 = base64.substring(0, base64.length - 2) + "=="; - } - - return base64; - }; - - exports.decode = function (base64) { - var bufferLength = base64.length * 0.75, - len = base64.length, - i, - p = 0, - encoded1, - encoded2, - encoded3, - encoded4; - - if (base64[base64.length - 1] === "=") { - bufferLength--; - - if (base64[base64.length - 2] === "=") { - bufferLength--; - } - } - - var arraybuffer = new ArrayBuffer(bufferLength), - bytes = new Uint8Array(arraybuffer); - - for (i = 0; i < len; i += 4) { - encoded1 = lookup[base64.charCodeAt(i)]; - encoded2 = lookup[base64.charCodeAt(i + 1)]; - encoded3 = lookup[base64.charCodeAt(i + 2)]; - encoded4 = lookup[base64.charCodeAt(i + 3)]; - bytes[p++] = encoded1 << 2 | encoded2 >> 4; - bytes[p++] = (encoded2 & 15) << 4 | encoded3 >> 2; - bytes[p++] = (encoded3 & 3) << 6 | encoded4 & 63; - } - - return arraybuffer; - }; -})(); -},{}],"hW+K":[function(require,module,exports) { -var Buffer = require("buffer").Buffer; -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 WSQL_VERSION = require('../constants.js').WSQL_VERSION; - -var WSQL_SIZE = require('../constants.js').WSQL_SIZE; - -var WSQL_DESC = require('../constants.js').WSQL_DESC; - -var Errors = require('../errors.js'); - -var base64ArrayBuffer = require('base64-arraybuffer'); - -function WebSQLContext(db, isReadOnly) { - var that = this; - - this.getTransaction = function (callback) { - if (that.transaction) { - callback(that.transaction); - return; - } // Either do readTransaction() (read-only) or transaction() (read/write) - - - db[isReadOnly ? 'readTransaction' : 'transaction'](function (transaction) { - that.transaction = transaction; - callback(transaction); - }); - }; -} - -WebSQLContext.prototype.clear = function (callback) { - function onError(transaction, error) { - callback(error); - } - - function onSuccess() { - callback(null); - } - - this.getTransaction(function (transaction) { - transaction.executeSql('DELETE FROM ' + FILE_STORE_NAME + ';', [], onSuccess, onError); - }); -}; - -function _get(getTransaction, key, callback) { - function onSuccess(transaction, result) { - // If the key isn't found, return null - var value = result.rows.length === 0 ? null : result.rows.item(0).data; - callback(null, value); - } - - function onError(transaction, error) { - callback(error); - } - - getTransaction(function (transaction) { - transaction.executeSql('SELECT data FROM ' + FILE_STORE_NAME + ' WHERE id = ? LIMIT 1;', [key], onSuccess, onError); - }); -} - -WebSQLContext.prototype.getObject = function (key, callback) { - _get(this.getTransaction, key, function (err, result) { - if (err) { - return callback(err); - } - - try { - if (result) { - result = JSON.parse(result); - } - } catch (e) { - return callback(e); - } - - callback(null, result); - }); -}; - -WebSQLContext.prototype.getBuffer = function (key, callback) { - _get(this.getTransaction, key, function (err, result) { - if (err) { - return callback(err); - } // Deal with zero-length ArrayBuffers, which will be encoded as '' - - - if (result || result === '') { - var arrayBuffer = base64ArrayBuffer.decode(result); - result = Buffer.from(arrayBuffer); - } - - callback(null, result); - }); -}; - -function _put(getTransaction, key, value, callback) { - 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); - }); -} - -WebSQLContext.prototype.putObject = function (key, value, callback) { - var json = JSON.stringify(value); - - _put(this.getTransaction, key, json, callback); -}; - -WebSQLContext.prototype.putBuffer = function (key, uint8BackedBuffer, callback) { - var base64 = base64ArrayBuffer.encode(uint8BackedBuffer.buffer); - - _put(this.getTransaction, key, base64, callback); -}; - -WebSQLContext.prototype.delete = function (key, callback) { - 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); - }); -}; - -function WebSQL(name) { - this.name = name || FILE_SYSTEM_NAME; - this.db = null; -} - -WebSQL.isSupported = function () { - return !!global.openDatabase; -}; - -WebSQL.prototype.open = function (callback) { - var that = this; // Bail if we already have a db open - - if (that.db) { - return callback(); - } - - var db = global.openDatabase(that.name, WSQL_VERSION, WSQL_DESC, WSQL_SIZE); - - if (!db) { - callback('[WebSQL] Unable to open database.'); - return; - } - - function onError(transaction, error) { - if (error.code === 5) { - callback(new Errors.EINVAL('WebSQL cannot be accessed. If private browsing is enabled, disable it.')); - } - - callback(error); - } - - function onSuccess() { - that.db = db; - 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 TABLE IF NOT EXISTS ' + FILE_STORE_NAME + ' (id unique, data TEXT);', [], createIndex, onError); - }); -}; - -WebSQL.prototype.getReadOnlyContext = function () { - return new WebSQLContext(this.db, true); -}; - -WebSQL.prototype.getReadWriteContext = function () { - return new WebSQLContext(this.db, false); -}; - -module.exports = WebSQL; -},{"../constants.js":"iJA9","../errors.js":"p8GN","base64-arraybuffer":"vLJO","buffer":"dskh"}],"u4Zs":[function(require,module,exports) { +},{"../constants.js":"iJA9","buffer":"dskh"}],"u4Zs":[function(require,module,exports) { var process = require("process"); var define; /*global setImmediate: false, setTimeout: false, console: false */ @@ -3602,42 +3243,105 @@ module.exports = Memory; },{"../constants.js":"iJA9","../../lib/async.js":"u4Zs"}],"AiW7":[function(require,module,exports) { var IndexedDB = require('./indexeddb.js'); -var WebSQL = require('./websql.js'); - var Memory = require('./memory.js'); module.exports = { IndexedDB: IndexedDB, - WebSQL: WebSQL, - Memory: Memory, - - /** - * Convenience Provider references - */ - // The default provider to use when none is specified Default: IndexedDB, - // The Fallback provider does automatic fallback checks - Fallback: function () { - if (IndexedDB.isSupported()) { - return IndexedDB; - } - - if (WebSQL.isSupported()) { - return WebSQL; - } - - function NotSupported() { - throw '[Filer Error] Your browser doesn\'t support IndexedDB or WebSQL.'; - } - - NotSupported.isSupported = function () { - return false; - }; - - return NotSupported; - }() + Memory: Memory }; -},{"./indexeddb.js":"QO4x","./websql.js":"hW+K","./memory.js":"3OWy"}],"QMiB":[function(require,module,exports) { +},{"./indexeddb.js":"QO4x","./memory.js":"3OWy"}],"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; +},{}],"QMiB":[function(require,module,exports) { var defaults = require('../constants.js').ENVIRONMENT; module.exports = function Environment(env) { @@ -5954,7 +5658,61 @@ module.exports = function DirectoryEntry(id, type) { this.id = id; this.type = type || NODE_TYPE_FILE; }; -},{"./constants.js":"iJA9"}],"KKNo":[function(require,module,exports) { +},{"./constants.js":"iJA9"}],"osLK":[function(require,module,exports) { +var _require = require('./constants'), + FIRST_DESCRIPTOR = _require.FIRST_DESCRIPTOR; + +var openFiles = {}; +/** + * Start at FIRST_DESCRIPTOR and go until we find + * an empty file descriptor, then return it. + */ + +var getEmptyDescriptor = function getEmptyDescriptor() { + var fd = FIRST_DESCRIPTOR; + + while (getOpenFileDescription(fd)) { + fd++; + } + + return fd; +}; +/** + * Look up the open file description object for a given + * file descriptor. + */ + + +var getOpenFileDescription = function getOpenFileDescription(ofd) { + return openFiles[ofd]; +}; +/** + * Allocate a new file descriptor for the given + * open file description. + */ + + +var allocDescriptor = function allocDescriptor(openFileDescription) { + var ofd = getEmptyDescriptor(); + openFiles[ofd] = openFileDescription; + return ofd; +}; +/** + * Release the given existing file descriptor created + * with allocDescriptor(). + */ + + +var releaseDescriptor = function releaseDescriptor(ofd) { + return delete openFiles[ofd]; +}; + +module.exports = { + allocDescriptor: allocDescriptor, + releaseDescriptor: releaseDescriptor, + getOpenFileDescription: getOpenFileDescription +}; +},{"./constants":"iJA9"}],"KKNo":[function(require,module,exports) { function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } @@ -6239,7 +5997,6 @@ var normalize = Path.normalize; var dirname = Path.dirname; var basename = Path.basename; var isAbsolutePath = Path.isAbsolute; -var isNullPath = Path.isNull; var shared = require('../shared.js'); @@ -6270,6 +6027,8 @@ var Errors = require('../errors.js'); var DirectoryEntry = require('../directory-entry.js'); +var openFiles = require('../open-files.js'); + var OpenFileDescription = require('../open-file-description.js'); var SuperNode = require('../super-node.js'); @@ -7942,40 +7701,14 @@ function validate_file_options(options, enc, fileMode) { return options; } -function pathCheck(path, allowRelative, callback) { - var err; - - if (typeof allowRelative === 'function') { - callback = allowRelative; - allowRelative = false; - } - - if (!path) { - err = new Errors.EINVAL('Path must be a string', path); - } else if (isNullPath(path)) { - err = new Errors.EINVAL('Path must be a string without null bytes.', path); - } else if (!allowRelative && !isAbsolutePath(path)) { - err = new Errors.EINVAL('Path must be absolute.', path); - } - - if (err) { - callback(err); - return false; - } - - return true; -} - -function open(fs, context, path, flags, mode, callback) { - if (arguments.length < 6) { +function open(context, path, flags, mode, callback) { + if (arguments.length < 5) { callback = arguments[arguments.length - 1]; mode = 420; } else { mode = validateAndMaskMode(mode, FULL_READ_WRITE_EXEC_PERMISSIONS, callback); } - if (!pathCheck(path, callback)) return; - function check_result(error, fileNode) { if (error) { callback(error); @@ -7989,7 +7722,7 @@ function open(fs, context, path, flags, mode, callback) { } var openFileDescription = new OpenFileDescription(path, fileNode.id, flags, position); - var fd = fs.allocDescriptor(openFileDescription); + var fd = openFiles.allocDescriptor(openFileDescription); callback(null, fd); } } @@ -8003,22 +7736,21 @@ function open(fs, context, path, flags, mode, callback) { open_file(context, path, flags, mode, check_result); } -function close(fs, context, fd, callback) { - if (!fs.openFiles[fd]) { +function close(context, fd, callback) { + if (!openFiles.getOpenFileDescription(fd)) { callback(new Errors.EBADF()); } else { - fs.releaseDescriptor(fd); + openFiles.releaseDescriptor(fd); callback(null); } } -function mknod(fs, context, path, type, callback) { - if (!pathCheck(path, callback)) return; +function mknod(context, path, type, callback) { make_node(context, path, type, callback); } -function mkdir(fs, context, path, mode, callback) { - if (arguments.length < 5) { +function mkdir(context, path, mode, callback) { + if (arguments.length < 4) { callback = mode; mode = FULL_READ_WRITE_EXEC_PERMISSIONS; } else { @@ -8026,22 +7758,20 @@ function mkdir(fs, context, path, mode, callback) { if (!mode) return; } - if (!pathCheck(path, callback)) return; make_directory(context, path, callback); } -function access(fs, context, path, mode, callback) { +function access(context, path, mode, callback) { if (typeof mode === 'function') { callback = mode; mode = Constants.fsConstants.F_OK; } - if (!pathCheck(path, callback)) return; mode = mode | Constants.fsConstants.F_OK; access_file(context, path, mode, callback); } -function mkdtemp(fs, context, prefix, options, callback) { +function mkdtemp(context, prefix, options, callback) { callback = arguments[arguments.length - 1]; if (!prefix) { @@ -8050,25 +7780,21 @@ function mkdtemp(fs, context, prefix, options, callback) { var random = shared.randomChars(6); var path = prefix + '-' + random; - if (!pathCheck(path, callback)) return; make_directory(context, path, function (error) { callback(error, path); }); } -function rmdir(fs, context, path, callback) { - if (!pathCheck(path, callback)) return; +function rmdir(context, path, callback) { remove_directory(context, path, callback); } -function stat(fs, context, path, callback) { - if (!pathCheck(path, callback)) return; - +function stat(context, path, callback) { function check_result(error, result) { if (error) { callback(error); } else { - var stats = new Stats(path, result, fs.name); + var stats = new Stats(path, result, context.name); callback(null, stats); } } @@ -8076,17 +7802,17 @@ function stat(fs, context, path, callback) { stat_file(context, path, check_result); } -function fstat(fs, context, fd, callback) { +function fstat(context, fd, callback) { function check_result(error, result) { if (error) { callback(error); } else { - var stats = new Stats(ofd.path, result, fs.name); + var stats = new Stats(ofd.path, result, context.name); callback(null, stats); } } - var ofd = fs.openFiles[fd]; + var ofd = openFiles.getOpenFileDescription(fd); if (!ofd) { callback(new Errors.EBADF()); @@ -8095,18 +7821,15 @@ function fstat(fs, context, fd, callback) { } } -function link(fs, context, oldpath, newpath, callback) { - if (!pathCheck(oldpath, callback)) return; - if (!pathCheck(newpath, callback)) return; +function link(context, oldpath, newpath, callback) { link_node(context, oldpath, newpath, callback); } -function unlink(fs, context, path, callback) { - if (!pathCheck(path, callback)) return; +function unlink(context, path, callback) { unlink_node(context, path, callback); } -function read(fs, context, fd, buffer, offset, length, position, callback) { +function read(context, fd, buffer, offset, length, position, callback) { // Follow how node.js does this function wrapped_cb(err, bytesRead) { // Retain a reference to buffer so that it can't be GC'ed too soon. @@ -8116,7 +7839,7 @@ function read(fs, context, fd, buffer, offset, length, position, callback) { offset = undefined === offset ? 0 : offset; length = undefined === length ? buffer.length - offset : length; callback = arguments[arguments.length - 1]; - var ofd = fs.openFiles[fd]; + var ofd = openFiles.getOpenFileDescription(fd); if (!ofd) { callback(new Errors.EBADF()); @@ -8127,9 +7850,9 @@ function read(fs, context, fd, buffer, offset, length, position, callback) { } } -function fsync(fs, context, fd, callback) { +function fsync(context, fd, callback) { if (validateInteger(fd, callback) !== fd) return; - var ofd = fs.openFiles[fd]; + var ofd = openFiles.getOpenFileDescription(fd); if (!ofd) { callback(new Errors.EBADF()); @@ -8138,10 +7861,9 @@ function fsync(fs, context, fd, callback) { } } -function readFile(fs, context, path, options, callback) { +function readFile(context, path, options, callback) { callback = arguments[arguments.length - 1]; options = validate_file_options(options, null, 'r'); - if (!pathCheck(path, callback)) return; var flags = validate_flags(options.flag || 'r'); if (!flags) { @@ -8154,10 +7876,10 @@ function readFile(fs, context, path, options, callback) { } var ofd = new OpenFileDescription(path, fileNode.id, flags, 0); - var fd = fs.allocDescriptor(ofd); + var fd = openFiles.allocDescriptor(ofd); function cleanup() { - fs.releaseDescriptor(fd); + openFiles.releaseDescriptor(fd); } fstat_file(context, ofd, function (err, fstatResult) { @@ -8166,7 +7888,7 @@ function readFile(fs, context, path, options, callback) { return callback(err); } - var stats = new Stats(ofd.path, fstatResult, fs.name); + var stats = new Stats(ofd.path, fstatResult, context.name); if (stats.isDirectory()) { cleanup(); @@ -8196,11 +7918,11 @@ function readFile(fs, context, path, options, callback) { }); } -function write(fs, context, fd, buffer, offset, length, position, callback) { +function write(context, fd, buffer, offset, length, position, callback) { callback = arguments[arguments.length - 1]; offset = undefined === offset ? 0 : offset; length = undefined === length ? buffer.length - offset : length; - var ofd = fs.openFiles[fd]; + var ofd = openFiles.getOpenFileDescription(fd); if (!ofd) { callback(new Errors.EBADF()); @@ -8213,10 +7935,9 @@ function write(fs, context, fd, buffer, offset, length, position, callback) { } } -function writeFile(fs, context, path, data, options, callback) { +function writeFile(context, path, data, options, callback) { callback = arguments[arguments.length - 1]; options = validate_file_options(options, 'utf8', 'w'); - if (!pathCheck(path, callback)) return; var flags = validate_flags(options.flag || 'w'); if (!flags) { @@ -8239,9 +7960,9 @@ function writeFile(fs, context, path, data, options, callback) { } var ofd = new OpenFileDescription(path, fileNode.id, flags, 0); - var fd = fs.allocDescriptor(ofd); + var fd = openFiles.allocDescriptor(ofd); replace_data(context, ofd, data, 0, data.length, function (err) { - fs.releaseDescriptor(fd); + openFiles.releaseDescriptor(fd); if (err) { return callback(err); @@ -8252,10 +7973,9 @@ function writeFile(fs, context, path, data, options, callback) { }); } -function appendFile(fs, context, path, data, options, callback) { +function appendFile(context, path, data, options, callback) { callback = arguments[arguments.length - 1]; options = validate_file_options(options, 'utf8', 'a'); - if (!pathCheck(path, callback)) return; var flags = validate_flags(options.flag || 'a'); if (!flags) { @@ -8278,9 +7998,9 @@ function appendFile(fs, context, path, data, options, callback) { } var ofd = new OpenFileDescription(path, fileNode.id, flags, fileNode.size); - var fd = fs.allocDescriptor(ofd); + var fd = openFiles.allocDescriptor(ofd); write_data(context, ofd, data, 0, data.length, ofd.position, function (err) { - fs.releaseDescriptor(fd); + openFiles.releaseDescriptor(fd); if (err) { return callback(err); @@ -8291,12 +8011,12 @@ function appendFile(fs, context, path, data, options, callback) { }); } -function exists(fs, context, path, callback) { +function exists(context, path, callback) { function cb(err) { callback(err ? false : true); } - stat(fs, context, path, cb); + stat(context, path, cb); } function validateInteger(value, callback) { @@ -8431,13 +8151,12 @@ function fchown_file(context, ofd, uid, gid, callback) { ofd.getNode(context, update_owner); } -function getxattr(fs, context, path, name, callback) { - if (!pathCheck(path, callback)) return; +function getxattr(context, path, name, callback) { getxattr_file(context, path, name, callback); } -function fgetxattr(fs, context, fd, name, callback) { - var ofd = fs.openFiles[fd]; +function fgetxattr(context, fd, name, callback) { + var ofd = openFiles.getOpenFileDescription(fd); if (!ofd) { callback(new Errors.EBADF()); @@ -8446,23 +8165,22 @@ function fgetxattr(fs, context, fd, name, callback) { } } -function setxattr(fs, context, path, name, value, flag, callback) { +function setxattr(context, path, name, value, flag, callback) { if (typeof flag === 'function') { callback = flag; flag = null; } - if (!pathCheck(path, callback)) return; setxattr_file(context, path, name, value, flag, callback); } -function fsetxattr(fs, context, fd, name, value, flag, callback) { +function fsetxattr(context, fd, name, value, flag, callback) { if (typeof flag === 'function') { callback = flag; flag = null; } - var ofd = fs.openFiles[fd]; + var ofd = openFiles.getOpenFileDescription(fd); if (!ofd) { callback(new Errors.EBADF()); @@ -8473,13 +8191,12 @@ function fsetxattr(fs, context, fd, name, value, flag, callback) { } } -function removexattr(fs, context, path, name, callback) { - if (!pathCheck(path, callback)) return; +function removexattr(context, path, name, callback) { removexattr_file(context, path, name, callback); } -function fremovexattr(fs, context, fd, name, callback) { - var ofd = fs.openFiles[fd]; +function fremovexattr(context, fd, name, callback) { + var ofd = openFiles.getOpenFileDescription(fd); if (!ofd) { callback(new Errors.EBADF()); @@ -8490,7 +8207,7 @@ function fremovexattr(fs, context, fd, name, callback) { } } -function lseek(fs, context, fd, offset, whence, callback) { +function lseek(context, fd, offset, whence, callback) { function update_descriptor_position(error, stats) { if (error) { callback(error); @@ -8504,7 +8221,7 @@ function lseek(fs, context, fd, offset, whence, callback) { } } - var ofd = fs.openFiles[fd]; + var ofd = openFiles.getOpenFileDescription(fd); if (!ofd) { callback(new Errors.EBADF()); @@ -8531,8 +8248,7 @@ function lseek(fs, context, fd, offset, whence, callback) { } } -function readdir(fs, context, path, callback) { - if (!pathCheck(path, callback)) return; +function readdir(context, path, callback) { read_directory(context, path, callback); } @@ -8546,19 +8262,18 @@ function toUnixTimestamp(time) { } } -function utimes(fs, context, path, atime, mtime, callback) { - if (!pathCheck(path, callback)) return; +function utimes(context, path, atime, mtime, callback) { var currentTime = Date.now(); atime = atime ? toUnixTimestamp(atime) : toUnixTimestamp(currentTime); mtime = mtime ? toUnixTimestamp(mtime) : toUnixTimestamp(currentTime); utimes_file(context, path, atime, mtime, callback); } -function futimes(fs, context, fd, atime, mtime, callback) { +function futimes(context, fd, atime, mtime, callback) { var currentTime = Date.now(); atime = atime ? toUnixTimestamp(atime) : toUnixTimestamp(currentTime); mtime = mtime ? toUnixTimestamp(mtime) : toUnixTimestamp(currentTime); - var ofd = fs.openFiles[fd]; + var ofd = openFiles.getOpenFileDescription(fd); if (!ofd) { callback(new Errors.EBADF()); @@ -8569,17 +8284,16 @@ function futimes(fs, context, fd, atime, mtime, callback) { } } -function chmod(fs, context, path, mode, callback) { - if (!pathCheck(path, callback)) return; +function chmod(context, path, mode, callback) { mode = validateAndMaskMode(mode, callback); if (!mode) return; chmod_file(context, path, mode, callback); } -function fchmod(fs, context, fd, mode, callback) { +function fchmod(context, fd, mode, callback) { mode = validateAndMaskMode(mode, callback); if (!mode) return; - var ofd = fs.openFiles[fd]; + var ofd = openFiles.getOpenFileDescription(fd); if (!ofd) { callback(new Errors.EBADF()); @@ -8590,9 +8304,7 @@ function fchmod(fs, context, fd, mode, callback) { } } -function chown(fs, context, path, uid, gid, callback) { - if (!pathCheck(path, callback)) return; - +function chown(context, path, uid, gid, callback) { if (!isUint32(uid)) { return callback(new Errors.EINVAL('uid must be a valid integer', uid)); } @@ -8604,7 +8316,7 @@ function chown(fs, context, path, uid, gid, callback) { chown_file(context, path, uid, gid, callback); } -function fchown(fs, context, fd, uid, gid, callback) { +function fchown(context, fd, uid, gid, callback) { if (!isUint32(uid)) { return callback(new Errors.EINVAL('uid must be a valid integer', uid)); } @@ -8613,7 +8325,7 @@ function fchown(fs, context, fd, uid, gid, callback) { return callback(new Errors.EINVAL('gid must be a valid integer', gid)); } - var ofd = fs.openFiles[fd]; + var ofd = openFiles.getOpenFileDescription(fd); if (!ofd) { callback(new Errors.EBADF()); @@ -8624,9 +8336,7 @@ function fchown(fs, context, fd, uid, gid, callback) { } } -function rename(fs, context, oldpath, newpath, callback) { - if (!pathCheck(oldpath, callback)) return; - if (!pathCheck(newpath, callback)) return; +function rename(context, oldpath, newpath, callback) { oldpath = normalize(oldpath); newpath = normalize(newpath); var oldParentPath = Path.dirname(oldpath); @@ -8741,29 +8451,22 @@ function rename(fs, context, oldpath, newpath, callback) { find_node(context, oldpath, check_node_type); } -function symlink(fs, context, srcpath, dstpath, type, callback) { +function symlink(context, srcpath, dstpath, type, callback) { // NOTE: we support passing the `type` arg, but ignore it. - callback = arguments[arguments.length - 1]; // Special Case: allow srcpath to be relative, which we normally don't permit. - // If the srcpath is relative, we assume it's relative to the dirpath of dstpath. - - if (!pathCheck(srcpath, true, callback)) return; - if (!pathCheck(dstpath, callback)) return; + callback = arguments[arguments.length - 1]; make_symbolic_link(context, srcpath, dstpath, callback); } -function readlink(fs, context, path, callback) { - if (!pathCheck(path, callback)) return; +function readlink(context, path, callback) { read_link(context, path, callback); } -function lstat(fs, context, path, callback) { - if (!pathCheck(path, callback)) return; - +function lstat(context, path, callback) { function check_result(error, result) { if (error) { callback(error); } else { - var stats = new Stats(path, result, fs.name); + var stats = new Stats(path, result, context.name); callback(null, stats); } } @@ -8771,20 +8474,19 @@ function lstat(fs, context, path, callback) { lstat_file(context, path, check_result); } -function truncate(fs, context, path, length, callback) { +function truncate(context, path, length, callback) { // NOTE: length is optional callback = arguments[arguments.length - 1]; length = length || 0; - if (!pathCheck(path, callback)) return; if (validateInteger(length, callback) !== length) return; truncate_file(context, path, length, callback); } -function ftruncate(fs, context, fd, length, callback) { +function ftruncate(context, fd, length, callback) { // NOTE: length is optional callback = arguments[arguments.length - 1]; length = length || 0; - var ofd = fs.openFiles[fd]; + var ofd = openFiles.getOpenFileDescription(fd); if (!ofd) { callback(new Errors.EBADF()); @@ -8797,51 +8499,60 @@ function ftruncate(fs, context, fd, length, callback) { } module.exports = { - ensureRootDirectory: ensure_root_directory, - open: open, - chmod: chmod, + appendFile: appendFile, access: access, - fchmod: fchmod, chown: chown, - fchown: fchown, + chmod: chmod, close: close, - mknod: mknod, + // copyFile - https://github.com/filerjs/filer/issues/436 + ensureRootDirectory: ensure_root_directory, + exists: exists, + fchown: fchown, + fchmod: fchmod, + // fdatasync - https://github.com/filerjs/filer/issues/653 + fgetxattr: fgetxattr, + fremovexattr: fremovexattr, + fsetxattr: fsetxattr, + fstat: fstat, + fsync: fsync, + ftruncate: ftruncate, + futimes: futimes, + getxattr: getxattr, + // lchown - https://github.com/filerjs/filer/issues/620 + // lchmod - https://github.com/filerjs/filer/issues/619 + link: link, + lseek: lseek, + lstat: lstat, mkdir: mkdir, mkdtemp: mkdtemp, - rmdir: rmdir, - unlink: unlink, - stat: stat, - fstat: fstat, - link: link, - fsync: fsync, + mknod: mknod, + open: open, + readdir: readdir, read: read, readFile: readFile, - write: write, - writeFile: writeFile, - appendFile: appendFile, - exists: exists, - getxattr: getxattr, - fgetxattr: fgetxattr, - setxattr: setxattr, - fsetxattr: fsetxattr, - removexattr: removexattr, - fremovexattr: fremovexattr, - lseek: lseek, - readdir: readdir, - utimes: utimes, - futimes: futimes, - rename: rename, - symlink: symlink, readlink: readlink, - lstat: lstat, + // realpath - https://github.com/filerjs/filer/issues/85 + removexattr: removexattr, + rename: rename, + rmdir: rmdir, + setxattr: setxattr, + stat: stat, + symlink: symlink, truncate: truncate, - ftruncate: ftruncate + // unwatchFile - implemented in interface.js + unlink: unlink, + utimes: utimes, + // watch - implemented in interface.js + // watchFile - implemented in interface.js + writeFile: writeFile, + write: write }; -},{"../path.js":"UzoP","../shared.js":"3zBM","../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":"dskh"}],"GMi4":[function(require,module,exports) { +},{"../path.js":"UzoP","../shared.js":"3zBM","../constants.js":"iJA9","../encoding.js":"03yF","../errors.js":"p8GN","../directory-entry.js":"ZECt","../open-files.js":"osLK","../open-file-description.js":"XWaV","../super-node.js":"33JE","../node.js":"KKNo","../stats.js":"6dsC","buffer":"dskh"}],"GMi4":[function(require,module,exports) { +var Buffer = require("buffer").Buffer; var _require = require('es6-promisify'), promisify = _require.promisify; -var isNullPath = require('../path.js').isNull; +var Path = require('../path.js'); var nop = require('../shared.js').nop; @@ -8868,8 +8579,7 @@ var defaultGuidFn = require('../shared.js').guid; var STDIN = Constants.STDIN; var STDOUT = Constants.STDOUT; -var STDERR = Constants.STDERR; -var FIRST_DESCRIPTOR = Constants.FIRST_DESCRIPTOR; // The core fs operations live on impl +var STDERR = Constants.STDERR; // The core fs operations live on impl var impl = require('./implementation.js'); // node.js supports a calling pattern that leaves off a callback. @@ -8892,6 +8602,62 @@ function defaultCallback(err) { /* eslint no-console: 0 */ console.error('Filer error: ', err); } +} // Get a path (String) from a file:// URL. Support URL() like objects +// https://github.com/nodejs/node/blob/968e901aff38a343b1de4addebf79fd8fa991c59/lib/internal/url.js#L1381 + + +function toPathIfFileURL(fileURLOrPath) { + if (!(fileURLOrPath && fileURLOrPath.protocol && fileURLOrPath.pathname)) { + return fileURLOrPath; + } + + if (fileURLOrPath.protocol !== 'file:') { + throw new Errors.EINVAL('only file: URLs are supported for paths', fileURLOrPath); + } + + var pathname = fileURLOrPath.pathname; + + for (var n = 0; n < pathname.length; n++) { + if (pathname[n] === '%') { + var third = pathname.codePointAt(n + 2) | 0x20; + + if (pathname[n + 1] === '2' && third === 102) { + throw new Errors.EINVAL('file: URLs must not include encoded / characters', fileURLOrPath); + } + } + } + + return decodeURIComponent(pathname); +} // Allow Buffers for paths. Assumes we want UTF8. + + +function toPathIfBuffer(bufferOrPath) { + return Buffer.isBuffer(bufferOrPath) ? bufferOrPath.toString() : bufferOrPath; +} + +function validatePath(path, allowRelative) { + if (!path) { + return new Errors.EINVAL('Path must be a string', path); + } else if (Path.isNull(path)) { + return new Errors.EINVAL('Path must be a string without null bytes.', path); + } else if (!allowRelative && !Path.isAbsolute(path)) { + return new Errors.EINVAL('Path must be absolute.', path); + } +} + +function processPathArg(args, idx, allowRelative) { + var path = args[idx]; + path = toPathIfFileURL(path); + path = toPathIfBuffer(path); // Some methods specifically allow for rel paths (eg symlink with srcPath) + + var err = validatePath(path, allowRelative); + + if (err) { + throw err; + } // Overwrite path arg with converted and validated path + + + args[idx] = path; } /** * FileSystem @@ -8940,29 +8706,14 @@ function FileSystem(options, callback) { fs.stdout = STDOUT; fs.stderr = STDERR; // Expose Node's fs.constants to users - fs.constants = Constants.fsConstants; // Expose Shell constructor + fs.constants = Constants.fsConstants; // Node also forwards the access mode flags onto fs - this.Shell = Shell.bind(undefined, this); // Safely expose the list of open files and file - // descriptor management functions - - var openFiles = {}; - var nextDescriptor = FIRST_DESCRIPTOR; - Object.defineProperty(this, 'openFiles', { - get: function get() { - return openFiles; - } - }); - - this.allocDescriptor = function (openFileDescription) { - var fd = nextDescriptor++; - openFiles[fd] = openFileDescription; - return fd; - }; - - this.releaseDescriptor = function (fd) { - delete openFiles[fd]; - }; // Safely expose the operation queue + fs.F_OK = Constants.fsConstants.F_OK; + fs.R_OK = Constants.fsConstants.R_OK; + fs.W_OK = Constants.fsConstants.W_OK; + fs.X_OK = Constants.fsConstants.X_OK; // Expose Shell constructor + this.Shell = Shell.bind(undefined, this); // Safely expose the operation queue var queue = []; @@ -8989,7 +8740,7 @@ function FileSystem(options, callback) { this.watch = function (filename, options, listener) { - if (isNullPath(filename)) { + if (Path.isNull(filename)) { throw new Error('Path must be a string without null bytes.'); } @@ -9055,6 +8806,7 @@ function FileSystem(options, callback) { function complete(error) { function wrappedContext(methodName) { var context = provider[methodName](); + context.name = name; context.flags = flags; context.changes = []; context.guid = wrappedGuidFn(context); // When the context is finished, let the fs deal with any change events @@ -9114,112 +8866,146 @@ function FileSystem(options, callback) { }); FileSystem.prototype.promises = {}; /** - * Public API for FileSystem. All node.js methods that are - * exposed on fs.promises include `promise: true`. We also - * include our own extra methods, but skip the fd versions - * to match node.js, which puts these on a FileHandle object. + * Public API for FileSystem. All node.js methods that are exposed on fs.promises + * include `promise: true`. We also include our own extra methods, but skip the + * fd versions to match node.js, which puts these on a `FileHandle` object. + * Any method that deals with path argument(s) also includes the position of + * those args in one of `absPathArgs: [...]` or `relPathArgs: [...]`, so they + * can be processed and validated before being passed on to the method. */ [{ - name: 'open', - promises: true + name: 'appendFile', + promises: true, + absPathArgs: [0] }, { name: 'access', - promises: true - }, { - name: 'chmod', - promises: true - }, { - name: 'fchmod' + promises: true, + absPathArgs: [0] }, { name: 'chown', - promises: true + promises: true, + absPathArgs: [0] + }, { + name: 'chmod', + promises: true, + absPathArgs: [0] + }, { + name: 'close' + }, // copyFile - https://github.com/filerjs/filer/issues/436 + { + name: 'exists', + absPathArgs: [0] }, { name: 'fchown' }, { - name: 'close' + name: 'fchmod' + }, // fdatasync - https://github.com/filerjs/filer/issues/653 + { + name: 'fgetxattr' }, { - name: 'mknod', - promises: true + name: 'fremovexattr' }, { - name: 'mkdir', - promises: true - }, { - name: 'mkdtemp', - promises: true - }, { - name: 'rmdir', - promises: true - }, { - name: 'stat', - promises: true + name: 'fsetxattr' }, { name: 'fstat' }, { name: 'fsync' }, { + name: 'ftruncate' + }, { + name: 'futimes' + }, { + name: 'getxattr', + promises: true, + absPathArgs: [0] + }, // lchown - https://github.com/filerjs/filer/issues/620 + // lchmod - https://github.com/filerjs/filer/issues/619 + { name: 'link', - promises: true - }, { - name: 'unlink', - promises: true - }, { - name: 'read' - }, { - name: 'readFile', - promises: true - }, { - name: 'write' - }, { - name: 'writeFile', - promises: true - }, { - name: 'appendFile', - promises: true - }, { - name: 'exists' + promises: true, + absPathArgs: [0, 1] }, { name: 'lseek' - }, { - name: 'readdir', - promises: true - }, { - name: 'rename', - promises: true - }, { - name: 'readlink', - promises: true - }, { - name: 'symlink', - promises: true }, { name: 'lstat', promises: true }, { - name: 'truncate', + name: 'mkdir', + promises: true, + absPathArgs: [0] + }, { + name: 'mkdtemp', promises: true }, { - name: 'ftruncate' + name: 'mknod', + promises: true, + absPathArgs: [0] }, { - name: 'utimes', - promises: true + name: 'open', + promises: true, + absPathArgs: [0] }, { - name: 'futimes' + name: 'readdir', + promises: true, + absPathArgs: [0] + }, { + name: 'read' + }, { + name: 'readFile', + promises: true, + absPathArgs: [0] + }, { + name: 'readlink', + promises: true, + absPathArgs: [0] + }, // realpath - https://github.com/filerjs/filer/issues/85 + { + name: 'removexattr', + promises: true, + absPathArgs: [0] + }, { + name: 'rename', + promises: true, + absPathArgs: [0, 1] + }, { + name: 'rmdir', + promises: true, + absPathArgs: [0] }, { name: 'setxattr', - promises: true + promises: true, + absPathArgs: [0] }, { - name: 'getxattr', - promises: true + name: 'stat', + promises: true, + absPathArgs: [0] }, { - name: 'fsetxattr' + name: 'symlink', + promises: true, + relPathArgs: [0], + absPathArgs: [1] }, { - name: 'fgetxattr' + name: 'truncate', + promises: true, + absPathArgs: [0] + }, // unwatchFile - https://github.com/filerjs/filer/pull/553 + { + name: 'unlink', + promises: true, + absPathArgs: [0] }, { - name: 'removexattr', - promises: true + name: 'utimes', + promises: true, + absPathArgs: [0] + }, // watch - implemented above in `this.watch` + // watchFile - https://github.com/filerjs/filer/issues/654 + { + name: 'writeFile', + promises: true, + absPathArgs: [0] }, { - name: 'fremovexattr' + name: 'write' }].forEach(function (method) { var methodName = method.name; var shouldPromisify = method.promises === true; @@ -9231,7 +9017,20 @@ function FileSystem(options, callback) { // 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 callback = maybeCallback(args[lastArgIndex]); // Deal with path arguments, validating and normalizing Buffer and file:// URLs + + if (method.absPathArgs) { + method.absPathArgs.forEach(function (pathArg) { + return processPathArg(args, pathArg, false); + }); + } + + if (method.relPathArgs) { + method.relPathArgs.forEach(function (pathArg) { + return processPathArg(args, pathArg, true); + }); + } + 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. @@ -9257,7 +9056,7 @@ function FileSystem(options, callback) { // fn(fs, context, arg0, arg1, ... , complete); - var fnArgs = [fs, context].concat(args); + var fnArgs = [context].concat(args); impl[methodName].apply(null, fnArgs); }); @@ -9276,14 +9075,30 @@ function FileSystem(options, callback) { FileSystem.providers = providers; module.exports = FileSystem; -},{"es6-promisify":"0c0E","../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) { +},{"es6-promisify":"0c0E","../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","buffer":"dskh"}],"Focm":[function(require,module,exports) { var Buffer = require("buffer").Buffer; -module.exports = { +var fs = null; +var Filer = null; +module.exports = Filer = { FileSystem: require('./filesystem/interface.js'), Buffer: Buffer, + // We previously called this Path, but node calls it path. Do both Path: require('./path.js'), + path: require('./path.js'), Errors: require('./errors.js'), Shell: require('./shell/shell.js') -}; +}; // Add a getter for the `fs` instance, which returns +// a Filer FileSystem instance, using the default provider/flags. + +Object.defineProperty(Filer, 'fs', { + enumerable: true, + get: function get() { + if (!fs) { + fs = new Filer.FileSystem(); + } + + return fs; + } +}); },{"./filesystem/interface.js":"GMi4","./path.js":"UzoP","./errors.js":"p8GN","./shell/shell.js":"D1Ra","buffer":"dskh"}]},{},["Focm"], "Filer") //# sourceMappingURL=/filer.map \ No newline at end of file diff --git a/dist/filer.map b/dist/filer.map index 2d0040c..2778c87 100644 --- a/dist/filer.map +++ b/dist/filer.map @@ -1 +1 @@ -{"version":3,"sources":["../node_modules/es6-promisify/dist/promisify.js","../node_modules/process/browser.js","../node_modules/path-browserify/index.js","path.js","shared.js","constants.js","../node_modules/base64-js/index.js","../node_modules/ieee754/index.js","../node_modules/isarray/index.js","../node_modules/buffer/index.js","providers/indexeddb.js","errors.js","../node_modules/base64-arraybuffer/lib/base64-arraybuffer.js","providers/websql.js","../lib/async.js","providers/memory.js","providers/index.js","shell/environment.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","encoding.js","directory-entry.js","node.js","open-file-description.js","super-node.js","stats.js","filesystem/implementation.js","filesystem/interface.js","index.js"],"names":["process","module","exports","cachedSetTimeout","cachedClearTimeout","defaultSetTimout","Error","defaultClearTimeout","setTimeout","e","clearTimeout","runTimeout","fun","call","runClearTimeout","marker","queue","draining","currentQueue","queueIndex","cleanUpNextTick","length","concat","drainQueue","timeout","len","run","nextTick","args","Array","arguments","i","push","Item","array","prototype","apply","title","browser","env","argv","version","versions","noop","on","addListener","once","off","removeListener","removeAllListeners","emit","prependListener","prependOnceListener","listeners","name","binding","cwd","chdir","dir","umask","nodePath","require","filerPath","Object","create","basename","path","ext","normalize","removeTrailing","isNull","indexOf","addTrailing","replace","generateRandom","template","c","r","Math","random","v","toString","guid","toUpperCase","randomChars","n","repeat","nop","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","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_IFREG","S_IFDIR","S_IFCHR","S_IFBLK","S_IFIFO","S_IFLNK","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","indexedDB","global","mozIndexedDB","webkitIndexedDB","msIndexedDB","IndexedDBContext","db","mode","_getObjectStore","objectStore","transaction","clear","callback","request","onsuccess","onerror","event","preventDefault","error","err","_get","key","get","result","target","getObject","getBuffer","arrayBuffer","Buffer","from","_put","value","put","putObject","putBuffer","uint8BackedBuffer","buf","buffer","delete","IndexedDB","isSupported","open","that","openRequest","onupgradeneeded","objectStoreNames","contains","deleteObjectStore","createObjectStore","getReadOnlyContext","getReadWriteContext","errors","forEach","split","errno","errName","defaultMessage","FilerError","msg","code","message","stack","constructor","pathInfo","chars","lookup","Uint8Array","charCodeAt","encode","arraybuffer","bytes","base64","substring","decode","bufferLength","p","encoded1","encoded2","encoded3","encoded4","ArrayBuffer","Errors","base64ArrayBuffer","WebSQLContext","isReadOnly","getTransaction","onError","onSuccess","executeSql","rows","item","data","JSON","parse","json","stringify","WebSQL","openDatabase","EINVAL","createIndex","async","setImmediate","fn","eachSeries","arr","iterator","completed","iterate","forEachSeries","define","amd","root","asyncCallback","createDB","pool","getOrCreate","hasOwnProperty","MemoryContext","readOnly","keys","Memory","Default","Fallback","NotSupported","defaults","Environment","set","promisify","Path","minimatch","Shell","fs","options","defineProperty","enumerable","cd","resolve","stat","stats","ENOTDIR","type","pwd","promises","methodName","bind","exec","sh","readFile","cmd","Function","touch","createFile","writeFile","updateTimes","now","Date","atime","date","mtime","utimes","updateOnly","cat","files","all","append","filename","ls","list","pathname","readdir","entries","getDirEntry","join","entry","recursive","items","contents","rm","remove","unlink","rmdir","ENOTEMPTY","map","tempDir","tmp","mkdir","mkdirp","_mkdirp","isDirectory","isFile","parent","dirname","find","next","found","processPath","maybeProcessPath","rawPath","regex","test","walk","removeItem","splice","EventEmitter","createInterface","space","methods","trigger","slice","self","pvt","_on","_off","_trigger","pub","unshift","throttle","delay","last","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","delimiter","supported","destroy","getInstance","intercom","FSWatcher","recursivePathPrefix","onchange","start","filename_","persistent_","recursive_","close","string","DirectoryEntry","ensureID","prop","generateMode","nodeType","modePermissions","Node","size","ctime","flags","xattrs","nlinks","permissions","uid","gid","OpenFileDescription","position","getNode","context","check_if_node_exists","node","EBADF","Constants","SuperNode","rnode","dateFromNumeric","num","Number","Stats","fileNode","devName","dev","atimeMs","mtimeMs","ctimeMs","isSymbolicLink","isSocket","isFIFO","isCharacterDevice","isBlockDevice","isAbsolutePath","isAbsolute","isNullPath","shared","Encoding","update_node_times","times","includes","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","nodeData","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","access_file","st_mode","validateAndMaskMode","EACCES","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","alloc","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","encoding","pathCheck","allowRelative","check_result","openFileDescription","fd","allocDescriptor","openFiles","releaseDescriptor","mknod","access","mkdtemp","prefix","fstat","link","read","wrapped_cb","bytesRead","fsync","validateInteger","cleanup","fstatResult","write","appendFile","exists","cb","octalReg","isUint32","def","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","toUnixTimestamp","time","getTime","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","nextDescriptor","queueOrRun","operation","runQueued","watch","listener","watcher","wrappedGuidFn","guidWithCheck","broadcastChanges","change","wrappedContext","openReadWriteContext","openReadOnlyContext","method","shouldPromisify","lastArgIndex","missingCallback","fnArgs"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;ACnFA;AACA,IAAIA,OAAO,GAAGC,MAAM,CAACC,OAAP,GAAiB,EAA/B,EAEA;AACA;AACA;AACA;;AAEA,IAAIC,gBAAJ;AACA,IAAIC,kBAAJ;;AAEA,SAASC,gBAAT,GAA4B;AACxB,QAAM,IAAIC,KAAJ,CAAU,iCAAV,CAAN;AACH;;AACD,SAASC,mBAAT,GAAgC;AAC5B,QAAM,IAAID,KAAJ,CAAU,mCAAV,CAAN;AACH;;AACA,aAAY;AACT,MAAI;AACA,QAAI,OAAOE,UAAP,KAAsB,UAA1B,EAAsC;AAClCL,MAAAA,gBAAgB,GAAGK,UAAnB;AACH,KAFD,MAEO;AACHL,MAAAA,gBAAgB,GAAGE,gBAAnB;AACH;AACJ,GAND,CAME,OAAOI,CAAP,EAAU;AACRN,IAAAA,gBAAgB,GAAGE,gBAAnB;AACH;;AACD,MAAI;AACA,QAAI,OAAOK,YAAP,KAAwB,UAA5B,EAAwC;AACpCN,MAAAA,kBAAkB,GAAGM,YAArB;AACH,KAFD,MAEO;AACHN,MAAAA,kBAAkB,GAAGG,mBAArB;AACH;AACJ,GAND,CAME,OAAOE,CAAP,EAAU;AACRL,IAAAA,kBAAkB,GAAGG,mBAArB;AACH;AACJ,CAnBA,GAAD;;AAoBA,SAASI,UAAT,CAAoBC,GAApB,EAAyB;AACrB,MAAIT,gBAAgB,KAAKK,UAAzB,EAAqC;AACjC;AACA,WAAOA,UAAU,CAACI,GAAD,EAAM,CAAN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ACA3C,OAAO,CAACkD,IAAR,GAAeP,IAAf;AACA3C,OAAO,CAACmD,eAAR,GAA0BR,IAA1B;AACA3C,OAAO,CAACoD,mBAAR,GAA8BT,IAA9B;;AAEA3C,OAAO,CAACqD,SAAR,GAAoB,UAAUC,IAAV,EAAgB;AAAE,SAAO,EAAP;AAAW,CAAjD;;AAEAtD,OAAO,CAACuD,OAAR,GAAkB,UAAUD,IAAV,EAAgB;AAC9B,QAAM,IAAIhD,KAAJ,CAAU,kCAAV,CAAN;AACH,CAFD;;AAIAN,OAAO,CAACwD,GAAR,GAAc,YAAY;AAAE,SAAO,GAAP;AAAY,CAAxC;;AACAxD,OAAO,CAACyD,KAAR,GAAgB,UAAUC,GAAV,EAAe;AAC3B,QAAM,IAAIpD,KAAJ,CAAU,gCAAV,CAAN;AACH,CAFD;;AAGAN,OAAO,CAAC2D,KAAR,GAAgB,YAAW;AAAE,SAAO,CAAP;AAAW,CAAxC;;;ACvLA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC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AAE,CAlCE;AAmCXC,IAAAA,IAAI,EAAE,CAnCK;AAoCXC,IAAAA,IAAI,EAAE,CApCK;AAqCXC,IAAAA,IAAI,EAAE,CArCK;AAsCXC,IAAAA,IAAI,EAAE,CAtCK;AAuCXC,IAAAA,mBAAmB,EAAE,CAvCV;AAwCXC,IAAAA,aAAa,EAAE;AAxCJ;AA9EE,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;;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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L,GAAW,UAAS3I,IAAT,EAAe;AACxB,WAAOf,GAAG,CAACe,IAAD,CAAV;AACD,GAFD;;AAIA,OAAKmP,GAAL,GAAW,UAASnP,IAAT,EAAeoJ,KAAf,EAAsB;AAC/BnK,IAAAA,GAAG,CAACe,IAAD,CAAH,GAAYoJ,KAAZ;AACD,GAFD;AAGD,CAZD;;ACFA;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;;eC35BkB7I,OAAO,CAAC,eAAD;IAApB6O,qBAAAA;;AACL,IAAIC,IAAI,GAAG9O,OAAO,CAAC,YAAD,CAAlB;;AACA,IAAI+L,MAAM,GAAG/L,OAAO,CAAC,cAAD,CAApB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KAAH,EAAU;AACRN,QAAAA,QAAQ,CAACM,KAAD,CAAR;AACD;AACF,KA1CD,CAJyB,CAgDzB;;;AACA,QAAGqiB,eAAH,EAAoB;AAClBvB,MAAAA,UAAU,CAACxqB,SAAX,CAAqBsR,QAArB,CAA8BC,UAA9B,IAA4ChB,SAAS,CAACia,UAAU,CAACxqB,SAAX,CAAqBuR,UAArB,EAAiCC,IAAjC,CAAsCb,EAAtC,CAAD,CAArD;AACD;AACF,GA3FD;AA6FD,EAED;;;AACA6Z,UAAU,CAACN,SAAX,GAAuBA,SAAvB;AAEApsB,MAAM,CAACC,OAAP,GAAiBysB,UAAjB;;;ACjXA1sB,MAAM,CAACC,OAAP,GAAiB;AACfysB,EAAAA,UAAU,EAAE9oB,OAAO,CAAC,2BAAD,CADJ;AAEf0I,EAAAA,MAAM,EAAEA,MAFO;AAGfoG,EAAAA,IAAI,EAAE9O,OAAO,CAAC,WAAD,CAHE;AAIf+L,EAAAA,MAAM,EAAE/L,OAAO,CAAC,aAAD,CAJA;AAKfgP,EAAAA,KAAK,EAAEhP,OAAO,CAAC,kBAAD;AALC,CAAjB","file":"filer.map","sourceRoot":"../src","sourcesContent":["\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n// Symbols is a better way to do this, but if we don't have support we'll just\n// have to make do with an unlikely token\nvar customArgumentsToken = Symbol ? Symbol(\"__ES6-PROMISIFY--CUSTOM-ARGUMENTS__\") : \"__ES6-PROMISIFY--CUSTOM-ARGUMENTS__\";\n\n/**\n * promisify()\n * Transforms callback-based function -- func(arg1, arg2 .. argN, callback) -- into\n * an ES6-compatible Promise. Promisify provides a default callback of the form (error, result)\n * and rejects when `error` is truthy.\n *\n * @param {function} original - The function to promisify\n * @return {function} A promisified version of `original`\n */\nfunction promisify(original) {\n\n // Ensure the argument is a function\n if (typeof original !== \"function\") {\n throw new TypeError(\"Argument to promisify must be a function\");\n }\n\n // If the user has asked us to decode argument names for them, honour that\n var argumentNames = original[customArgumentsToken];\n\n // If the user has supplied a custom Promise implementation, use it. Otherwise\n // fall back to whatever we can find on the global object.\n var ES6Promise = promisify.Promise || Promise;\n\n // If we can find no Promise implemention, then fail now.\n if (typeof ES6Promise !== \"function\") {\n throw new Error(\"No Promise implementation found; do you need a polyfill?\");\n }\n\n return function () {\n var _this = this;\n\n for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n return new ES6Promise(function (resolve, reject) {\n\n // Append the callback bound to the context\n args.push(function callback(err) {\n\n if (err) {\n return reject(err);\n }\n\n for (var _len2 = arguments.length, values = Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {\n values[_key2 - 1] = arguments[_key2];\n }\n\n if (values.length === 1 || !argumentNames) {\n return resolve(values[0]);\n }\n\n var o = {};\n values.forEach(function (value, index) {\n var name = argumentNames[index];\n if (name) {\n o[name] = value;\n }\n });\n\n resolve(o);\n });\n\n // Call the function.\n original.call.apply(original, [_this].concat(args));\n });\n };\n}\n\n// Attach this symbol to the exported function, so users can use it\npromisify.argumentNames = customArgumentsToken;\npromisify.Promise = undefined;\n\n// Export the public API\nexports.promisify = promisify;","// 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","// 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// 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}|[^\\/]+?|)(\\.[^.\\/]*|))(?:[\\/]*)$/;\nvar splitPath = function(filename) {\n return splitPathRe.exec(filename).slice(1);\n};\n\n// path.resolve([from ...], to)\n// posix version\nexports.resolve = function() {\n var resolvedPath = '',\n resolvedAbsolute = false;\n\n for (var i = arguments.length - 1; i >= -1 && !resolvedAbsolute; i--) {\n var path = (i >= 0) ? arguments[i] : process.cwd();\n\n // Skip empty and invalid entries\n if (typeof path !== 'string') {\n throw new TypeError('Arguments to path.resolve must be strings');\n } else if (!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(filter(resolvedPath.split('/'), function(p) {\n return !!p;\n }), !resolvedAbsolute).join('/');\n\n return ((resolvedAbsolute ? '/' : '') + resolvedPath) || '.';\n};\n\n// path.normalize(path)\n// posix version\nexports.normalize = function(path) {\n var isAbsolute = exports.isAbsolute(path),\n trailingSlash = substr(path, -1) === '/';\n\n // Normalize the path\n path = normalizeArray(filter(path.split('/'), function(p) {\n return !!p;\n }), !isAbsolute).join('/');\n\n if (!path && !isAbsolute) {\n path = '.';\n }\n if (path && trailingSlash) {\n path += '/';\n }\n\n return (isAbsolute ? '/' : '') + path;\n};\n\n// posix version\nexports.isAbsolute = function(path) {\n return path.charAt(0) === '/';\n};\n\n// posix version\nexports.join = function() {\n var paths = Array.prototype.slice.call(arguments, 0);\n return exports.normalize(filter(paths, function(p, index) {\n if (typeof p !== 'string') {\n throw new TypeError('Arguments to path.join must be strings');\n }\n return p;\n }).join('/'));\n};\n\n\n// path.relative(from, to)\n// posix version\nexports.relative = function(from, to) {\n from = exports.resolve(from).substr(1);\n to = exports.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\nexports.sep = '/';\nexports.delimiter = ':';\n\nexports.dirname = function(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\n\nexports.basename = function(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 return f;\n};\n\n\nexports.extname = function(path) {\n return splitPath(path)[3];\n};\n\nfunction filter (xs, f) {\n if (xs.filter) return xs.filter(f);\n var res = [];\n for (var i = 0; i < xs.length; i++) {\n if (f(xs[i], i, xs)) res.push(xs[i]);\n }\n return res;\n}\n\n// String.prototype.substr - negative index don't work in IE8\nvar substr = 'ab'.substr(-1) === 'b'\n ? function (str, start, len) { return str.substr(start, len) }\n : function (str, start, len) {\n if (start < 0) start = str.length + start;\n return str.substr(start, len);\n }\n;\n","/**\n * Patch process to add process.cwd(), always giving the root dir.\n * NOTE: this line needs to happen *before* we require in `path`.\n */\nprocess.cwd = () => '/';\n\n/**\n * https://github.com/browserify/path-browserify via Parcel.\n * We use is as a base for our own Filer.Path, and patch/add\n * a few things we need for the browser environment.\n */\nconst nodePath = require('path');\nconst filerPath = Object.create(nodePath);\n\n/**\n * Patch path.basename() to return / vs. ''\n */\nfilerPath.basename = (path, ext) => {\n const basename = nodePath.basename(path, ext);\n return basename === '' ? '/' : basename;\n};\n\n/**\n * Patch path.normalize() to not add a trailing /\n */\nfilerPath.normalize = (path) => {\n path = nodePath.normalize(path);\n return path === '/' ? path : filerPath.removeTrailing(path);\n};\n\n/**\n * Add new utility method isNull() to path: check for null paths.\n */\nfilerPath.isNull = path => ('' + path).indexOf('\\u0000') !== -1;\n\n/**\n * Add new utility method addTrailing() to add trailing / without doubling to //.\n */\nfilerPath.addTrailing = path => path.replace(/\\/*$/, '/');\n\n/**\n * Add new utility method removeTrailing() to remove trailing /, dealing with multiple\n */\nfilerPath.removeTrailing = path => {\n path = path.replace(/\\/*$/, '');\n return path === '' ? '/' : path;\n};\n\nmodule.exports = filerPath;\n","function generateRandom(template) {\n return template.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 });\n}\n\nfunction guid() {\n return generateRandom('xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx').toUpperCase();\n}\n\n/**\n * Generate a string of n random characters. Defaults to n=6.\n */ \nfunction randomChars(n) {\n n = n || 6;\n var template = 'x'.repeat(n);\n return generateRandom(template);\n}\n\nfunction nop() {}\n\nmodule.exports = {\n guid: guid,\n nop: nop,\n randomChars: randomChars\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\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","'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","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;\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, Buffer.from(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","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","/*\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 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() {\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 = Buffer.from(arrayBuffer);\n }\n\n callback(null, result);\n });\n};\n\nfunction _put(getTransaction, key, value, callback) {\n function onSuccess() {\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() {\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() {\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","/*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