>S)+(l-=f)]=b<<24|m<<16|w|0,0!==l;);for(f=1<<_-1;B&f;)f>>=1;if(0!==f?(B&=f-1,B+=f):B=0,g++,0==--R[_]){if(_===p)break;_=t[i+o[g]]}if(x<_&&(B&c)!==d){for(0===S&&(S=x),u+=v,E=1<<(y=_-S);y+S Array
+ *
+ * Chunks of output data, if [[Deflate#onData]] not overridden.
+ **/
+
+/**
+ * Deflate.result -> Uint8Array|Array
+ *
+ * Compressed result, generated by default [[Deflate#onData]]
+ * and [[Deflate#onEnd]] handlers. Filled after you push last chunk
+ * (call [[Deflate#push]] with `Z_FINISH` / `true` param) or if you
+ * push a chunk with explicit flush (call [[Deflate#push]] with
+ * `Z_SYNC_FLUSH` param).
+ **/
+
+/**
+ * Deflate.err -> Number
+ *
+ * Error code after deflate finished. 0 (Z_OK) on success.
+ * You will not need it in real life, because deflate errors
+ * are possible only on wrong options or bad `onData` / `onEnd`
+ * custom handlers.
+ **/
+
+/**
+ * Deflate.msg -> String
+ *
+ * Error message, if [[Deflate.err]] != 0
+ **/
+
+
+/**
+ * new Deflate(options)
+ * - options (Object): zlib deflate options.
+ *
+ * Creates new deflator instance with specified params. Throws exception
+ * on bad params. Supported options:
+ *
+ * - `level`
+ * - `windowBits`
+ * - `memLevel`
+ * - `strategy`
+ * - `dictionary`
+ *
+ * [http://zlib.net/manual.html#Advanced](http://zlib.net/manual.html#Advanced)
+ * for more information on these.
+ *
+ * Additional options, for internal needs:
+ *
+ * - `chunkSize` - size of generated data chunks (16K by default)
+ * - `raw` (Boolean) - do raw deflate
+ * - `gzip` (Boolean) - create gzip wrapper
+ * - `to` (String) - if equal to 'string', then result will be "binary string"
+ * (each char code [0..255])
+ * - `header` (Object) - custom header for gzip
+ * - `text` (Boolean) - true if compressed data believed to be text
+ * - `time` (Number) - modification time, unix timestamp
+ * - `os` (Number) - operation system code
+ * - `extra` (Array) - array of bytes with extra data (max 65536)
+ * - `name` (String) - file name (binary string)
+ * - `comment` (String) - comment (binary string)
+ * - `hcrc` (Boolean) - true if header crc should be added
+ *
+ * ##### Example:
+ *
+ * ```javascript
+ * var pako = require('pako')
+ * , chunk1 = Uint8Array([1,2,3,4,5,6,7,8,9])
+ * , chunk2 = Uint8Array([10,11,12,13,14,15,16,17,18,19]);
+ *
+ * var deflate = new pako.Deflate({ level: 3});
+ *
+ * deflate.push(chunk1, false);
+ * deflate.push(chunk2, true); // true -> last chunk
+ *
+ * if (deflate.err) { throw new Error(deflate.err); }
+ *
+ * console.log(deflate.result);
+ * ```
+ **/
+function Deflate(options) {
+ if (!(this instanceof Deflate)) return new Deflate(options);
+
+ this.options = utils.assign({
+ level: Z_DEFAULT_COMPRESSION,
+ method: Z_DEFLATED,
+ chunkSize: 16384,
+ windowBits: 15,
+ memLevel: 8,
+ strategy: Z_DEFAULT_STRATEGY,
+ to: ''
+ }, options || {});
+
+ var opt = this.options;
+
+ if (opt.raw && (opt.windowBits > 0)) {
+ opt.windowBits = -opt.windowBits;
+ }
+
+ else if (opt.gzip && (opt.windowBits > 0) && (opt.windowBits < 16)) {
+ opt.windowBits += 16;
+ }
+
+ this.err = 0; // error code, if happens (0 = Z_OK)
+ this.msg = ''; // error message
+ this.ended = false; // used to avoid multiple onEnd() calls
+ this.chunks = []; // chunks of compressed data
+
+ this.strm = new ZStream();
+ this.strm.avail_out = 0;
+
+ var status = zlib_deflate.deflateInit2(
+ this.strm,
+ opt.level,
+ opt.method,
+ opt.windowBits,
+ opt.memLevel,
+ opt.strategy
+ );
+
+ if (status !== Z_OK) {
+ throw new Error(msg[status]);
+ }
+
+ if (opt.header) {
+ zlib_deflate.deflateSetHeader(this.strm, opt.header);
+ }
+
+ if (opt.dictionary) {
+ var dict;
+ // Convert data if needed
+ if (typeof opt.dictionary === 'string') {
+ // If we need to compress text, change encoding to utf8.
+ dict = strings.string2buf(opt.dictionary);
+ } else if (toString.call(opt.dictionary) === '[object ArrayBuffer]') {
+ dict = new Uint8Array(opt.dictionary);
+ } else {
+ dict = opt.dictionary;
+ }
+
+ status = zlib_deflate.deflateSetDictionary(this.strm, dict);
+
+ if (status !== Z_OK) {
+ throw new Error(msg[status]);
+ }
+
+ this._dict_set = true;
+ }
+}
+
+/**
+ * Deflate#push(data[, mode]) -> Boolean
+ * - data (Uint8Array|Array|ArrayBuffer|String): input data. Strings will be
+ * converted to utf8 byte sequence.
+ * - mode (Number|Boolean): 0..6 for corresponding Z_NO_FLUSH..Z_TREE modes.
+ * See constants. Skipped or `false` means Z_NO_FLUSH, `true` means Z_FINISH.
+ *
+ * Sends input data to deflate pipe, generating [[Deflate#onData]] calls with
+ * new compressed chunks. Returns `true` on success. The last data block must have
+ * mode Z_FINISH (or `true`). That will flush internal pending buffers and call
+ * [[Deflate#onEnd]]. For interim explicit flushes (without ending the stream) you
+ * can use mode Z_SYNC_FLUSH, keeping the compression context.
+ *
+ * On fail call [[Deflate#onEnd]] with error code and return false.
+ *
+ * We strongly recommend to use `Uint8Array` on input for best speed (output
+ * array format is detected automatically). Also, don't skip last param and always
+ * use the same type in your code (boolean or number). That will improve JS speed.
+ *
+ * For regular `Array`-s make sure all elements are [0..255].
+ *
+ * ##### Example
+ *
+ * ```javascript
+ * push(chunk, false); // push one of data chunks
+ * ...
+ * push(chunk, true); // push last chunk
+ * ```
+ **/
+Deflate.prototype.push = function (data, mode) {
+ var strm = this.strm;
+ var chunkSize = this.options.chunkSize;
+ var status, _mode;
+
+ if (this.ended) { return false; }
+
+ _mode = (mode === ~~mode) ? mode : ((mode === true) ? Z_FINISH : Z_NO_FLUSH);
+
+ // Convert data if needed
+ if (typeof data === 'string') {
+ // If we need to compress text, change encoding to utf8.
+ strm.input = strings.string2buf(data);
+ } else if (toString.call(data) === '[object ArrayBuffer]') {
+ strm.input = new Uint8Array(data);
+ } else {
+ strm.input = data;
+ }
+
+ strm.next_in = 0;
+ strm.avail_in = strm.input.length;
+
+ do {
+ if (strm.avail_out === 0) {
+ strm.output = new utils.Buf8(chunkSize);
+ strm.next_out = 0;
+ strm.avail_out = chunkSize;
+ }
+ status = zlib_deflate.deflate(strm, _mode); /* no bad return value */
+
+ if (status !== Z_STREAM_END && status !== Z_OK) {
+ this.onEnd(status);
+ this.ended = true;
+ return false;
+ }
+ if (strm.avail_out === 0 || (strm.avail_in === 0 && (_mode === Z_FINISH || _mode === Z_SYNC_FLUSH))) {
+ if (this.options.to === 'string') {
+ this.onData(strings.buf2binstring(utils.shrinkBuf(strm.output, strm.next_out)));
+ } else {
+ this.onData(utils.shrinkBuf(strm.output, strm.next_out));
+ }
+ }
+ } while ((strm.avail_in > 0 || strm.avail_out === 0) && status !== Z_STREAM_END);
+
+ // Finalize on the last chunk.
+ if (_mode === Z_FINISH) {
+ status = zlib_deflate.deflateEnd(this.strm);
+ this.onEnd(status);
+ this.ended = true;
+ return status === Z_OK;
+ }
+
+ // callback interim results if Z_SYNC_FLUSH.
+ if (_mode === Z_SYNC_FLUSH) {
+ this.onEnd(Z_OK);
+ strm.avail_out = 0;
+ return true;
+ }
+
+ return true;
+};
+
+
+/**
+ * Deflate#onData(chunk) -> Void
+ * - chunk (Uint8Array|Array|String): output data. Type of array depends
+ * on js engine support. When string output requested, each chunk
+ * will be string.
+ *
+ * By default, stores data blocks in `chunks[]` property and glue
+ * those in `onEnd`. Override this handler, if you need another behaviour.
+ **/
+Deflate.prototype.onData = function (chunk) {
+ this.chunks.push(chunk);
+};
+
+
+/**
+ * Deflate#onEnd(status) -> Void
+ * - status (Number): deflate status. 0 (Z_OK) on success,
+ * other if not.
+ *
+ * Called once after you tell deflate that the input stream is
+ * complete (Z_FINISH) or should be flushed (Z_SYNC_FLUSH)
+ * or if an error happened. By default - join collected chunks,
+ * free memory and fill `results` / `err` properties.
+ **/
+Deflate.prototype.onEnd = function (status) {
+ // On success - join
+ if (status === Z_OK) {
+ if (this.options.to === 'string') {
+ this.result = this.chunks.join('');
+ } else {
+ this.result = utils.flattenChunks(this.chunks);
+ }
+ }
+ this.chunks = [];
+ this.err = status;
+ this.msg = this.strm.msg;
+};
+
+
+/**
+ * deflate(data[, options]) -> Uint8Array|Array|String
+ * - data (Uint8Array|Array|String): input data to compress.
+ * - options (Object): zlib deflate options.
+ *
+ * Compress `data` with deflate algorithm and `options`.
+ *
+ * Supported options are:
+ *
+ * - level
+ * - windowBits
+ * - memLevel
+ * - strategy
+ * - dictionary
+ *
+ * [http://zlib.net/manual.html#Advanced](http://zlib.net/manual.html#Advanced)
+ * for more information on these.
+ *
+ * Sugar (options):
+ *
+ * - `raw` (Boolean) - say that we work with raw stream, if you don't wish to specify
+ * negative windowBits implicitly.
+ * - `to` (String) - if equal to 'string', then result will be "binary string"
+ * (each char code [0..255])
+ *
+ * ##### Example:
+ *
+ * ```javascript
+ * var pako = require('pako')
+ * , data = Uint8Array([1,2,3,4,5,6,7,8,9]);
+ *
+ * console.log(pako.deflate(data));
+ * ```
+ **/
+function deflate(input, options) {
+ var deflator = new Deflate(options);
+
+ deflator.push(input, true);
+
+ // That will never happens, if you don't cheat with options :)
+ if (deflator.err) { throw deflator.msg || msg[deflator.err]; }
+
+ return deflator.result;
+}
+
+
+/**
+ * deflateRaw(data[, options]) -> Uint8Array|Array|String
+ * - data (Uint8Array|Array|String): input data to compress.
+ * - options (Object): zlib deflate options.
+ *
+ * The same as [[deflate]], but creates raw data, without wrapper
+ * (header and adler32 crc).
+ **/
+function deflateRaw(input, options) {
+ options = options || {};
+ options.raw = true;
+ return deflate(input, options);
+}
+
+
+/**
+ * gzip(data[, options]) -> Uint8Array|Array|String
+ * - data (Uint8Array|Array|String): input data to compress.
+ * - options (Object): zlib deflate options.
+ *
+ * The same as [[deflate]], but create gzip wrapper instead of
+ * deflate one.
+ **/
+function gzip(input, options) {
+ options = options || {};
+ options.gzip = true;
+ return deflate(input, options);
+}
+
+
+exports.Deflate = Deflate;
+exports.deflate = deflate;
+exports.deflateRaw = deflateRaw;
+exports.gzip = gzip;
diff --git a/node_modules/pako/lib/inflate.js b/node_modules/pako/lib/inflate.js
new file mode 100644
index 0000000000000000000000000000000000000000..7535d15af147c347b1c46562f3876dd40354ba28
--- /dev/null
+++ b/node_modules/pako/lib/inflate.js
@@ -0,0 +1,423 @@
+'use strict';
+
+
+var zlib_inflate = require('./zlib/inflate');
+var utils = require('./utils/common');
+var strings = require('./utils/strings');
+var c = require('./zlib/constants');
+var msg = require('./zlib/messages');
+var ZStream = require('./zlib/zstream');
+var GZheader = require('./zlib/gzheader');
+
+var toString = Object.prototype.toString;
+
+/**
+ * class Inflate
+ *
+ * Generic JS-style wrapper for zlib calls. If you don't need
+ * streaming behaviour - use more simple functions: [[inflate]]
+ * and [[inflateRaw]].
+ **/
+
+/* internal
+ * inflate.chunks -> Array
+ *
+ * Chunks of output data, if [[Inflate#onData]] not overridden.
+ **/
+
+/**
+ * Inflate.result -> Uint8Array|Array|String
+ *
+ * Uncompressed result, generated by default [[Inflate#onData]]
+ * and [[Inflate#onEnd]] handlers. Filled after you push last chunk
+ * (call [[Inflate#push]] with `Z_FINISH` / `true` param) or if you
+ * push a chunk with explicit flush (call [[Inflate#push]] with
+ * `Z_SYNC_FLUSH` param).
+ **/
+
+/**
+ * Inflate.err -> Number
+ *
+ * Error code after inflate finished. 0 (Z_OK) on success.
+ * Should be checked if broken data possible.
+ **/
+
+/**
+ * Inflate.msg -> String
+ *
+ * Error message, if [[Inflate.err]] != 0
+ **/
+
+
+/**
+ * new Inflate(options)
+ * - options (Object): zlib inflate options.
+ *
+ * Creates new inflator instance with specified params. Throws exception
+ * on bad params. Supported options:
+ *
+ * - `windowBits`
+ * - `dictionary`
+ *
+ * [http://zlib.net/manual.html#Advanced](http://zlib.net/manual.html#Advanced)
+ * for more information on these.
+ *
+ * Additional options, for internal needs:
+ *
+ * - `chunkSize` - size of generated data chunks (16K by default)
+ * - `raw` (Boolean) - do raw inflate
+ * - `to` (String) - if equal to 'string', then result will be converted
+ * from utf8 to utf16 (javascript) string. When string output requested,
+ * chunk length can differ from `chunkSize`, depending on content.
+ *
+ * By default, when no options set, autodetect deflate/gzip data format via
+ * wrapper header.
+ *
+ * ##### Example:
+ *
+ * ```javascript
+ * var pako = require('pako')
+ * , chunk1 = Uint8Array([1,2,3,4,5,6,7,8,9])
+ * , chunk2 = Uint8Array([10,11,12,13,14,15,16,17,18,19]);
+ *
+ * var inflate = new pako.Inflate({ level: 3});
+ *
+ * inflate.push(chunk1, false);
+ * inflate.push(chunk2, true); // true -> last chunk
+ *
+ * if (inflate.err) { throw new Error(inflate.err); }
+ *
+ * console.log(inflate.result);
+ * ```
+ **/
+function Inflate(options) {
+ if (!(this instanceof Inflate)) return new Inflate(options);
+
+ this.options = utils.assign({
+ chunkSize: 16384,
+ windowBits: 0,
+ to: ''
+ }, options || {});
+
+ var opt = this.options;
+
+ // Force window size for `raw` data, if not set directly,
+ // because we have no header for autodetect.
+ if (opt.raw && (opt.windowBits >= 0) && (opt.windowBits < 16)) {
+ opt.windowBits = -opt.windowBits;
+ if (opt.windowBits === 0) { opt.windowBits = -15; }
+ }
+
+ // If `windowBits` not defined (and mode not raw) - set autodetect flag for gzip/deflate
+ if ((opt.windowBits >= 0) && (opt.windowBits < 16) &&
+ !(options && options.windowBits)) {
+ opt.windowBits += 32;
+ }
+
+ // Gzip header has no info about windows size, we can do autodetect only
+ // for deflate. So, if window size not set, force it to max when gzip possible
+ if ((opt.windowBits > 15) && (opt.windowBits < 48)) {
+ // bit 3 (16) -> gzipped data
+ // bit 4 (32) -> autodetect gzip/deflate
+ if ((opt.windowBits & 15) === 0) {
+ opt.windowBits |= 15;
+ }
+ }
+
+ this.err = 0; // error code, if happens (0 = Z_OK)
+ this.msg = ''; // error message
+ this.ended = false; // used to avoid multiple onEnd() calls
+ this.chunks = []; // chunks of compressed data
+
+ this.strm = new ZStream();
+ this.strm.avail_out = 0;
+
+ var status = zlib_inflate.inflateInit2(
+ this.strm,
+ opt.windowBits
+ );
+
+ if (status !== c.Z_OK) {
+ throw new Error(msg[status]);
+ }
+
+ this.header = new GZheader();
+
+ zlib_inflate.inflateGetHeader(this.strm, this.header);
+
+ // Setup dictionary
+ if (opt.dictionary) {
+ // Convert data if needed
+ if (typeof opt.dictionary === 'string') {
+ opt.dictionary = strings.string2buf(opt.dictionary);
+ } else if (toString.call(opt.dictionary) === '[object ArrayBuffer]') {
+ opt.dictionary = new Uint8Array(opt.dictionary);
+ }
+ if (opt.raw) { //In raw mode we need to set the dictionary early
+ status = zlib_inflate.inflateSetDictionary(this.strm, opt.dictionary);
+ if (status !== c.Z_OK) {
+ throw new Error(msg[status]);
+ }
+ }
+ }
+}
+
+/**
+ * Inflate#push(data[, mode]) -> Boolean
+ * - data (Uint8Array|Array|ArrayBuffer|String): input data
+ * - mode (Number|Boolean): 0..6 for corresponding Z_NO_FLUSH..Z_TREE modes.
+ * See constants. Skipped or `false` means Z_NO_FLUSH, `true` means Z_FINISH.
+ *
+ * Sends input data to inflate pipe, generating [[Inflate#onData]] calls with
+ * new output chunks. Returns `true` on success. The last data block must have
+ * mode Z_FINISH (or `true`). That will flush internal pending buffers and call
+ * [[Inflate#onEnd]]. For interim explicit flushes (without ending the stream) you
+ * can use mode Z_SYNC_FLUSH, keeping the decompression context.
+ *
+ * On fail call [[Inflate#onEnd]] with error code and return false.
+ *
+ * We strongly recommend to use `Uint8Array` on input for best speed (output
+ * format is detected automatically). Also, don't skip last param and always
+ * use the same type in your code (boolean or number). That will improve JS speed.
+ *
+ * For regular `Array`-s make sure all elements are [0..255].
+ *
+ * ##### Example
+ *
+ * ```javascript
+ * push(chunk, false); // push one of data chunks
+ * ...
+ * push(chunk, true); // push last chunk
+ * ```
+ **/
+Inflate.prototype.push = function (data, mode) {
+ var strm = this.strm;
+ var chunkSize = this.options.chunkSize;
+ var dictionary = this.options.dictionary;
+ var status, _mode;
+ var next_out_utf8, tail, utf8str;
+
+ // Flag to properly process Z_BUF_ERROR on testing inflate call
+ // when we check that all output data was flushed.
+ var allowBufError = false;
+
+ if (this.ended) { return false; }
+ _mode = (mode === ~~mode) ? mode : ((mode === true) ? c.Z_FINISH : c.Z_NO_FLUSH);
+
+ // Convert data if needed
+ if (typeof data === 'string') {
+ // Only binary strings can be decompressed on practice
+ strm.input = strings.binstring2buf(data);
+ } else if (toString.call(data) === '[object ArrayBuffer]') {
+ strm.input = new Uint8Array(data);
+ } else {
+ strm.input = data;
+ }
+
+ strm.next_in = 0;
+ strm.avail_in = strm.input.length;
+
+ do {
+ if (strm.avail_out === 0) {
+ strm.output = new utils.Buf8(chunkSize);
+ strm.next_out = 0;
+ strm.avail_out = chunkSize;
+ }
+
+ status = zlib_inflate.inflate(strm, c.Z_NO_FLUSH); /* no bad return value */
+
+ if (status === c.Z_NEED_DICT && dictionary) {
+ status = zlib_inflate.inflateSetDictionary(this.strm, dictionary);
+ }
+
+ if (status === c.Z_BUF_ERROR && allowBufError === true) {
+ status = c.Z_OK;
+ allowBufError = false;
+ }
+
+ if (status !== c.Z_STREAM_END && status !== c.Z_OK) {
+ this.onEnd(status);
+ this.ended = true;
+ return false;
+ }
+
+ if (strm.next_out) {
+ if (strm.avail_out === 0 || status === c.Z_STREAM_END || (strm.avail_in === 0 && (_mode === c.Z_FINISH || _mode === c.Z_SYNC_FLUSH))) {
+
+ if (this.options.to === 'string') {
+
+ next_out_utf8 = strings.utf8border(strm.output, strm.next_out);
+
+ tail = strm.next_out - next_out_utf8;
+ utf8str = strings.buf2string(strm.output, next_out_utf8);
+
+ // move tail
+ strm.next_out = tail;
+ strm.avail_out = chunkSize - tail;
+ if (tail) { utils.arraySet(strm.output, strm.output, next_out_utf8, tail, 0); }
+
+ this.onData(utf8str);
+
+ } else {
+ this.onData(utils.shrinkBuf(strm.output, strm.next_out));
+ }
+ }
+ }
+
+ // When no more input data, we should check that internal inflate buffers
+ // are flushed. The only way to do it when avail_out = 0 - run one more
+ // inflate pass. But if output data not exists, inflate return Z_BUF_ERROR.
+ // Here we set flag to process this error properly.
+ //
+ // NOTE. Deflate does not return error in this case and does not needs such
+ // logic.
+ if (strm.avail_in === 0 && strm.avail_out === 0) {
+ allowBufError = true;
+ }
+
+ } while ((strm.avail_in > 0 || strm.avail_out === 0) && status !== c.Z_STREAM_END);
+
+ if (status === c.Z_STREAM_END) {
+ _mode = c.Z_FINISH;
+ }
+
+ // Finalize on the last chunk.
+ if (_mode === c.Z_FINISH) {
+ status = zlib_inflate.inflateEnd(this.strm);
+ this.onEnd(status);
+ this.ended = true;
+ return status === c.Z_OK;
+ }
+
+ // callback interim results if Z_SYNC_FLUSH.
+ if (_mode === c.Z_SYNC_FLUSH) {
+ this.onEnd(c.Z_OK);
+ strm.avail_out = 0;
+ return true;
+ }
+
+ return true;
+};
+
+
+/**
+ * Inflate#onData(chunk) -> Void
+ * - chunk (Uint8Array|Array|String): output data. Type of array depends
+ * on js engine support. When string output requested, each chunk
+ * will be string.
+ *
+ * By default, stores data blocks in `chunks[]` property and glue
+ * those in `onEnd`. Override this handler, if you need another behaviour.
+ **/
+Inflate.prototype.onData = function (chunk) {
+ this.chunks.push(chunk);
+};
+
+
+/**
+ * Inflate#onEnd(status) -> Void
+ * - status (Number): inflate status. 0 (Z_OK) on success,
+ * other if not.
+ *
+ * Called either after you tell inflate that the input stream is
+ * complete (Z_FINISH) or should be flushed (Z_SYNC_FLUSH)
+ * or if an error happened. By default - join collected chunks,
+ * free memory and fill `results` / `err` properties.
+ **/
+Inflate.prototype.onEnd = function (status) {
+ // On success - join
+ if (status === c.Z_OK) {
+ if (this.options.to === 'string') {
+ // Glue & convert here, until we teach pako to send
+ // utf8 aligned strings to onData
+ this.result = this.chunks.join('');
+ } else {
+ this.result = utils.flattenChunks(this.chunks);
+ }
+ }
+ this.chunks = [];
+ this.err = status;
+ this.msg = this.strm.msg;
+};
+
+
+/**
+ * inflate(data[, options]) -> Uint8Array|Array|String
+ * - data (Uint8Array|Array|String): input data to decompress.
+ * - options (Object): zlib inflate options.
+ *
+ * Decompress `data` with inflate/ungzip and `options`. Autodetect
+ * format via wrapper header by default. That's why we don't provide
+ * separate `ungzip` method.
+ *
+ * Supported options are:
+ *
+ * - windowBits
+ *
+ * [http://zlib.net/manual.html#Advanced](http://zlib.net/manual.html#Advanced)
+ * for more information.
+ *
+ * Sugar (options):
+ *
+ * - `raw` (Boolean) - say that we work with raw stream, if you don't wish to specify
+ * negative windowBits implicitly.
+ * - `to` (String) - if equal to 'string', then result will be converted
+ * from utf8 to utf16 (javascript) string. When string output requested,
+ * chunk length can differ from `chunkSize`, depending on content.
+ *
+ *
+ * ##### Example:
+ *
+ * ```javascript
+ * var pako = require('pako')
+ * , input = pako.deflate([1,2,3,4,5,6,7,8,9])
+ * , output;
+ *
+ * try {
+ * output = pako.inflate(input);
+ * } catch (err)
+ * console.log(err);
+ * }
+ * ```
+ **/
+function inflate(input, options) {
+ var inflator = new Inflate(options);
+
+ inflator.push(input, true);
+
+ // That will never happens, if you don't cheat with options :)
+ if (inflator.err) { throw inflator.msg || msg[inflator.err]; }
+
+ return inflator.result;
+}
+
+
+/**
+ * inflateRaw(data[, options]) -> Uint8Array|Array|String
+ * - data (Uint8Array|Array|String): input data to decompress.
+ * - options (Object): zlib inflate options.
+ *
+ * The same as [[inflate]], but creates raw data, without wrapper
+ * (header and adler32 crc).
+ **/
+function inflateRaw(input, options) {
+ options = options || {};
+ options.raw = true;
+ return inflate(input, options);
+}
+
+
+/**
+ * ungzip(data[, options]) -> Uint8Array|Array|String
+ * - data (Uint8Array|Array|String): input data to decompress.
+ * - options (Object): zlib inflate options.
+ *
+ * Just shortcut to [[inflate]], because it autodetects format
+ * by header.content. Done for convenience.
+ **/
+
+
+exports.Inflate = Inflate;
+exports.inflate = inflate;
+exports.inflateRaw = inflateRaw;
+exports.ungzip = inflate;
diff --git a/node_modules/pako/lib/utils/common.js b/node_modules/pako/lib/utils/common.js
new file mode 100644
index 0000000000000000000000000000000000000000..58be4beb4af3e0153371608a3566e1a074437a7c
--- /dev/null
+++ b/node_modules/pako/lib/utils/common.js
@@ -0,0 +1,105 @@
+'use strict';
+
+
+var TYPED_OK = (typeof Uint8Array !== 'undefined') &&
+ (typeof Uint16Array !== 'undefined') &&
+ (typeof Int32Array !== 'undefined');
+
+function _has(obj, key) {
+ return Object.prototype.hasOwnProperty.call(obj, key);
+}
+
+exports.assign = function (obj /*from1, from2, from3, ...*/) {
+ var sources = Array.prototype.slice.call(arguments, 1);
+ while (sources.length) {
+ var source = sources.shift();
+ if (!source) { continue; }
+
+ if (typeof source !== 'object') {
+ throw new TypeError(source + 'must be non-object');
+ }
+
+ for (var p in source) {
+ if (_has(source, p)) {
+ obj[p] = source[p];
+ }
+ }
+ }
+
+ return obj;
+};
+
+
+// reduce buffer size, avoiding mem copy
+exports.shrinkBuf = function (buf, size) {
+ if (buf.length === size) { return buf; }
+ if (buf.subarray) { return buf.subarray(0, size); }
+ buf.length = size;
+ return buf;
+};
+
+
+var fnTyped = {
+ arraySet: function (dest, src, src_offs, len, dest_offs) {
+ if (src.subarray && dest.subarray) {
+ dest.set(src.subarray(src_offs, src_offs + len), dest_offs);
+ return;
+ }
+ // Fallback to ordinary array
+ for (var i = 0; i < len; i++) {
+ dest[dest_offs + i] = src[src_offs + i];
+ }
+ },
+ // Join array of chunks to single array.
+ flattenChunks: function (chunks) {
+ var i, l, len, pos, chunk, result;
+
+ // calculate data length
+ len = 0;
+ for (i = 0, l = chunks.length; i < l; i++) {
+ len += chunks[i].length;
+ }
+
+ // join chunks
+ result = new Uint8Array(len);
+ pos = 0;
+ for (i = 0, l = chunks.length; i < l; i++) {
+ chunk = chunks[i];
+ result.set(chunk, pos);
+ pos += chunk.length;
+ }
+
+ return result;
+ }
+};
+
+var fnUntyped = {
+ arraySet: function (dest, src, src_offs, len, dest_offs) {
+ for (var i = 0; i < len; i++) {
+ dest[dest_offs + i] = src[src_offs + i];
+ }
+ },
+ // Join array of chunks to single array.
+ flattenChunks: function (chunks) {
+ return [].concat.apply([], chunks);
+ }
+};
+
+
+// Enable/Disable typed arrays use, for testing
+//
+exports.setTyped = function (on) {
+ if (on) {
+ exports.Buf8 = Uint8Array;
+ exports.Buf16 = Uint16Array;
+ exports.Buf32 = Int32Array;
+ exports.assign(exports, fnTyped);
+ } else {
+ exports.Buf8 = Array;
+ exports.Buf16 = Array;
+ exports.Buf32 = Array;
+ exports.assign(exports, fnUntyped);
+ }
+};
+
+exports.setTyped(TYPED_OK);
diff --git a/node_modules/pako/lib/utils/strings.js b/node_modules/pako/lib/utils/strings.js
new file mode 100644
index 0000000000000000000000000000000000000000..b07a732d6b18101e07eacb138dffb0761fd54d4f
--- /dev/null
+++ b/node_modules/pako/lib/utils/strings.js
@@ -0,0 +1,187 @@
+// String encode/decode helpers
+'use strict';
+
+
+var utils = require('./common');
+
+
+// Quick check if we can use fast array to bin string conversion
+//
+// - apply(Array) can fail on Android 2.2
+// - apply(Uint8Array) can fail on iOS 5.1 Safari
+//
+var STR_APPLY_OK = true;
+var STR_APPLY_UIA_OK = true;
+
+try { String.fromCharCode.apply(null, [ 0 ]); } catch (__) { STR_APPLY_OK = false; }
+try { String.fromCharCode.apply(null, new Uint8Array(1)); } catch (__) { STR_APPLY_UIA_OK = false; }
+
+
+// Table with utf8 lengths (calculated by first byte of sequence)
+// Note, that 5 & 6-byte values and some 4-byte values can not be represented in JS,
+// because max possible codepoint is 0x10ffff
+var _utf8len = new utils.Buf8(256);
+for (var q = 0; q < 256; q++) {
+ _utf8len[q] = (q >= 252 ? 6 : q >= 248 ? 5 : q >= 240 ? 4 : q >= 224 ? 3 : q >= 192 ? 2 : 1);
+}
+_utf8len[254] = _utf8len[254] = 1; // Invalid sequence start
+
+
+// convert string to array (typed, when possible)
+exports.string2buf = function (str) {
+ var buf, c, c2, m_pos, i, str_len = str.length, buf_len = 0;
+
+ // count binary size
+ for (m_pos = 0; m_pos < str_len; m_pos++) {
+ c = str.charCodeAt(m_pos);
+ if ((c & 0xfc00) === 0xd800 && (m_pos + 1 < str_len)) {
+ c2 = str.charCodeAt(m_pos + 1);
+ if ((c2 & 0xfc00) === 0xdc00) {
+ c = 0x10000 + ((c - 0xd800) << 10) + (c2 - 0xdc00);
+ m_pos++;
+ }
+ }
+ buf_len += c < 0x80 ? 1 : c < 0x800 ? 2 : c < 0x10000 ? 3 : 4;
+ }
+
+ // allocate buffer
+ buf = new utils.Buf8(buf_len);
+
+ // convert
+ for (i = 0, m_pos = 0; i < buf_len; m_pos++) {
+ c = str.charCodeAt(m_pos);
+ if ((c & 0xfc00) === 0xd800 && (m_pos + 1 < str_len)) {
+ c2 = str.charCodeAt(m_pos + 1);
+ if ((c2 & 0xfc00) === 0xdc00) {
+ c = 0x10000 + ((c - 0xd800) << 10) + (c2 - 0xdc00);
+ m_pos++;
+ }
+ }
+ if (c < 0x80) {
+ /* one byte */
+ buf[i++] = c;
+ } else if (c < 0x800) {
+ /* two bytes */
+ buf[i++] = 0xC0 | (c >>> 6);
+ buf[i++] = 0x80 | (c & 0x3f);
+ } else if (c < 0x10000) {
+ /* three bytes */
+ buf[i++] = 0xE0 | (c >>> 12);
+ buf[i++] = 0x80 | (c >>> 6 & 0x3f);
+ buf[i++] = 0x80 | (c & 0x3f);
+ } else {
+ /* four bytes */
+ buf[i++] = 0xf0 | (c >>> 18);
+ buf[i++] = 0x80 | (c >>> 12 & 0x3f);
+ buf[i++] = 0x80 | (c >>> 6 & 0x3f);
+ buf[i++] = 0x80 | (c & 0x3f);
+ }
+ }
+
+ return buf;
+};
+
+// Helper (used in 2 places)
+function buf2binstring(buf, len) {
+ // On Chrome, the arguments in a function call that are allowed is `65534`.
+ // If the length of the buffer is smaller than that, we can use this optimization,
+ // otherwise we will take a slower path.
+ if (len < 65534) {
+ if ((buf.subarray && STR_APPLY_UIA_OK) || (!buf.subarray && STR_APPLY_OK)) {
+ return String.fromCharCode.apply(null, utils.shrinkBuf(buf, len));
+ }
+ }
+
+ var result = '';
+ for (var i = 0; i < len; i++) {
+ result += String.fromCharCode(buf[i]);
+ }
+ return result;
+}
+
+
+// Convert byte array to binary string
+exports.buf2binstring = function (buf) {
+ return buf2binstring(buf, buf.length);
+};
+
+
+// Convert binary string (typed, when possible)
+exports.binstring2buf = function (str) {
+ var buf = new utils.Buf8(str.length);
+ for (var i = 0, len = buf.length; i < len; i++) {
+ buf[i] = str.charCodeAt(i);
+ }
+ return buf;
+};
+
+
+// convert array to string
+exports.buf2string = function (buf, max) {
+ var i, out, c, c_len;
+ var len = max || buf.length;
+
+ // Reserve max possible length (2 words per char)
+ // NB: by unknown reasons, Array is significantly faster for
+ // String.fromCharCode.apply than Uint16Array.
+ var utf16buf = new Array(len * 2);
+
+ for (out = 0, i = 0; i < len;) {
+ c = buf[i++];
+ // quick process ascii
+ if (c < 0x80) { utf16buf[out++] = c; continue; }
+
+ c_len = _utf8len[c];
+ // skip 5 & 6 byte codes
+ if (c_len > 4) { utf16buf[out++] = 0xfffd; i += c_len - 1; continue; }
+
+ // apply mask on first byte
+ c &= c_len === 2 ? 0x1f : c_len === 3 ? 0x0f : 0x07;
+ // join the rest
+ while (c_len > 1 && i < len) {
+ c = (c << 6) | (buf[i++] & 0x3f);
+ c_len--;
+ }
+
+ // terminated by end of string?
+ if (c_len > 1) { utf16buf[out++] = 0xfffd; continue; }
+
+ if (c < 0x10000) {
+ utf16buf[out++] = c;
+ } else {
+ c -= 0x10000;
+ utf16buf[out++] = 0xd800 | ((c >> 10) & 0x3ff);
+ utf16buf[out++] = 0xdc00 | (c & 0x3ff);
+ }
+ }
+
+ return buf2binstring(utf16buf, out);
+};
+
+
+// Calculate max possible position in utf8 buffer,
+// that will not break sequence. If that's not possible
+// - (very small limits) return max size as is.
+//
+// buf[] - utf8 bytes array
+// max - length limit (mandatory);
+exports.utf8border = function (buf, max) {
+ var pos;
+
+ max = max || buf.length;
+ if (max > buf.length) { max = buf.length; }
+
+ // go back from last position, until start of sequence found
+ pos = max - 1;
+ while (pos >= 0 && (buf[pos] & 0xC0) === 0x80) { pos--; }
+
+ // Very small and broken sequence,
+ // return max, because we should return something anyway.
+ if (pos < 0) { return max; }
+
+ // If we came to start of buffer - that means buffer is too small,
+ // return max too.
+ if (pos === 0) { return max; }
+
+ return (pos + _utf8len[buf[pos]] > max) ? pos : max;
+};
diff --git a/node_modules/pako/lib/zlib/README b/node_modules/pako/lib/zlib/README
new file mode 100644
index 0000000000000000000000000000000000000000..88a8752470dc696bf358e9622cc164572436f688
--- /dev/null
+++ b/node_modules/pako/lib/zlib/README
@@ -0,0 +1,59 @@
+Content of this folder follows zlib C sources as close as possible.
+That's intended to simplify maintainability and guarantee equal API
+and result.
+
+Key differences:
+
+- Everything is in JavaScript.
+- No platform-dependent blocks.
+- Some things like crc32 rewritten to keep size small and make JIT
+ work better.
+- Some code is different due missed features in JS (macros, pointers,
+ structures, header files)
+- Specific API methods are not implemented (see notes in root readme)
+
+This port is based on zlib 1.2.8.
+
+This port is under zlib license (see below) with contribution and addition of javascript
+port under expat license (see LICENSE at root of project)
+
+Copyright:
+(C) 1995-2013 Jean-loup Gailly and Mark Adler
+(C) 2014-2017 Vitaly Puzrin and Andrey Tupitsin
+
+
+From zlib's README
+=============================================================================
+
+Acknowledgments:
+
+ The deflate format used by zlib was defined by Phil Katz. The deflate and
+ zlib specifications were written by L. Peter Deutsch. Thanks to all the
+ people who reported problems and suggested various improvements in zlib; they
+ are too numerous to cite here.
+
+Copyright notice:
+
+ (C) 1995-2013 Jean-loup Gailly and Mark Adler
+
+Copyright (c) <''year''> <''copyright holders''>
+
+This software is provided 'as-is', without any express or implied
+warranty. In no event will the authors be held liable for any damages
+arising from the use of this software.
+
+Permission is granted to anyone to use this software for any purpose,
+including commercial applications, and to alter it and redistribute it
+freely, subject to the following restrictions:
+
+1. The origin of this software must not be misrepresented; you must not
+ claim that you wrote the original software. If you use this software
+ in a product, an acknowledgment in the product documentation would be
+ appreciated but is not required.
+2. Altered source versions must be plainly marked as such, and must not be
+ misrepresented as being the original software.
+3. This notice may not be removed or altered from any source distribution.
+
+
+ Jean-loup Gailly Mark Adler
+ jloup@gzip.org madler@alumni.caltech.edu
diff --git a/node_modules/pako/lib/zlib/adler32.js b/node_modules/pako/lib/zlib/adler32.js
new file mode 100644
index 0000000000000000000000000000000000000000..d440a9810d1ce6dc31bcab5e704a57ab219a1d89
--- /dev/null
+++ b/node_modules/pako/lib/zlib/adler32.js
@@ -0,0 +1,51 @@
+'use strict';
+
+// Note: adler32 takes 12% for level 0 and 2% for level 6.
+// It isn't worth it to make additional optimizations as in original.
+// Small size is preferable.
+
+// (C) 1995-2013 Jean-loup Gailly and Mark Adler
+// (C) 2014-2017 Vitaly Puzrin and Andrey Tupitsin
+//
+// This software is provided 'as-is', without any express or implied
+// warranty. In no event will the authors be held liable for any damages
+// arising from the use of this software.
+//
+// Permission is granted to anyone to use this software for any purpose,
+// including commercial applications, and to alter it and redistribute it
+// freely, subject to the following restrictions:
+//
+// 1. The origin of this software must not be misrepresented; you must not
+// claim that you wrote the original software. If you use this software
+// in a product, an acknowledgment in the product documentation would be
+// appreciated but is not required.
+// 2. Altered source versions must be plainly marked as such, and must not be
+// misrepresented as being the original software.
+// 3. This notice may not be removed or altered from any source distribution.
+
+function adler32(adler, buf, len, pos) {
+ var s1 = (adler & 0xffff) |0,
+ s2 = ((adler >>> 16) & 0xffff) |0,
+ n = 0;
+
+ while (len !== 0) {
+ // Set limit ~ twice less than 5552, to keep
+ // s2 in 31-bits, because we force signed ints.
+ // in other case %= will fail.
+ n = len > 2000 ? 2000 : len;
+ len -= n;
+
+ do {
+ s1 = (s1 + buf[pos++]) |0;
+ s2 = (s2 + s1) |0;
+ } while (--n);
+
+ s1 %= 65521;
+ s2 %= 65521;
+ }
+
+ return (s1 | (s2 << 16)) |0;
+}
+
+
+module.exports = adler32;
diff --git a/node_modules/pako/lib/zlib/constants.js b/node_modules/pako/lib/zlib/constants.js
new file mode 100644
index 0000000000000000000000000000000000000000..569b8724175e4025e6da6f06bd58a33a4c42a899
--- /dev/null
+++ b/node_modules/pako/lib/zlib/constants.js
@@ -0,0 +1,68 @@
+'use strict';
+
+// (C) 1995-2013 Jean-loup Gailly and Mark Adler
+// (C) 2014-2017 Vitaly Puzrin and Andrey Tupitsin
+//
+// This software is provided 'as-is', without any express or implied
+// warranty. In no event will the authors be held liable for any damages
+// arising from the use of this software.
+//
+// Permission is granted to anyone to use this software for any purpose,
+// including commercial applications, and to alter it and redistribute it
+// freely, subject to the following restrictions:
+//
+// 1. The origin of this software must not be misrepresented; you must not
+// claim that you wrote the original software. If you use this software
+// in a product, an acknowledgment in the product documentation would be
+// appreciated but is not required.
+// 2. Altered source versions must be plainly marked as such, and must not be
+// misrepresented as being the original software.
+// 3. This notice may not be removed or altered from any source distribution.
+
+module.exports = {
+
+ /* Allowed flush values; see deflate() and inflate() below for details */
+ Z_NO_FLUSH: 0,
+ Z_PARTIAL_FLUSH: 1,
+ Z_SYNC_FLUSH: 2,
+ Z_FULL_FLUSH: 3,
+ Z_FINISH: 4,
+ Z_BLOCK: 5,
+ Z_TREES: 6,
+
+ /* Return codes for the compression/decompression functions. Negative values
+ * are errors, positive values are used for special but normal events.
+ */
+ Z_OK: 0,
+ Z_STREAM_END: 1,
+ Z_NEED_DICT: 2,
+ Z_ERRNO: -1,
+ Z_STREAM_ERROR: -2,
+ Z_DATA_ERROR: -3,
+ //Z_MEM_ERROR: -4,
+ Z_BUF_ERROR: -5,
+ //Z_VERSION_ERROR: -6,
+
+ /* compression levels */
+ Z_NO_COMPRESSION: 0,
+ Z_BEST_SPEED: 1,
+ Z_BEST_COMPRESSION: 9,
+ Z_DEFAULT_COMPRESSION: -1,
+
+
+ Z_FILTERED: 1,
+ Z_HUFFMAN_ONLY: 2,
+ Z_RLE: 3,
+ Z_FIXED: 4,
+ Z_DEFAULT_STRATEGY: 0,
+
+ /* Possible values of the data_type field (though see inflate()) */
+ Z_BINARY: 0,
+ Z_TEXT: 1,
+ //Z_ASCII: 1, // = Z_TEXT (deprecated)
+ Z_UNKNOWN: 2,
+
+ /* The deflate compression method */
+ Z_DEFLATED: 8
+ //Z_NULL: null // Use -1 or null inline, depending on var type
+};
diff --git a/node_modules/pako/lib/zlib/crc32.js b/node_modules/pako/lib/zlib/crc32.js
new file mode 100644
index 0000000000000000000000000000000000000000..6a96092462a293036c5b39efe2d0d849ab01c27f
--- /dev/null
+++ b/node_modules/pako/lib/zlib/crc32.js
@@ -0,0 +1,59 @@
+'use strict';
+
+// Note: we can't get significant speed boost here.
+// So write code to minimize size - no pregenerated tables
+// and array tools dependencies.
+
+// (C) 1995-2013 Jean-loup Gailly and Mark Adler
+// (C) 2014-2017 Vitaly Puzrin and Andrey Tupitsin
+//
+// This software is provided 'as-is', without any express or implied
+// warranty. In no event will the authors be held liable for any damages
+// arising from the use of this software.
+//
+// Permission is granted to anyone to use this software for any purpose,
+// including commercial applications, and to alter it and redistribute it
+// freely, subject to the following restrictions:
+//
+// 1. The origin of this software must not be misrepresented; you must not
+// claim that you wrote the original software. If you use this software
+// in a product, an acknowledgment in the product documentation would be
+// appreciated but is not required.
+// 2. Altered source versions must be plainly marked as such, and must not be
+// misrepresented as being the original software.
+// 3. This notice may not be removed or altered from any source distribution.
+
+// Use ordinary array, since untyped makes no boost here
+function makeTable() {
+ var c, table = [];
+
+ for (var n = 0; n < 256; n++) {
+ c = n;
+ for (var k = 0; k < 8; k++) {
+ c = ((c & 1) ? (0xEDB88320 ^ (c >>> 1)) : (c >>> 1));
+ }
+ table[n] = c;
+ }
+
+ return table;
+}
+
+// Create table on load. Just 255 signed longs. Not a problem.
+var crcTable = makeTable();
+
+
+function crc32(crc, buf, len, pos) {
+ var t = crcTable,
+ end = pos + len;
+
+ crc ^= -1;
+
+ for (var i = pos; i < end; i++) {
+ crc = (crc >>> 8) ^ t[(crc ^ buf[i]) & 0xFF];
+ }
+
+ return (crc ^ (-1)); // >>> 0;
+}
+
+
+module.exports = crc32;
diff --git a/node_modules/pako/lib/zlib/deflate.js b/node_modules/pako/lib/zlib/deflate.js
new file mode 100644
index 0000000000000000000000000000000000000000..314569892c5d1e4efc2ccff1651f1a29505281a1
--- /dev/null
+++ b/node_modules/pako/lib/zlib/deflate.js
@@ -0,0 +1,1874 @@
+'use strict';
+
+// (C) 1995-2013 Jean-loup Gailly and Mark Adler
+// (C) 2014-2017 Vitaly Puzrin and Andrey Tupitsin
+//
+// This software is provided 'as-is', without any express or implied
+// warranty. In no event will the authors be held liable for any damages
+// arising from the use of this software.
+//
+// Permission is granted to anyone to use this software for any purpose,
+// including commercial applications, and to alter it and redistribute it
+// freely, subject to the following restrictions:
+//
+// 1. The origin of this software must not be misrepresented; you must not
+// claim that you wrote the original software. If you use this software
+// in a product, an acknowledgment in the product documentation would be
+// appreciated but is not required.
+// 2. Altered source versions must be plainly marked as such, and must not be
+// misrepresented as being the original software.
+// 3. This notice may not be removed or altered from any source distribution.
+
+var utils = require('../utils/common');
+var trees = require('./trees');
+var adler32 = require('./adler32');
+var crc32 = require('./crc32');
+var msg = require('./messages');
+
+/* Public constants ==========================================================*/
+/* ===========================================================================*/
+
+
+/* Allowed flush values; see deflate() and inflate() below for details */
+var Z_NO_FLUSH = 0;
+var Z_PARTIAL_FLUSH = 1;
+//var Z_SYNC_FLUSH = 2;
+var Z_FULL_FLUSH = 3;
+var Z_FINISH = 4;
+var Z_BLOCK = 5;
+//var Z_TREES = 6;
+
+
+/* Return codes for the compression/decompression functions. Negative values
+ * are errors, positive values are used for special but normal events.
+ */
+var Z_OK = 0;
+var Z_STREAM_END = 1;
+//var Z_NEED_DICT = 2;
+//var Z_ERRNO = -1;
+var Z_STREAM_ERROR = -2;
+var Z_DATA_ERROR = -3;
+//var Z_MEM_ERROR = -4;
+var Z_BUF_ERROR = -5;
+//var Z_VERSION_ERROR = -6;
+
+
+/* compression levels */
+//var Z_NO_COMPRESSION = 0;
+//var Z_BEST_SPEED = 1;
+//var Z_BEST_COMPRESSION = 9;
+var Z_DEFAULT_COMPRESSION = -1;
+
+
+var Z_FILTERED = 1;
+var Z_HUFFMAN_ONLY = 2;
+var Z_RLE = 3;
+var Z_FIXED = 4;
+var Z_DEFAULT_STRATEGY = 0;
+
+/* Possible values of the data_type field (though see inflate()) */
+//var Z_BINARY = 0;
+//var Z_TEXT = 1;
+//var Z_ASCII = 1; // = Z_TEXT
+var Z_UNKNOWN = 2;
+
+
+/* The deflate compression method */
+var Z_DEFLATED = 8;
+
+/*============================================================================*/
+
+
+var MAX_MEM_LEVEL = 9;
+/* Maximum value for memLevel in deflateInit2 */
+var MAX_WBITS = 15;
+/* 32K LZ77 window */
+var DEF_MEM_LEVEL = 8;
+
+
+var LENGTH_CODES = 29;
+/* number of length codes, not counting the special END_BLOCK code */
+var LITERALS = 256;
+/* number of literal bytes 0..255 */
+var L_CODES = LITERALS + 1 + LENGTH_CODES;
+/* number of Literal or Length codes, including the END_BLOCK code */
+var D_CODES = 30;
+/* number of distance codes */
+var BL_CODES = 19;
+/* number of codes used to transfer the bit lengths */
+var HEAP_SIZE = 2 * L_CODES + 1;
+/* maximum heap size */
+var MAX_BITS = 15;
+/* All codes must not exceed MAX_BITS bits */
+
+var MIN_MATCH = 3;
+var MAX_MATCH = 258;
+var MIN_LOOKAHEAD = (MAX_MATCH + MIN_MATCH + 1);
+
+var PRESET_DICT = 0x20;
+
+var INIT_STATE = 42;
+var EXTRA_STATE = 69;
+var NAME_STATE = 73;
+var COMMENT_STATE = 91;
+var HCRC_STATE = 103;
+var BUSY_STATE = 113;
+var FINISH_STATE = 666;
+
+var BS_NEED_MORE = 1; /* block not completed, need more input or more output */
+var BS_BLOCK_DONE = 2; /* block flush performed */
+var BS_FINISH_STARTED = 3; /* finish started, need only more output at next deflate */
+var BS_FINISH_DONE = 4; /* finish done, accept no more input or output */
+
+var OS_CODE = 0x03; // Unix :) . Don't detect, use this default.
+
+function err(strm, errorCode) {
+ strm.msg = msg[errorCode];
+ return errorCode;
+}
+
+function rank(f) {
+ return ((f) << 1) - ((f) > 4 ? 9 : 0);
+}
+
+function zero(buf) { var len = buf.length; while (--len >= 0) { buf[len] = 0; } }
+
+
+/* =========================================================================
+ * Flush as much pending output as possible. All deflate() output goes
+ * through this function so some applications may wish to modify it
+ * to avoid allocating a large strm->output buffer and copying into it.
+ * (See also read_buf()).
+ */
+function flush_pending(strm) {
+ var s = strm.state;
+
+ //_tr_flush_bits(s);
+ var len = s.pending;
+ if (len > strm.avail_out) {
+ len = strm.avail_out;
+ }
+ if (len === 0) { return; }
+
+ utils.arraySet(strm.output, s.pending_buf, s.pending_out, len, strm.next_out);
+ strm.next_out += len;
+ s.pending_out += len;
+ strm.total_out += len;
+ strm.avail_out -= len;
+ s.pending -= len;
+ if (s.pending === 0) {
+ s.pending_out = 0;
+ }
+}
+
+
+function flush_block_only(s, last) {
+ trees._tr_flush_block(s, (s.block_start >= 0 ? s.block_start : -1), s.strstart - s.block_start, last);
+ s.block_start = s.strstart;
+ flush_pending(s.strm);
+}
+
+
+function put_byte(s, b) {
+ s.pending_buf[s.pending++] = b;
+}
+
+
+/* =========================================================================
+ * Put a short in the pending buffer. The 16-bit value is put in MSB order.
+ * IN assertion: the stream state is correct and there is enough room in
+ * pending_buf.
+ */
+function putShortMSB(s, b) {
+// put_byte(s, (Byte)(b >> 8));
+// put_byte(s, (Byte)(b & 0xff));
+ s.pending_buf[s.pending++] = (b >>> 8) & 0xff;
+ s.pending_buf[s.pending++] = b & 0xff;
+}
+
+
+/* ===========================================================================
+ * Read a new buffer from the current input stream, update the adler32
+ * and total number of bytes read. All deflate() input goes through
+ * this function so some applications may wish to modify it to avoid
+ * allocating a large strm->input buffer and copying from it.
+ * (See also flush_pending()).
+ */
+function read_buf(strm, buf, start, size) {
+ var len = strm.avail_in;
+
+ if (len > size) { len = size; }
+ if (len === 0) { return 0; }
+
+ strm.avail_in -= len;
+
+ // zmemcpy(buf, strm->next_in, len);
+ utils.arraySet(buf, strm.input, strm.next_in, len, start);
+ if (strm.state.wrap === 1) {
+ strm.adler = adler32(strm.adler, buf, len, start);
+ }
+
+ else if (strm.state.wrap === 2) {
+ strm.adler = crc32(strm.adler, buf, len, start);
+ }
+
+ strm.next_in += len;
+ strm.total_in += len;
+
+ return len;
+}
+
+
+/* ===========================================================================
+ * Set match_start to the longest match starting at the given string and
+ * return its length. Matches shorter or equal to prev_length are discarded,
+ * in which case the result is equal to prev_length and match_start is
+ * garbage.
+ * IN assertions: cur_match is the head of the hash chain for the current
+ * string (strstart) and its distance is <= MAX_DIST, and prev_length >= 1
+ * OUT assertion: the match length is not greater than s->lookahead.
+ */
+function longest_match(s, cur_match) {
+ var chain_length = s.max_chain_length; /* max hash chain length */
+ var scan = s.strstart; /* current string */
+ var match; /* matched string */
+ var len; /* length of current match */
+ var best_len = s.prev_length; /* best match length so far */
+ var nice_match = s.nice_match; /* stop if match long enough */
+ var limit = (s.strstart > (s.w_size - MIN_LOOKAHEAD)) ?
+ s.strstart - (s.w_size - MIN_LOOKAHEAD) : 0/*NIL*/;
+
+ var _win = s.window; // shortcut
+
+ var wmask = s.w_mask;
+ var prev = s.prev;
+
+ /* Stop when cur_match becomes <= limit. To simplify the code,
+ * we prevent matches with the string of window index 0.
+ */
+
+ var strend = s.strstart + MAX_MATCH;
+ var scan_end1 = _win[scan + best_len - 1];
+ var scan_end = _win[scan + best_len];
+
+ /* The code is optimized for HASH_BITS >= 8 and MAX_MATCH-2 multiple of 16.
+ * It is easy to get rid of this optimization if necessary.
+ */
+ // Assert(s->hash_bits >= 8 && MAX_MATCH == 258, "Code too clever");
+
+ /* Do not waste too much time if we already have a good match: */
+ if (s.prev_length >= s.good_match) {
+ chain_length >>= 2;
+ }
+ /* Do not look for matches beyond the end of the input. This is necessary
+ * to make deflate deterministic.
+ */
+ if (nice_match > s.lookahead) { nice_match = s.lookahead; }
+
+ // Assert((ulg)s->strstart <= s->window_size-MIN_LOOKAHEAD, "need lookahead");
+
+ do {
+ // Assert(cur_match < s->strstart, "no future");
+ match = cur_match;
+
+ /* Skip to next match if the match length cannot increase
+ * or if the match length is less than 2. Note that the checks below
+ * for insufficient lookahead only occur occasionally for performance
+ * reasons. Therefore uninitialized memory will be accessed, and
+ * conditional jumps will be made that depend on those values.
+ * However the length of the match is limited to the lookahead, so
+ * the output of deflate is not affected by the uninitialized values.
+ */
+
+ if (_win[match + best_len] !== scan_end ||
+ _win[match + best_len - 1] !== scan_end1 ||
+ _win[match] !== _win[scan] ||
+ _win[++match] !== _win[scan + 1]) {
+ continue;
+ }
+
+ /* The check at best_len-1 can be removed because it will be made
+ * again later. (This heuristic is not always a win.)
+ * It is not necessary to compare scan[2] and match[2] since they
+ * are always equal when the other bytes match, given that
+ * the hash keys are equal and that HASH_BITS >= 8.
+ */
+ scan += 2;
+ match++;
+ // Assert(*scan == *match, "match[2]?");
+
+ /* We check for insufficient lookahead only every 8th comparison;
+ * the 256th check will be made at strstart+258.
+ */
+ do {
+ /*jshint noempty:false*/
+ } while (_win[++scan] === _win[++match] && _win[++scan] === _win[++match] &&
+ _win[++scan] === _win[++match] && _win[++scan] === _win[++match] &&
+ _win[++scan] === _win[++match] && _win[++scan] === _win[++match] &&
+ _win[++scan] === _win[++match] && _win[++scan] === _win[++match] &&
+ scan < strend);
+
+ // Assert(scan <= s->window+(unsigned)(s->window_size-1), "wild scan");
+
+ len = MAX_MATCH - (strend - scan);
+ scan = strend - MAX_MATCH;
+
+ if (len > best_len) {
+ s.match_start = cur_match;
+ best_len = len;
+ if (len >= nice_match) {
+ break;
+ }
+ scan_end1 = _win[scan + best_len - 1];
+ scan_end = _win[scan + best_len];
+ }
+ } while ((cur_match = prev[cur_match & wmask]) > limit && --chain_length !== 0);
+
+ if (best_len <= s.lookahead) {
+ return best_len;
+ }
+ return s.lookahead;
+}
+
+
+/* ===========================================================================
+ * Fill the window when the lookahead becomes insufficient.
+ * Updates strstart and lookahead.
+ *
+ * IN assertion: lookahead < MIN_LOOKAHEAD
+ * OUT assertions: strstart <= window_size-MIN_LOOKAHEAD
+ * At least one byte has been read, or avail_in == 0; reads are
+ * performed for at least two bytes (required for the zip translate_eol
+ * option -- not supported here).
+ */
+function fill_window(s) {
+ var _w_size = s.w_size;
+ var p, n, m, more, str;
+
+ //Assert(s->lookahead < MIN_LOOKAHEAD, "already enough lookahead");
+
+ do {
+ more = s.window_size - s.lookahead - s.strstart;
+
+ // JS ints have 32 bit, block below not needed
+ /* Deal with !@#$% 64K limit: */
+ //if (sizeof(int) <= 2) {
+ // if (more == 0 && s->strstart == 0 && s->lookahead == 0) {
+ // more = wsize;
+ //
+ // } else if (more == (unsigned)(-1)) {
+ // /* Very unlikely, but possible on 16 bit machine if
+ // * strstart == 0 && lookahead == 1 (input done a byte at time)
+ // */
+ // more--;
+ // }
+ //}
+
+
+ /* If the window is almost full and there is insufficient lookahead,
+ * move the upper half to the lower one to make room in the upper half.
+ */
+ if (s.strstart >= _w_size + (_w_size - MIN_LOOKAHEAD)) {
+
+ utils.arraySet(s.window, s.window, _w_size, _w_size, 0);
+ s.match_start -= _w_size;
+ s.strstart -= _w_size;
+ /* we now have strstart >= MAX_DIST */
+ s.block_start -= _w_size;
+
+ /* Slide the hash table (could be avoided with 32 bit values
+ at the expense of memory usage). We slide even when level == 0
+ to keep the hash table consistent if we switch back to level > 0
+ later. (Using level 0 permanently is not an optimal usage of
+ zlib, so we don't care about this pathological case.)
+ */
+
+ n = s.hash_size;
+ p = n;
+ do {
+ m = s.head[--p];
+ s.head[p] = (m >= _w_size ? m - _w_size : 0);
+ } while (--n);
+
+ n = _w_size;
+ p = n;
+ do {
+ m = s.prev[--p];
+ s.prev[p] = (m >= _w_size ? m - _w_size : 0);
+ /* If n is not on any hash chain, prev[n] is garbage but
+ * its value will never be used.
+ */
+ } while (--n);
+
+ more += _w_size;
+ }
+ if (s.strm.avail_in === 0) {
+ break;
+ }
+
+ /* If there was no sliding:
+ * strstart <= WSIZE+MAX_DIST-1 && lookahead <= MIN_LOOKAHEAD - 1 &&
+ * more == window_size - lookahead - strstart
+ * => more >= window_size - (MIN_LOOKAHEAD-1 + WSIZE + MAX_DIST-1)
+ * => more >= window_size - 2*WSIZE + 2
+ * In the BIG_MEM or MMAP case (not yet supported),
+ * window_size == input_size + MIN_LOOKAHEAD &&
+ * strstart + s->lookahead <= input_size => more >= MIN_LOOKAHEAD.
+ * Otherwise, window_size == 2*WSIZE so more >= 2.
+ * If there was sliding, more >= WSIZE. So in all cases, more >= 2.
+ */
+ //Assert(more >= 2, "more < 2");
+ n = read_buf(s.strm, s.window, s.strstart + s.lookahead, more);
+ s.lookahead += n;
+
+ /* Initialize the hash value now that we have some input: */
+ if (s.lookahead + s.insert >= MIN_MATCH) {
+ str = s.strstart - s.insert;
+ s.ins_h = s.window[str];
+
+ /* UPDATE_HASH(s, s->ins_h, s->window[str + 1]); */
+ s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[str + 1]) & s.hash_mask;
+//#if MIN_MATCH != 3
+// Call update_hash() MIN_MATCH-3 more times
+//#endif
+ while (s.insert) {
+ /* UPDATE_HASH(s, s->ins_h, s->window[str + MIN_MATCH-1]); */
+ s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[str + MIN_MATCH - 1]) & s.hash_mask;
+
+ s.prev[str & s.w_mask] = s.head[s.ins_h];
+ s.head[s.ins_h] = str;
+ str++;
+ s.insert--;
+ if (s.lookahead + s.insert < MIN_MATCH) {
+ break;
+ }
+ }
+ }
+ /* If the whole input has less than MIN_MATCH bytes, ins_h is garbage,
+ * but this is not important since only literal bytes will be emitted.
+ */
+
+ } while (s.lookahead < MIN_LOOKAHEAD && s.strm.avail_in !== 0);
+
+ /* If the WIN_INIT bytes after the end of the current data have never been
+ * written, then zero those bytes in order to avoid memory check reports of
+ * the use of uninitialized (or uninitialised as Julian writes) bytes by
+ * the longest match routines. Update the high water mark for the next
+ * time through here. WIN_INIT is set to MAX_MATCH since the longest match
+ * routines allow scanning to strstart + MAX_MATCH, ignoring lookahead.
+ */
+// if (s.high_water < s.window_size) {
+// var curr = s.strstart + s.lookahead;
+// var init = 0;
+//
+// if (s.high_water < curr) {
+// /* Previous high water mark below current data -- zero WIN_INIT
+// * bytes or up to end of window, whichever is less.
+// */
+// init = s.window_size - curr;
+// if (init > WIN_INIT)
+// init = WIN_INIT;
+// zmemzero(s->window + curr, (unsigned)init);
+// s->high_water = curr + init;
+// }
+// else if (s->high_water < (ulg)curr + WIN_INIT) {
+// /* High water mark at or above current data, but below current data
+// * plus WIN_INIT -- zero out to current data plus WIN_INIT, or up
+// * to end of window, whichever is less.
+// */
+// init = (ulg)curr + WIN_INIT - s->high_water;
+// if (init > s->window_size - s->high_water)
+// init = s->window_size - s->high_water;
+// zmemzero(s->window + s->high_water, (unsigned)init);
+// s->high_water += init;
+// }
+// }
+//
+// Assert((ulg)s->strstart <= s->window_size - MIN_LOOKAHEAD,
+// "not enough room for search");
+}
+
+/* ===========================================================================
+ * Copy without compression as much as possible from the input stream, return
+ * the current block state.
+ * This function does not insert new strings in the dictionary since
+ * uncompressible data is probably not useful. This function is used
+ * only for the level=0 compression option.
+ * NOTE: this function should be optimized to avoid extra copying from
+ * window to pending_buf.
+ */
+function deflate_stored(s, flush) {
+ /* Stored blocks are limited to 0xffff bytes, pending_buf is limited
+ * to pending_buf_size, and each stored block has a 5 byte header:
+ */
+ var max_block_size = 0xffff;
+
+ if (max_block_size > s.pending_buf_size - 5) {
+ max_block_size = s.pending_buf_size - 5;
+ }
+
+ /* Copy as much as possible from input to output: */
+ for (;;) {
+ /* Fill the window as much as possible: */
+ if (s.lookahead <= 1) {
+
+ //Assert(s->strstart < s->w_size+MAX_DIST(s) ||
+ // s->block_start >= (long)s->w_size, "slide too late");
+// if (!(s.strstart < s.w_size + (s.w_size - MIN_LOOKAHEAD) ||
+// s.block_start >= s.w_size)) {
+// throw new Error("slide too late");
+// }
+
+ fill_window(s);
+ if (s.lookahead === 0 && flush === Z_NO_FLUSH) {
+ return BS_NEED_MORE;
+ }
+
+ if (s.lookahead === 0) {
+ break;
+ }
+ /* flush the current block */
+ }
+ //Assert(s->block_start >= 0L, "block gone");
+// if (s.block_start < 0) throw new Error("block gone");
+
+ s.strstart += s.lookahead;
+ s.lookahead = 0;
+
+ /* Emit a stored block if pending_buf will be full: */
+ var max_start = s.block_start + max_block_size;
+
+ if (s.strstart === 0 || s.strstart >= max_start) {
+ /* strstart == 0 is possible when wraparound on 16-bit machine */
+ s.lookahead = s.strstart - max_start;
+ s.strstart = max_start;
+ /*** FLUSH_BLOCK(s, 0); ***/
+ flush_block_only(s, false);
+ if (s.strm.avail_out === 0) {
+ return BS_NEED_MORE;
+ }
+ /***/
+
+
+ }
+ /* Flush if we may have to slide, otherwise block_start may become
+ * negative and the data will be gone:
+ */
+ if (s.strstart - s.block_start >= (s.w_size - MIN_LOOKAHEAD)) {
+ /*** FLUSH_BLOCK(s, 0); ***/
+ flush_block_only(s, false);
+ if (s.strm.avail_out === 0) {
+ return BS_NEED_MORE;
+ }
+ /***/
+ }
+ }
+
+ s.insert = 0;
+
+ if (flush === Z_FINISH) {
+ /*** FLUSH_BLOCK(s, 1); ***/
+ flush_block_only(s, true);
+ if (s.strm.avail_out === 0) {
+ return BS_FINISH_STARTED;
+ }
+ /***/
+ return BS_FINISH_DONE;
+ }
+
+ if (s.strstart > s.block_start) {
+ /*** FLUSH_BLOCK(s, 0); ***/
+ flush_block_only(s, false);
+ if (s.strm.avail_out === 0) {
+ return BS_NEED_MORE;
+ }
+ /***/
+ }
+
+ return BS_NEED_MORE;
+}
+
+/* ===========================================================================
+ * Compress as much as possible from the input stream, return the current
+ * block state.
+ * This function does not perform lazy evaluation of matches and inserts
+ * new strings in the dictionary only for unmatched strings or for short
+ * matches. It is used only for the fast compression options.
+ */
+function deflate_fast(s, flush) {
+ var hash_head; /* head of the hash chain */
+ var bflush; /* set if current block must be flushed */
+
+ for (;;) {
+ /* Make sure that we always have enough lookahead, except
+ * at the end of the input file. We need MAX_MATCH bytes
+ * for the next match, plus MIN_MATCH bytes to insert the
+ * string following the next match.
+ */
+ if (s.lookahead < MIN_LOOKAHEAD) {
+ fill_window(s);
+ if (s.lookahead < MIN_LOOKAHEAD && flush === Z_NO_FLUSH) {
+ return BS_NEED_MORE;
+ }
+ if (s.lookahead === 0) {
+ break; /* flush the current block */
+ }
+ }
+
+ /* Insert the string window[strstart .. strstart+2] in the
+ * dictionary, and set hash_head to the head of the hash chain:
+ */
+ hash_head = 0/*NIL*/;
+ if (s.lookahead >= MIN_MATCH) {
+ /*** INSERT_STRING(s, s.strstart, hash_head); ***/
+ s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;
+ hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];
+ s.head[s.ins_h] = s.strstart;
+ /***/
+ }
+
+ /* Find the longest match, discarding those <= prev_length.
+ * At this point we have always match_length < MIN_MATCH
+ */
+ if (hash_head !== 0/*NIL*/ && ((s.strstart - hash_head) <= (s.w_size - MIN_LOOKAHEAD))) {
+ /* To simplify the code, we prevent matches with the string
+ * of window index 0 (in particular we have to avoid a match
+ * of the string with itself at the start of the input file).
+ */
+ s.match_length = longest_match(s, hash_head);
+ /* longest_match() sets match_start */
+ }
+ if (s.match_length >= MIN_MATCH) {
+ // check_match(s, s.strstart, s.match_start, s.match_length); // for debug only
+
+ /*** _tr_tally_dist(s, s.strstart - s.match_start,
+ s.match_length - MIN_MATCH, bflush); ***/
+ bflush = trees._tr_tally(s, s.strstart - s.match_start, s.match_length - MIN_MATCH);
+
+ s.lookahead -= s.match_length;
+
+ /* Insert new strings in the hash table only if the match length
+ * is not too large. This saves time but degrades compression.
+ */
+ if (s.match_length <= s.max_lazy_match/*max_insert_length*/ && s.lookahead >= MIN_MATCH) {
+ s.match_length--; /* string at strstart already in table */
+ do {
+ s.strstart++;
+ /*** INSERT_STRING(s, s.strstart, hash_head); ***/
+ s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;
+ hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];
+ s.head[s.ins_h] = s.strstart;
+ /***/
+ /* strstart never exceeds WSIZE-MAX_MATCH, so there are
+ * always MIN_MATCH bytes ahead.
+ */
+ } while (--s.match_length !== 0);
+ s.strstart++;
+ } else
+ {
+ s.strstart += s.match_length;
+ s.match_length = 0;
+ s.ins_h = s.window[s.strstart];
+ /* UPDATE_HASH(s, s.ins_h, s.window[s.strstart+1]); */
+ s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + 1]) & s.hash_mask;
+
+//#if MIN_MATCH != 3
+// Call UPDATE_HASH() MIN_MATCH-3 more times
+//#endif
+ /* If lookahead < MIN_MATCH, ins_h is garbage, but it does not
+ * matter since it will be recomputed at next deflate call.
+ */
+ }
+ } else {
+ /* No match, output a literal byte */
+ //Tracevv((stderr,"%c", s.window[s.strstart]));
+ /*** _tr_tally_lit(s, s.window[s.strstart], bflush); ***/
+ bflush = trees._tr_tally(s, 0, s.window[s.strstart]);
+
+ s.lookahead--;
+ s.strstart++;
+ }
+ if (bflush) {
+ /*** FLUSH_BLOCK(s, 0); ***/
+ flush_block_only(s, false);
+ if (s.strm.avail_out === 0) {
+ return BS_NEED_MORE;
+ }
+ /***/
+ }
+ }
+ s.insert = ((s.strstart < (MIN_MATCH - 1)) ? s.strstart : MIN_MATCH - 1);
+ if (flush === Z_FINISH) {
+ /*** FLUSH_BLOCK(s, 1); ***/
+ flush_block_only(s, true);
+ if (s.strm.avail_out === 0) {
+ return BS_FINISH_STARTED;
+ }
+ /***/
+ return BS_FINISH_DONE;
+ }
+ if (s.last_lit) {
+ /*** FLUSH_BLOCK(s, 0); ***/
+ flush_block_only(s, false);
+ if (s.strm.avail_out === 0) {
+ return BS_NEED_MORE;
+ }
+ /***/
+ }
+ return BS_BLOCK_DONE;
+}
+
+/* ===========================================================================
+ * Same as above, but achieves better compression. We use a lazy
+ * evaluation for matches: a match is finally adopted only if there is
+ * no better match at the next window position.
+ */
+function deflate_slow(s, flush) {
+ var hash_head; /* head of hash chain */
+ var bflush; /* set if current block must be flushed */
+
+ var max_insert;
+
+ /* Process the input block. */
+ for (;;) {
+ /* Make sure that we always have enough lookahead, except
+ * at the end of the input file. We need MAX_MATCH bytes
+ * for the next match, plus MIN_MATCH bytes to insert the
+ * string following the next match.
+ */
+ if (s.lookahead < MIN_LOOKAHEAD) {
+ fill_window(s);
+ if (s.lookahead < MIN_LOOKAHEAD && flush === Z_NO_FLUSH) {
+ return BS_NEED_MORE;
+ }
+ if (s.lookahead === 0) { break; } /* flush the current block */
+ }
+
+ /* Insert the string window[strstart .. strstart+2] in the
+ * dictionary, and set hash_head to the head of the hash chain:
+ */
+ hash_head = 0/*NIL*/;
+ if (s.lookahead >= MIN_MATCH) {
+ /*** INSERT_STRING(s, s.strstart, hash_head); ***/
+ s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;
+ hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];
+ s.head[s.ins_h] = s.strstart;
+ /***/
+ }
+
+ /* Find the longest match, discarding those <= prev_length.
+ */
+ s.prev_length = s.match_length;
+ s.prev_match = s.match_start;
+ s.match_length = MIN_MATCH - 1;
+
+ if (hash_head !== 0/*NIL*/ && s.prev_length < s.max_lazy_match &&
+ s.strstart - hash_head <= (s.w_size - MIN_LOOKAHEAD)/*MAX_DIST(s)*/) {
+ /* To simplify the code, we prevent matches with the string
+ * of window index 0 (in particular we have to avoid a match
+ * of the string with itself at the start of the input file).
+ */
+ s.match_length = longest_match(s, hash_head);
+ /* longest_match() sets match_start */
+
+ if (s.match_length <= 5 &&
+ (s.strategy === Z_FILTERED || (s.match_length === MIN_MATCH && s.strstart - s.match_start > 4096/*TOO_FAR*/))) {
+
+ /* If prev_match is also MIN_MATCH, match_start is garbage
+ * but we will ignore the current match anyway.
+ */
+ s.match_length = MIN_MATCH - 1;
+ }
+ }
+ /* If there was a match at the previous step and the current
+ * match is not better, output the previous match:
+ */
+ if (s.prev_length >= MIN_MATCH && s.match_length <= s.prev_length) {
+ max_insert = s.strstart + s.lookahead - MIN_MATCH;
+ /* Do not insert strings in hash table beyond this. */
+
+ //check_match(s, s.strstart-1, s.prev_match, s.prev_length);
+
+ /***_tr_tally_dist(s, s.strstart - 1 - s.prev_match,
+ s.prev_length - MIN_MATCH, bflush);***/
+ bflush = trees._tr_tally(s, s.strstart - 1 - s.prev_match, s.prev_length - MIN_MATCH);
+ /* Insert in hash table all strings up to the end of the match.
+ * strstart-1 and strstart are already inserted. If there is not
+ * enough lookahead, the last two strings are not inserted in
+ * the hash table.
+ */
+ s.lookahead -= s.prev_length - 1;
+ s.prev_length -= 2;
+ do {
+ if (++s.strstart <= max_insert) {
+ /*** INSERT_STRING(s, s.strstart, hash_head); ***/
+ s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;
+ hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];
+ s.head[s.ins_h] = s.strstart;
+ /***/
+ }
+ } while (--s.prev_length !== 0);
+ s.match_available = 0;
+ s.match_length = MIN_MATCH - 1;
+ s.strstart++;
+
+ if (bflush) {
+ /*** FLUSH_BLOCK(s, 0); ***/
+ flush_block_only(s, false);
+ if (s.strm.avail_out === 0) {
+ return BS_NEED_MORE;
+ }
+ /***/
+ }
+
+ } else if (s.match_available) {
+ /* If there was no match at the previous position, output a
+ * single literal. If there was a match but the current match
+ * is longer, truncate the previous match to a single literal.
+ */
+ //Tracevv((stderr,"%c", s->window[s->strstart-1]));
+ /*** _tr_tally_lit(s, s.window[s.strstart-1], bflush); ***/
+ bflush = trees._tr_tally(s, 0, s.window[s.strstart - 1]);
+
+ if (bflush) {
+ /*** FLUSH_BLOCK_ONLY(s, 0) ***/
+ flush_block_only(s, false);
+ /***/
+ }
+ s.strstart++;
+ s.lookahead--;
+ if (s.strm.avail_out === 0) {
+ return BS_NEED_MORE;
+ }
+ } else {
+ /* There is no previous match to compare with, wait for
+ * the next step to decide.
+ */
+ s.match_available = 1;
+ s.strstart++;
+ s.lookahead--;
+ }
+ }
+ //Assert (flush != Z_NO_FLUSH, "no flush?");
+ if (s.match_available) {
+ //Tracevv((stderr,"%c", s->window[s->strstart-1]));
+ /*** _tr_tally_lit(s, s.window[s.strstart-1], bflush); ***/
+ bflush = trees._tr_tally(s, 0, s.window[s.strstart - 1]);
+
+ s.match_available = 0;
+ }
+ s.insert = s.strstart < MIN_MATCH - 1 ? s.strstart : MIN_MATCH - 1;
+ if (flush === Z_FINISH) {
+ /*** FLUSH_BLOCK(s, 1); ***/
+ flush_block_only(s, true);
+ if (s.strm.avail_out === 0) {
+ return BS_FINISH_STARTED;
+ }
+ /***/
+ return BS_FINISH_DONE;
+ }
+ if (s.last_lit) {
+ /*** FLUSH_BLOCK(s, 0); ***/
+ flush_block_only(s, false);
+ if (s.strm.avail_out === 0) {
+ return BS_NEED_MORE;
+ }
+ /***/
+ }
+
+ return BS_BLOCK_DONE;
+}
+
+
+/* ===========================================================================
+ * For Z_RLE, simply look for runs of bytes, generate matches only of distance
+ * one. Do not maintain a hash table. (It will be regenerated if this run of
+ * deflate switches away from Z_RLE.)
+ */
+function deflate_rle(s, flush) {
+ var bflush; /* set if current block must be flushed */
+ var prev; /* byte at distance one to match */
+ var scan, strend; /* scan goes up to strend for length of run */
+
+ var _win = s.window;
+
+ for (;;) {
+ /* Make sure that we always have enough lookahead, except
+ * at the end of the input file. We need MAX_MATCH bytes
+ * for the longest run, plus one for the unrolled loop.
+ */
+ if (s.lookahead <= MAX_MATCH) {
+ fill_window(s);
+ if (s.lookahead <= MAX_MATCH && flush === Z_NO_FLUSH) {
+ return BS_NEED_MORE;
+ }
+ if (s.lookahead === 0) { break; } /* flush the current block */
+ }
+
+ /* See how many times the previous byte repeats */
+ s.match_length = 0;
+ if (s.lookahead >= MIN_MATCH && s.strstart > 0) {
+ scan = s.strstart - 1;
+ prev = _win[scan];
+ if (prev === _win[++scan] && prev === _win[++scan] && prev === _win[++scan]) {
+ strend = s.strstart + MAX_MATCH;
+ do {
+ /*jshint noempty:false*/
+ } while (prev === _win[++scan] && prev === _win[++scan] &&
+ prev === _win[++scan] && prev === _win[++scan] &&
+ prev === _win[++scan] && prev === _win[++scan] &&
+ prev === _win[++scan] && prev === _win[++scan] &&
+ scan < strend);
+ s.match_length = MAX_MATCH - (strend - scan);
+ if (s.match_length > s.lookahead) {
+ s.match_length = s.lookahead;
+ }
+ }
+ //Assert(scan <= s->window+(uInt)(s->window_size-1), "wild scan");
+ }
+
+ /* Emit match if have run of MIN_MATCH or longer, else emit literal */
+ if (s.match_length >= MIN_MATCH) {
+ //check_match(s, s.strstart, s.strstart - 1, s.match_length);
+
+ /*** _tr_tally_dist(s, 1, s.match_length - MIN_MATCH, bflush); ***/
+ bflush = trees._tr_tally(s, 1, s.match_length - MIN_MATCH);
+
+ s.lookahead -= s.match_length;
+ s.strstart += s.match_length;
+ s.match_length = 0;
+ } else {
+ /* No match, output a literal byte */
+ //Tracevv((stderr,"%c", s->window[s->strstart]));
+ /*** _tr_tally_lit(s, s.window[s.strstart], bflush); ***/
+ bflush = trees._tr_tally(s, 0, s.window[s.strstart]);
+
+ s.lookahead--;
+ s.strstart++;
+ }
+ if (bflush) {
+ /*** FLUSH_BLOCK(s, 0); ***/
+ flush_block_only(s, false);
+ if (s.strm.avail_out === 0) {
+ return BS_NEED_MORE;
+ }
+ /***/
+ }
+ }
+ s.insert = 0;
+ if (flush === Z_FINISH) {
+ /*** FLUSH_BLOCK(s, 1); ***/
+ flush_block_only(s, true);
+ if (s.strm.avail_out === 0) {
+ return BS_FINISH_STARTED;
+ }
+ /***/
+ return BS_FINISH_DONE;
+ }
+ if (s.last_lit) {
+ /*** FLUSH_BLOCK(s, 0); ***/
+ flush_block_only(s, false);
+ if (s.strm.avail_out === 0) {
+ return BS_NEED_MORE;
+ }
+ /***/
+ }
+ return BS_BLOCK_DONE;
+}
+
+/* ===========================================================================
+ * For Z_HUFFMAN_ONLY, do not look for matches. Do not maintain a hash table.
+ * (It will be regenerated if this run of deflate switches away from Huffman.)
+ */
+function deflate_huff(s, flush) {
+ var bflush; /* set if current block must be flushed */
+
+ for (;;) {
+ /* Make sure that we have a literal to write. */
+ if (s.lookahead === 0) {
+ fill_window(s);
+ if (s.lookahead === 0) {
+ if (flush === Z_NO_FLUSH) {
+ return BS_NEED_MORE;
+ }
+ break; /* flush the current block */
+ }
+ }
+
+ /* Output a literal byte */
+ s.match_length = 0;
+ //Tracevv((stderr,"%c", s->window[s->strstart]));
+ /*** _tr_tally_lit(s, s.window[s.strstart], bflush); ***/
+ bflush = trees._tr_tally(s, 0, s.window[s.strstart]);
+ s.lookahead--;
+ s.strstart++;
+ if (bflush) {
+ /*** FLUSH_BLOCK(s, 0); ***/
+ flush_block_only(s, false);
+ if (s.strm.avail_out === 0) {
+ return BS_NEED_MORE;
+ }
+ /***/
+ }
+ }
+ s.insert = 0;
+ if (flush === Z_FINISH) {
+ /*** FLUSH_BLOCK(s, 1); ***/
+ flush_block_only(s, true);
+ if (s.strm.avail_out === 0) {
+ return BS_FINISH_STARTED;
+ }
+ /***/
+ return BS_FINISH_DONE;
+ }
+ if (s.last_lit) {
+ /*** FLUSH_BLOCK(s, 0); ***/
+ flush_block_only(s, false);
+ if (s.strm.avail_out === 0) {
+ return BS_NEED_MORE;
+ }
+ /***/
+ }
+ return BS_BLOCK_DONE;
+}
+
+/* Values for max_lazy_match, good_match and max_chain_length, depending on
+ * the desired pack level (0..9). The values given below have been tuned to
+ * exclude worst case performance for pathological files. Better values may be
+ * found for specific files.
+ */
+function Config(good_length, max_lazy, nice_length, max_chain, func) {
+ this.good_length = good_length;
+ this.max_lazy = max_lazy;
+ this.nice_length = nice_length;
+ this.max_chain = max_chain;
+ this.func = func;
+}
+
+var configuration_table;
+
+configuration_table = [
+ /* good lazy nice chain */
+ new Config(0, 0, 0, 0, deflate_stored), /* 0 store only */
+ new Config(4, 4, 8, 4, deflate_fast), /* 1 max speed, no lazy matches */
+ new Config(4, 5, 16, 8, deflate_fast), /* 2 */
+ new Config(4, 6, 32, 32, deflate_fast), /* 3 */
+
+ new Config(4, 4, 16, 16, deflate_slow), /* 4 lazy matches */
+ new Config(8, 16, 32, 32, deflate_slow), /* 5 */
+ new Config(8, 16, 128, 128, deflate_slow), /* 6 */
+ new Config(8, 32, 128, 256, deflate_slow), /* 7 */
+ new Config(32, 128, 258, 1024, deflate_slow), /* 8 */
+ new Config(32, 258, 258, 4096, deflate_slow) /* 9 max compression */
+];
+
+
+/* ===========================================================================
+ * Initialize the "longest match" routines for a new zlib stream
+ */
+function lm_init(s) {
+ s.window_size = 2 * s.w_size;
+
+ /*** CLEAR_HASH(s); ***/
+ zero(s.head); // Fill with NIL (= 0);
+
+ /* Set the default configuration parameters:
+ */
+ s.max_lazy_match = configuration_table[s.level].max_lazy;
+ s.good_match = configuration_table[s.level].good_length;
+ s.nice_match = configuration_table[s.level].nice_length;
+ s.max_chain_length = configuration_table[s.level].max_chain;
+
+ s.strstart = 0;
+ s.block_start = 0;
+ s.lookahead = 0;
+ s.insert = 0;
+ s.match_length = s.prev_length = MIN_MATCH - 1;
+ s.match_available = 0;
+ s.ins_h = 0;
+}
+
+
+function DeflateState() {
+ this.strm = null; /* pointer back to this zlib stream */
+ this.status = 0; /* as the name implies */
+ this.pending_buf = null; /* output still pending */
+ this.pending_buf_size = 0; /* size of pending_buf */
+ this.pending_out = 0; /* next pending byte to output to the stream */
+ this.pending = 0; /* nb of bytes in the pending buffer */
+ this.wrap = 0; /* bit 0 true for zlib, bit 1 true for gzip */
+ this.gzhead = null; /* gzip header information to write */
+ this.gzindex = 0; /* where in extra, name, or comment */
+ this.method = Z_DEFLATED; /* can only be DEFLATED */
+ this.last_flush = -1; /* value of flush param for previous deflate call */
+
+ this.w_size = 0; /* LZ77 window size (32K by default) */
+ this.w_bits = 0; /* log2(w_size) (8..16) */
+ this.w_mask = 0; /* w_size - 1 */
+
+ this.window = null;
+ /* Sliding window. Input bytes are read into the second half of the window,
+ * and move to the first half later to keep a dictionary of at least wSize
+ * bytes. With this organization, matches are limited to a distance of
+ * wSize-MAX_MATCH bytes, but this ensures that IO is always
+ * performed with a length multiple of the block size.
+ */
+
+ this.window_size = 0;
+ /* Actual size of window: 2*wSize, except when the user input buffer
+ * is directly used as sliding window.
+ */
+
+ this.prev = null;
+ /* Link to older string with same hash index. To limit the size of this
+ * array to 64K, this link is maintained only for the last 32K strings.
+ * An index in this array is thus a window index modulo 32K.
+ */
+
+ this.head = null; /* Heads of the hash chains or NIL. */
+
+ this.ins_h = 0; /* hash index of string to be inserted */
+ this.hash_size = 0; /* number of elements in hash table */
+ this.hash_bits = 0; /* log2(hash_size) */
+ this.hash_mask = 0; /* hash_size-1 */
+
+ this.hash_shift = 0;
+ /* Number of bits by which ins_h must be shifted at each input
+ * step. It must be such that after MIN_MATCH steps, the oldest
+ * byte no longer takes part in the hash key, that is:
+ * hash_shift * MIN_MATCH >= hash_bits
+ */
+
+ this.block_start = 0;
+ /* Window position at the beginning of the current output block. Gets
+ * negative when the window is moved backwards.
+ */
+
+ this.match_length = 0; /* length of best match */
+ this.prev_match = 0; /* previous match */
+ this.match_available = 0; /* set if previous match exists */
+ this.strstart = 0; /* start of string to insert */
+ this.match_start = 0; /* start of matching string */
+ this.lookahead = 0; /* number of valid bytes ahead in window */
+
+ this.prev_length = 0;
+ /* Length of the best match at previous step. Matches not greater than this
+ * are discarded. This is used in the lazy match evaluation.
+ */
+
+ this.max_chain_length = 0;
+ /* To speed up deflation, hash chains are never searched beyond this
+ * length. A higher limit improves compression ratio but degrades the
+ * speed.
+ */
+
+ this.max_lazy_match = 0;
+ /* Attempt to find a better match only when the current match is strictly
+ * smaller than this value. This mechanism is used only for compression
+ * levels >= 4.
+ */
+ // That's alias to max_lazy_match, don't use directly
+ //this.max_insert_length = 0;
+ /* Insert new strings in the hash table only if the match length is not
+ * greater than this length. This saves time but degrades compression.
+ * max_insert_length is used only for compression levels <= 3.
+ */
+
+ this.level = 0; /* compression level (1..9) */
+ this.strategy = 0; /* favor or force Huffman coding*/
+
+ this.good_match = 0;
+ /* Use a faster search when the previous match is longer than this */
+
+ this.nice_match = 0; /* Stop searching when current match exceeds this */
+
+ /* used by trees.c: */
+
+ /* Didn't use ct_data typedef below to suppress compiler warning */
+
+ // struct ct_data_s dyn_ltree[HEAP_SIZE]; /* literal and length tree */
+ // struct ct_data_s dyn_dtree[2*D_CODES+1]; /* distance tree */
+ // struct ct_data_s bl_tree[2*BL_CODES+1]; /* Huffman tree for bit lengths */
+
+ // Use flat array of DOUBLE size, with interleaved fata,
+ // because JS does not support effective
+ this.dyn_ltree = new utils.Buf16(HEAP_SIZE * 2);
+ this.dyn_dtree = new utils.Buf16((2 * D_CODES + 1) * 2);
+ this.bl_tree = new utils.Buf16((2 * BL_CODES + 1) * 2);
+ zero(this.dyn_ltree);
+ zero(this.dyn_dtree);
+ zero(this.bl_tree);
+
+ this.l_desc = null; /* desc. for literal tree */
+ this.d_desc = null; /* desc. for distance tree */
+ this.bl_desc = null; /* desc. for bit length tree */
+
+ //ush bl_count[MAX_BITS+1];
+ this.bl_count = new utils.Buf16(MAX_BITS + 1);
+ /* number of codes at each bit length for an optimal tree */
+
+ //int heap[2*L_CODES+1]; /* heap used to build the Huffman trees */
+ this.heap = new utils.Buf16(2 * L_CODES + 1); /* heap used to build the Huffman trees */
+ zero(this.heap);
+
+ this.heap_len = 0; /* number of elements in the heap */
+ this.heap_max = 0; /* element of largest frequency */
+ /* The sons of heap[n] are heap[2*n] and heap[2*n+1]. heap[0] is not used.
+ * The same heap array is used to build all trees.
+ */
+
+ this.depth = new utils.Buf16(2 * L_CODES + 1); //uch depth[2*L_CODES+1];
+ zero(this.depth);
+ /* Depth of each subtree used as tie breaker for trees of equal frequency
+ */
+
+ this.l_buf = 0; /* buffer index for literals or lengths */
+
+ this.lit_bufsize = 0;
+ /* Size of match buffer for literals/lengths. There are 4 reasons for
+ * limiting lit_bufsize to 64K:
+ * - frequencies can be kept in 16 bit counters
+ * - if compression is not successful for the first block, all input
+ * data is still in the window so we can still emit a stored block even
+ * when input comes from standard input. (This can also be done for
+ * all blocks if lit_bufsize is not greater than 32K.)
+ * - if compression is not successful for a file smaller than 64K, we can
+ * even emit a stored file instead of a stored block (saving 5 bytes).
+ * This is applicable only for zip (not gzip or zlib).
+ * - creating new Huffman trees less frequently may not provide fast
+ * adaptation to changes in the input data statistics. (Take for
+ * example a binary file with poorly compressible code followed by
+ * a highly compressible string table.) Smaller buffer sizes give
+ * fast adaptation but have of course the overhead of transmitting
+ * trees more frequently.
+ * - I can't count above 4
+ */
+
+ this.last_lit = 0; /* running index in l_buf */
+
+ this.d_buf = 0;
+ /* Buffer index for distances. To simplify the code, d_buf and l_buf have
+ * the same number of elements. To use different lengths, an extra flag
+ * array would be necessary.
+ */
+
+ this.opt_len = 0; /* bit length of current block with optimal trees */
+ this.static_len = 0; /* bit length of current block with static trees */
+ this.matches = 0; /* number of string matches in current block */
+ this.insert = 0; /* bytes at end of window left to insert */
+
+
+ this.bi_buf = 0;
+ /* Output buffer. bits are inserted starting at the bottom (least
+ * significant bits).
+ */
+ this.bi_valid = 0;
+ /* Number of valid bits in bi_buf. All bits above the last valid bit
+ * are always zero.
+ */
+
+ // Used for window memory init. We safely ignore it for JS. That makes
+ // sense only for pointers and memory check tools.
+ //this.high_water = 0;
+ /* High water mark offset in window for initialized bytes -- bytes above
+ * this are set to zero in order to avoid memory check warnings when
+ * longest match routines access bytes past the input. This is then
+ * updated to the new high water mark.
+ */
+}
+
+
+function deflateResetKeep(strm) {
+ var s;
+
+ if (!strm || !strm.state) {
+ return err(strm, Z_STREAM_ERROR);
+ }
+
+ strm.total_in = strm.total_out = 0;
+ strm.data_type = Z_UNKNOWN;
+
+ s = strm.state;
+ s.pending = 0;
+ s.pending_out = 0;
+
+ if (s.wrap < 0) {
+ s.wrap = -s.wrap;
+ /* was made negative by deflate(..., Z_FINISH); */
+ }
+ s.status = (s.wrap ? INIT_STATE : BUSY_STATE);
+ strm.adler = (s.wrap === 2) ?
+ 0 // crc32(0, Z_NULL, 0)
+ :
+ 1; // adler32(0, Z_NULL, 0)
+ s.last_flush = Z_NO_FLUSH;
+ trees._tr_init(s);
+ return Z_OK;
+}
+
+
+function deflateReset(strm) {
+ var ret = deflateResetKeep(strm);
+ if (ret === Z_OK) {
+ lm_init(strm.state);
+ }
+ return ret;
+}
+
+
+function deflateSetHeader(strm, head) {
+ if (!strm || !strm.state) { return Z_STREAM_ERROR; }
+ if (strm.state.wrap !== 2) { return Z_STREAM_ERROR; }
+ strm.state.gzhead = head;
+ return Z_OK;
+}
+
+
+function deflateInit2(strm, level, method, windowBits, memLevel, strategy) {
+ if (!strm) { // === Z_NULL
+ return Z_STREAM_ERROR;
+ }
+ var wrap = 1;
+
+ if (level === Z_DEFAULT_COMPRESSION) {
+ level = 6;
+ }
+
+ if (windowBits < 0) { /* suppress zlib wrapper */
+ wrap = 0;
+ windowBits = -windowBits;
+ }
+
+ else if (windowBits > 15) {
+ wrap = 2; /* write gzip wrapper instead */
+ windowBits -= 16;
+ }
+
+
+ if (memLevel < 1 || memLevel > MAX_MEM_LEVEL || method !== Z_DEFLATED ||
+ windowBits < 8 || windowBits > 15 || level < 0 || level > 9 ||
+ strategy < 0 || strategy > Z_FIXED) {
+ return err(strm, Z_STREAM_ERROR);
+ }
+
+
+ if (windowBits === 8) {
+ windowBits = 9;
+ }
+ /* until 256-byte window bug fixed */
+
+ var s = new DeflateState();
+
+ strm.state = s;
+ s.strm = strm;
+
+ s.wrap = wrap;
+ s.gzhead = null;
+ s.w_bits = windowBits;
+ s.w_size = 1 << s.w_bits;
+ s.w_mask = s.w_size - 1;
+
+ s.hash_bits = memLevel + 7;
+ s.hash_size = 1 << s.hash_bits;
+ s.hash_mask = s.hash_size - 1;
+ s.hash_shift = ~~((s.hash_bits + MIN_MATCH - 1) / MIN_MATCH);
+
+ s.window = new utils.Buf8(s.w_size * 2);
+ s.head = new utils.Buf16(s.hash_size);
+ s.prev = new utils.Buf16(s.w_size);
+
+ // Don't need mem init magic for JS.
+ //s.high_water = 0; /* nothing written to s->window yet */
+
+ s.lit_bufsize = 1 << (memLevel + 6); /* 16K elements by default */
+
+ s.pending_buf_size = s.lit_bufsize * 4;
+
+ //overlay = (ushf *) ZALLOC(strm, s->lit_bufsize, sizeof(ush)+2);
+ //s->pending_buf = (uchf *) overlay;
+ s.pending_buf = new utils.Buf8(s.pending_buf_size);
+
+ // It is offset from `s.pending_buf` (size is `s.lit_bufsize * 2`)
+ //s->d_buf = overlay + s->lit_bufsize/sizeof(ush);
+ s.d_buf = 1 * s.lit_bufsize;
+
+ //s->l_buf = s->pending_buf + (1+sizeof(ush))*s->lit_bufsize;
+ s.l_buf = (1 + 2) * s.lit_bufsize;
+
+ s.level = level;
+ s.strategy = strategy;
+ s.method = method;
+
+ return deflateReset(strm);
+}
+
+function deflateInit(strm, level) {
+ return deflateInit2(strm, level, Z_DEFLATED, MAX_WBITS, DEF_MEM_LEVEL, Z_DEFAULT_STRATEGY);
+}
+
+
+function deflate(strm, flush) {
+ var old_flush, s;
+ var beg, val; // for gzip header write only
+
+ if (!strm || !strm.state ||
+ flush > Z_BLOCK || flush < 0) {
+ return strm ? err(strm, Z_STREAM_ERROR) : Z_STREAM_ERROR;
+ }
+
+ s = strm.state;
+
+ if (!strm.output ||
+ (!strm.input && strm.avail_in !== 0) ||
+ (s.status === FINISH_STATE && flush !== Z_FINISH)) {
+ return err(strm, (strm.avail_out === 0) ? Z_BUF_ERROR : Z_STREAM_ERROR);
+ }
+
+ s.strm = strm; /* just in case */
+ old_flush = s.last_flush;
+ s.last_flush = flush;
+
+ /* Write the header */
+ if (s.status === INIT_STATE) {
+
+ if (s.wrap === 2) { // GZIP header
+ strm.adler = 0; //crc32(0L, Z_NULL, 0);
+ put_byte(s, 31);
+ put_byte(s, 139);
+ put_byte(s, 8);
+ if (!s.gzhead) { // s->gzhead == Z_NULL
+ put_byte(s, 0);
+ put_byte(s, 0);
+ put_byte(s, 0);
+ put_byte(s, 0);
+ put_byte(s, 0);
+ put_byte(s, s.level === 9 ? 2 :
+ (s.strategy >= Z_HUFFMAN_ONLY || s.level < 2 ?
+ 4 : 0));
+ put_byte(s, OS_CODE);
+ s.status = BUSY_STATE;
+ }
+ else {
+ put_byte(s, (s.gzhead.text ? 1 : 0) +
+ (s.gzhead.hcrc ? 2 : 0) +
+ (!s.gzhead.extra ? 0 : 4) +
+ (!s.gzhead.name ? 0 : 8) +
+ (!s.gzhead.comment ? 0 : 16)
+ );
+ put_byte(s, s.gzhead.time & 0xff);
+ put_byte(s, (s.gzhead.time >> 8) & 0xff);
+ put_byte(s, (s.gzhead.time >> 16) & 0xff);
+ put_byte(s, (s.gzhead.time >> 24) & 0xff);
+ put_byte(s, s.level === 9 ? 2 :
+ (s.strategy >= Z_HUFFMAN_ONLY || s.level < 2 ?
+ 4 : 0));
+ put_byte(s, s.gzhead.os & 0xff);
+ if (s.gzhead.extra && s.gzhead.extra.length) {
+ put_byte(s, s.gzhead.extra.length & 0xff);
+ put_byte(s, (s.gzhead.extra.length >> 8) & 0xff);
+ }
+ if (s.gzhead.hcrc) {
+ strm.adler = crc32(strm.adler, s.pending_buf, s.pending, 0);
+ }
+ s.gzindex = 0;
+ s.status = EXTRA_STATE;
+ }
+ }
+ else // DEFLATE header
+ {
+ var header = (Z_DEFLATED + ((s.w_bits - 8) << 4)) << 8;
+ var level_flags = -1;
+
+ if (s.strategy >= Z_HUFFMAN_ONLY || s.level < 2) {
+ level_flags = 0;
+ } else if (s.level < 6) {
+ level_flags = 1;
+ } else if (s.level === 6) {
+ level_flags = 2;
+ } else {
+ level_flags = 3;
+ }
+ header |= (level_flags << 6);
+ if (s.strstart !== 0) { header |= PRESET_DICT; }
+ header += 31 - (header % 31);
+
+ s.status = BUSY_STATE;
+ putShortMSB(s, header);
+
+ /* Save the adler32 of the preset dictionary: */
+ if (s.strstart !== 0) {
+ putShortMSB(s, strm.adler >>> 16);
+ putShortMSB(s, strm.adler & 0xffff);
+ }
+ strm.adler = 1; // adler32(0L, Z_NULL, 0);
+ }
+ }
+
+//#ifdef GZIP
+ if (s.status === EXTRA_STATE) {
+ if (s.gzhead.extra/* != Z_NULL*/) {
+ beg = s.pending; /* start of bytes to update crc */
+
+ while (s.gzindex < (s.gzhead.extra.length & 0xffff)) {
+ if (s.pending === s.pending_buf_size) {
+ if (s.gzhead.hcrc && s.pending > beg) {
+ strm.adler = crc32(strm.adler, s.pending_buf, s.pending - beg, beg);
+ }
+ flush_pending(strm);
+ beg = s.pending;
+ if (s.pending === s.pending_buf_size) {
+ break;
+ }
+ }
+ put_byte(s, s.gzhead.extra[s.gzindex] & 0xff);
+ s.gzindex++;
+ }
+ if (s.gzhead.hcrc && s.pending > beg) {
+ strm.adler = crc32(strm.adler, s.pending_buf, s.pending - beg, beg);
+ }
+ if (s.gzindex === s.gzhead.extra.length) {
+ s.gzindex = 0;
+ s.status = NAME_STATE;
+ }
+ }
+ else {
+ s.status = NAME_STATE;
+ }
+ }
+ if (s.status === NAME_STATE) {
+ if (s.gzhead.name/* != Z_NULL*/) {
+ beg = s.pending; /* start of bytes to update crc */
+ //int val;
+
+ do {
+ if (s.pending === s.pending_buf_size) {
+ if (s.gzhead.hcrc && s.pending > beg) {
+ strm.adler = crc32(strm.adler, s.pending_buf, s.pending - beg, beg);
+ }
+ flush_pending(strm);
+ beg = s.pending;
+ if (s.pending === s.pending_buf_size) {
+ val = 1;
+ break;
+ }
+ }
+ // JS specific: little magic to add zero terminator to end of string
+ if (s.gzindex < s.gzhead.name.length) {
+ val = s.gzhead.name.charCodeAt(s.gzindex++) & 0xff;
+ } else {
+ val = 0;
+ }
+ put_byte(s, val);
+ } while (val !== 0);
+
+ if (s.gzhead.hcrc && s.pending > beg) {
+ strm.adler = crc32(strm.adler, s.pending_buf, s.pending - beg, beg);
+ }
+ if (val === 0) {
+ s.gzindex = 0;
+ s.status = COMMENT_STATE;
+ }
+ }
+ else {
+ s.status = COMMENT_STATE;
+ }
+ }
+ if (s.status === COMMENT_STATE) {
+ if (s.gzhead.comment/* != Z_NULL*/) {
+ beg = s.pending; /* start of bytes to update crc */
+ //int val;
+
+ do {
+ if (s.pending === s.pending_buf_size) {
+ if (s.gzhead.hcrc && s.pending > beg) {
+ strm.adler = crc32(strm.adler, s.pending_buf, s.pending - beg, beg);
+ }
+ flush_pending(strm);
+ beg = s.pending;
+ if (s.pending === s.pending_buf_size) {
+ val = 1;
+ break;
+ }
+ }
+ // JS specific: little magic to add zero terminator to end of string
+ if (s.gzindex < s.gzhead.comment.length) {
+ val = s.gzhead.comment.charCodeAt(s.gzindex++) & 0xff;
+ } else {
+ val = 0;
+ }
+ put_byte(s, val);
+ } while (val !== 0);
+
+ if (s.gzhead.hcrc && s.pending > beg) {
+ strm.adler = crc32(strm.adler, s.pending_buf, s.pending - beg, beg);
+ }
+ if (val === 0) {
+ s.status = HCRC_STATE;
+ }
+ }
+ else {
+ s.status = HCRC_STATE;
+ }
+ }
+ if (s.status === HCRC_STATE) {
+ if (s.gzhead.hcrc) {
+ if (s.pending + 2 > s.pending_buf_size) {
+ flush_pending(strm);
+ }
+ if (s.pending + 2 <= s.pending_buf_size) {
+ put_byte(s, strm.adler & 0xff);
+ put_byte(s, (strm.adler >> 8) & 0xff);
+ strm.adler = 0; //crc32(0L, Z_NULL, 0);
+ s.status = BUSY_STATE;
+ }
+ }
+ else {
+ s.status = BUSY_STATE;
+ }
+ }
+//#endif
+
+ /* Flush as much pending output as possible */
+ if (s.pending !== 0) {
+ flush_pending(strm);
+ if (strm.avail_out === 0) {
+ /* Since avail_out is 0, deflate will be called again with
+ * more output space, but possibly with both pending and
+ * avail_in equal to zero. There won't be anything to do,
+ * but this is not an error situation so make sure we
+ * return OK instead of BUF_ERROR at next call of deflate:
+ */
+ s.last_flush = -1;
+ return Z_OK;
+ }
+
+ /* Make sure there is something to do and avoid duplicate consecutive
+ * flushes. For repeated and useless calls with Z_FINISH, we keep
+ * returning Z_STREAM_END instead of Z_BUF_ERROR.
+ */
+ } else if (strm.avail_in === 0 && rank(flush) <= rank(old_flush) &&
+ flush !== Z_FINISH) {
+ return err(strm, Z_BUF_ERROR);
+ }
+
+ /* User must not provide more input after the first FINISH: */
+ if (s.status === FINISH_STATE && strm.avail_in !== 0) {
+ return err(strm, Z_BUF_ERROR);
+ }
+
+ /* Start a new block or continue the current one.
+ */
+ if (strm.avail_in !== 0 || s.lookahead !== 0 ||
+ (flush !== Z_NO_FLUSH && s.status !== FINISH_STATE)) {
+ var bstate = (s.strategy === Z_HUFFMAN_ONLY) ? deflate_huff(s, flush) :
+ (s.strategy === Z_RLE ? deflate_rle(s, flush) :
+ configuration_table[s.level].func(s, flush));
+
+ if (bstate === BS_FINISH_STARTED || bstate === BS_FINISH_DONE) {
+ s.status = FINISH_STATE;
+ }
+ if (bstate === BS_NEED_MORE || bstate === BS_FINISH_STARTED) {
+ if (strm.avail_out === 0) {
+ s.last_flush = -1;
+ /* avoid BUF_ERROR next call, see above */
+ }
+ return Z_OK;
+ /* If flush != Z_NO_FLUSH && avail_out == 0, the next call
+ * of deflate should use the same flush parameter to make sure
+ * that the flush is complete. So we don't have to output an
+ * empty block here, this will be done at next call. This also
+ * ensures that for a very small output buffer, we emit at most
+ * one empty block.
+ */
+ }
+ if (bstate === BS_BLOCK_DONE) {
+ if (flush === Z_PARTIAL_FLUSH) {
+ trees._tr_align(s);
+ }
+ else if (flush !== Z_BLOCK) { /* FULL_FLUSH or SYNC_FLUSH */
+
+ trees._tr_stored_block(s, 0, 0, false);
+ /* For a full flush, this empty block will be recognized
+ * as a special marker by inflate_sync().
+ */
+ if (flush === Z_FULL_FLUSH) {
+ /*** CLEAR_HASH(s); ***/ /* forget history */
+ zero(s.head); // Fill with NIL (= 0);
+
+ if (s.lookahead === 0) {
+ s.strstart = 0;
+ s.block_start = 0;
+ s.insert = 0;
+ }
+ }
+ }
+ flush_pending(strm);
+ if (strm.avail_out === 0) {
+ s.last_flush = -1; /* avoid BUF_ERROR at next call, see above */
+ return Z_OK;
+ }
+ }
+ }
+ //Assert(strm->avail_out > 0, "bug2");
+ //if (strm.avail_out <= 0) { throw new Error("bug2");}
+
+ if (flush !== Z_FINISH) { return Z_OK; }
+ if (s.wrap <= 0) { return Z_STREAM_END; }
+
+ /* Write the trailer */
+ if (s.wrap === 2) {
+ put_byte(s, strm.adler & 0xff);
+ put_byte(s, (strm.adler >> 8) & 0xff);
+ put_byte(s, (strm.adler >> 16) & 0xff);
+ put_byte(s, (strm.adler >> 24) & 0xff);
+ put_byte(s, strm.total_in & 0xff);
+ put_byte(s, (strm.total_in >> 8) & 0xff);
+ put_byte(s, (strm.total_in >> 16) & 0xff);
+ put_byte(s, (strm.total_in >> 24) & 0xff);
+ }
+ else
+ {
+ putShortMSB(s, strm.adler >>> 16);
+ putShortMSB(s, strm.adler & 0xffff);
+ }
+
+ flush_pending(strm);
+ /* If avail_out is zero, the application will call deflate again
+ * to flush the rest.
+ */
+ if (s.wrap > 0) { s.wrap = -s.wrap; }
+ /* write the trailer only once! */
+ return s.pending !== 0 ? Z_OK : Z_STREAM_END;
+}
+
+function deflateEnd(strm) {
+ var status;
+
+ if (!strm/*== Z_NULL*/ || !strm.state/*== Z_NULL*/) {
+ return Z_STREAM_ERROR;
+ }
+
+ status = strm.state.status;
+ if (status !== INIT_STATE &&
+ status !== EXTRA_STATE &&
+ status !== NAME_STATE &&
+ status !== COMMENT_STATE &&
+ status !== HCRC_STATE &&
+ status !== BUSY_STATE &&
+ status !== FINISH_STATE
+ ) {
+ return err(strm, Z_STREAM_ERROR);
+ }
+
+ strm.state = null;
+
+ return status === BUSY_STATE ? err(strm, Z_DATA_ERROR) : Z_OK;
+}
+
+
+/* =========================================================================
+ * Initializes the compression dictionary from the given byte
+ * sequence without producing any compressed output.
+ */
+function deflateSetDictionary(strm, dictionary) {
+ var dictLength = dictionary.length;
+
+ var s;
+ var str, n;
+ var wrap;
+ var avail;
+ var next;
+ var input;
+ var tmpDict;
+
+ if (!strm/*== Z_NULL*/ || !strm.state/*== Z_NULL*/) {
+ return Z_STREAM_ERROR;
+ }
+
+ s = strm.state;
+ wrap = s.wrap;
+
+ if (wrap === 2 || (wrap === 1 && s.status !== INIT_STATE) || s.lookahead) {
+ return Z_STREAM_ERROR;
+ }
+
+ /* when using zlib wrappers, compute Adler-32 for provided dictionary */
+ if (wrap === 1) {
+ /* adler32(strm->adler, dictionary, dictLength); */
+ strm.adler = adler32(strm.adler, dictionary, dictLength, 0);
+ }
+
+ s.wrap = 0; /* avoid computing Adler-32 in read_buf */
+
+ /* if dictionary would fill window, just replace the history */
+ if (dictLength >= s.w_size) {
+ if (wrap === 0) { /* already empty otherwise */
+ /*** CLEAR_HASH(s); ***/
+ zero(s.head); // Fill with NIL (= 0);
+ s.strstart = 0;
+ s.block_start = 0;
+ s.insert = 0;
+ }
+ /* use the tail */
+ // dictionary = dictionary.slice(dictLength - s.w_size);
+ tmpDict = new utils.Buf8(s.w_size);
+ utils.arraySet(tmpDict, dictionary, dictLength - s.w_size, s.w_size, 0);
+ dictionary = tmpDict;
+ dictLength = s.w_size;
+ }
+ /* insert dictionary into window and hash */
+ avail = strm.avail_in;
+ next = strm.next_in;
+ input = strm.input;
+ strm.avail_in = dictLength;
+ strm.next_in = 0;
+ strm.input = dictionary;
+ fill_window(s);
+ while (s.lookahead >= MIN_MATCH) {
+ str = s.strstart;
+ n = s.lookahead - (MIN_MATCH - 1);
+ do {
+ /* UPDATE_HASH(s, s->ins_h, s->window[str + MIN_MATCH-1]); */
+ s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[str + MIN_MATCH - 1]) & s.hash_mask;
+
+ s.prev[str & s.w_mask] = s.head[s.ins_h];
+
+ s.head[s.ins_h] = str;
+ str++;
+ } while (--n);
+ s.strstart = str;
+ s.lookahead = MIN_MATCH - 1;
+ fill_window(s);
+ }
+ s.strstart += s.lookahead;
+ s.block_start = s.strstart;
+ s.insert = s.lookahead;
+ s.lookahead = 0;
+ s.match_length = s.prev_length = MIN_MATCH - 1;
+ s.match_available = 0;
+ strm.next_in = next;
+ strm.input = input;
+ strm.avail_in = avail;
+ s.wrap = wrap;
+ return Z_OK;
+}
+
+
+exports.deflateInit = deflateInit;
+exports.deflateInit2 = deflateInit2;
+exports.deflateReset = deflateReset;
+exports.deflateResetKeep = deflateResetKeep;
+exports.deflateSetHeader = deflateSetHeader;
+exports.deflate = deflate;
+exports.deflateEnd = deflateEnd;
+exports.deflateSetDictionary = deflateSetDictionary;
+exports.deflateInfo = 'pako deflate (from Nodeca project)';
+
+/* Not implemented
+exports.deflateBound = deflateBound;
+exports.deflateCopy = deflateCopy;
+exports.deflateParams = deflateParams;
+exports.deflatePending = deflatePending;
+exports.deflatePrime = deflatePrime;
+exports.deflateTune = deflateTune;
+*/
diff --git a/node_modules/pako/lib/zlib/gzheader.js b/node_modules/pako/lib/zlib/gzheader.js
new file mode 100644
index 0000000000000000000000000000000000000000..9582cba603259edf791ebf4392aecb8eeedb3f4d
--- /dev/null
+++ b/node_modules/pako/lib/zlib/gzheader.js
@@ -0,0 +1,58 @@
+'use strict';
+
+// (C) 1995-2013 Jean-loup Gailly and Mark Adler
+// (C) 2014-2017 Vitaly Puzrin and Andrey Tupitsin
+//
+// This software is provided 'as-is', without any express or implied
+// warranty. In no event will the authors be held liable for any damages
+// arising from the use of this software.
+//
+// Permission is granted to anyone to use this software for any purpose,
+// including commercial applications, and to alter it and redistribute it
+// freely, subject to the following restrictions:
+//
+// 1. The origin of this software must not be misrepresented; you must not
+// claim that you wrote the original software. If you use this software
+// in a product, an acknowledgment in the product documentation would be
+// appreciated but is not required.
+// 2. Altered source versions must be plainly marked as such, and must not be
+// misrepresented as being the original software.
+// 3. This notice may not be removed or altered from any source distribution.
+
+function GZheader() {
+ /* true if compressed data believed to be text */
+ this.text = 0;
+ /* modification time */
+ this.time = 0;
+ /* extra flags (not used when writing a gzip file) */
+ this.xflags = 0;
+ /* operating system */
+ this.os = 0;
+ /* pointer to extra field or Z_NULL if none */
+ this.extra = null;
+ /* extra field length (valid if extra != Z_NULL) */
+ this.extra_len = 0; // Actually, we don't need it in JS,
+ // but leave for few code modifications
+
+ //
+ // Setup limits is not necessary because in js we should not preallocate memory
+ // for inflate use constant limit in 65536 bytes
+ //
+
+ /* space at extra (only when reading header) */
+ // this.extra_max = 0;
+ /* pointer to zero-terminated file name or Z_NULL */
+ this.name = '';
+ /* space at name (only when reading header) */
+ // this.name_max = 0;
+ /* pointer to zero-terminated comment or Z_NULL */
+ this.comment = '';
+ /* space at comment (only when reading header) */
+ // this.comm_max = 0;
+ /* true if there was or will be a header crc */
+ this.hcrc = 0;
+ /* true when done reading gzip header (not used when writing a gzip file) */
+ this.done = false;
+}
+
+module.exports = GZheader;
diff --git a/node_modules/pako/lib/zlib/inffast.js b/node_modules/pako/lib/zlib/inffast.js
new file mode 100644
index 0000000000000000000000000000000000000000..4cc958feedcfab29a5a3a5d902d19a8f736967a9
--- /dev/null
+++ b/node_modules/pako/lib/zlib/inffast.js
@@ -0,0 +1,345 @@
+'use strict';
+
+// (C) 1995-2013 Jean-loup Gailly and Mark Adler
+// (C) 2014-2017 Vitaly Puzrin and Andrey Tupitsin
+//
+// This software is provided 'as-is', without any express or implied
+// warranty. In no event will the authors be held liable for any damages
+// arising from the use of this software.
+//
+// Permission is granted to anyone to use this software for any purpose,
+// including commercial applications, and to alter it and redistribute it
+// freely, subject to the following restrictions:
+//
+// 1. The origin of this software must not be misrepresented; you must not
+// claim that you wrote the original software. If you use this software
+// in a product, an acknowledgment in the product documentation would be
+// appreciated but is not required.
+// 2. Altered source versions must be plainly marked as such, and must not be
+// misrepresented as being the original software.
+// 3. This notice may not be removed or altered from any source distribution.
+
+// See state defs from inflate.js
+var BAD = 30; /* got a data error -- remain here until reset */
+var TYPE = 12; /* i: waiting for type bits, including last-flag bit */
+
+/*
+ Decode literal, length, and distance codes and write out the resulting
+ literal and match bytes until either not enough input or output is
+ available, an end-of-block is encountered, or a data error is encountered.
+ When large enough input and output buffers are supplied to inflate(), for
+ example, a 16K input buffer and a 64K output buffer, more than 95% of the
+ inflate execution time is spent in this routine.
+
+ Entry assumptions:
+
+ state.mode === LEN
+ strm.avail_in >= 6
+ strm.avail_out >= 258
+ start >= strm.avail_out
+ state.bits < 8
+
+ On return, state.mode is one of:
+
+ LEN -- ran out of enough output space or enough available input
+ TYPE -- reached end of block code, inflate() to interpret next block
+ BAD -- error in block data
+
+ Notes:
+
+ - The maximum input bits used by a length/distance pair is 15 bits for the
+ length code, 5 bits for the length extra, 15 bits for the distance code,
+ and 13 bits for the distance extra. This totals 48 bits, or six bytes.
+ Therefore if strm.avail_in >= 6, then there is enough input to avoid
+ checking for available input while decoding.
+
+ - The maximum bytes that a single length/distance pair can output is 258
+ bytes, which is the maximum length that can be coded. inflate_fast()
+ requires strm.avail_out >= 258 for each loop to avoid checking for
+ output space.
+ */
+module.exports = function inflate_fast(strm, start) {
+ var state;
+ var _in; /* local strm.input */
+ var last; /* have enough input while in < last */
+ var _out; /* local strm.output */
+ var beg; /* inflate()'s initial strm.output */
+ var end; /* while out < end, enough space available */
+//#ifdef INFLATE_STRICT
+ var dmax; /* maximum distance from zlib header */
+//#endif
+ var wsize; /* window size or zero if not using window */
+ var whave; /* valid bytes in the window */
+ var wnext; /* window write index */
+ // Use `s_window` instead `window`, avoid conflict with instrumentation tools
+ var s_window; /* allocated sliding window, if wsize != 0 */
+ var hold; /* local strm.hold */
+ var bits; /* local strm.bits */
+ var lcode; /* local strm.lencode */
+ var dcode; /* local strm.distcode */
+ var lmask; /* mask for first level of length codes */
+ var dmask; /* mask for first level of distance codes */
+ var here; /* retrieved table entry */
+ var op; /* code bits, operation, extra bits, or */
+ /* window position, window bytes to copy */
+ var len; /* match length, unused bytes */
+ var dist; /* match distance */
+ var from; /* where to copy match from */
+ var from_source;
+
+
+ var input, output; // JS specific, because we have no pointers
+
+ /* copy state to local variables */
+ state = strm.state;
+ //here = state.here;
+ _in = strm.next_in;
+ input = strm.input;
+ last = _in + (strm.avail_in - 5);
+ _out = strm.next_out;
+ output = strm.output;
+ beg = _out - (start - strm.avail_out);
+ end = _out + (strm.avail_out - 257);
+//#ifdef INFLATE_STRICT
+ dmax = state.dmax;
+//#endif
+ wsize = state.wsize;
+ whave = state.whave;
+ wnext = state.wnext;
+ s_window = state.window;
+ hold = state.hold;
+ bits = state.bits;
+ lcode = state.lencode;
+ dcode = state.distcode;
+ lmask = (1 << state.lenbits) - 1;
+ dmask = (1 << state.distbits) - 1;
+
+
+ /* decode literals and length/distances until end-of-block or not enough
+ input data or output space */
+
+ top:
+ do {
+ if (bits < 15) {
+ hold += input[_in++] << bits;
+ bits += 8;
+ hold += input[_in++] << bits;
+ bits += 8;
+ }
+
+ here = lcode[hold & lmask];
+
+ dolen:
+ for (;;) { // Goto emulation
+ op = here >>> 24/*here.bits*/;
+ hold >>>= op;
+ bits -= op;
+ op = (here >>> 16) & 0xff/*here.op*/;
+ if (op === 0) { /* literal */
+ //Tracevv((stderr, here.val >= 0x20 && here.val < 0x7f ?
+ // "inflate: literal '%c'\n" :
+ // "inflate: literal 0x%02x\n", here.val));
+ output[_out++] = here & 0xffff/*here.val*/;
+ }
+ else if (op & 16) { /* length base */
+ len = here & 0xffff/*here.val*/;
+ op &= 15; /* number of extra bits */
+ if (op) {
+ if (bits < op) {
+ hold += input[_in++] << bits;
+ bits += 8;
+ }
+ len += hold & ((1 << op) - 1);
+ hold >>>= op;
+ bits -= op;
+ }
+ //Tracevv((stderr, "inflate: length %u\n", len));
+ if (bits < 15) {
+ hold += input[_in++] << bits;
+ bits += 8;
+ hold += input[_in++] << bits;
+ bits += 8;
+ }
+ here = dcode[hold & dmask];
+
+ dodist:
+ for (;;) { // goto emulation
+ op = here >>> 24/*here.bits*/;
+ hold >>>= op;
+ bits -= op;
+ op = (here >>> 16) & 0xff/*here.op*/;
+
+ if (op & 16) { /* distance base */
+ dist = here & 0xffff/*here.val*/;
+ op &= 15; /* number of extra bits */
+ if (bits < op) {
+ hold += input[_in++] << bits;
+ bits += 8;
+ if (bits < op) {
+ hold += input[_in++] << bits;
+ bits += 8;
+ }
+ }
+ dist += hold & ((1 << op) - 1);
+//#ifdef INFLATE_STRICT
+ if (dist > dmax) {
+ strm.msg = 'invalid distance too far back';
+ state.mode = BAD;
+ break top;
+ }
+//#endif
+ hold >>>= op;
+ bits -= op;
+ //Tracevv((stderr, "inflate: distance %u\n", dist));
+ op = _out - beg; /* max distance in output */
+ if (dist > op) { /* see if copy from window */
+ op = dist - op; /* distance back in window */
+ if (op > whave) {
+ if (state.sane) {
+ strm.msg = 'invalid distance too far back';
+ state.mode = BAD;
+ break top;
+ }
+
+// (!) This block is disabled in zlib defaults,
+// don't enable it for binary compatibility
+//#ifdef INFLATE_ALLOW_INVALID_DISTANCE_TOOFAR_ARRR
+// if (len <= op - whave) {
+// do {
+// output[_out++] = 0;
+// } while (--len);
+// continue top;
+// }
+// len -= op - whave;
+// do {
+// output[_out++] = 0;
+// } while (--op > whave);
+// if (op === 0) {
+// from = _out - dist;
+// do {
+// output[_out++] = output[from++];
+// } while (--len);
+// continue top;
+// }
+//#endif
+ }
+ from = 0; // window index
+ from_source = s_window;
+ if (wnext === 0) { /* very common case */
+ from += wsize - op;
+ if (op < len) { /* some from window */
+ len -= op;
+ do {
+ output[_out++] = s_window[from++];
+ } while (--op);
+ from = _out - dist; /* rest from output */
+ from_source = output;
+ }
+ }
+ else if (wnext < op) { /* wrap around window */
+ from += wsize + wnext - op;
+ op -= wnext;
+ if (op < len) { /* some from end of window */
+ len -= op;
+ do {
+ output[_out++] = s_window[from++];
+ } while (--op);
+ from = 0;
+ if (wnext < len) { /* some from start of window */
+ op = wnext;
+ len -= op;
+ do {
+ output[_out++] = s_window[from++];
+ } while (--op);
+ from = _out - dist; /* rest from output */
+ from_source = output;
+ }
+ }
+ }
+ else { /* contiguous in window */
+ from += wnext - op;
+ if (op < len) { /* some from window */
+ len -= op;
+ do {
+ output[_out++] = s_window[from++];
+ } while (--op);
+ from = _out - dist; /* rest from output */
+ from_source = output;
+ }
+ }
+ while (len > 2) {
+ output[_out++] = from_source[from++];
+ output[_out++] = from_source[from++];
+ output[_out++] = from_source[from++];
+ len -= 3;
+ }
+ if (len) {
+ output[_out++] = from_source[from++];
+ if (len > 1) {
+ output[_out++] = from_source[from++];
+ }
+ }
+ }
+ else {
+ from = _out - dist; /* copy direct from output */
+ do { /* minimum length is three */
+ output[_out++] = output[from++];
+ output[_out++] = output[from++];
+ output[_out++] = output[from++];
+ len -= 3;
+ } while (len > 2);
+ if (len) {
+ output[_out++] = output[from++];
+ if (len > 1) {
+ output[_out++] = output[from++];
+ }
+ }
+ }
+ }
+ else if ((op & 64) === 0) { /* 2nd level distance code */
+ here = dcode[(here & 0xffff)/*here.val*/ + (hold & ((1 << op) - 1))];
+ continue dodist;
+ }
+ else {
+ strm.msg = 'invalid distance code';
+ state.mode = BAD;
+ break top;
+ }
+
+ break; // need to emulate goto via "continue"
+ }
+ }
+ else if ((op & 64) === 0) { /* 2nd level length code */
+ here = lcode[(here & 0xffff)/*here.val*/ + (hold & ((1 << op) - 1))];
+ continue dolen;
+ }
+ else if (op & 32) { /* end-of-block */
+ //Tracevv((stderr, "inflate: end of block\n"));
+ state.mode = TYPE;
+ break top;
+ }
+ else {
+ strm.msg = 'invalid literal/length code';
+ state.mode = BAD;
+ break top;
+ }
+
+ break; // need to emulate goto via "continue"
+ }
+ } while (_in < last && _out < end);
+
+ /* return unused bytes (on entry, bits < 8, so in won't go too far back) */
+ len = bits >> 3;
+ _in -= len;
+ bits -= len << 3;
+ hold &= (1 << bits) - 1;
+
+ /* update state and return */
+ strm.next_in = _in;
+ strm.next_out = _out;
+ strm.avail_in = (_in < last ? 5 + (last - _in) : 5 - (_in - last));
+ strm.avail_out = (_out < end ? 257 + (end - _out) : 257 - (_out - end));
+ state.hold = hold;
+ state.bits = bits;
+ return;
+};
diff --git a/node_modules/pako/lib/zlib/inflate.js b/node_modules/pako/lib/zlib/inflate.js
new file mode 100644
index 0000000000000000000000000000000000000000..6384844845c5e818b71ecb1e4179a9c96bbd7a8c
--- /dev/null
+++ b/node_modules/pako/lib/zlib/inflate.js
@@ -0,0 +1,1556 @@
+'use strict';
+
+// (C) 1995-2013 Jean-loup Gailly and Mark Adler
+// (C) 2014-2017 Vitaly Puzrin and Andrey Tupitsin
+//
+// This software is provided 'as-is', without any express or implied
+// warranty. In no event will the authors be held liable for any damages
+// arising from the use of this software.
+//
+// Permission is granted to anyone to use this software for any purpose,
+// including commercial applications, and to alter it and redistribute it
+// freely, subject to the following restrictions:
+//
+// 1. The origin of this software must not be misrepresented; you must not
+// claim that you wrote the original software. If you use this software
+// in a product, an acknowledgment in the product documentation would be
+// appreciated but is not required.
+// 2. Altered source versions must be plainly marked as such, and must not be
+// misrepresented as being the original software.
+// 3. This notice may not be removed or altered from any source distribution.
+
+var utils = require('../utils/common');
+var adler32 = require('./adler32');
+var crc32 = require('./crc32');
+var inflate_fast = require('./inffast');
+var inflate_table = require('./inftrees');
+
+var CODES = 0;
+var LENS = 1;
+var DISTS = 2;
+
+/* Public constants ==========================================================*/
+/* ===========================================================================*/
+
+
+/* Allowed flush values; see deflate() and inflate() below for details */
+//var Z_NO_FLUSH = 0;
+//var Z_PARTIAL_FLUSH = 1;
+//var Z_SYNC_FLUSH = 2;
+//var Z_FULL_FLUSH = 3;
+var Z_FINISH = 4;
+var Z_BLOCK = 5;
+var Z_TREES = 6;
+
+
+/* Return codes for the compression/decompression functions. Negative values
+ * are errors, positive values are used for special but normal events.
+ */
+var Z_OK = 0;
+var Z_STREAM_END = 1;
+var Z_NEED_DICT = 2;
+//var Z_ERRNO = -1;
+var Z_STREAM_ERROR = -2;
+var Z_DATA_ERROR = -3;
+var Z_MEM_ERROR = -4;
+var Z_BUF_ERROR = -5;
+//var Z_VERSION_ERROR = -6;
+
+/* The deflate compression method */
+var Z_DEFLATED = 8;
+
+
+/* STATES ====================================================================*/
+/* ===========================================================================*/
+
+
+var HEAD = 1; /* i: waiting for magic header */
+var FLAGS = 2; /* i: waiting for method and flags (gzip) */
+var TIME = 3; /* i: waiting for modification time (gzip) */
+var OS = 4; /* i: waiting for extra flags and operating system (gzip) */
+var EXLEN = 5; /* i: waiting for extra length (gzip) */
+var EXTRA = 6; /* i: waiting for extra bytes (gzip) */
+var NAME = 7; /* i: waiting for end of file name (gzip) */
+var COMMENT = 8; /* i: waiting for end of comment (gzip) */
+var HCRC = 9; /* i: waiting for header crc (gzip) */
+var DICTID = 10; /* i: waiting for dictionary check value */
+var DICT = 11; /* waiting for inflateSetDictionary() call */
+var TYPE = 12; /* i: waiting for type bits, including last-flag bit */
+var TYPEDO = 13; /* i: same, but skip check to exit inflate on new block */
+var STORED = 14; /* i: waiting for stored size (length and complement) */
+var COPY_ = 15; /* i/o: same as COPY below, but only first time in */
+var COPY = 16; /* i/o: waiting for input or output to copy stored block */
+var TABLE = 17; /* i: waiting for dynamic block table lengths */
+var LENLENS = 18; /* i: waiting for code length code lengths */
+var CODELENS = 19; /* i: waiting for length/lit and distance code lengths */
+var LEN_ = 20; /* i: same as LEN below, but only first time in */
+var LEN = 21; /* i: waiting for length/lit/eob code */
+var LENEXT = 22; /* i: waiting for length extra bits */
+var DIST = 23; /* i: waiting for distance code */
+var DISTEXT = 24; /* i: waiting for distance extra bits */
+var MATCH = 25; /* o: waiting for output space to copy string */
+var LIT = 26; /* o: waiting for output space to write literal */
+var CHECK = 27; /* i: waiting for 32-bit check value */
+var LENGTH = 28; /* i: waiting for 32-bit length (gzip) */
+var DONE = 29; /* finished check, done -- remain here until reset */
+var BAD = 30; /* got a data error -- remain here until reset */
+var MEM = 31; /* got an inflate() memory error -- remain here until reset */
+var SYNC = 32; /* looking for synchronization bytes to restart inflate() */
+
+/* ===========================================================================*/
+
+
+
+var ENOUGH_LENS = 852;
+var ENOUGH_DISTS = 592;
+//var ENOUGH = (ENOUGH_LENS+ENOUGH_DISTS);
+
+var MAX_WBITS = 15;
+/* 32K LZ77 window */
+var DEF_WBITS = MAX_WBITS;
+
+
+function zswap32(q) {
+ return (((q >>> 24) & 0xff) +
+ ((q >>> 8) & 0xff00) +
+ ((q & 0xff00) << 8) +
+ ((q & 0xff) << 24));
+}
+
+
+function InflateState() {
+ this.mode = 0; /* current inflate mode */
+ this.last = false; /* true if processing last block */
+ this.wrap = 0; /* bit 0 true for zlib, bit 1 true for gzip */
+ this.havedict = false; /* true if dictionary provided */
+ this.flags = 0; /* gzip header method and flags (0 if zlib) */
+ this.dmax = 0; /* zlib header max distance (INFLATE_STRICT) */
+ this.check = 0; /* protected copy of check value */
+ this.total = 0; /* protected copy of output count */
+ // TODO: may be {}
+ this.head = null; /* where to save gzip header information */
+
+ /* sliding window */
+ this.wbits = 0; /* log base 2 of requested window size */
+ this.wsize = 0; /* window size or zero if not using window */
+ this.whave = 0; /* valid bytes in the window */
+ this.wnext = 0; /* window write index */
+ this.window = null; /* allocated sliding window, if needed */
+
+ /* bit accumulator */
+ this.hold = 0; /* input bit accumulator */
+ this.bits = 0; /* number of bits in "in" */
+
+ /* for string and stored block copying */
+ this.length = 0; /* literal or length of data to copy */
+ this.offset = 0; /* distance back to copy string from */
+
+ /* for table and code decoding */
+ this.extra = 0; /* extra bits needed */
+
+ /* fixed and dynamic code tables */
+ this.lencode = null; /* starting table for length/literal codes */
+ this.distcode = null; /* starting table for distance codes */
+ this.lenbits = 0; /* index bits for lencode */
+ this.distbits = 0; /* index bits for distcode */
+
+ /* dynamic table building */
+ this.ncode = 0; /* number of code length code lengths */
+ this.nlen = 0; /* number of length code lengths */
+ this.ndist = 0; /* number of distance code lengths */
+ this.have = 0; /* number of code lengths in lens[] */
+ this.next = null; /* next available space in codes[] */
+
+ this.lens = new utils.Buf16(320); /* temporary storage for code lengths */
+ this.work = new utils.Buf16(288); /* work area for code table building */
+
+ /*
+ because we don't have pointers in js, we use lencode and distcode directly
+ as buffers so we don't need codes
+ */
+ //this.codes = new utils.Buf32(ENOUGH); /* space for code tables */
+ this.lendyn = null; /* dynamic table for length/literal codes (JS specific) */
+ this.distdyn = null; /* dynamic table for distance codes (JS specific) */
+ this.sane = 0; /* if false, allow invalid distance too far */
+ this.back = 0; /* bits back of last unprocessed length/lit */
+ this.was = 0; /* initial length of match */
+}
+
+function inflateResetKeep(strm) {
+ var state;
+
+ if (!strm || !strm.state) { return Z_STREAM_ERROR; }
+ state = strm.state;
+ strm.total_in = strm.total_out = state.total = 0;
+ strm.msg = ''; /*Z_NULL*/
+ if (state.wrap) { /* to support ill-conceived Java test suite */
+ strm.adler = state.wrap & 1;
+ }
+ state.mode = HEAD;
+ state.last = 0;
+ state.havedict = 0;
+ state.dmax = 32768;
+ state.head = null/*Z_NULL*/;
+ state.hold = 0;
+ state.bits = 0;
+ //state.lencode = state.distcode = state.next = state.codes;
+ state.lencode = state.lendyn = new utils.Buf32(ENOUGH_LENS);
+ state.distcode = state.distdyn = new utils.Buf32(ENOUGH_DISTS);
+
+ state.sane = 1;
+ state.back = -1;
+ //Tracev((stderr, "inflate: reset\n"));
+ return Z_OK;
+}
+
+function inflateReset(strm) {
+ var state;
+
+ if (!strm || !strm.state) { return Z_STREAM_ERROR; }
+ state = strm.state;
+ state.wsize = 0;
+ state.whave = 0;
+ state.wnext = 0;
+ return inflateResetKeep(strm);
+
+}
+
+function inflateReset2(strm, windowBits) {
+ var wrap;
+ var state;
+
+ /* get the state */
+ if (!strm || !strm.state) { return Z_STREAM_ERROR; }
+ state = strm.state;
+
+ /* extract wrap request from windowBits parameter */
+ if (windowBits < 0) {
+ wrap = 0;
+ windowBits = -windowBits;
+ }
+ else {
+ wrap = (windowBits >> 4) + 1;
+ if (windowBits < 48) {
+ windowBits &= 15;
+ }
+ }
+
+ /* set number of window bits, free window if different */
+ if (windowBits && (windowBits < 8 || windowBits > 15)) {
+ return Z_STREAM_ERROR;
+ }
+ if (state.window !== null && state.wbits !== windowBits) {
+ state.window = null;
+ }
+
+ /* update state and reset the rest of it */
+ state.wrap = wrap;
+ state.wbits = windowBits;
+ return inflateReset(strm);
+}
+
+function inflateInit2(strm, windowBits) {
+ var ret;
+ var state;
+
+ if (!strm) { return Z_STREAM_ERROR; }
+ //strm.msg = Z_NULL; /* in case we return an error */
+
+ state = new InflateState();
+
+ //if (state === Z_NULL) return Z_MEM_ERROR;
+ //Tracev((stderr, "inflate: allocated\n"));
+ strm.state = state;
+ state.window = null/*Z_NULL*/;
+ ret = inflateReset2(strm, windowBits);
+ if (ret !== Z_OK) {
+ strm.state = null/*Z_NULL*/;
+ }
+ return ret;
+}
+
+function inflateInit(strm) {
+ return inflateInit2(strm, DEF_WBITS);
+}
+
+
+/*
+ Return state with length and distance decoding tables and index sizes set to
+ fixed code decoding. Normally this returns fixed tables from inffixed.h.
+ If BUILDFIXED is defined, then instead this routine builds the tables the
+ first time it's called, and returns those tables the first time and
+ thereafter. This reduces the size of the code by about 2K bytes, in
+ exchange for a little execution time. However, BUILDFIXED should not be
+ used for threaded applications, since the rewriting of the tables and virgin
+ may not be thread-safe.
+ */
+var virgin = true;
+
+var lenfix, distfix; // We have no pointers in JS, so keep tables separate
+
+function fixedtables(state) {
+ /* build fixed huffman tables if first call (may not be thread safe) */
+ if (virgin) {
+ var sym;
+
+ lenfix = new utils.Buf32(512);
+ distfix = new utils.Buf32(32);
+
+ /* literal/length table */
+ sym = 0;
+ while (sym < 144) { state.lens[sym++] = 8; }
+ while (sym < 256) { state.lens[sym++] = 9; }
+ while (sym < 280) { state.lens[sym++] = 7; }
+ while (sym < 288) { state.lens[sym++] = 8; }
+
+ inflate_table(LENS, state.lens, 0, 288, lenfix, 0, state.work, { bits: 9 });
+
+ /* distance table */
+ sym = 0;
+ while (sym < 32) { state.lens[sym++] = 5; }
+
+ inflate_table(DISTS, state.lens, 0, 32, distfix, 0, state.work, { bits: 5 });
+
+ /* do this just once */
+ virgin = false;
+ }
+
+ state.lencode = lenfix;
+ state.lenbits = 9;
+ state.distcode = distfix;
+ state.distbits = 5;
+}
+
+
+/*
+ Update the window with the last wsize (normally 32K) bytes written before
+ returning. If window does not exist yet, create it. This is only called
+ when a window is already in use, or when output has been written during this
+ inflate call, but the end of the deflate stream has not been reached yet.
+ It is also called to create a window for dictionary data when a dictionary
+ is loaded.
+
+ Providing output buffers larger than 32K to inflate() should provide a speed
+ advantage, since only the last 32K of output is copied to the sliding window
+ upon return from inflate(), and since all distances after the first 32K of
+ output will fall in the output data, making match copies simpler and faster.
+ The advantage may be dependent on the size of the processor's data caches.
+ */
+function updatewindow(strm, src, end, copy) {
+ var dist;
+ var state = strm.state;
+
+ /* if it hasn't been done already, allocate space for the window */
+ if (state.window === null) {
+ state.wsize = 1 << state.wbits;
+ state.wnext = 0;
+ state.whave = 0;
+
+ state.window = new utils.Buf8(state.wsize);
+ }
+
+ /* copy state->wsize or less output bytes into the circular window */
+ if (copy >= state.wsize) {
+ utils.arraySet(state.window, src, end - state.wsize, state.wsize, 0);
+ state.wnext = 0;
+ state.whave = state.wsize;
+ }
+ else {
+ dist = state.wsize - state.wnext;
+ if (dist > copy) {
+ dist = copy;
+ }
+ //zmemcpy(state->window + state->wnext, end - copy, dist);
+ utils.arraySet(state.window, src, end - copy, dist, state.wnext);
+ copy -= dist;
+ if (copy) {
+ //zmemcpy(state->window, end - copy, copy);
+ utils.arraySet(state.window, src, end - copy, copy, 0);
+ state.wnext = copy;
+ state.whave = state.wsize;
+ }
+ else {
+ state.wnext += dist;
+ if (state.wnext === state.wsize) { state.wnext = 0; }
+ if (state.whave < state.wsize) { state.whave += dist; }
+ }
+ }
+ return 0;
+}
+
+function inflate(strm, flush) {
+ var state;
+ var input, output; // input/output buffers
+ var next; /* next input INDEX */
+ var put; /* next output INDEX */
+ var have, left; /* available input and output */
+ var hold; /* bit buffer */
+ var bits; /* bits in bit buffer */
+ var _in, _out; /* save starting available input and output */
+ var copy; /* number of stored or match bytes to copy */
+ var from; /* where to copy match bytes from */
+ var from_source;
+ var here = 0; /* current decoding table entry */
+ var here_bits, here_op, here_val; // paked "here" denormalized (JS specific)
+ //var last; /* parent table entry */
+ var last_bits, last_op, last_val; // paked "last" denormalized (JS specific)
+ var len; /* length to copy for repeats, bits to drop */
+ var ret; /* return code */
+ var hbuf = new utils.Buf8(4); /* buffer for gzip header crc calculation */
+ var opts;
+
+ var n; // temporary var for NEED_BITS
+
+ var order = /* permutation of code lengths */
+ [ 16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15 ];
+
+
+ if (!strm || !strm.state || !strm.output ||
+ (!strm.input && strm.avail_in !== 0)) {
+ return Z_STREAM_ERROR;
+ }
+
+ state = strm.state;
+ if (state.mode === TYPE) { state.mode = TYPEDO; } /* skip check */
+
+
+ //--- LOAD() ---
+ put = strm.next_out;
+ output = strm.output;
+ left = strm.avail_out;
+ next = strm.next_in;
+ input = strm.input;
+ have = strm.avail_in;
+ hold = state.hold;
+ bits = state.bits;
+ //---
+
+ _in = have;
+ _out = left;
+ ret = Z_OK;
+
+ inf_leave: // goto emulation
+ for (;;) {
+ switch (state.mode) {
+ case HEAD:
+ if (state.wrap === 0) {
+ state.mode = TYPEDO;
+ break;
+ }
+ //=== NEEDBITS(16);
+ while (bits < 16) {
+ if (have === 0) { break inf_leave; }
+ have--;
+ hold += input[next++] << bits;
+ bits += 8;
+ }
+ //===//
+ if ((state.wrap & 2) && hold === 0x8b1f) { /* gzip header */
+ state.check = 0/*crc32(0L, Z_NULL, 0)*/;
+ //=== CRC2(state.check, hold);
+ hbuf[0] = hold & 0xff;
+ hbuf[1] = (hold >>> 8) & 0xff;
+ state.check = crc32(state.check, hbuf, 2, 0);
+ //===//
+
+ //=== INITBITS();
+ hold = 0;
+ bits = 0;
+ //===//
+ state.mode = FLAGS;
+ break;
+ }
+ state.flags = 0; /* expect zlib header */
+ if (state.head) {
+ state.head.done = false;
+ }
+ if (!(state.wrap & 1) || /* check if zlib header allowed */
+ (((hold & 0xff)/*BITS(8)*/ << 8) + (hold >> 8)) % 31) {
+ strm.msg = 'incorrect header check';
+ state.mode = BAD;
+ break;
+ }
+ if ((hold & 0x0f)/*BITS(4)*/ !== Z_DEFLATED) {
+ strm.msg = 'unknown compression method';
+ state.mode = BAD;
+ break;
+ }
+ //--- DROPBITS(4) ---//
+ hold >>>= 4;
+ bits -= 4;
+ //---//
+ len = (hold & 0x0f)/*BITS(4)*/ + 8;
+ if (state.wbits === 0) {
+ state.wbits = len;
+ }
+ else if (len > state.wbits) {
+ strm.msg = 'invalid window size';
+ state.mode = BAD;
+ break;
+ }
+ state.dmax = 1 << len;
+ //Tracev((stderr, "inflate: zlib header ok\n"));
+ strm.adler = state.check = 1/*adler32(0L, Z_NULL, 0)*/;
+ state.mode = hold & 0x200 ? DICTID : TYPE;
+ //=== INITBITS();
+ hold = 0;
+ bits = 0;
+ //===//
+ break;
+ case FLAGS:
+ //=== NEEDBITS(16); */
+ while (bits < 16) {
+ if (have === 0) { break inf_leave; }
+ have--;
+ hold += input[next++] << bits;
+ bits += 8;
+ }
+ //===//
+ state.flags = hold;
+ if ((state.flags & 0xff) !== Z_DEFLATED) {
+ strm.msg = 'unknown compression method';
+ state.mode = BAD;
+ break;
+ }
+ if (state.flags & 0xe000) {
+ strm.msg = 'unknown header flags set';
+ state.mode = BAD;
+ break;
+ }
+ if (state.head) {
+ state.head.text = ((hold >> 8) & 1);
+ }
+ if (state.flags & 0x0200) {
+ //=== CRC2(state.check, hold);
+ hbuf[0] = hold & 0xff;
+ hbuf[1] = (hold >>> 8) & 0xff;
+ state.check = crc32(state.check, hbuf, 2, 0);
+ //===//
+ }
+ //=== INITBITS();
+ hold = 0;
+ bits = 0;
+ //===//
+ state.mode = TIME;
+ /* falls through */
+ case TIME:
+ //=== NEEDBITS(32); */
+ while (bits < 32) {
+ if (have === 0) { break inf_leave; }
+ have--;
+ hold += input[next++] << bits;
+ bits += 8;
+ }
+ //===//
+ if (state.head) {
+ state.head.time = hold;
+ }
+ if (state.flags & 0x0200) {
+ //=== CRC4(state.check, hold)
+ hbuf[0] = hold & 0xff;
+ hbuf[1] = (hold >>> 8) & 0xff;
+ hbuf[2] = (hold >>> 16) & 0xff;
+ hbuf[3] = (hold >>> 24) & 0xff;
+ state.check = crc32(state.check, hbuf, 4, 0);
+ //===
+ }
+ //=== INITBITS();
+ hold = 0;
+ bits = 0;
+ //===//
+ state.mode = OS;
+ /* falls through */
+ case OS:
+ //=== NEEDBITS(16); */
+ while (bits < 16) {
+ if (have === 0) { break inf_leave; }
+ have--;
+ hold += input[next++] << bits;
+ bits += 8;
+ }
+ //===//
+ if (state.head) {
+ state.head.xflags = (hold & 0xff);
+ state.head.os = (hold >> 8);
+ }
+ if (state.flags & 0x0200) {
+ //=== CRC2(state.check, hold);
+ hbuf[0] = hold & 0xff;
+ hbuf[1] = (hold >>> 8) & 0xff;
+ state.check = crc32(state.check, hbuf, 2, 0);
+ //===//
+ }
+ //=== INITBITS();
+ hold = 0;
+ bits = 0;
+ //===//
+ state.mode = EXLEN;
+ /* falls through */
+ case EXLEN:
+ if (state.flags & 0x0400) {
+ //=== NEEDBITS(16); */
+ while (bits < 16) {
+ if (have === 0) { break inf_leave; }
+ have--;
+ hold += input[next++] << bits;
+ bits += 8;
+ }
+ //===//
+ state.length = hold;
+ if (state.head) {
+ state.head.extra_len = hold;
+ }
+ if (state.flags & 0x0200) {
+ //=== CRC2(state.check, hold);
+ hbuf[0] = hold & 0xff;
+ hbuf[1] = (hold >>> 8) & 0xff;
+ state.check = crc32(state.check, hbuf, 2, 0);
+ //===//
+ }
+ //=== INITBITS();
+ hold = 0;
+ bits = 0;
+ //===//
+ }
+ else if (state.head) {
+ state.head.extra = null/*Z_NULL*/;
+ }
+ state.mode = EXTRA;
+ /* falls through */
+ case EXTRA:
+ if (state.flags & 0x0400) {
+ copy = state.length;
+ if (copy > have) { copy = have; }
+ if (copy) {
+ if (state.head) {
+ len = state.head.extra_len - state.length;
+ if (!state.head.extra) {
+ // Use untyped array for more convenient processing later
+ state.head.extra = new Array(state.head.extra_len);
+ }
+ utils.arraySet(
+ state.head.extra,
+ input,
+ next,
+ // extra field is limited to 65536 bytes
+ // - no need for additional size check
+ copy,
+ /*len + copy > state.head.extra_max - len ? state.head.extra_max : copy,*/
+ len
+ );
+ //zmemcpy(state.head.extra + len, next,
+ // len + copy > state.head.extra_max ?
+ // state.head.extra_max - len : copy);
+ }
+ if (state.flags & 0x0200) {
+ state.check = crc32(state.check, input, copy, next);
+ }
+ have -= copy;
+ next += copy;
+ state.length -= copy;
+ }
+ if (state.length) { break inf_leave; }
+ }
+ state.length = 0;
+ state.mode = NAME;
+ /* falls through */
+ case NAME:
+ if (state.flags & 0x0800) {
+ if (have === 0) { break inf_leave; }
+ copy = 0;
+ do {
+ // TODO: 2 or 1 bytes?
+ len = input[next + copy++];
+ /* use constant limit because in js we should not preallocate memory */
+ if (state.head && len &&
+ (state.length < 65536 /*state.head.name_max*/)) {
+ state.head.name += String.fromCharCode(len);
+ }
+ } while (len && copy < have);
+
+ if (state.flags & 0x0200) {
+ state.check = crc32(state.check, input, copy, next);
+ }
+ have -= copy;
+ next += copy;
+ if (len) { break inf_leave; }
+ }
+ else if (state.head) {
+ state.head.name = null;
+ }
+ state.length = 0;
+ state.mode = COMMENT;
+ /* falls through */
+ case COMMENT:
+ if (state.flags & 0x1000) {
+ if (have === 0) { break inf_leave; }
+ copy = 0;
+ do {
+ len = input[next + copy++];
+ /* use constant limit because in js we should not preallocate memory */
+ if (state.head && len &&
+ (state.length < 65536 /*state.head.comm_max*/)) {
+ state.head.comment += String.fromCharCode(len);
+ }
+ } while (len && copy < have);
+ if (state.flags & 0x0200) {
+ state.check = crc32(state.check, input, copy, next);
+ }
+ have -= copy;
+ next += copy;
+ if (len) { break inf_leave; }
+ }
+ else if (state.head) {
+ state.head.comment = null;
+ }
+ state.mode = HCRC;
+ /* falls through */
+ case HCRC:
+ if (state.flags & 0x0200) {
+ //=== NEEDBITS(16); */
+ while (bits < 16) {
+ if (have === 0) { break inf_leave; }
+ have--;
+ hold += input[next++] << bits;
+ bits += 8;
+ }
+ //===//
+ if (hold !== (state.check & 0xffff)) {
+ strm.msg = 'header crc mismatch';
+ state.mode = BAD;
+ break;
+ }
+ //=== INITBITS();
+ hold = 0;
+ bits = 0;
+ //===//
+ }
+ if (state.head) {
+ state.head.hcrc = ((state.flags >> 9) & 1);
+ state.head.done = true;
+ }
+ strm.adler = state.check = 0;
+ state.mode = TYPE;
+ break;
+ case DICTID:
+ //=== NEEDBITS(32); */
+ while (bits < 32) {
+ if (have === 0) { break inf_leave; }
+ have--;
+ hold += input[next++] << bits;
+ bits += 8;
+ }
+ //===//
+ strm.adler = state.check = zswap32(hold);
+ //=== INITBITS();
+ hold = 0;
+ bits = 0;
+ //===//
+ state.mode = DICT;
+ /* falls through */
+ case DICT:
+ if (state.havedict === 0) {
+ //--- RESTORE() ---
+ strm.next_out = put;
+ strm.avail_out = left;
+ strm.next_in = next;
+ strm.avail_in = have;
+ state.hold = hold;
+ state.bits = bits;
+ //---
+ return Z_NEED_DICT;
+ }
+ strm.adler = state.check = 1/*adler32(0L, Z_NULL, 0)*/;
+ state.mode = TYPE;
+ /* falls through */
+ case TYPE:
+ if (flush === Z_BLOCK || flush === Z_TREES) { break inf_leave; }
+ /* falls through */
+ case TYPEDO:
+ if (state.last) {
+ //--- BYTEBITS() ---//
+ hold >>>= bits & 7;
+ bits -= bits & 7;
+ //---//
+ state.mode = CHECK;
+ break;
+ }
+ //=== NEEDBITS(3); */
+ while (bits < 3) {
+ if (have === 0) { break inf_leave; }
+ have--;
+ hold += input[next++] << bits;
+ bits += 8;
+ }
+ //===//
+ state.last = (hold & 0x01)/*BITS(1)*/;
+ //--- DROPBITS(1) ---//
+ hold >>>= 1;
+ bits -= 1;
+ //---//
+
+ switch ((hold & 0x03)/*BITS(2)*/) {
+ case 0: /* stored block */
+ //Tracev((stderr, "inflate: stored block%s\n",
+ // state.last ? " (last)" : ""));
+ state.mode = STORED;
+ break;
+ case 1: /* fixed block */
+ fixedtables(state);
+ //Tracev((stderr, "inflate: fixed codes block%s\n",
+ // state.last ? " (last)" : ""));
+ state.mode = LEN_; /* decode codes */
+ if (flush === Z_TREES) {
+ //--- DROPBITS(2) ---//
+ hold >>>= 2;
+ bits -= 2;
+ //---//
+ break inf_leave;
+ }
+ break;
+ case 2: /* dynamic block */
+ //Tracev((stderr, "inflate: dynamic codes block%s\n",
+ // state.last ? " (last)" : ""));
+ state.mode = TABLE;
+ break;
+ case 3:
+ strm.msg = 'invalid block type';
+ state.mode = BAD;
+ }
+ //--- DROPBITS(2) ---//
+ hold >>>= 2;
+ bits -= 2;
+ //---//
+ break;
+ case STORED:
+ //--- BYTEBITS() ---// /* go to byte boundary */
+ hold >>>= bits & 7;
+ bits -= bits & 7;
+ //---//
+ //=== NEEDBITS(32); */
+ while (bits < 32) {
+ if (have === 0) { break inf_leave; }
+ have--;
+ hold += input[next++] << bits;
+ bits += 8;
+ }
+ //===//
+ if ((hold & 0xffff) !== ((hold >>> 16) ^ 0xffff)) {
+ strm.msg = 'invalid stored block lengths';
+ state.mode = BAD;
+ break;
+ }
+ state.length = hold & 0xffff;
+ //Tracev((stderr, "inflate: stored length %u\n",
+ // state.length));
+ //=== INITBITS();
+ hold = 0;
+ bits = 0;
+ //===//
+ state.mode = COPY_;
+ if (flush === Z_TREES) { break inf_leave; }
+ /* falls through */
+ case COPY_:
+ state.mode = COPY;
+ /* falls through */
+ case COPY:
+ copy = state.length;
+ if (copy) {
+ if (copy > have) { copy = have; }
+ if (copy > left) { copy = left; }
+ if (copy === 0) { break inf_leave; }
+ //--- zmemcpy(put, next, copy); ---
+ utils.arraySet(output, input, next, copy, put);
+ //---//
+ have -= copy;
+ next += copy;
+ left -= copy;
+ put += copy;
+ state.length -= copy;
+ break;
+ }
+ //Tracev((stderr, "inflate: stored end\n"));
+ state.mode = TYPE;
+ break;
+ case TABLE:
+ //=== NEEDBITS(14); */
+ while (bits < 14) {
+ if (have === 0) { break inf_leave; }
+ have--;
+ hold += input[next++] << bits;
+ bits += 8;
+ }
+ //===//
+ state.nlen = (hold & 0x1f)/*BITS(5)*/ + 257;
+ //--- DROPBITS(5) ---//
+ hold >>>= 5;
+ bits -= 5;
+ //---//
+ state.ndist = (hold & 0x1f)/*BITS(5)*/ + 1;
+ //--- DROPBITS(5) ---//
+ hold >>>= 5;
+ bits -= 5;
+ //---//
+ state.ncode = (hold & 0x0f)/*BITS(4)*/ + 4;
+ //--- DROPBITS(4) ---//
+ hold >>>= 4;
+ bits -= 4;
+ //---//
+//#ifndef PKZIP_BUG_WORKAROUND
+ if (state.nlen > 286 || state.ndist > 30) {
+ strm.msg = 'too many length or distance symbols';
+ state.mode = BAD;
+ break;
+ }
+//#endif
+ //Tracev((stderr, "inflate: table sizes ok\n"));
+ state.have = 0;
+ state.mode = LENLENS;
+ /* falls through */
+ case LENLENS:
+ while (state.have < state.ncode) {
+ //=== NEEDBITS(3);
+ while (bits < 3) {
+ if (have === 0) { break inf_leave; }
+ have--;
+ hold += input[next++] << bits;
+ bits += 8;
+ }
+ //===//
+ state.lens[order[state.have++]] = (hold & 0x07);//BITS(3);
+ //--- DROPBITS(3) ---//
+ hold >>>= 3;
+ bits -= 3;
+ //---//
+ }
+ while (state.have < 19) {
+ state.lens[order[state.have++]] = 0;
+ }
+ // We have separate tables & no pointers. 2 commented lines below not needed.
+ //state.next = state.codes;
+ //state.lencode = state.next;
+ // Switch to use dynamic table
+ state.lencode = state.lendyn;
+ state.lenbits = 7;
+
+ opts = { bits: state.lenbits };
+ ret = inflate_table(CODES, state.lens, 0, 19, state.lencode, 0, state.work, opts);
+ state.lenbits = opts.bits;
+
+ if (ret) {
+ strm.msg = 'invalid code lengths set';
+ state.mode = BAD;
+ break;
+ }
+ //Tracev((stderr, "inflate: code lengths ok\n"));
+ state.have = 0;
+ state.mode = CODELENS;
+ /* falls through */
+ case CODELENS:
+ while (state.have < state.nlen + state.ndist) {
+ for (;;) {
+ here = state.lencode[hold & ((1 << state.lenbits) - 1)];/*BITS(state.lenbits)*/
+ here_bits = here >>> 24;
+ here_op = (here >>> 16) & 0xff;
+ here_val = here & 0xffff;
+
+ if ((here_bits) <= bits) { break; }
+ //--- PULLBYTE() ---//
+ if (have === 0) { break inf_leave; }
+ have--;
+ hold += input[next++] << bits;
+ bits += 8;
+ //---//
+ }
+ if (here_val < 16) {
+ //--- DROPBITS(here.bits) ---//
+ hold >>>= here_bits;
+ bits -= here_bits;
+ //---//
+ state.lens[state.have++] = here_val;
+ }
+ else {
+ if (here_val === 16) {
+ //=== NEEDBITS(here.bits + 2);
+ n = here_bits + 2;
+ while (bits < n) {
+ if (have === 0) { break inf_leave; }
+ have--;
+ hold += input[next++] << bits;
+ bits += 8;
+ }
+ //===//
+ //--- DROPBITS(here.bits) ---//
+ hold >>>= here_bits;
+ bits -= here_bits;
+ //---//
+ if (state.have === 0) {
+ strm.msg = 'invalid bit length repeat';
+ state.mode = BAD;
+ break;
+ }
+ len = state.lens[state.have - 1];
+ copy = 3 + (hold & 0x03);//BITS(2);
+ //--- DROPBITS(2) ---//
+ hold >>>= 2;
+ bits -= 2;
+ //---//
+ }
+ else if (here_val === 17) {
+ //=== NEEDBITS(here.bits + 3);
+ n = here_bits + 3;
+ while (bits < n) {
+ if (have === 0) { break inf_leave; }
+ have--;
+ hold += input[next++] << bits;
+ bits += 8;
+ }
+ //===//
+ //--- DROPBITS(here.bits) ---//
+ hold >>>= here_bits;
+ bits -= here_bits;
+ //---//
+ len = 0;
+ copy = 3 + (hold & 0x07);//BITS(3);
+ //--- DROPBITS(3) ---//
+ hold >>>= 3;
+ bits -= 3;
+ //---//
+ }
+ else {
+ //=== NEEDBITS(here.bits + 7);
+ n = here_bits + 7;
+ while (bits < n) {
+ if (have === 0) { break inf_leave; }
+ have--;
+ hold += input[next++] << bits;
+ bits += 8;
+ }
+ //===//
+ //--- DROPBITS(here.bits) ---//
+ hold >>>= here_bits;
+ bits -= here_bits;
+ //---//
+ len = 0;
+ copy = 11 + (hold & 0x7f);//BITS(7);
+ //--- DROPBITS(7) ---//
+ hold >>>= 7;
+ bits -= 7;
+ //---//
+ }
+ if (state.have + copy > state.nlen + state.ndist) {
+ strm.msg = 'invalid bit length repeat';
+ state.mode = BAD;
+ break;
+ }
+ while (copy--) {
+ state.lens[state.have++] = len;
+ }
+ }
+ }
+
+ /* handle error breaks in while */
+ if (state.mode === BAD) { break; }
+
+ /* check for end-of-block code (better have one) */
+ if (state.lens[256] === 0) {
+ strm.msg = 'invalid code -- missing end-of-block';
+ state.mode = BAD;
+ break;
+ }
+
+ /* build code tables -- note: do not change the lenbits or distbits
+ values here (9 and 6) without reading the comments in inftrees.h
+ concerning the ENOUGH constants, which depend on those values */
+ state.lenbits = 9;
+
+ opts = { bits: state.lenbits };
+ ret = inflate_table(LENS, state.lens, 0, state.nlen, state.lencode, 0, state.work, opts);
+ // We have separate tables & no pointers. 2 commented lines below not needed.
+ // state.next_index = opts.table_index;
+ state.lenbits = opts.bits;
+ // state.lencode = state.next;
+
+ if (ret) {
+ strm.msg = 'invalid literal/lengths set';
+ state.mode = BAD;
+ break;
+ }
+
+ state.distbits = 6;
+ //state.distcode.copy(state.codes);
+ // Switch to use dynamic table
+ state.distcode = state.distdyn;
+ opts = { bits: state.distbits };
+ ret = inflate_table(DISTS, state.lens, state.nlen, state.ndist, state.distcode, 0, state.work, opts);
+ // We have separate tables & no pointers. 2 commented lines below not needed.
+ // state.next_index = opts.table_index;
+ state.distbits = opts.bits;
+ // state.distcode = state.next;
+
+ if (ret) {
+ strm.msg = 'invalid distances set';
+ state.mode = BAD;
+ break;
+ }
+ //Tracev((stderr, 'inflate: codes ok\n'));
+ state.mode = LEN_;
+ if (flush === Z_TREES) { break inf_leave; }
+ /* falls through */
+ case LEN_:
+ state.mode = LEN;
+ /* falls through */
+ case LEN:
+ if (have >= 6 && left >= 258) {
+ //--- RESTORE() ---
+ strm.next_out = put;
+ strm.avail_out = left;
+ strm.next_in = next;
+ strm.avail_in = have;
+ state.hold = hold;
+ state.bits = bits;
+ //---
+ inflate_fast(strm, _out);
+ //--- LOAD() ---
+ put = strm.next_out;
+ output = strm.output;
+ left = strm.avail_out;
+ next = strm.next_in;
+ input = strm.input;
+ have = strm.avail_in;
+ hold = state.hold;
+ bits = state.bits;
+ //---
+
+ if (state.mode === TYPE) {
+ state.back = -1;
+ }
+ break;
+ }
+ state.back = 0;
+ for (;;) {
+ here = state.lencode[hold & ((1 << state.lenbits) - 1)]; /*BITS(state.lenbits)*/
+ here_bits = here >>> 24;
+ here_op = (here >>> 16) & 0xff;
+ here_val = here & 0xffff;
+
+ if (here_bits <= bits) { break; }
+ //--- PULLBYTE() ---//
+ if (have === 0) { break inf_leave; }
+ have--;
+ hold += input[next++] << bits;
+ bits += 8;
+ //---//
+ }
+ if (here_op && (here_op & 0xf0) === 0) {
+ last_bits = here_bits;
+ last_op = here_op;
+ last_val = here_val;
+ for (;;) {
+ here = state.lencode[last_val +
+ ((hold & ((1 << (last_bits + last_op)) - 1))/*BITS(last.bits + last.op)*/ >> last_bits)];
+ here_bits = here >>> 24;
+ here_op = (here >>> 16) & 0xff;
+ here_val = here & 0xffff;
+
+ if ((last_bits + here_bits) <= bits) { break; }
+ //--- PULLBYTE() ---//
+ if (have === 0) { break inf_leave; }
+ have--;
+ hold += input[next++] << bits;
+ bits += 8;
+ //---//
+ }
+ //--- DROPBITS(last.bits) ---//
+ hold >>>= last_bits;
+ bits -= last_bits;
+ //---//
+ state.back += last_bits;
+ }
+ //--- DROPBITS(here.bits) ---//
+ hold >>>= here_bits;
+ bits -= here_bits;
+ //---//
+ state.back += here_bits;
+ state.length = here_val;
+ if (here_op === 0) {
+ //Tracevv((stderr, here.val >= 0x20 && here.val < 0x7f ?
+ // "inflate: literal '%c'\n" :
+ // "inflate: literal 0x%02x\n", here.val));
+ state.mode = LIT;
+ break;
+ }
+ if (here_op & 32) {
+ //Tracevv((stderr, "inflate: end of block\n"));
+ state.back = -1;
+ state.mode = TYPE;
+ break;
+ }
+ if (here_op & 64) {
+ strm.msg = 'invalid literal/length code';
+ state.mode = BAD;
+ break;
+ }
+ state.extra = here_op & 15;
+ state.mode = LENEXT;
+ /* falls through */
+ case LENEXT:
+ if (state.extra) {
+ //=== NEEDBITS(state.extra);
+ n = state.extra;
+ while (bits < n) {
+ if (have === 0) { break inf_leave; }
+ have--;
+ hold += input[next++] << bits;
+ bits += 8;
+ }
+ //===//
+ state.length += hold & ((1 << state.extra) - 1)/*BITS(state.extra)*/;
+ //--- DROPBITS(state.extra) ---//
+ hold >>>= state.extra;
+ bits -= state.extra;
+ //---//
+ state.back += state.extra;
+ }
+ //Tracevv((stderr, "inflate: length %u\n", state.length));
+ state.was = state.length;
+ state.mode = DIST;
+ /* falls through */
+ case DIST:
+ for (;;) {
+ here = state.distcode[hold & ((1 << state.distbits) - 1)];/*BITS(state.distbits)*/
+ here_bits = here >>> 24;
+ here_op = (here >>> 16) & 0xff;
+ here_val = here & 0xffff;
+
+ if ((here_bits) <= bits) { break; }
+ //--- PULLBYTE() ---//
+ if (have === 0) { break inf_leave; }
+ have--;
+ hold += input[next++] << bits;
+ bits += 8;
+ //---//
+ }
+ if ((here_op & 0xf0) === 0) {
+ last_bits = here_bits;
+ last_op = here_op;
+ last_val = here_val;
+ for (;;) {
+ here = state.distcode[last_val +
+ ((hold & ((1 << (last_bits + last_op)) - 1))/*BITS(last.bits + last.op)*/ >> last_bits)];
+ here_bits = here >>> 24;
+ here_op = (here >>> 16) & 0xff;
+ here_val = here & 0xffff;
+
+ if ((last_bits + here_bits) <= bits) { break; }
+ //--- PULLBYTE() ---//
+ if (have === 0) { break inf_leave; }
+ have--;
+ hold += input[next++] << bits;
+ bits += 8;
+ //---//
+ }
+ //--- DROPBITS(last.bits) ---//
+ hold >>>= last_bits;
+ bits -= last_bits;
+ //---//
+ state.back += last_bits;
+ }
+ //--- DROPBITS(here.bits) ---//
+ hold >>>= here_bits;
+ bits -= here_bits;
+ //---//
+ state.back += here_bits;
+ if (here_op & 64) {
+ strm.msg = 'invalid distance code';
+ state.mode = BAD;
+ break;
+ }
+ state.offset = here_val;
+ state.extra = (here_op) & 15;
+ state.mode = DISTEXT;
+ /* falls through */
+ case DISTEXT:
+ if (state.extra) {
+ //=== NEEDBITS(state.extra);
+ n = state.extra;
+ while (bits < n) {
+ if (have === 0) { break inf_leave; }
+ have--;
+ hold += input[next++] << bits;
+ bits += 8;
+ }
+ //===//
+ state.offset += hold & ((1 << state.extra) - 1)/*BITS(state.extra)*/;
+ //--- DROPBITS(state.extra) ---//
+ hold >>>= state.extra;
+ bits -= state.extra;
+ //---//
+ state.back += state.extra;
+ }
+//#ifdef INFLATE_STRICT
+ if (state.offset > state.dmax) {
+ strm.msg = 'invalid distance too far back';
+ state.mode = BAD;
+ break;
+ }
+//#endif
+ //Tracevv((stderr, "inflate: distance %u\n", state.offset));
+ state.mode = MATCH;
+ /* falls through */
+ case MATCH:
+ if (left === 0) { break inf_leave; }
+ copy = _out - left;
+ if (state.offset > copy) { /* copy from window */
+ copy = state.offset - copy;
+ if (copy > state.whave) {
+ if (state.sane) {
+ strm.msg = 'invalid distance too far back';
+ state.mode = BAD;
+ break;
+ }
+// (!) This block is disabled in zlib defaults,
+// don't enable it for binary compatibility
+//#ifdef INFLATE_ALLOW_INVALID_DISTANCE_TOOFAR_ARRR
+// Trace((stderr, "inflate.c too far\n"));
+// copy -= state.whave;
+// if (copy > state.length) { copy = state.length; }
+// if (copy > left) { copy = left; }
+// left -= copy;
+// state.length -= copy;
+// do {
+// output[put++] = 0;
+// } while (--copy);
+// if (state.length === 0) { state.mode = LEN; }
+// break;
+//#endif
+ }
+ if (copy > state.wnext) {
+ copy -= state.wnext;
+ from = state.wsize - copy;
+ }
+ else {
+ from = state.wnext - copy;
+ }
+ if (copy > state.length) { copy = state.length; }
+ from_source = state.window;
+ }
+ else { /* copy from output */
+ from_source = output;
+ from = put - state.offset;
+ copy = state.length;
+ }
+ if (copy > left) { copy = left; }
+ left -= copy;
+ state.length -= copy;
+ do {
+ output[put++] = from_source[from++];
+ } while (--copy);
+ if (state.length === 0) { state.mode = LEN; }
+ break;
+ case LIT:
+ if (left === 0) { break inf_leave; }
+ output[put++] = state.length;
+ left--;
+ state.mode = LEN;
+ break;
+ case CHECK:
+ if (state.wrap) {
+ //=== NEEDBITS(32);
+ while (bits < 32) {
+ if (have === 0) { break inf_leave; }
+ have--;
+ // Use '|' instead of '+' to make sure that result is signed
+ hold |= input[next++] << bits;
+ bits += 8;
+ }
+ //===//
+ _out -= left;
+ strm.total_out += _out;
+ state.total += _out;
+ if (_out) {
+ strm.adler = state.check =
+ /*UPDATE(state.check, put - _out, _out);*/
+ (state.flags ? crc32(state.check, output, _out, put - _out) : adler32(state.check, output, _out, put - _out));
+
+ }
+ _out = left;
+ // NB: crc32 stored as signed 32-bit int, zswap32 returns signed too
+ if ((state.flags ? hold : zswap32(hold)) !== state.check) {
+ strm.msg = 'incorrect data check';
+ state.mode = BAD;
+ break;
+ }
+ //=== INITBITS();
+ hold = 0;
+ bits = 0;
+ //===//
+ //Tracev((stderr, "inflate: check matches trailer\n"));
+ }
+ state.mode = LENGTH;
+ /* falls through */
+ case LENGTH:
+ if (state.wrap && state.flags) {
+ //=== NEEDBITS(32);
+ while (bits < 32) {
+ if (have === 0) { break inf_leave; }
+ have--;
+ hold += input[next++] << bits;
+ bits += 8;
+ }
+ //===//
+ if (hold !== (state.total & 0xffffffff)) {
+ strm.msg = 'incorrect length check';
+ state.mode = BAD;
+ break;
+ }
+ //=== INITBITS();
+ hold = 0;
+ bits = 0;
+ //===//
+ //Tracev((stderr, "inflate: length matches trailer\n"));
+ }
+ state.mode = DONE;
+ /* falls through */
+ case DONE:
+ ret = Z_STREAM_END;
+ break inf_leave;
+ case BAD:
+ ret = Z_DATA_ERROR;
+ break inf_leave;
+ case MEM:
+ return Z_MEM_ERROR;
+ case SYNC:
+ /* falls through */
+ default:
+ return Z_STREAM_ERROR;
+ }
+ }
+
+ // inf_leave <- here is real place for "goto inf_leave", emulated via "break inf_leave"
+
+ /*
+ Return from inflate(), updating the total counts and the check value.
+ If there was no progress during the inflate() call, return a buffer
+ error. Call updatewindow() to create and/or update the window state.
+ Note: a memory error from inflate() is non-recoverable.
+ */
+
+ //--- RESTORE() ---
+ strm.next_out = put;
+ strm.avail_out = left;
+ strm.next_in = next;
+ strm.avail_in = have;
+ state.hold = hold;
+ state.bits = bits;
+ //---
+
+ if (state.wsize || (_out !== strm.avail_out && state.mode < BAD &&
+ (state.mode < CHECK || flush !== Z_FINISH))) {
+ if (updatewindow(strm, strm.output, strm.next_out, _out - strm.avail_out)) {
+ state.mode = MEM;
+ return Z_MEM_ERROR;
+ }
+ }
+ _in -= strm.avail_in;
+ _out -= strm.avail_out;
+ strm.total_in += _in;
+ strm.total_out += _out;
+ state.total += _out;
+ if (state.wrap && _out) {
+ strm.adler = state.check = /*UPDATE(state.check, strm.next_out - _out, _out);*/
+ (state.flags ? crc32(state.check, output, _out, strm.next_out - _out) : adler32(state.check, output, _out, strm.next_out - _out));
+ }
+ strm.data_type = state.bits + (state.last ? 64 : 0) +
+ (state.mode === TYPE ? 128 : 0) +
+ (state.mode === LEN_ || state.mode === COPY_ ? 256 : 0);
+ if (((_in === 0 && _out === 0) || flush === Z_FINISH) && ret === Z_OK) {
+ ret = Z_BUF_ERROR;
+ }
+ return ret;
+}
+
+function inflateEnd(strm) {
+
+ if (!strm || !strm.state /*|| strm->zfree == (free_func)0*/) {
+ return Z_STREAM_ERROR;
+ }
+
+ var state = strm.state;
+ if (state.window) {
+ state.window = null;
+ }
+ strm.state = null;
+ return Z_OK;
+}
+
+function inflateGetHeader(strm, head) {
+ var state;
+
+ /* check state */
+ if (!strm || !strm.state) { return Z_STREAM_ERROR; }
+ state = strm.state;
+ if ((state.wrap & 2) === 0) { return Z_STREAM_ERROR; }
+
+ /* save header structure */
+ state.head = head;
+ head.done = false;
+ return Z_OK;
+}
+
+function inflateSetDictionary(strm, dictionary) {
+ var dictLength = dictionary.length;
+
+ var state;
+ var dictid;
+ var ret;
+
+ /* check state */
+ if (!strm /* == Z_NULL */ || !strm.state /* == Z_NULL */) { return Z_STREAM_ERROR; }
+ state = strm.state;
+
+ if (state.wrap !== 0 && state.mode !== DICT) {
+ return Z_STREAM_ERROR;
+ }
+
+ /* check for correct dictionary identifier */
+ if (state.mode === DICT) {
+ dictid = 1; /* adler32(0, null, 0)*/
+ /* dictid = adler32(dictid, dictionary, dictLength); */
+ dictid = adler32(dictid, dictionary, dictLength, 0);
+ if (dictid !== state.check) {
+ return Z_DATA_ERROR;
+ }
+ }
+ /* copy dictionary to window using updatewindow(), which will amend the
+ existing dictionary if appropriate */
+ ret = updatewindow(strm, dictionary, dictLength, dictLength);
+ if (ret) {
+ state.mode = MEM;
+ return Z_MEM_ERROR;
+ }
+ state.havedict = 1;
+ // Tracev((stderr, "inflate: dictionary set\n"));
+ return Z_OK;
+}
+
+exports.inflateReset = inflateReset;
+exports.inflateReset2 = inflateReset2;
+exports.inflateResetKeep = inflateResetKeep;
+exports.inflateInit = inflateInit;
+exports.inflateInit2 = inflateInit2;
+exports.inflate = inflate;
+exports.inflateEnd = inflateEnd;
+exports.inflateGetHeader = inflateGetHeader;
+exports.inflateSetDictionary = inflateSetDictionary;
+exports.inflateInfo = 'pako inflate (from Nodeca project)';
+
+/* Not implemented
+exports.inflateCopy = inflateCopy;
+exports.inflateGetDictionary = inflateGetDictionary;
+exports.inflateMark = inflateMark;
+exports.inflatePrime = inflatePrime;
+exports.inflateSync = inflateSync;
+exports.inflateSyncPoint = inflateSyncPoint;
+exports.inflateUndermine = inflateUndermine;
+*/
diff --git a/node_modules/pako/lib/zlib/inftrees.js b/node_modules/pako/lib/zlib/inftrees.js
new file mode 100644
index 0000000000000000000000000000000000000000..ec4e4e909628877cfc7f438860d9999f99e14ebe
--- /dev/null
+++ b/node_modules/pako/lib/zlib/inftrees.js
@@ -0,0 +1,343 @@
+'use strict';
+
+// (C) 1995-2013 Jean-loup Gailly and Mark Adler
+// (C) 2014-2017 Vitaly Puzrin and Andrey Tupitsin
+//
+// This software is provided 'as-is', without any express or implied
+// warranty. In no event will the authors be held liable for any damages
+// arising from the use of this software.
+//
+// Permission is granted to anyone to use this software for any purpose,
+// including commercial applications, and to alter it and redistribute it
+// freely, subject to the following restrictions:
+//
+// 1. The origin of this software must not be misrepresented; you must not
+// claim that you wrote the original software. If you use this software
+// in a product, an acknowledgment in the product documentation would be
+// appreciated but is not required.
+// 2. Altered source versions must be plainly marked as such, and must not be
+// misrepresented as being the original software.
+// 3. This notice may not be removed or altered from any source distribution.
+
+var utils = require('../utils/common');
+
+var MAXBITS = 15;
+var ENOUGH_LENS = 852;
+var ENOUGH_DISTS = 592;
+//var ENOUGH = (ENOUGH_LENS+ENOUGH_DISTS);
+
+var CODES = 0;
+var LENS = 1;
+var DISTS = 2;
+
+var lbase = [ /* Length codes 257..285 base */
+ 3, 4, 5, 6, 7, 8, 9, 10, 11, 13, 15, 17, 19, 23, 27, 31,
+ 35, 43, 51, 59, 67, 83, 99, 115, 131, 163, 195, 227, 258, 0, 0
+];
+
+var lext = [ /* Length codes 257..285 extra */
+ 16, 16, 16, 16, 16, 16, 16, 16, 17, 17, 17, 17, 18, 18, 18, 18,
+ 19, 19, 19, 19, 20, 20, 20, 20, 21, 21, 21, 21, 16, 72, 78
+];
+
+var dbase = [ /* Distance codes 0..29 base */
+ 1, 2, 3, 4, 5, 7, 9, 13, 17, 25, 33, 49, 65, 97, 129, 193,
+ 257, 385, 513, 769, 1025, 1537, 2049, 3073, 4097, 6145,
+ 8193, 12289, 16385, 24577, 0, 0
+];
+
+var dext = [ /* Distance codes 0..29 extra */
+ 16, 16, 16, 16, 17, 17, 18, 18, 19, 19, 20, 20, 21, 21, 22, 22,
+ 23, 23, 24, 24, 25, 25, 26, 26, 27, 27,
+ 28, 28, 29, 29, 64, 64
+];
+
+module.exports = function inflate_table(type, lens, lens_index, codes, table, table_index, work, opts)
+{
+ var bits = opts.bits;
+ //here = opts.here; /* table entry for duplication */
+
+ var len = 0; /* a code's length in bits */
+ var sym = 0; /* index of code symbols */
+ var min = 0, max = 0; /* minimum and maximum code lengths */
+ var root = 0; /* number of index bits for root table */
+ var curr = 0; /* number of index bits for current table */
+ var drop = 0; /* code bits to drop for sub-table */
+ var left = 0; /* number of prefix codes available */
+ var used = 0; /* code entries in table used */
+ var huff = 0; /* Huffman code */
+ var incr; /* for incrementing code, index */
+ var fill; /* index for replicating entries */
+ var low; /* low bits for current root entry */
+ var mask; /* mask for low root bits */
+ var next; /* next available space in table */
+ var base = null; /* base value table to use */
+ var base_index = 0;
+// var shoextra; /* extra bits table to use */
+ var end; /* use base and extra for symbol > end */
+ var count = new utils.Buf16(MAXBITS + 1); //[MAXBITS+1]; /* number of codes of each length */
+ var offs = new utils.Buf16(MAXBITS + 1); //[MAXBITS+1]; /* offsets in table for each length */
+ var extra = null;
+ var extra_index = 0;
+
+ var here_bits, here_op, here_val;
+
+ /*
+ Process a set of code lengths to create a canonical Huffman code. The
+ code lengths are lens[0..codes-1]. Each length corresponds to the
+ symbols 0..codes-1. The Huffman code is generated by first sorting the
+ symbols by length from short to long, and retaining the symbol order
+ for codes with equal lengths. Then the code starts with all zero bits
+ for the first code of the shortest length, and the codes are integer
+ increments for the same length, and zeros are appended as the length
+ increases. For the deflate format, these bits are stored backwards
+ from their more natural integer increment ordering, and so when the
+ decoding tables are built in the large loop below, the integer codes
+ are incremented backwards.
+
+ This routine assumes, but does not check, that all of the entries in
+ lens[] are in the range 0..MAXBITS. The caller must assure this.
+ 1..MAXBITS is interpreted as that code length. zero means that that
+ symbol does not occur in this code.
+
+ The codes are sorted by computing a count of codes for each length,
+ creating from that a table of starting indices for each length in the
+ sorted table, and then entering the symbols in order in the sorted
+ table. The sorted table is work[], with that space being provided by
+ the caller.
+
+ The length counts are used for other purposes as well, i.e. finding
+ the minimum and maximum length codes, determining if there are any
+ codes at all, checking for a valid set of lengths, and looking ahead
+ at length counts to determine sub-table sizes when building the
+ decoding tables.
+ */
+
+ /* accumulate lengths for codes (assumes lens[] all in 0..MAXBITS) */
+ for (len = 0; len <= MAXBITS; len++) {
+ count[len] = 0;
+ }
+ for (sym = 0; sym < codes; sym++) {
+ count[lens[lens_index + sym]]++;
+ }
+
+ /* bound code lengths, force root to be within code lengths */
+ root = bits;
+ for (max = MAXBITS; max >= 1; max--) {
+ if (count[max] !== 0) { break; }
+ }
+ if (root > max) {
+ root = max;
+ }
+ if (max === 0) { /* no symbols to code at all */
+ //table.op[opts.table_index] = 64; //here.op = (var char)64; /* invalid code marker */
+ //table.bits[opts.table_index] = 1; //here.bits = (var char)1;
+ //table.val[opts.table_index++] = 0; //here.val = (var short)0;
+ table[table_index++] = (1 << 24) | (64 << 16) | 0;
+
+
+ //table.op[opts.table_index] = 64;
+ //table.bits[opts.table_index] = 1;
+ //table.val[opts.table_index++] = 0;
+ table[table_index++] = (1 << 24) | (64 << 16) | 0;
+
+ opts.bits = 1;
+ return 0; /* no symbols, but wait for decoding to report error */
+ }
+ for (min = 1; min < max; min++) {
+ if (count[min] !== 0) { break; }
+ }
+ if (root < min) {
+ root = min;
+ }
+
+ /* check for an over-subscribed or incomplete set of lengths */
+ left = 1;
+ for (len = 1; len <= MAXBITS; len++) {
+ left <<= 1;
+ left -= count[len];
+ if (left < 0) {
+ return -1;
+ } /* over-subscribed */
+ }
+ if (left > 0 && (type === CODES || max !== 1)) {
+ return -1; /* incomplete set */
+ }
+
+ /* generate offsets into symbol table for each length for sorting */
+ offs[1] = 0;
+ for (len = 1; len < MAXBITS; len++) {
+ offs[len + 1] = offs[len] + count[len];
+ }
+
+ /* sort symbols by length, by symbol order within each length */
+ for (sym = 0; sym < codes; sym++) {
+ if (lens[lens_index + sym] !== 0) {
+ work[offs[lens[lens_index + sym]]++] = sym;
+ }
+ }
+
+ /*
+ Create and fill in decoding tables. In this loop, the table being
+ filled is at next and has curr index bits. The code being used is huff
+ with length len. That code is converted to an index by dropping drop
+ bits off of the bottom. For codes where len is less than drop + curr,
+ those top drop + curr - len bits are incremented through all values to
+ fill the table with replicated entries.
+
+ root is the number of index bits for the root table. When len exceeds
+ root, sub-tables are created pointed to by the root entry with an index
+ of the low root bits of huff. This is saved in low to check for when a
+ new sub-table should be started. drop is zero when the root table is
+ being filled, and drop is root when sub-tables are being filled.
+
+ When a new sub-table is needed, it is necessary to look ahead in the
+ code lengths to determine what size sub-table is needed. The length
+ counts are used for this, and so count[] is decremented as codes are
+ entered in the tables.
+
+ used keeps track of how many table entries have been allocated from the
+ provided *table space. It is checked for LENS and DIST tables against
+ the constants ENOUGH_LENS and ENOUGH_DISTS to guard against changes in
+ the initial root table size constants. See the comments in inftrees.h
+ for more information.
+
+ sym increments through all symbols, and the loop terminates when
+ all codes of length max, i.e. all codes, have been processed. This
+ routine permits incomplete codes, so another loop after this one fills
+ in the rest of the decoding tables with invalid code markers.
+ */
+
+ /* set up for code type */
+ // poor man optimization - use if-else instead of switch,
+ // to avoid deopts in old v8
+ if (type === CODES) {
+ base = extra = work; /* dummy value--not used */
+ end = 19;
+
+ } else if (type === LENS) {
+ base = lbase;
+ base_index -= 257;
+ extra = lext;
+ extra_index -= 257;
+ end = 256;
+
+ } else { /* DISTS */
+ base = dbase;
+ extra = dext;
+ end = -1;
+ }
+
+ /* initialize opts for loop */
+ huff = 0; /* starting code */
+ sym = 0; /* starting code symbol */
+ len = min; /* starting code length */
+ next = table_index; /* current table to fill in */
+ curr = root; /* current table index bits */
+ drop = 0; /* current bits to drop from code for index */
+ low = -1; /* trigger new sub-table when len > root */
+ used = 1 << root; /* use root table entries */
+ mask = used - 1; /* mask for comparing low */
+
+ /* check available table space */
+ if ((type === LENS && used > ENOUGH_LENS) ||
+ (type === DISTS && used > ENOUGH_DISTS)) {
+ return 1;
+ }
+
+ /* process all codes and make table entries */
+ for (;;) {
+ /* create table entry */
+ here_bits = len - drop;
+ if (work[sym] < end) {
+ here_op = 0;
+ here_val = work[sym];
+ }
+ else if (work[sym] > end) {
+ here_op = extra[extra_index + work[sym]];
+ here_val = base[base_index + work[sym]];
+ }
+ else {
+ here_op = 32 + 64; /* end of block */
+ here_val = 0;
+ }
+
+ /* replicate for those indices with low len bits equal to huff */
+ incr = 1 << (len - drop);
+ fill = 1 << curr;
+ min = fill; /* save offset to next table */
+ do {
+ fill -= incr;
+ table[next + (huff >> drop) + fill] = (here_bits << 24) | (here_op << 16) | here_val |0;
+ } while (fill !== 0);
+
+ /* backwards increment the len-bit code huff */
+ incr = 1 << (len - 1);
+ while (huff & incr) {
+ incr >>= 1;
+ }
+ if (incr !== 0) {
+ huff &= incr - 1;
+ huff += incr;
+ } else {
+ huff = 0;
+ }
+
+ /* go to next symbol, update count, len */
+ sym++;
+ if (--count[len] === 0) {
+ if (len === max) { break; }
+ len = lens[lens_index + work[sym]];
+ }
+
+ /* create new sub-table if needed */
+ if (len > root && (huff & mask) !== low) {
+ /* if first time, transition to sub-tables */
+ if (drop === 0) {
+ drop = root;
+ }
+
+ /* increment past last table */
+ next += min; /* here min is 1 << curr */
+
+ /* determine length of next table */
+ curr = len - drop;
+ left = 1 << curr;
+ while (curr + drop < max) {
+ left -= count[curr + drop];
+ if (left <= 0) { break; }
+ curr++;
+ left <<= 1;
+ }
+
+ /* check for enough space */
+ used += 1 << curr;
+ if ((type === LENS && used > ENOUGH_LENS) ||
+ (type === DISTS && used > ENOUGH_DISTS)) {
+ return 1;
+ }
+
+ /* point entry in root table to sub-table */
+ low = huff & mask;
+ /*table.op[low] = curr;
+ table.bits[low] = root;
+ table.val[low] = next - opts.table_index;*/
+ table[low] = (root << 24) | (curr << 16) | (next - table_index) |0;
+ }
+ }
+
+ /* fill in remaining table entry if code is incomplete (guaranteed to have
+ at most one remaining entry, since if the code is incomplete, the
+ maximum code length that was allowed to get this far is one bit) */
+ if (huff !== 0) {
+ //table.op[next + huff] = 64; /* invalid code marker */
+ //table.bits[next + huff] = len - drop;
+ //table.val[next + huff] = 0;
+ table[next + huff] = ((len - drop) << 24) | (64 << 16) |0;
+ }
+
+ /* set return parameters */
+ //opts.table_index += used;
+ opts.bits = root;
+ return 0;
+};
diff --git a/node_modules/pako/lib/zlib/messages.js b/node_modules/pako/lib/zlib/messages.js
new file mode 100644
index 0000000000000000000000000000000000000000..426daec6b6ec21f5fddebecfc548b5609ebc7973
--- /dev/null
+++ b/node_modules/pako/lib/zlib/messages.js
@@ -0,0 +1,32 @@
+'use strict';
+
+// (C) 1995-2013 Jean-loup Gailly and Mark Adler
+// (C) 2014-2017 Vitaly Puzrin and Andrey Tupitsin
+//
+// This software is provided 'as-is', without any express or implied
+// warranty. In no event will the authors be held liable for any damages
+// arising from the use of this software.
+//
+// Permission is granted to anyone to use this software for any purpose,
+// including commercial applications, and to alter it and redistribute it
+// freely, subject to the following restrictions:
+//
+// 1. The origin of this software must not be misrepresented; you must not
+// claim that you wrote the original software. If you use this software
+// in a product, an acknowledgment in the product documentation would be
+// appreciated but is not required.
+// 2. Altered source versions must be plainly marked as such, and must not be
+// misrepresented as being the original software.
+// 3. This notice may not be removed or altered from any source distribution.
+
+module.exports = {
+ 2: 'need dictionary', /* Z_NEED_DICT 2 */
+ 1: 'stream end', /* Z_STREAM_END 1 */
+ 0: '', /* Z_OK 0 */
+ '-1': 'file error', /* Z_ERRNO (-1) */
+ '-2': 'stream error', /* Z_STREAM_ERROR (-2) */
+ '-3': 'data error', /* Z_DATA_ERROR (-3) */
+ '-4': 'insufficient memory', /* Z_MEM_ERROR (-4) */
+ '-5': 'buffer error', /* Z_BUF_ERROR (-5) */
+ '-6': 'incompatible version' /* Z_VERSION_ERROR (-6) */
+};
diff --git a/node_modules/pako/lib/zlib/trees.js b/node_modules/pako/lib/zlib/trees.js
new file mode 100644
index 0000000000000000000000000000000000000000..aaf15dba626651e04d56e07750c1b6f514265b14
--- /dev/null
+++ b/node_modules/pako/lib/zlib/trees.js
@@ -0,0 +1,1222 @@
+'use strict';
+
+// (C) 1995-2013 Jean-loup Gailly and Mark Adler
+// (C) 2014-2017 Vitaly Puzrin and Andrey Tupitsin
+//
+// This software is provided 'as-is', without any express or implied
+// warranty. In no event will the authors be held liable for any damages
+// arising from the use of this software.
+//
+// Permission is granted to anyone to use this software for any purpose,
+// including commercial applications, and to alter it and redistribute it
+// freely, subject to the following restrictions:
+//
+// 1. The origin of this software must not be misrepresented; you must not
+// claim that you wrote the original software. If you use this software
+// in a product, an acknowledgment in the product documentation would be
+// appreciated but is not required.
+// 2. Altered source versions must be plainly marked as such, and must not be
+// misrepresented as being the original software.
+// 3. This notice may not be removed or altered from any source distribution.
+
+/* eslint-disable space-unary-ops */
+
+var utils = require('../utils/common');
+
+/* Public constants ==========================================================*/
+/* ===========================================================================*/
+
+
+//var Z_FILTERED = 1;
+//var Z_HUFFMAN_ONLY = 2;
+//var Z_RLE = 3;
+var Z_FIXED = 4;
+//var Z_DEFAULT_STRATEGY = 0;
+
+/* Possible values of the data_type field (though see inflate()) */
+var Z_BINARY = 0;
+var Z_TEXT = 1;
+//var Z_ASCII = 1; // = Z_TEXT
+var Z_UNKNOWN = 2;
+
+/*============================================================================*/
+
+
+function zero(buf) { var len = buf.length; while (--len >= 0) { buf[len] = 0; } }
+
+// From zutil.h
+
+var STORED_BLOCK = 0;
+var STATIC_TREES = 1;
+var DYN_TREES = 2;
+/* The three kinds of block type */
+
+var MIN_MATCH = 3;
+var MAX_MATCH = 258;
+/* The minimum and maximum match lengths */
+
+// From deflate.h
+/* ===========================================================================
+ * Internal compression state.
+ */
+
+var LENGTH_CODES = 29;
+/* number of length codes, not counting the special END_BLOCK code */
+
+var LITERALS = 256;
+/* number of literal bytes 0..255 */
+
+var L_CODES = LITERALS + 1 + LENGTH_CODES;
+/* number of Literal or Length codes, including the END_BLOCK code */
+
+var D_CODES = 30;
+/* number of distance codes */
+
+var BL_CODES = 19;
+/* number of codes used to transfer the bit lengths */
+
+var HEAP_SIZE = 2 * L_CODES + 1;
+/* maximum heap size */
+
+var MAX_BITS = 15;
+/* All codes must not exceed MAX_BITS bits */
+
+var Buf_size = 16;
+/* size of bit buffer in bi_buf */
+
+
+/* ===========================================================================
+ * Constants
+ */
+
+var MAX_BL_BITS = 7;
+/* Bit length codes must not exceed MAX_BL_BITS bits */
+
+var END_BLOCK = 256;
+/* end of block literal code */
+
+var REP_3_6 = 16;
+/* repeat previous bit length 3-6 times (2 bits of repeat count) */
+
+var REPZ_3_10 = 17;
+/* repeat a zero length 3-10 times (3 bits of repeat count) */
+
+var REPZ_11_138 = 18;
+/* repeat a zero length 11-138 times (7 bits of repeat count) */
+
+/* eslint-disable comma-spacing,array-bracket-spacing */
+var extra_lbits = /* extra bits for each length code */
+ [0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0];
+
+var extra_dbits = /* extra bits for each distance code */
+ [0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13];
+
+var extra_blbits = /* extra bits for each bit length code */
+ [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7];
+
+var bl_order =
+ [16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15];
+/* eslint-enable comma-spacing,array-bracket-spacing */
+
+/* The lengths of the bit length codes are sent in order of decreasing
+ * probability, to avoid transmitting the lengths for unused bit length codes.
+ */
+
+/* ===========================================================================
+ * Local data. These are initialized only once.
+ */
+
+// We pre-fill arrays with 0 to avoid uninitialized gaps
+
+var DIST_CODE_LEN = 512; /* see definition of array dist_code below */
+
+// !!!! Use flat array instead of structure, Freq = i*2, Len = i*2+1
+var static_ltree = new Array((L_CODES + 2) * 2);
+zero(static_ltree);
+/* The static literal tree. Since the bit lengths are imposed, there is no
+ * need for the L_CODES extra codes used during heap construction. However
+ * The codes 286 and 287 are needed to build a canonical tree (see _tr_init
+ * below).
+ */
+
+var static_dtree = new Array(D_CODES * 2);
+zero(static_dtree);
+/* The static distance tree. (Actually a trivial tree since all codes use
+ * 5 bits.)
+ */
+
+var _dist_code = new Array(DIST_CODE_LEN);
+zero(_dist_code);
+/* Distance codes. The first 256 values correspond to the distances
+ * 3 .. 258, the last 256 values correspond to the top 8 bits of
+ * the 15 bit distances.
+ */
+
+var _length_code = new Array(MAX_MATCH - MIN_MATCH + 1);
+zero(_length_code);
+/* length code for each normalized match length (0 == MIN_MATCH) */
+
+var base_length = new Array(LENGTH_CODES);
+zero(base_length);
+/* First normalized length for each code (0 = MIN_MATCH) */
+
+var base_dist = new Array(D_CODES);
+zero(base_dist);
+/* First normalized distance for each code (0 = distance of 1) */
+
+
+function StaticTreeDesc(static_tree, extra_bits, extra_base, elems, max_length) {
+
+ this.static_tree = static_tree; /* static tree or NULL */
+ this.extra_bits = extra_bits; /* extra bits for each code or NULL */
+ this.extra_base = extra_base; /* base index for extra_bits */
+ this.elems = elems; /* max number of elements in the tree */
+ this.max_length = max_length; /* max bit length for the codes */
+
+ // show if `static_tree` has data or dummy - needed for monomorphic objects
+ this.has_stree = static_tree && static_tree.length;
+}
+
+
+var static_l_desc;
+var static_d_desc;
+var static_bl_desc;
+
+
+function TreeDesc(dyn_tree, stat_desc) {
+ this.dyn_tree = dyn_tree; /* the dynamic tree */
+ this.max_code = 0; /* largest code with non zero frequency */
+ this.stat_desc = stat_desc; /* the corresponding static tree */
+}
+
+
+
+function d_code(dist) {
+ return dist < 256 ? _dist_code[dist] : _dist_code[256 + (dist >>> 7)];
+}
+
+
+/* ===========================================================================
+ * Output a short LSB first on the stream.
+ * IN assertion: there is enough room in pendingBuf.
+ */
+function put_short(s, w) {
+// put_byte(s, (uch)((w) & 0xff));
+// put_byte(s, (uch)((ush)(w) >> 8));
+ s.pending_buf[s.pending++] = (w) & 0xff;
+ s.pending_buf[s.pending++] = (w >>> 8) & 0xff;
+}
+
+
+/* ===========================================================================
+ * Send a value on a given number of bits.
+ * IN assertion: length <= 16 and value fits in length bits.
+ */
+function send_bits(s, value, length) {
+ if (s.bi_valid > (Buf_size - length)) {
+ s.bi_buf |= (value << s.bi_valid) & 0xffff;
+ put_short(s, s.bi_buf);
+ s.bi_buf = value >> (Buf_size - s.bi_valid);
+ s.bi_valid += length - Buf_size;
+ } else {
+ s.bi_buf |= (value << s.bi_valid) & 0xffff;
+ s.bi_valid += length;
+ }
+}
+
+
+function send_code(s, c, tree) {
+ send_bits(s, tree[c * 2]/*.Code*/, tree[c * 2 + 1]/*.Len*/);
+}
+
+
+/* ===========================================================================
+ * Reverse the first len bits of a code, using straightforward code (a faster
+ * method would use a table)
+ * IN assertion: 1 <= len <= 15
+ */
+function bi_reverse(code, len) {
+ var res = 0;
+ do {
+ res |= code & 1;
+ code >>>= 1;
+ res <<= 1;
+ } while (--len > 0);
+ return res >>> 1;
+}
+
+
+/* ===========================================================================
+ * Flush the bit buffer, keeping at most 7 bits in it.
+ */
+function bi_flush(s) {
+ if (s.bi_valid === 16) {
+ put_short(s, s.bi_buf);
+ s.bi_buf = 0;
+ s.bi_valid = 0;
+
+ } else if (s.bi_valid >= 8) {
+ s.pending_buf[s.pending++] = s.bi_buf & 0xff;
+ s.bi_buf >>= 8;
+ s.bi_valid -= 8;
+ }
+}
+
+
+/* ===========================================================================
+ * Compute the optimal bit lengths for a tree and update the total bit length
+ * for the current block.
+ * IN assertion: the fields freq and dad are set, heap[heap_max] and
+ * above are the tree nodes sorted by increasing frequency.
+ * OUT assertions: the field len is set to the optimal bit length, the
+ * array bl_count contains the frequencies for each bit length.
+ * The length opt_len is updated; static_len is also updated if stree is
+ * not null.
+ */
+function gen_bitlen(s, desc)
+// deflate_state *s;
+// tree_desc *desc; /* the tree descriptor */
+{
+ var tree = desc.dyn_tree;
+ var max_code = desc.max_code;
+ var stree = desc.stat_desc.static_tree;
+ var has_stree = desc.stat_desc.has_stree;
+ var extra = desc.stat_desc.extra_bits;
+ var base = desc.stat_desc.extra_base;
+ var max_length = desc.stat_desc.max_length;
+ var h; /* heap index */
+ var n, m; /* iterate over the tree elements */
+ var bits; /* bit length */
+ var xbits; /* extra bits */
+ var f; /* frequency */
+ var overflow = 0; /* number of elements with bit length too large */
+
+ for (bits = 0; bits <= MAX_BITS; bits++) {
+ s.bl_count[bits] = 0;
+ }
+
+ /* In a first pass, compute the optimal bit lengths (which may
+ * overflow in the case of the bit length tree).
+ */
+ tree[s.heap[s.heap_max] * 2 + 1]/*.Len*/ = 0; /* root of the heap */
+
+ for (h = s.heap_max + 1; h < HEAP_SIZE; h++) {
+ n = s.heap[h];
+ bits = tree[tree[n * 2 + 1]/*.Dad*/ * 2 + 1]/*.Len*/ + 1;
+ if (bits > max_length) {
+ bits = max_length;
+ overflow++;
+ }
+ tree[n * 2 + 1]/*.Len*/ = bits;
+ /* We overwrite tree[n].Dad which is no longer needed */
+
+ if (n > max_code) { continue; } /* not a leaf node */
+
+ s.bl_count[bits]++;
+ xbits = 0;
+ if (n >= base) {
+ xbits = extra[n - base];
+ }
+ f = tree[n * 2]/*.Freq*/;
+ s.opt_len += f * (bits + xbits);
+ if (has_stree) {
+ s.static_len += f * (stree[n * 2 + 1]/*.Len*/ + xbits);
+ }
+ }
+ if (overflow === 0) { return; }
+
+ // Trace((stderr,"\nbit length overflow\n"));
+ /* This happens for example on obj2 and pic of the Calgary corpus */
+
+ /* Find the first bit length which could increase: */
+ do {
+ bits = max_length - 1;
+ while (s.bl_count[bits] === 0) { bits--; }
+ s.bl_count[bits]--; /* move one leaf down the tree */
+ s.bl_count[bits + 1] += 2; /* move one overflow item as its brother */
+ s.bl_count[max_length]--;
+ /* The brother of the overflow item also moves one step up,
+ * but this does not affect bl_count[max_length]
+ */
+ overflow -= 2;
+ } while (overflow > 0);
+
+ /* Now recompute all bit lengths, scanning in increasing frequency.
+ * h is still equal to HEAP_SIZE. (It is simpler to reconstruct all
+ * lengths instead of fixing only the wrong ones. This idea is taken
+ * from 'ar' written by Haruhiko Okumura.)
+ */
+ for (bits = max_length; bits !== 0; bits--) {
+ n = s.bl_count[bits];
+ while (n !== 0) {
+ m = s.heap[--h];
+ if (m > max_code) { continue; }
+ if (tree[m * 2 + 1]/*.Len*/ !== bits) {
+ // Trace((stderr,"code %d bits %d->%d\n", m, tree[m].Len, bits));
+ s.opt_len += (bits - tree[m * 2 + 1]/*.Len*/) * tree[m * 2]/*.Freq*/;
+ tree[m * 2 + 1]/*.Len*/ = bits;
+ }
+ n--;
+ }
+ }
+}
+
+
+/* ===========================================================================
+ * Generate the codes for a given tree and bit counts (which need not be
+ * optimal).
+ * IN assertion: the array bl_count contains the bit length statistics for
+ * the given tree and the field len is set for all tree elements.
+ * OUT assertion: the field code is set for all tree elements of non
+ * zero code length.
+ */
+function gen_codes(tree, max_code, bl_count)
+// ct_data *tree; /* the tree to decorate */
+// int max_code; /* largest code with non zero frequency */
+// ushf *bl_count; /* number of codes at each bit length */
+{
+ var next_code = new Array(MAX_BITS + 1); /* next code value for each bit length */
+ var code = 0; /* running code value */
+ var bits; /* bit index */
+ var n; /* code index */
+
+ /* The distribution counts are first used to generate the code values
+ * without bit reversal.
+ */
+ for (bits = 1; bits <= MAX_BITS; bits++) {
+ next_code[bits] = code = (code + bl_count[bits - 1]) << 1;
+ }
+ /* Check that the bit counts in bl_count are consistent. The last code
+ * must be all ones.
+ */
+ //Assert (code + bl_count[MAX_BITS]-1 == (1< length code (0..28) */
+ length = 0;
+ for (code = 0; code < LENGTH_CODES - 1; code++) {
+ base_length[code] = length;
+ for (n = 0; n < (1 << extra_lbits[code]); n++) {
+ _length_code[length++] = code;
+ }
+ }
+ //Assert (length == 256, "tr_static_init: length != 256");
+ /* Note that the length 255 (match length 258) can be represented
+ * in two different ways: code 284 + 5 bits or code 285, so we
+ * overwrite length_code[255] to use the best encoding:
+ */
+ _length_code[length - 1] = code;
+
+ /* Initialize the mapping dist (0..32K) -> dist code (0..29) */
+ dist = 0;
+ for (code = 0; code < 16; code++) {
+ base_dist[code] = dist;
+ for (n = 0; n < (1 << extra_dbits[code]); n++) {
+ _dist_code[dist++] = code;
+ }
+ }
+ //Assert (dist == 256, "tr_static_init: dist != 256");
+ dist >>= 7; /* from now on, all distances are divided by 128 */
+ for (; code < D_CODES; code++) {
+ base_dist[code] = dist << 7;
+ for (n = 0; n < (1 << (extra_dbits[code] - 7)); n++) {
+ _dist_code[256 + dist++] = code;
+ }
+ }
+ //Assert (dist == 256, "tr_static_init: 256+dist != 512");
+
+ /* Construct the codes of the static literal tree */
+ for (bits = 0; bits <= MAX_BITS; bits++) {
+ bl_count[bits] = 0;
+ }
+
+ n = 0;
+ while (n <= 143) {
+ static_ltree[n * 2 + 1]/*.Len*/ = 8;
+ n++;
+ bl_count[8]++;
+ }
+ while (n <= 255) {
+ static_ltree[n * 2 + 1]/*.Len*/ = 9;
+ n++;
+ bl_count[9]++;
+ }
+ while (n <= 279) {
+ static_ltree[n * 2 + 1]/*.Len*/ = 7;
+ n++;
+ bl_count[7]++;
+ }
+ while (n <= 287) {
+ static_ltree[n * 2 + 1]/*.Len*/ = 8;
+ n++;
+ bl_count[8]++;
+ }
+ /* Codes 286 and 287 do not exist, but we must include them in the
+ * tree construction to get a canonical Huffman tree (longest code
+ * all ones)
+ */
+ gen_codes(static_ltree, L_CODES + 1, bl_count);
+
+ /* The static distance tree is trivial: */
+ for (n = 0; n < D_CODES; n++) {
+ static_dtree[n * 2 + 1]/*.Len*/ = 5;
+ static_dtree[n * 2]/*.Code*/ = bi_reverse(n, 5);
+ }
+
+ // Now data ready and we can init static trees
+ static_l_desc = new StaticTreeDesc(static_ltree, extra_lbits, LITERALS + 1, L_CODES, MAX_BITS);
+ static_d_desc = new StaticTreeDesc(static_dtree, extra_dbits, 0, D_CODES, MAX_BITS);
+ static_bl_desc = new StaticTreeDesc(new Array(0), extra_blbits, 0, BL_CODES, MAX_BL_BITS);
+
+ //static_init_done = true;
+}
+
+
+/* ===========================================================================
+ * Initialize a new block.
+ */
+function init_block(s) {
+ var n; /* iterates over tree elements */
+
+ /* Initialize the trees. */
+ for (n = 0; n < L_CODES; n++) { s.dyn_ltree[n * 2]/*.Freq*/ = 0; }
+ for (n = 0; n < D_CODES; n++) { s.dyn_dtree[n * 2]/*.Freq*/ = 0; }
+ for (n = 0; n < BL_CODES; n++) { s.bl_tree[n * 2]/*.Freq*/ = 0; }
+
+ s.dyn_ltree[END_BLOCK * 2]/*.Freq*/ = 1;
+ s.opt_len = s.static_len = 0;
+ s.last_lit = s.matches = 0;
+}
+
+
+/* ===========================================================================
+ * Flush the bit buffer and align the output on a byte boundary
+ */
+function bi_windup(s)
+{
+ if (s.bi_valid > 8) {
+ put_short(s, s.bi_buf);
+ } else if (s.bi_valid > 0) {
+ //put_byte(s, (Byte)s->bi_buf);
+ s.pending_buf[s.pending++] = s.bi_buf;
+ }
+ s.bi_buf = 0;
+ s.bi_valid = 0;
+}
+
+/* ===========================================================================
+ * Copy a stored block, storing first the length and its
+ * one's complement if requested.
+ */
+function copy_block(s, buf, len, header)
+//DeflateState *s;
+//charf *buf; /* the input data */
+//unsigned len; /* its length */
+//int header; /* true if block header must be written */
+{
+ bi_windup(s); /* align on byte boundary */
+
+ if (header) {
+ put_short(s, len);
+ put_short(s, ~len);
+ }
+// while (len--) {
+// put_byte(s, *buf++);
+// }
+ utils.arraySet(s.pending_buf, s.window, buf, len, s.pending);
+ s.pending += len;
+}
+
+/* ===========================================================================
+ * Compares to subtrees, using the tree depth as tie breaker when
+ * the subtrees have equal frequency. This minimizes the worst case length.
+ */
+function smaller(tree, n, m, depth) {
+ var _n2 = n * 2;
+ var _m2 = m * 2;
+ return (tree[_n2]/*.Freq*/ < tree[_m2]/*.Freq*/ ||
+ (tree[_n2]/*.Freq*/ === tree[_m2]/*.Freq*/ && depth[n] <= depth[m]));
+}
+
+/* ===========================================================================
+ * Restore the heap property by moving down the tree starting at node k,
+ * exchanging a node with the smallest of its two sons if necessary, stopping
+ * when the heap property is re-established (each father smaller than its
+ * two sons).
+ */
+function pqdownheap(s, tree, k)
+// deflate_state *s;
+// ct_data *tree; /* the tree to restore */
+// int k; /* node to move down */
+{
+ var v = s.heap[k];
+ var j = k << 1; /* left son of k */
+ while (j <= s.heap_len) {
+ /* Set j to the smallest of the two sons: */
+ if (j < s.heap_len &&
+ smaller(tree, s.heap[j + 1], s.heap[j], s.depth)) {
+ j++;
+ }
+ /* Exit if v is smaller than both sons */
+ if (smaller(tree, v, s.heap[j], s.depth)) { break; }
+
+ /* Exchange v with the smallest son */
+ s.heap[k] = s.heap[j];
+ k = j;
+
+ /* And continue down the tree, setting j to the left son of k */
+ j <<= 1;
+ }
+ s.heap[k] = v;
+}
+
+
+// inlined manually
+// var SMALLEST = 1;
+
+/* ===========================================================================
+ * Send the block data compressed using the given Huffman trees
+ */
+function compress_block(s, ltree, dtree)
+// deflate_state *s;
+// const ct_data *ltree; /* literal tree */
+// const ct_data *dtree; /* distance tree */
+{
+ var dist; /* distance of matched string */
+ var lc; /* match length or unmatched char (if dist == 0) */
+ var lx = 0; /* running index in l_buf */
+ var code; /* the code to send */
+ var extra; /* number of extra bits to send */
+
+ if (s.last_lit !== 0) {
+ do {
+ dist = (s.pending_buf[s.d_buf + lx * 2] << 8) | (s.pending_buf[s.d_buf + lx * 2 + 1]);
+ lc = s.pending_buf[s.l_buf + lx];
+ lx++;
+
+ if (dist === 0) {
+ send_code(s, lc, ltree); /* send a literal byte */
+ //Tracecv(isgraph(lc), (stderr," '%c' ", lc));
+ } else {
+ /* Here, lc is the match length - MIN_MATCH */
+ code = _length_code[lc];
+ send_code(s, code + LITERALS + 1, ltree); /* send the length code */
+ extra = extra_lbits[code];
+ if (extra !== 0) {
+ lc -= base_length[code];
+ send_bits(s, lc, extra); /* send the extra length bits */
+ }
+ dist--; /* dist is now the match distance - 1 */
+ code = d_code(dist);
+ //Assert (code < D_CODES, "bad d_code");
+
+ send_code(s, code, dtree); /* send the distance code */
+ extra = extra_dbits[code];
+ if (extra !== 0) {
+ dist -= base_dist[code];
+ send_bits(s, dist, extra); /* send the extra distance bits */
+ }
+ } /* literal or match pair ? */
+
+ /* Check that the overlay between pending_buf and d_buf+l_buf is ok: */
+ //Assert((uInt)(s->pending) < s->lit_bufsize + 2*lx,
+ // "pendingBuf overflow");
+
+ } while (lx < s.last_lit);
+ }
+
+ send_code(s, END_BLOCK, ltree);
+}
+
+
+/* ===========================================================================
+ * Construct one Huffman tree and assigns the code bit strings and lengths.
+ * Update the total bit length for the current block.
+ * IN assertion: the field freq is set for all tree elements.
+ * OUT assertions: the fields len and code are set to the optimal bit length
+ * and corresponding code. The length opt_len is updated; static_len is
+ * also updated if stree is not null. The field max_code is set.
+ */
+function build_tree(s, desc)
+// deflate_state *s;
+// tree_desc *desc; /* the tree descriptor */
+{
+ var tree = desc.dyn_tree;
+ var stree = desc.stat_desc.static_tree;
+ var has_stree = desc.stat_desc.has_stree;
+ var elems = desc.stat_desc.elems;
+ var n, m; /* iterate over heap elements */
+ var max_code = -1; /* largest code with non zero frequency */
+ var node; /* new node being created */
+
+ /* Construct the initial heap, with least frequent element in
+ * heap[SMALLEST]. The sons of heap[n] are heap[2*n] and heap[2*n+1].
+ * heap[0] is not used.
+ */
+ s.heap_len = 0;
+ s.heap_max = HEAP_SIZE;
+
+ for (n = 0; n < elems; n++) {
+ if (tree[n * 2]/*.Freq*/ !== 0) {
+ s.heap[++s.heap_len] = max_code = n;
+ s.depth[n] = 0;
+
+ } else {
+ tree[n * 2 + 1]/*.Len*/ = 0;
+ }
+ }
+
+ /* The pkzip format requires that at least one distance code exists,
+ * and that at least one bit should be sent even if there is only one
+ * possible code. So to avoid special checks later on we force at least
+ * two codes of non zero frequency.
+ */
+ while (s.heap_len < 2) {
+ node = s.heap[++s.heap_len] = (max_code < 2 ? ++max_code : 0);
+ tree[node * 2]/*.Freq*/ = 1;
+ s.depth[node] = 0;
+ s.opt_len--;
+
+ if (has_stree) {
+ s.static_len -= stree[node * 2 + 1]/*.Len*/;
+ }
+ /* node is 0 or 1 so it does not have extra bits */
+ }
+ desc.max_code = max_code;
+
+ /* The elements heap[heap_len/2+1 .. heap_len] are leaves of the tree,
+ * establish sub-heaps of increasing lengths:
+ */
+ for (n = (s.heap_len >> 1/*int /2*/); n >= 1; n--) { pqdownheap(s, tree, n); }
+
+ /* Construct the Huffman tree by repeatedly combining the least two
+ * frequent nodes.
+ */
+ node = elems; /* next internal node of the tree */
+ do {
+ //pqremove(s, tree, n); /* n = node of least frequency */
+ /*** pqremove ***/
+ n = s.heap[1/*SMALLEST*/];
+ s.heap[1/*SMALLEST*/] = s.heap[s.heap_len--];
+ pqdownheap(s, tree, 1/*SMALLEST*/);
+ /***/
+
+ m = s.heap[1/*SMALLEST*/]; /* m = node of next least frequency */
+
+ s.heap[--s.heap_max] = n; /* keep the nodes sorted by frequency */
+ s.heap[--s.heap_max] = m;
+
+ /* Create a new node father of n and m */
+ tree[node * 2]/*.Freq*/ = tree[n * 2]/*.Freq*/ + tree[m * 2]/*.Freq*/;
+ s.depth[node] = (s.depth[n] >= s.depth[m] ? s.depth[n] : s.depth[m]) + 1;
+ tree[n * 2 + 1]/*.Dad*/ = tree[m * 2 + 1]/*.Dad*/ = node;
+
+ /* and insert the new node in the heap */
+ s.heap[1/*SMALLEST*/] = node++;
+ pqdownheap(s, tree, 1/*SMALLEST*/);
+
+ } while (s.heap_len >= 2);
+
+ s.heap[--s.heap_max] = s.heap[1/*SMALLEST*/];
+
+ /* At this point, the fields freq and dad are set. We can now
+ * generate the bit lengths.
+ */
+ gen_bitlen(s, desc);
+
+ /* The field len is now set, we can generate the bit codes */
+ gen_codes(tree, max_code, s.bl_count);
+}
+
+
+/* ===========================================================================
+ * Scan a literal or distance tree to determine the frequencies of the codes
+ * in the bit length tree.
+ */
+function scan_tree(s, tree, max_code)
+// deflate_state *s;
+// ct_data *tree; /* the tree to be scanned */
+// int max_code; /* and its largest code of non zero frequency */
+{
+ var n; /* iterates over all tree elements */
+ var prevlen = -1; /* last emitted length */
+ var curlen; /* length of current code */
+
+ var nextlen = tree[0 * 2 + 1]/*.Len*/; /* length of next code */
+
+ var count = 0; /* repeat count of the current code */
+ var max_count = 7; /* max repeat count */
+ var min_count = 4; /* min repeat count */
+
+ if (nextlen === 0) {
+ max_count = 138;
+ min_count = 3;
+ }
+ tree[(max_code + 1) * 2 + 1]/*.Len*/ = 0xffff; /* guard */
+
+ for (n = 0; n <= max_code; n++) {
+ curlen = nextlen;
+ nextlen = tree[(n + 1) * 2 + 1]/*.Len*/;
+
+ if (++count < max_count && curlen === nextlen) {
+ continue;
+
+ } else if (count < min_count) {
+ s.bl_tree[curlen * 2]/*.Freq*/ += count;
+
+ } else if (curlen !== 0) {
+
+ if (curlen !== prevlen) { s.bl_tree[curlen * 2]/*.Freq*/++; }
+ s.bl_tree[REP_3_6 * 2]/*.Freq*/++;
+
+ } else if (count <= 10) {
+ s.bl_tree[REPZ_3_10 * 2]/*.Freq*/++;
+
+ } else {
+ s.bl_tree[REPZ_11_138 * 2]/*.Freq*/++;
+ }
+
+ count = 0;
+ prevlen = curlen;
+
+ if (nextlen === 0) {
+ max_count = 138;
+ min_count = 3;
+
+ } else if (curlen === nextlen) {
+ max_count = 6;
+ min_count = 3;
+
+ } else {
+ max_count = 7;
+ min_count = 4;
+ }
+ }
+}
+
+
+/* ===========================================================================
+ * Send a literal or distance tree in compressed form, using the codes in
+ * bl_tree.
+ */
+function send_tree(s, tree, max_code)
+// deflate_state *s;
+// ct_data *tree; /* the tree to be scanned */
+// int max_code; /* and its largest code of non zero frequency */
+{
+ var n; /* iterates over all tree elements */
+ var prevlen = -1; /* last emitted length */
+ var curlen; /* length of current code */
+
+ var nextlen = tree[0 * 2 + 1]/*.Len*/; /* length of next code */
+
+ var count = 0; /* repeat count of the current code */
+ var max_count = 7; /* max repeat count */
+ var min_count = 4; /* min repeat count */
+
+ /* tree[max_code+1].Len = -1; */ /* guard already set */
+ if (nextlen === 0) {
+ max_count = 138;
+ min_count = 3;
+ }
+
+ for (n = 0; n <= max_code; n++) {
+ curlen = nextlen;
+ nextlen = tree[(n + 1) * 2 + 1]/*.Len*/;
+
+ if (++count < max_count && curlen === nextlen) {
+ continue;
+
+ } else if (count < min_count) {
+ do { send_code(s, curlen, s.bl_tree); } while (--count !== 0);
+
+ } else if (curlen !== 0) {
+ if (curlen !== prevlen) {
+ send_code(s, curlen, s.bl_tree);
+ count--;
+ }
+ //Assert(count >= 3 && count <= 6, " 3_6?");
+ send_code(s, REP_3_6, s.bl_tree);
+ send_bits(s, count - 3, 2);
+
+ } else if (count <= 10) {
+ send_code(s, REPZ_3_10, s.bl_tree);
+ send_bits(s, count - 3, 3);
+
+ } else {
+ send_code(s, REPZ_11_138, s.bl_tree);
+ send_bits(s, count - 11, 7);
+ }
+
+ count = 0;
+ prevlen = curlen;
+ if (nextlen === 0) {
+ max_count = 138;
+ min_count = 3;
+
+ } else if (curlen === nextlen) {
+ max_count = 6;
+ min_count = 3;
+
+ } else {
+ max_count = 7;
+ min_count = 4;
+ }
+ }
+}
+
+
+/* ===========================================================================
+ * Construct the Huffman tree for the bit lengths and return the index in
+ * bl_order of the last bit length code to send.
+ */
+function build_bl_tree(s) {
+ var max_blindex; /* index of last bit length code of non zero freq */
+
+ /* Determine the bit length frequencies for literal and distance trees */
+ scan_tree(s, s.dyn_ltree, s.l_desc.max_code);
+ scan_tree(s, s.dyn_dtree, s.d_desc.max_code);
+
+ /* Build the bit length tree: */
+ build_tree(s, s.bl_desc);
+ /* opt_len now includes the length of the tree representations, except
+ * the lengths of the bit lengths codes and the 5+5+4 bits for the counts.
+ */
+
+ /* Determine the number of bit length codes to send. The pkzip format
+ * requires that at least 4 bit length codes be sent. (appnote.txt says
+ * 3 but the actual value used is 4.)
+ */
+ for (max_blindex = BL_CODES - 1; max_blindex >= 3; max_blindex--) {
+ if (s.bl_tree[bl_order[max_blindex] * 2 + 1]/*.Len*/ !== 0) {
+ break;
+ }
+ }
+ /* Update opt_len to include the bit length tree and counts */
+ s.opt_len += 3 * (max_blindex + 1) + 5 + 5 + 4;
+ //Tracev((stderr, "\ndyn trees: dyn %ld, stat %ld",
+ // s->opt_len, s->static_len));
+
+ return max_blindex;
+}
+
+
+/* ===========================================================================
+ * Send the header for a block using dynamic Huffman trees: the counts, the
+ * lengths of the bit length codes, the literal tree and the distance tree.
+ * IN assertion: lcodes >= 257, dcodes >= 1, blcodes >= 4.
+ */
+function send_all_trees(s, lcodes, dcodes, blcodes)
+// deflate_state *s;
+// int lcodes, dcodes, blcodes; /* number of codes for each tree */
+{
+ var rank; /* index in bl_order */
+
+ //Assert (lcodes >= 257 && dcodes >= 1 && blcodes >= 4, "not enough codes");
+ //Assert (lcodes <= L_CODES && dcodes <= D_CODES && blcodes <= BL_CODES,
+ // "too many codes");
+ //Tracev((stderr, "\nbl counts: "));
+ send_bits(s, lcodes - 257, 5); /* not +255 as stated in appnote.txt */
+ send_bits(s, dcodes - 1, 5);
+ send_bits(s, blcodes - 4, 4); /* not -3 as stated in appnote.txt */
+ for (rank = 0; rank < blcodes; rank++) {
+ //Tracev((stderr, "\nbl code %2d ", bl_order[rank]));
+ send_bits(s, s.bl_tree[bl_order[rank] * 2 + 1]/*.Len*/, 3);
+ }
+ //Tracev((stderr, "\nbl tree: sent %ld", s->bits_sent));
+
+ send_tree(s, s.dyn_ltree, lcodes - 1); /* literal tree */
+ //Tracev((stderr, "\nlit tree: sent %ld", s->bits_sent));
+
+ send_tree(s, s.dyn_dtree, dcodes - 1); /* distance tree */
+ //Tracev((stderr, "\ndist tree: sent %ld", s->bits_sent));
+}
+
+
+/* ===========================================================================
+ * Check if the data type is TEXT or BINARY, using the following algorithm:
+ * - TEXT if the two conditions below are satisfied:
+ * a) There are no non-portable control characters belonging to the
+ * "black list" (0..6, 14..25, 28..31).
+ * b) There is at least one printable character belonging to the
+ * "white list" (9 {TAB}, 10 {LF}, 13 {CR}, 32..255).
+ * - BINARY otherwise.
+ * - The following partially-portable control characters form a
+ * "gray list" that is ignored in this detection algorithm:
+ * (7 {BEL}, 8 {BS}, 11 {VT}, 12 {FF}, 26 {SUB}, 27 {ESC}).
+ * IN assertion: the fields Freq of dyn_ltree are set.
+ */
+function detect_data_type(s) {
+ /* black_mask is the bit mask of black-listed bytes
+ * set bits 0..6, 14..25, and 28..31
+ * 0xf3ffc07f = binary 11110011111111111100000001111111
+ */
+ var black_mask = 0xf3ffc07f;
+ var n;
+
+ /* Check for non-textual ("black-listed") bytes. */
+ for (n = 0; n <= 31; n++, black_mask >>>= 1) {
+ if ((black_mask & 1) && (s.dyn_ltree[n * 2]/*.Freq*/ !== 0)) {
+ return Z_BINARY;
+ }
+ }
+
+ /* Check for textual ("white-listed") bytes. */
+ if (s.dyn_ltree[9 * 2]/*.Freq*/ !== 0 || s.dyn_ltree[10 * 2]/*.Freq*/ !== 0 ||
+ s.dyn_ltree[13 * 2]/*.Freq*/ !== 0) {
+ return Z_TEXT;
+ }
+ for (n = 32; n < LITERALS; n++) {
+ if (s.dyn_ltree[n * 2]/*.Freq*/ !== 0) {
+ return Z_TEXT;
+ }
+ }
+
+ /* There are no "black-listed" or "white-listed" bytes:
+ * this stream either is empty or has tolerated ("gray-listed") bytes only.
+ */
+ return Z_BINARY;
+}
+
+
+var static_init_done = false;
+
+/* ===========================================================================
+ * Initialize the tree data structures for a new zlib stream.
+ */
+function _tr_init(s)
+{
+
+ if (!static_init_done) {
+ tr_static_init();
+ static_init_done = true;
+ }
+
+ s.l_desc = new TreeDesc(s.dyn_ltree, static_l_desc);
+ s.d_desc = new TreeDesc(s.dyn_dtree, static_d_desc);
+ s.bl_desc = new TreeDesc(s.bl_tree, static_bl_desc);
+
+ s.bi_buf = 0;
+ s.bi_valid = 0;
+
+ /* Initialize the first block of the first file: */
+ init_block(s);
+}
+
+
+/* ===========================================================================
+ * Send a stored block
+ */
+function _tr_stored_block(s, buf, stored_len, last)
+//DeflateState *s;
+//charf *buf; /* input block */
+//ulg stored_len; /* length of input block */
+//int last; /* one if this is the last block for a file */
+{
+ send_bits(s, (STORED_BLOCK << 1) + (last ? 1 : 0), 3); /* send block type */
+ copy_block(s, buf, stored_len, true); /* with header */
+}
+
+
+/* ===========================================================================
+ * Send one empty static block to give enough lookahead for inflate.
+ * This takes 10 bits, of which 7 may remain in the bit buffer.
+ */
+function _tr_align(s) {
+ send_bits(s, STATIC_TREES << 1, 3);
+ send_code(s, END_BLOCK, static_ltree);
+ bi_flush(s);
+}
+
+
+/* ===========================================================================
+ * Determine the best encoding for the current block: dynamic trees, static
+ * trees or store, and output the encoded block to the zip file.
+ */
+function _tr_flush_block(s, buf, stored_len, last)
+//DeflateState *s;
+//charf *buf; /* input block, or NULL if too old */
+//ulg stored_len; /* length of input block */
+//int last; /* one if this is the last block for a file */
+{
+ var opt_lenb, static_lenb; /* opt_len and static_len in bytes */
+ var max_blindex = 0; /* index of last bit length code of non zero freq */
+
+ /* Build the Huffman trees unless a stored block is forced */
+ if (s.level > 0) {
+
+ /* Check if the file is binary or text */
+ if (s.strm.data_type === Z_UNKNOWN) {
+ s.strm.data_type = detect_data_type(s);
+ }
+
+ /* Construct the literal and distance trees */
+ build_tree(s, s.l_desc);
+ // Tracev((stderr, "\nlit data: dyn %ld, stat %ld", s->opt_len,
+ // s->static_len));
+
+ build_tree(s, s.d_desc);
+ // Tracev((stderr, "\ndist data: dyn %ld, stat %ld", s->opt_len,
+ // s->static_len));
+ /* At this point, opt_len and static_len are the total bit lengths of
+ * the compressed block data, excluding the tree representations.
+ */
+
+ /* Build the bit length tree for the above two trees, and get the index
+ * in bl_order of the last bit length code to send.
+ */
+ max_blindex = build_bl_tree(s);
+
+ /* Determine the best encoding. Compute the block lengths in bytes. */
+ opt_lenb = (s.opt_len + 3 + 7) >>> 3;
+ static_lenb = (s.static_len + 3 + 7) >>> 3;
+
+ // Tracev((stderr, "\nopt %lu(%lu) stat %lu(%lu) stored %lu lit %u ",
+ // opt_lenb, s->opt_len, static_lenb, s->static_len, stored_len,
+ // s->last_lit));
+
+ if (static_lenb <= opt_lenb) { opt_lenb = static_lenb; }
+
+ } else {
+ // Assert(buf != (char*)0, "lost buf");
+ opt_lenb = static_lenb = stored_len + 5; /* force a stored block */
+ }
+
+ if ((stored_len + 4 <= opt_lenb) && (buf !== -1)) {
+ /* 4: two words for the lengths */
+
+ /* The test buf != NULL is only necessary if LIT_BUFSIZE > WSIZE.
+ * Otherwise we can't have processed more than WSIZE input bytes since
+ * the last block flush, because compression would have been
+ * successful. If LIT_BUFSIZE <= WSIZE, it is never too late to
+ * transform a block into a stored block.
+ */
+ _tr_stored_block(s, buf, stored_len, last);
+
+ } else if (s.strategy === Z_FIXED || static_lenb === opt_lenb) {
+
+ send_bits(s, (STATIC_TREES << 1) + (last ? 1 : 0), 3);
+ compress_block(s, static_ltree, static_dtree);
+
+ } else {
+ send_bits(s, (DYN_TREES << 1) + (last ? 1 : 0), 3);
+ send_all_trees(s, s.l_desc.max_code + 1, s.d_desc.max_code + 1, max_blindex + 1);
+ compress_block(s, s.dyn_ltree, s.dyn_dtree);
+ }
+ // Assert (s->compressed_len == s->bits_sent, "bad compressed size");
+ /* The above check is made mod 2^32, for files larger than 512 MB
+ * and uLong implemented on 32 bits.
+ */
+ init_block(s);
+
+ if (last) {
+ bi_windup(s);
+ }
+ // Tracev((stderr,"\ncomprlen %lu(%lu) ", s->compressed_len>>3,
+ // s->compressed_len-7*last));
+}
+
+/* ===========================================================================
+ * Save the match info and tally the frequency counts. Return true if
+ * the current block must be flushed.
+ */
+function _tr_tally(s, dist, lc)
+// deflate_state *s;
+// unsigned dist; /* distance of matched string */
+// unsigned lc; /* match length-MIN_MATCH or unmatched char (if dist==0) */
+{
+ //var out_length, in_length, dcode;
+
+ s.pending_buf[s.d_buf + s.last_lit * 2] = (dist >>> 8) & 0xff;
+ s.pending_buf[s.d_buf + s.last_lit * 2 + 1] = dist & 0xff;
+
+ s.pending_buf[s.l_buf + s.last_lit] = lc & 0xff;
+ s.last_lit++;
+
+ if (dist === 0) {
+ /* lc is the unmatched char */
+ s.dyn_ltree[lc * 2]/*.Freq*/++;
+ } else {
+ s.matches++;
+ /* Here, lc is the match length - MIN_MATCH */
+ dist--; /* dist = match distance - 1 */
+ //Assert((ush)dist < (ush)MAX_DIST(s) &&
+ // (ush)lc <= (ush)(MAX_MATCH-MIN_MATCH) &&
+ // (ush)d_code(dist) < (ush)D_CODES, "_tr_tally: bad match");
+
+ s.dyn_ltree[(_length_code[lc] + LITERALS + 1) * 2]/*.Freq*/++;
+ s.dyn_dtree[d_code(dist) * 2]/*.Freq*/++;
+ }
+
+// (!) This block is disabled in zlib defaults,
+// don't enable it for binary compatibility
+
+//#ifdef TRUNCATE_BLOCK
+// /* Try to guess if it is profitable to stop the current block here */
+// if ((s.last_lit & 0x1fff) === 0 && s.level > 2) {
+// /* Compute an upper bound for the compressed length */
+// out_length = s.last_lit*8;
+// in_length = s.strstart - s.block_start;
+//
+// for (dcode = 0; dcode < D_CODES; dcode++) {
+// out_length += s.dyn_dtree[dcode*2]/*.Freq*/ * (5 + extra_dbits[dcode]);
+// }
+// out_length >>>= 3;
+// //Tracev((stderr,"\nlast_lit %u, in %ld, out ~%ld(%ld%%) ",
+// // s->last_lit, in_length, out_length,
+// // 100L - out_length*100L/in_length));
+// if (s.matches < (s.last_lit>>1)/*int /2*/ && out_length < (in_length>>1)/*int /2*/) {
+// return true;
+// }
+// }
+//#endif
+
+ return (s.last_lit === s.lit_bufsize - 1);
+ /* We avoid equality with lit_bufsize because of wraparound at 64K
+ * on 16 bit machines and because stored blocks are restricted to
+ * 64K-1 bytes.
+ */
+}
+
+exports._tr_init = _tr_init;
+exports._tr_stored_block = _tr_stored_block;
+exports._tr_flush_block = _tr_flush_block;
+exports._tr_tally = _tr_tally;
+exports._tr_align = _tr_align;
diff --git a/node_modules/pako/lib/zlib/zstream.js b/node_modules/pako/lib/zlib/zstream.js
new file mode 100644
index 0000000000000000000000000000000000000000..122acfef0f720234db175fe5b9d6a9369d310d02
--- /dev/null
+++ b/node_modules/pako/lib/zlib/zstream.js
@@ -0,0 +1,47 @@
+'use strict';
+
+// (C) 1995-2013 Jean-loup Gailly and Mark Adler
+// (C) 2014-2017 Vitaly Puzrin and Andrey Tupitsin
+//
+// This software is provided 'as-is', without any express or implied
+// warranty. In no event will the authors be held liable for any damages
+// arising from the use of this software.
+//
+// Permission is granted to anyone to use this software for any purpose,
+// including commercial applications, and to alter it and redistribute it
+// freely, subject to the following restrictions:
+//
+// 1. The origin of this software must not be misrepresented; you must not
+// claim that you wrote the original software. If you use this software
+// in a product, an acknowledgment in the product documentation would be
+// appreciated but is not required.
+// 2. Altered source versions must be plainly marked as such, and must not be
+// misrepresented as being the original software.
+// 3. This notice may not be removed or altered from any source distribution.
+
+function ZStream() {
+ /* next input byte */
+ this.input = null; // JS specific, because we have no pointers
+ this.next_in = 0;
+ /* number of bytes available at input */
+ this.avail_in = 0;
+ /* total number of input bytes read so far */
+ this.total_in = 0;
+ /* next output byte should be put there */
+ this.output = null; // JS specific, because we have no pointers
+ this.next_out = 0;
+ /* remaining free space at output */
+ this.avail_out = 0;
+ /* total number of bytes output so far */
+ this.total_out = 0;
+ /* last error message, NULL if no error */
+ this.msg = ''/*Z_NULL*/;
+ /* not visible by applications */
+ this.state = null;
+ /* best guess about the data type: binary or text */
+ this.data_type = 2/*Z_UNKNOWN*/;
+ /* adler32 value of the uncompressed data */
+ this.adler = 0;
+}
+
+module.exports = ZStream;
diff --git a/node_modules/pako/package.json b/node_modules/pako/package.json
new file mode 100644
index 0000000000000000000000000000000000000000..7aaade84cf66707204ae18917d4e4fa1e4b911a7
--- /dev/null
+++ b/node_modules/pako/package.json
@@ -0,0 +1,44 @@
+{
+ "name": "pako",
+ "description": "zlib port to javascript - fast, modularized, with browser support",
+ "version": "1.0.11",
+ "keywords": [
+ "zlib",
+ "deflate",
+ "inflate",
+ "gzip"
+ ],
+ "homepage": "https://github.com/nodeca/pako",
+ "contributors": [
+ "Andrei Tuputcyn (https://github.com/andr83)",
+ "Vitaly Puzrin (https://github.com/puzrin)",
+ "Friedel Ziegelmayer (https://github.com/dignifiedquire)",
+ "Kirill Efimov (https://github.com/Kirill89)",
+ "Jean-loup Gailly",
+ "Mark Adler"
+ ],
+ "files": [
+ "index.js",
+ "dist/",
+ "lib/"
+ ],
+ "license": "(MIT AND Zlib)",
+ "repository": "nodeca/pako",
+ "scripts": {
+ "test": "make test"
+ },
+ "devDependencies": {
+ "ansi": "^0.3.1",
+ "benchmark": "^2.1.4",
+ "browserify": "^16.2.3",
+ "buffer-from": "^1.1.1",
+ "eslint": "^5.9.0",
+ "istanbul": "^0.4.5",
+ "mocha": "^5.2.0",
+ "multiparty": "^4.1.3",
+ "ndoc": "^5.0.1",
+ "uglify-js": "=3.4.8",
+ "zlibjs": "^0.3.1"
+ },
+ "dependencies": {}
+}
diff --git a/node_modules/parenthesis/LICENSE b/node_modules/parenthesis/LICENSE
new file mode 100644
index 0000000000000000000000000000000000000000..913af54347b9edd549edb21e0ed9d9cbb0cfd039
--- /dev/null
+++ b/node_modules/parenthesis/LICENSE
@@ -0,0 +1,8 @@
+The MIT License (MIT)
+Copyright © 2016 Dmitry Ivanov
+
+Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
\ No newline at end of file
diff --git a/node_modules/parenthesis/README.md b/node_modules/parenthesis/README.md
new file mode 100644
index 0000000000000000000000000000000000000000..5f16ce2f2728ce9bdca1d447077c32175d1f3aa5
--- /dev/null
+++ b/node_modules/parenthesis/README.md
@@ -0,0 +1,56 @@
+# parenthesis [](https://travis-ci.org/dy/parenthesis)
+
+Parse parentheses from a string, return folded arrays.
+
+[](https://npmjs.org/package/parenthesis/)
+
+
+```js
+var parse = require('parenthesis')
+
+// Parse into nested format
+parse('a(b[c{d}])')
+// ['a(', ['b[', ['c{', ['d'], '}'], ']'], ')']
+
+// Parse into flat format with cross-references
+parse('a(b[c{d}])', {
+ brackets: ['()'],
+ escape: '\\',
+ flat: true
+})
+// ['a(\\1)', 'b[c{d}]']
+
+
+// Stringify nested format
+parse.stringify(['a(', ['b[', ['c{', ['d'], '}'], ']'], ')'])
+// 'a(b[c{d}])'
+
+// Stringify flat format with cross-references
+parse.stringify(['a(\\1)', 'b[c{d}]'], {flat: true, escape: '\\'})
+// 'a(b[c{d}])'
+```
+
+## API
+
+### tokens = paren.parse(string, brackets|opts?)
+
+Return array with tokens.
+
+Option | Default | Meaning
+---|---|---
+`brackets` | `['{}', '[]', '()']` | Single brackets string or list of strings to detect brackets. Can be repeating brackets eg. `"" or ''`.
+`escape` | `'___'` | Escape prefix for flat references.
+`flat` | `false` | Return flat array instead of nested arrays.
+
+### str = paren.stringify(tokens, {flat}?)
+
+Stringify tokens back. Pass `{flat: true}` flag for flat tokens array.
+
+## Related
+
+* [balanced-match](http://npmjs.org/package/balanced-match)
+
+
+## License
+
+© 2018 Dmitry Yv. MIT License
diff --git a/node_modules/parenthesis/index.d.ts b/node_modules/parenthesis/index.d.ts
new file mode 100644
index 0000000000000000000000000000000000000000..3aeba3d81a05dee24e5296e257ff5bd39d24551d
--- /dev/null
+++ b/node_modules/parenthesis/index.d.ts
@@ -0,0 +1,46 @@
+declare module "parenthesis" {
+ namespace parens {
+ // One entry in the returned nested array
+ type Node = string | ArrayTree;
+ // A nested array of strings
+ interface ArrayTree extends Array {}
+ // Second-argument options used by the function
+ interface Opts {
+ // Single brackets string or list of strings to detect brackets. Can be repeating brackets eg. "" or ''.
+ brackets?: string | string[],
+ // Escape prefix for flat references.
+ escape?: string,
+ // `flat` is a boolean but since it affects return type, it's explicitly specified below
+ }
+
+ // Parse parentheses from a string, return folded arrays
+ function parse(
+ str: string,
+ opts?: string | string[] | (parens.Opts & { flat?: false })
+ ): parens.ArrayTree;
+ // Parse parentheses from a string, return flat array
+ function parse(
+ str: string,
+ opts: (parens.Opts & { flat: true })
+ ): string[];
+
+ // Stringify tokens back. Pass {flat: true} flag for flat tokens array.
+ function stringify(tokens: ArrayTree, opts?: {flat: boolean}): string;
+ }
+
+ // Parse parentheses from a string, return folded arrays
+ function parens(
+ str: string,
+ opts?: string | string[] | (parens.Opts & { flat?: false })
+ ): parens.ArrayTree;
+ // Parse parentheses from a string, return flat array
+ function parens(
+ str: string,
+ opts: (parens.Opts & { flat: true })
+ ): string[];
+ function parens(tokens: parens.ArrayTree, opts?: {flat: boolean}): string;
+
+ // imports via `import paren from "parenthesis", can call the export
+ // directly or use `paren.parse` / `paren.stringify`.
+ export = parens;
+}
diff --git a/node_modules/parenthesis/index.js b/node_modules/parenthesis/index.js
new file mode 100644
index 0000000000000000000000000000000000000000..e566418a303adbd1cabd0bee942d8096da0a310a
--- /dev/null
+++ b/node_modules/parenthesis/index.js
@@ -0,0 +1,135 @@
+'use strict'
+
+/**
+ * @module parenthesis
+ */
+
+function parse (str, opts) {
+ // pretend non-string parsed per-se
+ if (typeof str !== 'string') return [str]
+
+ var res = [str]
+
+ if (typeof opts === 'string' || Array.isArray(opts)) {
+ opts = {brackets: opts}
+ }
+ else if (!opts) opts = {}
+
+ var brackets = opts.brackets ? (Array.isArray(opts.brackets) ? opts.brackets : [opts.brackets]) : ['{}', '[]', '()']
+
+ var escape = opts.escape || '___'
+
+ var flat = !!opts.flat
+
+ brackets.forEach(function (bracket) {
+ // create parenthesis regex
+ var pRE = new RegExp(['\\', bracket[0], '[^\\', bracket[0], '\\', bracket[1], ']*\\', bracket[1]].join(''))
+
+ var ids = []
+
+ function replaceToken(token, idx, str){
+ // save token to res
+ var refId = res.push(token.slice(bracket[0].length, -bracket[1].length)) - 1
+
+ ids.push(refId)
+
+ return escape + refId + escape
+ }
+
+ res.forEach(function (str, i) {
+ var prevStr
+
+ // replace paren tokens till there’s none
+ var a = 0
+ while (str != prevStr) {
+ prevStr = str
+ str = str.replace(pRE, replaceToken)
+ if (a++ > 10e3) throw Error('References have circular dependency. Please, check them.')
+ }
+
+ res[i] = str
+ })
+
+ // wrap found refs to brackets
+ ids = ids.reverse()
+ res = res.map(function (str) {
+ ids.forEach(function (id) {
+ str = str.replace(new RegExp('(\\' + escape + id + '\\' + escape + ')', 'g'), bracket[0] + '$1' + bracket[1])
+ })
+ return str
+ })
+ })
+
+ var re = new RegExp('\\' + escape + '([0-9]+)' + '\\' + escape)
+
+ // transform references to tree
+ function nest (str, refs, escape) {
+ var res = [], match
+
+ var a = 0
+ while (match = re.exec(str)) {
+ if (a++ > 10e3) throw Error('Circular references in parenthesis')
+
+ res.push(str.slice(0, match.index))
+
+ res.push(nest(refs[match[1]], refs))
+
+ str = str.slice(match.index + match[0].length)
+ }
+
+ res.push(str)
+
+ return res
+ }
+
+ return flat ? res : nest(res[0], res)
+}
+
+function stringify (arg, opts) {
+ if (opts && opts.flat) {
+ var escape = opts && opts.escape || '___'
+
+ var str = arg[0], prevStr
+
+ // pretend bad string stringified with no parentheses
+ if (!str) return ''
+
+
+ var re = new RegExp('\\' + escape + '([0-9]+)' + '\\' + escape)
+
+ var a = 0
+ while (str != prevStr) {
+ if (a++ > 10e3) throw Error('Circular references in ' + arg)
+ prevStr = str
+ str = str.replace(re, replaceRef)
+ }
+
+ return str
+ }
+
+ return arg.reduce(function f (prev, curr) {
+ if (Array.isArray(curr)) {
+ curr = curr.reduce(f, '')
+ }
+ return prev + curr
+ }, '')
+
+ function replaceRef(match, idx){
+ if (arg[idx] == null) throw Error('Reference ' + idx + 'is undefined')
+ return arg[idx]
+ }
+}
+
+function parenthesis (arg, opts) {
+ if (Array.isArray(arg)) {
+ return stringify(arg, opts)
+ }
+ else {
+ return parse(arg, opts)
+ }
+}
+
+parenthesis.parse = parse
+parenthesis.stringify = stringify
+
+module.exports = parenthesis
diff --git a/node_modules/parenthesis/package.json b/node_modules/parenthesis/package.json
new file mode 100644
index 0000000000000000000000000000000000000000..0ba2a2f12ba1b9da851249581713eb255ee0881f
--- /dev/null
+++ b/node_modules/parenthesis/package.json
@@ -0,0 +1,46 @@
+{
+ "name": "parenthesis",
+ "version": "3.1.8",
+ "description": "Parse parentheses from a string",
+ "main": "index.js",
+ "scripts": {
+ "test": "node test.js",
+ "test:browser": "budo test.js"
+ },
+ "files": [
+ "index.js",
+ "index.d.ts"
+ ],
+ "repository": {
+ "type": "git",
+ "url": "git://github.com/dy/parenthesis.git"
+ },
+ "keywords": [
+ "paren",
+ "parenthesis",
+ "parse",
+ "brackets",
+ "parser",
+ "regexp",
+ "stringify",
+ "tokenizer",
+ "replace",
+ "csv",
+ "string"
+ ],
+ "author": {
+ "name": "Dmitry Yv",
+ "email": "df.creative@gmail.com",
+ "url": "http://github.com/dy"
+ },
+ "license": "MIT",
+ "bugs": {
+ "url": "https://github.com/dy/parenthesis/issues"
+ },
+ "homepage": "https://github.com/dy/parenthesis",
+ "devDependencies": {
+ "tape": "^4.9.0"
+ },
+ "dependencies": {},
+ "types": "index.d.ts"
+}
diff --git a/node_modules/parse-asn1/.eslintrc b/node_modules/parse-asn1/.eslintrc
new file mode 100644
index 0000000000000000000000000000000000000000..0bc0f455256afc0ba336f6d1d7acd44ec6180aed
--- /dev/null
+++ b/node_modules/parse-asn1/.eslintrc
@@ -0,0 +1,34 @@
+{
+ "root": true,
+
+ "extends": "@ljharb",
+
+ "rules": {
+ "camelcase": "off",
+ "func-style": "off",
+ "id-length": "off",
+ "max-lines-per-function": "off",
+ "multiline-comment-style": "off",
+ "no-negated-condition": "off",
+ "no-param-reassign": "warn",
+ "sort-keys": "off",
+ },
+
+ "overrides": [
+ {
+ "files": "./asn1.js",
+ "rules": {
+ "no-underscore-dangle": "off",
+ }
+ },
+ {
+ "files": [
+ "./asn1.js",
+ "./certificate.js",
+ ],
+ "rules": {
+ "no-invalid-this": "off",
+ }
+ },
+ ]
+}
diff --git a/node_modules/parse-asn1/.github/FUNDING.yml b/node_modules/parse-asn1/.github/FUNDING.yml
new file mode 100644
index 0000000000000000000000000000000000000000..b14fee5d5a0c0fa889dfa0db72f19041566aa9ab
--- /dev/null
+++ b/node_modules/parse-asn1/.github/FUNDING.yml
@@ -0,0 +1,12 @@
+# These are supported funding model platforms
+
+github: [ljharb]
+patreon: # Replace with a single Patreon username
+open_collective: # Replace with a single Open Collective username
+ko_fi: # Replace with a single Ko-fi username
+tidelift: npm/parse-asn1
+community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry
+liberapay: # Replace with a single Liberapay username
+issuehunt: # Replace with a single IssueHunt username
+otechie: # Replace with a single Otechie username
+custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2']
diff --git a/node_modules/parse-asn1/CHANGELOG.md b/node_modules/parse-asn1/CHANGELOG.md
new file mode 100644
index 0000000000000000000000000000000000000000..89c9edbb67abe12f6d67079dffccbcc2e2a2e30e
--- /dev/null
+++ b/node_modules/parse-asn1/CHANGELOG.md
@@ -0,0 +1,209 @@
+# Changelog
+
+All notable changes to this project will be documented in this file.
+
+The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
+and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
+
+## [v5.1.9](https://github.com/browserify/parse-asn1/compare/v5.1.8...v5.1.9) - 2025-09-24
+
+### Commits
+
+- [meta] node 0.10 works now [`4596fae`](https://github.com/browserify/parse-asn1/commit/4596fae4ba80df5db0f335a400fc53d22b307633)
+- [Deps] update `pbkdf2` [`6ef651a`](https://github.com/browserify/parse-asn1/commit/6ef651a9e6373e6e09c71330ea4a4cac4329c009)
+
+## [v5.1.8](https://github.com/browserify/parse-asn1/compare/v5.1.7...v5.1.8) - 2025-09-22
+
+### Commits
+
+- [actions] split out node 10-20, and 20+ [`e186dbf`](https://github.com/browserify/parse-asn1/commit/e186dbf58216c9013b560f3f9627347985abd202)
+- [meta] raise engines.node to match dep graph [`29d1def`](https://github.com/browserify/parse-asn1/commit/29d1defdaf3fc113069347a2edd284d118a73775)
+- [Dev Deps] update `@ljharb/eslint-config`, `auto-changelog`, `tape` [`2648018`](https://github.com/browserify/parse-asn1/commit/264801813422e4f88ba1834e40e026cdf6bf3f30)
+- [Deps] update `hash-base`, `pbkdf2` [`3ce78af`](https://github.com/browserify/parse-asn1/commit/3ce78af3720c95a71e1f264ebb20e8af63ad00bc)
+- [Tests] replace `aud` with `npm audit` [`5ea1506`](https://github.com/browserify/parse-asn1/commit/5ea1506b28cb7c4f976ddb89877c0fe92d183ec9)
+- [Tests] fix tests in node `4.0 - 4.4 | 5.0 - 5.9` [`4d24a07`](https://github.com/browserify/parse-asn1/commit/4d24a070402332083357da4edcacbee9d98e9dd5)
+- [meta] add proper `npm version` npmrc settings [`f5d7025`](https://github.com/browserify/parse-asn1/commit/f5d702582d762e96a7deb7338a398a32224e9424)
+- [Deps] remove unused `hash-base` dep [`93663af`](https://github.com/browserify/parse-asn1/commit/93663af2ba632c5a4c76847d410836ca8da3f00b)
+- [Dev Deps] add missing peer dep [`f3e9076`](https://github.com/browserify/parse-asn1/commit/f3e9076f00bd43bacc283979bfb3c390e8414580)
+
+## [v5.1.7](https://github.com/browserify/parse-asn1/compare/v5.1.6...v5.1.7) - 2024-03-05
+
+### Commits
+
+- [eslint] switch from standard to eslint [`794cf67`](https://github.com/browserify/parse-asn1/commit/794cf67208a69d4cc855f784a299906c6d6ef671)
+- [meta] add `auto-changelog` [`8961374`](https://github.com/browserify/parse-asn1/commit/89613740568d94746d45adf8d1af029922ab9d54)
+- [Tests] migrate from travis to github actions [`fdbdda5`](https://github.com/browserify/parse-asn1/commit/fdbdda5eeeaec0aeb8a740fa49deb449a47390ab)
+- [meta] fix package.json indentation [`60eb8f3`](https://github.com/browserify/parse-asn1/commit/60eb8f3e2bd9e91dca0e9fd5e617864cde35cb35)
+- [meta] switch from files to npmignore [`e41c881`](https://github.com/browserify/parse-asn1/commit/e41c881bf4cbf97609a82bfe4bfde4fdfcf54e39)
+- [Tests] Buffer.from requires node >= 4 [`0f9ba08`](https://github.com/browserify/parse-asn1/commit/0f9ba08be2b626fc4d8d01dd96916c1dbd6a8fb7)
+- [Deps] update `browserify-aes`, `evp_bytestokey`, `pbkdf2`, `safe-buffer` [`b5a64da`](https://github.com/browserify/parse-asn1/commit/b5a64da4651941980c91c04e9a4fae814c654aec)
+- Only apps should have lockfiles [`75803fd`](https://github.com/browserify/parse-asn1/commit/75803fda05246c4cf5cd968c5cc87494c03d3cf0)
+- [meta] add `safe-publish-latest` [`aba1931`](https://github.com/browserify/parse-asn1/commit/aba1931df788100a7ffaf6054e5b024caf3d9a23)
+- [Tests] use `aud` [`2a848f6`](https://github.com/browserify/parse-asn1/commit/2a848f6c55d84896a52dcb3bcb54be637e42886d)
+- [meta] add missing `engines.node` [`87e2bd3`](https://github.com/browserify/parse-asn1/commit/87e2bd3f9657ecb4fba7903a0c56305de273c3b6)
+- [Dev Deps] update `tape` [`50baf1c`](https://github.com/browserify/parse-asn1/commit/50baf1c6a4af51a3d4eac1d1508cda69f6f5252a)
+- [Deps] downgrade `asn1.js` to v4 since v5 drops support for node < 4 [`f230870`](https://github.com/browserify/parse-asn1/commit/f23087045497c93bd0a151e29b1e3f738e898cb8)
+- [Deps] pin `hash-base` to ~3.0, due to a breaking change [`f15dc5f`](https://github.com/browserify/parse-asn1/commit/f15dc5f12898fd955ef27d037ba649724f6c5e17)
+
+## [v5.1.6](https://github.com/browserify/parse-asn1/compare/v5.1.5...v5.1.6) - 2020-08-11
+
+### Merged
+
+- update asn1 [`#37`](https://github.com/browserify/parse-asn1/pull/37)
+- remove 'create-hash' dependency [`#40`](https://github.com/browserify/parse-asn1/pull/40)
+
+### Commits
+
+- fix more deps [`8ebb8a3`](https://github.com/browserify/parse-asn1/commit/8ebb8a3c7aaabd25c90f64cb7304c961ba55cf1d)
+
+## [v5.1.5](https://github.com/browserify/parse-asn1/compare/v5.1.4...v5.1.5) - 2019-09-18
+
+### Merged
+
+- Improving published files [`#38`](https://github.com/browserify/parse-asn1/pull/38)
+
+## [v5.1.4](https://github.com/browserify/parse-asn1/compare/v5.1.3...v5.1.4) - 2019-02-14
+
+### Fixed
+
+- fixes #35, regex work for pems without linebreaks [`#35`](https://github.com/browserify/parse-asn1/issues/35)
+
+## [v5.1.3](https://github.com/browserify/parse-asn1/compare/v5.1.2...v5.1.3) - 2019-01-17
+
+### Commits
+
+- rm const [`635d530`](https://github.com/browserify/parse-asn1/commit/635d530a4e29e07ac89814ef9e2a8de1f7c002ed)
+
+## [v5.1.2](https://github.com/browserify/parse-asn1/compare/v5.1.1...v5.1.2) - 2019-01-17
+
+### Merged
+
+- Safe buffer [`#30`](https://github.com/browserify/parse-asn1/pull/30)
+- Add curve as parameter to certificate algorithm [`#28`](https://github.com/browserify/parse-asn1/pull/28)
+
+### Commits
+
+- version is optional [`97ca375`](https://github.com/browserify/parse-asn1/commit/97ca3751f2c6b928f26fbc6558823042df7bec5d)
+
+## [v5.1.1](https://github.com/browserify/parse-asn1/compare/v5.1.0...v5.1.1) - 2018-04-11
+
+### Merged
+
+- Create LICENSE [`#27`](https://github.com/browserify/parse-asn1/pull/27)
+- make fixproc compliant with common newline conventions [`#22`](https://github.com/browserify/parse-asn1/pull/22)
+
+### Commits
+
+- Update README.md [`19789cd`](https://github.com/browserify/parse-asn1/commit/19789cdbd5f529351e2477fae4961d996fbc11a1)
+
+## [v5.1.0](https://github.com/browserify/parse-asn1/compare/v5.0.0...v5.1.0) - 2017-03-13
+
+### Merged
+
+- add description [`#20`](https://github.com/browserify/parse-asn1/pull/20)
+- Cert parsing [`#6`](https://github.com/browserify/parse-asn1/pull/6)
+
+### Commits
+
+- fix formatting [`febc75d`](https://github.com/browserify/parse-asn1/commit/febc75d6ae3e995ab28d4b1d3e5a040cdd1afb28)
+- merge [`5e306be`](https://github.com/browserify/parse-asn1/commit/5e306be93671655c518569868066f53c9b298b62)
+- fix style [`6131733`](https://github.com/browserify/parse-asn1/commit/6131733f2cea84ca6394e3e6bfe2040daf7eae66)
+- cert parsing [`e571b18`](https://github.com/browserify/parse-asn1/commit/e571b18bf516bcd47c6a5699767ac27398a8e0df)
+- update deps [`eab3500`](https://github.com/browserify/parse-asn1/commit/eab3500f62ddec3491e28c47dcfeb1e54459b747)
+- iter stuff [`00b030c`](https://github.com/browserify/parse-asn1/commit/00b030c2d304ca3a003591abdd10a6e7ef2ce68d)
+- credit [`c94dba3`](https://github.com/browserify/parse-asn1/commit/c94dba391223af0b72687868f88049bb0dfcb276)
+
+## [v5.0.0](https://github.com/browserify/parse-asn1/compare/v4.0.0...v5.0.0) - 2015-10-29
+
+### Merged
+
+- bump asn1.js [`#17`](https://github.com/browserify/parse-asn1/pull/17)
+
+## [v4.0.0](https://github.com/browserify/parse-asn1/compare/v3.0.2...v4.0.0) - 2015-10-26
+
+### Merged
+
+- bump bn [`#16`](https://github.com/browserify/parse-asn1/pull/16)
+
+## [v3.0.2](https://github.com/browserify/parse-asn1/compare/v3.0.1...v3.0.2) - 2015-09-28
+
+### Merged
+
+- pull out evp [`#15`](https://github.com/browserify/parse-asn1/pull/15)
+- evp: simplify overall logic [`#12`](https://github.com/browserify/parse-asn1/pull/12)
+
+### Fixed
+
+- adds .travis.yml, resolves #14 [`#14`](https://github.com/browserify/parse-asn1/issues/14)
+
+### Commits
+
+- standard [`10d65d0`](https://github.com/browserify/parse-asn1/commit/10d65d07202941a94ef914d883939d318bbbe33d)
+- evp: standard-ish formatting [`be4e43d`](https://github.com/browserify/parse-asn1/commit/be4e43d8ca8a766ef77caf724e7204b3e299d601)
+- evp: improve variable names [`080e62b`](https://github.com/browserify/parse-asn1/commit/080e62bdb1d3dde124ff736a7767cfaa6e4d71db)
+- evp: simplify md_buf logic [`ed059dd`](https://github.com/browserify/parse-asn1/commit/ed059dd60802651722a3e7f7470bbc323b255c99)
+- add badges [`ed3184d`](https://github.com/browserify/parse-asn1/commit/ed3184d7b189e32b3fec3d66de98b0676e10e11b)
+- evp: remove unused ii, avoid inline expressions [`8058c1e`](https://github.com/browserify/parse-asn1/commit/8058c1ec4f39cfea4bb9fdfd81b675e063e28d1d)
+- adds standard and travis targets [`e663708`](https://github.com/browserify/parse-asn1/commit/e66370856e1e20c4b3aa3089734a418b1a752d5e)
+- evp: remove another semicolon [`7e1b6e5`](https://github.com/browserify/parse-asn1/commit/7e1b6e5fdb4781497262aa18939b31b2dbffbadd)
+- evp: remove semicolon [`403330f`](https://github.com/browserify/parse-asn1/commit/403330fb5768c3572b2d3f45a4f003cadac541bf)
+- Rename readme.md to README.md [`cf240ae`](https://github.com/browserify/parse-asn1/commit/cf240ae3283df6afd5aa5bc8e4e7922e8ce0aed2)
+
+## [v3.0.1](https://github.com/browserify/parse-asn1/compare/v3.0.0...v3.0.1) - 2015-05-20
+
+### Merged
+
+- Upgrade deps [`#9`](https://github.com/browserify/parse-asn1/pull/9)
+- pbkdf2 [`#5`](https://github.com/browserify/parse-asn1/pull/5)
+- fixProc: simplify wrap [`#10`](https://github.com/browserify/parse-asn1/pull/10)
+
+### Fixed
+
+- switch line breaks to \r?\n instead of \n\r? fixes #7 [`#7`](https://github.com/browserify/parse-asn1/issues/7)
+
+### Commits
+
+- deal with iterations not being an integer [`c4aee9e`](https://github.com/browserify/parse-asn1/commit/c4aee9e971dac0b7cf9c125e563957cb4c5f2a05)
+- update asn1.js [`92214f6`](https://github.com/browserify/parse-asn1/commit/92214f60a33f761fb97989e29f1d1588968aa621)
+- update repo location [`5e7960a`](https://github.com/browserify/parse-asn1/commit/5e7960a19eab30468dbc6442bf0fce89d1d26e75)
+- Add coverage directory to .npmignore. [`0d11c15`](https://github.com/browserify/parse-asn1/commit/0d11c15d7b2f1dea6243991e5bd98fe6057a80d7)
+- rn .npmignore to .gitignore [`a9abb96`](https://github.com/browserify/parse-asn1/commit/a9abb96008289c241c3372151ac06a8e43a4343e)
+
+## [v3.0.0](https://github.com/browserify/parse-asn1/compare/v2.0.0...v3.0.0) - 2015-01-28
+
+### Commits
+
+- add tests, remove dep [`b6ecaa2`](https://github.com/browserify/parse-asn1/commit/b6ecaa2ebca59d3ee9718fcc6515d7215a1bb89a)
+- clean up [`dd84475`](https://github.com/browserify/parse-asn1/commit/dd84475f02741ebc08bed3fc02d36e6d0c1dde7e)
+- make modularized [`7059346`](https://github.com/browserify/parse-asn1/commit/7059346a4b74e3b732151174c26d7eb547acba47)
+
+## [v2.0.0](https://github.com/browserify/parse-asn1/compare/v1.2.1...v2.0.0) - 2015-01-06
+
+### Commits
+
+- Update asn1.js and bn.js to 1.0 [`9ab8411`](https://github.com/browserify/parse-asn1/commit/9ab8411d7fb489f9d5cde08efdd9ec041a11c99c)
+
+## [v1.2.1](https://github.com/browserify/parse-asn1/compare/v1.2.0...v1.2.1) - 2015-01-04
+
+### Merged
+
+- Update asn1.js [`#1`](https://github.com/browserify/parse-asn1/pull/1)
+
+## [v1.2.0](https://github.com/browserify/parse-asn1/compare/v1.1.0...v1.2.0) - 2014-12-18
+
+### Commits
+
+- varient version of passwords [`e1eef0b`](https://github.com/browserify/parse-asn1/commit/e1eef0b1d5534e7f0f08caf4242e0dda274882d5)
+
+## [v1.1.0](https://github.com/browserify/parse-asn1/compare/v1.0.1...v1.1.0) - 2014-12-18
+
+### Commits
+
+- updates for dsa [`f1e82d2`](https://github.com/browserify/parse-asn1/commit/f1e82d2b61723ea17b8cd86eef5cbed3b0e4658c)
+
+## v1.0.1 - 2014-12-16
+
+### Commits
+
+- first [`6cfeecb`](https://github.com/browserify/parse-asn1/commit/6cfeecb4cd46c8032833e76360386f9c64d88c19)
+- handle strings [`df96666`](https://github.com/browserify/parse-asn1/commit/df9666656c6edf341a2e99549b197334c5fa2fc9)
diff --git a/node_modules/parse-asn1/LICENSE b/node_modules/parse-asn1/LICENSE
new file mode 100644
index 0000000000000000000000000000000000000000..e0efcf251d049d2c98160af0e8989260c14cc89f
--- /dev/null
+++ b/node_modules/parse-asn1/LICENSE
@@ -0,0 +1,13 @@
+Copyright (c) 2017, crypto-browserify contributors
+
+Permission to use, copy, modify, and/or distribute this software for any
+purpose with or without fee is hereby granted, provided that the above
+copyright notice and this permission notice appear in all copies.
+
+THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
+ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
+OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
diff --git a/node_modules/parse-asn1/README.md b/node_modules/parse-asn1/README.md
new file mode 100644
index 0000000000000000000000000000000000000000..9cd4c153e698db696ac63eb92667994ac1e1579a
--- /dev/null
+++ b/node_modules/parse-asn1/README.md
@@ -0,0 +1,8 @@
+# parse-asn1
+
+[](http://travis-ci.org/crypto-browserify/parse-asn1)
+[](https://www.npmjs.org/package/parse-asn1)
+
+[](https://github.com/feross/standard)
+
+utility library for parsing asn1 files for use with browserify-sign.
diff --git a/node_modules/parse-asn1/aesid.json b/node_modules/parse-asn1/aesid.json
new file mode 100644
index 0000000000000000000000000000000000000000..24f653b40f2a29d64ec52a71ffaf1b0a682c1513
--- /dev/null
+++ b/node_modules/parse-asn1/aesid.json
@@ -0,0 +1,13 @@
+{"2.16.840.1.101.3.4.1.1": "aes-128-ecb",
+"2.16.840.1.101.3.4.1.2": "aes-128-cbc",
+"2.16.840.1.101.3.4.1.3": "aes-128-ofb",
+"2.16.840.1.101.3.4.1.4": "aes-128-cfb",
+"2.16.840.1.101.3.4.1.21": "aes-192-ecb",
+"2.16.840.1.101.3.4.1.22": "aes-192-cbc",
+"2.16.840.1.101.3.4.1.23": "aes-192-ofb",
+"2.16.840.1.101.3.4.1.24": "aes-192-cfb",
+"2.16.840.1.101.3.4.1.41": "aes-256-ecb",
+"2.16.840.1.101.3.4.1.42": "aes-256-cbc",
+"2.16.840.1.101.3.4.1.43": "aes-256-ofb",
+"2.16.840.1.101.3.4.1.44": "aes-256-cfb"
+}
\ No newline at end of file
diff --git a/node_modules/parse-asn1/asn1.js b/node_modules/parse-asn1/asn1.js
new file mode 100644
index 0000000000000000000000000000000000000000..9b20c9460146498a880e219f0f5372256f5e952f
--- /dev/null
+++ b/node_modules/parse-asn1/asn1.js
@@ -0,0 +1,123 @@
+// from https://github.com/indutny/self-signed/blob/gh-pages/lib/asn1.js
+// Fedor, you are amazing.
+
+'use strict';
+
+var asn1 = require('asn1.js');
+
+exports.certificate = require('./certificate');
+
+var RSAPrivateKey = asn1.define('RSAPrivateKey', function () {
+ this.seq().obj(
+ this.key('version')['int'](),
+ this.key('modulus')['int'](),
+ this.key('publicExponent')['int'](),
+ this.key('privateExponent')['int'](),
+ this.key('prime1')['int'](),
+ this.key('prime2')['int'](),
+ this.key('exponent1')['int'](),
+ this.key('exponent2')['int'](),
+ this.key('coefficient')['int']()
+ );
+});
+exports.RSAPrivateKey = RSAPrivateKey;
+
+var RSAPublicKey = asn1.define('RSAPublicKey', function () {
+ this.seq().obj(
+ this.key('modulus')['int'](),
+ this.key('publicExponent')['int']()
+ );
+});
+exports.RSAPublicKey = RSAPublicKey;
+
+var AlgorithmIdentifier = asn1.define('AlgorithmIdentifier', function () {
+ this.seq().obj(
+ this.key('algorithm').objid(),
+ this.key('none').null_().optional(),
+ this.key('curve').objid().optional(),
+ this.key('params').seq().obj(
+ this.key('p')['int'](),
+ this.key('q')['int'](),
+ this.key('g')['int']()
+ ).optional()
+ );
+});
+
+var PublicKey = asn1.define('SubjectPublicKeyInfo', function () {
+ this.seq().obj(
+ this.key('algorithm').use(AlgorithmIdentifier),
+ this.key('subjectPublicKey').bitstr()
+ );
+});
+exports.PublicKey = PublicKey;
+
+var PrivateKeyInfo = asn1.define('PrivateKeyInfo', function () {
+ this.seq().obj(
+ this.key('version')['int'](),
+ this.key('algorithm').use(AlgorithmIdentifier),
+ this.key('subjectPrivateKey').octstr()
+ );
+});
+exports.PrivateKey = PrivateKeyInfo;
+var EncryptedPrivateKeyInfo = asn1.define('EncryptedPrivateKeyInfo', function () {
+ this.seq().obj(
+ this.key('algorithm').seq().obj(
+ this.key('id').objid(),
+ this.key('decrypt').seq().obj(
+ this.key('kde').seq().obj(
+ this.key('id').objid(),
+ this.key('kdeparams').seq().obj(
+ this.key('salt').octstr(),
+ this.key('iters')['int']()
+ )
+ ),
+ this.key('cipher').seq().obj(
+ this.key('algo').objid(),
+ this.key('iv').octstr()
+ )
+ )
+ ),
+ this.key('subjectPrivateKey').octstr()
+ );
+});
+
+exports.EncryptedPrivateKey = EncryptedPrivateKeyInfo;
+
+var DSAPrivateKey = asn1.define('DSAPrivateKey', function () {
+ this.seq().obj(
+ this.key('version')['int'](),
+ this.key('p')['int'](),
+ this.key('q')['int'](),
+ this.key('g')['int'](),
+ this.key('pub_key')['int'](),
+ this.key('priv_key')['int']()
+ );
+});
+exports.DSAPrivateKey = DSAPrivateKey;
+
+exports.DSAparam = asn1.define('DSAparam', function () {
+ this['int']();
+});
+
+var ECParameters = asn1.define('ECParameters', function () {
+ this.choice({
+ namedCurve: this.objid()
+ });
+});
+
+var ECPrivateKey = asn1.define('ECPrivateKey', function () {
+ this.seq().obj(
+ this.key('version')['int'](),
+ this.key('privateKey').octstr(),
+ this.key('parameters').optional().explicit(0).use(ECParameters),
+ this.key('publicKey').optional().explicit(1).bitstr()
+ );
+});
+exports.ECPrivateKey = ECPrivateKey;
+
+exports.signature = asn1.define('signature', function () {
+ this.seq().obj(
+ this.key('r')['int'](),
+ this.key('s')['int']()
+ );
+});
diff --git a/node_modules/parse-asn1/certificate.js b/node_modules/parse-asn1/certificate.js
new file mode 100644
index 0000000000000000000000000000000000000000..3529c72a142ce250af2ab6ede4b7dafbcf3531e4
--- /dev/null
+++ b/node_modules/parse-asn1/certificate.js
@@ -0,0 +1,89 @@
+// from https://github.com/Rantanen/node-dtls/blob/25a7dc861bda38cfeac93a723500eea4f0ac2e86/Certificate.js
+// thanks to @Rantanen
+
+'use strict';
+
+var asn = require('asn1.js');
+
+var Time = asn.define('Time', function () {
+ this.choice({
+ utcTime: this.utctime(),
+ generalTime: this.gentime()
+ });
+});
+
+var AttributeTypeValue = asn.define('AttributeTypeValue', function () {
+ this.seq().obj(
+ this.key('type').objid(),
+ this.key('value').any()
+ );
+});
+
+var AlgorithmIdentifier = asn.define('AlgorithmIdentifier', function () {
+ this.seq().obj(
+ this.key('algorithm').objid(),
+ this.key('parameters').optional(),
+ this.key('curve').objid().optional()
+ );
+});
+
+var SubjectPublicKeyInfo = asn.define('SubjectPublicKeyInfo', function () {
+ this.seq().obj(
+ this.key('algorithm').use(AlgorithmIdentifier),
+ this.key('subjectPublicKey').bitstr()
+ );
+});
+
+var RelativeDistinguishedName = asn.define('RelativeDistinguishedName', function () {
+ this.setof(AttributeTypeValue);
+});
+
+var RDNSequence = asn.define('RDNSequence', function () {
+ this.seqof(RelativeDistinguishedName);
+});
+
+var Name = asn.define('Name', function () {
+ this.choice({
+ rdnSequence: this.use(RDNSequence)
+ });
+});
+
+var Validity = asn.define('Validity', function () {
+ this.seq().obj(
+ this.key('notBefore').use(Time),
+ this.key('notAfter').use(Time)
+ );
+});
+
+var Extension = asn.define('Extension', function () {
+ this.seq().obj(
+ this.key('extnID').objid(),
+ this.key('critical').bool().def(false),
+ this.key('extnValue').octstr()
+ );
+});
+
+var TBSCertificate = asn.define('TBSCertificate', function () {
+ this.seq().obj(
+ this.key('version').explicit(0)['int']().optional(),
+ this.key('serialNumber')['int'](),
+ this.key('signature').use(AlgorithmIdentifier),
+ this.key('issuer').use(Name),
+ this.key('validity').use(Validity),
+ this.key('subject').use(Name),
+ this.key('subjectPublicKeyInfo').use(SubjectPublicKeyInfo),
+ this.key('issuerUniqueID').implicit(1).bitstr().optional(),
+ this.key('subjectUniqueID').implicit(2).bitstr().optional(),
+ this.key('extensions').explicit(3).seqof(Extension).optional()
+ );
+});
+
+var X509Certificate = asn.define('X509Certificate', function () {
+ this.seq().obj(
+ this.key('tbsCertificate').use(TBSCertificate),
+ this.key('signatureAlgorithm').use(AlgorithmIdentifier),
+ this.key('signatureValue').bitstr()
+ );
+});
+
+module.exports = X509Certificate;
diff --git a/node_modules/parse-asn1/fixProc.js b/node_modules/parse-asn1/fixProc.js
new file mode 100644
index 0000000000000000000000000000000000000000..0e3d234ccfcb74de7407b66f869de9a56106ef94
--- /dev/null
+++ b/node_modules/parse-asn1/fixProc.js
@@ -0,0 +1,33 @@
+'use strict';
+
+// adapted from https://github.com/apatil/pemstrip
+var findProc = /Proc-Type: 4,ENCRYPTED[\n\r]+DEK-Info: AES-((?:128)|(?:192)|(?:256))-CBC,([0-9A-H]+)[\n\r]+([0-9A-z\n\r+/=]+)[\n\r]+/m;
+var startRegex = /^-----BEGIN ((?:.*? KEY)|CERTIFICATE)-----/m;
+var fullRegex = /^-----BEGIN ((?:.*? KEY)|CERTIFICATE)-----([0-9A-z\n\r+/=]+)-----END \1-----$/m;
+var evp = require('evp_bytestokey');
+var ciphers = require('browserify-aes');
+var Buffer = require('safe-buffer').Buffer;
+module.exports = function (okey, password) {
+ var key = okey.toString();
+ var match = key.match(findProc);
+ var decrypted;
+ if (!match) {
+ var match2 = key.match(fullRegex);
+ decrypted = Buffer.from(match2[2].replace(/[\r\n]/g, ''), 'base64');
+ } else {
+ var suite = 'aes' + match[1];
+ var iv = Buffer.from(match[2], 'hex');
+ var cipherText = Buffer.from(match[3].replace(/[\r\n]/g, ''), 'base64');
+ var cipherKey = evp(password, iv.slice(0, 8), parseInt(match[1], 10)).key;
+ var out = [];
+ var cipher = ciphers.createDecipheriv(suite, cipherKey, iv);
+ out.push(cipher.update(cipherText));
+ out.push(cipher['final']());
+ decrypted = Buffer.concat(out);
+ }
+ var tag = key.match(startRegex)[1];
+ return {
+ tag: tag,
+ data: decrypted
+ };
+};
diff --git a/node_modules/parse-asn1/index.js b/node_modules/parse-asn1/index.js
new file mode 100644
index 0000000000000000000000000000000000000000..ad8607745166e9f6161ea943f71a93a4c3181ddc
--- /dev/null
+++ b/node_modules/parse-asn1/index.js
@@ -0,0 +1,111 @@
+'use strict';
+
+var asn1 = require('./asn1');
+var aesid = require('./aesid.json');
+var fixProc = require('./fixProc');
+var ciphers = require('browserify-aes');
+var pbkdf2Sync = require('pbkdf2').pbkdf2Sync;
+var Buffer = require('safe-buffer').Buffer;
+
+function decrypt(data, password) {
+ var salt = data.algorithm.decrypt.kde.kdeparams.salt;
+ var iters = parseInt(data.algorithm.decrypt.kde.kdeparams.iters.toString(), 10);
+ var algo = aesid[data.algorithm.decrypt.cipher.algo.join('.')];
+ var iv = data.algorithm.decrypt.cipher.iv;
+ var cipherText = data.subjectPrivateKey;
+ var keylen = parseInt(algo.split('-')[1], 10) / 8;
+ var key = pbkdf2Sync(password, salt, iters, keylen, 'sha1');
+ var cipher = ciphers.createDecipheriv(algo, key, iv);
+ var out = [];
+ out.push(cipher.update(cipherText));
+ out.push(cipher['final']());
+ return Buffer.concat(out);
+}
+
+function parseKeys(buffer) {
+ var password;
+ if (typeof buffer === 'object' && !Buffer.isBuffer(buffer)) {
+ password = buffer.passphrase;
+ buffer = buffer.key;
+ }
+ if (typeof buffer === 'string') {
+ buffer = Buffer.from(buffer);
+ }
+
+ var stripped = fixProc(buffer, password);
+
+ var type = stripped.tag;
+ var data = stripped.data;
+ var subtype, ndata;
+ switch (type) {
+ case 'CERTIFICATE':
+ ndata = asn1.certificate.decode(data, 'der').tbsCertificate.subjectPublicKeyInfo;
+ // falls through
+ case 'PUBLIC KEY':
+ if (!ndata) {
+ ndata = asn1.PublicKey.decode(data, 'der');
+ }
+ subtype = ndata.algorithm.algorithm.join('.');
+ switch (subtype) {
+ case '1.2.840.113549.1.1.1':
+ return asn1.RSAPublicKey.decode(ndata.subjectPublicKey.data, 'der');
+ case '1.2.840.10045.2.1':
+ ndata.subjectPrivateKey = ndata.subjectPublicKey;
+ return {
+ type: 'ec',
+ data: ndata
+ };
+ case '1.2.840.10040.4.1':
+ ndata.algorithm.params.pub_key = asn1.DSAparam.decode(ndata.subjectPublicKey.data, 'der');
+ return {
+ type: 'dsa',
+ data: ndata.algorithm.params
+ };
+ default: throw new Error('unknown key id ' + subtype);
+ }
+ // throw new Error('unknown key type ' + type)
+ case 'ENCRYPTED PRIVATE KEY':
+ data = asn1.EncryptedPrivateKey.decode(data, 'der');
+ data = decrypt(data, password);
+ // falls through
+ case 'PRIVATE KEY':
+ ndata = asn1.PrivateKey.decode(data, 'der');
+ subtype = ndata.algorithm.algorithm.join('.');
+ switch (subtype) {
+ case '1.2.840.113549.1.1.1':
+ return asn1.RSAPrivateKey.decode(ndata.subjectPrivateKey, 'der');
+ case '1.2.840.10045.2.1':
+ return {
+ curve: ndata.algorithm.curve,
+ privateKey: asn1.ECPrivateKey.decode(ndata.subjectPrivateKey, 'der').privateKey
+ };
+ case '1.2.840.10040.4.1':
+ ndata.algorithm.params.priv_key = asn1.DSAparam.decode(ndata.subjectPrivateKey, 'der');
+ return {
+ type: 'dsa',
+ params: ndata.algorithm.params
+ };
+ default: throw new Error('unknown key id ' + subtype);
+ }
+ // throw new Error('unknown key type ' + type)
+ case 'RSA PUBLIC KEY':
+ return asn1.RSAPublicKey.decode(data, 'der');
+ case 'RSA PRIVATE KEY':
+ return asn1.RSAPrivateKey.decode(data, 'der');
+ case 'DSA PRIVATE KEY':
+ return {
+ type: 'dsa',
+ params: asn1.DSAPrivateKey.decode(data, 'der')
+ };
+ case 'EC PRIVATE KEY':
+ data = asn1.ECPrivateKey.decode(data, 'der');
+ return {
+ curve: data.parameters.value,
+ privateKey: data.privateKey
+ };
+ default: throw new Error('unknown key type ' + type);
+ }
+}
+parseKeys.signature = asn1.signature;
+
+module.exports = parseKeys;
diff --git a/node_modules/parse-asn1/package.json b/node_modules/parse-asn1/package.json
new file mode 100644
index 0000000000000000000000000000000000000000..ca0b42af6cc594fb2e43dd5cd72e4a1db905908f
--- /dev/null
+++ b/node_modules/parse-asn1/package.json
@@ -0,0 +1,58 @@
+{
+ "name": "parse-asn1",
+ "version": "5.1.9",
+ "description": "utility library for parsing asn1 files for use with browserify-sign.",
+ "main": "index.js",
+ "scripts": {
+ "prepack": "npmignore --auto --commentLines=autogenerated",
+ "prepublish": "not-in-publish || npm run prepublishOnly",
+ "prepublishOnly": "safe-publish-latest",
+ "lint": "eslint --ext=js,mjs .",
+ "tests-only": "tape 'test/**/*.js'",
+ "pretest": "npm run lint",
+ "test": "npm run tests-only",
+ "posttest": "npx npm@\">= 10.2\" audit --production",
+ "version": "auto-changelog && git add CHANGELOG.md",
+ "postversion": "auto-changelog && git add CHANGELOG.md && git commit --no-edit --amend && git tag -f \"v$(node -e \"console.log(require('./package.json').version)\")\""
+ },
+ "repository": {
+ "type": "git",
+ "url": "git://github.com/crypto-browserify/parse-asn1.git"
+ },
+ "author": "",
+ "license": "ISC",
+ "dependencies": {
+ "asn1.js": "^4.10.1",
+ "browserify-aes": "^1.2.0",
+ "evp_bytestokey": "^1.0.3",
+ "pbkdf2": "^3.1.5",
+ "safe-buffer": "^5.2.1"
+ },
+ "devDependencies": {
+ "@ljharb/eslint-config": "^21.2.0",
+ "auto-changelog": "^2.5.0",
+ "encoding": "^0.1.13",
+ "eslint": "=8.8.0",
+ "in-publish": "^2.0.1",
+ "npmignore": "^0.3.1",
+ "safe-publish-latest": "^2.0.0",
+ "tape": "^5.9.0"
+ },
+ "engines": {
+ "node": ">= 0.10"
+ },
+ "auto-changelog": {
+ "output": "CHANGELOG.md",
+ "template": "keepachangelog",
+ "unreleased": false,
+ "commitLimit": false,
+ "backfillLimit": false,
+ "hideCredit": true
+ },
+ "publishConfig": {
+ "ignore": [
+ ".github/workflows",
+ "test"
+ ]
+ }
+}
diff --git a/node_modules/parse-rect/.eslintrc.json b/node_modules/parse-rect/.eslintrc.json
new file mode 100644
index 0000000000000000000000000000000000000000..1e5e08b37332379d194a6a5e8fd259d8de4f7fc9
--- /dev/null
+++ b/node_modules/parse-rect/.eslintrc.json
@@ -0,0 +1,44 @@
+{
+ "env": {
+ "browser": true,
+ "node": true,
+ "commonjs": true,
+ "es6": true
+ },
+ "extends": "eslint:recommended",
+ "rules": {
+ "strict": 2,
+ "indent": 0,
+ "linebreak-style": 0,
+ "quotes": 0,
+ "semi": 0,
+ "no-cond-assign": 1,
+ "no-constant-condition": 1,
+ "no-duplicate-case": 1,
+ "no-empty": 1,
+ "no-ex-assign": 1,
+ "no-extra-boolean-cast": 1,
+ "no-extra-semi": 1,
+ "no-fallthrough": 1,
+ "no-func-assign": 1,
+ "no-global-assign": 1,
+ "no-implicit-globals": 2,
+ "no-inner-declarations": ["error", "functions"],
+ "no-irregular-whitespace": 2,
+ "no-loop-func": 1,
+ "no-magic-numbers": ["warn", { "ignore": [1, 0, -1], "ignoreArrayIndexes": true}],
+ "no-multi-str": 1,
+ "no-mixed-spaces-and-tabs": 1,
+ "no-proto": 1,
+ "no-sequences": 1,
+ "no-throw-literal": 1,
+ "no-unmodified-loop-condition": 1,
+ "no-useless-call": 1,
+ "no-void": 1,
+ "no-with": 2,
+ "wrap-iife": 1,
+ "no-redeclare": 1,
+ "no-unused-vars": ["error", { "vars": "all", "args": "none" }],
+ "no-sparse-arrays": 1
+ }
+}
diff --git a/node_modules/parse-rect/.travis.yml b/node_modules/parse-rect/.travis.yml
new file mode 100644
index 0000000000000000000000000000000000000000..2ea53652d5e2375bdb9bde81676ee2031963188a
--- /dev/null
+++ b/node_modules/parse-rect/.travis.yml
@@ -0,0 +1,5 @@
+sudo: false
+language: node_js
+node_js:
+ - 'node'
+ - '6'
diff --git a/node_modules/parse-rect/index.js b/node_modules/parse-rect/index.js
new file mode 100644
index 0000000000000000000000000000000000000000..84a88176cbc522b3451c95368e97b40d8d0f2fda
--- /dev/null
+++ b/node_modules/parse-rect/index.js
@@ -0,0 +1,85 @@
+'use strict'
+
+var pick = require('pick-by-alias')
+
+module.exports = parseRect
+
+function parseRect (arg) {
+ var rect
+
+ // direct arguments sequence
+ if (arguments.length > 1) {
+ arg = arguments
+ }
+
+ // svg viewbox
+ if (typeof arg === 'string') {
+ arg = arg.split(/\s/).map(parseFloat)
+ }
+ else if (typeof arg === 'number') {
+ arg = [arg]
+ }
+
+ // 0, 0, 100, 100 - array-like
+ if (arg.length && typeof arg[0] === 'number') {
+ // [w, w]
+ if (arg.length === 1) {
+ rect = {
+ width: arg[0],
+ height: arg[0],
+ x: 0, y: 0
+ }
+ }
+ // [w, h]
+ else if (arg.length === 2) {
+ rect = {
+ width: arg[0],
+ height: arg[1],
+ x: 0, y: 0
+ }
+ }
+ // [l, t, r, b]
+ else {
+ rect = {
+ x: arg[0],
+ y: arg[1],
+ width: (arg[2] - arg[0]) || 0,
+ height: (arg[3] - arg[1]) || 0
+ }
+ }
+ }
+ // {x, y, w, h} or {l, t, b, r}
+ else if (arg) {
+ arg = pick(arg, {
+ left: 'x l left Left',
+ top: 'y t top Top',
+ width: 'w width W Width',
+ height: 'h height W Width',
+ bottom: 'b bottom Bottom',
+ right: 'r right Right'
+ })
+
+ rect = {
+ x: arg.left || 0,
+ y: arg.top || 0
+ }
+
+ if (arg.width == null) {
+ if (arg.right) rect.width = arg.right - rect.x
+ else rect.width = 0
+ }
+ else {
+ rect.width = arg.width
+ }
+
+ if (arg.height == null) {
+ if (arg.bottom) rect.height = arg.bottom - rect.y
+ else rect.height = 0
+ }
+ else {
+ rect.height = arg.height
+ }
+ }
+
+ return rect
+}
diff --git a/node_modules/parse-rect/license b/node_modules/parse-rect/license
new file mode 100644
index 0000000000000000000000000000000000000000..fb2315440d1b16cfeb3eb2d46152c8bd110280c2
--- /dev/null
+++ b/node_modules/parse-rect/license
@@ -0,0 +1,21 @@
+The MIT License (MIT)
+
+Copyright (c) 2017 Dmitry Ivanov
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
diff --git a/node_modules/parse-rect/package.json b/node_modules/parse-rect/package.json
new file mode 100644
index 0000000000000000000000000000000000000000..e31ab74592c0555c9a9aa82538e619e381c34aa9
--- /dev/null
+++ b/node_modules/parse-rect/package.json
@@ -0,0 +1,24 @@
+{
+ "name": "parse-rect",
+ "version": "1.2.0",
+ "description": "Parse any input rectangle format",
+ "main": "index.js",
+ "dependencies": {
+ "pick-by-alias": "^1.2.0"
+ },
+ "devDependencies": {},
+ "scripts": {
+ "test": "node test"
+ },
+ "repository": {
+ "type": "git",
+ "url": "git+https://github.com/dfcreative/parse-rect.git"
+ },
+ "keywords": [
+ "rect",
+ "rectangle",
+ "parse"
+ ],
+ "author": "Dmitry Yv ",
+ "license": "MIT"
+}
diff --git a/node_modules/parse-rect/readme.md b/node_modules/parse-rect/readme.md
new file mode 100644
index 0000000000000000000000000000000000000000..6a7fc5f9a3afdf8d34fc53ef706137ee5691d08b
--- /dev/null
+++ b/node_modules/parse-rect/readme.md
@@ -0,0 +1,30 @@
+# parse-rect [](http://github.com/badges/stability-badges) [](https://travis-ci.org/dfcreative/parse-rect)
+
+Take any rectangle-like argument and return rectangle values.
+
+[](https://npmjs.org/package/parse-rect/)
+
+```js
+const parseRect = require('parse-rect')
+
+// {x: 10, y: 20, width: 90, height: 80}
+parseRect('10 20 100 100')
+parseRect(10, 20, 100, 100)
+parseRect([10, 20, 100, 100])
+parseRect({ x: 10, y: 20, width: 90, height: 80 })
+parseRect({ x: 10, y: 20, w: 90, h: 80 })
+parseRect({ l: 10, t: 20, r: 100, b: 100 })
+parseRect({ left: 10, top: 20, right: 100, bottom: 100 })
+
+// {x: 0, y: 0, width: 90, height: 80}
+parseRect({ width: 90, height: 80 })
+parseRect([ 90, 80 ])
+
+// {x: 0, y: 0, width: 90, height: 90}
+parseRect(90)
+parseRect([90])
+```
+
+## License
+
+(c) 2018 Dmitry Yv. MIT License
diff --git a/node_modules/parse-rect/test.js b/node_modules/parse-rect/test.js
new file mode 100644
index 0000000000000000000000000000000000000000..3f389c07b1ebedf64837fd021be7a15a47b9306d
--- /dev/null
+++ b/node_modules/parse-rect/test.js
@@ -0,0 +1,20 @@
+'use strict'
+
+const parseRect = require('./')
+const assert = require('assert')
+
+var res = {x: 10, y: 20, width: 90, height: 80}
+assert.deepEqual(parseRect('10 20 100 100'), res)
+assert.deepEqual(parseRect(10, 20, 100, 100), res)
+assert.deepEqual(parseRect([10, 20, 100, 100]), res)
+assert.deepEqual(parseRect({ x: 10, y: 20, width: 90, height: 80 }), res)
+assert.deepEqual(parseRect({ x: 10, y: 20, w: 90, h: 80 }), res)
+assert.deepEqual(parseRect({ l: 10, t: 20, r: 100, b: 100 }), res)
+assert.deepEqual(parseRect({ left: 10, top: 20, right: 100, bottom: 100 }), res)
+
+var res = {x: 0, y: 0, width: 90, height: 80}
+assert.deepEqual(parseRect({ width: 90, height: 80 }), res)
+
+assert.deepEqual(parseRect([10, 20]), {width: 10, height: 20, x: 0, y: 0})
+assert.deepEqual(parseRect(10), {width: 10, height: 10, x: 0, y: 0})
+assert.deepEqual(parseRect([10]), {width: 10, height: 10, x: 0, y: 0})
diff --git a/node_modules/parse-svg-path/License b/node_modules/parse-svg-path/License
new file mode 100644
index 0000000000000000000000000000000000000000..c9b77ebb4de12e2451ac7c67b43cf1ddceaf7739
--- /dev/null
+++ b/node_modules/parse-svg-path/License
@@ -0,0 +1,23 @@
+
+The MIT License
+
+Copyright (c) 2013 Jake Rosoman
+
+Permission is hereby granted, free of charge, to any person obtaining
+a copy of this software and associated documentation files (the
+'Software'), to deal in the Software without restriction, including
+without limitation the rights to use, copy, modify, merge, publish,
+distribute, sublicense, and/or sell copies of the Software, and to
+permit persons to whom the Software is furnished to do so, subject to
+the following conditions:
+
+The above copyright notice and this permission notice shall be
+included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
+CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
diff --git a/node_modules/parse-svg-path/Readme.md b/node_modules/parse-svg-path/Readme.md
new file mode 100644
index 0000000000000000000000000000000000000000..49801535bc223e82499d2754ba33bb3d883b9be3
--- /dev/null
+++ b/node_modules/parse-svg-path/Readme.md
@@ -0,0 +1,32 @@
+
+# parse-svg-path
+
+ A minimal svg path parser. For the delux model see [hughsk/svg-path-parser](//github.com/hughsk/svg-path-parser) or for the streaming model see [nfroidure/SVGPathData](//github.com/nfroidure/SVGPathData).
+
+## Installation
+
+- [packin](//github.com/jkroso/packin): `packin add jkroso/parse-svg-path`
+- [component](//github.com/component/component#installing-packages): `component install jkroso/parse-svg-path`
+- [npm](//npmjs.org/doc/cli/npm-install.html): `npm install parse-svg-path`
+
+then in your app:
+
+```js
+var parse = require('parse-svg-path')
+```
+
+## API
+
+### parse(string)
+
+ parse an svg path data string. Generates an Array
+ of commands where each command is an Array of the
+ form `[command, arg1, arg2, ...]`
+
+```js
+parse('m1 2 3 4') // => [['m',1,2],['l',3,4]]
+```
+
+## Running the tests
+
+Just run `make` and navigate your browser to the test directory.
diff --git a/node_modules/parse-svg-path/index.js b/node_modules/parse-svg-path/index.js
new file mode 100644
index 0000000000000000000000000000000000000000..6ba39ebbb1ab3ae0236643e69c7dbdb12661547f
--- /dev/null
+++ b/node_modules/parse-svg-path/index.js
@@ -0,0 +1,57 @@
+
+module.exports = parse
+
+/**
+ * expected argument lengths
+ * @type {Object}
+ */
+
+var length = {a: 7, c: 6, h: 1, l: 2, m: 2, q: 4, s: 4, t: 2, v: 1, z: 0}
+
+/**
+ * segment pattern
+ * @type {RegExp}
+ */
+
+var segment = /([astvzqmhlc])([^astvzqmhlc]*)/ig
+
+/**
+ * parse an svg path data string. Generates an Array
+ * of commands where each command is an Array of the
+ * form `[command, arg1, arg2, ...]`
+ *
+ * @param {String} path
+ * @return {Array}
+ */
+
+function parse(path) {
+ var data = []
+ path.replace(segment, function(_, command, args){
+ var type = command.toLowerCase()
+ args = parseValues(args)
+
+ // overloaded moveTo
+ if (type == 'm' && args.length > 2) {
+ data.push([command].concat(args.splice(0, 2)))
+ type = 'l'
+ command = command == 'm' ? 'l' : 'L'
+ }
+
+ while (true) {
+ if (args.length == length[type]) {
+ args.unshift(command)
+ return data.push(args)
+ }
+ if (args.length < length[type]) throw new Error('malformed path data')
+ data.push([command].concat(args.splice(0, length[type])))
+ }
+ })
+ return data
+}
+
+var number = /-?[0-9]*\.?[0-9]+(?:e[-+]?\d+)?/ig
+
+function parseValues(args) {
+ var numbers = args.match(number)
+ return numbers ? numbers.map(Number) : []
+}
diff --git a/node_modules/parse-svg-path/package.json b/node_modules/parse-svg-path/package.json
new file mode 100644
index 0000000000000000000000000000000000000000..b457a517c61343e70b51824faf4ec7ae88321600
--- /dev/null
+++ b/node_modules/parse-svg-path/package.json
@@ -0,0 +1,17 @@
+{
+ "name": "parse-svg-path",
+ "version": "0.1.2",
+ "description": "svg path parser",
+ "keywords": ["svg","path","parse","parser"],
+ "dependencies": {},
+ "devDependencies": {
+ "serve": "jkroso/serve#1.5.1",
+ "mocha": "*",
+ "chai": "*"
+ },
+ "repository": "git://github.com/jkroso/parse-svg-path.git",
+ "bugs": "https://github.com/jkroso/parse-svg-path/issues",
+ "author": "Jake Rosoman",
+ "files": ["index.js"],
+ "license": "MIT"
+}
diff --git a/node_modules/parse-unit/.npmignore b/node_modules/parse-unit/.npmignore
new file mode 100644
index 0000000000000000000000000000000000000000..bd11a0be2a1b9c72cfe67f1fa1b393aed0923fc3
--- /dev/null
+++ b/node_modules/parse-unit/.npmignore
@@ -0,0 +1,8 @@
+bower_components
+node_modules
+*.log
+.DS_Store
+bundle.js
+test
+test.js
+demo/
\ No newline at end of file
diff --git a/node_modules/parse-unit/LICENSE.md b/node_modules/parse-unit/LICENSE.md
new file mode 100644
index 0000000000000000000000000000000000000000..927a999b6ee41b2e53992f0eecdd5ee939cf7038
--- /dev/null
+++ b/node_modules/parse-unit/LICENSE.md
@@ -0,0 +1,21 @@
+The MIT License (MIT)
+Copyright (c) 2014 Matt DesLauriers
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
+DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE
+OR OTHER DEALINGS IN THE SOFTWARE.
+
diff --git a/node_modules/parse-unit/README.md b/node_modules/parse-unit/README.md
new file mode 100644
index 0000000000000000000000000000000000000000..e44bae40bc7cb64df5e3c128015e0e7fb1524a08
--- /dev/null
+++ b/node_modules/parse-unit/README.md
@@ -0,0 +1,33 @@
+# parse-unit
+
+[](http://github.com/badges/stability-badges)
+
+Parses a number and unit string, eg `"20px"` into `[20, "px"]`.
+
+```js
+var unit = require('parse-unit')
+
+//prints [50, "gold"]
+console.log( unit("50 gold") )
+```
+
+## Usage
+
+[](https://nodei.co/npm/parse-unit/)
+
+#### `parse(str[, out])`
+
+Parses the string and its unit, returning an array containing the number and unit, separated.
+
+```
+"-20 foo" => [-20, "foo"]
+"5.5%" => [5.5, "%"]
+5 => [5, ""]
+"5" => [5, ""]
+```
+
+This will create a new array unless you specify an array to `out`, which allows you to re-use arrays.
+
+## License
+
+MIT, see [LICENSE.md](http://github.com/mattdesl/parse-unit/blob/master/LICENSE.md) for details.
diff --git a/node_modules/parse-unit/index.js b/node_modules/parse-unit/index.js
new file mode 100644
index 0000000000000000000000000000000000000000..921f68bb25e382c6ddbfbd796291073cc34e479a
--- /dev/null
+++ b/node_modules/parse-unit/index.js
@@ -0,0 +1,10 @@
+module.exports = function parseUnit(str, out) {
+ if (!out)
+ out = [ 0, '' ]
+
+ str = String(str)
+ var num = parseFloat(str, 10)
+ out[0] = num
+ out[1] = str.match(/[\d.\-\+]*\s*(.*)/)[1] || ''
+ return out
+}
\ No newline at end of file
diff --git a/node_modules/parse-unit/package.json b/node_modules/parse-unit/package.json
new file mode 100644
index 0000000000000000000000000000000000000000..4562bbb91e4d3ef44d621abe2b2e10cfc96e53ae
--- /dev/null
+++ b/node_modules/parse-unit/package.json
@@ -0,0 +1,42 @@
+{
+ "name": "parse-unit",
+ "version": "1.0.1",
+ "description": "parses number and unit, '20px' into [20, 'px']",
+ "main": "index.js",
+ "license": "MIT",
+ "author": "Matt DesLauriers ",
+ "dependencies": {},
+ "devDependencies": {
+ "tape": "~2.13.2"
+ },
+ "scripts": {
+ "test": "node test.js"
+ },
+ "repository": {
+ "type": "git",
+ "url": "git://github.com/mattdesl/parse-unit.git"
+ },
+ "keywords": [
+ "parse",
+ "number",
+ "string",
+ "str",
+ "split",
+ "unit",
+ "in",
+ "m",
+ "px",
+ "%",
+ "pt",
+ "pc",
+ "em",
+ "deg",
+ "rad",
+ "css",
+ "value"
+ ],
+ "homepage": "https://github.com/mattdesl/parse-unit",
+ "bugs": {
+ "url": "https://github.com/mattdesl/parse-unit/issues"
+ }
+}
diff --git a/node_modules/parseurl/HISTORY.md b/node_modules/parseurl/HISTORY.md
new file mode 100644
index 0000000000000000000000000000000000000000..8e409541d855de232cc24d29524282441d11cbc7
--- /dev/null
+++ b/node_modules/parseurl/HISTORY.md
@@ -0,0 +1,58 @@
+1.3.3 / 2019-04-15
+==================
+
+ * Fix Node.js 0.8 return value inconsistencies
+
+1.3.2 / 2017-09-09
+==================
+
+ * perf: reduce overhead for full URLs
+ * perf: unroll the "fast-path" `RegExp`
+
+1.3.1 / 2016-01-17
+==================
+
+ * perf: enable strict mode
+
+1.3.0 / 2014-08-09
+==================
+
+ * Add `parseurl.original` for parsing `req.originalUrl` with fallback
+ * Return `undefined` if `req.url` is `undefined`
+
+1.2.0 / 2014-07-21
+==================
+
+ * Cache URLs based on original value
+ * Remove no-longer-needed URL mis-parse work-around
+ * Simplify the "fast-path" `RegExp`
+
+1.1.3 / 2014-07-08
+==================
+
+ * Fix typo
+
+1.1.2 / 2014-07-08
+==================
+
+ * Seriously fix Node.js 0.8 compatibility
+
+1.1.1 / 2014-07-08
+==================
+
+ * Fix Node.js 0.8 compatibility
+
+1.1.0 / 2014-07-08
+==================
+
+ * Incorporate URL href-only parse fast-path
+
+1.0.1 / 2014-03-08
+==================
+
+ * Add missing `require`
+
+1.0.0 / 2014-03-08
+==================
+
+ * Genesis from `connect`
diff --git a/node_modules/parseurl/LICENSE b/node_modules/parseurl/LICENSE
new file mode 100644
index 0000000000000000000000000000000000000000..27653d3db7e584321691af8f1bc30d49fe105d3e
--- /dev/null
+++ b/node_modules/parseurl/LICENSE
@@ -0,0 +1,24 @@
+
+(The MIT License)
+
+Copyright (c) 2014 Jonathan Ong
+Copyright (c) 2014-2017 Douglas Christopher Wilson
+
+Permission is hereby granted, free of charge, to any person obtaining
+a copy of this software and associated documentation files (the
+'Software'), to deal in the Software without restriction, including
+without limitation the rights to use, copy, modify, merge, publish,
+distribute, sublicense, and/or sell copies of the Software, and to
+permit persons to whom the Software is furnished to do so, subject to
+the following conditions:
+
+The above copyright notice and this permission notice shall be
+included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
+CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
diff --git a/node_modules/parseurl/README.md b/node_modules/parseurl/README.md
new file mode 100644
index 0000000000000000000000000000000000000000..443e716b85dc54a70d063109d4e9afa39022989d
--- /dev/null
+++ b/node_modules/parseurl/README.md
@@ -0,0 +1,133 @@
+# parseurl
+
+[![NPM Version][npm-version-image]][npm-url]
+[![NPM Downloads][npm-downloads-image]][npm-url]
+[![Node.js Version][node-image]][node-url]
+[![Build Status][travis-image]][travis-url]
+[![Test Coverage][coveralls-image]][coveralls-url]
+
+Parse a URL with memoization.
+
+## Install
+
+This is a [Node.js](https://nodejs.org/en/) module available through the
+[npm registry](https://www.npmjs.com/). Installation is done using the
+[`npm install` command](https://docs.npmjs.com/getting-started/installing-npm-packages-locally):
+
+```sh
+$ npm install parseurl
+```
+
+## API
+
+```js
+var parseurl = require('parseurl')
+```
+
+### parseurl(req)
+
+Parse the URL of the given request object (looks at the `req.url` property)
+and return the result. The result is the same as `url.parse` in Node.js core.
+Calling this function multiple times on the same `req` where `req.url` does
+not change will return a cached parsed object, rather than parsing again.
+
+### parseurl.original(req)
+
+Parse the original URL of the given request object and return the result.
+This works by trying to parse `req.originalUrl` if it is a string, otherwise
+parses `req.url`. The result is the same as `url.parse` in Node.js core.
+Calling this function multiple times on the same `req` where `req.originalUrl`
+does not change will return a cached parsed object, rather than parsing again.
+
+## Benchmark
+
+```bash
+$ npm run-script bench
+
+> parseurl@1.3.3 bench nodejs-parseurl
+> node benchmark/index.js
+
+ http_parser@2.8.0
+ node@10.6.0
+ v8@6.7.288.46-node.13
+ uv@1.21.0
+ zlib@1.2.11
+ ares@1.14.0
+ modules@64
+ nghttp2@1.32.0
+ napi@3
+ openssl@1.1.0h
+ icu@61.1
+ unicode@10.0
+ cldr@33.0
+ tz@2018c
+
+> node benchmark/fullurl.js
+
+ Parsing URL "http://localhost:8888/foo/bar?user=tj&pet=fluffy"
+
+ 4 tests completed.
+
+ fasturl x 2,207,842 ops/sec ±3.76% (184 runs sampled)
+ nativeurl - legacy x 507,180 ops/sec ±0.82% (191 runs sampled)
+ nativeurl - whatwg x 290,044 ops/sec ±1.96% (189 runs sampled)
+ parseurl x 488,907 ops/sec ±2.13% (192 runs sampled)
+
+> node benchmark/pathquery.js
+
+ Parsing URL "/foo/bar?user=tj&pet=fluffy"
+
+ 4 tests completed.
+
+ fasturl x 3,812,564 ops/sec ±3.15% (188 runs sampled)
+ nativeurl - legacy x 2,651,631 ops/sec ±1.68% (189 runs sampled)
+ nativeurl - whatwg x 161,837 ops/sec ±2.26% (189 runs sampled)
+ parseurl x 4,166,338 ops/sec ±2.23% (184 runs sampled)
+
+> node benchmark/samerequest.js
+
+ Parsing URL "/foo/bar?user=tj&pet=fluffy" on same request object
+
+ 4 tests completed.
+
+ fasturl x 3,821,651 ops/sec ±2.42% (185 runs sampled)
+ nativeurl - legacy x 2,651,162 ops/sec ±1.90% (187 runs sampled)
+ nativeurl - whatwg x 175,166 ops/sec ±1.44% (188 runs sampled)
+ parseurl x 14,912,606 ops/sec ±3.59% (183 runs sampled)
+
+> node benchmark/simplepath.js
+
+ Parsing URL "/foo/bar"
+
+ 4 tests completed.
+
+ fasturl x 12,421,765 ops/sec ±2.04% (191 runs sampled)
+ nativeurl - legacy x 7,546,036 ops/sec ±1.41% (188 runs sampled)
+ nativeurl - whatwg x 198,843 ops/sec ±1.83% (189 runs sampled)
+ parseurl x 24,244,006 ops/sec ±0.51% (194 runs sampled)
+
+> node benchmark/slash.js
+
+ Parsing URL "/"
+
+ 4 tests completed.
+
+ fasturl x 17,159,456 ops/sec ±3.25% (188 runs sampled)
+ nativeurl - legacy x 11,635,097 ops/sec ±3.79% (184 runs sampled)
+ nativeurl - whatwg x 240,693 ops/sec ±0.83% (189 runs sampled)
+ parseurl x 42,279,067 ops/sec ±0.55% (190 runs sampled)
+```
+
+## License
+
+ [MIT](LICENSE)
+
+[coveralls-image]: https://badgen.net/coveralls/c/github/pillarjs/parseurl/master
+[coveralls-url]: https://coveralls.io/r/pillarjs/parseurl?branch=master
+[node-image]: https://badgen.net/npm/node/parseurl
+[node-url]: https://nodejs.org/en/download
+[npm-downloads-image]: https://badgen.net/npm/dm/parseurl
+[npm-url]: https://npmjs.org/package/parseurl
+[npm-version-image]: https://badgen.net/npm/v/parseurl
+[travis-image]: https://badgen.net/travis/pillarjs/parseurl/master
+[travis-url]: https://travis-ci.org/pillarjs/parseurl
diff --git a/node_modules/parseurl/index.js b/node_modules/parseurl/index.js
new file mode 100644
index 0000000000000000000000000000000000000000..ece722327959f3bd9721488a035947387f1c1db1
--- /dev/null
+++ b/node_modules/parseurl/index.js
@@ -0,0 +1,158 @@
+/*!
+ * parseurl
+ * Copyright(c) 2014 Jonathan Ong
+ * Copyright(c) 2014-2017 Douglas Christopher Wilson
+ * MIT Licensed
+ */
+
+'use strict'
+
+/**
+ * Module dependencies.
+ * @private
+ */
+
+var url = require('url')
+var parse = url.parse
+var Url = url.Url
+
+/**
+ * Module exports.
+ * @public
+ */
+
+module.exports = parseurl
+module.exports.original = originalurl
+
+/**
+ * Parse the `req` url with memoization.
+ *
+ * @param {ServerRequest} req
+ * @return {Object}
+ * @public
+ */
+
+function parseurl (req) {
+ var url = req.url
+
+ if (url === undefined) {
+ // URL is undefined
+ return undefined
+ }
+
+ var parsed = req._parsedUrl
+
+ if (fresh(url, parsed)) {
+ // Return cached URL parse
+ return parsed
+ }
+
+ // Parse the URL
+ parsed = fastparse(url)
+ parsed._raw = url
+
+ return (req._parsedUrl = parsed)
+};
+
+/**
+ * Parse the `req` original url with fallback and memoization.
+ *
+ * @param {ServerRequest} req
+ * @return {Object}
+ * @public
+ */
+
+function originalurl (req) {
+ var url = req.originalUrl
+
+ if (typeof url !== 'string') {
+ // Fallback
+ return parseurl(req)
+ }
+
+ var parsed = req._parsedOriginalUrl
+
+ if (fresh(url, parsed)) {
+ // Return cached URL parse
+ return parsed
+ }
+
+ // Parse the URL
+ parsed = fastparse(url)
+ parsed._raw = url
+
+ return (req._parsedOriginalUrl = parsed)
+};
+
+/**
+ * Parse the `str` url with fast-path short-cut.
+ *
+ * @param {string} str
+ * @return {Object}
+ * @private
+ */
+
+function fastparse (str) {
+ if (typeof str !== 'string' || str.charCodeAt(0) !== 0x2f /* / */) {
+ return parse(str)
+ }
+
+ var pathname = str
+ var query = null
+ var search = null
+
+ // This takes the regexp from https://github.com/joyent/node/pull/7878
+ // Which is /^(\/[^?#\s]*)(\?[^#\s]*)?$/
+ // And unrolls it into a for loop
+ for (var i = 1; i < str.length; i++) {
+ switch (str.charCodeAt(i)) {
+ case 0x3f: /* ? */
+ if (search === null) {
+ pathname = str.substring(0, i)
+ query = str.substring(i + 1)
+ search = str.substring(i)
+ }
+ break
+ case 0x09: /* \t */
+ case 0x0a: /* \n */
+ case 0x0c: /* \f */
+ case 0x0d: /* \r */
+ case 0x20: /* */
+ case 0x23: /* # */
+ case 0xa0:
+ case 0xfeff:
+ return parse(str)
+ }
+ }
+
+ var url = Url !== undefined
+ ? new Url()
+ : {}
+
+ url.path = str
+ url.href = str
+ url.pathname = pathname
+
+ if (search !== null) {
+ url.query = query
+ url.search = search
+ }
+
+ return url
+}
+
+/**
+ * Determine if parsed is still fresh for url.
+ *
+ * @param {string} url
+ * @param {object} parsedUrl
+ * @return {boolean}
+ * @private
+ */
+
+function fresh (url, parsedUrl) {
+ return typeof parsedUrl === 'object' &&
+ parsedUrl !== null &&
+ (Url === undefined || parsedUrl instanceof Url) &&
+ parsedUrl._raw === url
+}
diff --git a/node_modules/parseurl/package.json b/node_modules/parseurl/package.json
new file mode 100644
index 0000000000000000000000000000000000000000..6b443ca7a84aa09444101a104dd8f8946dc9fa58
--- /dev/null
+++ b/node_modules/parseurl/package.json
@@ -0,0 +1,40 @@
+{
+ "name": "parseurl",
+ "description": "parse a url with memoization",
+ "version": "1.3.3",
+ "contributors": [
+ "Douglas Christopher Wilson ",
+ "Jonathan Ong (http://jongleberry.com)"
+ ],
+ "repository": "pillarjs/parseurl",
+ "license": "MIT",
+ "devDependencies": {
+ "beautify-benchmark": "0.2.4",
+ "benchmark": "2.1.4",
+ "eslint": "5.16.0",
+ "eslint-config-standard": "12.0.0",
+ "eslint-plugin-import": "2.17.1",
+ "eslint-plugin-node": "7.0.1",
+ "eslint-plugin-promise": "4.1.1",
+ "eslint-plugin-standard": "4.0.0",
+ "fast-url-parser": "1.1.3",
+ "istanbul": "0.4.5",
+ "mocha": "6.1.3"
+ },
+ "files": [
+ "LICENSE",
+ "HISTORY.md",
+ "README.md",
+ "index.js"
+ ],
+ "engines": {
+ "node": ">= 0.8"
+ },
+ "scripts": {
+ "bench": "node benchmark/index.js",
+ "lint": "eslint .",
+ "test": "mocha --check-leaks --bail --reporter spec test/",
+ "test-cov": "istanbul cover node_modules/mocha/bin/_mocha -- --check-leaks --reporter dot test/",
+ "test-travis": "istanbul cover node_modules/mocha/bin/_mocha --report lcovonly -- --check-leaks --reporter spec test/"
+ }
+}
diff --git a/node_modules/path-browserify/.github/FUNDING.yml b/node_modules/path-browserify/.github/FUNDING.yml
new file mode 100644
index 0000000000000000000000000000000000000000..a163f0e4c7269b3c229daeb5b60626cfe6257565
--- /dev/null
+++ b/node_modules/path-browserify/.github/FUNDING.yml
@@ -0,0 +1,12 @@
+# These are supported funding model platforms
+
+github: # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2]
+patreon: # Replace with a single Patreon username
+open_collective: # Replace with a single Open Collective username
+ko_fi: # Replace with a single Ko-fi username
+tidelift: npm/path-browserify
+community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry
+liberapay: # Replace with a single Liberapay username
+issuehunt: # Replace with a single IssueHunt username
+otechie: # Replace with a single Otechie username
+custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2']
diff --git a/node_modules/path-browserify/.travis.yml b/node_modules/path-browserify/.travis.yml
new file mode 100644
index 0000000000000000000000000000000000000000..b14ef45bbdfb70fcf5b808c92f3c8b6fbc35ff6a
--- /dev/null
+++ b/node_modules/path-browserify/.travis.yml
@@ -0,0 +1,16 @@
+language: node_js
+sudo: false
+node_js:
+ - "10"
+ - "9"
+ - "8"
+ - "6"
+ - "4"
+ - "iojs"
+ - "0.12"
+ - "0.10"
+ - "0.8"
+before_install:
+ # Old npm certs are untrusted https://github.com/npm/npm/issues/20191
+ - 'if [ "${TRAVIS_NODE_VERSION}" = "0.6" ] || [ "${TRAVIS_NODE_VERSION}" = "0.8" ]; then export NPM_CONFIG_STRICT_SSL=false; fi'
+ - 'nvm install-latest-npm'
diff --git a/node_modules/path-browserify/CHANGELOG.md b/node_modules/path-browserify/CHANGELOG.md
new file mode 100644
index 0000000000000000000000000000000000000000..957fb130e3c26bd8f80d2c6d3077628641316e49
--- /dev/null
+++ b/node_modules/path-browserify/CHANGELOG.md
@@ -0,0 +1,20 @@
+# path-browserify change log
+
+All notable changes to this project will be documented in this file.
+
+This project adheres to [Semantic Versioning](http://semver.org/).
+
+## 1.0.1
+* Fix a duplicate test name.
+* Tweak LICENSE text so Github can recognise it.
+* Tweak LICENSE text to include the year and author.
+* Add security policy file.
+
+## 1.0.0
+This release updates to the Node v10.3.0 API. **This change is breaking**,
+because path methods now throw errors when called with arguments that are not
+strings.
+
+* Add `path.parse` and `path.format`.
+* Add `path.posix` as an alias to `path`.
+* Port tests from Node.js.
diff --git a/node_modules/path-browserify/LICENSE b/node_modules/path-browserify/LICENSE
new file mode 100644
index 0000000000000000000000000000000000000000..f52ee8c7249baebfc063b5284958105b199bc2c2
--- /dev/null
+++ b/node_modules/path-browserify/LICENSE
@@ -0,0 +1,20 @@
+MIT License
+
+Copyright (c) 2013 James Halliday
+
+Permission is hereby granted, free of charge, to any person obtaining a copy of
+this software and associated documentation files (the "Software"), to deal in
+the Software without restriction, including without limitation the rights to
+use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
+the Software, and to permit persons to whom the Software is furnished to do so,
+subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
+FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
+COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
+IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
diff --git a/node_modules/path-browserify/README.md b/node_modules/path-browserify/README.md
new file mode 100644
index 0000000000000000000000000000000000000000..2f639c2477b348401c39d629dbb7215e4a057794
--- /dev/null
+++ b/node_modules/path-browserify/README.md
@@ -0,0 +1,45 @@
+# path-browserify [](https://travis-ci.org/browserify/path-browserify)
+
+> The `path` module from Node.js for browsers
+
+This implements the Node.js [`path`][path] module for environments that do not have it, like browsers.
+
+> `path-browserify` currently matches the **Node.js 10.3** API.
+
+## Install
+
+You usually do not have to install `path-browserify` yourself! If your code runs in Node.js, `path` is built in. If your code runs in the browser, bundlers like [browserify](https://github.com/browserify/browserify) or [webpack](https://github.com/webpack/webpack) include the `path-browserify` module by default.
+
+But if none of those apply, with npm do:
+
+```
+npm install path-browserify
+```
+
+## Usage
+
+```javascript
+var path = require('path')
+
+var filename = 'logo.png';
+var logo = path.join('./assets/img', filename);
+document.querySelector('#logo').src = logo;
+```
+
+## API
+
+See the [Node.js path docs][path]. `path-browserify` currently matches the Node.js 10.3 API.
+`path-browserify` only implements the POSIX functions, not the win32 ones.
+
+## Contributing
+
+PRs are very welcome! The main way to contribute to `path-browserify` is by porting features, bugfixes and tests from Node.js. Ideally, code contributions to this module are copy-pasted from Node.js and transpiled to ES5, rather than reimplemented from scratch. Matching the Node.js code as closely as possible makes maintenance simpler when new changes land in Node.js.
+This module intends to provide exactly the same API as Node.js, so features that are not available in the core `path` module will not be accepted. Feature requests should instead be directed at [nodejs/node](https://github.com/nodejs/node) and will be added to this module once they are implemented in Node.js.
+
+If there is a difference in behaviour between Node.js's `path` module and this module, please open an issue!
+
+## License
+
+[MIT](./LICENSE)
+
+[path]: https://nodejs.org/docs/v10.3.0/api/path.html
diff --git a/node_modules/path-browserify/index.js b/node_modules/path-browserify/index.js
new file mode 100644
index 0000000000000000000000000000000000000000..24235288130acf35900f66f60c350d19583816e6
--- /dev/null
+++ b/node_modules/path-browserify/index.js
@@ -0,0 +1,529 @@
+// 'path' module extracted from Node.js v8.11.1 (only the posix part)
+// transplited with Babel
+
+// Copyright Joyent, Inc. and other Node contributors.
+//
+// Permission is hereby granted, free of charge, to any person obtaining a
+// copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to permit
+// persons to whom the Software is furnished to do so, subject to the
+// following conditions:
+//
+// The above copyright notice and this permission notice shall be included
+// in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
+// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
+// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
+// USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+'use strict';
+
+function assertPath(path) {
+ if (typeof path !== 'string') {
+ throw new TypeError('Path must be a string. Received ' + JSON.stringify(path));
+ }
+}
+
+// Resolves . and .. elements in a path with directory names
+function normalizeStringPosix(path, allowAboveRoot) {
+ var res = '';
+ var lastSegmentLength = 0;
+ var lastSlash = -1;
+ var dots = 0;
+ var code;
+ for (var i = 0; i <= path.length; ++i) {
+ if (i < path.length)
+ code = path.charCodeAt(i);
+ else if (code === 47 /*/*/)
+ break;
+ else
+ code = 47 /*/*/;
+ if (code === 47 /*/*/) {
+ if (lastSlash === i - 1 || dots === 1) {
+ // NOOP
+ } else if (lastSlash !== i - 1 && dots === 2) {
+ if (res.length < 2 || lastSegmentLength !== 2 || res.charCodeAt(res.length - 1) !== 46 /*.*/ || res.charCodeAt(res.length - 2) !== 46 /*.*/) {
+ if (res.length > 2) {
+ var lastSlashIndex = res.lastIndexOf('/');
+ if (lastSlashIndex !== res.length - 1) {
+ if (lastSlashIndex === -1) {
+ res = '';
+ lastSegmentLength = 0;
+ } else {
+ res = res.slice(0, lastSlashIndex);
+ lastSegmentLength = res.length - 1 - res.lastIndexOf('/');
+ }
+ lastSlash = i;
+ dots = 0;
+ continue;
+ }
+ } else if (res.length === 2 || res.length === 1) {
+ res = '';
+ lastSegmentLength = 0;
+ lastSlash = i;
+ dots = 0;
+ continue;
+ }
+ }
+ if (allowAboveRoot) {
+ if (res.length > 0)
+ res += '/..';
+ else
+ res = '..';
+ lastSegmentLength = 2;
+ }
+ } else {
+ if (res.length > 0)
+ res += '/' + path.slice(lastSlash + 1, i);
+ else
+ res = path.slice(lastSlash + 1, i);
+ lastSegmentLength = i - lastSlash - 1;
+ }
+ lastSlash = i;
+ dots = 0;
+ } else if (code === 46 /*.*/ && dots !== -1) {
+ ++dots;
+ } else {
+ dots = -1;
+ }
+ }
+ return res;
+}
+
+function _format(sep, pathObject) {
+ var dir = pathObject.dir || pathObject.root;
+ var base = pathObject.base || (pathObject.name || '') + (pathObject.ext || '');
+ if (!dir) {
+ return base;
+ }
+ if (dir === pathObject.root) {
+ return dir + base;
+ }
+ return dir + sep + base;
+}
+
+var posix = {
+ // path.resolve([from ...], to)
+ resolve: function resolve() {
+ var resolvedPath = '';
+ var resolvedAbsolute = false;
+ var cwd;
+
+ for (var i = arguments.length - 1; i >= -1 && !resolvedAbsolute; i--) {
+ var path;
+ if (i >= 0)
+ path = arguments[i];
+ else {
+ if (cwd === undefined)
+ cwd = process.cwd();
+ path = cwd;
+ }
+
+ assertPath(path);
+
+ // Skip empty entries
+ if (path.length === 0) {
+ continue;
+ }
+
+ resolvedPath = path + '/' + resolvedPath;
+ resolvedAbsolute = path.charCodeAt(0) === 47 /*/*/;
+ }
+
+ // At this point the path should be resolved to a full absolute path, but
+ // handle relative paths to be safe (might happen when process.cwd() fails)
+
+ // Normalize the path
+ resolvedPath = normalizeStringPosix(resolvedPath, !resolvedAbsolute);
+
+ if (resolvedAbsolute) {
+ if (resolvedPath.length > 0)
+ return '/' + resolvedPath;
+ else
+ return '/';
+ } else if (resolvedPath.length > 0) {
+ return resolvedPath;
+ } else {
+ return '.';
+ }
+ },
+
+ normalize: function normalize(path) {
+ assertPath(path);
+
+ if (path.length === 0) return '.';
+
+ var isAbsolute = path.charCodeAt(0) === 47 /*/*/;
+ var trailingSeparator = path.charCodeAt(path.length - 1) === 47 /*/*/;
+
+ // Normalize the path
+ path = normalizeStringPosix(path, !isAbsolute);
+
+ if (path.length === 0 && !isAbsolute) path = '.';
+ if (path.length > 0 && trailingSeparator) path += '/';
+
+ if (isAbsolute) return '/' + path;
+ return path;
+ },
+
+ isAbsolute: function isAbsolute(path) {
+ assertPath(path);
+ return path.length > 0 && path.charCodeAt(0) === 47 /*/*/;
+ },
+
+ join: function join() {
+ if (arguments.length === 0)
+ return '.';
+ var joined;
+ for (var i = 0; i < arguments.length; ++i) {
+ var arg = arguments[i];
+ assertPath(arg);
+ if (arg.length > 0) {
+ if (joined === undefined)
+ joined = arg;
+ else
+ joined += '/' + arg;
+ }
+ }
+ if (joined === undefined)
+ return '.';
+ return posix.normalize(joined);
+ },
+
+ relative: function relative(from, to) {
+ assertPath(from);
+ assertPath(to);
+
+ if (from === to) return '';
+
+ from = posix.resolve(from);
+ to = posix.resolve(to);
+
+ if (from === to) return '';
+
+ // Trim any leading backslashes
+ var fromStart = 1;
+ for (; fromStart < from.length; ++fromStart) {
+ if (from.charCodeAt(fromStart) !== 47 /*/*/)
+ break;
+ }
+ var fromEnd = from.length;
+ var fromLen = fromEnd - fromStart;
+
+ // Trim any leading backslashes
+ var toStart = 1;
+ for (; toStart < to.length; ++toStart) {
+ if (to.charCodeAt(toStart) !== 47 /*/*/)
+ break;
+ }
+ var toEnd = to.length;
+ var toLen = toEnd - toStart;
+
+ // Compare paths to find the longest common path from root
+ var length = fromLen < toLen ? fromLen : toLen;
+ var lastCommonSep = -1;
+ var i = 0;
+ for (; i <= length; ++i) {
+ if (i === length) {
+ if (toLen > length) {
+ if (to.charCodeAt(toStart + i) === 47 /*/*/) {
+ // We get here if `from` is the exact base path for `to`.
+ // For example: from='/foo/bar'; to='/foo/bar/baz'
+ return to.slice(toStart + i + 1);
+ } else if (i === 0) {
+ // We get here if `from` is the root
+ // For example: from='/'; to='/foo'
+ return to.slice(toStart + i);
+ }
+ } else if (fromLen > length) {
+ if (from.charCodeAt(fromStart + i) === 47 /*/*/) {
+ // We get here if `to` is the exact base path for `from`.
+ // For example: from='/foo/bar/baz'; to='/foo/bar'
+ lastCommonSep = i;
+ } else if (i === 0) {
+ // We get here if `to` is the root.
+ // For example: from='/foo'; to='/'
+ lastCommonSep = 0;
+ }
+ }
+ break;
+ }
+ var fromCode = from.charCodeAt(fromStart + i);
+ var toCode = to.charCodeAt(toStart + i);
+ if (fromCode !== toCode)
+ break;
+ else if (fromCode === 47 /*/*/)
+ lastCommonSep = i;
+ }
+
+ var out = '';
+ // Generate the relative path based on the path difference between `to`
+ // and `from`
+ for (i = fromStart + lastCommonSep + 1; i <= fromEnd; ++i) {
+ if (i === fromEnd || from.charCodeAt(i) === 47 /*/*/) {
+ if (out.length === 0)
+ out += '..';
+ else
+ out += '/..';
+ }
+ }
+
+ // Lastly, append the rest of the destination (`to`) path that comes after
+ // the common path parts
+ if (out.length > 0)
+ return out + to.slice(toStart + lastCommonSep);
+ else {
+ toStart += lastCommonSep;
+ if (to.charCodeAt(toStart) === 47 /*/*/)
+ ++toStart;
+ return to.slice(toStart);
+ }
+ },
+
+ _makeLong: function _makeLong(path) {
+ return path;
+ },
+
+ dirname: function dirname(path) {
+ assertPath(path);
+ if (path.length === 0) return '.';
+ var code = path.charCodeAt(0);
+ var hasRoot = code === 47 /*/*/;
+ var end = -1;
+ var matchedSlash = true;
+ for (var i = path.length - 1; i >= 1; --i) {
+ code = path.charCodeAt(i);
+ if (code === 47 /*/*/) {
+ if (!matchedSlash) {
+ end = i;
+ break;
+ }
+ } else {
+ // We saw the first non-path separator
+ matchedSlash = false;
+ }
+ }
+
+ if (end === -1) return hasRoot ? '/' : '.';
+ if (hasRoot && end === 1) return '//';
+ return path.slice(0, end);
+ },
+
+ basename: function basename(path, ext) {
+ if (ext !== undefined && typeof ext !== 'string') throw new TypeError('"ext" argument must be a string');
+ assertPath(path);
+
+ var start = 0;
+ var end = -1;
+ var matchedSlash = true;
+ var i;
+
+ if (ext !== undefined && ext.length > 0 && ext.length <= path.length) {
+ if (ext.length === path.length && ext === path) return '';
+ var extIdx = ext.length - 1;
+ var firstNonSlashEnd = -1;
+ for (i = path.length - 1; i >= 0; --i) {
+ var code = path.charCodeAt(i);
+ if (code === 47 /*/*/) {
+ // If we reached a path separator that was not part of a set of path
+ // separators at the end of the string, stop now
+ if (!matchedSlash) {
+ start = i + 1;
+ break;
+ }
+ } else {
+ if (firstNonSlashEnd === -1) {
+ // We saw the first non-path separator, remember this index in case
+ // we need it if the extension ends up not matching
+ matchedSlash = false;
+ firstNonSlashEnd = i + 1;
+ }
+ if (extIdx >= 0) {
+ // Try to match the explicit extension
+ if (code === ext.charCodeAt(extIdx)) {
+ if (--extIdx === -1) {
+ // We matched the extension, so mark this as the end of our path
+ // component
+ end = i;
+ }
+ } else {
+ // Extension does not match, so our result is the entire path
+ // component
+ extIdx = -1;
+ end = firstNonSlashEnd;
+ }
+ }
+ }
+ }
+
+ if (start === end) end = firstNonSlashEnd;else if (end === -1) end = path.length;
+ return path.slice(start, end);
+ } else {
+ for (i = path.length - 1; i >= 0; --i) {
+ if (path.charCodeAt(i) === 47 /*/*/) {
+ // If we reached a path separator that was not part of a set of path
+ // separators at the end of the string, stop now
+ if (!matchedSlash) {
+ start = i + 1;
+ break;
+ }
+ } else if (end === -1) {
+ // We saw the first non-path separator, mark this as the end of our
+ // path component
+ matchedSlash = false;
+ end = i + 1;
+ }
+ }
+
+ if (end === -1) return '';
+ return path.slice(start, end);
+ }
+ },
+
+ extname: function extname(path) {
+ assertPath(path);
+ var startDot = -1;
+ var startPart = 0;
+ var end = -1;
+ var matchedSlash = true;
+ // Track the state of characters (if any) we see before our first dot and
+ // after any path separator we find
+ var preDotState = 0;
+ for (var i = path.length - 1; i >= 0; --i) {
+ var code = path.charCodeAt(i);
+ if (code === 47 /*/*/) {
+ // If we reached a path separator that was not part of a set of path
+ // separators at the end of the string, stop now
+ if (!matchedSlash) {
+ startPart = i + 1;
+ break;
+ }
+ continue;
+ }
+ if (end === -1) {
+ // We saw the first non-path separator, mark this as the end of our
+ // extension
+ matchedSlash = false;
+ end = i + 1;
+ }
+ if (code === 46 /*.*/) {
+ // If this is our first dot, mark it as the start of our extension
+ if (startDot === -1)
+ startDot = i;
+ else if (preDotState !== 1)
+ preDotState = 1;
+ } else if (startDot !== -1) {
+ // We saw a non-dot and non-path separator before our dot, so we should
+ // have a good chance at having a non-empty extension
+ preDotState = -1;
+ }
+ }
+
+ if (startDot === -1 || end === -1 ||
+ // We saw a non-dot character immediately before the dot
+ preDotState === 0 ||
+ // The (right-most) trimmed path component is exactly '..'
+ preDotState === 1 && startDot === end - 1 && startDot === startPart + 1) {
+ return '';
+ }
+ return path.slice(startDot, end);
+ },
+
+ format: function format(pathObject) {
+ if (pathObject === null || typeof pathObject !== 'object') {
+ throw new TypeError('The "pathObject" argument must be of type Object. Received type ' + typeof pathObject);
+ }
+ return _format('/', pathObject);
+ },
+
+ parse: function parse(path) {
+ assertPath(path);
+
+ var ret = { root: '', dir: '', base: '', ext: '', name: '' };
+ if (path.length === 0) return ret;
+ var code = path.charCodeAt(0);
+ var isAbsolute = code === 47 /*/*/;
+ var start;
+ if (isAbsolute) {
+ ret.root = '/';
+ start = 1;
+ } else {
+ start = 0;
+ }
+ var startDot = -1;
+ var startPart = 0;
+ var end = -1;
+ var matchedSlash = true;
+ var i = path.length - 1;
+
+ // Track the state of characters (if any) we see before our first dot and
+ // after any path separator we find
+ var preDotState = 0;
+
+ // Get non-dir info
+ for (; i >= start; --i) {
+ code = path.charCodeAt(i);
+ if (code === 47 /*/*/) {
+ // If we reached a path separator that was not part of a set of path
+ // separators at the end of the string, stop now
+ if (!matchedSlash) {
+ startPart = i + 1;
+ break;
+ }
+ continue;
+ }
+ if (end === -1) {
+ // We saw the first non-path separator, mark this as the end of our
+ // extension
+ matchedSlash = false;
+ end = i + 1;
+ }
+ if (code === 46 /*.*/) {
+ // If this is our first dot, mark it as the start of our extension
+ if (startDot === -1) startDot = i;else if (preDotState !== 1) preDotState = 1;
+ } else if (startDot !== -1) {
+ // We saw a non-dot and non-path separator before our dot, so we should
+ // have a good chance at having a non-empty extension
+ preDotState = -1;
+ }
+ }
+
+ if (startDot === -1 || end === -1 ||
+ // We saw a non-dot character immediately before the dot
+ preDotState === 0 ||
+ // The (right-most) trimmed path component is exactly '..'
+ preDotState === 1 && startDot === end - 1 && startDot === startPart + 1) {
+ if (end !== -1) {
+ if (startPart === 0 && isAbsolute) ret.base = ret.name = path.slice(1, end);else ret.base = ret.name = path.slice(startPart, end);
+ }
+ } else {
+ if (startPart === 0 && isAbsolute) {
+ ret.name = path.slice(1, startDot);
+ ret.base = path.slice(1, end);
+ } else {
+ ret.name = path.slice(startPart, startDot);
+ ret.base = path.slice(startPart, end);
+ }
+ ret.ext = path.slice(startDot, end);
+ }
+
+ if (startPart > 0) ret.dir = path.slice(0, startPart - 1);else if (isAbsolute) ret.dir = '/';
+
+ return ret;
+ },
+
+ sep: '/',
+ delimiter: ':',
+ win32: null,
+ posix: null
+};
+
+posix.posix = posix;
+
+module.exports = posix;
diff --git a/node_modules/path-browserify/package.json b/node_modules/path-browserify/package.json
new file mode 100644
index 0000000000000000000000000000000000000000..821e0cf4b392b86d2b3f2395a81ef8bc18af15c2
--- /dev/null
+++ b/node_modules/path-browserify/package.json
@@ -0,0 +1,30 @@
+{
+ "name": "path-browserify",
+ "description": "the path module from node core for browsers",
+ "version": "1.0.1",
+ "author": {
+ "name": "James Halliday",
+ "email": "mail@substack.net",
+ "url": "http://substack.net"
+ },
+ "bugs": "https://github.com/browserify/path-browserify/issues",
+ "dependencies": {},
+ "devDependencies": {
+ "tape": "^4.9.0"
+ },
+ "homepage": "https://github.com/browserify/path-browserify",
+ "keywords": [
+ "browser",
+ "browserify",
+ "path"
+ ],
+ "license": "MIT",
+ "main": "index.js",
+ "repository": {
+ "type": "git",
+ "url": "git://github.com/browserify/path-browserify.git"
+ },
+ "scripts": {
+ "test": "node test"
+ }
+}
diff --git a/node_modules/path-browserify/security.md b/node_modules/path-browserify/security.md
new file mode 100644
index 0000000000000000000000000000000000000000..a14ace6a57db70992630a568df6a7bf57763d26b
--- /dev/null
+++ b/node_modules/path-browserify/security.md
@@ -0,0 +1,10 @@
+# Security Policy
+
+## Supported Versions
+Only the latest major version is supported at any given time.
+
+## Reporting a Vulnerability
+
+To report a security vulnerability, please use the
+[Tidelift security contact](https://tidelift.com/security).
+Tidelift will coordinate the fix and disclosure.
diff --git a/node_modules/path-browserify/test/index.js b/node_modules/path-browserify/test/index.js
new file mode 100644
index 0000000000000000000000000000000000000000..a0fbe2bd10c6ba09b917f22e821f4df737d1a40b
--- /dev/null
+++ b/node_modules/path-browserify/test/index.js
@@ -0,0 +1,9 @@
+require('./test-path');
+require('./test-path-basename');
+require('./test-path-dirname');
+require('./test-path-extname');
+require('./test-path-isabsolute');
+require('./test-path-join');
+require('./test-path-relative');
+require('./test-path-resolve');
+require('./test-path-zero-length-strings');
diff --git a/node_modules/path-browserify/test/test-path-basename.js b/node_modules/path-browserify/test/test-path-basename.js
new file mode 100644
index 0000000000000000000000000000000000000000..81fa1dcefdee3c9b2eb016607faa055aeb87db85
--- /dev/null
+++ b/node_modules/path-browserify/test/test-path-basename.js
@@ -0,0 +1,79 @@
+'use strict';
+var tape = require('tape');
+var path = require('../');
+
+tape('path.basename', function (t) {
+ t.strictEqual(path.basename(__filename), 'test-path-basename.js');
+ t.strictEqual(path.basename(__filename, '.js'), 'test-path-basename');
+ t.strictEqual(path.basename('.js', '.js'), '');
+ t.strictEqual(path.basename(''), '');
+ t.strictEqual(path.basename('/dir/basename.ext'), 'basename.ext');
+ t.strictEqual(path.basename('/basename.ext'), 'basename.ext');
+ t.strictEqual(path.basename('basename.ext'), 'basename.ext');
+ t.strictEqual(path.basename('basename.ext/'), 'basename.ext');
+ t.strictEqual(path.basename('basename.ext//'), 'basename.ext');
+ t.strictEqual(path.basename('aaa/bbb', '/bbb'), 'bbb');
+ t.strictEqual(path.basename('aaa/bbb', 'a/bbb'), 'bbb');
+ t.strictEqual(path.basename('aaa/bbb', 'bbb'), 'bbb');
+ t.strictEqual(path.basename('aaa/bbb//', 'bbb'), 'bbb');
+ t.strictEqual(path.basename('aaa/bbb', 'bb'), 'b');
+ t.strictEqual(path.basename('aaa/bbb', 'b'), 'bb');
+ t.strictEqual(path.basename('/aaa/bbb', '/bbb'), 'bbb');
+ t.strictEqual(path.basename('/aaa/bbb', 'a/bbb'), 'bbb');
+ t.strictEqual(path.basename('/aaa/bbb', 'bbb'), 'bbb');
+ t.strictEqual(path.basename('/aaa/bbb//', 'bbb'), 'bbb');
+ t.strictEqual(path.basename('/aaa/bbb', 'bb'), 'b');
+ t.strictEqual(path.basename('/aaa/bbb', 'b'), 'bb');
+ t.strictEqual(path.basename('/aaa/bbb'), 'bbb');
+ t.strictEqual(path.basename('/aaa/'), 'aaa');
+ t.strictEqual(path.basename('/aaa/b'), 'b');
+ t.strictEqual(path.basename('/a/b'), 'b');
+ t.strictEqual(path.basename('//a'), 'a');
+ t.end();
+})
+
+tape('path.win32.basename', { skip: true }, function (t) {
+ // On Windows a backslash acts as a path separator.
+ t.strictEqual(path.win32.basename('\\dir\\basename.ext'), 'basename.ext');
+ t.strictEqual(path.win32.basename('\\basename.ext'), 'basename.ext');
+ t.strictEqual(path.win32.basename('basename.ext'), 'basename.ext');
+ t.strictEqual(path.win32.basename('basename.ext\\'), 'basename.ext');
+ t.strictEqual(path.win32.basename('basename.ext\\\\'), 'basename.ext');
+ t.strictEqual(path.win32.basename('foo'), 'foo');
+ t.strictEqual(path.win32.basename('aaa\\bbb', '\\bbb'), 'bbb');
+ t.strictEqual(path.win32.basename('aaa\\bbb', 'a\\bbb'), 'bbb');
+ t.strictEqual(path.win32.basename('aaa\\bbb', 'bbb'), 'bbb');
+ t.strictEqual(path.win32.basename('aaa\\bbb\\\\\\\\', 'bbb'), 'bbb');
+ t.strictEqual(path.win32.basename('aaa\\bbb', 'bb'), 'b');
+ t.strictEqual(path.win32.basename('aaa\\bbb', 'b'), 'bb');
+ t.strictEqual(path.win32.basename('C:'), '');
+ t.strictEqual(path.win32.basename('C:.'), '.');
+ t.strictEqual(path.win32.basename('C:\\'), '');
+ t.strictEqual(path.win32.basename('C:\\dir\\base.ext'), 'base.ext');
+ t.strictEqual(path.win32.basename('C:\\basename.ext'), 'basename.ext');
+ t.strictEqual(path.win32.basename('C:basename.ext'), 'basename.ext');
+ t.strictEqual(path.win32.basename('C:basename.ext\\'), 'basename.ext');
+ t.strictEqual(path.win32.basename('C:basename.ext\\\\'), 'basename.ext');
+ t.strictEqual(path.win32.basename('C:foo'), 'foo');
+ t.strictEqual(path.win32.basename('file:stream'), 'file:stream');
+ t.end();
+});
+
+tape('On unix a backslash is just treated as any other character.', function (t) {
+ t.strictEqual(path.posix.basename('\\dir\\basename.ext'),
+ '\\dir\\basename.ext');
+ t.strictEqual(path.posix.basename('\\basename.ext'), '\\basename.ext');
+ t.strictEqual(path.posix.basename('basename.ext'), 'basename.ext');
+ t.strictEqual(path.posix.basename('basename.ext\\'), 'basename.ext\\');
+ t.strictEqual(path.posix.basename('basename.ext\\\\'), 'basename.ext\\\\');
+ t.strictEqual(path.posix.basename('foo'), 'foo');
+ t.end();
+});
+
+tape('POSIX filenames may include control characters', function (t) {
+ // c.f. http://www.dwheeler.com/essays/fixing-unix-linux-filenames.html
+ var controlCharFilename = "Icon" + (String.fromCharCode(13));
+ t.strictEqual(path.posix.basename(("/a/b/" + controlCharFilename)),
+ controlCharFilename);
+ t.end();
+});
diff --git a/node_modules/path-browserify/test/test-path-dirname.js b/node_modules/path-browserify/test/test-path-dirname.js
new file mode 100644
index 0000000000000000000000000000000000000000..c775071aad620546a7de955be6514c944fe8a58a
--- /dev/null
+++ b/node_modules/path-browserify/test/test-path-dirname.js
@@ -0,0 +1,58 @@
+'use strict';
+var tape = require('tape');
+var path = require('../');
+
+tape('path.posix.dirname', function (t) {
+ t.strictEqual(path.posix.dirname('/a/b/'), '/a');
+ t.strictEqual(path.posix.dirname('/a/b'), '/a');
+ t.strictEqual(path.posix.dirname('/a'), '/');
+ t.strictEqual(path.posix.dirname(''), '.');
+ t.strictEqual(path.posix.dirname('/'), '/');
+ t.strictEqual(path.posix.dirname('////'), '/');
+ t.strictEqual(path.posix.dirname('//a'), '//');
+ t.strictEqual(path.posix.dirname('foo'), '.');
+ t.end();
+});
+
+tape('path.win32.dirname', { skip: true }, function (t) {
+ t.strictEqual(path.win32.dirname('c:\\'), 'c:\\');
+ t.strictEqual(path.win32.dirname('c:\\foo'), 'c:\\');
+ t.strictEqual(path.win32.dirname('c:\\foo\\'), 'c:\\');
+ t.strictEqual(path.win32.dirname('c:\\foo\\bar'), 'c:\\foo');
+ t.strictEqual(path.win32.dirname('c:\\foo\\bar\\'), 'c:\\foo');
+ t.strictEqual(path.win32.dirname('c:\\foo\\bar\\baz'), 'c:\\foo\\bar');
+ t.strictEqual(path.win32.dirname('\\'), '\\');
+ t.strictEqual(path.win32.dirname('\\foo'), '\\');
+ t.strictEqual(path.win32.dirname('\\foo\\'), '\\');
+ t.strictEqual(path.win32.dirname('\\foo\\bar'), '\\foo');
+ t.strictEqual(path.win32.dirname('\\foo\\bar\\'), '\\foo');
+ t.strictEqual(path.win32.dirname('\\foo\\bar\\baz'), '\\foo\\bar');
+ t.strictEqual(path.win32.dirname('c:'), 'c:');
+ t.strictEqual(path.win32.dirname('c:foo'), 'c:');
+ t.strictEqual(path.win32.dirname('c:foo\\'), 'c:');
+ t.strictEqual(path.win32.dirname('c:foo\\bar'), 'c:foo');
+ t.strictEqual(path.win32.dirname('c:foo\\bar\\'), 'c:foo');
+ t.strictEqual(path.win32.dirname('c:foo\\bar\\baz'), 'c:foo\\bar');
+ t.strictEqual(path.win32.dirname('file:stream'), '.');
+ t.strictEqual(path.win32.dirname('dir\\file:stream'), 'dir');
+ t.strictEqual(path.win32.dirname('\\\\unc\\share'),
+ '\\\\unc\\share');
+ t.strictEqual(path.win32.dirname('\\\\unc\\share\\foo'),
+ '\\\\unc\\share\\');
+ t.strictEqual(path.win32.dirname('\\\\unc\\share\\foo\\'),
+ '\\\\unc\\share\\');
+ t.strictEqual(path.win32.dirname('\\\\unc\\share\\foo\\bar'),
+ '\\\\unc\\share\\foo');
+ t.strictEqual(path.win32.dirname('\\\\unc\\share\\foo\\bar\\'),
+ '\\\\unc\\share\\foo');
+ t.strictEqual(path.win32.dirname('\\\\unc\\share\\foo\\bar\\baz'),
+ '\\\\unc\\share\\foo\\bar');
+ t.strictEqual(path.win32.dirname('/a/b/'), '/a');
+ t.strictEqual(path.win32.dirname('/a/b'), '/a');
+ t.strictEqual(path.win32.dirname('/a'), '/');
+ t.strictEqual(path.win32.dirname(''), '.');
+ t.strictEqual(path.win32.dirname('/'), '/');
+ t.strictEqual(path.win32.dirname('////'), '/');
+ t.strictEqual(path.win32.dirname('foo'), '.');
+ t.end();
+});
diff --git a/node_modules/path-browserify/test/test-path-extname.js b/node_modules/path-browserify/test/test-path-extname.js
new file mode 100644
index 0000000000000000000000000000000000000000..dab29d8a024186790c0d1faf94972009eb08f11f
--- /dev/null
+++ b/node_modules/path-browserify/test/test-path-extname.js
@@ -0,0 +1,96 @@
+'use strict';
+var tape = require('tape');
+var path = require('../');
+
+var slashRE = /\//g;
+
+var pairs = [
+ [__filename, '.js'],
+ ['', ''],
+ ['/path/to/file', ''],
+ ['/path/to/file.ext', '.ext'],
+ ['/path.to/file.ext', '.ext'],
+ ['/path.to/file', ''],
+ ['/path.to/.file', ''],
+ ['/path.to/.file.ext', '.ext'],
+ ['/path/to/f.ext', '.ext'],
+ ['/path/to/..ext', '.ext'],
+ ['/path/to/..', ''],
+ ['file', ''],
+ ['file.ext', '.ext'],
+ ['.file', ''],
+ ['.file.ext', '.ext'],
+ ['/file', ''],
+ ['/file.ext', '.ext'],
+ ['/.file', ''],
+ ['/.file.ext', '.ext'],
+ ['.path/file.ext', '.ext'],
+ ['file.ext.ext', '.ext'],
+ ['file.', '.'],
+ ['.', ''],
+ ['./', ''],
+ ['.file.ext', '.ext'],
+ ['.file', ''],
+ ['.file.', '.'],
+ ['.file..', '.'],
+ ['..', ''],
+ ['../', ''],
+ ['..file.ext', '.ext'],
+ ['..file', '.file'],
+ ['..file.', '.'],
+ ['..file..', '.'],
+ ['...', '.'],
+ ['...ext', '.ext'],
+ ['....', '.'],
+ ['file.ext/', '.ext'],
+ ['file.ext//', '.ext'],
+ ['file/', ''],
+ ['file//', ''],
+ ['file./', '.'],
+ ['file.//', '.'] ];
+
+tape('path.posix.extname', function (t) {
+ pairs.forEach(function (p) {
+ var input = p[0];
+ var expected = p[1];
+ t.strictEqual(expected, path.posix.extname(input));
+ });
+ t.end();
+});
+
+tape('path.win32.extname', { skip: true }, function (t) {
+ pairs.forEach(function (p) {
+ var input = p[0].replace(slashRE, '\\');
+ var expected = p[1];
+ t.strictEqual(expected, path.win32.extname(input));
+ t.strictEqual(expected, path.win32.extname("C:" + input));
+ });
+ t.end();
+});
+
+tape('path.win32.extname backslash', { skip: true }, function (t) {
+ // On Windows, backslash is a path separator.
+ t.strictEqual(path.win32.extname('.\\'), '');
+ t.strictEqual(path.win32.extname('..\\'), '');
+ t.strictEqual(path.win32.extname('file.ext\\'), '.ext');
+ t.strictEqual(path.win32.extname('file.ext\\\\'), '.ext');
+ t.strictEqual(path.win32.extname('file\\'), '');
+ t.strictEqual(path.win32.extname('file\\\\'), '');
+ t.strictEqual(path.win32.extname('file.\\'), '.');
+ t.strictEqual(path.win32.extname('file.\\\\'), '.');
+ t.end();
+});
+
+tape('path.posix.extname backslash', function (t) {
+ // On *nix, backslash is a valid name component like any other character.
+ t.strictEqual(path.posix.extname('.\\'), '');
+ t.strictEqual(path.posix.extname('..\\'), '.\\');
+ t.strictEqual(path.posix.extname('file.ext\\'), '.ext\\');
+ t.strictEqual(path.posix.extname('file.ext\\\\'), '.ext\\\\');
+ t.strictEqual(path.posix.extname('file\\'), '');
+ t.strictEqual(path.posix.extname('file\\\\'), '');
+ t.strictEqual(path.posix.extname('file.\\'), '.\\');
+ t.strictEqual(path.posix.extname('file.\\\\'), '.\\\\');
+ t.end();
+});
+
diff --git a/node_modules/path-browserify/test/test-path-isabsolute.js b/node_modules/path-browserify/test/test-path-isabsolute.js
new file mode 100644
index 0000000000000000000000000000000000000000..f7fe9e33d2001c921e81f7bb2b1ac85c16efec71
--- /dev/null
+++ b/node_modules/path-browserify/test/test-path-isabsolute.js
@@ -0,0 +1,33 @@
+'use strict';
+var tape = require('tape');
+var path = require('../');
+
+tape('path.win32.isAbsolute', { skip: true }, function (t) {
+ t.strictEqual(path.win32.isAbsolute('/'), true);
+ t.strictEqual(path.win32.isAbsolute('//'), true);
+ t.strictEqual(path.win32.isAbsolute('//server'), true);
+ t.strictEqual(path.win32.isAbsolute('//server/file'), true);
+ t.strictEqual(path.win32.isAbsolute('\\\\server\\file'), true);
+ t.strictEqual(path.win32.isAbsolute('\\\\server'), true);
+ t.strictEqual(path.win32.isAbsolute('\\\\'), true);
+ t.strictEqual(path.win32.isAbsolute('c'), false);
+ t.strictEqual(path.win32.isAbsolute('c:'), false);
+ t.strictEqual(path.win32.isAbsolute('c:\\'), true);
+ t.strictEqual(path.win32.isAbsolute('c:/'), true);
+ t.strictEqual(path.win32.isAbsolute('c://'), true);
+ t.strictEqual(path.win32.isAbsolute('C:/Users/'), true);
+ t.strictEqual(path.win32.isAbsolute('C:\\Users\\'), true);
+ t.strictEqual(path.win32.isAbsolute('C:cwd/another'), false);
+ t.strictEqual(path.win32.isAbsolute('C:cwd\\another'), false);
+ t.strictEqual(path.win32.isAbsolute('directory/directory'), false);
+ t.strictEqual(path.win32.isAbsolute('directory\\directory'), false);
+ t.end();
+});
+
+tape('path.posix.isAbsolute', function (t) {
+ t.strictEqual(path.posix.isAbsolute('/home/foo'), true);
+ t.strictEqual(path.posix.isAbsolute('/home/foo/..'), true);
+ t.strictEqual(path.posix.isAbsolute('bar/'), false);
+ t.strictEqual(path.posix.isAbsolute('./baz'), false);
+ t.end();
+});
diff --git a/node_modules/path-browserify/test/test-path-join.js b/node_modules/path-browserify/test/test-path-join.js
new file mode 100644
index 0000000000000000000000000000000000000000..086e4a97a22e1eca0ab54c27f41dd4730665ead5
--- /dev/null
+++ b/node_modules/path-browserify/test/test-path-join.js
@@ -0,0 +1,126 @@
+'use strict';
+var tape = require('tape');
+var path = require('../');
+
+var backslashRE = /\\/g;
+
+var joinTests =
+ // arguments result
+ [[['.', 'x/b', '..', '/b/c.js'], 'x/b/c.js'],
+ [[], '.'],
+ [['/.', 'x/b', '..', '/b/c.js'], '/x/b/c.js'],
+ [['/foo', '../../../bar'], '/bar'],
+ [['foo', '../../../bar'], '../../bar'],
+ [['foo/', '../../../bar'], '../../bar'],
+ [['foo/x', '../../../bar'], '../bar'],
+ [['foo/x', './bar'], 'foo/x/bar'],
+ [['foo/x/', './bar'], 'foo/x/bar'],
+ [['foo/x/', '.', 'bar'], 'foo/x/bar'],
+ [['./'], './'],
+ [['.', './'], './'],
+ [['.', '.', '.'], '.'],
+ [['.', './', '.'], '.'],
+ [['.', '/./', '.'], '.'],
+ [['.', '/////./', '.'], '.'],
+ [['.'], '.'],
+ [['', '.'], '.'],
+ [['', 'foo'], 'foo'],
+ [['foo', '/bar'], 'foo/bar'],
+ [['', '/foo'], '/foo'],
+ [['', '', '/foo'], '/foo'],
+ [['', '', 'foo'], 'foo'],
+ [['foo', ''], 'foo'],
+ [['foo/', ''], 'foo/'],
+ [['foo', '', '/bar'], 'foo/bar'],
+ [['./', '..', '/foo'], '../foo'],
+ [['./', '..', '..', '/foo'], '../../foo'],
+ [['.', '..', '..', '/foo'], '../../foo'],
+ [['', '..', '..', '/foo'], '../../foo'],
+ [['/'], '/'],
+ [['/', '.'], '/'],
+ [['/', '..'], '/'],
+ [['/', '..', '..'], '/'],
+ [[''], '.'],
+ [['', ''], '.'],
+ [[' /foo'], ' /foo'],
+ [[' ', 'foo'], ' /foo'],
+ [[' ', '.'], ' '],
+ [[' ', '/'], ' /'],
+ [[' ', ''], ' '],
+ [['/', 'foo'], '/foo'],
+ [['/', '/foo'], '/foo'],
+ [['/', '//foo'], '/foo'],
+ [['/', '', '/foo'], '/foo'],
+ [['', '/', 'foo'], '/foo'],
+ [['', '/', '/foo'], '/foo']
+ ];
+
+// Windows-specific join tests
+var windowsJoinTests =
+ [// arguments result
+ // UNC path expected
+ [['//foo/bar'], '\\\\foo\\bar\\'],
+ [['\\/foo/bar'], '\\\\foo\\bar\\'],
+ [['\\\\foo/bar'], '\\\\foo\\bar\\'],
+ // UNC path expected - server and share separate
+ [['//foo', 'bar'], '\\\\foo\\bar\\'],
+ [['//foo/', 'bar'], '\\\\foo\\bar\\'],
+ [['//foo', '/bar'], '\\\\foo\\bar\\'],
+ // UNC path expected - questionable
+ [['//foo', '', 'bar'], '\\\\foo\\bar\\'],
+ [['//foo/', '', 'bar'], '\\\\foo\\bar\\'],
+ [['//foo/', '', '/bar'], '\\\\foo\\bar\\'],
+ // UNC path expected - even more questionable
+ [['', '//foo', 'bar'], '\\\\foo\\bar\\'],
+ [['', '//foo/', 'bar'], '\\\\foo\\bar\\'],
+ [['', '//foo/', '/bar'], '\\\\foo\\bar\\'],
+ // No UNC path expected (no double slash in first component)
+ [['\\', 'foo/bar'], '\\foo\\bar'],
+ [['\\', '/foo/bar'], '\\foo\\bar'],
+ [['', '/', '/foo/bar'], '\\foo\\bar'],
+ // No UNC path expected (no non-slashes in first component -
+ // questionable)
+ [['//', 'foo/bar'], '\\foo\\bar'],
+ [['//', '/foo/bar'], '\\foo\\bar'],
+ [['\\\\', '/', '/foo/bar'], '\\foo\\bar'],
+ [['//'], '/'],
+ // No UNC path expected (share name missing - questionable).
+ [['//foo'], '\\foo'],
+ [['//foo/'], '\\foo\\'],
+ [['//foo', '/'], '\\foo\\'],
+ [['//foo', '', '/'], '\\foo\\'],
+ // No UNC path expected (too many leading slashes - questionable)
+ [['///foo/bar'], '\\foo\\bar'],
+ [['////foo', 'bar'], '\\foo\\bar'],
+ [['\\\\\\/foo/bar'], '\\foo\\bar'],
+ // Drive-relative vs drive-absolute paths. This merely describes the
+ // status quo, rather than being obviously right
+ [['c:'], 'c:.'],
+ [['c:.'], 'c:.'],
+ [['c:', ''], 'c:.'],
+ [['', 'c:'], 'c:.'],
+ [['c:.', '/'], 'c:.\\'],
+ [['c:.', 'file'], 'c:file'],
+ [['c:', '/'], 'c:\\'],
+ [['c:', 'file'], 'c:\\file']
+ ];
+
+tape('path.posix.join', function (t) {
+ joinTests.forEach(function (p) {
+ var actual = path.posix.join.apply(null, p[0]);
+ t.strictEqual(actual, p[1]);
+ });
+ t.end();
+});
+
+tape('path.win32.join', { skip: true }, function (t) {
+ joinTests.forEach(function (p) {
+ var actual = path.win32.join.apply(null, p[0]).replace(backslashRE, '/');
+ t.strictEqual(actual, p[1]);
+ });
+ windowsJoinTests.forEach(function (p) {
+ var actual = path.win32.join.apply(null, p[0]);
+ t.strictEqual(actual, p[1]);
+ });
+ t.end();
+});
diff --git a/node_modules/path-browserify/test/test-path-parse-format.js b/node_modules/path-browserify/test/test-path-parse-format.js
new file mode 100644
index 0000000000000000000000000000000000000000..aea48b2fbf0e8f6f0d63b273ae6674e62ccd5857
--- /dev/null
+++ b/node_modules/path-browserify/test/test-path-parse-format.js
@@ -0,0 +1,235 @@
+// Copyright Joyent, Inc. and other Node contributors.
+//
+// Permission is hereby granted, free of charge, to any person obtaining a
+// copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to permit
+// persons to whom the Software is furnished to do so, subject to the
+// following conditions:
+//
+// The above copyright notice and this permission notice shall be included
+// in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
+// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
+// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
+// USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+'use strict';
+var tape = require('tape');
+var path = require('../');
+
+var winPaths = [
+ // [path, root]
+ ['C:\\path\\dir\\index.html', 'C:\\'],
+ ['C:\\another_path\\DIR\\1\\2\\33\\\\index', 'C:\\'],
+ ['another_path\\DIR with spaces\\1\\2\\33\\index', ''],
+ ['\\', '\\'],
+ ['\\foo\\C:', '\\'],
+ ['file', ''],
+ ['file:stream', ''],
+ ['.\\file', ''],
+ ['C:', 'C:'],
+ ['C:.', 'C:'],
+ ['C:..', 'C:'],
+ ['C:abc', 'C:'],
+ ['C:\\', 'C:\\'],
+ ['C:\\abc', 'C:\\' ],
+ ['', ''],
+
+ // unc
+ ['\\\\server\\share\\file_path', '\\\\server\\share\\'],
+ ['\\\\server two\\shared folder\\file path.zip',
+ '\\\\server two\\shared folder\\'],
+ ['\\\\teela\\admin$\\system32', '\\\\teela\\admin$\\'],
+ ['\\\\?\\UNC\\server\\share', '\\\\?\\UNC\\']
+];
+
+var winSpecialCaseParseTests = [
+ ['/foo/bar', { root: '/' }],
+];
+
+var winSpecialCaseFormatTests = [
+ [{ dir: 'some\\dir' }, 'some\\dir\\'],
+ [{ base: 'index.html' }, 'index.html'],
+ [{ root: 'C:\\' }, 'C:\\'],
+ [{ name: 'index', ext: '.html' }, 'index.html'],
+ [{ dir: 'some\\dir', name: 'index', ext: '.html' }, 'some\\dir\\index.html'],
+ [{ root: 'C:\\', name: 'index', ext: '.html' }, 'C:\\index.html'],
+ [{}, '']
+];
+
+var unixPaths = [
+ // [path, root]
+ ['/home/user/dir/file.txt', '/'],
+ ['/home/user/a dir/another File.zip', '/'],
+ ['/home/user/a dir//another&File.', '/'],
+ ['/home/user/a$$$dir//another File.zip', '/'],
+ ['user/dir/another File.zip', ''],
+ ['file', ''],
+ ['.\\file', ''],
+ ['./file', ''],
+ ['C:\\foo', ''],
+ ['/', '/'],
+ ['', ''],
+ ['.', ''],
+ ['..', ''],
+ ['/foo', '/'],
+ ['/foo.', '/'],
+ ['/foo.bar', '/'],
+ ['/.', '/'],
+ ['/.foo', '/'],
+ ['/.foo.bar', '/'],
+ ['/foo/bar.baz', '/']
+];
+
+var unixSpecialCaseFormatTests = [
+ [{ dir: 'some/dir' }, 'some/dir/'],
+ [{ base: 'index.html' }, 'index.html'],
+ [{ root: '/' }, '/'],
+ [{ name: 'index', ext: '.html' }, 'index.html'],
+ [{ dir: 'some/dir', name: 'index', ext: '.html' }, 'some/dir/index.html'],
+ [{ root: '/', name: 'index', ext: '.html' }, '/index.html'],
+ [{}, '']
+];
+
+var errors = [
+ { method: 'parse', input: [null], message: TypeError },
+ { method: 'parse', input: [{}], message: TypeError },
+ { method: 'parse', input: [true], message: TypeError },
+ { method: 'parse', input: [1], message: TypeError },
+ { method: 'parse', input: [], message: TypeError },
+ { method: 'format', input: [null], message: TypeError },
+ { method: 'format', input: [''], message: TypeError },
+ { method: 'format', input: [true], message: TypeError },
+ { method: 'format', input: [1], message: TypeError },
+];
+
+tape('path.win32.parse', { skip: true }, function (t) {
+ checkParseFormat(t, path.win32, winPaths);
+ checkSpecialCaseParseFormat(t, path.win32, winSpecialCaseParseTests);
+ t.end();
+});
+
+tape('path.posix.parse', function (t) {
+ checkParseFormat(t, path.posix, unixPaths);
+ t.end();
+});
+
+tape('path.win32.parse errors', { skip: true }, function (t) {
+ checkErrors(t, path.win32);
+ t.end();
+});
+
+tape('path.posix.parse errors', function (t) {
+ checkErrors(t, path.posix);
+ t.end();
+});
+
+tape('path.win32.format', { skip: true }, function (t) {
+ checkFormat(t, path.win32, winSpecialCaseFormatTests);
+ t.end();
+});
+
+tape('path.posix.format', function (t) {
+ checkFormat(t, path.posix, unixSpecialCaseFormatTests);
+ t.end();
+});
+
+// Test removal of trailing path separators
+var windowsTrailingTests =
+ [['.\\', { root: '', dir: '', base: '.', ext: '', name: '.' }],
+ ['\\\\', { root: '\\', dir: '\\', base: '', ext: '', name: '' }],
+ ['\\\\', { root: '\\', dir: '\\', base: '', ext: '', name: '' }],
+ ['c:\\foo\\\\\\',
+ { root: 'c:\\', dir: 'c:\\', base: 'foo', ext: '', name: 'foo' }],
+ ['D:\\foo\\\\\\bar.baz',
+ { root: 'D:\\',
+ dir: 'D:\\foo\\\\',
+ base: 'bar.baz',
+ ext: '.baz',
+ name: 'bar'
+ }
+ ]
+ ];
+var posixTrailingTests =
+ [['./', { root: '', dir: '', base: '.', ext: '', name: '.' }],
+ ['//', { root: '/', dir: '/', base: '', ext: '', name: '' }],
+ ['///', { root: '/', dir: '/', base: '', ext: '', name: '' }],
+ ['/foo///', { root: '/', dir: '/', base: 'foo', ext: '', name: 'foo' }],
+ ['/foo///bar.baz',
+ { root: '/', dir: '/foo//', base: 'bar.baz', ext: '.baz', name: 'bar' }
+ ]
+ ];
+
+tape('path.win32.parse trailing', { skip: true }, function (t) {
+ windowsTrailingTests.forEach(function (p) {
+ var actual = path.win32.parse(p[0]);
+ var expected = p[1];
+ t.deepEqual(actual, expected)
+ });
+ t.end();
+});
+
+tape('path.posix.parse trailing', function (t) {
+ posixTrailingTests.forEach(function (p) {
+ var actual = path.posix.parse(p[0]);
+ var expected = p[1];
+ t.deepEqual(actual, expected)
+ });
+ t.end();
+});
+
+function checkErrors(t, path) {
+ errors.forEach(function(errorCase) {
+ t.throws(function () {
+ path[errorCase.method].apply(path, errorCase.input);
+ }, errorCase.message);
+ });
+}
+
+function checkParseFormat(t, path, paths) {
+ paths.forEach(function(p) {
+ var element = p[0];
+ var root = p[1];
+ var output = path.parse(element);
+ t.strictEqual(typeof output.root, 'string');
+ t.strictEqual(typeof output.dir, 'string');
+ t.strictEqual(typeof output.base, 'string');
+ t.strictEqual(typeof output.ext, 'string');
+ t.strictEqual(typeof output.name, 'string');
+ t.strictEqual(path.format(output), element);
+ t.strictEqual(output.root, root);
+ t.ok(output.dir.startsWith(output.root));
+ t.strictEqual(output.dir, output.dir ? path.dirname(element) : '');
+ t.strictEqual(output.base, path.basename(element));
+ t.strictEqual(output.ext, path.extname(element));
+ });
+}
+
+function checkSpecialCaseParseFormat(t, path, testCases) {
+ testCases.forEach(function(testCase) {
+ var element = testCase[0];
+ var expect = testCase[1];
+ var output = path.parse(element);
+ Object.keys(expect).forEach(function(key) {
+ t.strictEqual(output[key], expect[key]);
+ });
+ });
+}
+
+function checkFormat(t, path, testCases) {
+ testCases.forEach(function(testCase) {
+ t.strictEqual(path.format(testCase[0]), testCase[1]);
+ });
+
+ [null, undefined, 1, true, false, 'string'].forEach(function (pathObject) {
+ t.throws(function() {
+ path.format(pathObject);
+ }, /The "pathObject" argument must be of type Object. Received type (\w+)/);
+ });
+}
diff --git a/node_modules/path-browserify/test/test-path-relative.js b/node_modules/path-browserify/test/test-path-relative.js
new file mode 100644
index 0000000000000000000000000000000000000000..44841f679c1040f1b50574dea47c59ac0af997a2
--- /dev/null
+++ b/node_modules/path-browserify/test/test-path-relative.js
@@ -0,0 +1,66 @@
+'use strict';
+var tape = require('tape');
+var path = require('../');
+
+var relativeTests = {
+ win32:
+ // arguments result
+ [['c:/blah\\blah', 'd:/games', 'd:\\games'],
+ ['c:/aaaa/bbbb', 'c:/aaaa', '..'],
+ ['c:/aaaa/bbbb', 'c:/cccc', '..\\..\\cccc'],
+ ['c:/aaaa/bbbb', 'c:/aaaa/bbbb', ''],
+ ['c:/aaaa/bbbb', 'c:/aaaa/cccc', '..\\cccc'],
+ ['c:/aaaa/', 'c:/aaaa/cccc', 'cccc'],
+ ['c:/', 'c:\\aaaa\\bbbb', 'aaaa\\bbbb'],
+ ['c:/aaaa/bbbb', 'd:\\', 'd:\\'],
+ ['c:/AaAa/bbbb', 'c:/aaaa/bbbb', ''],
+ ['c:/aaaaa/', 'c:/aaaa/cccc', '..\\aaaa\\cccc'],
+ ['C:\\foo\\bar\\baz\\quux', 'C:\\', '..\\..\\..\\..'],
+ ['C:\\foo\\test', 'C:\\foo\\test\\bar\\package.json', 'bar\\package.json'],
+ ['C:\\foo\\bar\\baz-quux', 'C:\\foo\\bar\\baz', '..\\baz'],
+ ['C:\\foo\\bar\\baz', 'C:\\foo\\bar\\baz-quux', '..\\baz-quux'],
+ ['\\\\foo\\bar', '\\\\foo\\bar\\baz', 'baz'],
+ ['\\\\foo\\bar\\baz', '\\\\foo\\bar', '..'],
+ ['\\\\foo\\bar\\baz-quux', '\\\\foo\\bar\\baz', '..\\baz'],
+ ['\\\\foo\\bar\\baz', '\\\\foo\\bar\\baz-quux', '..\\baz-quux'],
+ ['C:\\baz-quux', 'C:\\baz', '..\\baz'],
+ ['C:\\baz', 'C:\\baz-quux', '..\\baz-quux'],
+ ['\\\\foo\\baz-quux', '\\\\foo\\baz', '..\\baz'],
+ ['\\\\foo\\baz', '\\\\foo\\baz-quux', '..\\baz-quux'],
+ ['C:\\baz', '\\\\foo\\bar\\baz', '\\\\foo\\bar\\baz'],
+ ['\\\\foo\\bar\\baz', 'C:\\baz', 'C:\\baz']
+ ],
+ posix:
+ // arguments result
+ [['/var/lib', '/var', '..'],
+ ['/var/lib', '/bin', '../../bin'],
+ ['/var/lib', '/var/lib', ''],
+ ['/var/lib', '/var/apache', '../apache'],
+ ['/var/', '/var/lib', 'lib'],
+ ['/', '/var/lib', 'var/lib'],
+ ['/foo/test', '/foo/test/bar/package.json', 'bar/package.json'],
+ ['/Users/a/web/b/test/mails', '/Users/a/web/b', '../..'],
+ ['/foo/bar/baz-quux', '/foo/bar/baz', '../baz'],
+ ['/foo/bar/baz', '/foo/bar/baz-quux', '../baz-quux'],
+ ['/baz-quux', '/baz', '../baz'],
+ ['/baz', '/baz-quux', '../baz-quux']
+ ]
+};
+
+tape('path.posix.relative', function (t) {
+ relativeTests.posix.forEach(function (p) {
+ var expected = p[2];
+ var actual = path.posix.relative(p[0], p[1]);
+ t.strictEqual(actual, expected);
+ });
+ t.end();
+});
+
+tape('path.win32.relative', { skip: true }, function (t) {
+ relativeTests.win32.forEach(function (p) {
+ var expected = p[2];
+ var actual = path.win32.relative(p[0], p[1]);
+ t.strictEqual(actual, expected);
+ });
+ t.end();
+});
diff --git a/node_modules/path-browserify/test/test-path-resolve.js b/node_modules/path-browserify/test/test-path-resolve.js
new file mode 100644
index 0000000000000000000000000000000000000000..520fdb8c0ce0682a2b2359149733ab07ce0b313e
--- /dev/null
+++ b/node_modules/path-browserify/test/test-path-resolve.js
@@ -0,0 +1,45 @@
+'use strict';
+var tape = require('tape');
+var path = require('../');
+
+var windowsTests =
+ // arguments result
+ [[['c:/blah\\blah', 'd:/games', 'c:../a'], 'c:\\blah\\a'],
+ [['c:/ignore', 'd:\\a/b\\c/d', '\\e.exe'], 'd:\\e.exe'],
+ [['c:/ignore', 'c:/some/file'], 'c:\\some\\file'],
+ [['d:/ignore', 'd:some/dir//'], 'd:\\ignore\\some\\dir'],
+ [['.'], process.cwd()],
+ [['//server/share', '..', 'relative\\'], '\\\\server\\share\\relative'],
+ [['c:/', '//'], 'c:\\'],
+ [['c:/', '//dir'], 'c:\\dir'],
+ [['c:/', '//server/share'], '\\\\server\\share\\'],
+ [['c:/', '//server//share'], '\\\\server\\share\\'],
+ [['c:/', '///some//dir'], 'c:\\some\\dir'],
+ [['C:\\foo\\tmp.3\\', '..\\tmp.3\\cycles\\root.js'],
+ 'C:\\foo\\tmp.3\\cycles\\root.js']
+ ];
+var posixTests =
+ // arguments result
+ [[['/var/lib', '../', 'file/'], '/var/file'],
+ [['/var/lib', '/../', 'file/'], '/file'],
+ [['a/b/c/', '../../..'], process.cwd()],
+ [['.'], process.cwd()],
+ [['/some/dir', '.', '/absolute/'], '/absolute'],
+ [['/foo/tmp.3/', '../tmp.3/cycles/root.js'], '/foo/tmp.3/cycles/root.js']
+ ];
+
+tape('path.posix.resolve', function (t) {
+ posixTests.forEach(function (p) {
+ var actual = path.posix.resolve.apply(null, p[0]);
+ t.strictEqual(actual, p[1]);
+ });
+ t.end();
+});
+
+tape('path.win32.resolve', { skip: true }, function (t) {
+ windowsTests.forEach(function (p) {
+ var actual = path.win32.resolve.apply(null, p[0]);
+ t.strictEqual(actual, p[1]);
+ });
+ t.end();
+});
diff --git a/node_modules/path-browserify/test/test-path-zero-length-strings.js b/node_modules/path-browserify/test/test-path-zero-length-strings.js
new file mode 100644
index 0000000000000000000000000000000000000000..7361b5c25fb70e9e100d5dda0b518a6c100ede0a
--- /dev/null
+++ b/node_modules/path-browserify/test/test-path-zero-length-strings.js
@@ -0,0 +1,53 @@
+'use strict';
+
+// These testcases are specific to one uncommon behavior in path module. Few
+// of the functions in path module, treat '' strings as current working
+// directory. This test makes sure that the behavior is intact between commits.
+// See: https://github.com/nodejs/node/pull/2106
+
+var tape = require('tape');
+var path = require('../');
+var pwd = process.cwd();
+
+tape('path.join zero-length', function (t) {
+ // join will internally ignore all the zero-length strings and it will return
+ // '.' if the joined string is a zero-length string.
+ t.strictEqual(path.posix.join(''), '.');
+ t.strictEqual(path.posix.join('', ''), '.');
+ if (path.win32) t.strictEqual(path.win32.join(''), '.');
+ if (path.win32) t.strictEqual(path.win32.join('', ''), '.');
+ t.strictEqual(path.join(pwd), pwd);
+ t.strictEqual(path.join(pwd, ''), pwd);
+ t.end();
+});
+
+tape('path.normalize zero-length', function (t) {
+ // normalize will return '.' if the input is a zero-length string
+ t.strictEqual(path.posix.normalize(''), '.');
+ if (path.win32) t.strictEqual(path.win32.normalize(''), '.');
+ t.strictEqual(path.normalize(pwd), pwd);
+ t.end();
+});
+
+tape('path.isAbsolute zero-length', function (t) {
+ // Since '' is not a valid path in any of the common environments, return false
+ t.strictEqual(path.posix.isAbsolute(''), false);
+ if (path.win32) t.strictEqual(path.win32.isAbsolute(''), false);
+ t.end();
+});
+
+tape('path.resolve zero-length', function (t) {
+ // resolve, internally ignores all the zero-length strings and returns the
+ // current working directory
+ t.strictEqual(path.resolve(''), pwd);
+ t.strictEqual(path.resolve('', ''), pwd);
+ t.end();
+});
+
+tape('path.relative zero-length', function (t) {
+ // relative, internally calls resolve. So, '' is actually the current directory
+ t.strictEqual(path.relative('', pwd), '');
+ t.strictEqual(path.relative(pwd, ''), '');
+ t.strictEqual(path.relative(pwd, pwd), '');
+ t.end();
+});
diff --git a/node_modules/path-browserify/test/test-path.js b/node_modules/path-browserify/test/test-path.js
new file mode 100644
index 0000000000000000000000000000000000000000..7de12b4459cca7d222f0a7d5690f10ddd9e0e85e
--- /dev/null
+++ b/node_modules/path-browserify/test/test-path.js
@@ -0,0 +1,107 @@
+// Copyright Joyent, Inc. and other Node contributors.
+//
+// Permission is hereby granted, free of charge, to any person obtaining a
+// copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to permit
+// persons to whom the Software is furnished to do so, subject to the
+// following conditions:
+//
+// The above copyright notice and this permission notice shall be included
+// in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
+// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
+// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
+// USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+'use strict';
+var tape = require('tape');
+var path = require('../');
+
+// Test thrown TypeErrors
+var typeErrorTests = [true, false, 7, null, {}, undefined, [], NaN];
+
+function fail(t, fn) {
+ var args = [].slice.call(arguments, 1);
+
+ t.throws(function () {
+ fn.apply(null, args);
+ }, TypeError);
+}
+
+tape('path.posix TypeErrors', function (t) {
+ typeErrorTests.forEach(function (test) {
+ fail(t, path.posix.join, test);
+ fail(t, path.posix.resolve, test);
+ fail(t, path.posix.normalize, test);
+ fail(t, path.posix.isAbsolute, test);
+ fail(t, path.posix.relative, test, 'foo');
+ fail(t, path.posix.relative, 'foo', test);
+ fail(t, path.posix.parse, test);
+ fail(t, path.posix.dirname, test);
+ fail(t, path.posix.basename, test);
+ fail(t, path.posix.extname, test);
+
+ // undefined is a valid value as the second argument to basename
+ if (test !== undefined) {
+ fail(t, path.posix.basename, 'foo', test);
+ }
+ });
+ t.end();
+});
+
+tape('path.win32 TypeErrors', { skip: true }, function (t) {
+ typeErrorTests.forEach(function (test) {
+ fail(t, path.win32.join, test);
+ fail(t, path.win32.resolve, test);
+ fail(t, path.win32.normalize, test);
+ fail(t, path.win32.isAbsolute, test);
+ fail(t, path.win32.relative, test, 'foo');
+ fail(t, path.win32.relative, 'foo', test);
+ fail(t, path.win32.parse, test);
+ fail(t, path.win32.dirname, test);
+ fail(t, path.win32.basename, test);
+ fail(t, path.win32.extname, test);
+
+ // undefined is a valid value as the second argument to basename
+ if (test !== undefined) {
+ fail(t, path.win32.basename, 'foo', test);
+ }
+ });
+ t.end();
+});
+
+// path.sep tests
+tape('path.win32.sep', { skip: true }, function (t) {
+ // windows
+ t.strictEqual(path.win32.sep, '\\');
+ t.end();
+});
+tape('path.posix.sep', function (t) {
+ // posix
+ t.strictEqual(path.posix.sep, '/');
+ t.end();
+});
+
+// path.delimiter tests
+tape('path.win32.delimiter', { skip: true }, function (t) {
+ // windows
+ t.strictEqual(path.win32.delimiter, ';');
+ t.end();
+});
+tape('path.posix.delimiter', function (t) {
+ // posix
+ t.strictEqual(path.posix.delimiter, ':');
+ t.end();
+});
+
+tape('path', function (t) {
+ t.strictEqual(path, path.posix);
+ t.end();
+});
+
diff --git a/node_modules/path-exists/index.d.ts b/node_modules/path-exists/index.d.ts
new file mode 100644
index 0000000000000000000000000000000000000000..54b7ab8f4ec50cb0180fe046d155f5116386641b
--- /dev/null
+++ b/node_modules/path-exists/index.d.ts
@@ -0,0 +1,28 @@
+declare const pathExists: {
+ /**
+ Check if a path exists.
+
+ @returns Whether the path exists.
+
+ @example
+ ```
+ // foo.ts
+ import pathExists = require('path-exists');
+
+ (async () => {
+ console.log(await pathExists('foo.ts'));
+ //=> true
+ })();
+ ```
+ */
+ (path: string): Promise;
+
+ /**
+ Synchronously check if a path exists.
+
+ @returns Whether the path exists.
+ */
+ sync(path: string): boolean;
+};
+
+export = pathExists;
diff --git a/node_modules/path-exists/index.js b/node_modules/path-exists/index.js
new file mode 100644
index 0000000000000000000000000000000000000000..1943921b758505a03af8330fa28ef86f6dea9b3a
--- /dev/null
+++ b/node_modules/path-exists/index.js
@@ -0,0 +1,23 @@
+'use strict';
+const fs = require('fs');
+const {promisify} = require('util');
+
+const pAccess = promisify(fs.access);
+
+module.exports = async path => {
+ try {
+ await pAccess(path);
+ return true;
+ } catch (_) {
+ return false;
+ }
+};
+
+module.exports.sync = path => {
+ try {
+ fs.accessSync(path);
+ return true;
+ } catch (_) {
+ return false;
+ }
+};
diff --git a/node_modules/path-exists/license b/node_modules/path-exists/license
new file mode 100644
index 0000000000000000000000000000000000000000..e7af2f77107d73046421ef56c4684cbfdd3c1e89
--- /dev/null
+++ b/node_modules/path-exists/license
@@ -0,0 +1,9 @@
+MIT License
+
+Copyright (c) Sindre Sorhus (sindresorhus.com)
+
+Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
diff --git a/node_modules/path-exists/package.json b/node_modules/path-exists/package.json
new file mode 100644
index 0000000000000000000000000000000000000000..0755256a2b33fed98f241a398d341b1682967ca3
--- /dev/null
+++ b/node_modules/path-exists/package.json
@@ -0,0 +1,39 @@
+{
+ "name": "path-exists",
+ "version": "4.0.0",
+ "description": "Check if a path exists",
+ "license": "MIT",
+ "repository": "sindresorhus/path-exists",
+ "author": {
+ "name": "Sindre Sorhus",
+ "email": "sindresorhus@gmail.com",
+ "url": "sindresorhus.com"
+ },
+ "engines": {
+ "node": ">=8"
+ },
+ "scripts": {
+ "test": "xo && ava && tsd"
+ },
+ "files": [
+ "index.js",
+ "index.d.ts"
+ ],
+ "keywords": [
+ "path",
+ "exists",
+ "exist",
+ "file",
+ "filepath",
+ "fs",
+ "filesystem",
+ "file-system",
+ "access",
+ "stat"
+ ],
+ "devDependencies": {
+ "ava": "^1.4.1",
+ "tsd": "^0.7.2",
+ "xo": "^0.24.0"
+ }
+}
diff --git a/node_modules/path-exists/readme.md b/node_modules/path-exists/readme.md
new file mode 100644
index 0000000000000000000000000000000000000000..81f98454567fbfcfcf9ced2ae50231ff99c547b1
--- /dev/null
+++ b/node_modules/path-exists/readme.md
@@ -0,0 +1,52 @@
+# path-exists [](https://travis-ci.org/sindresorhus/path-exists)
+
+> Check if a path exists
+
+NOTE: `fs.existsSync` has been un-deprecated in Node.js since 6.8.0. If you only need to check synchronously, this module is not needed.
+
+While [`fs.exists()`](https://nodejs.org/api/fs.html#fs_fs_exists_path_callback) is being [deprecated](https://github.com/iojs/io.js/issues/103), there's still a genuine use-case of being able to check if a path exists for other purposes than doing IO with it.
+
+Never use this before handling a file though:
+
+> In particular, checking if a file exists before opening it is an anti-pattern that leaves you vulnerable to race conditions: another process may remove the file between the calls to `fs.exists()` and `fs.open()`. Just open the file and handle the error when it's not there.
+
+
+## Install
+
+```
+$ npm install path-exists
+```
+
+
+## Usage
+
+```js
+// foo.js
+const pathExists = require('path-exists');
+
+(async () => {
+ console.log(await pathExists('foo.js'));
+ //=> true
+})();
+```
+
+
+## API
+
+### pathExists(path)
+
+Returns a `Promise` of whether the path exists.
+
+### pathExists.sync(path)
+
+Returns a `boolean` of whether the path exists.
+
+
+## Related
+
+- [path-exists-cli](https://github.com/sindresorhus/path-exists-cli) - CLI for this module
+
+
+## License
+
+MIT © [Sindre Sorhus](https://sindresorhus.com)
diff --git a/node_modules/path-parse/LICENSE b/node_modules/path-parse/LICENSE
new file mode 100644
index 0000000000000000000000000000000000000000..810f3dbea83b538626b466a1aa3d60ed8cf27281
--- /dev/null
+++ b/node_modules/path-parse/LICENSE
@@ -0,0 +1,21 @@
+The MIT License (MIT)
+
+Copyright (c) 2015 Javier Blanco
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
diff --git a/node_modules/path-parse/README.md b/node_modules/path-parse/README.md
new file mode 100644
index 0000000000000000000000000000000000000000..05097f86aef364d88bab44fac2ce01c2d825ada9
--- /dev/null
+++ b/node_modules/path-parse/README.md
@@ -0,0 +1,42 @@
+# path-parse [](https://travis-ci.org/jbgutierrez/path-parse)
+
+> Node.js [`path.parse(pathString)`](https://nodejs.org/api/path.html#path_path_parse_pathstring) [ponyfill](https://ponyfill.com).
+
+## Install
+
+```
+$ npm install --save path-parse
+```
+
+## Usage
+
+```js
+var pathParse = require('path-parse');
+
+pathParse('/home/user/dir/file.txt');
+//=> {
+// root : "/",
+// dir : "/home/user/dir",
+// base : "file.txt",
+// ext : ".txt",
+// name : "file"
+// }
+```
+
+## API
+
+See [`path.parse(pathString)`](https://nodejs.org/api/path.html#path_path_parse_pathstring) docs.
+
+### pathParse(path)
+
+### pathParse.posix(path)
+
+The Posix specific version.
+
+### pathParse.win32(path)
+
+The Windows specific version.
+
+## License
+
+MIT © [Javier Blanco](http://jbgutierrez.info)
diff --git a/node_modules/path-parse/index.js b/node_modules/path-parse/index.js
new file mode 100644
index 0000000000000000000000000000000000000000..f062d0a23e6299b2eee1797c6c476159348f147c
--- /dev/null
+++ b/node_modules/path-parse/index.js
@@ -0,0 +1,75 @@
+'use strict';
+
+var isWindows = process.platform === 'win32';
+
+// Regex to split a windows path into into [dir, root, basename, name, ext]
+var splitWindowsRe =
+ /^(((?:[a-zA-Z]:|[\\\/]{2}[^\\\/]+[\\\/]+[^\\\/]+)?[\\\/]?)(?:[^\\\/]*[\\\/])*)((\.{1,2}|[^\\\/]+?|)(\.[^.\/\\]*|))[\\\/]*$/;
+
+var win32 = {};
+
+function win32SplitPath(filename) {
+ return splitWindowsRe.exec(filename).slice(1);
+}
+
+win32.parse = function(pathString) {
+ if (typeof pathString !== 'string') {
+ throw new TypeError(
+ "Parameter 'pathString' must be a string, not " + typeof pathString
+ );
+ }
+ var allParts = win32SplitPath(pathString);
+ if (!allParts || allParts.length !== 5) {
+ throw new TypeError("Invalid path '" + pathString + "'");
+ }
+ return {
+ root: allParts[1],
+ dir: allParts[0] === allParts[1] ? allParts[0] : allParts[0].slice(0, -1),
+ base: allParts[2],
+ ext: allParts[4],
+ name: allParts[3]
+ };
+};
+
+
+
+// Split a filename into [dir, root, basename, name, ext], unix version
+// 'root' is just a slash, or nothing.
+var splitPathRe =
+ /^((\/?)(?:[^\/]*\/)*)((\.{1,2}|[^\/]+?|)(\.[^.\/]*|))[\/]*$/;
+var posix = {};
+
+
+function posixSplitPath(filename) {
+ return splitPathRe.exec(filename).slice(1);
+}
+
+
+posix.parse = function(pathString) {
+ if (typeof pathString !== 'string') {
+ throw new TypeError(
+ "Parameter 'pathString' must be a string, not " + typeof pathString
+ );
+ }
+ var allParts = posixSplitPath(pathString);
+ if (!allParts || allParts.length !== 5) {
+ throw new TypeError("Invalid path '" + pathString + "'");
+ }
+
+ return {
+ root: allParts[1],
+ dir: allParts[0].slice(0, -1),
+ base: allParts[2],
+ ext: allParts[4],
+ name: allParts[3],
+ };
+};
+
+
+if (isWindows)
+ module.exports = win32.parse;
+else /* posix */
+ module.exports = posix.parse;
+
+module.exports.posix = posix.parse;
+module.exports.win32 = win32.parse;
diff --git a/node_modules/path-parse/package.json b/node_modules/path-parse/package.json
new file mode 100644
index 0000000000000000000000000000000000000000..36c23f84e7063cc7063844a278fe851afaa5da09
--- /dev/null
+++ b/node_modules/path-parse/package.json
@@ -0,0 +1,33 @@
+{
+ "name": "path-parse",
+ "version": "1.0.7",
+ "description": "Node.js path.parse() ponyfill",
+ "main": "index.js",
+ "scripts": {
+ "test": "node test.js"
+ },
+ "repository": {
+ "type": "git",
+ "url": "https://github.com/jbgutierrez/path-parse.git"
+ },
+ "keywords": [
+ "path",
+ "paths",
+ "file",
+ "dir",
+ "parse",
+ "built-in",
+ "util",
+ "utils",
+ "core",
+ "ponyfill",
+ "polyfill",
+ "shim"
+ ],
+ "author": "Javier Blanco ",
+ "license": "MIT",
+ "bugs": {
+ "url": "https://github.com/jbgutierrez/path-parse/issues"
+ },
+ "homepage": "https://github.com/jbgutierrez/path-parse#readme"
+}
diff --git a/node_modules/path-to-regexp/LICENSE b/node_modules/path-to-regexp/LICENSE
new file mode 100644
index 0000000000000000000000000000000000000000..983fbe8aec3f4e2d4add592bb1083b00d7366f66
--- /dev/null
+++ b/node_modules/path-to-regexp/LICENSE
@@ -0,0 +1,21 @@
+The MIT License (MIT)
+
+Copyright (c) 2014 Blake Embrey (hello@blakeembrey.com)
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+THE SOFTWARE.
diff --git a/node_modules/path-to-regexp/Readme.md b/node_modules/path-to-regexp/Readme.md
new file mode 100644
index 0000000000000000000000000000000000000000..f5df40a9adbcaaff172645e21defd845a0c21deb
--- /dev/null
+++ b/node_modules/path-to-regexp/Readme.md
@@ -0,0 +1,224 @@
+# Path-to-RegExp
+
+> Turn a path string such as `/user/:name` into a regular expression.
+
+[![NPM version][npm-image]][npm-url]
+[![NPM downloads][downloads-image]][downloads-url]
+[![Build status][build-image]][build-url]
+[![Build coverage][coverage-image]][coverage-url]
+[![License][license-image]][license-url]
+
+## Installation
+
+```
+npm install path-to-regexp --save
+```
+
+## Usage
+
+```js
+const {
+ match,
+ pathToRegexp,
+ compile,
+ parse,
+ stringify,
+} = require("path-to-regexp");
+```
+
+### Parameters
+
+Parameters match arbitrary strings in a path by matching up to the end of the segment, or up to any proceeding tokens. They are defined by prefixing a colon to the parameter name (`:foo`). Parameter names can use any valid JavaScript identifier, or be double quoted to use other characters (`:"param-name"`).
+
+```js
+const fn = match("/:foo/:bar");
+
+fn("/test/route");
+//=> { path: '/test/route', params: { foo: 'test', bar: 'route' } }
+```
+
+### Wildcard
+
+Wildcard parameters match one or more characters across multiple segments. They are defined the same way as regular parameters, but are prefixed with an asterisk (`*foo`).
+
+```js
+const fn = match("/*splat");
+
+fn("/bar/baz");
+//=> { path: '/bar/baz', params: { splat: [ 'bar', 'baz' ] } }
+```
+
+### Optional
+
+Braces can be used to define parts of the path that are optional.
+
+```js
+const fn = match("/users{/:id}/delete");
+
+fn("/users/delete");
+//=> { path: '/users/delete', params: {} }
+
+fn("/users/123/delete");
+//=> { path: '/users/123/delete', params: { id: '123' } }
+```
+
+## Match
+
+The `match` function returns a function for matching strings against a path:
+
+- **path** String, `TokenData` object, or array of strings and `TokenData` objects.
+- **options** _(optional)_ (Extends [pathToRegexp](#pathToRegexp) options)
+ - **decode** Function for decoding strings to params, or `false` to disable all processing. (default: `decodeURIComponent`)
+
+```js
+const fn = match("/foo/:bar");
+```
+
+**Please note:** `path-to-regexp` is intended for ordered data (e.g. paths, hosts). It can not handle arbitrarily ordered data (e.g. query strings, URL fragments, JSON, etc).
+
+## PathToRegexp
+
+The `pathToRegexp` function returns the `regexp` for matching strings against paths, and an array of `keys` for understanding the `RegExp#exec` matches.
+
+- **path** String, `TokenData` object, or array of strings and `TokenData` objects.
+- **options** _(optional)_ (See [parse](#parse) for more options)
+ - **sensitive** Regexp will be case sensitive. (default: `false`)
+ - **end** Validate the match reaches the end of the string. (default: `true`)
+ - **delimiter** The default delimiter for segments, e.g. `[^/]` for `:named` parameters. (default: `'/'`)
+ - **trailing** Allows optional trailing delimiter to match. (default: `true`)
+
+```js
+const { regexp, keys } = pathToRegexp("/foo/:bar");
+
+regexp.exec("/foo/123"); //=> ["/foo/123", "123"]
+```
+
+## Compile ("Reverse" Path-To-RegExp)
+
+The `compile` function will return a function for transforming parameters into a valid path:
+
+- **path** A string or `TokenData` object.
+- **options** (See [parse](#parse) for more options)
+ - **delimiter** The default delimiter for segments, e.g. `[^/]` for `:named` parameters. (default: `'/'`)
+ - **encode** Function for encoding input strings for output into the path, or `false` to disable entirely. (default: `encodeURIComponent`)
+
+```js
+const toPath = compile("/user/:id");
+
+toPath({ id: "name" }); //=> "/user/name"
+toPath({ id: "café" }); //=> "/user/caf%C3%A9"
+
+const toPathRepeated = compile("/*segment");
+
+toPathRepeated({ segment: ["foo"] }); //=> "/foo"
+toPathRepeated({ segment: ["a", "b", "c"] }); //=> "/a/b/c"
+
+// When disabling `encode`, you need to make sure inputs are encoded correctly. No arrays are accepted.
+const toPathRaw = compile("/user/:id", { encode: false });
+
+toPathRaw({ id: "%3A%2F" }); //=> "/user/%3A%2F"
+```
+
+## Stringify
+
+Transform a `TokenData` object to a Path-to-RegExp string.
+
+- **data** A `TokenData` object.
+
+```js
+const data = {
+ tokens: [
+ { type: "text", value: "/" },
+ { type: "param", name: "foo" },
+ ],
+};
+
+const path = stringify(data); //=> "/:foo"
+```
+
+## Developers
+
+- If you are rewriting paths with match and compile, consider using `encode: false` and `decode: false` to keep raw paths passed around.
+- To ensure matches work on paths containing characters usually encoded, such as emoji, consider using [encodeurl](https://github.com/pillarjs/encodeurl) for `encodePath`.
+
+### Parse
+
+The `parse` function accepts a string and returns `TokenData`, which can be used with `match` and `compile`.
+
+- **path** A string.
+- **options** _(optional)_
+ - **encodePath** A function for encoding input strings. (default: `x => x`, recommended: [`encodeurl`](https://github.com/pillarjs/encodeurl))
+
+### Tokens
+
+`TokenData` has two properties:
+
+- **tokens** A sequence of tokens, currently of types `text`, `parameter`, `wildcard`, or `group`.
+- **originalPath** The original path used with `parse`, shown in error messages to assist debugging.
+
+### Custom path
+
+In some applications you may not be able to use the `path-to-regexp` syntax, but you still want to use this library for `match` and `compile`. For example:
+
+```js
+import { match } from "path-to-regexp";
+
+const tokens = [
+ { type: "text", value: "/" },
+ { type: "parameter", name: "foo" },
+];
+const originalPath = "/[foo]"; // To help debug error messages.
+const path = { tokens, originalPath };
+const fn = match(path);
+
+fn("/test"); //=> { path: '/test', index: 0, params: { foo: 'test' } }
+```
+
+## Errors
+
+An effort has been made to ensure ambiguous paths from previous releases throw an error. This means you might be seeing an error when things worked before.
+
+### Missing parameter name
+
+Parameter names must be provided after `:` or `*`, for example `/*path`. They can be valid JavaScript identifiers (e.g. `:myName`) or JSON strings (`:"my-name"`).
+
+### Unexpected `?` or `+`
+
+In past releases, `?`, `*`, and `+` were used to denote optional or repeating parameters. As an alternative, try these:
+
+- For optional (`?`), use braces: `/file{.:ext}`.
+- For one or more (`+`), use a wildcard: `/*path`.
+- For zero or more (`*`), use both: `/files{/*path}`.
+
+### Unexpected `(`, `)`, `[`, `]`, etc.
+
+Previous versions of Path-to-RegExp used these for RegExp features. This version no longer supports them so they've been reserved to avoid ambiguity. To match these characters literally, escape them with a backslash, e.g. `"\\("`.
+
+### Unterminated quote
+
+Parameter names can be wrapped in double quote characters, and this error means you forgot to close the quote character. For example, `:"foo`.
+
+### Express <= 4.x
+
+Path-To-RegExp breaks compatibility with Express <= `4.x` in the following ways:
+
+- The wildcard `*` must have a name and matches the behavior of parameters `:`.
+- The optional character `?` is no longer supported, use braces instead: `/:file{.:ext}`.
+- Regexp characters are not supported.
+- Some characters have been reserved to avoid confusion during upgrade (`()[]?+!`).
+- Parameter names now support valid JavaScript identifiers, or quoted like `:"this"`.
+
+## License
+
+MIT
+
+[npm-image]: https://img.shields.io/npm/v/path-to-regexp
+[npm-url]: https://npmjs.org/package/path-to-regexp
+[downloads-image]: https://img.shields.io/npm/dm/path-to-regexp
+[downloads-url]: https://npmjs.org/package/path-to-regexp
+[build-image]: https://img.shields.io/github/actions/workflow/status/pillarjs/path-to-regexp/ci.yml?branch=master
+[build-url]: https://github.com/pillarjs/path-to-regexp/actions/workflows/ci.yml?query=branch%3Amaster
+[coverage-image]: https://img.shields.io/codecov/c/gh/pillarjs/path-to-regexp
+[coverage-url]: https://codecov.io/gh/pillarjs/path-to-regexp
+[license-image]: http://img.shields.io/npm/l/path-to-regexp.svg?style=flat
+[license-url]: LICENSE.md
diff --git a/node_modules/path-to-regexp/dist/index.d.ts b/node_modules/path-to-regexp/dist/index.d.ts
new file mode 100644
index 0000000000000000000000000000000000000000..b59dff0e2901335e6b36a901b13b2d080d8619b1
--- /dev/null
+++ b/node_modules/path-to-regexp/dist/index.d.ts
@@ -0,0 +1,144 @@
+/**
+ * Encode a string into another string.
+ */
+export type Encode = (value: string) => string;
+/**
+ * Decode a string into another string.
+ */
+export type Decode = (value: string) => string;
+export interface ParseOptions {
+ /**
+ * A function for encoding input strings.
+ */
+ encodePath?: Encode;
+}
+export interface PathToRegexpOptions {
+ /**
+ * Matches the path completely without trailing characters. (default: `true`)
+ */
+ end?: boolean;
+ /**
+ * Allows optional trailing delimiter to match. (default: `true`)
+ */
+ trailing?: boolean;
+ /**
+ * Match will be case sensitive. (default: `false`)
+ */
+ sensitive?: boolean;
+ /**
+ * The default delimiter for segments. (default: `'/'`)
+ */
+ delimiter?: string;
+}
+export interface MatchOptions extends PathToRegexpOptions {
+ /**
+ * Function for decoding strings for params, or `false` to disable entirely. (default: `decodeURIComponent`)
+ */
+ decode?: Decode | false;
+}
+export interface CompileOptions {
+ /**
+ * Function for encoding input strings for output into the path, or `false` to disable entirely. (default: `encodeURIComponent`)
+ */
+ encode?: Encode | false;
+ /**
+ * The default delimiter for segments. (default: `'/'`)
+ */
+ delimiter?: string;
+}
+/**
+ * Plain text.
+ */
+export interface Text {
+ type: "text";
+ value: string;
+}
+/**
+ * A parameter designed to match arbitrary text within a segment.
+ */
+export interface Parameter {
+ type: "param";
+ name: string;
+}
+/**
+ * A wildcard parameter designed to match multiple segments.
+ */
+export interface Wildcard {
+ type: "wildcard";
+ name: string;
+}
+/**
+ * A set of possible tokens to expand when matching.
+ */
+export interface Group {
+ type: "group";
+ tokens: Token[];
+}
+/**
+ * A token that corresponds with a regexp capture.
+ */
+export type Key = Parameter | Wildcard;
+/**
+ * A sequence of `path-to-regexp` keys that match capturing groups.
+ */
+export type Keys = Array;
+/**
+ * A sequence of path match characters.
+ */
+export type Token = Text | Parameter | Wildcard | Group;
+/**
+ * Tokenized path instance.
+ */
+export declare class TokenData {
+ readonly tokens: Token[];
+ readonly originalPath?: string | undefined;
+ constructor(tokens: Token[], originalPath?: string | undefined);
+}
+/**
+ * ParseError is thrown when there is an error processing the path.
+ */
+export declare class PathError extends TypeError {
+ readonly originalPath: string | undefined;
+ constructor(message: string, originalPath: string | undefined);
+}
+/**
+ * Parse a string for the raw tokens.
+ */
+export declare function parse(str: string, options?: ParseOptions): TokenData;
+/**
+ * Compile a string to a template function for the path.
+ */
+export declare function compile(path: Path, options?: CompileOptions & ParseOptions): (params?: P) => string;
+export type ParamData = Partial>;
+export type PathFunction = (data?: P) => string;
+/**
+ * A match result contains data about the path match.
+ */
+export interface MatchResult
{
+ path: string;
+ params: P;
+}
+/**
+ * A match is either `false` (no match) or a match result.
+ */
+export type Match
= false | MatchResult
;
+/**
+ * The match function takes a string and returns whether it matched the path.
+ */
+export type MatchFunction
= (path: string) => Match
;
+/**
+ * Supported path types.
+ */
+export type Path = string | TokenData;
+/**
+ * Transform a path into a match function.
+ */
+export declare function match
(path: Path | Path[], options?: MatchOptions & ParseOptions): MatchFunction
;
+export declare function pathToRegexp(path: Path | Path[], options?: PathToRegexpOptions & ParseOptions): {
+ regexp: RegExp;
+ keys: Keys;
+};
+/**
+ * Stringify token data into a path string.
+ */
+export declare function stringify(data: TokenData): string;
diff --git a/node_modules/path-to-regexp/dist/index.js b/node_modules/path-to-regexp/dist/index.js
new file mode 100644
index 0000000000000000000000000000000000000000..9331ae06722aa7c9642620135b1f71520bde8d63
--- /dev/null
+++ b/node_modules/path-to-regexp/dist/index.js
@@ -0,0 +1,409 @@
+"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+exports.PathError = exports.TokenData = void 0;
+exports.parse = parse;
+exports.compile = compile;
+exports.match = match;
+exports.pathToRegexp = pathToRegexp;
+exports.stringify = stringify;
+const DEFAULT_DELIMITER = "/";
+const NOOP_VALUE = (value) => value;
+const ID_START = /^[$_\p{ID_Start}]$/u;
+const ID_CONTINUE = /^[$\u200c\u200d\p{ID_Continue}]$/u;
+const SIMPLE_TOKENS = {
+ // Groups.
+ "{": "{",
+ "}": "}",
+ // Reserved.
+ "(": "(",
+ ")": ")",
+ "[": "[",
+ "]": "]",
+ "+": "+",
+ "?": "?",
+ "!": "!",
+};
+/**
+ * Escape text for stringify to path.
+ */
+function escapeText(str) {
+ return str.replace(/[{}()\[\]+?!:*\\]/g, "\\$&");
+}
+/**
+ * Escape a regular expression string.
+ */
+function escape(str) {
+ return str.replace(/[.+*?^${}()[\]|/\\]/g, "\\$&");
+}
+/**
+ * Tokenized path instance.
+ */
+class TokenData {
+ constructor(tokens, originalPath) {
+ this.tokens = tokens;
+ this.originalPath = originalPath;
+ }
+}
+exports.TokenData = TokenData;
+/**
+ * ParseError is thrown when there is an error processing the path.
+ */
+class PathError extends TypeError {
+ constructor(message, originalPath) {
+ let text = message;
+ if (originalPath)
+ text += `: ${originalPath}`;
+ text += `; visit https://git.new/pathToRegexpError for info`;
+ super(text);
+ this.originalPath = originalPath;
+ }
+}
+exports.PathError = PathError;
+/**
+ * Parse a string for the raw tokens.
+ */
+function parse(str, options = {}) {
+ const { encodePath = NOOP_VALUE } = options;
+ const chars = [...str];
+ const tokens = [];
+ let index = 0;
+ let pos = 0;
+ function name() {
+ let value = "";
+ if (ID_START.test(chars[index])) {
+ do {
+ value += chars[index++];
+ } while (ID_CONTINUE.test(chars[index]));
+ }
+ else if (chars[index] === '"') {
+ let quoteStart = index;
+ while (index++ < chars.length) {
+ if (chars[index] === '"') {
+ index++;
+ quoteStart = 0;
+ break;
+ }
+ // Increment over escape characters.
+ if (chars[index] === "\\")
+ index++;
+ value += chars[index];
+ }
+ if (quoteStart) {
+ throw new PathError(`Unterminated quote at index ${quoteStart}`, str);
+ }
+ }
+ if (!value) {
+ throw new PathError(`Missing parameter name at index ${index}`, str);
+ }
+ return value;
+ }
+ while (index < chars.length) {
+ const value = chars[index];
+ const type = SIMPLE_TOKENS[value];
+ if (type) {
+ tokens.push({ type, index: index++, value });
+ }
+ else if (value === "\\") {
+ tokens.push({ type: "escape", index: index++, value: chars[index++] });
+ }
+ else if (value === ":") {
+ tokens.push({ type: "param", index: index++, value: name() });
+ }
+ else if (value === "*") {
+ tokens.push({ type: "wildcard", index: index++, value: name() });
+ }
+ else {
+ tokens.push({ type: "char", index: index++, value });
+ }
+ }
+ tokens.push({ type: "end", index, value: "" });
+ function consumeUntil(endType) {
+ const output = [];
+ while (true) {
+ const token = tokens[pos++];
+ if (token.type === endType)
+ break;
+ if (token.type === "char" || token.type === "escape") {
+ let path = token.value;
+ let cur = tokens[pos];
+ while (cur.type === "char" || cur.type === "escape") {
+ path += cur.value;
+ cur = tokens[++pos];
+ }
+ output.push({
+ type: "text",
+ value: encodePath(path),
+ });
+ continue;
+ }
+ if (token.type === "param" || token.type === "wildcard") {
+ output.push({
+ type: token.type,
+ name: token.value,
+ });
+ continue;
+ }
+ if (token.type === "{") {
+ output.push({
+ type: "group",
+ tokens: consumeUntil("}"),
+ });
+ continue;
+ }
+ throw new PathError(`Unexpected ${token.type} at index ${token.index}, expected ${endType}`, str);
+ }
+ return output;
+ }
+ return new TokenData(consumeUntil("end"), str);
+}
+/**
+ * Compile a string to a template function for the path.
+ */
+function compile(path, options = {}) {
+ const { encode = encodeURIComponent, delimiter = DEFAULT_DELIMITER } = options;
+ const data = typeof path === "object" ? path : parse(path, options);
+ const fn = tokensToFunction(data.tokens, delimiter, encode);
+ return function path(params = {}) {
+ const [path, ...missing] = fn(params);
+ if (missing.length) {
+ throw new TypeError(`Missing parameters: ${missing.join(", ")}`);
+ }
+ return path;
+ };
+}
+function tokensToFunction(tokens, delimiter, encode) {
+ const encoders = tokens.map((token) => tokenToFunction(token, delimiter, encode));
+ return (data) => {
+ const result = [""];
+ for (const encoder of encoders) {
+ const [value, ...extras] = encoder(data);
+ result[0] += value;
+ result.push(...extras);
+ }
+ return result;
+ };
+}
+/**
+ * Convert a single token into a path building function.
+ */
+function tokenToFunction(token, delimiter, encode) {
+ if (token.type === "text")
+ return () => [token.value];
+ if (token.type === "group") {
+ const fn = tokensToFunction(token.tokens, delimiter, encode);
+ return (data) => {
+ const [value, ...missing] = fn(data);
+ if (!missing.length)
+ return [value];
+ return [""];
+ };
+ }
+ const encodeValue = encode || NOOP_VALUE;
+ if (token.type === "wildcard" && encode !== false) {
+ return (data) => {
+ const value = data[token.name];
+ if (value == null)
+ return ["", token.name];
+ if (!Array.isArray(value) || value.length === 0) {
+ throw new TypeError(`Expected "${token.name}" to be a non-empty array`);
+ }
+ return [
+ value
+ .map((value, index) => {
+ if (typeof value !== "string") {
+ throw new TypeError(`Expected "${token.name}/${index}" to be a string`);
+ }
+ return encodeValue(value);
+ })
+ .join(delimiter),
+ ];
+ };
+ }
+ return (data) => {
+ const value = data[token.name];
+ if (value == null)
+ return ["", token.name];
+ if (typeof value !== "string") {
+ throw new TypeError(`Expected "${token.name}" to be a string`);
+ }
+ return [encodeValue(value)];
+ };
+}
+/**
+ * Transform a path into a match function.
+ */
+function match(path, options = {}) {
+ const { decode = decodeURIComponent, delimiter = DEFAULT_DELIMITER } = options;
+ const { regexp, keys } = pathToRegexp(path, options);
+ const decoders = keys.map((key) => {
+ if (decode === false)
+ return NOOP_VALUE;
+ if (key.type === "param")
+ return decode;
+ return (value) => value.split(delimiter).map(decode);
+ });
+ return function match(input) {
+ const m = regexp.exec(input);
+ if (!m)
+ return false;
+ const path = m[0];
+ const params = Object.create(null);
+ for (let i = 1; i < m.length; i++) {
+ if (m[i] === undefined)
+ continue;
+ const key = keys[i - 1];
+ const decoder = decoders[i - 1];
+ params[key.name] = decoder(m[i]);
+ }
+ return { path, params };
+ };
+}
+function pathToRegexp(path, options = {}) {
+ const { delimiter = DEFAULT_DELIMITER, end = true, sensitive = false, trailing = true, } = options;
+ const keys = [];
+ const flags = sensitive ? "" : "i";
+ const sources = [];
+ for (const input of pathsToArray(path, [])) {
+ const data = typeof input === "object" ? input : parse(input, options);
+ for (const tokens of flatten(data.tokens, 0, [])) {
+ sources.push(toRegExpSource(tokens, delimiter, keys, data.originalPath));
+ }
+ }
+ let pattern = `^(?:${sources.join("|")})`;
+ if (trailing)
+ pattern += `(?:${escape(delimiter)}$)?`;
+ pattern += end ? "$" : `(?=${escape(delimiter)}|$)`;
+ const regexp = new RegExp(pattern, flags);
+ return { regexp, keys };
+}
+/**
+ * Convert a path or array of paths into a flat array.
+ */
+function pathsToArray(paths, init) {
+ if (Array.isArray(paths)) {
+ for (const p of paths)
+ pathsToArray(p, init);
+ }
+ else {
+ init.push(paths);
+ }
+ return init;
+}
+/**
+ * Generate a flat list of sequence tokens from the given tokens.
+ */
+function* flatten(tokens, index, init) {
+ if (index === tokens.length) {
+ return yield init;
+ }
+ const token = tokens[index];
+ if (token.type === "group") {
+ for (const seq of flatten(token.tokens, 0, init.slice())) {
+ yield* flatten(tokens, index + 1, seq);
+ }
+ }
+ else {
+ init.push(token);
+ }
+ yield* flatten(tokens, index + 1, init);
+}
+/**
+ * Transform a flat sequence of tokens into a regular expression.
+ */
+function toRegExpSource(tokens, delimiter, keys, originalPath) {
+ let result = "";
+ let backtrack = "";
+ let isSafeSegmentParam = true;
+ for (const token of tokens) {
+ if (token.type === "text") {
+ result += escape(token.value);
+ backtrack += token.value;
+ isSafeSegmentParam || (isSafeSegmentParam = token.value.includes(delimiter));
+ continue;
+ }
+ if (token.type === "param" || token.type === "wildcard") {
+ if (!isSafeSegmentParam && !backtrack) {
+ throw new PathError(`Missing text before "${token.name}" ${token.type}`, originalPath);
+ }
+ if (token.type === "param") {
+ result += `(${negate(delimiter, isSafeSegmentParam ? "" : backtrack)}+)`;
+ }
+ else {
+ result += `([\\s\\S]+)`;
+ }
+ keys.push(token);
+ backtrack = "";
+ isSafeSegmentParam = false;
+ continue;
+ }
+ }
+ return result;
+}
+/**
+ * Block backtracking on previous text and ignore delimiter string.
+ */
+function negate(delimiter, backtrack) {
+ if (backtrack.length < 2) {
+ if (delimiter.length < 2)
+ return `[^${escape(delimiter + backtrack)}]`;
+ return `(?:(?!${escape(delimiter)})[^${escape(backtrack)}])`;
+ }
+ if (delimiter.length < 2) {
+ return `(?:(?!${escape(backtrack)})[^${escape(delimiter)}])`;
+ }
+ return `(?:(?!${escape(backtrack)}|${escape(delimiter)})[\\s\\S])`;
+}
+/**
+ * Stringify an array of tokens into a path string.
+ */
+function stringifyTokens(tokens) {
+ let value = "";
+ let i = 0;
+ function name(value) {
+ const isSafe = isNameSafe(value) && isNextNameSafe(tokens[i]);
+ return isSafe ? value : JSON.stringify(value);
+ }
+ while (i < tokens.length) {
+ const token = tokens[i++];
+ if (token.type === "text") {
+ value += escapeText(token.value);
+ continue;
+ }
+ if (token.type === "group") {
+ value += `{${stringifyTokens(token.tokens)}}`;
+ continue;
+ }
+ if (token.type === "param") {
+ value += `:${name(token.name)}`;
+ continue;
+ }
+ if (token.type === "wildcard") {
+ value += `*${name(token.name)}`;
+ continue;
+ }
+ throw new TypeError(`Unknown token type: ${token.type}`);
+ }
+ return value;
+}
+/**
+ * Stringify token data into a path string.
+ */
+function stringify(data) {
+ return stringifyTokens(data.tokens);
+}
+/**
+ * Validate the parameter name contains valid ID characters.
+ */
+function isNameSafe(name) {
+ const [first, ...rest] = name;
+ return ID_START.test(first) && rest.every((char) => ID_CONTINUE.test(char));
+}
+/**
+ * Validate the next token does not interfere with the current param name.
+ */
+function isNextNameSafe(token) {
+ if (token && token.type === "text")
+ return !ID_CONTINUE.test(token.value[0]);
+ return true;
+}
+//# sourceMappingURL=index.js.map
\ No newline at end of file
diff --git a/node_modules/path-to-regexp/dist/index.js.map b/node_modules/path-to-regexp/dist/index.js.map
new file mode 100644
index 0000000000000000000000000000000000000000..ec14c730a6dc131a198d6d7c0de206dddbc6b5f6
--- /dev/null
+++ b/node_modules/path-to-regexp/dist/index.js.map
@@ -0,0 +1 @@
+{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;AA4LA,sBA8GC;AAKD,0BAgBC;AAgHD,sBA+BC;AAED,oCA2BC;AAmJD,8BAEC;AAhoBD,MAAM,iBAAiB,GAAG,GAAG,CAAC;AAC9B,MAAM,UAAU,GAAG,CAAC,KAAa,EAAE,EAAE,CAAC,KAAK,CAAC;AAC5C,MAAM,QAAQ,GAAG,qBAAqB,CAAC;AACvC,MAAM,WAAW,GAAG,mCAAmC,CAAC;AAkFxD,MAAM,aAAa,GAA8B;IAC/C,UAAU;IACV,GAAG,EAAE,GAAG;IACR,GAAG,EAAE,GAAG;IACR,YAAY;IACZ,GAAG,EAAE,GAAG;IACR,GAAG,EAAE,GAAG;IACR,GAAG,EAAE,GAAG;IACR,GAAG,EAAE,GAAG;IACR,GAAG,EAAE,GAAG;IACR,GAAG,EAAE,GAAG;IACR,GAAG,EAAE,GAAG;CACT,CAAC;AAEF;;GAEG;AACH,SAAS,UAAU,CAAC,GAAW;IAC7B,OAAO,GAAG,CAAC,OAAO,CAAC,oBAAoB,EAAE,MAAM,CAAC,CAAC;AACnD,CAAC;AAED;;GAEG;AACH,SAAS,MAAM,CAAC,GAAW;IACzB,OAAO,GAAG,CAAC,OAAO,CAAC,sBAAsB,EAAE,MAAM,CAAC,CAAC;AACrD,CAAC;AAiDD;;GAEG;AACH,MAAa,SAAS;IACpB,YACkB,MAAe,EACf,YAAq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KAAK,CAAC,IAAI,KAAK,OAAO,EAAE,CAAC;YAC3B,KAAK,IAAI,IAAI,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC;YAChC,SAAS;QACX,CAAC;QAED,IAAI,KAAK,CAAC,IAAI,KAAK,UAAU,EAAE,CAAC;YAC9B,KAAK,IAAI,IAAI,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC;YAChC,SAAS;QACX,CAAC;QAED,MAAM,IAAI,SAAS,CAAC,uBAAwB,KAAa,CAAC,IAAI,EAAE,CAAC,CAAC;IACpE,CAAC;IAED,OAAO,KAAK,CAAC;AACf,CAAC;AAED;;GAEG;AACH,SAAgB,SAAS,CAAC,IAAe;IACvC,OAAO,eAAe,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;AACtC,CAAC;AAED;;GAEG;AACH,SAAS,UAAU,CAAC,IAAY;IAC9B,MAAM,CAAC,KAAK,EAAE,GAAG,IAAI,CAAC,GAAG,IAAI,CAAC;IAC9B,OAAO,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,IAAI,CAAC,KAAK,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,WAAW,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC;AAC9E,CAAC;AAED;;GAEG;AACH,SAAS,cAAc,CAAC,KAAwB;IAC9C,IAAI,KAAK,IAAI,KAAK,CAAC,IAAI,KAAK,MAAM;QAAE,OAAO,CAAC,WAAW,CAAC,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;IAC7E,OAAO,IAAI,CAAC;AACd,CAAC","sourcesContent":["const DEFAULT_DELIMITER = \"/\";\nconst NOOP_VALUE = (value: string) => value;\nconst ID_START = /^[$_\\p{ID_Start}]$/u;\nconst ID_CONTINUE = /^[$\\u200c\\u200d\\p{ID_Continue}]$/u;\n\n/**\n * Encode a string into another string.\n */\nexport type Encode = (value: string) => string;\n\n/**\n * Decode a string into another string.\n */\nexport type Decode = (value: string) => string;\n\nexport interface ParseOptions {\n /**\n * A function for encoding input strings.\n */\n encodePath?: Encode;\n}\n\nexport interface PathToRegexpOptions {\n /**\n * Matches the path completely without trailing characters. (default: `true`)\n */\n end?: boolean;\n /**\n * Allows optional trailing delimiter to match. (default: `true`)\n */\n trailing?: boolean;\n /**\n * Match will be case sensitive. (default: `false`)\n */\n sensitive?: boolean;\n /**\n * The default delimiter for segments. (default: `'/'`)\n */\n delimiter?: string;\n}\n\nexport interface MatchOptions extends PathToRegexpOptions {\n /**\n * Function for decoding strings for params, or `false` to disable entirely. (default: `decodeURIComponent`)\n */\n decode?: Decode | false;\n}\n\nexport interface CompileOptions {\n /**\n * Function for encoding input strings for output into the path, or `false` to disable entirely. (default: `encodeURIComponent`)\n */\n encode?: Encode | false;\n /**\n * The default delimiter for segments. (default: `'/'`)\n */\n delimiter?: string;\n}\n\ntype TokenType =\n | \"{\"\n | \"}\"\n | \"wildcard\"\n | \"param\"\n | \"char\"\n | \"escape\"\n | \"end\"\n // Reserved for use or ambiguous due to past use.\n | \"(\"\n | \")\"\n | \"[\"\n | \"]\"\n | \"+\"\n | \"?\"\n | \"!\";\n\n/**\n * Tokenizer results.\n */\ninterface LexToken {\n type: TokenType;\n index: number;\n value: string;\n}\n\nconst SIMPLE_TOKENS: Record = {\n // Groups.\n \"{\": \"{\",\n \"}\": \"}\",\n // Reserved.\n \"(\": \"(\",\n \")\": \")\",\n \"[\": \"[\",\n \"]\": \"]\",\n \"+\": \"+\",\n \"?\": \"?\",\n \"!\": \"!\",\n};\n\n/**\n * Escape text for stringify to path.\n */\nfunction escapeText(str: string) {\n return str.replace(/[{}()\\[\\]+?!:*\\\\]/g, \"\\\\$&\");\n}\n\n/**\n * Escape a regular expression string.\n */\nfunction escape(str: string) {\n return str.replace(/[.+*?^${}()[\\]|/\\\\]/g, \"\\\\$&\");\n}\n\n/**\n * Plain text.\n */\nexport interface Text {\n type: \"text\";\n value: string;\n}\n\n/**\n * A parameter designed to match arbitrary text within a segment.\n */\nexport interface Parameter {\n type: \"param\";\n name: string;\n}\n\n/**\n * A wildcard parameter designed to match multiple segments.\n */\nexport interface Wildcard {\n type: \"wildcard\";\n name: string;\n}\n\n/**\n * A set of possible tokens to expand when matching.\n */\nexport interface Group {\n type: \"group\";\n tokens: Token[];\n}\n\n/**\n * A token that corresponds with a regexp capture.\n */\nexport type Key = Parameter | Wildcard;\n\n/**\n * A sequence of `path-to-regexp` keys that match capturing groups.\n */\nexport type Keys = Array;\n\n/**\n * A sequence of path match characters.\n */\nexport type Token = Text | Parameter | Wildcard | Group;\n\n/**\n * Tokenized path instance.\n */\nexport class TokenData {\n constructor(\n public readonly tokens: Token[],\n public readonly originalPath?: string,\n ) {}\n}\n\n/**\n * ParseError is thrown when there is an error processing the path.\n */\nexport class PathError extends TypeError {\n constructor(\n message: string,\n public readonly originalPath: string | undefined,\n ) {\n let text = message;\n if (originalPath) text += `: ${originalPath}`;\n text += `; visit https://git.new/pathToRegexpError for info`;\n super(text);\n }\n}\n\n/**\n * Parse a string for the raw tokens.\n */\nexport function parse(str: string, options: ParseOptions = {}): TokenData {\n const { encodePath = NOOP_VALUE } = options;\n const chars = [...str];\n const tokens: Array = [];\n let index = 0;\n let pos = 0;\n\n function name() {\n let value = \"\";\n\n if (ID_START.test(chars[index])) {\n do {\n value += chars[index++];\n } while (ID_CONTINUE.test(chars[index]));\n } else if (chars[index] === '\"') {\n let quoteStart = index;\n\n while (index++ < chars.length) {\n if (chars[index] === '\"') {\n index++;\n quoteStart = 0;\n break;\n }\n\n // Increment over escape characters.\n if (chars[index] === \"\\\\\") index++;\n\n value += chars[index];\n }\n\n if (quoteStart) {\n throw new PathError(`Unterminated quote at index ${quoteStart}`, str);\n }\n }\n\n if (!value) {\n throw new PathError(`Missing parameter name at index ${index}`, str);\n }\n\n return value;\n }\n\n while (index < chars.length) {\n const value = chars[index];\n const type = SIMPLE_TOKENS[value];\n\n if (type) {\n tokens.push({ type, index: index++, value });\n } else if (value === \"\\\\\") {\n tokens.push({ type: \"escape\", index: index++, value: chars[index++] });\n } else if (value === \":\") {\n tokens.push({ type: \"param\", index: index++, value: name() });\n } else if (value === \"*\") {\n tokens.push({ type: \"wildcard\", index: index++, value: name() });\n } else {\n tokens.push({ type: \"char\", index: index++, value });\n }\n }\n\n tokens.push({ type: \"end\", index, value: \"\" });\n\n function consumeUntil(endType: TokenType): Token[] {\n const output: Token[] = [];\n\n while (true) {\n const token = tokens[pos++];\n if (token.type === endType) break;\n\n if (token.type === \"char\" || token.type === \"escape\") {\n let path = token.value;\n let cur = tokens[pos];\n\n while (cur.type === \"char\" || cur.type === \"escape\") {\n path += cur.value;\n cur = tokens[++pos];\n }\n\n output.push({\n type: \"text\",\n value: encodePath(path),\n });\n continue;\n }\n\n if (token.type === \"param\" || token.type === \"wildcard\") {\n output.push({\n type: token.type,\n name: token.value,\n });\n continue;\n }\n\n if (token.type === \"{\") {\n output.push({\n type: \"group\",\n tokens: consumeUntil(\"}\"),\n });\n continue;\n }\n\n throw new PathError(\n `Unexpected ${token.type} at index ${token.index}, expected ${endType}`,\n str,\n );\n }\n\n return output;\n }\n\n return new TokenData(consumeUntil(\"end\"), str);\n}\n\n/**\n * Compile a string to a template function for the path.\n */\nexport function compile(\n path: Path,\n options: CompileOptions & ParseOptions = {},\n) {\n const { encode = encodeURIComponent, delimiter = DEFAULT_DELIMITER } =\n options;\n const data = typeof path === \"object\" ? path : parse(path, options);\n const fn = tokensToFunction(data.tokens, delimiter, encode);\n\n return function path(params: P = {} as P) {\n const [path, ...missing] = fn(params);\n if (missing.length) {\n throw new TypeError(`Missing parameters: ${missing.join(\", \")}`);\n }\n return path;\n };\n}\n\nexport type ParamData = Partial>;\nexport type PathFunction = (data?: P) => string;\n\nfunction tokensToFunction(\n tokens: Token[],\n delimiter: string,\n encode: Encode | false,\n) {\n const encoders = tokens.map((token) =>\n tokenToFunction(token, delimiter, encode),\n );\n\n return (data: ParamData) => {\n const result: string[] = [\"\"];\n\n for (const encoder of encoders) {\n const [value, ...extras] = encoder(data);\n result[0] += value;\n result.push(...extras);\n }\n\n return result;\n };\n}\n\n/**\n * Convert a single token into a path building function.\n */\nfunction tokenToFunction(\n token: Token,\n delimiter: string,\n encode: Encode | false,\n): (data: ParamData) => string[] {\n if (token.type === \"text\") return () => [token.value];\n\n if (token.type === \"group\") {\n const fn = tokensToFunction(token.tokens, delimiter, encode);\n\n return (data) => {\n const [value, ...missing] = fn(data);\n if (!missing.length) return [value];\n return [\"\"];\n };\n }\n\n const encodeValue = encode || NOOP_VALUE;\n\n if (token.type === \"wildcard\" && encode !== false) {\n return (data) => {\n const value = data[token.name];\n if (value == null) return [\"\", token.name];\n\n if (!Array.isArray(value) || value.length === 0) {\n throw new TypeError(`Expected \"${token.name}\" to be a non-empty array`);\n }\n\n return [\n value\n .map((value, index) => {\n if (typeof value !== \"string\") {\n throw new TypeError(\n `Expected \"${token.name}/${index}\" to be a string`,\n );\n }\n\n return encodeValue(value);\n })\n .join(delimiter),\n ];\n };\n }\n\n return (data) => {\n const value = data[token.name];\n if (value == null) return [\"\", token.name];\n\n if (typeof value !== \"string\") {\n throw new TypeError(`Expected \"${token.name}\" to be a string`);\n }\n\n return [encodeValue(value)];\n };\n}\n\n/**\n * A match result contains data about the path match.\n */\nexport interface MatchResult
{\n path: string;\n params: P;\n}\n\n/**\n * A match is either `false` (no match) or a match result.\n */\nexport type Match
= false | MatchResult
;\n\n/**\n * The match function takes a string and returns whether it matched the path.\n */\nexport type MatchFunction
= (path: string) => Match
;\n\n/**\n * Supported path types.\n */\nexport type Path = string | TokenData;\n\n/**\n * Transform a path into a match function.\n */\nexport function match
(\n path: Path | Path[],\n options: MatchOptions & ParseOptions = {},\n): MatchFunction
{\n const { decode = decodeURIComponent, delimiter = DEFAULT_DELIMITER } =\n options;\n const { regexp, keys } = pathToRegexp(path, options);\n\n const decoders = keys.map((key) => {\n if (decode === false) return NOOP_VALUE;\n if (key.type === \"param\") return decode;\n return (value: string) => value.split(delimiter).map(decode);\n });\n\n return function match(input: string) {\n const m = regexp.exec(input);\n if (!m) return false;\n\n const path = m[0];\n const params = Object.create(null);\n\n for (let i = 1; i < m.length; i++) {\n if (m[i] === undefined) continue;\n\n const key = keys[i - 1];\n const decoder = decoders[i - 1];\n params[key.name] = decoder(m[i]);\n }\n\n return { path, params };\n };\n}\n\nexport function pathToRegexp(\n path: Path | Path[],\n options: PathToRegexpOptions & ParseOptions = {},\n) {\n const {\n delimiter = DEFAULT_DELIMITER,\n end = true,\n sensitive = false,\n trailing = true,\n } = options;\n const keys: Keys = [];\n const flags = sensitive ? \"\" : \"i\";\n const sources: string[] = [];\n\n for (const input of pathsToArray(path, [])) {\n const data = typeof input === \"object\" ? input : parse(input, options);\n for (const tokens of flatten(data.tokens, 0, [])) {\n sources.push(toRegExpSource(tokens, delimiter, keys, data.originalPath));\n }\n }\n\n let pattern = `^(?:${sources.join(\"|\")})`;\n if (trailing) pattern += `(?:${escape(delimiter)}$)?`;\n pattern += end ? \"$\" : `(?=${escape(delimiter)}|$)`;\n\n const regexp = new RegExp(pattern, flags);\n return { regexp, keys };\n}\n\n/**\n * Convert a path or array of paths into a flat array.\n */\nfunction pathsToArray(paths: Path | Path[], init: Path[]): Path[] {\n if (Array.isArray(paths)) {\n for (const p of paths) pathsToArray(p, init);\n } else {\n init.push(paths);\n }\n return init;\n}\n\n/**\n * Flattened token set.\n */\ntype FlatToken = Text | Parameter | Wildcard;\n\n/**\n * Generate a flat list of sequence tokens from the given tokens.\n */\nfunction* flatten(\n tokens: Token[],\n index: number,\n init: FlatToken[],\n): Generator {\n if (index === tokens.length) {\n return yield init;\n }\n\n const token = tokens[index];\n\n if (token.type === \"group\") {\n for (const seq of flatten(token.tokens, 0, init.slice())) {\n yield* flatten(tokens, index + 1, seq);\n }\n } else {\n init.push(token);\n }\n\n yield* flatten(tokens, index + 1, init);\n}\n\n/**\n * Transform a flat sequence of tokens into a regular expression.\n */\nfunction toRegExpSource(\n tokens: FlatToken[],\n delimiter: string,\n keys: Keys,\n originalPath: string | undefined,\n): string {\n let result = \"\";\n let backtrack = \"\";\n let isSafeSegmentParam = true;\n\n for (const token of tokens) {\n if (token.type === \"text\") {\n result += escape(token.value);\n backtrack += token.value;\n isSafeSegmentParam ||= token.value.includes(delimiter);\n continue;\n }\n\n if (token.type === \"param\" || token.type === \"wildcard\") {\n if (!isSafeSegmentParam && !backtrack) {\n throw new PathError(\n `Missing text before \"${token.name}\" ${token.type}`,\n originalPath,\n );\n }\n\n if (token.type === \"param\") {\n result += `(${negate(delimiter, isSafeSegmentParam ? \"\" : backtrack)}+)`;\n } else {\n result += `([\\\\s\\\\S]+)`;\n }\n\n keys.push(token);\n backtrack = \"\";\n isSafeSegmentParam = false;\n continue;\n }\n }\n\n return result;\n}\n\n/**\n * Block backtracking on previous text and ignore delimiter string.\n */\nfunction negate(delimiter: string, backtrack: string): string {\n if (backtrack.length < 2) {\n if (delimiter.length < 2) return `[^${escape(delimiter + backtrack)}]`;\n return `(?:(?!${escape(delimiter)})[^${escape(backtrack)}])`;\n }\n if (delimiter.length < 2) {\n return `(?:(?!${escape(backtrack)})[^${escape(delimiter)}])`;\n }\n return `(?:(?!${escape(backtrack)}|${escape(delimiter)})[\\\\s\\\\S])`;\n}\n\n/**\n * Stringify an array of tokens into a path string.\n */\nfunction stringifyTokens(tokens: Token[]): string {\n let value = \"\";\n let i = 0;\n\n function name(value: string) {\n const isSafe = isNameSafe(value) && isNextNameSafe(tokens[i]);\n return isSafe ? value : JSON.stringify(value);\n }\n\n while (i < tokens.length) {\n const token = tokens[i++];\n\n if (token.type === \"text\") {\n value += escapeText(token.value);\n continue;\n }\n\n if (token.type === \"group\") {\n value += `{${stringifyTokens(token.tokens)}}`;\n continue;\n }\n\n if (token.type === \"param\") {\n value += `:${name(token.name)}`;\n continue;\n }\n\n if (token.type === \"wildcard\") {\n value += `*${name(token.name)}`;\n continue;\n }\n\n throw new TypeError(`Unknown token type: ${(token as any).type}`);\n }\n\n return value;\n}\n\n/**\n * Stringify token data into a path string.\n */\nexport function stringify(data: TokenData): string {\n return stringifyTokens(data.tokens);\n}\n\n/**\n * Validate the parameter name contains valid ID characters.\n */\nfunction isNameSafe(name: string): boolean {\n const [first, ...rest] = name;\n return ID_START.test(first) && rest.every((char) => ID_CONTINUE.test(char));\n}\n\n/**\n * Validate the next token does not interfere with the current param name.\n */\nfunction isNextNameSafe(token: Token | undefined): boolean {\n if (token && token.type === \"text\") return !ID_CONTINUE.test(token.value[0]);\n return true;\n}\n"]}
\ No newline at end of file
diff --git a/node_modules/path-to-regexp/package.json b/node_modules/path-to-regexp/package.json
new file mode 100644
index 0000000000000000000000000000000000000000..7ae266ef77f77e7341bfc43d6624a7f80848369e
--- /dev/null
+++ b/node_modules/path-to-regexp/package.json
@@ -0,0 +1,64 @@
+{
+ "name": "path-to-regexp",
+ "version": "8.3.0",
+ "description": "Express style path to RegExp utility",
+ "keywords": [
+ "express",
+ "regexp",
+ "route",
+ "routing"
+ ],
+ "repository": {
+ "type": "git",
+ "url": "https://github.com/pillarjs/path-to-regexp.git"
+ },
+ "funding": {
+ "type": "opencollective",
+ "url": "https://opencollective.com/express"
+ },
+ "license": "MIT",
+ "exports": "./dist/index.js",
+ "main": "dist/index.js",
+ "typings": "dist/index.d.ts",
+ "files": [
+ "dist/"
+ ],
+ "scripts": {
+ "bench": "vitest bench",
+ "build": "ts-scripts build",
+ "format": "ts-scripts format",
+ "lint": "ts-scripts lint",
+ "prepare": "ts-scripts install && npm run build",
+ "size": "size-limit",
+ "specs": "ts-scripts specs",
+ "test": "ts-scripts test && npm run size"
+ },
+ "devDependencies": {
+ "@borderless/ts-scripts": "^0.15.0",
+ "@size-limit/preset-small-lib": "^11.1.2",
+ "@types/node": "^22.7.2",
+ "@types/semver": "^7.3.1",
+ "@vitest/coverage-v8": "^3.0.5",
+ "recheck": "^4.4.5",
+ "size-limit": "^11.1.2",
+ "typescript": "^5.7.3",
+ "vitest": "^3.0.5"
+ },
+ "publishConfig": {
+ "access": "public"
+ },
+ "size-limit": [
+ {
+ "path": "dist/index.js",
+ "limit": "2 kB"
+ }
+ ],
+ "ts-scripts": {
+ "dist": [
+ "dist"
+ ],
+ "project": [
+ "tsconfig.build.json"
+ ]
+ }
+}
diff --git a/node_modules/pbf/LICENSE b/node_modules/pbf/LICENSE
new file mode 100644
index 0000000000000000000000000000000000000000..7245151df81a0489401451248329a6a491d44f08
--- /dev/null
+++ b/node_modules/pbf/LICENSE
@@ -0,0 +1,27 @@
+Copyright (c) 2017, Mapbox
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are met:
+
+* Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+* Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following disclaimer in the documentation
+ and/or other materials provided with the distribution.
+
+* Neither the name of pbf nor the names of its
+ contributors may be used to endorse or promote products derived from
+ this software without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
+FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
diff --git a/node_modules/pbf/README.md b/node_modules/pbf/README.md
new file mode 100644
index 0000000000000000000000000000000000000000..f2bbd0600a84480d721f6a6045e7ee80caa689e9
--- /dev/null
+++ b/node_modules/pbf/README.md
@@ -0,0 +1,453 @@
+# pbf
+
+[](https://github.com/mapbox/pbf/actions/workflows/node.yml)
+
+
+A low-level, fast, ultra-lightweight (3KB gzipped) JavaScript library for decoding and encoding [protocol buffers](https://developers.google.com/protocol-buffers), a compact binary format for structured data serialization. Works both in Node and the browser. Supports lazy decoding and detailed customization of the reading/writing code.
+
+## Performance
+
+This library is extremely fast — much faster than native `JSON.parse`/`JSON.stringify`
+and the [protocol-buffers](https://github.com/mafintosh/protocol-buffers) module.
+Here's a result from running a real-world benchmark on Node v6.5
+(decoding and encoding a sample of 439 vector tiles, 22.6 MB total):
+
+- **pbf** decode: 387ms, or 57 MB/s
+- **pbf** encode: 396ms, or 56 MB/s
+- **protocol-buffers** decode: 837ms, or 26 MB/s
+- **protocol-buffers** encode: 4197ms, or 5 MB/s
+- **JSON.parse**: 1540ms, or 125 MB/s (parsing an equivalent 77.5 MB JSON file)
+- **JSON.stringify**: 607ms, or 49 MB/s
+
+## Examples
+
+#### Using Compiled Code
+
+Install `pbf` and compile a JavaScript module from a `.proto` file:
+
+```bash
+$ npm install -g pbf
+$ pbf example.proto > example.js
+```
+
+Then read and write objects using the module like this:
+
+```js
+var Pbf = require('pbf');
+var Example = require('./example.js').Example;
+
+// read
+var pbf = new Pbf(buffer);
+var obj = Example.read(pbf);
+
+// write
+var pbf = new Pbf();
+Example.write(obj, pbf);
+var buffer = pbf.finish();
+```
+
+Alternatively, you can compile a module directly in the code:
+
+```js
+var compile = require('pbf/compile');
+var schema = require('protocol-buffers-schema');
+
+var proto = schema.parse(fs.readFileSync('example.proto'));
+var Test = compile(proto).Test;
+```
+
+If you use `webpack` as your module bundler, you can use [pbf-loader](https://github.com/trivago/pbf-loader)
+to load .proto files directly. It returns a compiled module ready to be used.
+
+Given you already configured your `webpack.config.js`, the code above would look like:
+```js
+var Pbf = require('pbf');
+var proto = require('./example.proto');
+
+var Test = proto.Test;
+```
+
+#### Custom Reading
+
+```js
+var data = new Pbf(buffer).readFields(readData, {});
+
+function readData(tag, data, pbf) {
+ if (tag === 1) data.name = pbf.readString();
+ else if (tag === 2) data.version = pbf.readVarint();
+ else if (tag === 3) data.layer = pbf.readMessage(readLayer, {});
+}
+function readLayer(tag, layer, pbf) {
+ if (tag === 1) layer.name = pbf.readString();
+ else if (tag === 3) layer.size = pbf.readVarint();
+}
+```
+
+#### Custom Writing
+
+```js
+var pbf = new Pbf();
+writeData(data, pbf);
+var buffer = pbf.finish();
+
+function writeData(data, pbf) {
+ pbf.writeStringField(1, data.name);
+ pbf.writeVarintField(2, data.version);
+ pbf.writeMessage(3, writeLayer, data.layer);
+}
+function writeLayer(layer, pbf) {
+ pbf.writeStringField(1, layer.name);
+ pbf.writeVarintField(2, layer.size);
+}
+```
+
+## Install
+
+Node and Browserify:
+
+```bash
+npm install pbf
+```
+
+Making a browser build:
+
+```bash
+npm install
+npm run build-dev # dist/pbf-dev.js (development build)
+npm run build-min # dist/pbf.js (minified production build)
+```
+
+CDN link: https://unpkg.com/pbf@3.0.5/dist/pbf.js
+
+## API
+
+Create a `Pbf` object, optionally given a `Buffer` or `Uint8Array` as input data:
+
+```js
+// parse a pbf file from disk in Node
+var pbf = new Pbf(fs.readFileSync('data.pbf'));
+
+// parse a pbf file in a browser after an ajax request with responseType="arraybuffer"
+var pbf = new Pbf(new Uint8Array(xhr.response));
+```
+
+`Pbf` object properties:
+
+```js
+pbf.length; // length of the underlying buffer
+pbf.pos; // current offset for reading or writing
+```
+
+#### Reading
+
+Read a sequence of fields:
+
+```js
+pbf.readFields(function (tag) {
+ if (tag === 1) pbf.readVarint();
+ else if (tag === 2) pbf.readString();
+ else ...
+});
+```
+
+It optionally accepts an object that will be passed to the reading function for easier construction of decoded data,
+and also passes the `Pbf` object as a third argument:
+
+```js
+var result = pbf.readFields(callback, {})
+
+function callback(tag, result, pbf) {
+ if (tag === 1) result.id = pbf.readVarint();
+}
+```
+
+To read an embedded message, use `pbf.readMessage(fn[, obj])` (in the same way as `read`).
+
+Read values:
+
+```js
+var value = pbf.readVarint();
+var str = pbf.readString();
+var numbers = pbf.readPackedVarint();
+```
+
+For lazy or partial decoding, simply save the position instead of reading a value,
+then later set it back to the saved value and read:
+
+```js
+var fooPos = -1;
+pbf.readFields(function (tag) {
+ if (tag === 1) fooPos = pbf.pos;
+});
+...
+pbf.pos = fooPos;
+pbf.readMessage(readFoo);
+```
+
+Scalar reading methods:
+
+* `readVarint(isSigned)` (pass `true` if you expect negative varints)
+* `readSVarint()`
+* `readFixed32()`
+* `readFixed64()`
+* `readSFixed32()`
+* `readSFixed64()`
+* `readBoolean()`
+* `readFloat()`
+* `readDouble()`
+* `readString()`
+* `readBytes()`
+* `skip(value)`
+
+Packed reading methods:
+
+* `readPackedVarint(arr, isSigned)` (appends read items to `arr`)
+* `readPackedSVarint(arr)`
+* `readPackedFixed32(arr)`
+* `readPackedFixed64(arr)`
+* `readPackedSFixed32(arr)`
+* `readPackedSFixed64(arr)`
+* `readPackedBoolean(arr)`
+* `readPackedFloat(arr)`
+* `readPackedDouble(arr)`
+
+#### Writing
+
+Write values:
+
+```js
+pbf.writeVarint(123);
+pbf.writeString("Hello world");
+```
+
+Write an embedded message:
+
+```js
+pbf.writeMessage(1, writeObj, obj);
+
+function writeObj(obj, pbf) {
+ pbf.writeStringField(obj.name);
+ pbf.writeVarintField(obj.version);
+}
+```
+
+Field writing methods:
+
+* `writeVarintField(tag, val)`
+* `writeSVarintField(tag, val)`
+* `writeFixed32Field(tag, val)`
+* `writeFixed64Field(tag, val)`
+* `writeSFixed32Field(tag, val)`
+* `writeSFixed64Field(tag, val)`
+* `writeBooleanField(tag, val)`
+* `writeFloatField(tag, val)`
+* `writeDoubleField(tag, val)`
+* `writeStringField(tag, val)`
+* `writeBytesField(tag, buffer)`
+
+Packed field writing methods:
+
+* `writePackedVarint(tag, val)`
+* `writePackedSVarint(tag, val)`
+* `writePackedSFixed32(tag, val)`
+* `writePackedSFixed64(tag, val)`
+* `writePackedBoolean(tag, val)`
+* `writePackedFloat(tag, val)`
+* `writePackedDouble(tag, val)`
+
+Scalar writing methods:
+
+* `writeVarint(val)`
+* `writeSVarint(val)`
+* `writeSFixed32(val)`
+* `writeSFixed64(val)`
+* `writeBoolean(val)`
+* `writeFloat(val)`
+* `writeDouble(val)`
+* `writeString(val)`
+* `writeBytes(buffer)`
+
+Message writing methods:
+
+* `writeMessage(tag, fn[, obj])`
+* `writeRawMessage(fn[, obj])`
+
+Misc methods:
+
+* `realloc(minBytes)` - pad the underlying buffer size to accommodate the given number of bytes;
+ note that the size increases exponentially, so it won't necessarily equal the size of data written
+* `finish()` - make the current buffer ready for reading and return the data as a buffer slice
+* `destroy()` - dispose the buffer
+
+For an example of a real-world usage of the library, see [vector-tile-js](https://github.com/mapbox/vector-tile-js).
+
+
+## Proto Schema to JavaScript
+
+If installed globally, `pbf` provides a binary that compiles `proto` files into JavaScript modules. Usage:
+
+```bash
+$ pbf [--no-write] [--no-read] [--browser]
+```
+
+The `--no-write` and `--no-read` switches remove corresponding code in the output.
+The `--browser` switch makes the module work in browsers instead of Node.
+
+The resulting module exports each message by name with the following methods:
+
+* `read(pbf)` - decodes an object from the given `Pbf` instance
+* `write(obj, pbf)` - encodes an object into the given `Pbf` instance (usually empty)
+
+The resulting code is clean and simple, so feel free to customize it.
+
+## Changelog
+
+#### 3.2.1 (Oct 11, 2019)
+
+- Significantly improved performance when decoding large strings in the browser.
+
+#### 3.2.0 (Mar 11, 2019)
+
+- Improved decoding to be able to parse repeated fields even if they were specified as packed, and vise versa.
+- Improved packed encoding to skip empty arrays (previously, it would write a tag).
+- Fixed an off-by-one data corruption bug when writing a message larger than 0x10000000 bytes.
+
+#### 3.1.0 (Sep 27, 2017)
+
+- Added support for Protocol Buffer 3 [maps](https://developers.google.com/protocol-buffers/docs/proto3#maps) to proto compiler.
+
+#### 3.0.5 (Nov 30, 2016)
+
+- Fixed an error appearing in some versions of IE11 and old Android browsers.
+
+#### 3.0.4 (Nov 14, 2016)
+
+- Fixed compiling repeated packed enum fields.
+
+#### 3.0.3 (Nov 14, 2016)
+
+- Fixed a regression that broke compiling repeated enum fields with defaults.
+
+#### 3.0.2 (Sep 30, 2016)
+
+- Fixed a regression that broke decoding of packed fields with a tag that didn't fit into one byte.
+
+#### 3.0.1 (Sep 20, 2016)
+
+- Fixed a regression that broke encoding of long strings.
+
+#### 3.0.0 (Aug 30, 2016)
+
+This release include tons of compatibility/robustness fixes, and a more reliable Node implementation. Decoding performance is expected to get up to ~15% slower than v2.0 in Node (browsers are unaffected), but encoding got faster by ~15% in return.
+
+##### Encoder/decoder
+
+- **Breaking**: changed Node implementation to use `Uint8Array` instead of `Buffer` internally (and produce corresponding result on `finish()`), making it fully match the browser implementation for consistency and simplicity.
+- Fixed `writeVarint` to write `0` when given `NaN` or other non-number to avoid producing a broken Protobuf message.
+- Changed `readPacked*` methods signature to accept an optional `arr` argument to append the results to (to support messages with repeated fields that mix packed/non-packed encoding).
+- Added an optional `isSigned` argument to `readVarint` that enables proper reading of negative varints.
+- Deprecated `readVarint64()` (it still works, but it's recommended to be changed to `readVarint(true)`).
+- Faster string encoding.
+
+##### Proto compiler
+
+- **Breaking:** Full support for defaults field values (both implicit and explicit); they're now included in the decoded JSON objects.
+- Fixed reading of repeated fields with mixed packed/non-packed encoding for compatibility.
+- Fixed proto3 compiler to use packed by default for repeated scalar fields.
+- Fixed reading of negative varint types.
+- Fixed packed fields to decode into `[]` if they're not present.
+- Fixed nested message references handling.
+- Fixed `packed=false` being interpreted as packed.
+- Added a comment to generated code with pbf version number.
+
+#### 2.0.1 (May 28, 2016)
+
+- Fixed a regression with `writeVarint` that affected certain numbers.
+
+#### 2.0.0 (May 28, 2016)
+
+- Significantly improved the proto compiler, which now produces a much safer reading/writing code.
+- Added the ability to compile a read/write module from a protobuf schema directly in the code.
+- Proto compiler: fixed name resolutions and collisions in schemas with nested messages.
+- Proto compiler: fixed broken top-level enums.
+
+#### 1.3.7 (May 28, 2016)
+
+- Fixed a regression with `writeVarint` that affected certain numbers.
+
+#### 1.3.6 (May 27, 2016)
+
+- Improved read and write performance (both ~15% faster).
+- Improved generated code for default values.
+
+#### 1.3.5 (Oct 5, 2015)
+
+- Added support for `syntax` keyword proto files (by updating `resolve-protobuf-schema` dependency).
+
+#### 1.3.4 (Jul 31, 2015)
+
+- Added `writeRawMessage` method for writing a message without a tag, useful for creating pbfs with multiple top-level messages.
+
+#### 1.3.2 (Mar 5, 2015)
+
+- Added `readVarint64` method for proper decoding of negative `int64`-encoded values.
+
+#### 1.3.1 (Feb 20, 2015)
+
+- Fixed pbf proto compile tool generating broken writing code.
+
+#### 1.3.0 (Feb 5, 2015)
+
+- Added `pbf` binary that compiles `.proto` files into `Pbf`-based JavaScript modules.
+
+#### 1.2.0 (Jan 5, 2015)
+
+##### Breaking API changes
+
+- Changed `writeMessage` signature to `(tag, fn, obj)` (see example in the docs)
+ for a huge encoding performance improvement.
+- Replaced `readPacked` and `writePacked` methods that accept type as a string
+ with `readPackedVarint`, etc. for each type (better performance and simpler API).
+
+##### Improvements
+
+- 5x faster encoding in Node (vector tile benchmark).
+- 40x faster encoding and 3x faster decoding in the browser (vector tile benchmark).
+
+#### 1.1.4 (Jan 2, 2015)
+
+- Significantly improved `readPacked` and `writePacked` performance (the tile reading benchmark is now 70% faster).
+
+#### 1.1.3 (Dec 26, 2014)
+
+Brings tons of improvements and fixes over the previous version (`0.0.2`).
+Basically makes the library complete.
+
+##### Improvements
+
+- Improved performance of both reading and writing.
+- Made the browser build 3 times smaller.
+- Added convenience `readFields` and `readMessage` methods for a much easier reading API.
+- Added reading methods: `readFloat`, `readBoolean`, `readSFixed32`, `readSFixed64`.
+- Added writing methods: `writeUInt64`, `writeSFixed32`, `writeSFixed64`.
+- Improved `readDouble` and `readString` to use native Buffer methods under Node.
+- Improved `readString` and `writeString` to use HTML5 `TextEncoder` and `TextDecoder` where available.
+- Made `Pbf` `buffer` argument optional.
+- Added extensive docs and examples in the readme.
+- Added an extensive test suite that brings test coverage up to 100%.
+
+##### Breaking API changes
+
+- Renamed `readBuffer`/`writeBuffer` to `readBytes`/`writeBytes`.
+- Renamed `readUInt32`/`writeUInt32` to `readFixed32`/`writeFixed32`, etc.
+- Renamed `writeTaggedVarint` to `writeVarintField`, etc.
+- Changed `writePacked` signature from `(type, tag, items)` to `(tag, type, items)`.
+
+##### Bugfixes
+
+- Fixed `readVarint` to handle varints bigger than 6 bytes.
+- Fixed `readSVarint` to handle number bigger than `2^30`.
+- Fixed `writeVarint` failing on some integers.
+- Fixed `writeVarint` not throwing an error on numbers that are too big.
+- Fixed `readUInt64` always failing.
+- Fixed writing to an empty buffer always failing.
diff --git a/node_modules/pbf/bin/pbf b/node_modules/pbf/bin/pbf
new file mode 100644
index 0000000000000000000000000000000000000000..10645149f9ba0c1434170b9d5ac76db8b2d5f0cf
--- /dev/null
+++ b/node_modules/pbf/bin/pbf
@@ -0,0 +1,19 @@
+#!/usr/bin/env node
+
+'use strict';
+
+var resolve = require('resolve-protobuf-schema');
+var compile = require('../compile');
+
+if (process.argv.length < 3) {
+ console.error('Usage: pbf [file.proto] [--browser] [--no-read] [--no-write]');
+ return;
+}
+
+var code = compile.raw(resolve.sync(process.argv[2]), {
+ exports: process.argv.indexOf('--browser') >= 0 ? 'self' : 'exports',
+ noRead: process.argv.indexOf('--no-read') >= 0,
+ noWrite: process.argv.indexOf('--no-write') >= 0
+});
+
+process.stdout.write(code);
diff --git a/node_modules/pbf/compile.js b/node_modules/pbf/compile.js
new file mode 100644
index 0000000000000000000000000000000000000000..18d6bc8cf289b0615ebdc1006cea87008bbb51be
--- /dev/null
+++ b/node_modules/pbf/compile.js
@@ -0,0 +1,435 @@
+'use strict';
+
+module.exports = compile;
+
+var version = require('./package.json').version;
+
+function compile(proto) {
+ var code = 'var exports = {};\n';
+ code += compileRaw(proto) + '\n';
+ code += 'return exports;\n';
+ return new Function(code)();
+}
+
+compile.raw = compileRaw;
+
+function compileRaw(proto, options) {
+ var pre = '\'use strict\'; // code generated by pbf v' + version + '\n';
+ var context = buildDefaults(buildContext(proto, null), proto.syntax);
+ return pre + writeContext(context, options || {});
+}
+
+function writeContext(ctx, options) {
+ var code = '';
+ if (ctx._proto.fields) code += writeMessage(ctx, options);
+ if (ctx._proto.values) code += writeEnum(ctx, options);
+
+ for (var i = 0; i < ctx._children.length; i++) {
+ code += writeContext(ctx._children[i], options);
+ }
+ return code;
+}
+
+function writeMessage(ctx, options) {
+ var name = ctx._name;
+ var fields = ctx._proto.fields;
+ var numRepeated = 0;
+
+ var code = '\n// ' + name + ' ========================================\n\n';
+
+ if (!options.noRead || !options.noWrite) {
+ code += compileExport(ctx, options) + ' {};\n\n';
+ }
+
+ if (!options.noRead) {
+ code += name + '.read = function (pbf, end) {\n';
+ code += ' return pbf.readFields(' + name + '._readField, ' + compileDest(ctx) + ', end);\n';
+ code += '};\n';
+ code += name + '._readField = function (tag, obj, pbf) {\n';
+
+ for (var i = 0; i < fields.length; i++) {
+ var field = fields[i];
+ var readCode = compileFieldRead(ctx, field);
+ var packed = willSupportPacked(ctx, field);
+ code += ' ' + (i ? 'else if' : 'if') +
+ ' (tag === ' + field.tag + ') ' +
+ (field.type === 'map' ? ' { ' : '') +
+ (
+ field.type === 'map' ? compileMapRead(readCode, field.name, numRepeated++) :
+ field.repeated && !packed ? 'obj.' + field.name + '.push(' + readCode + ')' :
+ field.repeated && packed ? readCode : 'obj.' + field.name + ' = ' + readCode
+ );
+
+ if (field.oneof) {
+ code += ', obj.' + field.oneof + ' = ' + JSON.stringify(field.name);
+ }
+
+ code += ';' + (field.type === 'map' ? ' }' : '') + '\n';
+ }
+ code += '};\n';
+ }
+
+ if (!options.noWrite) {
+ code += name + '.write = function (obj, pbf) {\n';
+ numRepeated = 0;
+ for (i = 0; i < fields.length; i++) {
+ field = fields[i];
+ var writeCode = field.repeated && !isPacked(field) ?
+ compileRepeatedWrite(ctx, field, numRepeated++) :
+ field.type === 'map' ? compileMapWrite(ctx, field, numRepeated++) :
+ compileFieldWrite(ctx, field, 'obj.' + field.name);
+ code += getDefaultWriteTest(ctx, field);
+ code += writeCode + ';\n';
+ }
+ code += '};\n';
+ }
+ return code;
+}
+
+function getEnumValues(ctx) {
+ var enums = {};
+ var ids = Object.keys(ctx._proto.values);
+ for (var i = 0; i < ids.length; i++) {
+ enums[ids[i]] = ctx._proto.values[ids[i]].value;
+ }
+ return enums;
+}
+
+function writeEnum(ctx, options) {
+ return '\n' + compileExport(ctx, options) + ' ' +
+ JSON.stringify(getEnumValues(ctx), null, 4) + ';\n';
+}
+
+function compileExport(ctx, options) {
+ var exportsVar = options.exports || 'exports';
+ return (ctx._root ? 'var ' + ctx._name + ' = ' + exportsVar + '.' : '') + ctx._name + ' =';
+}
+
+function compileDest(ctx) {
+ var props = {};
+ for (var i = 0; i < ctx._proto.fields.length; i++) {
+ var field = ctx._proto.fields[i];
+ props[field.name + ': ' + JSON.stringify(ctx._defaults[field.name])] = true;
+ if (field.oneof) props[field.oneof + ': undefined'] = true;
+ }
+ return '{' + Object.keys(props).join(', ') + '}';
+}
+
+function isEnum(type) {
+ return type && type._proto.values;
+}
+
+function getType(ctx, field) {
+ if (field.type === 'map') {
+ return ctx[getMapMessageName(field.tag)];
+ }
+
+ var path = field.type.split('.');
+ return path.reduce(function(ctx, name) { return ctx && ctx[name]; }, ctx);
+}
+
+function fieldShouldUseStringAsNumber(field) {
+ if (field.options.jstype === 'JS_STRING') {
+ switch (field.type) {
+ case 'float':
+ case 'double':
+ case 'uint32':
+ case 'uint64':
+ case 'int32':
+ case 'int64':
+ case 'sint32':
+ case 'sint64':
+ case 'fixed32':
+ case 'fixed64':
+ case 'sfixed32':
+ case 'sfixed64': return true;
+ default: return false;
+ }
+ }
+ return false;
+}
+
+function compileFieldRead(ctx, field) {
+ var type = getType(ctx, field);
+ if (type) {
+ if (type._proto.fields) return type._name + '.read(pbf, pbf.readVarint() + pbf.pos)';
+ if (!isEnum(type)) throw new Error('Unexpected type: ' + type._name);
+ }
+
+ var fieldType = isEnum(type) ? 'enum' : field.type;
+
+ var prefix = 'pbf.read';
+ var signed = fieldType === 'int32' || fieldType === 'int64' ? 'true' : '';
+ var suffix = '(' + signed + ')';
+
+ if (willSupportPacked(ctx, field)) {
+ prefix += 'Packed';
+ suffix = '(obj.' + field.name + (signed ? ', ' + signed : '') + ')';
+ }
+
+ if (fieldShouldUseStringAsNumber(field)) {
+ suffix += '.toString()';
+ }
+
+ switch (fieldType) {
+ case 'string': return prefix + 'String' + suffix;
+ case 'float': return prefix + 'Float' + suffix;
+ case 'double': return prefix + 'Double' + suffix;
+ case 'bool': return prefix + 'Boolean' + suffix;
+ case 'enum':
+ case 'uint32':
+ case 'uint64':
+ case 'int32':
+ case 'int64': return prefix + 'Varint' + suffix;
+ case 'sint32':
+ case 'sint64': return prefix + 'SVarint' + suffix;
+ case 'fixed32': return prefix + 'Fixed32' + suffix;
+ case 'fixed64': return prefix + 'Fixed64' + suffix;
+ case 'sfixed32': return prefix + 'SFixed32' + suffix;
+ case 'sfixed64': return prefix + 'SFixed64' + suffix;
+ case 'bytes': return prefix + 'Bytes' + suffix;
+ default: throw new Error('Unexpected type: ' + field.type);
+ }
+}
+
+function compileFieldWrite(ctx, field, name) {
+ var prefix = 'pbf.write';
+ if (isPacked(field)) prefix += 'Packed';
+
+ if (fieldShouldUseStringAsNumber(field)) {
+ if (field.type === 'float' || field.type === 'double') {
+ name = 'parseFloat(' + name + ')';
+ } else {
+ name = 'parseInt(' + name + ', 10)';
+ }
+ }
+ var postfix = (isPacked(field) ? '' : 'Field') + '(' + field.tag + ', ' + name + ')';
+
+ var type = getType(ctx, field);
+ if (type) {
+ if (type._proto.fields) return prefix + 'Message(' + field.tag + ', ' + type._name + '.write, ' + name + ')';
+ if (type._proto.values) return prefix + 'Varint' + postfix;
+ throw new Error('Unexpected type: ' + type._name);
+ }
+
+ switch (field.type) {
+ case 'string': return prefix + 'String' + postfix;
+ case 'float': return prefix + 'Float' + postfix;
+ case 'double': return prefix + 'Double' + postfix;
+ case 'bool': return prefix + 'Boolean' + postfix;
+ case 'enum':
+ case 'uint32':
+ case 'uint64':
+ case 'int32':
+ case 'int64': return prefix + 'Varint' + postfix;
+ case 'sint32':
+ case 'sint64': return prefix + 'SVarint' + postfix;
+ case 'fixed32': return prefix + 'Fixed32' + postfix;
+ case 'fixed64': return prefix + 'Fixed64' + postfix;
+ case 'sfixed32': return prefix + 'SFixed32' + postfix;
+ case 'sfixed64': return prefix + 'SFixed64' + postfix;
+ case 'bytes': return prefix + 'Bytes' + postfix;
+ default: throw new Error('Unexpected type: ' + field.type);
+ }
+}
+
+function compileMapRead(readCode, name, numRepeated) {
+ return (numRepeated ? '' : 'var ') + 'entry = ' + readCode + '; obj.' + name + '[entry.key] = entry.value';
+}
+
+function compileRepeatedWrite(ctx, field, numRepeated) {
+ return 'for (' + (numRepeated ? '' : 'var ') +
+ 'i = 0; i < obj.' + field.name + '.length; i++) ' +
+ compileFieldWrite(ctx, field, 'obj.' + field.name + '[i]');
+}
+
+function compileMapWrite(ctx, field, numRepeated) {
+ var name = 'obj.' + field.name;
+
+ return 'for (' + (numRepeated ? '' : 'var ') +
+ 'i in ' + name + ') if (Object.prototype.hasOwnProperty.call(' + name + ', i)) ' +
+ compileFieldWrite(ctx, field, '{ key: i, value: ' + name + '[i] }');
+}
+
+function getMapMessageName(tag) {
+ return '_FieldEntry' + tag;
+}
+
+function getMapField(name, type, tag) {
+ return {
+ name: name,
+ type: type,
+ tag: tag,
+ map: null,
+ oneof: null,
+ required: false,
+ repeated: false,
+ options: {}
+ };
+}
+
+function getMapMessage(field) {
+ return {
+ name: getMapMessageName(field.tag),
+ enums: [],
+ messages: [],
+ extensions: null,
+ fields: [
+ getMapField('key', field.map.from, 1),
+ getMapField('value', field.map.to, 2)
+ ]
+ };
+}
+
+function buildContext(proto, parent) {
+ var obj = Object.create(parent);
+ obj._proto = proto;
+ obj._children = [];
+ obj._defaults = {};
+
+ if (parent) {
+ parent[proto.name] = obj;
+
+ if (parent._name) {
+ obj._root = false;
+ obj._name = parent._name + '.' + proto.name;
+ } else {
+ obj._root = true;
+ obj._name = proto.name;
+ }
+ }
+
+ for (var i = 0; proto.enums && i < proto.enums.length; i++) {
+ obj._children.push(buildContext(proto.enums[i], obj));
+ }
+
+ for (i = 0; proto.messages && i < proto.messages.length; i++) {
+ obj._children.push(buildContext(proto.messages[i], obj));
+ }
+
+ for (i = 0; proto.fields && i < proto.fields.length; i++) {
+ if (proto.fields[i].type === 'map') {
+ obj._children.push(buildContext(getMapMessage(proto.fields[i]), obj));
+ }
+ }
+
+ return obj;
+}
+
+function getDefaultValue(field, value) {
+ // Defaults not supported for repeated fields
+ if (field.repeated) return [];
+ var convertToStringIfNeeded = function(val) { return val; };
+ if (fieldShouldUseStringAsNumber(field)) {
+ convertToStringIfNeeded = function(val) { return val.toString(); };
+ }
+
+ switch (field.type) {
+ case 'float':
+ case 'double': return convertToStringIfNeeded(value ? parseFloat(value) : 0);
+ case 'uint32':
+ case 'uint64':
+ case 'int32':
+ case 'int64':
+ case 'sint32':
+ case 'sint64':
+ case 'fixed32':
+ case 'fixed64':
+ case 'sfixed32':
+ case 'sfixed64': return convertToStringIfNeeded(value ? parseInt(value, 10) : 0);
+ case 'string': return value || '';
+ case 'bool': return value === 'true';
+ case 'map': return {};
+ default: return undefined;
+ }
+}
+
+function willSupportPacked(ctx, field) {
+ var fieldType = isEnum(getType(ctx, field)) ? 'enum' : field.type;
+
+ switch (field.repeated && fieldType) {
+ case 'float':
+ case 'double':
+ case 'uint32':
+ case 'uint64':
+ case 'int32':
+ case 'int64':
+ case 'sint32':
+ case 'sint64':
+ case 'fixed32':
+ case 'fixed64':
+ case 'sfixed32':
+ case 'enum':
+ case 'bool': return true;
+ }
+
+ return false;
+}
+
+function setPackedOption(ctx, field, syntax) {
+ // No default packed in older protobuf versions
+ if (syntax < 3) return;
+
+ // Packed option already set
+ if (field.options.packed !== undefined) return;
+
+ // Not a packed field type
+ if (!willSupportPacked(ctx, field)) return;
+
+ field.options.packed = 'true';
+}
+
+function setDefaultValue(ctx, field, syntax) {
+ var options = field.options;
+ var type = getType(ctx, field);
+ var enumValues = type && type._proto.values && getEnumValues(type);
+
+ // Proto3 does not support overriding defaults
+ var explicitDefault = syntax < 3 ? options.default : undefined;
+
+ // Set default for enum values
+ if (enumValues && !field.repeated) {
+ ctx._defaults[field.name] = enumValues[explicitDefault] || 0;
+
+ } else {
+ ctx._defaults[field.name] = getDefaultValue(field, explicitDefault);
+ }
+}
+
+function buildDefaults(ctx, syntax) {
+ var proto = ctx._proto;
+
+ for (var i = 0; i < ctx._children.length; i++) {
+ buildDefaults(ctx._children[i], syntax);
+ }
+
+ if (proto.fields) {
+ for (i = 0; i < proto.fields.length; i++) {
+ setPackedOption(ctx, proto.fields[i], syntax);
+ setDefaultValue(ctx, proto.fields[i], syntax);
+ }
+ }
+
+ return ctx;
+}
+
+function getDefaultWriteTest(ctx, field) {
+ var def = ctx._defaults[field.name];
+ var type = getType(ctx, field);
+ var code = ' if (obj.' + field.name;
+
+ if (!field.repeated && (!type || !type._proto.fields)) {
+ if (def === undefined || def) {
+ code += ' != undefined';
+ }
+ if (def) {
+ code += ' && obj.' + field.name + ' !== ' + JSON.stringify(def);
+ }
+ }
+
+ return code + ') ';
+}
+
+function isPacked(field) {
+ return field.options.packed === 'true';
+}
diff --git a/node_modules/pbf/dist/pbf-dev.js b/node_modules/pbf/dist/pbf-dev.js
new file mode 100644
index 0000000000000000000000000000000000000000..b36fecb7928de297122a72b02cefcdd61470d4df
--- /dev/null
+++ b/node_modules/pbf/dist/pbf-dev.js
@@ -0,0 +1,735 @@
+(function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.Pbf = f()}})(function(){var define,module,exports;return (function(){function r(e,n,t){function o(i,f){if(!n[i]){if(!e[i]){var c="function"==typeof require&&require;if(!f&&c)return c(i,!0);if(u)return u(i,!0);var a=new Error("Cannot find module '"+i+"'");throw a.code="MODULE_NOT_FOUND",a}var p=n[i]={exports:{}};e[i][0].call(p.exports,function(r){var n=e[i][1][r];return o(n||r)},p,p.exports,r,e,n,t)}return n[i].exports}for(var u="function"==typeof require&&require,i=0;i> 3,
+ startPos = this.pos;
+
+ this.type = val & 0x7;
+ readField(tag, result, this);
+
+ if (this.pos === startPos) this.skip(val);
+ }
+ return result;
+ },
+
+ readMessage: function(readField, result) {
+ return this.readFields(readField, result, this.readVarint() + this.pos);
+ },
+
+ readFixed32: function() {
+ var val = readUInt32(this.buf, this.pos);
+ this.pos += 4;
+ return val;
+ },
+
+ readSFixed32: function() {
+ var val = readInt32(this.buf, this.pos);
+ this.pos += 4;
+ return val;
+ },
+
+ // 64-bit int handling is based on github.com/dpw/node-buffer-more-ints (MIT-licensed)
+
+ readFixed64: function() {
+ var val = readUInt32(this.buf, this.pos) + readUInt32(this.buf, this.pos + 4) * SHIFT_LEFT_32;
+ this.pos += 8;
+ return val;
+ },
+
+ readSFixed64: function() {
+ var val = readUInt32(this.buf, this.pos) + readInt32(this.buf, this.pos + 4) * SHIFT_LEFT_32;
+ this.pos += 8;
+ return val;
+ },
+
+ readFloat: function() {
+ var val = ieee754.read(this.buf, this.pos, true, 23, 4);
+ this.pos += 4;
+ return val;
+ },
+
+ readDouble: function() {
+ var val = ieee754.read(this.buf, this.pos, true, 52, 8);
+ this.pos += 8;
+ return val;
+ },
+
+ readVarint: function(isSigned) {
+ var buf = this.buf,
+ val, b;
+
+ b = buf[this.pos++]; val = b & 0x7f; if (b < 0x80) return val;
+ b = buf[this.pos++]; val |= (b & 0x7f) << 7; if (b < 0x80) return val;
+ b = buf[this.pos++]; val |= (b & 0x7f) << 14; if (b < 0x80) return val;
+ b = buf[this.pos++]; val |= (b & 0x7f) << 21; if (b < 0x80) return val;
+ b = buf[this.pos]; val |= (b & 0x0f) << 28;
+
+ return readVarintRemainder(val, isSigned, this);
+ },
+
+ readVarint64: function() { // for compatibility with v2.0.1
+ return this.readVarint(true);
+ },
+
+ readSVarint: function() {
+ var num = this.readVarint();
+ return num % 2 === 1 ? (num + 1) / -2 : num / 2; // zigzag encoding
+ },
+
+ readBoolean: function() {
+ return Boolean(this.readVarint());
+ },
+
+ readString: function() {
+ var end = this.readVarint() + this.pos;
+ var pos = this.pos;
+ this.pos = end;
+
+ if (end - pos >= TEXT_DECODER_MIN_LENGTH && utf8TextDecoder) {
+ // longer strings are fast with the built-in browser TextDecoder API
+ return readUtf8TextDecoder(this.buf, pos, end);
+ }
+ // short strings are fast with our custom implementation
+ return readUtf8(this.buf, pos, end);
+ },
+
+ readBytes: function() {
+ var end = this.readVarint() + this.pos,
+ buffer = this.buf.subarray(this.pos, end);
+ this.pos = end;
+ return buffer;
+ },
+
+ // verbose for performance reasons; doesn't affect gzipped size
+
+ readPackedVarint: function(arr, isSigned) {
+ if (this.type !== Pbf.Bytes) return arr.push(this.readVarint(isSigned));
+ var end = readPackedEnd(this);
+ arr = arr || [];
+ while (this.pos < end) arr.push(this.readVarint(isSigned));
+ return arr;
+ },
+ readPackedSVarint: function(arr) {
+ if (this.type !== Pbf.Bytes) return arr.push(this.readSVarint());
+ var end = readPackedEnd(this);
+ arr = arr || [];
+ while (this.pos < end) arr.push(this.readSVarint());
+ return arr;
+ },
+ readPackedBoolean: function(arr) {
+ if (this.type !== Pbf.Bytes) return arr.push(this.readBoolean());
+ var end = readPackedEnd(this);
+ arr = arr || [];
+ while (this.pos < end) arr.push(this.readBoolean());
+ return arr;
+ },
+ readPackedFloat: function(arr) {
+ if (this.type !== Pbf.Bytes) return arr.push(this.readFloat());
+ var end = readPackedEnd(this);
+ arr = arr || [];
+ while (this.pos < end) arr.push(this.readFloat());
+ return arr;
+ },
+ readPackedDouble: function(arr) {
+ if (this.type !== Pbf.Bytes) return arr.push(this.readDouble());
+ var end = readPackedEnd(this);
+ arr = arr || [];
+ while (this.pos < end) arr.push(this.readDouble());
+ return arr;
+ },
+ readPackedFixed32: function(arr) {
+ if (this.type !== Pbf.Bytes) return arr.push(this.readFixed32());
+ var end = readPackedEnd(this);
+ arr = arr || [];
+ while (this.pos < end) arr.push(this.readFixed32());
+ return arr;
+ },
+ readPackedSFixed32: function(arr) {
+ if (this.type !== Pbf.Bytes) return arr.push(this.readSFixed32());
+ var end = readPackedEnd(this);
+ arr = arr || [];
+ while (this.pos < end) arr.push(this.readSFixed32());
+ return arr;
+ },
+ readPackedFixed64: function(arr) {
+ if (this.type !== Pbf.Bytes) return arr.push(this.readFixed64());
+ var end = readPackedEnd(this);
+ arr = arr || [];
+ while (this.pos < end) arr.push(this.readFixed64());
+ return arr;
+ },
+ readPackedSFixed64: function(arr) {
+ if (this.type !== Pbf.Bytes) return arr.push(this.readSFixed64());
+ var end = readPackedEnd(this);
+ arr = arr || [];
+ while (this.pos < end) arr.push(this.readSFixed64());
+ return arr;
+ },
+
+ skip: function(val) {
+ var type = val & 0x7;
+ if (type === Pbf.Varint) while (this.buf[this.pos++] > 0x7f) {}
+ else if (type === Pbf.Bytes) this.pos = this.readVarint() + this.pos;
+ else if (type === Pbf.Fixed32) this.pos += 4;
+ else if (type === Pbf.Fixed64) this.pos += 8;
+ else throw new Error('Unimplemented type: ' + type);
+ },
+
+ // === WRITING =================================================================
+
+ writeTag: function(tag, type) {
+ this.writeVarint((tag << 3) | type);
+ },
+
+ realloc: function(min) {
+ var length = this.length || 16;
+
+ while (length < this.pos + min) length *= 2;
+
+ if (length !== this.length) {
+ var buf = new Uint8Array(length);
+ buf.set(this.buf);
+ this.buf = buf;
+ this.length = length;
+ }
+ },
+
+ finish: function() {
+ this.length = this.pos;
+ this.pos = 0;
+ return this.buf.subarray(0, this.length);
+ },
+
+ writeFixed32: function(val) {
+ this.realloc(4);
+ writeInt32(this.buf, val, this.pos);
+ this.pos += 4;
+ },
+
+ writeSFixed32: function(val) {
+ this.realloc(4);
+ writeInt32(this.buf, val, this.pos);
+ this.pos += 4;
+ },
+
+ writeFixed64: function(val) {
+ this.realloc(8);
+ writeInt32(this.buf, val & -1, this.pos);
+ writeInt32(this.buf, Math.floor(val * SHIFT_RIGHT_32), this.pos + 4);
+ this.pos += 8;
+ },
+
+ writeSFixed64: function(val) {
+ this.realloc(8);
+ writeInt32(this.buf, val & -1, this.pos);
+ writeInt32(this.buf, Math.floor(val * SHIFT_RIGHT_32), this.pos + 4);
+ this.pos += 8;
+ },
+
+ writeVarint: function(val) {
+ val = +val || 0;
+
+ if (val > 0xfffffff || val < 0) {
+ writeBigVarint(val, this);
+ return;
+ }
+
+ this.realloc(4);
+
+ this.buf[this.pos++] = val & 0x7f | (val > 0x7f ? 0x80 : 0); if (val <= 0x7f) return;
+ this.buf[this.pos++] = ((val >>>= 7) & 0x7f) | (val > 0x7f ? 0x80 : 0); if (val <= 0x7f) return;
+ this.buf[this.pos++] = ((val >>>= 7) & 0x7f) | (val > 0x7f ? 0x80 : 0); if (val <= 0x7f) return;
+ this.buf[this.pos++] = (val >>> 7) & 0x7f;
+ },
+
+ writeSVarint: function(val) {
+ this.writeVarint(val < 0 ? -val * 2 - 1 : val * 2);
+ },
+
+ writeBoolean: function(val) {
+ this.writeVarint(Boolean(val));
+ },
+
+ writeString: function(str) {
+ str = String(str);
+ this.realloc(str.length * 4);
+
+ this.pos++; // reserve 1 byte for short string length
+
+ var startPos = this.pos;
+ // write the string directly to the buffer and see how much was written
+ this.pos = writeUtf8(this.buf, str, this.pos);
+ var len = this.pos - startPos;
+
+ if (len >= 0x80) makeRoomForExtraLength(startPos, len, this);
+
+ // finally, write the message length in the reserved place and restore the position
+ this.pos = startPos - 1;
+ this.writeVarint(len);
+ this.pos += len;
+ },
+
+ writeFloat: function(val) {
+ this.realloc(4);
+ ieee754.write(this.buf, val, this.pos, true, 23, 4);
+ this.pos += 4;
+ },
+
+ writeDouble: function(val) {
+ this.realloc(8);
+ ieee754.write(this.buf, val, this.pos, true, 52, 8);
+ this.pos += 8;
+ },
+
+ writeBytes: function(buffer) {
+ var len = buffer.length;
+ this.writeVarint(len);
+ this.realloc(len);
+ for (var i = 0; i < len; i++) this.buf[this.pos++] = buffer[i];
+ },
+
+ writeRawMessage: function(fn, obj) {
+ this.pos++; // reserve 1 byte for short message length
+
+ // write the message directly to the buffer and see how much was written
+ var startPos = this.pos;
+ fn(obj, this);
+ var len = this.pos - startPos;
+
+ if (len >= 0x80) makeRoomForExtraLength(startPos, len, this);
+
+ // finally, write the message length in the reserved place and restore the position
+ this.pos = startPos - 1;
+ this.writeVarint(len);
+ this.pos += len;
+ },
+
+ writeMessage: function(tag, fn, obj) {
+ this.writeTag(tag, Pbf.Bytes);
+ this.writeRawMessage(fn, obj);
+ },
+
+ writePackedVarint: function(tag, arr) { if (arr.length) this.writeMessage(tag, writePackedVarint, arr); },
+ writePackedSVarint: function(tag, arr) { if (arr.length) this.writeMessage(tag, writePackedSVarint, arr); },
+ writePackedBoolean: function(tag, arr) { if (arr.length) this.writeMessage(tag, writePackedBoolean, arr); },
+ writePackedFloat: function(tag, arr) { if (arr.length) this.writeMessage(tag, writePackedFloat, arr); },
+ writePackedDouble: function(tag, arr) { if (arr.length) this.writeMessage(tag, writePackedDouble, arr); },
+ writePackedFixed32: function(tag, arr) { if (arr.length) this.writeMessage(tag, writePackedFixed32, arr); },
+ writePackedSFixed32: function(tag, arr) { if (arr.length) this.writeMessage(tag, writePackedSFixed32, arr); },
+ writePackedFixed64: function(tag, arr) { if (arr.length) this.writeMessage(tag, writePackedFixed64, arr); },
+ writePackedSFixed64: function(tag, arr) { if (arr.length) this.writeMessage(tag, writePackedSFixed64, arr); },
+
+ writeBytesField: function(tag, buffer) {
+ this.writeTag(tag, Pbf.Bytes);
+ this.writeBytes(buffer);
+ },
+ writeFixed32Field: function(tag, val) {
+ this.writeTag(tag, Pbf.Fixed32);
+ this.writeFixed32(val);
+ },
+ writeSFixed32Field: function(tag, val) {
+ this.writeTag(tag, Pbf.Fixed32);
+ this.writeSFixed32(val);
+ },
+ writeFixed64Field: function(tag, val) {
+ this.writeTag(tag, Pbf.Fixed64);
+ this.writeFixed64(val);
+ },
+ writeSFixed64Field: function(tag, val) {
+ this.writeTag(tag, Pbf.Fixed64);
+ this.writeSFixed64(val);
+ },
+ writeVarintField: function(tag, val) {
+ this.writeTag(tag, Pbf.Varint);
+ this.writeVarint(val);
+ },
+ writeSVarintField: function(tag, val) {
+ this.writeTag(tag, Pbf.Varint);
+ this.writeSVarint(val);
+ },
+ writeStringField: function(tag, str) {
+ this.writeTag(tag, Pbf.Bytes);
+ this.writeString(str);
+ },
+ writeFloatField: function(tag, val) {
+ this.writeTag(tag, Pbf.Fixed32);
+ this.writeFloat(val);
+ },
+ writeDoubleField: function(tag, val) {
+ this.writeTag(tag, Pbf.Fixed64);
+ this.writeDouble(val);
+ },
+ writeBooleanField: function(tag, val) {
+ this.writeVarintField(tag, Boolean(val));
+ }
+};
+
+function readVarintRemainder(l, s, p) {
+ var buf = p.buf,
+ h, b;
+
+ b = buf[p.pos++]; h = (b & 0x70) >> 4; if (b < 0x80) return toNum(l, h, s);
+ b = buf[p.pos++]; h |= (b & 0x7f) << 3; if (b < 0x80) return toNum(l, h, s);
+ b = buf[p.pos++]; h |= (b & 0x7f) << 10; if (b < 0x80) return toNum(l, h, s);
+ b = buf[p.pos++]; h |= (b & 0x7f) << 17; if (b < 0x80) return toNum(l, h, s);
+ b = buf[p.pos++]; h |= (b & 0x7f) << 24; if (b < 0x80) return toNum(l, h, s);
+ b = buf[p.pos++]; h |= (b & 0x01) << 31; if (b < 0x80) return toNum(l, h, s);
+
+ throw new Error('Expected varint not more than 10 bytes');
+}
+
+function readPackedEnd(pbf) {
+ return pbf.type === Pbf.Bytes ?
+ pbf.readVarint() + pbf.pos : pbf.pos + 1;
+}
+
+function toNum(low, high, isSigned) {
+ if (isSigned) {
+ return high * 0x100000000 + (low >>> 0);
+ }
+
+ return ((high >>> 0) * 0x100000000) + (low >>> 0);
+}
+
+function writeBigVarint(val, pbf) {
+ var low, high;
+
+ if (val >= 0) {
+ low = (val % 0x100000000) | 0;
+ high = (val / 0x100000000) | 0;
+ } else {
+ low = ~(-val % 0x100000000);
+ high = ~(-val / 0x100000000);
+
+ if (low ^ 0xffffffff) {
+ low = (low + 1) | 0;
+ } else {
+ low = 0;
+ high = (high + 1) | 0;
+ }
+ }
+
+ if (val >= 0x10000000000000000 || val < -0x10000000000000000) {
+ throw new Error('Given varint doesn\'t fit into 10 bytes');
+ }
+
+ pbf.realloc(10);
+
+ writeBigVarintLow(low, high, pbf);
+ writeBigVarintHigh(high, pbf);
+}
+
+function writeBigVarintLow(low, high, pbf) {
+ pbf.buf[pbf.pos++] = low & 0x7f | 0x80; low >>>= 7;
+ pbf.buf[pbf.pos++] = low & 0x7f | 0x80; low >>>= 7;
+ pbf.buf[pbf.pos++] = low & 0x7f | 0x80; low >>>= 7;
+ pbf.buf[pbf.pos++] = low & 0x7f | 0x80; low >>>= 7;
+ pbf.buf[pbf.pos] = low & 0x7f;
+}
+
+function writeBigVarintHigh(high, pbf) {
+ var lsb = (high & 0x07) << 4;
+
+ pbf.buf[pbf.pos++] |= lsb | ((high >>>= 3) ? 0x80 : 0); if (!high) return;
+ pbf.buf[pbf.pos++] = high & 0x7f | ((high >>>= 7) ? 0x80 : 0); if (!high) return;
+ pbf.buf[pbf.pos++] = high & 0x7f | ((high >>>= 7) ? 0x80 : 0); if (!high) return;
+ pbf.buf[pbf.pos++] = high & 0x7f | ((high >>>= 7) ? 0x80 : 0); if (!high) return;
+ pbf.buf[pbf.pos++] = high & 0x7f | ((high >>>= 7) ? 0x80 : 0); if (!high) return;
+ pbf.buf[pbf.pos++] = high & 0x7f;
+}
+
+function makeRoomForExtraLength(startPos, len, pbf) {
+ var extraLen =
+ len <= 0x3fff ? 1 :
+ len <= 0x1fffff ? 2 :
+ len <= 0xfffffff ? 3 : Math.floor(Math.log(len) / (Math.LN2 * 7));
+
+ // if 1 byte isn't enough for encoding message length, shift the data to the right
+ pbf.realloc(extraLen);
+ for (var i = pbf.pos - 1; i >= startPos; i--) pbf.buf[i + extraLen] = pbf.buf[i];
+}
+
+function writePackedVarint(arr, pbf) { for (var i = 0; i < arr.length; i++) pbf.writeVarint(arr[i]); }
+function writePackedSVarint(arr, pbf) { for (var i = 0; i < arr.length; i++) pbf.writeSVarint(arr[i]); }
+function writePackedFloat(arr, pbf) { for (var i = 0; i < arr.length; i++) pbf.writeFloat(arr[i]); }
+function writePackedDouble(arr, pbf) { for (var i = 0; i < arr.length; i++) pbf.writeDouble(arr[i]); }
+function writePackedBoolean(arr, pbf) { for (var i = 0; i < arr.length; i++) pbf.writeBoolean(arr[i]); }
+function writePackedFixed32(arr, pbf) { for (var i = 0; i < arr.length; i++) pbf.writeFixed32(arr[i]); }
+function writePackedSFixed32(arr, pbf) { for (var i = 0; i < arr.length; i++) pbf.writeSFixed32(arr[i]); }
+function writePackedFixed64(arr, pbf) { for (var i = 0; i < arr.length; i++) pbf.writeFixed64(arr[i]); }
+function writePackedSFixed64(arr, pbf) { for (var i = 0; i < arr.length; i++) pbf.writeSFixed64(arr[i]); }
+
+// Buffer code below from https://github.com/feross/buffer, MIT-licensed
+
+function readUInt32(buf, pos) {
+ return ((buf[pos]) |
+ (buf[pos + 1] << 8) |
+ (buf[pos + 2] << 16)) +
+ (buf[pos + 3] * 0x1000000);
+}
+
+function writeInt32(buf, val, pos) {
+ buf[pos] = val;
+ buf[pos + 1] = (val >>> 8);
+ buf[pos + 2] = (val >>> 16);
+ buf[pos + 3] = (val >>> 24);
+}
+
+function readInt32(buf, pos) {
+ return ((buf[pos]) |
+ (buf[pos + 1] << 8) |
+ (buf[pos + 2] << 16)) +
+ (buf[pos + 3] << 24);
+}
+
+function readUtf8(buf, pos, end) {
+ var str = '';
+ var i = pos;
+
+ while (i < end) {
+ var b0 = buf[i];
+ var c = null; // codepoint
+ var bytesPerSequence =
+ b0 > 0xEF ? 4 :
+ b0 > 0xDF ? 3 :
+ b0 > 0xBF ? 2 : 1;
+
+ if (i + bytesPerSequence > end) break;
+
+ var b1, b2, b3;
+
+ if (bytesPerSequence === 1) {
+ if (b0 < 0x80) {
+ c = b0;
+ }
+ } else if (bytesPerSequence === 2) {
+ b1 = buf[i + 1];
+ if ((b1 & 0xC0) === 0x80) {
+ c = (b0 & 0x1F) << 0x6 | (b1 & 0x3F);
+ if (c <= 0x7F) {
+ c = null;
+ }
+ }
+ } else if (bytesPerSequence === 3) {
+ b1 = buf[i + 1];
+ b2 = buf[i + 2];
+ if ((b1 & 0xC0) === 0x80 && (b2 & 0xC0) === 0x80) {
+ c = (b0 & 0xF) << 0xC | (b1 & 0x3F) << 0x6 | (b2 & 0x3F);
+ if (c <= 0x7FF || (c >= 0xD800 && c <= 0xDFFF)) {
+ c = null;
+ }
+ }
+ } else if (bytesPerSequence === 4) {
+ b1 = buf[i + 1];
+ b2 = buf[i + 2];
+ b3 = buf[i + 3];
+ if ((b1 & 0xC0) === 0x80 && (b2 & 0xC0) === 0x80 && (b3 & 0xC0) === 0x80) {
+ c = (b0 & 0xF) << 0x12 | (b1 & 0x3F) << 0xC | (b2 & 0x3F) << 0x6 | (b3 & 0x3F);
+ if (c <= 0xFFFF || c >= 0x110000) {
+ c = null;
+ }
+ }
+ }
+
+ if (c === null) {
+ c = 0xFFFD;
+ bytesPerSequence = 1;
+
+ } else if (c > 0xFFFF) {
+ c -= 0x10000;
+ str += String.fromCharCode(c >>> 10 & 0x3FF | 0xD800);
+ c = 0xDC00 | c & 0x3FF;
+ }
+
+ str += String.fromCharCode(c);
+ i += bytesPerSequence;
+ }
+
+ return str;
+}
+
+function readUtf8TextDecoder(buf, pos, end) {
+ return utf8TextDecoder.decode(buf.subarray(pos, end));
+}
+
+function writeUtf8(buf, str, pos) {
+ for (var i = 0, c, lead; i < str.length; i++) {
+ c = str.charCodeAt(i); // code point
+
+ if (c > 0xD7FF && c < 0xE000) {
+ if (lead) {
+ if (c < 0xDC00) {
+ buf[pos++] = 0xEF;
+ buf[pos++] = 0xBF;
+ buf[pos++] = 0xBD;
+ lead = c;
+ continue;
+ } else {
+ c = lead - 0xD800 << 10 | c - 0xDC00 | 0x10000;
+ lead = null;
+ }
+ } else {
+ if (c > 0xDBFF || (i + 1 === str.length)) {
+ buf[pos++] = 0xEF;
+ buf[pos++] = 0xBF;
+ buf[pos++] = 0xBD;
+ } else {
+ lead = c;
+ }
+ continue;
+ }
+ } else if (lead) {
+ buf[pos++] = 0xEF;
+ buf[pos++] = 0xBF;
+ buf[pos++] = 0xBD;
+ lead = null;
+ }
+
+ if (c < 0x80) {
+ buf[pos++] = c;
+ } else {
+ if (c < 0x800) {
+ buf[pos++] = c >> 0x6 | 0xC0;
+ } else {
+ if (c < 0x10000) {
+ buf[pos++] = c >> 0xC | 0xE0;
+ } else {
+ buf[pos++] = c >> 0x12 | 0xF0;
+ buf[pos++] = c >> 0xC & 0x3F | 0x80;
+ }
+ buf[pos++] = c >> 0x6 & 0x3F | 0x80;
+ }
+ buf[pos++] = c & 0x3F | 0x80;
+ }
+ }
+ return pos;
+}
+
+},{"ieee754":2}],2:[function(require,module,exports){
+/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh */
+exports.read = function (buffer, offset, isLE, mLen, nBytes) {
+ var e, m
+ var eLen = (nBytes * 8) - mLen - 1
+ var eMax = (1 << eLen) - 1
+ var eBias = eMax >> 1
+ var nBits = -7
+ var i = isLE ? (nBytes - 1) : 0
+ var d = isLE ? -1 : 1
+ var s = buffer[offset + i]
+
+ i += d
+
+ e = s & ((1 << (-nBits)) - 1)
+ s >>= (-nBits)
+ nBits += eLen
+ for (; nBits > 0; e = (e * 256) + buffer[offset + i], i += d, nBits -= 8) {}
+
+ m = e & ((1 << (-nBits)) - 1)
+ e >>= (-nBits)
+ nBits += mLen
+ for (; nBits > 0; m = (m * 256) + buffer[offset + i], i += d, nBits -= 8) {}
+
+ if (e === 0) {
+ e = 1 - eBias
+ } else if (e === eMax) {
+ return m ? NaN : ((s ? -1 : 1) * Infinity)
+ } else {
+ m = m + Math.pow(2, mLen)
+ e = e - eBias
+ }
+ return (s ? -1 : 1) * m * Math.pow(2, e - mLen)
+}
+
+exports.write = function (buffer, value, offset, isLE, mLen, nBytes) {
+ var e, m, c
+ var eLen = (nBytes * 8) - mLen - 1
+ var eMax = (1 << eLen) - 1
+ var eBias = eMax >> 1
+ var rt = (mLen === 23 ? Math.pow(2, -24) - Math.pow(2, -77) : 0)
+ var i = isLE ? 0 : (nBytes - 1)
+ var d = isLE ? 1 : -1
+ var s = value < 0 || (value === 0 && 1 / value < 0) ? 1 : 0
+
+ value = Math.abs(value)
+
+ if (isNaN(value) || value === Infinity) {
+ m = isNaN(value) ? 1 : 0
+ e = eMax
+ } else {
+ e = Math.floor(Math.log(value) / Math.LN2)
+ if (value * (c = Math.pow(2, -e)) < 1) {
+ e--
+ c *= 2
+ }
+ if (e + eBias >= 1) {
+ value += rt / c
+ } else {
+ value += rt * Math.pow(2, 1 - eBias)
+ }
+ if (value * c >= 2) {
+ e++
+ c /= 2
+ }
+
+ if (e + eBias >= eMax) {
+ m = 0
+ e = eMax
+ } else if (e + eBias >= 1) {
+ m = ((value * c) - 1) * Math.pow(2, mLen)
+ e = e + eBias
+ } else {
+ m = value * Math.pow(2, eBias - 1) * Math.pow(2, mLen)
+ e = 0
+ }
+ }
+
+ for (; mLen >= 8; buffer[offset + i] = m & 0xff, i += d, m /= 256, mLen -= 8) {}
+
+ e = (e << mLen) | m
+ eLen += mLen
+ for (; eLen > 0; buffer[offset + i] = e & 0xff, i += d, e /= 256, eLen -= 8) {}
+
+ buffer[offset + i - d] |= s * 128
+}
+
+},{}]},{},[1])(1)
+});
+
+//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIm5vZGVfbW9kdWxlcy9icm93c2VyLXBhY2svX3By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hciBjID0gbnVsbDsgLy8gY29kZXBvaW50XG4gICAgICAgIHZhciBieXRlc1BlclNlcXVlbmNlID1cbiAgICAgICAgICAgIGIwID4gMHhFRiA/IDQgOlxuICAgICAgICAgICAgYjAgPiAweERGID8gMyA6XG4gICAgICAgICAgICBiMCA+IDB4QkYgPyAyIDogMTtcblxuICAgICAgICBpZiAoaSArIGJ5dGVzUGVyU2VxdWVuY2UgPiBlbmQpIGJyZWFrO1xuXG4gICAgICAgIHZhciBiMSwgYjIsIGIzO1xuXG4gICAgICAgIGlmIChieXRlc1BlclNlcXVlbmNlID09PSAxKSB7XG4gICAgICAgICAgICBpZiAoYjAgPCAweDgwKSB7XG4gICAgICAgICAgICAgICAgYyA9IGIwO1xuICAgICAgICAgICAgfVxuICAgICAgICB9IGVsc2UgaWYgKGJ5dGVzUGVyU2VxdWVuY2UgPT09IDIpIHtcbiAgICAgICAgICAgIGIxID0gYnVmW2kgKyAxXTtcbiAgICAgICAgICAgIGlmICgoYjEgJiAweEMwKSA9PT0gMHg4MCkge1xuICAgICAgICAgICAgICAgIGMgPSAoYjAgJiAweDFGKSA8PCAweDYgfCAoYjEgJiAweDNGKTtcbiAgICAgICAgICAgICAgICBpZiAoYyA8PSAweDdGKSB7XG4gICAgICAgICAgICAgICAgICAgIGMgPSBudWxsO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgfSBlbHNlIGlmIChieXRlc1BlclNlcXVlbmNlID09PSAzKSB7XG4gICAgICAgICAgICBiMSA9IGJ1ZltpICsgMV07XG4gICAgICAgICAgICBiMiA9IGJ1ZltpICsgMl07XG4gICAgICAgICAgICBpZiAoKGIxICYgMHhDMCkgPT09IDB4ODAgJiYgKGIyICYgMHhDMCkgPT09IDB4ODApIHtcbiAgICAgICAgICAgICAgICBjID0gKGIwICYgMHhGKSA8PCAweEMgfCAoYjEgJiAweDNGKSA8PCAweDYgfCAoYjIgJiAweDNGKTtcbiAgICAgICAgICAgICAgICBpZiAoYyA8PSAweDdGRiB8fCAoYyA+PSAweEQ4MDAgJiYgYyA8PSAweERGRkYpKSB7XG4gICAgICAgICAgICAgICAgICAgIGMgPSBudWxsO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgfSBlbHNlIGlmIChieXRlc1BlclNlcXVlbmNlID09PSA0KSB7XG4gICAgICAgICAgICBiMSA9IGJ1ZltpICsgMV07XG4gICAgICAgICAgICBiMiA9IGJ1ZltpICsgMl07XG4gICAgICAgICAgICBiMyA9IGJ1ZltpICsgM107XG4gICAgICAgICAgICBpZiAoKGIxICYgMHhDMCkgPT09IDB4ODAgJiYgKGIyICYgMHhDMCkgPT09IDB4ODAgJiYgKGIzICYgMHhDMCkgPT09IDB4ODApIHtcbiAgICAgICAgICAgICAgICBjID0gKGIwICYgMHhGKSA8PCAweDEyIHwgKGIxICYgMHgzRikgPDwgMHhDIHwgKGIyICYgMHgzRikgPDwgMHg2IHwgKGIzICYgMHgzRik7XG4gICAgICAgICAgICAgICAgaWYgKGMgPD0gMHhGRkZGIHx8IGMgPj0gMHgxMTAwMDApIHtcbiAgICAgICAgICAgICAgICAgICAgYyA9IG51bGw7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICB9XG5cbiAgICAgICAgaWYgKGMgPT09IG51bGwpIHtcbiAgICAgICAgICAgIGMgPSAweEZGRkQ7XG4gICAgICAgICAgICBieXRlc1BlclNlcXVlbmNlID0gMTtcblxuICAgICAgICB9IGVsc2UgaWYgKGMgPiAweEZGRkYpIHtcbiAgICAgICAgICAgIGMgLT0gMHgxMDAwMDtcbiAgICAgICAgICAgIHN0ciArPSBTdHJpbmcuZnJvbUNoYXJDb2RlKGMgPj4+IDEwICYgMHgzRkYgfCAweEQ4MDApO1xuICAgICAgICAgICAgYyA9IDB4REMwMCB8IGMgJiAweDNGRjtcbiAgICAgICAgfVxuXG4gICAgICAgIHN0ciArPSBTdHJpbmcuZnJvbUNoYXJDb2RlKGMpO1xuICAgICAgICBpICs9IGJ5dGVzUGVyU2VxdWVuY2U7XG4gICAgfVxuXG4gICAgcmV0dXJuIHN0cjtcbn1cblxuZnVuY3Rpb24gcmVhZFV0ZjhUZXh0RGVjb2RlcihidWYsIHBvcywgZW5kKSB7XG4gICAgcmV0dXJuIHV0ZjhUZXh0RGVjb2Rlci5kZWNvZGUoYnVmLnN1YmFycmF5KHBvcywgZW5kKSk7XG59XG5cbmZ1bmN0aW9uIHdyaXRlVXRmOChidWYsIHN0ciwgcG9zKSB7XG4gICAgZm9yICh2YXIgaSA9IDAsIGMsIGxlYWQ7IGkgPCBzdHIubGVuZ3RoOyBpKyspIHtcbiAgICAgICAgYyA9IHN0ci5jaGFyQ29kZUF0KGkpOyAvLyBjb2RlIHBvaW50XG5cbiAgICAgICAgaWYgKGMgPiAweEQ3RkYgJiYgYyA8IDB4RTAwMCkge1xuICAgICAgICAgICAgaWYgKGxlYWQpIHtcbiAgICAgICAgICAgICAgICBpZiAoYyA8IDB4REMwMCkge1xuICAgICAgICAgICAgICAgICAgICBidWZbcG9zKytdID0gMHhFRjtcbiAgICAgICAgICAgICAgICAgICAgYnVmW3BvcysrXSA9IDB4QkY7XG4gICAgICAgICAgICAgICAgICAgIGJ1Zltwb3MrK10gPSAweEJEO1xuICAgICAgICAgICAgICAgICAgICBsZWFkID0gYztcbiAgICAgICAgICAgICAgICAgICAgY29udGludWU7XG4gICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgYyA9IGxlYWQgLSAweEQ4MDAgPDwgMTAgfCBjIC0gMHhEQzAwIHwgMHgxMDAwMDtcbiAgICAgICAgICAgICAgICAgICAgbGVhZCA9IG51bGw7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICBpZiAoYyA+IDB4REJGRiB8fCAoaSArIDEgPT09IHN0ci5sZW5ndGgpKSB7XG4gICAgICAgICAgICAgICAgICAgIGJ1Zltwb3MrK10gPSAweEVGO1xuICAgICAgICAgICAgICAgICAgICBidWZbcG9zKytdID0gMHhCRjtcbiAgICAgICAgICAgICAgICAgICAgYnVmW3BvcysrXSA9IDB4QkQ7XG4gICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgbGVhZCA9IGM7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIGNvbnRpbnVlO1xuICAgICAgICAgICAgfVxuICAgICAgICB9IGVsc2UgaWYgKGxlYWQpIHtcbiAgICAgICAgICAgIGJ1Zltwb3MrK10gPSAweEVGO1xuICAgICAgICAgICAgYnVmW3BvcysrXSA9IDB4QkY7XG4gICAgICAgICAgICBidWZbcG9zKytdID0gMHhCRDtcbiAgICAgICAgICAgIGxlYWQgPSBudWxsO1xuICAgICAgICB9XG5cbiAgICAgICAgaWYgKGMgPCAweDgwKSB7XG4gICAgICAgICAgICBidWZbcG9zKytdID0gYztcbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIGlmIChjIDwgMHg4MDApIHtcbiAgICAgICAgICAgICAgICBidWZbcG9zKytdID0gYyA+PiAweDYgfCAweEMwO1xuICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICBpZiAoYyA8IDB4MTAwMDApIHtcbiAgICAgICAgICAgICAgICAgICAgYnVmW3BvcysrXSA9IGMgPj4gMHhDIHwgMHhFMDtcbiAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICBidWZbcG9zKytdID0gYyA+PiAweDEyIHwgMHhGMDtcbiAgICAgICAgICAgICAgICAgICAgYnVmW3BvcysrXSA9IGMgPj4gMHhDICYgMHgzRiB8IDB4ODA7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIGJ1Zltwb3MrK10gPSBjID4+IDB4NiAmIDB4M0YgfCAweDgwO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgYnVmW3Bvcysr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XG4gICAgICB2YWx1ZSArPSBydCAvIGNcbiAgICB9IGVsc2Uge1xuICAgICAgdmFsdWUgKz0gcnQgKiBNYXRoLnBvdygyLCAxIC0gZUJpYXMpXG4gICAgfVxuICAgIGlmICh2YWx1ZSAqIGMgPj0gMikge1xuICAgICAgZSsrXG4gICAgICBjIC89IDJcbiAgICB9XG5cbiAgICBpZiAoZSArIGVCaWFzID49IGVNYXgpIHtcbiAgICAgIG0gPSAwXG4gICAgICBlID0gZU1heFxuICAgIH0gZWxzZSBpZiAoZSArIGVCaWFzID49IDEpIHtcbiAgICAgIG0gPSAoKHZhbHVlICogYykgLSAxKSAqIE1hdGgucG93KDIsIG1MZW4pXG4gICAgICBlID0gZSArIGVCaWFzXG4gICAgfSBlbHNlIHtcbiAgICAgIG0gPSB2YWx1ZSAqIE1hdGgucG93KDIsIGVCaWFzIC0gMSkgKiBNYXRoLnBvdygyLCBtTGVuKVxuICAgICAgZSA9IDBcbiAgICB9XG4gIH1cblxuICBmb3IgKDsgbUxlbiA+PSA4OyBidWZmZXJbb2Zmc2V0ICsgaV0gPSBtICYgMHhmZiwgaSArPSBkLCBtIC89IDI1NiwgbUxlbiAtPSA4KSB7fVxuXG4gIGUgPSAoZSA8PCBtTGVuKSB8IG1cbiAgZUxlbiArPSBtTGVuXG4gIGZvciAoOyBlTGVuID4gMDsgYnVmZmVyW29mZnNldCArIGldID0gZSAmIDB4ZmYsIGkgKz0gZCwgZSAvPSAyNTYsIGVMZW4gLT0gOCkge31cblxuICBidWZmZXJbb2Zmc2V0ICsgaSAtIGRdIHw9IHMgKiAxMjhcbn1cbiJdfQ==
diff --git a/node_modules/pbf/dist/pbf.js b/node_modules/pbf/dist/pbf.js
new file mode 100644
index 0000000000000000000000000000000000000000..3753a73caf23ef83f92e6e2de3ca4dbcdd2820eb
--- /dev/null
+++ b/node_modules/pbf/dist/pbf.js
@@ -0,0 +1 @@
+!function(t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):("undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this).Pbf=t()}(function(){return function r(s,n,o){function h(i,t){if(!n[i]){if(!s[i]){var e="function"==typeof require&&require;if(!t&&e)return e(i,!0);if(a)return a(i,!0);throw(t=new Error("Cannot find module '"+i+"'")).code="MODULE_NOT_FOUND",t}e=n[i]={exports:{}},s[i][0].call(e.exports,function(t){return h(s[i][1][t]||t)},e,e.exports,r,s,n,o)}return n[i].exports}for(var a="function"==typeof require&&require,t=0;t>>0):4294967296*(i>>>0)+(t>>>0)}function u(t,i,e){var r=i<=16383?1:i<=2097151?2:i<=268435455?3:Math.floor(Math.log(i)/(7*Math.LN2));e.realloc(r);for(var s=e.pos-1;t<=s;s--)e.buf[s+r]=e.buf[s]}function f(t,i){for(var e=0;e>>8,t[e+2]=i>>>16,t[e+3]=i>>>24}function V(t,i){return(t[i]|t[i+1]<<8|t[i+2]<<16)+(t[i+3]<<24)}s.prototype={destroy:function(){this.buf=null},readFields:function(t,i,e){for(e=e||this.length;this.pos>3,n=this.pos;this.type=7&r,t(s,i,this),this.pos===n&&this.skip(r)}return i},readMessage:function(t,i){return this.readFields(t,i,this.readVarint()+this.pos)},readFixed32:function(){var t=y(this.buf,this.pos);return this.pos+=4,t},readSFixed32:function(){var t=V(this.buf,this.pos);return this.pos+=4,t},readFixed64:function(){var t=y(this.buf,this.pos)+y(this.buf,this.pos+4)*n;return this.pos+=8,t},readSFixed64:function(){var t=y(this.buf,this.pos)+V(this.buf,this.pos+4)*n;return this.pos+=8,t},readFloat:function(){var t=r.read(this.buf,this.pos,!0,23,4);return this.pos+=4,t},readDouble:function(){var t=r.read(this.buf,this.pos,!0,52,8);return this.pos+=8,t},readVarint:function(t){var i=this.buf,e=i[this.pos++],r=127&e;if(e<128)return r;if(r|=(127&(e=i[this.pos++]))<<7,e<128)return r;if(r|=(127&(e=i[this.pos++]))<<14,e<128)return r;if(r|=(127&(e=i[this.pos++]))<<21,e<128)return r;var s,n,e=r|=(15&i[this.pos])<<28,i=t,r=this,t=r.buf;if(n=t[r.pos++],s=(112&n)>>4,n<128)return a(e,s,i);if(n=t[r.pos++],s|=(127&n)<<3,n<128)return a(e,s,i);if(n=t[r.pos++],s|=(127&n)<<10,n<128)return a(e,s,i);if(n=t[r.pos++],s|=(127&n)<<17,n<128)return a(e,s,i);if(n=t[r.pos++],s|=(127&n)<<24,n<128)return a(e,s,i);if(n=t[r.pos++],s|=(1&n)<<31,n<128)return a(e,s,i);throw new Error("Expected varint not more than 10 bytes")},readVarint64:function(){return this.readVarint(!0)},readSVarint:function(){var t=this.readVarint();return t%2==1?(t+1)/-2:t/2},readBoolean:function(){return Boolean(this.readVarint())},readString:function(){var t=this.readVarint()+this.pos,i=this.pos;if(12<=(this.pos=t)-i&&l)return e=this.buf,l.decode(e.subarray(i,t));for(var e,r,s,n,o=this.buf,h=t,a="",u=i;u>>10&1023|55296),d=56320|1023&d),a+=String.fromCharCode(d),u+=p}return a},readBytes:function(){var t=this.readVarint()+this.pos,i=this.buf.subarray(this.pos,t);return this.pos=t,i},readPackedVarint:function(t,i){if(this.type!==s.Bytes)return t.push(this.readVarint(i));var e=h(this);for(t=t||[];this.pos>>=7,r.buf[r.pos++]=127&i|128,i>>>=7,r.buf[r.pos++]=127&i|128,i>>>=7,r.buf[r.pos++]=127&i|128,i>>>=7,r.buf[r.pos]=127&i,s),s=e,e=(7&i)<<4;s.buf[s.pos++]|=e|((i>>>=3)?128:0),i&&(s.buf[s.pos++]=127&i|((i>>>=7)?128:0),i)&&(s.buf[s.pos++]=127&i|((i>>>=7)?128:0),i)&&(s.buf[s.pos++]=127&i|((i>>>=7)?128:0),i)&&(s.buf[s.pos++]=127&i|((i>>>=7)?128:0),i)&&(s.buf[s.pos++]=127&i)}else this.realloc(4),this.buf[this.pos++]=127&t|(127>>=7)|(127>>=7)|(127>>7&127)},writeSVarint:function(t){this.writeVarint(t<0?2*-t-1:2*t)},writeBoolean:function(t){this.writeVarint(Boolean(t))},writeString:function(t){t=String(t),this.realloc(4*t.length),this.pos++;var i=this.pos,t=(this.pos=function(t,i,e){for(var r,s,n=0;n>6|192:(r<65536?t[e++]=r>>12|224:(t[e++]=r>>18|240,t[e++]=r>>12&63|128),t[e++]=r>>6&63|128),t[e++]=63&r|128)}return e}(this.buf,t,this.pos),this.pos-i);128<=t&&u(i,t,this),this.pos=i-1,this.writeVarint(t),this.pos+=t},writeFloat:function(t){this.realloc(4),r.write(this.buf,t,this.pos,!0,23,4),this.pos+=4},writeDouble:function(t){this.realloc(8),r.write(this.buf,t,this.pos,!0,52,8),this.pos+=8},writeBytes:function(t){var i=t.length;this.writeVarint(i),this.realloc(i);for(var e=0;e>1,f=-7,d=e?s-1:0,p=e?-1:1,s=t[i+d];for(d+=p,n=s&(1<<-f)-1,s>>=-f,f+=h;0>=-f,f+=r;0>1,d=23===s?Math.pow(2,-24)-Math.pow(2,-77):0,p=r?0:n-1,l=r?1:-1,n=i<0||0===i&&1/i<0?1:0;for(i=Math.abs(i),isNaN(i)||i===1/0?(h=isNaN(i)?1:0,o=u):(o=Math.floor(Math.log(i)/Math.LN2),i*(r=Math.pow(2,-o))<1&&(o--,r*=2),2<=(i+=1<=o+f?d/r:d*Math.pow(2,1-f))*r&&(o++,r/=2),u<=o+f?(h=0,o=u):1<=o+f?(h=(i*r-1)*Math.pow(2,s),o+=f):(h=i*Math.pow(2,f-1)*Math.pow(2,s),o=0));8<=s;t[e+p]=255&h,p+=l,h/=256,s-=8);for(o=o<> 3,
+ startPos = this.pos;
+
+ this.type = val & 0x7;
+ readField(tag, result, this);
+
+ if (this.pos === startPos) this.skip(val);
+ }
+ return result;
+ },
+
+ readMessage: function(readField, result) {
+ return this.readFields(readField, result, this.readVarint() + this.pos);
+ },
+
+ readFixed32: function() {
+ var val = readUInt32(this.buf, this.pos);
+ this.pos += 4;
+ return val;
+ },
+
+ readSFixed32: function() {
+ var val = readInt32(this.buf, this.pos);
+ this.pos += 4;
+ return val;
+ },
+
+ // 64-bit int handling is based on github.com/dpw/node-buffer-more-ints (MIT-licensed)
+
+ readFixed64: function() {
+ var val = readUInt32(this.buf, this.pos) + readUInt32(this.buf, this.pos + 4) * SHIFT_LEFT_32;
+ this.pos += 8;
+ return val;
+ },
+
+ readSFixed64: function() {
+ var val = readUInt32(this.buf, this.pos) + readInt32(this.buf, this.pos + 4) * SHIFT_LEFT_32;
+ this.pos += 8;
+ return val;
+ },
+
+ readFloat: function() {
+ var val = ieee754.read(this.buf, this.pos, true, 23, 4);
+ this.pos += 4;
+ return val;
+ },
+
+ readDouble: function() {
+ var val = ieee754.read(this.buf, this.pos, true, 52, 8);
+ this.pos += 8;
+ return val;
+ },
+
+ readVarint: function(isSigned) {
+ var buf = this.buf,
+ val, b;
+
+ b = buf[this.pos++]; val = b & 0x7f; if (b < 0x80) return val;
+ b = buf[this.pos++]; val |= (b & 0x7f) << 7; if (b < 0x80) return val;
+ b = buf[this.pos++]; val |= (b & 0x7f) << 14; if (b < 0x80) return val;
+ b = buf[this.pos++]; val |= (b & 0x7f) << 21; if (b < 0x80) return val;
+ b = buf[this.pos]; val |= (b & 0x0f) << 28;
+
+ return readVarintRemainder(val, isSigned, this);
+ },
+
+ readVarint64: function() { // for compatibility with v2.0.1
+ return this.readVarint(true);
+ },
+
+ readSVarint: function() {
+ var num = this.readVarint();
+ return num % 2 === 1 ? (num + 1) / -2 : num / 2; // zigzag encoding
+ },
+
+ readBoolean: function() {
+ return Boolean(this.readVarint());
+ },
+
+ readString: function() {
+ var end = this.readVarint() + this.pos;
+ var pos = this.pos;
+ this.pos = end;
+
+ if (end - pos >= TEXT_DECODER_MIN_LENGTH && utf8TextDecoder) {
+ // longer strings are fast with the built-in browser TextDecoder API
+ return readUtf8TextDecoder(this.buf, pos, end);
+ }
+ // short strings are fast with our custom implementation
+ return readUtf8(this.buf, pos, end);
+ },
+
+ readBytes: function() {
+ var end = this.readVarint() + this.pos,
+ buffer = this.buf.subarray(this.pos, end);
+ this.pos = end;
+ return buffer;
+ },
+
+ // verbose for performance reasons; doesn't affect gzipped size
+
+ readPackedVarint: function(arr, isSigned) {
+ if (this.type !== Pbf.Bytes) return arr.push(this.readVarint(isSigned));
+ var end = readPackedEnd(this);
+ arr = arr || [];
+ while (this.pos < end) arr.push(this.readVarint(isSigned));
+ return arr;
+ },
+ readPackedSVarint: function(arr) {
+ if (this.type !== Pbf.Bytes) return arr.push(this.readSVarint());
+ var end = readPackedEnd(this);
+ arr = arr || [];
+ while (this.pos < end) arr.push(this.readSVarint());
+ return arr;
+ },
+ readPackedBoolean: function(arr) {
+ if (this.type !== Pbf.Bytes) return arr.push(this.readBoolean());
+ var end = readPackedEnd(this);
+ arr = arr || [];
+ while (this.pos < end) arr.push(this.readBoolean());
+ return arr;
+ },
+ readPackedFloat: function(arr) {
+ if (this.type !== Pbf.Bytes) return arr.push(this.readFloat());
+ var end = readPackedEnd(this);
+ arr = arr || [];
+ while (this.pos < end) arr.push(this.readFloat());
+ return arr;
+ },
+ readPackedDouble: function(arr) {
+ if (this.type !== Pbf.Bytes) return arr.push(this.readDouble());
+ var end = readPackedEnd(this);
+ arr = arr || [];
+ while (this.pos < end) arr.push(this.readDouble());
+ return arr;
+ },
+ readPackedFixed32: function(arr) {
+ if (this.type !== Pbf.Bytes) return arr.push(this.readFixed32());
+ var end = readPackedEnd(this);
+ arr = arr || [];
+ while (this.pos < end) arr.push(this.readFixed32());
+ return arr;
+ },
+ readPackedSFixed32: function(arr) {
+ if (this.type !== Pbf.Bytes) return arr.push(this.readSFixed32());
+ var end = readPackedEnd(this);
+ arr = arr || [];
+ while (this.pos < end) arr.push(this.readSFixed32());
+ return arr;
+ },
+ readPackedFixed64: function(arr) {
+ if (this.type !== Pbf.Bytes) return arr.push(this.readFixed64());
+ var end = readPackedEnd(this);
+ arr = arr || [];
+ while (this.pos < end) arr.push(this.readFixed64());
+ return arr;
+ },
+ readPackedSFixed64: function(arr) {
+ if (this.type !== Pbf.Bytes) return arr.push(this.readSFixed64());
+ var end = readPackedEnd(this);
+ arr = arr || [];
+ while (this.pos < end) arr.push(this.readSFixed64());
+ return arr;
+ },
+
+ skip: function(val) {
+ var type = val & 0x7;
+ if (type === Pbf.Varint) while (this.buf[this.pos++] > 0x7f) {}
+ else if (type === Pbf.Bytes) this.pos = this.readVarint() + this.pos;
+ else if (type === Pbf.Fixed32) this.pos += 4;
+ else if (type === Pbf.Fixed64) this.pos += 8;
+ else throw new Error('Unimplemented type: ' + type);
+ },
+
+ // === WRITING =================================================================
+
+ writeTag: function(tag, type) {
+ this.writeVarint((tag << 3) | type);
+ },
+
+ realloc: function(min) {
+ var length = this.length || 16;
+
+ while (length < this.pos + min) length *= 2;
+
+ if (length !== this.length) {
+ var buf = new Uint8Array(length);
+ buf.set(this.buf);
+ this.buf = buf;
+ this.length = length;
+ }
+ },
+
+ finish: function() {
+ this.length = this.pos;
+ this.pos = 0;
+ return this.buf.subarray(0, this.length);
+ },
+
+ writeFixed32: function(val) {
+ this.realloc(4);
+ writeInt32(this.buf, val, this.pos);
+ this.pos += 4;
+ },
+
+ writeSFixed32: function(val) {
+ this.realloc(4);
+ writeInt32(this.buf, val, this.pos);
+ this.pos += 4;
+ },
+
+ writeFixed64: function(val) {
+ this.realloc(8);
+ writeInt32(this.buf, val & -1, this.pos);
+ writeInt32(this.buf, Math.floor(val * SHIFT_RIGHT_32), this.pos + 4);
+ this.pos += 8;
+ },
+
+ writeSFixed64: function(val) {
+ this.realloc(8);
+ writeInt32(this.buf, val & -1, this.pos);
+ writeInt32(this.buf, Math.floor(val * SHIFT_RIGHT_32), this.pos + 4);
+ this.pos += 8;
+ },
+
+ writeVarint: function(val) {
+ val = +val || 0;
+
+ if (val > 0xfffffff || val < 0) {
+ writeBigVarint(val, this);
+ return;
+ }
+
+ this.realloc(4);
+
+ this.buf[this.pos++] = val & 0x7f | (val > 0x7f ? 0x80 : 0); if (val <= 0x7f) return;
+ this.buf[this.pos++] = ((val >>>= 7) & 0x7f) | (val > 0x7f ? 0x80 : 0); if (val <= 0x7f) return;
+ this.buf[this.pos++] = ((val >>>= 7) & 0x7f) | (val > 0x7f ? 0x80 : 0); if (val <= 0x7f) return;
+ this.buf[this.pos++] = (val >>> 7) & 0x7f;
+ },
+
+ writeSVarint: function(val) {
+ this.writeVarint(val < 0 ? -val * 2 - 1 : val * 2);
+ },
+
+ writeBoolean: function(val) {
+ this.writeVarint(Boolean(val));
+ },
+
+ writeString: function(str) {
+ str = String(str);
+ this.realloc(str.length * 4);
+
+ this.pos++; // reserve 1 byte for short string length
+
+ var startPos = this.pos;
+ // write the string directly to the buffer and see how much was written
+ this.pos = writeUtf8(this.buf, str, this.pos);
+ var len = this.pos - startPos;
+
+ if (len >= 0x80) makeRoomForExtraLength(startPos, len, this);
+
+ // finally, write the message length in the reserved place and restore the position
+ this.pos = startPos - 1;
+ this.writeVarint(len);
+ this.pos += len;
+ },
+
+ writeFloat: function(val) {
+ this.realloc(4);
+ ieee754.write(this.buf, val, this.pos, true, 23, 4);
+ this.pos += 4;
+ },
+
+ writeDouble: function(val) {
+ this.realloc(8);
+ ieee754.write(this.buf, val, this.pos, true, 52, 8);
+ this.pos += 8;
+ },
+
+ writeBytes: function(buffer) {
+ var len = buffer.length;
+ this.writeVarint(len);
+ this.realloc(len);
+ for (var i = 0; i < len; i++) this.buf[this.pos++] = buffer[i];
+ },
+
+ writeRawMessage: function(fn, obj) {
+ this.pos++; // reserve 1 byte for short message length
+
+ // write the message directly to the buffer and see how much was written
+ var startPos = this.pos;
+ fn(obj, this);
+ var len = this.pos - startPos;
+
+ if (len >= 0x80) makeRoomForExtraLength(startPos, len, this);
+
+ // finally, write the message length in the reserved place and restore the position
+ this.pos = startPos - 1;
+ this.writeVarint(len);
+ this.pos += len;
+ },
+
+ writeMessage: function(tag, fn, obj) {
+ this.writeTag(tag, Pbf.Bytes);
+ this.writeRawMessage(fn, obj);
+ },
+
+ writePackedVarint: function(tag, arr) { if (arr.length) this.writeMessage(tag, writePackedVarint, arr); },
+ writePackedSVarint: function(tag, arr) { if (arr.length) this.writeMessage(tag, writePackedSVarint, arr); },
+ writePackedBoolean: function(tag, arr) { if (arr.length) this.writeMessage(tag, writePackedBoolean, arr); },
+ writePackedFloat: function(tag, arr) { if (arr.length) this.writeMessage(tag, writePackedFloat, arr); },
+ writePackedDouble: function(tag, arr) { if (arr.length) this.writeMessage(tag, writePackedDouble, arr); },
+ writePackedFixed32: function(tag, arr) { if (arr.length) this.writeMessage(tag, writePackedFixed32, arr); },
+ writePackedSFixed32: function(tag, arr) { if (arr.length) this.writeMessage(tag, writePackedSFixed32, arr); },
+ writePackedFixed64: function(tag, arr) { if (arr.length) this.writeMessage(tag, writePackedFixed64, arr); },
+ writePackedSFixed64: function(tag, arr) { if (arr.length) this.writeMessage(tag, writePackedSFixed64, arr); },
+
+ writeBytesField: function(tag, buffer) {
+ this.writeTag(tag, Pbf.Bytes);
+ this.writeBytes(buffer);
+ },
+ writeFixed32Field: function(tag, val) {
+ this.writeTag(tag, Pbf.Fixed32);
+ this.writeFixed32(val);
+ },
+ writeSFixed32Field: function(tag, val) {
+ this.writeTag(tag, Pbf.Fixed32);
+ this.writeSFixed32(val);
+ },
+ writeFixed64Field: function(tag, val) {
+ this.writeTag(tag, Pbf.Fixed64);
+ this.writeFixed64(val);
+ },
+ writeSFixed64Field: function(tag, val) {
+ this.writeTag(tag, Pbf.Fixed64);
+ this.writeSFixed64(val);
+ },
+ writeVarintField: function(tag, val) {
+ this.writeTag(tag, Pbf.Varint);
+ this.writeVarint(val);
+ },
+ writeSVarintField: function(tag, val) {
+ this.writeTag(tag, Pbf.Varint);
+ this.writeSVarint(val);
+ },
+ writeStringField: function(tag, str) {
+ this.writeTag(tag, Pbf.Bytes);
+ this.writeString(str);
+ },
+ writeFloatField: function(tag, val) {
+ this.writeTag(tag, Pbf.Fixed32);
+ this.writeFloat(val);
+ },
+ writeDoubleField: function(tag, val) {
+ this.writeTag(tag, Pbf.Fixed64);
+ this.writeDouble(val);
+ },
+ writeBooleanField: function(tag, val) {
+ this.writeVarintField(tag, Boolean(val));
+ }
+};
+
+function readVarintRemainder(l, s, p) {
+ var buf = p.buf,
+ h, b;
+
+ b = buf[p.pos++]; h = (b & 0x70) >> 4; if (b < 0x80) return toNum(l, h, s);
+ b = buf[p.pos++]; h |= (b & 0x7f) << 3; if (b < 0x80) return toNum(l, h, s);
+ b = buf[p.pos++]; h |= (b & 0x7f) << 10; if (b < 0x80) return toNum(l, h, s);
+ b = buf[p.pos++]; h |= (b & 0x7f) << 17; if (b < 0x80) return toNum(l, h, s);
+ b = buf[p.pos++]; h |= (b & 0x7f) << 24; if (b < 0x80) return toNum(l, h, s);
+ b = buf[p.pos++]; h |= (b & 0x01) << 31; if (b < 0x80) return toNum(l, h, s);
+
+ throw new Error('Expected varint not more than 10 bytes');
+}
+
+function readPackedEnd(pbf) {
+ return pbf.type === Pbf.Bytes ?
+ pbf.readVarint() + pbf.pos : pbf.pos + 1;
+}
+
+function toNum(low, high, isSigned) {
+ if (isSigned) {
+ return high * 0x100000000 + (low >>> 0);
+ }
+
+ return ((high >>> 0) * 0x100000000) + (low >>> 0);
+}
+
+function writeBigVarint(val, pbf) {
+ var low, high;
+
+ if (val >= 0) {
+ low = (val % 0x100000000) | 0;
+ high = (val / 0x100000000) | 0;
+ } else {
+ low = ~(-val % 0x100000000);
+ high = ~(-val / 0x100000000);
+
+ if (low ^ 0xffffffff) {
+ low = (low + 1) | 0;
+ } else {
+ low = 0;
+ high = (high + 1) | 0;
+ }
+ }
+
+ if (val >= 0x10000000000000000 || val < -0x10000000000000000) {
+ throw new Error('Given varint doesn\'t fit into 10 bytes');
+ }
+
+ pbf.realloc(10);
+
+ writeBigVarintLow(low, high, pbf);
+ writeBigVarintHigh(high, pbf);
+}
+
+function writeBigVarintLow(low, high, pbf) {
+ pbf.buf[pbf.pos++] = low & 0x7f | 0x80; low >>>= 7;
+ pbf.buf[pbf.pos++] = low & 0x7f | 0x80; low >>>= 7;
+ pbf.buf[pbf.pos++] = low & 0x7f | 0x80; low >>>= 7;
+ pbf.buf[pbf.pos++] = low & 0x7f | 0x80; low >>>= 7;
+ pbf.buf[pbf.pos] = low & 0x7f;
+}
+
+function writeBigVarintHigh(high, pbf) {
+ var lsb = (high & 0x07) << 4;
+
+ pbf.buf[pbf.pos++] |= lsb | ((high >>>= 3) ? 0x80 : 0); if (!high) return;
+ pbf.buf[pbf.pos++] = high & 0x7f | ((high >>>= 7) ? 0x80 : 0); if (!high) return;
+ pbf.buf[pbf.pos++] = high & 0x7f | ((high >>>= 7) ? 0x80 : 0); if (!high) return;
+ pbf.buf[pbf.pos++] = high & 0x7f | ((high >>>= 7) ? 0x80 : 0); if (!high) return;
+ pbf.buf[pbf.pos++] = high & 0x7f | ((high >>>= 7) ? 0x80 : 0); if (!high) return;
+ pbf.buf[pbf.pos++] = high & 0x7f;
+}
+
+function makeRoomForExtraLength(startPos, len, pbf) {
+ var extraLen =
+ len <= 0x3fff ? 1 :
+ len <= 0x1fffff ? 2 :
+ len <= 0xfffffff ? 3 : Math.floor(Math.log(len) / (Math.LN2 * 7));
+
+ // if 1 byte isn't enough for encoding message length, shift the data to the right
+ pbf.realloc(extraLen);
+ for (var i = pbf.pos - 1; i >= startPos; i--) pbf.buf[i + extraLen] = pbf.buf[i];
+}
+
+function writePackedVarint(arr, pbf) { for (var i = 0; i < arr.length; i++) pbf.writeVarint(arr[i]); }
+function writePackedSVarint(arr, pbf) { for (var i = 0; i < arr.length; i++) pbf.writeSVarint(arr[i]); }
+function writePackedFloat(arr, pbf) { for (var i = 0; i < arr.length; i++) pbf.writeFloat(arr[i]); }
+function writePackedDouble(arr, pbf) { for (var i = 0; i < arr.length; i++) pbf.writeDouble(arr[i]); }
+function writePackedBoolean(arr, pbf) { for (var i = 0; i < arr.length; i++) pbf.writeBoolean(arr[i]); }
+function writePackedFixed32(arr, pbf) { for (var i = 0; i < arr.length; i++) pbf.writeFixed32(arr[i]); }
+function writePackedSFixed32(arr, pbf) { for (var i = 0; i < arr.length; i++) pbf.writeSFixed32(arr[i]); }
+function writePackedFixed64(arr, pbf) { for (var i = 0; i < arr.length; i++) pbf.writeFixed64(arr[i]); }
+function writePackedSFixed64(arr, pbf) { for (var i = 0; i < arr.length; i++) pbf.writeSFixed64(arr[i]); }
+
+// Buffer code below from https://github.com/feross/buffer, MIT-licensed
+
+function readUInt32(buf, pos) {
+ return ((buf[pos]) |
+ (buf[pos + 1] << 8) |
+ (buf[pos + 2] << 16)) +
+ (buf[pos + 3] * 0x1000000);
+}
+
+function writeInt32(buf, val, pos) {
+ buf[pos] = val;
+ buf[pos + 1] = (val >>> 8);
+ buf[pos + 2] = (val >>> 16);
+ buf[pos + 3] = (val >>> 24);
+}
+
+function readInt32(buf, pos) {
+ return ((buf[pos]) |
+ (buf[pos + 1] << 8) |
+ (buf[pos + 2] << 16)) +
+ (buf[pos + 3] << 24);
+}
+
+function readUtf8(buf, pos, end) {
+ var str = '';
+ var i = pos;
+
+ while (i < end) {
+ var b0 = buf[i];
+ var c = null; // codepoint
+ var bytesPerSequence =
+ b0 > 0xEF ? 4 :
+ b0 > 0xDF ? 3 :
+ b0 > 0xBF ? 2 : 1;
+
+ if (i + bytesPerSequence > end) break;
+
+ var b1, b2, b3;
+
+ if (bytesPerSequence === 1) {
+ if (b0 < 0x80) {
+ c = b0;
+ }
+ } else if (bytesPerSequence === 2) {
+ b1 = buf[i + 1];
+ if ((b1 & 0xC0) === 0x80) {
+ c = (b0 & 0x1F) << 0x6 | (b1 & 0x3F);
+ if (c <= 0x7F) {
+ c = null;
+ }
+ }
+ } else if (bytesPerSequence === 3) {
+ b1 = buf[i + 1];
+ b2 = buf[i + 2];
+ if ((b1 & 0xC0) === 0x80 && (b2 & 0xC0) === 0x80) {
+ c = (b0 & 0xF) << 0xC | (b1 & 0x3F) << 0x6 | (b2 & 0x3F);
+ if (c <= 0x7FF || (c >= 0xD800 && c <= 0xDFFF)) {
+ c = null;
+ }
+ }
+ } else if (bytesPerSequence === 4) {
+ b1 = buf[i + 1];
+ b2 = buf[i + 2];
+ b3 = buf[i + 3];
+ if ((b1 & 0xC0) === 0x80 && (b2 & 0xC0) === 0x80 && (b3 & 0xC0) === 0x80) {
+ c = (b0 & 0xF) << 0x12 | (b1 & 0x3F) << 0xC | (b2 & 0x3F) << 0x6 | (b3 & 0x3F);
+ if (c <= 0xFFFF || c >= 0x110000) {
+ c = null;
+ }
+ }
+ }
+
+ if (c === null) {
+ c = 0xFFFD;
+ bytesPerSequence = 1;
+
+ } else if (c > 0xFFFF) {
+ c -= 0x10000;
+ str += String.fromCharCode(c >>> 10 & 0x3FF | 0xD800);
+ c = 0xDC00 | c & 0x3FF;
+ }
+
+ str += String.fromCharCode(c);
+ i += bytesPerSequence;
+ }
+
+ return str;
+}
+
+function readUtf8TextDecoder(buf, pos, end) {
+ return utf8TextDecoder.decode(buf.subarray(pos, end));
+}
+
+function writeUtf8(buf, str, pos) {
+ for (var i = 0, c, lead; i < str.length; i++) {
+ c = str.charCodeAt(i); // code point
+
+ if (c > 0xD7FF && c < 0xE000) {
+ if (lead) {
+ if (c < 0xDC00) {
+ buf[pos++] = 0xEF;
+ buf[pos++] = 0xBF;
+ buf[pos++] = 0xBD;
+ lead = c;
+ continue;
+ } else {
+ c = lead - 0xD800 << 10 | c - 0xDC00 | 0x10000;
+ lead = null;
+ }
+ } else {
+ if (c > 0xDBFF || (i + 1 === str.length)) {
+ buf[pos++] = 0xEF;
+ buf[pos++] = 0xBF;
+ buf[pos++] = 0xBD;
+ } else {
+ lead = c;
+ }
+ continue;
+ }
+ } else if (lead) {
+ buf[pos++] = 0xEF;
+ buf[pos++] = 0xBF;
+ buf[pos++] = 0xBD;
+ lead = null;
+ }
+
+ if (c < 0x80) {
+ buf[pos++] = c;
+ } else {
+ if (c < 0x800) {
+ buf[pos++] = c >> 0x6 | 0xC0;
+ } else {
+ if (c < 0x10000) {
+ buf[pos++] = c >> 0xC | 0xE0;
+ } else {
+ buf[pos++] = c >> 0x12 | 0xF0;
+ buf[pos++] = c >> 0xC & 0x3F | 0x80;
+ }
+ buf[pos++] = c >> 0x6 & 0x3F | 0x80;
+ }
+ buf[pos++] = c & 0x3F | 0x80;
+ }
+ }
+ return pos;
+}
diff --git a/node_modules/pbf/package.json b/node_modules/pbf/package.json
new file mode 100644
index 0000000000000000000000000000000000000000..c6c921d137c8e72747a045ad9c94166ebe75ce3e
--- /dev/null
+++ b/node_modules/pbf/package.json
@@ -0,0 +1,81 @@
+{
+ "name": "pbf",
+ "version": "3.3.0",
+ "description": "a low-level, lightweight protocol buffers implementation in JavaScript",
+ "main": "index.js",
+ "unpkg": "dist/pbf.js",
+ "jsdelivr": "dist/pbf.js",
+ "scripts": {
+ "bench": "node bench/bench.js",
+ "pretest": "eslint index.js compile.js test/*.js bench/bench-tiles.js bin/pbf",
+ "test": "node --test",
+ "cov": "node --test --experimental-test-covetage",
+ "build-min": "mkdirp dist && browserify index.js -s Pbf | uglifyjs -c -m > dist/pbf.js",
+ "build-dev": "mkdirp dist && browserify index.js -d -s Pbf > dist/pbf-dev.js",
+ "prepublishOnly": "npm run build-dev && npm run build-min"
+ },
+ "files": [
+ "bin",
+ "dist",
+ "compile.js"
+ ],
+ "bin": {
+ "pbf": "bin/pbf"
+ },
+ "repository": {
+ "type": "git",
+ "url": "git@github.com:mapbox/pbf.git"
+ },
+ "keywords": [
+ "protocol",
+ "buffer",
+ "pbf",
+ "protobuf",
+ "binary",
+ "format",
+ "serialization",
+ "encoder",
+ "decoder"
+ ],
+ "author": "Konstantin Kaefer",
+ "license": "BSD-3-Clause",
+ "bugs": {
+ "url": "https://github.com/mapbox/pbf/issues"
+ },
+ "homepage": "https://github.com/mapbox/pbf",
+ "dependencies": {
+ "ieee754": "^1.1.12",
+ "resolve-protobuf-schema": "^2.1.0"
+ },
+ "devDependencies": {
+ "benchmark": "^2.1.4",
+ "browserify": "^17.0.0",
+ "eslint": "^8.57.0",
+ "eslint-config-mourner": "^2.0.3",
+ "mkdirp": "^3.0.1",
+ "protobufjs": "^7.3.2",
+ "protocol-buffers": "^5.0.0",
+ "tile-stats-runner": "^1.0.0",
+ "uglify-js": "^3.18.0"
+ },
+ "eslintConfig": {
+ "extends": "mourner",
+ "rules": {
+ "space-before-function-paren": [
+ 2,
+ "never"
+ ],
+ "key-spacing": 0,
+ "no-empty": 0,
+ "global-require": 0,
+ "no-cond-assign": 0,
+ "indent": [
+ 2,
+ 4,
+ {
+ "flatTernaryExpressions": true
+ }
+ ]
+ }
+ }
+}
diff --git a/node_modules/pbkdf2/.eslintrc b/node_modules/pbkdf2/.eslintrc
new file mode 100644
index 0000000000000000000000000000000000000000..9788295079c3c5e97931b791dfcd72301e86ae58
--- /dev/null
+++ b/node_modules/pbkdf2/.eslintrc
@@ -0,0 +1,46 @@
+{
+ "root": true,
+
+ "extends": "@ljharb",
+
+ "globals": {
+ "Uint8Array": "readonly",
+ "Uint16Array": "readonly",
+ "Uint32Array": "readonly",
+ "Int8Array": "readonly",
+ "Int16Array": "readonly",
+ "Int32Array": "readonly",
+ "Float32Array": "readonly",
+ "Float64Array": "readonly",
+ "BigInt64Array": "readonly",
+ "BigUint64Array": "readonly",
+ },
+
+ "rules": {
+ "complexity": "off",
+ "func-style": "warn",
+ "max-params": "warn",
+ "multiline-comment-style": "off",
+ "no-param-reassign": "warn",
+ "sort-keys": "warn",
+ },
+
+ "ignorePatterns": [
+ "test/bundle.js",
+ ],
+
+ "overrides": [
+ {
+ "files": "bench/*",
+ "extends": "@ljharb/eslint-config/node/4",
+ "rules": {
+ "func-style": "warn",
+ "max-params": "warn",
+ "no-param-reassign": "warn",
+ "no-var": "off",
+ "prefer-arrow-callback": "off",
+ "prefer-template": "off",
+ },
+ },
+ ],
+}
diff --git a/node_modules/pbkdf2/.github/FUNDING.yml b/node_modules/pbkdf2/.github/FUNDING.yml
new file mode 100644
index 0000000000000000000000000000000000000000..ca4853ac3631075e297e59733816d06874c369bc
--- /dev/null
+++ b/node_modules/pbkdf2/.github/FUNDING.yml
@@ -0,0 +1,12 @@
+# These are supported funding model platforms
+
+github: [ljharb]
+patreon: # Replace with a single Patreon username
+open_collective: # Replace with a single Open Collective username
+ko_fi: # Replace with a single Ko-fi username
+tidelift: npm/pbkdf2
+community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry
+liberapay: # Replace with a single Liberapay username
+issuehunt: # Replace with a single IssueHunt username
+otechie: # Replace with a single Otechie username
+custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2']
diff --git a/node_modules/pbkdf2/.nycrc b/node_modules/pbkdf2/.nycrc
new file mode 100644
index 0000000000000000000000000000000000000000..d37607e060ddd54892e13944ee5d387b39a4f385
--- /dev/null
+++ b/node_modules/pbkdf2/.nycrc
@@ -0,0 +1,10 @@
+{
+ "all": true,
+ "check-coverage": false,
+ "reporter": ["text-summary", "text", "html", "json"],
+ "exclude": [
+ "bench",
+ "coverage",
+ "test"
+ ]
+}
diff --git a/node_modules/pbkdf2/CHANGELOG.md b/node_modules/pbkdf2/CHANGELOG.md
new file mode 100644
index 0000000000000000000000000000000000000000..3fd6d8f9a9516700634296b9b51a9b3f440bcdc2
--- /dev/null
+++ b/node_modules/pbkdf2/CHANGELOG.md
@@ -0,0 +1,361 @@
+# Changelog
+
+All notable changes to this project will be documented in this file.
+
+The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
+and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
+
+## [v3.1.5](https://github.com/browserify/pbkdf2/compare/v3.1.4...v3.1.5) - 2025-09-23
+
+### Commits
+
+- [Fix] only allow finite iterations [`67bd94d`](https://github.com/browserify/pbkdf2/commit/67bd94dbbf21b93f5e282ee910728945c8ef2827)
+- [Fix] restore node 0.10 support [`8f59d96`](https://github.com/browserify/pbkdf2/commit/8f59d962f71dcb2cc14067d7f514ff96e3406f81)
+- [Fix] check parameters before the "no Promise" bailout [`d2dc5f0`](https://github.com/browserify/pbkdf2/commit/d2dc5f052cacadf3d4a09d87164158da875ca740)
+
+## [v3.1.4](https://github.com/browserify/pbkdf2/compare/v3.1.3...v3.1.4) - 2025-09-22
+
+### Commits
+
+- [Deps] update `create-hash`, `ripemd160`, `sha.js`, `to-buffer` [`8dbf49b`](https://github.com/browserify/pbkdf2/commit/8dbf49b38235066c565a92eaf3722720a1333a2d)
+- [meta] update repo URLs [`d15bc35`](https://github.com/browserify/pbkdf2/commit/d15bc351de0edbed394d2a6189176960aaa0d050)
+- [Dev Deps] update `@ljharb/eslint-config` [`aaf870b`](https://github.com/browserify/pbkdf2/commit/aaf870b1d1855e6a381af05021f304294a79f7c9)
+
+## [v3.1.3](https://github.com/browserify/pbkdf2/compare/v3.1.2...v3.1.3) - 2025-06-20
+
+### Commits
+
+- Only apps should have lockfiles [`8b06730`](https://github.com/browserify/pbkdf2/commit/8b067308eedcc3b7da3e06202d437ff532de75bd)
+- [lint] fix whitespace [`9a76e2f`](https://github.com/browserify/pbkdf2/commit/9a76e2f37ef4541aeff92d97b7335b7fa6e989a8)
+- [lint] fix parens/curlies/semis/etc [`6fd84bf`](https://github.com/browserify/pbkdf2/commit/6fd84bf64a423d207d9e665f3e9fd88b148c4480)
+- [meta] add `auto-changelog` [`796c38d`](https://github.com/browserify/pbkdf2/commit/796c38d428ed9546e7ddfbb38322faa99921d716)
+- [Tests] fix tests in node 17 [`3661fb0`](https://github.com/browserify/pbkdf2/commit/3661fb0156177bfe380c7bcc133917e7ee501bc7)
+- Revert "[Tests] fix tests in node < 3" [`7431b57`](https://github.com/browserify/pbkdf2/commit/7431b5766805cbf880c1b3d0f38d484357844ff7)
+- [Tests] fix tests in node < 3 [`eb9f97a`](https://github.com/browserify/pbkdf2/commit/eb9f97a66ed83836bebc4ff563a1588248708501)
+- [Fix] ensure unknown algorithms throw + known ones match node [`26d4fd3`](https://github.com/browserify/pbkdf2/commit/26d4fd391e00ed806840ea1ef7341937985f4ba8)
+- [Tests] add GHA, always run nyc [`513906a`](https://github.com/browserify/pbkdf2/commit/513906a735e80a0e125e1a3363c5dbe90bb34bb7)
+- [lint] fix a few more rules [`ab04da8`](https://github.com/browserify/pbkdf2/commit/ab04da834a0342cb3779486314fa67ebc1e3f035)
+- [lint] switch to eslint [`89694cf`](https://github.com/browserify/pbkdf2/commit/89694cf7e4062a8c924fbe74ad2b2d3cf78f1715)
+- [Tests] add coverage [`d0d534b`](https://github.com/browserify/pbkdf2/commit/d0d534bfdc4db6d6ea9f719606ad18a78db6c124)
+- [Refactor] use `to-buffer` [`e3102a8`](https://github.com/browserify/pbkdf2/commit/e3102a8cd4830a3ac85cd0dd011cc002fdde33bb)
+- [readme] improve badges [`fca0c9d`](https://github.com/browserify/pbkdf2/commit/fca0c9d4c5b053d911315a3607367d1db9f9f605)
+- [Tests] remove unused travis file [`a2c7d93`](https://github.com/browserify/pbkdf2/commit/a2c7d93bbcad73c49dad0c18fef6b8a4af8c3310)
+- [meta] switch from `files` to `npmignore` [`7f31fbc`](https://github.com/browserify/pbkdf2/commit/7f31fbca528fa5af3b7d3910daf09a7e5ed8adb4)
+- [Tests] use .nycrc [`8d628e8`](https://github.com/browserify/pbkdf2/commit/8d628e8d5559b4acd4d4a714afb04a2990f901b7)
+- [Refactor] minor tweaks [`fc61005`](https://github.com/browserify/pbkdf2/commit/fc61005c8cbd480e24ee103ac39a45f0d90ac636)
+- [Deps] update `create-hmac`, `safe-buffer`, `sha.js` [`ae2a7d0`](https://github.com/browserify/pbkdf2/commit/ae2a7d051c9133c25d5212ba4f46747c0ed4c190)
+- [Fix] pin `create-hash`, `ripemd160` due to breaking changes [`e079968`](https://github.com/browserify/pbkdf2/commit/e07996890af79296f1913431fb3b252e25df2f0e)
+- [Tests] fix tests in node 3 [`45fbcf3`](https://github.com/browserify/pbkdf2/commit/45fbcf30431f9585ae3b61f2207c0a16c1953915)
+- [meta] skip publishing benchmarks [`19ea57b`](https://github.com/browserify/pbkdf2/commit/19ea57bf11d055ddcd97d2556cd3097663b050b9)
+- [Dev Deps] add missing peer dep [`645e252`](https://github.com/browserify/pbkdf2/commit/645e252375087e97beb95e518038b99eb5724c5b)
+
+## [v3.1.2](https://github.com/browserify/pbkdf2/compare/v3.1.1...v3.1.2) - 2021-04-09
+
+### Commits
+
+- handle nextTick [`36457b9`](https://github.com/browserify/pbkdf2/commit/36457b9fecfd1e128c8e9884a57e277649679832)
+- Check for process before accessing [`449e510`](https://github.com/browserify/pbkdf2/commit/449e510f861f56ed673613d8102f6b1a3e680ced)
+- handle different returns [`fb82137`](https://github.com/browserify/pbkdf2/commit/fb82137ecefb56b5e93b70686e0dc0b4bb591b7c)
+
+## [v3.1.1](https://github.com/browserify/pbkdf2/compare/v3.1.0...v3.1.1) - 2020-06-04
+
+### Commits
+
+- style nit [`6d994f2`](https://github.com/browserify/pbkdf2/commit/6d994f2e71934c26f96791bde440e86d9d93ff2b)
+- remove arrow [`70ea270`](https://github.com/browserify/pbkdf2/commit/70ea2709b761b8fbb0551f4411feb52efb9c8690)
+
+## [v3.1.0](https://github.com/browserify/pbkdf2/compare/v3.0.17...v3.1.0) - 2020-06-03
+
+### Merged
+
+- check if process.version is available [`#85`](https://github.com/browserify/pbkdf2/pull/85)
+
+### Commits
+
+- fix style [`1674cbd`](https://github.com/browserify/pbkdf2/commit/1674cbdb359ae166e6c99733e0af40e92ebb3cd4)
+- add support for all ArrayBuffers [`b888820`](https://github.com/browserify/pbkdf2/commit/b88882005853ad5d8ecbc00a56e101c336b5ea04)
+- Build type check into toBuffer [`0b77ea9`](https://github.com/browserify/pbkdf2/commit/0b77ea96191a374fa6774ebaa4fe89be86c3d1af)
+- fix fixtures [`6af65e7`](https://github.com/browserify/pbkdf2/commit/6af65e797f5c0738fd9f4e9dfa9b00ae0885f5d7)
+- Add tests for Uint8Array [`bca4182`](https://github.com/browserify/pbkdf2/commit/bca4182a30ce5d73ed527fa254c6d3a62e07e8f8)
+- fix encodings [`b1c669b`](https://github.com/browserify/pbkdf2/commit/b1c669b6dfa9a0f82cecdec7bd4a14a042d9a070)
+- minor fixes for Uint8Array support [`f61abc7`](https://github.com/browserify/pbkdf2/commit/f61abc7596d40540d5d759bc583044082c52badc)
+- fix tests [`ab62504`](https://github.com/browserify/pbkdf2/commit/ab6250458dac29f4f9d7144e903e18726bed8535)
+- Add Uint8Array support [`3fbb793`](https://github.com/browserify/pbkdf2/commit/3fbb7935e2aa810a5ed861ef32c44092fb3fafbb)
+- adjust node versions [`a572cbc`](https://github.com/browserify/pbkdf2/commit/a572cbc655a1cc626ae72ccf8bb29f25418d394e)
+- update travis [`4a4deed`](https://github.com/browserify/pbkdf2/commit/4a4deed4d115d55a698cf1292abef4f38cdbe922)
+- fix standard typo (that was not caught locally for some reason) [`47c59ad`](https://github.com/browserify/pbkdf2/commit/47c59ad879f5fcce529a69ed902ca9b664813020)
+
+## [v3.0.17](https://github.com/browserify/pbkdf2/compare/v3.0.16...v3.0.17) - 2018-09-25
+
+### Commits
+
+- Add ripemd160 test [`9da9d9c`](https://github.com/browserify/pbkdf2/commit/9da9d9c4f426237e72b8f189ae14e3e473c84c69)
+- Do not inline rmd160Func [`b498c9b`](https://github.com/browserify/pbkdf2/commit/b498c9b779c40823fc504764c9a333fd44c79f31)
+- Fix RIPEMD160 support [`68729a6`](https://github.com/browserify/pbkdf2/commit/68729a6b54e1438e1960931fd6aa3bb343fcc173)
+
+## [v3.0.16](https://github.com/browserify/pbkdf2/compare/v3.0.15...v3.0.16) - 2018-04-20
+
+### Merged
+
+- default to SHA1 for native [`#76`](https://github.com/browserify/pbkdf2/pull/76)
+
+### Commits
+
+- fix standard indentation [`740d93e`](https://github.com/browserify/pbkdf2/commit/740d93e2f5798bc66d32d3a648ec2d96f7254c12)
+- tests: fix JS/sync tests not being run [`1416637`](https://github.com/browserify/pbkdf2/commit/1416637d82848494bd427a38643a58795213191f)
+- increase sync.js internal coverage [`4e07660`](https://github.com/browserify/pbkdf2/commit/4e076601b82e518cac6179ea62cc4f3c4553e43b)
+- travis: add 8 and 9 [`d82c51b`](https://github.com/browserify/pbkdf2/commit/d82c51bb04897f099512b3add9f892a36a71cedc)
+
+## [v3.0.15](https://github.com/browserify/pbkdf2/compare/v3.0.14...v3.0.15) - 2018-04-01
+
+### Merged
+
+- Throw if password / salt is not a buffer or string [`#77`](https://github.com/browserify/pbkdf2/pull/77)
+- Update README.md for async recommendation [`#75`](https://github.com/browserify/pbkdf2/pull/75)
+
+### Commits
+
+- throw if password / salt is not a buffer or string [`2410eb0`](https://github.com/browserify/pbkdf2/commit/2410eb0ee1f41da47d1ba2e53411b489d88838ce)
+- typos [`9dae437`](https://github.com/browserify/pbkdf2/commit/9dae437df90f5940eb332a5c6f86f78309f79f06)
+- Update README.md [`ad85843`](https://github.com/browserify/pbkdf2/commit/ad8584337742d4cf83d9244a73abce2a7af90ff2)
+
+## [v3.0.14](https://github.com/browserify/pbkdf2/compare/v3.0.13...v3.0.14) - 2017-09-08
+
+### Merged
+
+- use the local implementations if crypto.bpkdf2Sync [`#72`](https://github.com/browserify/pbkdf2/pull/72)
+
+### Commits
+
+- use the local implementations if *either* crypto.bpkdf2Sync doesn't exist OR it doesn't contain the marker string [`9132b7a`](https://github.com/browserify/pbkdf2/commit/9132b7a81540a5743ece086bea87ada10028e05f)
+
+## [v3.0.13](https://github.com/browserify/pbkdf2/compare/v3.0.12...v3.0.13) - 2017-08-02
+
+### Merged
+
+- fail better when node version loaded in browser [`#71`](https://github.com/browserify/pbkdf2/pull/71)
+- remove unnecessary r, T values [`#68`](https://github.com/browserify/pbkdf2/pull/68)
+
+### Commits
+
+- tests: add dkLen < and > [`c3d2998`](https://github.com/browserify/pbkdf2/commit/c3d29981a600cd30fa57849ce12bf95d45bb4b8f)
+- align definitions with assignment, formatting [`5c50528`](https://github.com/browserify/pbkdf2/commit/5c5052859b7ea4dba9484ce4ad0c1edfb507790b)
+- lib/sync*: avoid inner-loop T copy [`74b80d3`](https://github.com/browserify/pbkdf2/commit/74b80d32640d1c90a4a6a90d99784dadc9d2d880)
+- sync: align definitions with assignment [`c818cf1`](https://github.com/browserify/pbkdf2/commit/c818cf1bf6b7c23278ebd8196ebddc6b54c92c8c)
+- remove unused r variable [`9e0d168`](https://github.com/browserify/pbkdf2/commit/9e0d1684abca98e08a1334b0ead141ebf6c91806)
+- travis: drop 0.12 [`0985c3e`](https://github.com/browserify/pbkdf2/commit/0985c3e03cb4392a5f931c4a62869257f3feaeba)
+- sync-browser: consistent exports [`90ac748`](https://github.com/browserify/pbkdf2/commit/90ac7488016ad97023d3b42795dc1da00b310490)
+- just remove microtime [`0fa9638`](https://github.com/browserify/pbkdf2/commit/0fa9638dad5384d7afb8943c1e22d2e4a16957d4)
+- standard --fix [`8281fc6`](https://github.com/browserify/pbkdf2/commit/8281fc64b281bacab50f4b735aa768474eaaadcd)
+
+## [v3.0.12](https://github.com/browserify/pbkdf2/compare/v3.0.11...v3.0.12) - 2017-05-11
+
+### Merged
+
+- fix #60 - use browser.js in the browser, instead of index.js; include lib folder in the published package [`#62`](https://github.com/browserify/pbkdf2/pull/62)
+
+### Fixed
+
+- fix #60 - use browser.js in the browser, instead of index.js; include lib folder in the published package (#62) [`#60`](https://github.com/browserify/pbkdf2/issues/60)
+
+### Commits
+
+- switch to optional dep #63, 65 [`7d246e9`](https://github.com/browserify/pbkdf2/commit/7d246e91bbdaedbb55fa0c323306cbcc58d9ec73)
+
+## [v3.0.11](https://github.com/browserify/pbkdf2/compare/v3.0.10...v3.0.11) - 2017-05-11
+
+### Commits
+
+- update files [`3313867`](https://github.com/browserify/pbkdf2/commit/3313867fd5dd5fcce716b4c195556f5c329cbdd5)
+
+## [v3.0.10](https://github.com/browserify/pbkdf2/compare/v3.0.9...v3.0.10) - 2017-05-11
+
+### Merged
+
+- node for the node, js for the browser [`#59`](https://github.com/browserify/pbkdf2/pull/59)
+- real optimizations [`#57`](https://github.com/browserify/pbkdf2/pull/57)
+- benchmark [`#56`](https://github.com/browserify/pbkdf2/pull/56)
+- do our own hmacing [`#54`](https://github.com/browserify/pbkdf2/pull/54)
+
+### Commits
+
+- use native crypto when available [`cdaf5c0`](https://github.com/browserify/pbkdf2/commit/cdaf5c0da8502c47a40d2b2caaafb497836e3b42)
+- actually add bench [`fa2e0a1`](https://github.com/browserify/pbkdf2/commit/fa2e0a106adf8f2b2529bb9912f16d07f061cb17)
+- passing tests [`216a6a7`](https://github.com/browserify/pbkdf2/commit/216a6a7d137ba5a363d1be9c3a7a42d47398429e)
+- hmac ourselves [`9699045`](https://github.com/browserify/pbkdf2/commit/9699045c37a07f8319cfb8d44e2ff4252d7a7078)
+- use hashes directly [`89e0e80`](https://github.com/browserify/pbkdf2/commit/89e0e80dbce67e16b8946deb38dc755aeea78222)
+- correctly test both [`fb56873`](https://github.com/browserify/pbkdf2/commit/fb56873fa885059a8c17410eba0b544e5932cd28)
+- avoid Buffer.concat [`96518aa`](https://github.com/browserify/pbkdf2/commit/96518aac66af803a0040e3bd1ca48b2828f38881)
+- formatting [`dd3467c`](https://github.com/browserify/pbkdf2/commit/dd3467c75abd0136fc93f2acdbf1df94af10924f)
+- some fixes [`15b2cbf`](https://github.com/browserify/pbkdf2/commit/15b2cbfd9c3575593fc147dbd170e23c293a6f12)
+- cleanup [`fec6652`](https://github.com/browserify/pbkdf2/commit/fec66520e38de3b2fccaf924dd61807bf500ad36)
+- formating [`dc2e15a`](https://github.com/browserify/pbkdf2/commit/dc2e15aa0f25b091a94fd575eb0edbd41c2300b0)
+- fix coverage [`ae3f2a5`](https://github.com/browserify/pbkdf2/commit/ae3f2a5d0b475d0f4fb5a38b7ce6c9206a4a0c9b)
+- move stuff around [`52c3960`](https://github.com/browserify/pbkdf2/commit/52c3960b217a9933e8ef8a833b9a60141ddbd70a)
+- 100% [`ef38b2b`](https://github.com/browserify/pbkdf2/commit/ef38b2b9bb02bb4167689ab8955a0b323c03d644)
+- trailing space [`03832fb`](https://github.com/browserify/pbkdf2/commit/03832fbdd47fb354329bdbb51c463ed60033e2ea)
+- reduce coverage [`2f720b4`](https://github.com/browserify/pbkdf2/commit/2f720b4b4d3441f743d1637a479cda596c39b4a9)
+- switch to optional dep [`8423738`](https://github.com/browserify/pbkdf2/commit/8423738759f67929760c828cadd88c5867d4e5f2)
+- fix style [`5b33204`](https://github.com/browserify/pbkdf2/commit/5b33204d0172b06d7d93238ef72a1240b3e3f3c6)
+
+## [v3.0.9](https://github.com/browserify/pbkdf2/compare/v3.0.8...v3.0.9) - 2016-10-05
+
+### Merged
+
+- protect 0.10 users by throwing [`#47`](https://github.com/browserify/pbkdf2/pull/47)
+
+### Commits
+
+- warn 0.10 users by throwing [`5e63f63`](https://github.com/browserify/pbkdf2/commit/5e63f63c149182f617b209d0419c408691b918d7)
+
+## [v3.0.8](https://github.com/browserify/pbkdf2/compare/v3.0.7...v3.0.8) - 2016-09-22
+
+### Fixed
+
+- package: add engines [`#46`](https://github.com/browserify/pbkdf2/issues/46)
+
+### Commits
+
+- package: 1 too many indentations [`bffd057`](https://github.com/browserify/pbkdf2/commit/bffd0578fd2eb892a36cfd830fadc535deae9a49)
+- package: 90% branch coverage is fine for now [`c3d57f9`](https://github.com/browserify/pbkdf2/commit/c3d57f96666f556034b8b59839b28b7fa7c342e9)
+
+## [v3.0.7](https://github.com/browserify/pbkdf2/compare/v3.0.6...v3.0.7) - 2016-09-16
+
+### Merged
+
+- browser: avoid process.version split before process.browser [`#44`](https://github.com/browserify/pbkdf2/pull/44)
+
+## [v3.0.6](https://github.com/browserify/pbkdf2/compare/v3.0.5...v3.0.6) - 2016-09-14
+
+### Merged
+
+- tests: fix UTF-8 encoding [`#42`](https://github.com/browserify/pbkdf2/pull/42)
+- Add browserify dependency, rename index.html to bundle.html [`#41`](https://github.com/browserify/pbkdf2/pull/41)
+- package: add browser.js [`#39`](https://github.com/browserify/pbkdf2/pull/39)
+
+### Commits
+
+- add browserify and remove mocha from test/index.html [`f28965d`](https://github.com/browserify/pbkdf2/commit/f28965d0a494e9f6f95f616bb3f608d3a15bff9c)
+- rename index.html to bundle.html [`7d850d2`](https://github.com/browserify/pbkdf2/commit/7d850d247a93122a5e1b60fabddf64f7958cfeeb)
+
+## [v3.0.5](https://github.com/browserify/pbkdf2/compare/3.0.4...v3.0.5) - 2016-09-12
+
+### Merged
+
+- use tape instead of mocha [`#35`](https://github.com/browserify/pbkdf2/pull/35)
+- tests: remove binary assumption, fixes #34 [`#36`](https://github.com/browserify/pbkdf2/pull/36)
+- README: add documentation, close #31 [`#33`](https://github.com/browserify/pbkdf2/pull/33)
+- fix coverage [`#32`](https://github.com/browserify/pbkdf2/pull/32)
+- [trivial] update README.md [`#28`](https://github.com/browserify/pbkdf2/pull/28)
+- [trivial] rename async-shim.js to node-shim-async.js [`#29`](https://github.com/browserify/pbkdf2/pull/29)
+- update travis & standard [`#24`](https://github.com/browserify/pbkdf2/pull/24)
+- browser: delay async computation, fixes #13 [`#14`](https://github.com/browserify/pbkdf2/pull/14)
+
+### Fixed
+
+- Merge pull request #36 from crypto-browserify/testfix [`#34`](https://github.com/browserify/pbkdf2/issues/34)
+- tests: remove binary assumption, fixes #34 [`#34`](https://github.com/browserify/pbkdf2/issues/34)
+- Merge pull request #33 from crypto-browserify/dcousens-patch-1 [`#31`](https://github.com/browserify/pbkdf2/issues/31)
+- README: add documentation, close #31 [`#31`](https://github.com/browserify/pbkdf2/issues/31)
+- README: fix pbkdf2 spelling, resolves #20 [`#20`](https://github.com/browserify/pbkdf2/issues/20)
+- Merge pull request #14 from crypto-browserify/dcousens-patch-1 [`#13`](https://github.com/browserify/pbkdf2/issues/13)
+- browser: delay async computation, fixes #13 [`#13`](https://github.com/browserify/pbkdf2/issues/13)
+
+### Commits
+
+- add node-shim.js [`5eaa6ba`](https://github.com/browserify/pbkdf2/commit/5eaa6baa87564ab46775d1b8d547dd0f4ca8515b)
+- browser: default the encoding [`94e7979`](https://github.com/browserify/pbkdf2/commit/94e79791fcab6c91cc5cb773857e2d51783edada)
+- update tests [`931b7d5`](https://github.com/browserify/pbkdf2/commit/931b7d527a7a46e7518506680a1d431e6eb24dd3)
+- package: update standard [`dd02315`](https://github.com/browserify/pbkdf2/commit/dd02315c41b8339d14c656c7e70ba433c893b36f)
+- move checkParameters to separate file [`93ffd51`](https://github.com/browserify/pbkdf2/commit/93ffd519878f22d881a36eadcde4ad3e710caecc)
+- tests: merge to avoid double up of code [`59f6577`](https://github.com/browserify/pbkdf2/commit/59f6577f8783d6e71a99988397c3a1e0811ed6d5)
+- travis: update config [`7ab61b4`](https://github.com/browserify/pbkdf2/commit/7ab61b401c7c3d40bcb16d98bab97143c89d97e1)
+- update README.md [`8bf4958`](https://github.com/browserify/pbkdf2/commit/8bf4958da1da9a8a5d13cbe91aff0fe9e632371c)
+- pull out type checking [`e6b815f`](https://github.com/browserify/pbkdf2/commit/e6b815fa4c0b2edf222c663c7b5d761dddf23d57)
+- browser: s/testParams/checkParameters/ [`7730a55`](https://github.com/browserify/pbkdf2/commit/7730a552e89e09da0d8a42b56f8a376c851b2c11)
+- package: add files field to package.json [`3ee45ed`](https://github.com/browserify/pbkdf2/commit/3ee45ed1bd6b751d7918075b2a76d166eb61ae8a)
+- rename async-shim.js to node-shim-async.js [`2268e11`](https://github.com/browserify/pbkdf2/commit/2268e11ad301ebf377a1f859e05214bdf3622919)
+- browser: return null for error [`c470de1`](https://github.com/browserify/pbkdf2/commit/c470de18779fcb0f998d8c542bad5787dfb5f5f1)
+- .travis: test node 6 [`9f949d4`](https://github.com/browserify/pbkdf2/commit/9f949d46d9392be9e937e2916df7863ac17f2815)
+
+## [3.0.4](https://github.com/browserify/pbkdf2/compare/v3.0.3...3.0.4) - 2015-03-27
+
+### Merged
+
+- Fix shim encoding and more reliably close child process [`#12`](https://github.com/browserify/pbkdf2/pull/12)
+
+### Commits
+
+- async errors and exiting [`2bcfba8`](https://github.com/browserify/pbkdf2/commit/2bcfba85216694c10663540b34a4e3b400c205ed)
+- tests: add failing utf8 test [`ea1ddaf`](https://github.com/browserify/pbkdf2/commit/ea1ddaf28d06a288a955ae41b717011c1596fb0b)
+- fix 2 types of errors [`0cbba29`](https://github.com/browserify/pbkdf2/commit/0cbba29b0a81a7acf2619fd49ab5b9f40c47bfa8)
+- fix standard formatting issues [`93b06d3`](https://github.com/browserify/pbkdf2/commit/93b06d3762fdb850d5532e0f63b8051515db666f)
+- fix shim encoding [`a57d9c6`](https://github.com/browserify/pbkdf2/commit/a57d9c6b37fba515eb6a83cf8239bcd67356a203)
+- index/browser: rename MAX_INT to MAX_ALLOC [`9f6fb05`](https://github.com/browserify/pbkdf2/commit/9f6fb05b7284bc0fc72cde6e37524deffdc2d3a8)
+- package: use standard 3.0.0 [`941b46b`](https://github.com/browserify/pbkdf2/commit/941b46ba580918ec44bc0072b6ae0ecfa9fde277)
+
+## [v3.0.3](https://github.com/browserify/pbkdf2/compare/3.0.2...v3.0.3) - 2015-02-15
+
+### Commits
+
+- repo name [`a6516d9`](https://github.com/browserify/pbkdf2/commit/a6516d9fa34bb250c2ef6e0d75ef7e47b7c1b1a4)
+- change name [`471fb83`](https://github.com/browserify/pbkdf2/commit/471fb83c50fb1019b099fe9926fc28d3d25900e1)
+
+## [3.0.2](https://github.com/browserify/pbkdf2/compare/3.0.1...3.0.2) - 2015-02-15
+
+### Merged
+
+- fix bug in encoding [`#10`](https://github.com/browserify/pbkdf2/pull/10)
+
+### Commits
+
+- tests: add non-printable fixture handling and example fixture [`040707d`](https://github.com/browserify/pbkdf2/commit/040707da888f4eb7737dd671a3e0c71875b94b2b)
+- add 0.12 and iojs to travis [`45165c4`](https://github.com/browserify/pbkdf2/commit/45165c45bf2c1938431eed592eef5c087a43aa20)
+
+## [3.0.1](https://github.com/browserify/pbkdf2/compare/2.0.1...3.0.1) - 2015-01-29
+
+### Commits
+
+- modularize [`68c6c36`](https://github.com/browserify/pbkdf2/commit/68c6c36e4a0af2862274d0a8effc82d0650a546d)
+- all: standard cmpliance [`2f5ff3b`](https://github.com/browserify/pbkdf2/commit/2f5ff3ba739f84b2e51335c5f3cfacbf856bc587)
+- add shim [`386d4af`](https://github.com/browserify/pbkdf2/commit/386d4afd32b1ea3384cc175d3993ada757836e01)
+- add browser tests [`b88ad8d`](https://github.com/browserify/pbkdf2/commit/b88ad8d14ee02fefddb99f3b89c89ca51e90122f)
+- package: add coveralls and re-order [`5834697`](https://github.com/browserify/pbkdf2/commit/58346973b7d2e45b9bb313e159b43e05ab5024ae)
+- package: add standard test suite [`e504eed`](https://github.com/browserify/pbkdf2/commit/e504eed0a6e38846a752f9f49aa1b38ceb8dbd67)
+- package: update repository URL [`b217d1a`](https://github.com/browserify/pbkdf2/commit/b217d1ab6c153e9899cbd96b29653f7da308d444)
+- tests: remove unnecessary semicolon/vars [`24f8ab3`](https://github.com/browserify/pbkdf2/commit/24f8ab3b5d1928f5b87f50aa357475cd5855b03d)
+- package: add coveralls [`c5b6d51`](https://github.com/browserify/pbkdf2/commit/c5b6d510bdbd5792b98e4d27daf94849c70b9d57)
+- index: remove unnecessary __pbkdf2Export [`e51121f`](https://github.com/browserify/pbkdf2/commit/e51121f46887e545fedd817ac8624e0d68c9ace5)
+- index: fix digest algorithm typo [`558b3dd`](https://github.com/browserify/pbkdf2/commit/558b3dd06bb17b782ee0c1994c5aed19624d4c3b)
+- README: update repository URL [`f1fc7b4`](https://github.com/browserify/pbkdf2/commit/f1fc7b448f93e21a23bfe40f39670129f2ff31d6)
+- package: latest devDependencies [`9624836`](https://github.com/browserify/pbkdf2/commit/9624836014c4976f8907273a4a77020b51a4fe8c)
+- package: use latest create-hmac [`ffd5b94`](https://github.com/browserify/pbkdf2/commit/ffd5b943434dc78a36858f0bd61399aba6176617)
+- package: update description [`7fbec99`](https://github.com/browserify/pbkdf2/commit/7fbec99bfc993d01161aae4c4b00c3718a8737f4)
+
+## [2.0.1](https://github.com/browserify/pbkdf2/compare/2.0.0...2.0.1) - 2014-09-25
+
+### Merged
+
+- move istanbul to dev dependencies [`#1`](https://github.com/browserify/pbkdf2/pull/1)
+
+## [2.0.0](https://github.com/browserify/pbkdf2/compare/1.0.1...2.0.0) - 2014-09-24
+
+### Commits
+
+- pbkdf2: add async impl. and invalid tests [`16d209e`](https://github.com/browserify/pbkdf2/commit/16d209ecd2e997ca775f32b47b8c2318a55ecdd8)
+- README: update to latest API [`c2f01cf`](https://github.com/browserify/pbkdf2/commit/c2f01cf719063975dd943d8f6c280896f1c0958d)
+- index: re-order var declarations [`8ad010d`](https://github.com/browserify/pbkdf2/commit/8ad010d6ad5869b06ec9a8c0d80650c9b517da7f)
+
+## 1.0.1 - 2014-09-17
+
+### Commits
+
+- index: adds implementation [`1792996`](https://github.com/browserify/pbkdf2/commit/1792996f8f967ff5297990c498338b6790fc8a8b)
+- fixtures: adds test fixtures [`33e999e`](https://github.com/browserify/pbkdf2/commit/33e999e8630ce967adc28f64462bdc98b5ab5a47)
+- Initial commit [`f17b827`](https://github.com/browserify/pbkdf2/commit/f17b827efadd65634ab2f98de538b05ec526d959)
+- package: adds package.json [`2782f71`](https://github.com/browserify/pbkdf2/commit/2782f7152d283c709e4700bf473f15069adcd5c5)
+- README: add badges + usage instructions [`51ac17d`](https://github.com/browserify/pbkdf2/commit/51ac17db44d4b7e0b1bfc5995123dc5b2d031bc6)
+- index: adhere to node.js spec [`98ec635`](https://github.com/browserify/pbkdf2/commit/98ec635aa4d0d4909048483de4080a19b86b45f4)
+- travis: adds yml [`965f37f`](https://github.com/browserify/pbkdf2/commit/965f37fb409f1daffd01fad353bd923ed0aa2b2d)
+- README: add credits [`aa9ac2f`](https://github.com/browserify/pbkdf2/commit/aa9ac2f38e74a834500ec1fdaa7fe14ca976b26d)
+- README: no need for there [`0f6c37f`](https://github.com/browserify/pbkdf2/commit/0f6c37f10924fc3ceb8b2bf4074508e559454feb)
diff --git a/node_modules/pbkdf2/LICENSE b/node_modules/pbkdf2/LICENSE
new file mode 100644
index 0000000000000000000000000000000000000000..a115b524273d9f160d142069ca51ec0d0f658ff5
--- /dev/null
+++ b/node_modules/pbkdf2/LICENSE
@@ -0,0 +1,21 @@
+The MIT License (MIT)
+
+Copyright (c) 2014 Daniel Cousens
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
diff --git a/node_modules/pbkdf2/README.md b/node_modules/pbkdf2/README.md
new file mode 100644
index 0000000000000000000000000000000000000000..230bab645b02dda72d2d19635cb0f456c8dd3bf5
--- /dev/null
+++ b/node_modules/pbkdf2/README.md
@@ -0,0 +1,48 @@
+# pbkdf2 [![Version Badge][2]][1]
+
+This library provides the functionality of PBKDF2 with the ability to use any supported hashing algorithm returned from `crypto.getHashes()`
+
+[![github actions][actions-image]][actions-url]
+[![coverage][codecov-image]][codecov-url]
+[![dependency status][5]][6]
+[![dev dependency status][7]][8]
+[![License][license-image]][license-url]
+[![Downloads][downloads-image]][downloads-url]
+
+[![npm badge][11]][1]
+
+## Usage
+
+```js
+var pbkdf2 = require('pbkdf2')
+var derivedKey = pbkdf2.pbkdf2Sync('password', 'salt', 1, 32, 'sha512')
+
+...
+```
+
+For more information on the API, please see the relevant [Node documentation](https://nodejs.org/api/crypto.html#crypto_crypto_pbkdf2_password_salt_iterations_keylen_digest_callback).
+
+For high performance, use the `async` variant (`pbkdf2.pbkdf2`), not `pbkdf2.pbkdf2Sync`; this variant has the oppurtunity to use `window.crypto.subtle` when browserified.
+
+
+## Credits
+
+This module is a derivative of [cryptocoinjs/pbkdf2-sha256](https://github.com/cryptocoinjs/pbkdf2-sha256/), so thanks to [JP Richardson](https://github.com/jprichardson/) for laying the ground work.
+
+Thank you to [FangDun Cai](https://github.com/fundon) for donating the package name on npm, if you're looking for his previous module it is located at [fundon/pbkdf2](https://github.com/fundon/pbkdf2).
+
+[1]: https://npmjs.org/package/pbkdf2
+[2]: https://versionbadg.es/browserify/pbkdf2.svg
+[5]: https://david-dm.org/browserify/pbkdf2.svg
+[6]: https://david-dm.org/browserify/pbkdf2
+[7]: https://david-dm.org/browserify/pbkdf2/dev-status.svg
+[8]: https://david-dm.org/browserify/pbkdf2#info=devDependencies
+[11]: https://nodei.co/npm/pbkdf2.png?downloads=true&stars=true
+[license-image]: https://img.shields.io/npm/l/pbkdf2.svg
+[license-url]: LICENSE
+[downloads-image]: https://img.shields.io/npm/dm/pbkdf2.svg
+[downloads-url]: https://npm-stat.com/charts.html?package=pbkdf2
+[codecov-image]: https://codecov.io/gh/browserify/pbkdf2/branch/main/graphs/badge.svg
+[codecov-url]: https://app.codecov.io/gh/browserify/pbkdf2/
+[actions-image]: https://img.shields.io/endpoint?url=https://github-actions-badge-u3jn4tfpocch.runkit.sh/browserify/pbkdf2
+[actions-url]: https://github.com/browserify/pbkdf2/actions
diff --git a/node_modules/pbkdf2/browser.js b/node_modules/pbkdf2/browser.js
new file mode 100644
index 0000000000000000000000000000000000000000..9ac8ba077a8a41a18ec67b0327f0011bea6ede26
--- /dev/null
+++ b/node_modules/pbkdf2/browser.js
@@ -0,0 +1,4 @@
+'use strict';
+
+exports.pbkdf2 = require('./lib/async');
+exports.pbkdf2Sync = require('./lib/sync');
diff --git a/node_modules/pbkdf2/index.js b/node_modules/pbkdf2/index.js
new file mode 100644
index 0000000000000000000000000000000000000000..5b6c0bb0cf508be8abcdadc464e28bf12d1e2203
--- /dev/null
+++ b/node_modules/pbkdf2/index.js
@@ -0,0 +1,43 @@
+'use strict';
+
+var nativeImpl = require('crypto');
+
+var checkParameters = require('./lib/precondition');
+var defaultEncoding = require('./lib/default-encoding');
+var toBuffer = require('./lib/to-buffer');
+
+function nativePBKDF2(password, salt, iterations, keylen, digest, callback) {
+ checkParameters(iterations, keylen);
+ password = toBuffer(password, defaultEncoding, 'Password');
+ salt = toBuffer(salt, defaultEncoding, 'Salt');
+
+ if (typeof digest === 'function') {
+ callback = digest;
+ digest = 'sha1';
+ }
+ if (typeof callback !== 'function') {
+ throw new Error('No callback provided to pbkdf2');
+ }
+
+ return nativeImpl.pbkdf2(password, salt, iterations, keylen, digest, callback);
+}
+
+function nativePBKDF2Sync(password, salt, iterations, keylen, digest) {
+ checkParameters(iterations, keylen);
+ password = toBuffer(password, defaultEncoding, 'Password');
+ salt = toBuffer(salt, defaultEncoding, 'Salt');
+ digest = digest || 'sha1';
+ return nativeImpl.pbkdf2Sync(password, salt, iterations, keylen, digest);
+}
+
+/* istanbul ignore next */
+if (!nativeImpl.pbkdf2Sync || nativeImpl.pbkdf2Sync.toString().indexOf('keylen, digest') === -1) {
+ /* eslint global-require: 0 */
+ exports.pbkdf2Sync = require('./lib/sync');
+ exports.pbkdf2 = require('./lib/async');
+
+// native
+} else {
+ exports.pbkdf2Sync = nativePBKDF2Sync;
+ exports.pbkdf2 = nativePBKDF2;
+}
diff --git a/node_modules/pbkdf2/lib/async.js b/node_modules/pbkdf2/lib/async.js
new file mode 100644
index 0000000000000000000000000000000000000000..21aee16a4ec35f2ab1badfdb98c1ea2acd956616
--- /dev/null
+++ b/node_modules/pbkdf2/lib/async.js
@@ -0,0 +1,122 @@
+'use strict';
+
+var Buffer = require('safe-buffer').Buffer;
+
+var checkParameters = require('./precondition');
+var defaultEncoding = require('./default-encoding');
+var sync = require('./sync');
+var toBuffer = require('./to-buffer');
+
+var ZERO_BUF;
+var subtle = global.crypto && global.crypto.subtle;
+var toBrowser = {
+ sha: 'SHA-1',
+ 'sha-1': 'SHA-1',
+ sha1: 'SHA-1',
+ sha256: 'SHA-256',
+ 'sha-256': 'SHA-256',
+ sha384: 'SHA-384',
+ 'sha-384': 'SHA-384',
+ 'sha-512': 'SHA-512',
+ sha512: 'SHA-512'
+};
+var checks = [];
+var nextTick;
+function getNextTick() {
+ if (nextTick) {
+ return nextTick;
+ }
+ if (global.process && global.process.nextTick) {
+ nextTick = global.process.nextTick;
+ } else if (global.queueMicrotask) {
+ nextTick = global.queueMicrotask;
+ } else if (global.setImmediate) {
+ nextTick = global.setImmediate;
+ } else {
+ nextTick = global.setTimeout;
+ }
+ return nextTick;
+}
+function browserPbkdf2(password, salt, iterations, length, algo) {
+ return subtle.importKey('raw', password, { name: 'PBKDF2' }, false, ['deriveBits']).then(function (key) {
+ return subtle.deriveBits({
+ name: 'PBKDF2',
+ salt: salt,
+ iterations: iterations,
+ hash: {
+ name: algo
+ }
+ }, key, length << 3);
+ }).then(function (res) {
+ return Buffer.from(res);
+ });
+}
+function checkNative(algo) {
+ if (global.process && !global.process.browser) {
+ return Promise.resolve(false);
+ }
+ if (!subtle || !subtle.importKey || !subtle.deriveBits) {
+ return Promise.resolve(false);
+ }
+ if (checks[algo] !== undefined) {
+ return checks[algo];
+ }
+ ZERO_BUF = ZERO_BUF || Buffer.alloc(8);
+ var prom = browserPbkdf2(ZERO_BUF, ZERO_BUF, 10, 128, algo)
+ .then(
+ function () { return true; },
+ function () { return false; }
+ );
+ checks[algo] = prom;
+ return prom;
+}
+
+function resolvePromise(promise, callback) {
+ promise.then(function (out) {
+ getNextTick()(function () {
+ callback(null, out);
+ });
+ }, function (e) {
+ getNextTick()(function () {
+ callback(e);
+ });
+ });
+}
+module.exports = function (password, salt, iterations, keylen, digest, callback) {
+ if (typeof digest === 'function') {
+ callback = digest;
+ digest = undefined;
+ }
+
+ checkParameters(iterations, keylen);
+ password = toBuffer(password, defaultEncoding, 'Password');
+ salt = toBuffer(salt, defaultEncoding, 'Salt');
+ if (typeof callback !== 'function') {
+ throw new Error('No callback provided to pbkdf2');
+ }
+
+ digest = digest || 'sha1';
+ var algo = toBrowser[digest.toLowerCase()];
+
+ if (!algo || typeof global.Promise !== 'function') {
+ getNextTick()(function () {
+ var out;
+ try {
+ out = sync(password, salt, iterations, keylen, digest);
+ } catch (e) {
+ callback(e);
+ return;
+ }
+ callback(null, out);
+ });
+ return;
+ }
+
+ resolvePromise(checkNative(algo).then(function (resp) {
+ if (resp) {
+ return browserPbkdf2(password, salt, iterations, keylen, algo);
+ }
+
+ return sync(password, salt, iterations, keylen, digest);
+ }), callback);
+};
diff --git a/node_modules/pbkdf2/lib/default-encoding.js b/node_modules/pbkdf2/lib/default-encoding.js
new file mode 100644
index 0000000000000000000000000000000000000000..beb4efaedb41f26465a4df25580273d4a9bd420f
--- /dev/null
+++ b/node_modules/pbkdf2/lib/default-encoding.js
@@ -0,0 +1,14 @@
+'use strict';
+
+var defaultEncoding;
+/* istanbul ignore next */
+if (global.process && global.process.browser) {
+ defaultEncoding = 'utf-8';
+} else if (global.process && global.process.version) {
+ var pVersionMajor = parseInt(process.version.split('.')[0].slice(1), 10);
+
+ defaultEncoding = pVersionMajor >= 6 ? 'utf-8' : 'binary';
+} else {
+ defaultEncoding = 'utf-8';
+}
+module.exports = defaultEncoding;
diff --git a/node_modules/pbkdf2/lib/precondition.js b/node_modules/pbkdf2/lib/precondition.js
new file mode 100644
index 0000000000000000000000000000000000000000..1274dbb8fd935ba3fe6aae05cc92025e5af00c71
--- /dev/null
+++ b/node_modules/pbkdf2/lib/precondition.js
@@ -0,0 +1,22 @@
+'use strict';
+
+var $isFinite = isFinite;
+var MAX_ALLOC = Math.pow(2, 30) - 1; // default in iojs
+
+module.exports = function (iterations, keylen) {
+ if (typeof iterations !== 'number') {
+ throw new TypeError('Iterations not a number');
+ }
+
+ if (iterations < 0 || !$isFinite(iterations)) {
+ throw new TypeError('Bad iterations');
+ }
+
+ if (typeof keylen !== 'number') {
+ throw new TypeError('Key length not a number');
+ }
+
+ if (keylen < 0 || keylen > MAX_ALLOC || keylen !== keylen) { /* eslint no-self-compare: 0 */
+ throw new TypeError('Bad key length');
+ }
+};
diff --git a/node_modules/pbkdf2/lib/sync-browser.js b/node_modules/pbkdf2/lib/sync-browser.js
new file mode 100644
index 0000000000000000000000000000000000000000..5dbdb6e1e372021b920959f06ed380ed1ebcca3d
--- /dev/null
+++ b/node_modules/pbkdf2/lib/sync-browser.js
@@ -0,0 +1,131 @@
+'use strict';
+
+var md5 = require('create-hash/md5');
+var RIPEMD160 = require('ripemd160');
+var sha = require('sha.js');
+var Buffer = require('safe-buffer').Buffer;
+
+var checkParameters = require('./precondition');
+var defaultEncoding = require('./default-encoding');
+var toBuffer = require('./to-buffer');
+
+var ZEROS = Buffer.alloc(128);
+var sizes = {
+ __proto__: null,
+ md5: 16,
+ sha1: 20,
+ sha224: 28,
+ sha256: 32,
+ sha384: 48,
+ sha512: 64,
+ 'sha512-256': 32,
+ ripemd160: 20,
+ rmd160: 20
+};
+
+var mapping = {
+ __proto__: null,
+ 'sha-1': 'sha1',
+ 'sha-224': 'sha224',
+ 'sha-256': 'sha256',
+ 'sha-384': 'sha384',
+ 'sha-512': 'sha512',
+ 'ripemd-160': 'ripemd160'
+};
+
+function rmd160Func(data) {
+ return new RIPEMD160().update(data).digest();
+}
+
+function getDigest(alg) {
+ function shaFunc(data) {
+ return sha(alg).update(data).digest();
+ }
+
+ if (alg === 'rmd160' || alg === 'ripemd160') {
+ return rmd160Func;
+ }
+ if (alg === 'md5') {
+ return md5;
+ }
+ return shaFunc;
+}
+
+function Hmac(alg, key, saltLen) {
+ var hash = getDigest(alg);
+ var blocksize = alg === 'sha512' || alg === 'sha384' ? 128 : 64;
+
+ if (key.length > blocksize) {
+ key = hash(key);
+ } else if (key.length < blocksize) {
+ key = Buffer.concat([key, ZEROS], blocksize);
+ }
+
+ var ipad = Buffer.allocUnsafe(blocksize + sizes[alg]);
+ var opad = Buffer.allocUnsafe(blocksize + sizes[alg]);
+ for (var i = 0; i < blocksize; i++) {
+ ipad[i] = key[i] ^ 0x36;
+ opad[i] = key[i] ^ 0x5C;
+ }
+
+ var ipad1 = Buffer.allocUnsafe(blocksize + saltLen + 4);
+ ipad.copy(ipad1, 0, 0, blocksize);
+ this.ipad1 = ipad1;
+ this.ipad2 = ipad;
+ this.opad = opad;
+ this.alg = alg;
+ this.blocksize = blocksize;
+ this.hash = hash;
+ this.size = sizes[alg];
+}
+
+Hmac.prototype.run = function (data, ipad) {
+ data.copy(ipad, this.blocksize);
+ var h = this.hash(ipad);
+ h.copy(this.opad, this.blocksize);
+ return this.hash(this.opad);
+};
+
+function pbkdf2(password, salt, iterations, keylen, digest) {
+ checkParameters(iterations, keylen);
+ password = toBuffer(password, defaultEncoding, 'Password');
+ salt = toBuffer(salt, defaultEncoding, 'Salt');
+
+ var lowerDigest = (digest || 'sha1').toLowerCase();
+ var mappedDigest = mapping[lowerDigest] || lowerDigest;
+ var size = sizes[mappedDigest];
+ if (typeof size !== 'number' || !size) {
+ throw new TypeError('Digest algorithm not supported: ' + digest);
+ }
+
+ var hmac = new Hmac(mappedDigest, password, salt.length);
+
+ var DK = Buffer.allocUnsafe(keylen);
+ var block1 = Buffer.allocUnsafe(salt.length + 4);
+ salt.copy(block1, 0, 0, salt.length);
+
+ var destPos = 0;
+ var hLen = size;
+ var l = Math.ceil(keylen / hLen);
+
+ for (var i = 1; i <= l; i++) {
+ block1.writeUInt32BE(i, salt.length);
+
+ var T = hmac.run(block1, hmac.ipad1);
+ var U = T;
+
+ for (var j = 1; j < iterations; j++) {
+ U = hmac.run(U, hmac.ipad2);
+ for (var k = 0; k < hLen; k++) {
+ T[k] ^= U[k];
+ }
+ }
+
+ T.copy(DK, destPos);
+ destPos += hLen;
+ }
+
+ return DK;
+}
+
+module.exports = pbkdf2;
diff --git a/node_modules/pbkdf2/lib/sync.js b/node_modules/pbkdf2/lib/sync.js
new file mode 100644
index 0000000000000000000000000000000000000000..a0c322a2f0c9c16e88bc24cb0debc15db19d0a47
--- /dev/null
+++ b/node_modules/pbkdf2/lib/sync.js
@@ -0,0 +1,73 @@
+'use strict';
+
+var sizes = {
+ __proto__: null,
+ md5: 16,
+ sha1: 20,
+ sha224: 28,
+ sha256: 32,
+ sha384: 48,
+ sha512: 64,
+ 'sha512-256': 32,
+ rmd160: 20,
+ ripemd160: 20
+};
+
+var mapping = {
+ __proto__: null,
+ 'sha-1': 'sha1',
+ 'sha-224': 'sha224',
+ 'sha-256': 'sha256',
+ 'sha-384': 'sha384',
+ 'sha-512': 'sha512',
+ 'ripemd-160': 'ripemd160'
+};
+
+var createHmac = require('create-hmac');
+var Buffer = require('safe-buffer').Buffer;
+
+var checkParameters = require('./precondition');
+var defaultEncoding = require('./default-encoding');
+var toBuffer = require('./to-buffer');
+
+function pbkdf2(password, salt, iterations, keylen, digest) {
+ checkParameters(iterations, keylen);
+ password = toBuffer(password, defaultEncoding, 'Password');
+ salt = toBuffer(salt, defaultEncoding, 'Salt');
+
+ var lowerDigest = (digest || 'sha1').toLowerCase();
+ var mappedDigest = mapping[lowerDigest] || lowerDigest;
+ var size = sizes[mappedDigest];
+ if (typeof size !== 'number' || !size) {
+ throw new TypeError('Digest algorithm not supported: ' + digest);
+ }
+
+ var DK = Buffer.allocUnsafe(keylen);
+ var block1 = Buffer.allocUnsafe(salt.length + 4);
+ salt.copy(block1, 0, 0, salt.length);
+
+ var destPos = 0;
+ var hLen = size;
+ var l = Math.ceil(keylen / hLen);
+
+ for (var i = 1; i <= l; i++) {
+ block1.writeUInt32BE(i, salt.length);
+
+ var T = createHmac(mappedDigest, password).update(block1).digest();
+ var U = T;
+
+ for (var j = 1; j < iterations; j++) {
+ U = createHmac(mappedDigest, password).update(U).digest();
+ for (var k = 0; k < hLen; k++) {
+ T[k] ^= U[k];
+ }
+ }
+
+ T.copy(DK, destPos);
+ destPos += hLen;
+ }
+
+ return DK;
+}
+
+module.exports = pbkdf2;
diff --git a/node_modules/pbkdf2/lib/to-buffer.js b/node_modules/pbkdf2/lib/to-buffer.js
new file mode 100644
index 0000000000000000000000000000000000000000..5f83afe11b77ca68b3606aefea96c501ca1ce470
--- /dev/null
+++ b/node_modules/pbkdf2/lib/to-buffer.js
@@ -0,0 +1,20 @@
+'use strict';
+
+var Buffer = require('safe-buffer').Buffer;
+var toBuffer = require('to-buffer');
+
+var useUint8Array = typeof Uint8Array !== 'undefined';
+var useArrayBuffer = useUint8Array && typeof ArrayBuffer !== 'undefined';
+var isView = useArrayBuffer && ArrayBuffer.isView;
+
+module.exports = function (thing, encoding, name) {
+ if (
+ typeof thing === 'string'
+ || Buffer.isBuffer(thing)
+ || (useUint8Array && thing instanceof Uint8Array)
+ || (isView && isView(thing))
+ ) {
+ return toBuffer(thing, encoding);
+ }
+ throw new TypeError(name + ' must be a string, a Buffer, a Uint8Array, or a DataView');
+};
diff --git a/node_modules/pbkdf2/package.json b/node_modules/pbkdf2/package.json
new file mode 100644
index 0000000000000000000000000000000000000000..a24e1a06ef7b68899f9d1366b42b592873638d57
--- /dev/null
+++ b/node_modules/pbkdf2/package.json
@@ -0,0 +1,77 @@
+{
+ "name": "pbkdf2",
+ "version": "3.1.5",
+ "description": "This library provides the functionality of PBKDF2 with the ability to use any supported hashing algorithm returned from crypto.getHashes()",
+ "keywords": [
+ "pbkdf2",
+ "kdf",
+ "salt",
+ "hash"
+ ],
+ "homepage": "https://github.com/browserify/pbkdf2",
+ "bugs": {
+ "url": "https://github.com/browserify/pbkdf2/issues"
+ },
+ "license": "MIT",
+ "author": "Daniel Cousens",
+ "browser": {
+ "./index.js": "./browser.js",
+ "./lib/sync.js": "./lib/sync-browser.js"
+ },
+ "main": "index.js",
+ "repository": {
+ "type": "git",
+ "url": "https://github.com/browserify/pbkdf2.git"
+ },
+ "scripts": {
+ "prepack": "npmignore --auto --commentLines=autogenerated",
+ "lint": "eslint --ext=js,mjs .",
+ "pretest": "npm run lint",
+ "tests-only": "nyc tape test/index.js",
+ "test": "npm run tests-only && npm run bundle-test",
+ "posttest": "npx npm@\">= 10.2\" audit --production",
+ "bundle-test": "browserify test/index.js > test/bundle.js",
+ "bench": "node bench/",
+ "version": "auto-changelog && git add CHANGELOG.md",
+ "postversion": "auto-changelog && git add CHANGELOG.md && git commit --no-edit --amend && git tag -f \"v$(node -e \"console.log(require('./package.json').version)\")\""
+ },
+ "devDependencies": {
+ "@ljharb/eslint-config": "^21.2.0",
+ "auto-changelog": "^2.5.0",
+ "benchmark": "^2.1.4",
+ "browserify": "^17.0.1",
+ "encoding": "^0.1.13",
+ "eslint": "=8.8.0",
+ "npmignore": "^0.3.1",
+ "nyc": "^10.3.2",
+ "object.assign": "^4.1.7",
+ "semver": "^6.3.1",
+ "tape": "^5.9.0"
+ },
+ "dependencies": {
+ "create-hash": "^1.2.0",
+ "create-hmac": "^1.1.7",
+ "ripemd160": "^2.0.3",
+ "safe-buffer": "^5.2.1",
+ "sha.js": "^2.4.12",
+ "to-buffer": "^1.2.1"
+ },
+ "engines": {
+ "node": ">= 0.10"
+ },
+ "auto-changelog": {
+ "output": "CHANGELOG.md",
+ "template": "keepachangelog",
+ "unreleased": false,
+ "commitLimit": false,
+ "backfillLimit": false,
+ "hideCredit": true
+ },
+ "publishConfig": {
+ "ignore": [
+ ".github/workflows",
+ "bench",
+ "test"
+ ]
+ }
+}
diff --git a/node_modules/performance-now/.npmignore b/node_modules/performance-now/.npmignore
new file mode 100644
index 0000000000000000000000000000000000000000..496ee2ca6a2f08396a4076fe43dedf3dc0da8b6d
--- /dev/null
+++ b/node_modules/performance-now/.npmignore
@@ -0,0 +1 @@
+.DS_Store
\ No newline at end of file
diff --git a/node_modules/performance-now/.tm_properties b/node_modules/performance-now/.tm_properties
new file mode 100644
index 0000000000000000000000000000000000000000..4b8eb3f610c314ba7f7c605047b70692d648ffce
--- /dev/null
+++ b/node_modules/performance-now/.tm_properties
@@ -0,0 +1,7 @@
+excludeDirectories = "{.git,node_modules}"
+excludeInFolderSearch = "{excludeDirectories,lib}"
+
+includeFiles = "{.gitignore,.npmignore,.travis.yml}"
+
+[ attr.untitled ]
+fileType = 'source.coffee'
\ No newline at end of file
diff --git a/node_modules/performance-now/.travis.yml b/node_modules/performance-now/.travis.yml
new file mode 100644
index 0000000000000000000000000000000000000000..1543c1990eb9ed35b8f9c8cb3fc3d5026616179e
--- /dev/null
+++ b/node_modules/performance-now/.travis.yml
@@ -0,0 +1,6 @@
+language: node_js
+node_js:
+ - "node"
+ - "6"
+ - "4"
+ - "0.12"
diff --git a/node_modules/performance-now/README.md b/node_modules/performance-now/README.md
new file mode 100644
index 0000000000000000000000000000000000000000..28080f856aa21296b6ac8749704fec106bf247f8
--- /dev/null
+++ b/node_modules/performance-now/README.md
@@ -0,0 +1,30 @@
+# performance-now [](https://travis-ci.org/braveg1rl/performance-now) [](https://david-dm.org/braveg1rl/performance-now)
+
+Implements a function similar to `performance.now` (based on `process.hrtime`).
+
+Modern browsers have a `window.performance` object with - among others - a `now` method which gives time in milliseconds, but with sub-millisecond precision. This module offers the same function based on the Node.js native `process.hrtime` function.
+
+Using `process.hrtime` means that the reported time will be monotonically increasing, and not subject to clock-drift.
+
+According to the [High Resolution Time specification](http://www.w3.org/TR/hr-time/), the number of milliseconds reported by `performance.now` should be relative to the value of `performance.timing.navigationStart`.
+
+In the current version of the module (2.0) the reported time is relative to the time the current Node process has started (inferred from `process.uptime()`).
+
+Version 1.0 reported a different time. The reported time was relative to the time the module was loaded (i.e. the time it was first `require`d). If you need this functionality, version 1.0 is still available on NPM.
+
+## Example usage
+
+```javascript
+var now = require("performance-now")
+var start = now()
+var end = now()
+console.log(start.toFixed(3)) // the number of milliseconds the current node process is running
+console.log((start-end).toFixed(3)) // ~ 0.002 on my system
+```
+
+Running the now function two times right after each other yields a time difference of a few microseconds. Given this overhead, I think it's best to assume that the precision of intervals computed with this method is not higher than 10 microseconds, if you don't know the exact overhead on your own system.
+
+## License
+
+performance-now is released under the [MIT License](http://opensource.org/licenses/MIT).
+Copyright (c) 2017 Braveg1rl
diff --git a/node_modules/performance-now/lib/performance-now.js b/node_modules/performance-now/lib/performance-now.js
new file mode 100644
index 0000000000000000000000000000000000000000..37f569da1e066b6547d72c778564d6f9073faeb5
--- /dev/null
+++ b/node_modules/performance-now/lib/performance-now.js
@@ -0,0 +1,36 @@
+// Generated by CoffeeScript 1.12.2
+(function() {
+ var getNanoSeconds, hrtime, loadTime, moduleLoadTime, nodeLoadTime, upTime;
+
+ if ((typeof performance !== "undefined" && performance !== null) && performance.now) {
+ module.exports = function() {
+ return performance.now();
+ };
+ } else if ((typeof process !== "undefined" && process !== null) && process.hrtime) {
+ module.exports = function() {
+ return (getNanoSeconds() - nodeLoadTime) / 1e6;
+ };
+ hrtime = process.hrtime;
+ getNanoSeconds = function() {
+ var hr;
+ hr = hrtime();
+ return hr[0] * 1e9 + hr[1];
+ };
+ moduleLoadTime = getNanoSeconds();
+ upTime = process.uptime() * 1e9;
+ nodeLoadTime = moduleLoadTime - upTime;
+ } else if (Date.now) {
+ module.exports = function() {
+ return Date.now() - loadTime;
+ };
+ loadTime = Date.now();
+ } else {
+ module.exports = function() {
+ return new Date().getTime() - loadTime;
+ };
+ loadTime = new Date().getTime();
+ }
+
+}).call(this);
+
+//# sourceMappingURL=performance-now.js.map
diff --git a/node_modules/performance-now/lib/performance-now.js.map b/node_modules/performance-now/lib/performance-now.js.map
new file mode 100644
index 0000000000000000000000000000000000000000..bef83626d876dd4f344dd4467a678dbfaa4d0a14
--- /dev/null
+++ b/node_modules/performance-now/lib/performance-now.js.map
@@ -0,0 +1,10 @@
+{
+ "version": 3,
+ "file": "performance-now.js",
+ "sourceRoot": "..",
+ "sources": [
+ "src/performance-now.coffee"
+ ],
+ "names": [],
+ "mappings": ";AAAA;AAAA,MAAA;;EAAA,IAAG,4DAAA,IAAiB,WAAW,CAAC,GAAhC;IACE,MAAM,CAAC,OAAP,GAAiB,SAAA;aAAG,WAAW,CAAC,GAAZ,CAAA;IAAH,EADnB;GAAA,MAEK,IAAG,oDAAA,IAAa,OAAO,CAAC,MAAxB;IACH,MAAM,CAAC,OAAP,GAAiB,SAAA;aAAG,CAAC,cAAA,CAAA,CAAA,GAAmB,YAApB,CAAA,GAAoC;IAAvC;IACjB,MAAA,GAAS,OAAO,CAAC;IACjB,cAAA,GAAiB,SAAA;AACf,UAAA;MAAA,EAAA,GAAK,MAAA,CAAA;aACL,EAAG,CAAA,CAAA,CAAH,GAAQ,GAAR,GAAc,EAAG,CAAA,CAAA;IAFF;IAGjB,cAAA,GAAiB,cAAA,CAAA;IACjB,MAAA,GAAS,OAAO,CAAC,MAAR,CAAA,CAAA,GAAmB;IAC5B,YAAA,GAAe,cAAA,GAAiB,OAR7B;GAAA,MASA,IAAG,IAAI,CAAC,GAAR;IACH,MAAM,CAAC,OAAP,GAAiB,SAAA;aAAG,IAAI,CAAC,GAAL,CAAA,CAAA,GAAa;IAAhB;IACjB,QAAA,GAAW,IAAI,CAAC,GAAL,CAAA,EAFR;GAAA,MAAA;IAIH,MAAM,CAAC,OAAP,GAAiB,SAAA;aAAO,IAAA,IAAA,CAAA,CAAM,CAAC,OAAP,CAAA,CAAJ,GAAuB;IAA1B;IACjB,QAAA,GAAe,IAAA,IAAA,CAAA,CAAM,CAAC,OAAP,CAAA,EALZ;;AAXL"
+}
\ No newline at end of file
diff --git a/node_modules/performance-now/license.txt b/node_modules/performance-now/license.txt
new file mode 100644
index 0000000000000000000000000000000000000000..0bf51b460fc2e7f380ff5826c968e26ed749ffd2
--- /dev/null
+++ b/node_modules/performance-now/license.txt
@@ -0,0 +1,7 @@
+Copyright (c) 2013 Braveg1rl
+
+Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
\ No newline at end of file
diff --git a/node_modules/performance-now/package.json b/node_modules/performance-now/package.json
new file mode 100644
index 0000000000000000000000000000000000000000..962bfc85ff8fe11cedee32dfbbc684a2d10f68c9
--- /dev/null
+++ b/node_modules/performance-now/package.json
@@ -0,0 +1,35 @@
+{
+ "name": "performance-now",
+ "description": "Implements performance.now (based on process.hrtime).",
+ "keywords": [],
+ "version": "2.1.0",
+ "author": "Braveg1rl ",
+ "license": "MIT",
+ "homepage": "https://github.com/braveg1rl/performance-now",
+ "bugs": "https://github.com/braveg1rl/performance-now/issues",
+ "repository": {
+ "type": "git",
+ "url": "git://github.com/braveg1rl/performance-now.git"
+ },
+ "private": false,
+ "dependencies": {},
+ "devDependencies": {
+ "bluebird": "^3.4.7",
+ "call-delayed": "^1.0.0",
+ "chai": "^3.5.0",
+ "chai-increasing": "^1.2.0",
+ "coffee-script": "~1.12.2",
+ "mocha": "~3.2.0",
+ "pre-commit": "^1.2.2"
+ },
+ "optionalDependencies": {},
+ "main": "lib/performance-now.js",
+ "scripts": {
+ "build": "mkdir -p lib && rm -rf lib/* && node_modules/.bin/coffee --compile -m --output lib/ src/",
+ "prepublish": "npm test",
+ "pretest": "npm run build",
+ "test": "node_modules/.bin/mocha",
+ "watch": "node_modules/.bin/coffee --watch --compile --output lib/ src/"
+ },
+ "typings": "src/index.d.ts"
+}
diff --git a/node_modules/performance-now/src/index.d.ts b/node_modules/performance-now/src/index.d.ts
new file mode 100644
index 0000000000000000000000000000000000000000..68dca8eddc83ca54a43a8c9779005825381977f7
--- /dev/null
+++ b/node_modules/performance-now/src/index.d.ts
@@ -0,0 +1,8 @@
+// This file describes the package to typescript.
+
+/**
+ * Returns the number of milliseconds since the page was loaded (if browser)
+ * or the node process was started.
+ */
+declare function now(): number;
+export = now;
diff --git a/node_modules/performance-now/src/performance-now.coffee b/node_modules/performance-now/src/performance-now.coffee
new file mode 100644
index 0000000000000000000000000000000000000000..a8e075a40feda90dba21f70a8bfed1984d361773
--- /dev/null
+++ b/node_modules/performance-now/src/performance-now.coffee
@@ -0,0 +1,17 @@
+if performance? and performance.now
+ module.exports = -> performance.now()
+else if process? and process.hrtime
+ module.exports = -> (getNanoSeconds() - nodeLoadTime) / 1e6
+ hrtime = process.hrtime
+ getNanoSeconds = ->
+ hr = hrtime()
+ hr[0] * 1e9 + hr[1]
+ moduleLoadTime = getNanoSeconds()
+ upTime = process.uptime() * 1e9
+ nodeLoadTime = moduleLoadTime - upTime
+else if Date.now
+ module.exports = -> Date.now() - loadTime
+ loadTime = Date.now()
+else
+ module.exports = -> new Date().getTime() - loadTime
+ loadTime = new Date().getTime()
diff --git a/node_modules/performance-now/test/mocha.opts b/node_modules/performance-now/test/mocha.opts
new file mode 100644
index 0000000000000000000000000000000000000000..55d8492707f336c48ef2b40e62a6953a1e141df2
--- /dev/null
+++ b/node_modules/performance-now/test/mocha.opts
@@ -0,0 +1,3 @@
+--require coffee-script/register
+--compilers coffee:coffee-script/register
+--reporter spec
\ No newline at end of file
diff --git a/node_modules/performance-now/test/performance-now.coffee b/node_modules/performance-now/test/performance-now.coffee
new file mode 100644
index 0000000000000000000000000000000000000000..c99e95cd2cb860d32f6d8ec7f96e2b476bef68fd
--- /dev/null
+++ b/node_modules/performance-now/test/performance-now.coffee
@@ -0,0 +1,43 @@
+chai = require "chai"
+chai.use(require "chai-increasing")
+{assert,expect} = chai
+Bluebird = require "bluebird"
+
+now = require "../"
+
+getUptime = -> process.uptime() * 1e3
+
+describe "now", ->
+ it "reported time differs at most 1ms from a freshly reported uptime", ->
+ assert.isAtMost Math.abs(now()-getUptime()), 1
+
+ it "two subsequent calls return an increasing number", ->
+ assert.isBelow now(), now()
+
+ it "has less than 10 microseconds overhead", ->
+ assert.isBelow Math.abs(now() - now()), 0.010
+
+ it "can be called 1 million times in under 1 second (averaging under 1 microsecond per call)", ->
+ @timeout 1000
+ now() for [0...1e6]
+ undefined
+
+ it "for 10,000 numbers, number n is never bigger than number n-1", ->
+ stamps = (now() for [1...10000])
+ expect(stamps).to.be.increasing
+
+ it "shows that at least 0.2 ms has passed after a timeout of 1 ms", ->
+ earlier = now()
+ Bluebird.resolve().delay(1).then -> assert.isAbove (now()-earlier), 0.2
+
+ it "shows that at most 3 ms has passed after a timeout of 1 ms", ->
+ earlier = now()
+ Bluebird.resolve().delay(1).then -> assert.isBelow (now()-earlier), 3
+
+ it "shows that at least 190ms ms has passed after a timeout of 200ms", ->
+ earlier = now()
+ Bluebird.resolve().delay(200).then -> assert.isAbove (now()-earlier), 190
+
+ it "shows that at most 220 ms has passed after a timeout of 200ms", ->
+ earlier = now()
+ Bluebird.resolve().delay(200).then -> assert.isBelow (now()-earlier), 220
diff --git a/node_modules/performance-now/test/scripts.coffee b/node_modules/performance-now/test/scripts.coffee
new file mode 100644
index 0000000000000000000000000000000000000000..16312f185c844560eb8ec02ebdfef95b3a81b9f9
--- /dev/null
+++ b/node_modules/performance-now/test/scripts.coffee
@@ -0,0 +1,27 @@
+Bluebird = require "bluebird"
+exec = require("child_process").execSync
+{assert} = require "chai"
+
+describe "scripts/initital-value.coffee (module.uptime(), expressed in milliseconds)", ->
+ result = exec("./test/scripts/initial-value.coffee").toString().trim()
+ it "printed #{result}", ->
+ it "printed a value above 100", -> assert.isAbove result, 100
+ it "printed a value below 350", -> assert.isBelow result, 350
+
+describe "scripts/delayed-require.coffee (sum of uptime and 250 ms delay`)", ->
+ result = exec("./test/scripts/delayed-require.coffee").toString().trim()
+ it "printed #{result}", ->
+ it "printed a value above 350", -> assert.isAbove result, 350
+ it "printed a value below 600", -> assert.isBelow result, 600
+
+describe "scripts/delayed-call.coffee (sum of uptime and 250 ms delay`)", ->
+ result = exec("./test/scripts/delayed-call.coffee").toString().trim()
+ it "printed #{result}", ->
+ it "printed a value above 350", -> assert.isAbove result, 350
+ it "printed a value below 600", -> assert.isBelow result, 600
+
+describe "scripts/difference.coffee", ->
+ result = exec("./test/scripts/difference.coffee").toString().trim()
+ it "printed #{result}", ->
+ it "printed a value above 0.005", -> assert.isAbove result, 0.005
+ it "printed a value below 0.07", -> assert.isBelow result, 0.07
diff --git a/node_modules/performance-now/test/scripts/delayed-call.coffee b/node_modules/performance-now/test/scripts/delayed-call.coffee
new file mode 100644
index 0000000000000000000000000000000000000000..0c3bab5949b74bdd7a70adc803d3d718a8281080
--- /dev/null
+++ b/node_modules/performance-now/test/scripts/delayed-call.coffee
@@ -0,0 +1,11 @@
+#!/usr/bin/env ./node_modules/.bin/coffee
+
+###
+Expected output is a number above 350 and below 600.
+The time reported is relative to the time the node.js process was started
+this is approximately at `(Date.now() process.uptime() * 1000)`
+###
+
+delay = require "call-delayed"
+now = require "../../lib/performance-now"
+delay 250, -> console.log now().toFixed 3
diff --git a/node_modules/performance-now/test/scripts/delayed-require.coffee b/node_modules/performance-now/test/scripts/delayed-require.coffee
new file mode 100644
index 0000000000000000000000000000000000000000..3ddee952f2c30c87c1d6360d8d168ab8c7b6d183
--- /dev/null
+++ b/node_modules/performance-now/test/scripts/delayed-require.coffee
@@ -0,0 +1,12 @@
+#!/usr/bin/env ./node_modules/.bin/coffee
+
+###
+Expected output is a number above 350 and below 600.
+The time reported is relative to the time the node.js process was started
+this is approximately at `(Date.now() process.uptime() * 1000)`
+###
+
+delay = require "call-delayed"
+delay 250, ->
+ now = require "../../lib/performance-now"
+ console.log now().toFixed 3
diff --git a/node_modules/performance-now/test/scripts/difference.coffee b/node_modules/performance-now/test/scripts/difference.coffee
new file mode 100644
index 0000000000000000000000000000000000000000..0b5edf6c6b2a026da944c19db7524f4688b28c7a
--- /dev/null
+++ b/node_modules/performance-now/test/scripts/difference.coffee
@@ -0,0 +1,6 @@
+#!/usr/bin/env ./node_modules/.bin/coffee
+
+# Expected output is above 0.005 and below 0.07.
+
+now = require('../../lib/performance-now')
+console.log -(now() - now()).toFixed 3
diff --git a/node_modules/performance-now/test/scripts/initial-value.coffee b/node_modules/performance-now/test/scripts/initial-value.coffee
new file mode 100644
index 0000000000000000000000000000000000000000..19ef4e0f3e732fb9ff8c1b46a4e1616d3fb34497
--- /dev/null
+++ b/node_modules/performance-now/test/scripts/initial-value.coffee
@@ -0,0 +1,10 @@
+#!/usr/bin/env ./node_modules/.bin/coffee
+
+###
+Expected output is a number above 100 and below 350.
+The time reported is relative to the time the node.js process was started
+this is approximately at `(Date.now() process.uptime() * 1000)`
+###
+
+now = require '../../lib/performance-now'
+console.log now().toFixed 3
diff --git a/node_modules/pick-by-alias/.eslintrc.json b/node_modules/pick-by-alias/.eslintrc.json
new file mode 100644
index 0000000000000000000000000000000000000000..c50c250446ee6d06a87a590ecbf3905696b0871d
--- /dev/null
+++ b/node_modules/pick-by-alias/.eslintrc.json
@@ -0,0 +1,43 @@
+{
+ "env": {
+ "browser": true,
+ "node": true,
+ "commonjs": true,
+ "es6": true
+ },
+ "extends": "eslint:recommended",
+ "rules": {
+ "strict": 2,
+ "indent": 0,
+ "linebreak-style": 0,
+ "quotes": 0,
+ "semi": 0,
+ "no-cond-assign": 1,
+ "no-constant-condition": 1,
+ "no-duplicate-case": 1,
+ "no-empty": 1,
+ "no-ex-assign": 1,
+ "no-extra-boolean-cast": 1,
+ "no-extra-semi": 1,
+ "no-fallthrough": 1,
+ "no-func-assign": 1,
+ "no-global-assign": 1,
+ "no-implicit-globals": 2,
+ "no-inner-declarations": ["error", "functions"],
+ "no-irregular-whitespace": 2,
+ "no-loop-func": 1,
+ "no-multi-str": 1,
+ "no-mixed-spaces-and-tabs": 1,
+ "no-proto": 1,
+ "no-sequences": 1,
+ "no-throw-literal": 1,
+ "no-unmodified-loop-condition": 1,
+ "no-useless-call": 1,
+ "no-void": 1,
+ "no-with": 2,
+ "wrap-iife": 1,
+ "no-redeclare": 1,
+ "no-unused-vars": ["error", { "vars": "all", "args": "none" }],
+ "no-sparse-arrays": 1
+ }
+}
diff --git a/node_modules/pick-by-alias/.npmignore b/node_modules/pick-by-alias/.npmignore
new file mode 100644
index 0000000000000000000000000000000000000000..08b25532d6c20a465f83b50183a64307f0266fa5
--- /dev/null
+++ b/node_modules/pick-by-alias/.npmignore
@@ -0,0 +1 @@
+node_modules
diff --git a/node_modules/pick-by-alias/index.js b/node_modules/pick-by-alias/index.js
new file mode 100644
index 0000000000000000000000000000000000000000..5da4b13d1602d0840f475ac15d507329eff03cf7
--- /dev/null
+++ b/node_modules/pick-by-alias/index.js
@@ -0,0 +1,77 @@
+'use strict'
+
+
+module.exports = function pick (src, props, keepRest) {
+ var result = {}, prop, i
+
+ if (typeof props === 'string') props = toList(props)
+ if (Array.isArray(props)) {
+ var res = {}
+ for (i = 0; i < props.length; i++) {
+ res[props[i]] = true
+ }
+ props = res
+ }
+
+ // convert strings to lists
+ for (prop in props) {
+ props[prop] = toList(props[prop])
+ }
+
+ // keep-rest strategy requires unmatched props to be preserved
+ var occupied = {}
+
+ for (prop in props) {
+ var aliases = props[prop]
+
+ if (Array.isArray(aliases)) {
+ for (i = 0; i < aliases.length; i++) {
+ var alias = aliases[i]
+
+ if (keepRest) {
+ occupied[alias] = true
+ }
+
+ if (alias in src) {
+ result[prop] = src[alias]
+
+ if (keepRest) {
+ for (var j = i; j < aliases.length; j++) {
+ occupied[aliases[j]] = true
+ }
+ }
+
+ break
+ }
+ }
+ }
+ else if (prop in src) {
+ if (props[prop]) {
+ result[prop] = src[prop]
+ }
+
+ if (keepRest) {
+ occupied[prop] = true
+ }
+ }
+ }
+
+ if (keepRest) {
+ for (prop in src) {
+ if (occupied[prop]) continue
+ result[prop] = src[prop]
+ }
+ }
+
+ return result
+}
+
+var CACHE = {}
+
+function toList(arg) {
+ if (CACHE[arg]) return CACHE[arg]
+ if (typeof arg === 'string') {
+ arg = CACHE[arg] = arg.split(/\s*,\s*|\s+/)
+ }
+ return arg
+}
diff --git a/node_modules/pick-by-alias/package.json b/node_modules/pick-by-alias/package.json
new file mode 100644
index 0000000000000000000000000000000000000000..5f00af87af8962271dffef4f03ec98e0d3720b28
--- /dev/null
+++ b/node_modules/pick-by-alias/package.json
@@ -0,0 +1,26 @@
+{
+ "name": "pick-by-alias",
+ "version": "1.2.0",
+ "description": "Pick properties by aliases",
+ "main": "index.js",
+ "scripts": {
+ "test": "node test"
+ },
+ "repository": {
+ "type": "git",
+ "url": "git+ssh://git@github.com/dfcreative/pick-by-alias.git"
+ },
+ "keywords": [
+ "pick",
+ "object"
+ ],
+ "author": "Dima Yv ",
+ "license": "MIT",
+ "bugs": {
+ "url": "https://github.com/dfcreative/pick-by-alias/issues"
+ },
+ "homepage": "https://github.com/dfcreative/pick-by-alias#readme",
+ "devDependencies": {
+ "tape": "^4.8.0"
+ }
+}
diff --git a/node_modules/pick-by-alias/readme.md b/node_modules/pick-by-alias/readme.md
new file mode 100644
index 0000000000000000000000000000000000000000..e8c7170868d830a8facc4bd8e099d196c70107d6
--- /dev/null
+++ b/node_modules/pick-by-alias/readme.md
@@ -0,0 +1,46 @@
+# pick-by-alias [](http://github.com/badges/stability-badges)
+
+Pick object properties by synonyms. Useful to avoid remembering exact option names from user perspective.
+
+[](https://npmjs.org/package/pick-by-alias/)
+
+```js
+let pick = require('pick-by-alias')
+
+let result = pick({
+ positions: [...],
+ color: 'rgba(0, 100, 200, .75)',
+ viewBox: null,
+ extra: 123
+}, {
+ positions: 'positions points data coordinates',
+ color: 'colors color stroke',
+ viewport: 'viewport viewBox'
+})
+```
+
+### `pick(object, properties, keepRest=false)`
+
+Return an object with properties picked by the list or dict with aliases. Aliases are matched in priority order, ie. first matching name is picked. Each alias can be an array or a comma/space-separated string.
+
+```js
+// pick by dict
+let {a, b} = pick(src, {a: ['a', 'b', 'c'], b: 'd e f'})
+
+// pick by list
+let {c, d, e} = pick(src, ['c', 'd', 'e'])
+
+// pick by string
+let {f, g} = pick(src, 'f g')
+```
+
+`keepRest` defines if not listed object properties should be transfered to resulting object or discarded.
+
+## Related
+
+* [defined](https://www.npmjs.com/package/defined) − get first non-undefined out of a list of values
+* [update-diff](https://github.com/dfcreative/update-diff) − update object state by mapping diff.
+
+## License
+
+(c) 2017 Dima Yv. MIT License
diff --git a/node_modules/pick-by-alias/test.js b/node_modules/pick-by-alias/test.js
new file mode 100644
index 0000000000000000000000000000000000000000..e0aeaaa3d2e2150f370848a0897090ad3635a85f
--- /dev/null
+++ b/node_modules/pick-by-alias/test.js
@@ -0,0 +1,79 @@
+'use strict'
+
+const t = require('tape')
+const pick = require('./')
+
+t('obj', t => {
+ let res = pick({
+ a: 0,
+ b: null,
+ c: undefined,
+ d: 1,
+ e: [0, 1]
+ }, {a: ['x', 'y', 'a'], b: true, c: 'd', d: ['e'], e: 'b a', f: 'd,b'})
+
+ t.deepEqual(res, {
+ a: 0,
+ b: null,
+ c: 1,
+ d: [0, 1],
+ e: null,
+ f: 1
+ })
+
+ t.end()
+})
+
+t('array', t => {
+ t.deepEqual(pick({
+ a: 0,
+ b: null,
+ c: undefined,
+ d: 1,
+ e: [0, 1]
+ }, ['a', 'b', 'c', 'd']), {a: 0, b: null, c: undefined, d: 1})
+
+ t.end()
+})
+
+
+t('string', t => {
+ t.deepEqual(pick({
+ a: 0,
+ b: null,
+ c: undefined,
+ d: 1,
+ e: [0, 1]
+ }, 'a b c d'), {a: 0, b: null, c: undefined, d: 1})
+
+ t.end()
+})
+
+t('avoid picking absent props', t => {
+ t.deepEqual(pick({a: 1, b: 2}, 'a b c'), {a: 1, b: 2})
+
+ t.end()
+})
+
+t('keep rest strategy', t => {
+ t.deepEqual(pick({a: 1, B: 2, Be: 2.5, c: 3}, {
+ a: true,
+ b: 'B Be'
+ }, true),
+ {
+ a: 1,
+ b: 2,
+ c: 3
+ })
+
+ t.deepEqual(pick({a: 1, B: 2, Be: 2.5, c: 3}, {
+ a: true,
+ b: 'B Be'
+ }),
+ {
+ a: 1,
+ b: 2
+ })
+
+ t.end()
+})
diff --git a/node_modules/picocolors/LICENSE b/node_modules/picocolors/LICENSE
new file mode 100644
index 0000000000000000000000000000000000000000..46c9b95d4b83c8eba2d9ed406f49930a9fdaf3e3
--- /dev/null
+++ b/node_modules/picocolors/LICENSE
@@ -0,0 +1,15 @@
+ISC License
+
+Copyright (c) 2021-2024 Oleksii Raspopov, Kostiantyn Denysov, Anton Verinov
+
+Permission to use, copy, modify, and/or distribute this software for any
+purpose with or without fee is hereby granted, provided that the above
+copyright notice and this permission notice appear in all copies.
+
+THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
+ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
+OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
diff --git a/node_modules/picocolors/README.md b/node_modules/picocolors/README.md
new file mode 100644
index 0000000000000000000000000000000000000000..8e47aa8eea126388d0773e7f86f91471eb5e2150
--- /dev/null
+++ b/node_modules/picocolors/README.md
@@ -0,0 +1,21 @@
+# picocolors
+
+The tiniest and the fastest library for terminal output formatting with ANSI colors.
+
+```javascript
+import pc from "picocolors"
+
+console.log(
+ pc.green(`How are ${pc.italic(`you`)} doing?`)
+)
+```
+
+- **No dependencies.**
+- **14 times** smaller and **2 times** faster than chalk.
+- Used by popular tools like PostCSS, SVGO, Stylelint, and Browserslist.
+- Node.js v6+ & browsers support. Support for both CJS and ESM projects.
+- TypeScript type declarations included.
+- [`NO_COLOR`](https://no-color.org/) friendly.
+
+## Docs
+Read **[full docs](https://github.com/alexeyraspopov/picocolors#readme)** on GitHub.
diff --git a/node_modules/picocolors/package.json b/node_modules/picocolors/package.json
new file mode 100644
index 0000000000000000000000000000000000000000..372d4b642cf553e8234986a22441cce3aea3d11f
--- /dev/null
+++ b/node_modules/picocolors/package.json
@@ -0,0 +1,25 @@
+{
+ "name": "picocolors",
+ "version": "1.1.1",
+ "main": "./picocolors.js",
+ "types": "./picocolors.d.ts",
+ "browser": {
+ "./picocolors.js": "./picocolors.browser.js"
+ },
+ "sideEffects": false,
+ "description": "The tiniest and the fastest library for terminal output formatting with ANSI colors",
+ "files": [
+ "picocolors.*",
+ "types.d.ts"
+ ],
+ "keywords": [
+ "terminal",
+ "colors",
+ "formatting",
+ "cli",
+ "console"
+ ],
+ "author": "Alexey Raspopov",
+ "repository": "alexeyraspopov/picocolors",
+ "license": "ISC"
+}
diff --git a/node_modules/picocolors/picocolors.browser.js b/node_modules/picocolors/picocolors.browser.js
new file mode 100644
index 0000000000000000000000000000000000000000..9dcf637cda1ae2b7ed3281c42463da234ae91398
--- /dev/null
+++ b/node_modules/picocolors/picocolors.browser.js
@@ -0,0 +1,4 @@
+var x=String;
+var create=function() {return {isColorSupported:false,reset:x,bold:x,dim:x,italic:x,underline:x,inverse:x,hidden:x,strikethrough:x,black:x,red:x,green:x,yellow:x,blue:x,magenta:x,cyan:x,white:x,gray:x,bgBlack:x,bgRed:x,bgGreen:x,bgYellow:x,bgBlue:x,bgMagenta:x,bgCyan:x,bgWhite:x,blackBright:x,redBright:x,greenBright:x,yellowBright:x,blueBright:x,magentaBright:x,cyanBright:x,whiteBright:x,bgBlackBright:x,bgRedBright:x,bgGreenBright:x,bgYellowBright:x,bgBlueBright:x,bgMagentaBright:x,bgCyanBright:x,bgWhiteBright:x}};
+module.exports=create();
+module.exports.createColors = create;
diff --git a/node_modules/picocolors/picocolors.d.ts b/node_modules/picocolors/picocolors.d.ts
new file mode 100644
index 0000000000000000000000000000000000000000..94e146a82221e527be835656549ddfb1b41fd0c9
--- /dev/null
+++ b/node_modules/picocolors/picocolors.d.ts
@@ -0,0 +1,5 @@
+import { Colors } from "./types"
+
+declare const picocolors: Colors & { createColors: (enabled?: boolean) => Colors }
+
+export = picocolors
diff --git a/node_modules/picocolors/picocolors.js b/node_modules/picocolors/picocolors.js
new file mode 100644
index 0000000000000000000000000000000000000000..e32df8548820fdf608b39331be07a8519a1b6c46
--- /dev/null
+++ b/node_modules/picocolors/picocolors.js
@@ -0,0 +1,75 @@
+let p = process || {}, argv = p.argv || [], env = p.env || {}
+let isColorSupported =
+ !(!!env.NO_COLOR || argv.includes("--no-color")) &&
+ (!!env.FORCE_COLOR || argv.includes("--color") || p.platform === "win32" || ((p.stdout || {}).isTTY && env.TERM !== "dumb") || !!env.CI)
+
+let formatter = (open, close, replace = open) =>
+ input => {
+ let string = "" + input, index = string.indexOf(close, open.length)
+ return ~index ? open + replaceClose(string, close, replace, index) + close : open + string + close
+ }
+
+let replaceClose = (string, close, replace, index) => {
+ let result = "", cursor = 0
+ do {
+ result += string.substring(cursor, index) + replace
+ cursor = index + close.length
+ index = string.indexOf(close, cursor)
+ } while (~index)
+ return result + string.substring(cursor)
+}
+
+let createColors = (enabled = isColorSupported) => {
+ let f = enabled ? formatter : () => String
+ return {
+ isColorSupported: enabled,
+ reset: f("\x1b[0m", "\x1b[0m"),
+ bold: f("\x1b[1m", "\x1b[22m", "\x1b[22m\x1b[1m"),
+ dim: f("\x1b[2m", "\x1b[22m", "\x1b[22m\x1b[2m"),
+ italic: f("\x1b[3m", "\x1b[23m"),
+ underline: f("\x1b[4m", "\x1b[24m"),
+ inverse: f("\x1b[7m", "\x1b[27m"),
+ hidden: f("\x1b[8m", "\x1b[28m"),
+ strikethrough: f("\x1b[9m", "\x1b[29m"),
+
+ black: f("\x1b[30m", "\x1b[39m"),
+ red: f("\x1b[31m", "\x1b[39m"),
+ green: f("\x1b[32m", "\x1b[39m"),
+ yellow: f("\x1b[33m", "\x1b[39m"),
+ blue: f("\x1b[34m", "\x1b[39m"),
+ magenta: f("\x1b[35m", "\x1b[39m"),
+ cyan: f("\x1b[36m", "\x1b[39m"),
+ white: f("\x1b[37m", "\x1b[39m"),
+ gray: f("\x1b[90m", "\x1b[39m"),
+
+ bgBlack: f("\x1b[40m", "\x1b[49m"),
+ bgRed: f("\x1b[41m", "\x1b[49m"),
+ bgGreen: f("\x1b[42m", "\x1b[49m"),
+ bgYellow: f("\x1b[43m", "\x1b[49m"),
+ bgBlue: f("\x1b[44m", "\x1b[49m"),
+ bgMagenta: f("\x1b[45m", "\x1b[49m"),
+ bgCyan: f("\x1b[46m", "\x1b[49m"),
+ bgWhite: f("\x1b[47m", "\x1b[49m"),
+
+ blackBright: f("\x1b[90m", "\x1b[39m"),
+ redBright: f("\x1b[91m", "\x1b[39m"),
+ greenBright: f("\x1b[92m", "\x1b[39m"),
+ yellowBright: f("\x1b[93m", "\x1b[39m"),
+ blueBright: f("\x1b[94m", "\x1b[39m"),
+ magentaBright: f("\x1b[95m", "\x1b[39m"),
+ cyanBright: f("\x1b[96m", "\x1b[39m"),
+ whiteBright: f("\x1b[97m", "\x1b[39m"),
+
+ bgBlackBright: f("\x1b[100m", "\x1b[49m"),
+ bgRedBright: f("\x1b[101m", "\x1b[49m"),
+ bgGreenBright: f("\x1b[102m", "\x1b[49m"),
+ bgYellowBright: f("\x1b[103m", "\x1b[49m"),
+ bgBlueBright: f("\x1b[104m", "\x1b[49m"),
+ bgMagentaBright: f("\x1b[105m", "\x1b[49m"),
+ bgCyanBright: f("\x1b[106m", "\x1b[49m"),
+ bgWhiteBright: f("\x1b[107m", "\x1b[49m"),
+ }
+}
+
+module.exports = createColors()
+module.exports.createColors = createColors
diff --git a/node_modules/picocolors/types.d.ts b/node_modules/picocolors/types.d.ts
new file mode 100644
index 0000000000000000000000000000000000000000..cd1aec46792f4bdb4fd06aeabf1fd93c8b3f11ea
--- /dev/null
+++ b/node_modules/picocolors/types.d.ts
@@ -0,0 +1,51 @@
+export type Formatter = (input: string | number | null | undefined) => string
+
+export interface Colors {
+ isColorSupported: boolean
+
+ reset: Formatter
+ bold: Formatter
+ dim: Formatter
+ italic: Formatter
+ underline: Formatter
+ inverse: Formatter
+ hidden: Formatter
+ strikethrough: Formatter
+
+ black: Formatter
+ red: Formatter
+ green: Formatter
+ yellow: Formatter
+ blue: Formatter
+ magenta: Formatter
+ cyan: Formatter
+ white: Formatter
+ gray: Formatter
+
+ bgBlack: Formatter
+ bgRed: Formatter
+ bgGreen: Formatter
+ bgYellow: Formatter
+ bgBlue: Formatter
+ bgMagenta: Formatter
+ bgCyan: Formatter
+ bgWhite: Formatter
+
+ blackBright: Formatter
+ redBright: Formatter
+ greenBright: Formatter
+ yellowBright: Formatter
+ blueBright: Formatter
+ magentaBright: Formatter
+ cyanBright: Formatter
+ whiteBright: Formatter
+
+ bgBlackBright: Formatter
+ bgRedBright: Formatter
+ bgGreenBright: Formatter
+ bgYellowBright: Formatter
+ bgBlueBright: Formatter
+ bgMagentaBright: Formatter
+ bgCyanBright: Formatter
+ bgWhiteBright: Formatter
+}
diff --git a/node_modules/picomatch/LICENSE b/node_modules/picomatch/LICENSE
new file mode 100644
index 0000000000000000000000000000000000000000..3608dca25e30b572b6ad6935c8c7918bf70e3d2f
--- /dev/null
+++ b/node_modules/picomatch/LICENSE
@@ -0,0 +1,21 @@
+The MIT License (MIT)
+
+Copyright (c) 2017-present, Jon Schlinkert.
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+THE SOFTWARE.
diff --git a/node_modules/picomatch/README.md b/node_modules/picomatch/README.md
new file mode 100644
index 0000000000000000000000000000000000000000..07644967ac3677dd4f4b19cece1d654aebf8c6aa
--- /dev/null
+++ b/node_modules/picomatch/README.md
@@ -0,0 +1,738 @@
+Picomatch
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+Blazing fast and accurate glob matcher written in JavaScript.
+No dependencies and full support for standard and extended Bash glob features, including braces, extglobs, POSIX brackets, and regular expressions.
+
+
+
+
+
+## Why picomatch?
+
+* **Lightweight** - No dependencies
+* **Minimal** - Tiny API surface. Main export is a function that takes a glob pattern and returns a matcher function.
+* **Fast** - Loads in about 2ms (that's several times faster than a [single frame of a HD movie](http://www.endmemo.com/sconvert/framespersecondframespermillisecond.php) at 60fps)
+* **Performant** - Use the returned matcher function to speed up repeat matching (like when watching files)
+* **Accurate matching** - Using wildcards (`*` and `?`), globstars (`**`) for nested directories, [advanced globbing](#advanced-globbing) with extglobs, braces, and POSIX brackets, and support for escaping special characters with `\` or quotes.
+* **Well tested** - Thousands of unit tests
+
+See the [library comparison](#library-comparisons) to other libraries.
+
+
+
+
+## Table of Contents
+
+ Click to expand
+
+- [Install](#install)
+- [Usage](#usage)
+- [API](#api)
+ * [picomatch](#picomatch)
+ * [.test](#test)
+ * [.matchBase](#matchbase)
+ * [.isMatch](#ismatch)
+ * [.parse](#parse)
+ * [.scan](#scan)
+ * [.compileRe](#compilere)
+ * [.makeRe](#makere)
+ * [.toRegex](#toregex)
+- [Options](#options)
+ * [Picomatch options](#picomatch-options)
+ * [Scan Options](#scan-options)
+ * [Options Examples](#options-examples)
+- [Globbing features](#globbing-features)
+ * [Basic globbing](#basic-globbing)
+ * [Advanced globbing](#advanced-globbing)
+ * [Braces](#braces)
+ * [Matching special characters as literals](#matching-special-characters-as-literals)
+- [Library Comparisons](#library-comparisons)
+- [Benchmarks](#benchmarks)
+- [Philosophies](#philosophies)
+- [About](#about)
+ * [Author](#author)
+ * [License](#license)
+
+_(TOC generated by [verb](https://github.com/verbose/verb) using [markdown-toc](https://github.com/jonschlinkert/markdown-toc))_
+
+
+
+
+
+
+## Install
+
+Install with [npm](https://www.npmjs.com/):
+
+```sh
+npm install --save picomatch
+```
+
+
+
+## Usage
+
+The main export is a function that takes a glob pattern and an options object and returns a function for matching strings.
+
+```js
+const pm = require('picomatch');
+const isMatch = pm('*.js');
+
+console.log(isMatch('abcd')); //=> false
+console.log(isMatch('a.js')); //=> true
+console.log(isMatch('a.md')); //=> false
+console.log(isMatch('a/b.js')); //=> false
+```
+
+
+
+## API
+
+### [picomatch](lib/picomatch.js#L31)
+
+Creates a matcher function from one or more glob patterns. The returned function takes a string to match as its first argument, and returns true if the string is a match. The returned matcher function also takes a boolean as the second argument that, when true, returns an object with additional information.
+
+**Params**
+
+* `globs` **{String|Array}**: One or more glob patterns.
+* `options` **{Object=}**
+* `returns` **{Function=}**: Returns a matcher function.
+
+**Example**
+
+```js
+const picomatch = require('picomatch');
+// picomatch(glob[, options]);
+
+const isMatch = picomatch('*.!(*a)');
+console.log(isMatch('a.a')); //=> false
+console.log(isMatch('a.b')); //=> true
+```
+
+**Example without node.js**
+
+For environments without `node.js`, `picomatch/posix` provides you a dependency-free matcher, without automatic OS detection.
+
+```js
+const picomatch = require('picomatch/posix');
+// the same API, defaulting to posix paths
+const isMatch = picomatch('a/*');
+console.log(isMatch('a\\b')); //=> false
+console.log(isMatch('a/b')); //=> true
+
+// you can still configure the matcher function to accept windows paths
+const isMatch = picomatch('a/*', { options: windows });
+console.log(isMatch('a\\b')); //=> true
+console.log(isMatch('a/b')); //=> true
+```
+
+### [.test](lib/picomatch.js#L116)
+
+Test `input` with the given `regex`. This is used by the main `picomatch()` function to test the input string.
+
+**Params**
+
+* `input` **{String}**: String to test.
+* `regex` **{RegExp}**
+* `returns` **{Object}**: Returns an object with matching info.
+
+**Example**
+
+```js
+const picomatch = require('picomatch');
+// picomatch.test(input, regex[, options]);
+
+console.log(picomatch.test('foo/bar', /^(?:([^/]*?)\/([^/]*?))$/));
+// { isMatch: true, match: [ 'foo/', 'foo', 'bar' ], output: 'foo/bar' }
+```
+
+### [.matchBase](lib/picomatch.js#L160)
+
+Match the basename of a filepath.
+
+**Params**
+
+* `input` **{String}**: String to test.
+* `glob` **{RegExp|String}**: Glob pattern or regex created by [.makeRe](#makeRe).
+* `returns` **{Boolean}**
+
+**Example**
+
+```js
+const picomatch = require('picomatch');
+// picomatch.matchBase(input, glob[, options]);
+console.log(picomatch.matchBase('foo/bar.js', '*.js'); // true
+```
+
+### [.isMatch](lib/picomatch.js#L182)
+
+Returns true if **any** of the given glob `patterns` match the specified `string`.
+
+**Params**
+
+* **{String|Array}**: str The string to test.
+* **{String|Array}**: patterns One or more glob patterns to use for matching.
+* **{Object}**: See available [options](#options).
+* `returns` **{Boolean}**: Returns true if any patterns match `str`
+
+**Example**
+
+```js
+const picomatch = require('picomatch');
+// picomatch.isMatch(string, patterns[, options]);
+
+console.log(picomatch.isMatch('a.a', ['b.*', '*.a'])); //=> true
+console.log(picomatch.isMatch('a.a', 'b.*')); //=> false
+```
+
+### [.parse](lib/picomatch.js#L198)
+
+Parse a glob pattern to create the source string for a regular expression.
+
+**Params**
+
+* `pattern` **{String}**
+* `options` **{Object}**
+* `returns` **{Object}**: Returns an object with useful properties and output to be used as a regex source string.
+
+**Example**
+
+```js
+const picomatch = require('picomatch');
+const result = picomatch.parse(pattern[, options]);
+```
+
+### [.scan](lib/picomatch.js#L230)
+
+Scan a glob pattern to separate the pattern into segments.
+
+**Params**
+
+* `input` **{String}**: Glob pattern to scan.
+* `options` **{Object}**
+* `returns` **{Object}**: Returns an object with
+
+**Example**
+
+```js
+const picomatch = require('picomatch');
+// picomatch.scan(input[, options]);
+
+const result = picomatch.scan('!./foo/*.js');
+console.log(result);
+{ prefix: '!./',
+ input: '!./foo/*.js',
+ start: 3,
+ base: 'foo',
+ glob: '*.js',
+ isBrace: false,
+ isBracket: false,
+ isGlob: true,
+ isExtglob: false,
+ isGlobstar: false,
+ negated: true }
+```
+
+### [.compileRe](lib/picomatch.js#L244)
+
+Compile a regular expression from the `state` object returned by the
+[parse()](#parse) method.
+
+**Params**
+
+* `state` **{Object}**
+* `options` **{Object}**
+* `returnOutput` **{Boolean}**: Intended for implementors, this argument allows you to return the raw output from the parser.
+* `returnState` **{Boolean}**: Adds the state to a `state` property on the returned regex. Useful for implementors and debugging.
+* `returns` **{RegExp}**
+
+### [.makeRe](lib/picomatch.js#L285)
+
+Create a regular expression from a parsed glob pattern.
+
+**Params**
+
+* `state` **{String}**: The object returned from the `.parse` method.
+* `options` **{Object}**
+* `returnOutput` **{Boolean}**: Implementors may use this argument to return the compiled output, instead of a regular expression. This is not exposed on the options to prevent end-users from mutating the result.
+* `returnState` **{Boolean}**: Implementors may use this argument to return the state from the parsed glob with the returned regular expression.
+* `returns` **{RegExp}**: Returns a regex created from the given pattern.
+
+**Example**
+
+```js
+const picomatch = require('picomatch');
+const state = picomatch.parse('*.js');
+// picomatch.compileRe(state[, options]);
+
+console.log(picomatch.compileRe(state));
+//=> /^(?:(?!\.)(?=.)[^/]*?\.js)$/
+```
+
+### [.toRegex](lib/picomatch.js#L320)
+
+Create a regular expression from the given regex source string.
+
+**Params**
+
+* `source` **{String}**: Regular expression source string.
+* `options` **{Object}**
+* `returns` **{RegExp}**
+
+**Example**
+
+```js
+const picomatch = require('picomatch');
+// picomatch.toRegex(source[, options]);
+
+const { output } = picomatch.parse('*.js');
+console.log(picomatch.toRegex(output));
+//=> /^(?:(?!\.)(?=.)[^/]*?\.js)$/
+```
+
+
+
+## Options
+
+### Picomatch options
+
+The following options may be used with the main `picomatch()` function or any of the methods on the picomatch API.
+
+| **Option** | **Type** | **Default value** | **Description** |
+| --- | --- | --- | --- |
+| `basename` | `boolean` | `false` | If set, then patterns without slashes will be matched against the basename of the path if it contains slashes. For example, `a?b` would match the path `/xyz/123/acb`, but not `/xyz/acb/123`. |
+| `bash` | `boolean` | `false` | Follow bash matching rules more strictly - disallows backslashes as escape characters, and treats single stars as globstars (`**`). |
+| `capture` | `boolean` | `undefined` | Return regex matches in supporting methods. |
+| `contains` | `boolean` | `undefined` | Allows glob to match any part of the given string(s). |
+| `cwd` | `string` | `process.cwd()` | Current working directory. Used by `picomatch.split()` |
+| `debug` | `boolean` | `undefined` | Debug regular expressions when an error is thrown. |
+| `dot` | `boolean` | `false` | Enable dotfile matching. By default, dotfiles are ignored unless a `.` is explicitly defined in the pattern, or `options.dot` is true |
+| `expandRange` | `function` | `undefined` | Custom function for expanding ranges in brace patterns, such as `{a..z}`. The function receives the range values as two arguments, and it must return a string to be used in the generated regex. It's recommended that returned strings be wrapped in parentheses. |
+| `failglob` | `boolean` | `false` | Throws an error if no matches are found. Based on the bash option of the same name. |
+| `fastpaths` | `boolean` | `true` | To speed up processing, full parsing is skipped for a handful common glob patterns. Disable this behavior by setting this option to `false`. |
+| `flags` | `string` | `undefined` | Regex flags to use in the generated regex. If defined, the `nocase` option will be overridden. |
+| [format](#optionsformat) | `function` | `undefined` | Custom function for formatting the returned string. This is useful for removing leading slashes, converting Windows paths to Posix paths, etc. |
+| `ignore` | `array\|string` | `undefined` | One or more glob patterns for excluding strings that should not be matched from the result. |
+| `keepQuotes` | `boolean` | `false` | Retain quotes in the generated regex, since quotes may also be used as an alternative to backslashes. |
+| `literalBrackets` | `boolean` | `undefined` | When `true`, brackets in the glob pattern will be escaped so that only literal brackets will be matched. |
+| `matchBase` | `boolean` | `false` | Alias for `basename` |
+| `maxLength` | `number` | `65536` | Limit the max length of the input string. An error is thrown if the input string is longer than this value. |
+| `nobrace` | `boolean` | `false` | Disable brace matching, so that `{a,b}` and `{1..3}` would be treated as literal characters. |
+| `nobracket` | `boolean` | `undefined` | Disable matching with regex brackets. |
+| `nocase` | `boolean` | `false` | Make matching case-insensitive. Equivalent to the regex `i` flag. Note that this option is overridden by the `flags` option. |
+| `nodupes` | `boolean` | `true` | Deprecated, use `nounique` instead. This option will be removed in a future major release. By default duplicates are removed. Disable uniquification by setting this option to false. |
+| `noext` | `boolean` | `false` | Alias for `noextglob` |
+| `noextglob` | `boolean` | `false` | Disable support for matching with extglobs (like `+(a\|b)`) |
+| `noglobstar` | `boolean` | `false` | Disable support for matching nested directories with globstars (`**`) |
+| `nonegate` | `boolean` | `false` | Disable support for negating with leading `!` |
+| `noquantifiers` | `boolean` | `false` | Disable support for regex quantifiers (like `a{1,2}`) and treat them as brace patterns to be expanded. |
+| [onIgnore](#optionsonIgnore) | `function` | `undefined` | Function to be called on ignored items. |
+| [onMatch](#optionsonMatch) | `function` | `undefined` | Function to be called on matched items. |
+| [onResult](#optionsonResult) | `function` | `undefined` | Function to be called on all items, regardless of whether or not they are matched or ignored. |
+| `posix` | `boolean` | `false` | Support POSIX character classes ("posix brackets"). |
+| `posixSlashes` | `boolean` | `undefined` | Convert all slashes in file paths to forward slashes. This does not convert slashes in the glob pattern itself |
+| `prepend` | `boolean` | `undefined` | String to prepend to the generated regex used for matching. |
+| `regex` | `boolean` | `false` | Use regular expression rules for `+` (instead of matching literal `+`), and for stars that follow closing parentheses or brackets (as in `)*` and `]*`). |
+| `strictBrackets` | `boolean` | `undefined` | Throw an error if brackets, braces, or parens are imbalanced. |
+| `strictSlashes` | `boolean` | `undefined` | When true, picomatch won't match trailing slashes with single stars. |
+| `unescape` | `boolean` | `undefined` | Remove backslashes preceding escaped characters in the glob pattern. By default, backslashes are retained. |
+| `unixify` | `boolean` | `undefined` | Alias for `posixSlashes`, for backwards compatibility. |
+| `windows` | `boolean` | `false` | Also accept backslashes as the path separator. |
+
+### Scan Options
+
+In addition to the main [picomatch options](#picomatch-options), the following options may also be used with the [.scan](#scan) method.
+
+| **Option** | **Type** | **Default value** | **Description** |
+| --- | --- | --- | --- |
+| `tokens` | `boolean` | `false` | When `true`, the returned object will include an array of tokens (objects), representing each path "segment" in the scanned glob pattern |
+| `parts` | `boolean` | `false` | When `true`, the returned object will include an array of strings representing each path "segment" in the scanned glob pattern. This is automatically enabled when `options.tokens` is true |
+
+**Example**
+
+```js
+const picomatch = require('picomatch');
+const result = picomatch.scan('!./foo/*.js', { tokens: true });
+console.log(result);
+// {
+// prefix: '!./',
+// input: '!./foo/*.js',
+// start: 3,
+// base: 'foo',
+// glob: '*.js',
+// isBrace: false,
+// isBracket: false,
+// isGlob: true,
+// isExtglob: false,
+// isGlobstar: false,
+// negated: true,
+// maxDepth: 2,
+// tokens: [
+// { value: '!./', depth: 0, isGlob: false, negated: true, isPrefix: true },
+// { value: 'foo', depth: 1, isGlob: false },
+// { value: '*.js', depth: 1, isGlob: true }
+// ],
+// slashes: [ 2, 6 ],
+// parts: [ 'foo', '*.js' ]
+// }
+```
+
+
+
+### Options Examples
+
+#### options.expandRange
+
+**Type**: `function`
+
+**Default**: `undefined`
+
+Custom function for expanding ranges in brace patterns. The [fill-range](https://github.com/jonschlinkert/fill-range) library is ideal for this purpose, or you can use custom code to do whatever you need.
+
+**Example**
+
+The following example shows how to create a glob that matches a folder
+
+```js
+const fill = require('fill-range');
+const regex = pm.makeRe('foo/{01..25}/bar', {
+ expandRange(a, b) {
+ return `(${fill(a, b, { toRegex: true })})`;
+ }
+});
+
+console.log(regex);
+//=> /^(?:foo\/((?:0[1-9]|1[0-9]|2[0-5]))\/bar)$/
+
+console.log(regex.test('foo/00/bar')) // false
+console.log(regex.test('foo/01/bar')) // true
+console.log(regex.test('foo/10/bar')) // true
+console.log(regex.test('foo/22/bar')) // true
+console.log(regex.test('foo/25/bar')) // true
+console.log(regex.test('foo/26/bar')) // false
+```
+
+#### options.format
+
+**Type**: `function`
+
+**Default**: `undefined`
+
+Custom function for formatting strings before they're matched.
+
+**Example**
+
+```js
+// strip leading './' from strings
+const format = str => str.replace(/^\.\//, '');
+const isMatch = picomatch('foo/*.js', { format });
+console.log(isMatch('./foo/bar.js')); //=> true
+```
+
+#### options.onMatch
+
+```js
+const onMatch = ({ glob, regex, input, output }) => {
+ console.log({ glob, regex, input, output });
+};
+
+const isMatch = picomatch('*', { onMatch });
+isMatch('foo');
+isMatch('bar');
+isMatch('baz');
+```
+
+#### options.onIgnore
+
+```js
+const onIgnore = ({ glob, regex, input, output }) => {
+ console.log({ glob, regex, input, output });
+};
+
+const isMatch = picomatch('*', { onIgnore, ignore: 'f*' });
+isMatch('foo');
+isMatch('bar');
+isMatch('baz');
+```
+
+#### options.onResult
+
+```js
+const onResult = ({ glob, regex, input, output }) => {
+ console.log({ glob, regex, input, output });
+};
+
+const isMatch = picomatch('*', { onResult, ignore: 'f*' });
+isMatch('foo');
+isMatch('bar');
+isMatch('baz');
+```
+
+
+
+
+## Globbing features
+
+* [Basic globbing](#basic-globbing) (Wildcard matching)
+* [Advanced globbing](#advanced-globbing) (extglobs, posix brackets, brace matching)
+
+### Basic globbing
+
+| **Character** | **Description** |
+| --- | --- |
+| `*` | Matches any character zero or more times, excluding path separators. Does _not match_ path separators or hidden files or directories ("dotfiles"), unless explicitly enabled by setting the `dot` option to `true`. |
+| `**` | Matches any character zero or more times, including path separators. Note that `**` will only match path separators (`/`, and `\\` with the `windows` option) when they are the only characters in a path segment. Thus, `foo**/bar` is equivalent to `foo*/bar`, and `foo/a**b/bar` is equivalent to `foo/a*b/bar`, and _more than two_ consecutive stars in a glob path segment are regarded as _a single star_. Thus, `foo/***/bar` is equivalent to `foo/*/bar`. |
+| `?` | Matches any character excluding path separators one time. Does _not match_ path separators or leading dots. |
+| `[abc]` | Matches any characters inside the brackets. For example, `[abc]` would match the characters `a`, `b` or `c`, and nothing else. |
+
+#### Matching behavior vs. Bash
+
+Picomatch's matching features and expected results in unit tests are based on Bash's unit tests and the Bash 4.3 specification, with the following exceptions:
+
+* Bash will match `foo/bar/baz` with `*`. Picomatch only matches nested directories with `**`.
+* Bash greedily matches with negated extglobs. For example, Bash 4.3 says that `!(foo)*` should match `foo` and `foobar`, since the trailing `*` bracktracks to match the preceding pattern. This is very memory-inefficient, and IMHO, also incorrect. Picomatch would return `false` for both `foo` and `foobar`.
+
+
+
+### Advanced globbing
+
+* [extglobs](#extglobs)
+* [POSIX brackets](#posix-brackets)
+* [Braces](#brace-expansion)
+
+#### Extglobs
+
+| **Pattern** | **Description** |
+| --- | --- |
+| `@(pattern)` | Match _only one_ consecutive occurrence of `pattern` |
+| `*(pattern)` | Match _zero or more_ consecutive occurrences of `pattern` |
+| `+(pattern)` | Match _one or more_ consecutive occurrences of `pattern` |
+| `?(pattern)` | Match _zero or **one**_ consecutive occurrences of `pattern` |
+| `!(pattern)` | Match _anything but_ `pattern` |
+
+**Examples**
+
+```js
+const pm = require('picomatch');
+
+// *(pattern) matches ZERO or more of "pattern"
+console.log(pm.isMatch('a', 'a*(z)')); // true
+console.log(pm.isMatch('az', 'a*(z)')); // true
+console.log(pm.isMatch('azzz', 'a*(z)')); // true
+
+// +(pattern) matches ONE or more of "pattern"
+console.log(pm.isMatch('a', 'a+(z)')); // false
+console.log(pm.isMatch('az', 'a+(z)')); // true
+console.log(pm.isMatch('azzz', 'a+(z)')); // true
+
+// supports multiple extglobs
+console.log(pm.isMatch('foo.bar', '!(foo).!(bar)')); // false
+
+// supports nested extglobs
+console.log(pm.isMatch('foo.bar', '!(!(foo)).!(!(bar))')); // true
+```
+
+#### POSIX brackets
+
+POSIX classes are disabled by default. Enable this feature by setting the `posix` option to true.
+
+**Enable POSIX bracket support**
+
+```js
+console.log(pm.makeRe('[[:word:]]+', { posix: true }));
+//=> /^(?:(?=.)[A-Za-z0-9_]+\/?)$/
+```
+
+**Supported POSIX classes**
+
+The following named POSIX bracket expressions are supported:
+
+* `[:alnum:]` - Alphanumeric characters, equ `[a-zA-Z0-9]`
+* `[:alpha:]` - Alphabetical characters, equivalent to `[a-zA-Z]`.
+* `[:ascii:]` - ASCII characters, equivalent to `[\\x00-\\x7F]`.
+* `[:blank:]` - Space and tab characters, equivalent to `[ \\t]`.
+* `[:cntrl:]` - Control characters, equivalent to `[\\x00-\\x1F\\x7F]`.
+* `[:digit:]` - Numerical digits, equivalent to `[0-9]`.
+* `[:graph:]` - Graph characters, equivalent to `[\\x21-\\x7E]`.
+* `[:lower:]` - Lowercase letters, equivalent to `[a-z]`.
+* `[:print:]` - Print characters, equivalent to `[\\x20-\\x7E ]`.
+* `[:punct:]` - Punctuation and symbols, equivalent to `[\\-!"#$%&\'()\\*+,./:;<=>?@[\\]^_`{|}~]`.
+* `[:space:]` - Extended space characters, equivalent to `[ \\t\\r\\n\\v\\f]`.
+* `[:upper:]` - Uppercase letters, equivalent to `[A-Z]`.
+* `[:word:]` - Word characters (letters, numbers and underscores), equivalent to `[A-Za-z0-9_]`.
+* `[:xdigit:]` - Hexadecimal digits, equivalent to `[A-Fa-f0-9]`.
+
+See the [Bash Reference Manual](https://www.gnu.org/software/bash/manual/html_node/Pattern-Matching.html) for more information.
+
+### Braces
+
+Picomatch does not do brace expansion. For [brace expansion](https://www.gnu.org/software/bash/manual/html_node/Brace-Expansion.html) and advanced matching with braces, use [micromatch](https://github.com/micromatch/micromatch) instead. Picomatch has very basic support for braces.
+
+### Matching special characters as literals
+
+If you wish to match the following special characters in a filepath, and you want to use these characters in your glob pattern, they must be escaped with backslashes or quotes:
+
+**Special Characters**
+
+Some characters that are used for matching in regular expressions are also regarded as valid file path characters on some platforms.
+
+To match any of the following characters as literals: `$^*+?()[]
+
+Examples:
+
+```js
+console.log(pm.makeRe('foo/bar \\(1\\)'));
+console.log(pm.makeRe('foo/bar \\(1\\)'));
+```
+
+
+
+
+## Library Comparisons
+
+The following table shows which features are supported by [minimatch](https://github.com/isaacs/minimatch), [micromatch](https://github.com/micromatch/micromatch), [picomatch](https://github.com/micromatch/picomatch), [nanomatch](https://github.com/micromatch/nanomatch), [extglob](https://github.com/micromatch/extglob), [braces](https://github.com/micromatch/braces), and [expand-brackets](https://github.com/micromatch/expand-brackets).
+
+| **Feature** | `minimatch` | `micromatch` | `picomatch` | `nanomatch` | `extglob` | `braces` | `expand-brackets` |
+| --- | --- | --- | --- | --- | --- | --- | --- |
+| Wildcard matching (`*?+`) | ✔ | ✔ | ✔ | ✔ | - | - | - |
+| Advancing globbing | ✔ | ✔ | ✔ | - | - | - | - |
+| Brace _matching_ | ✔ | ✔ | ✔ | - | - | ✔ | - |
+| Brace _expansion_ | ✔ | ✔ | - | - | - | ✔ | - |
+| Extglobs | partial | ✔ | ✔ | - | ✔ | - | - |
+| Posix brackets | - | ✔ | ✔ | - | - | - | ✔ |
+| Regular expression syntax | - | ✔ | ✔ | ✔ | ✔ | - | ✔ |
+| File system operations | - | - | - | - | - | - | - |
+
+
+
+
+## Benchmarks
+
+Performance comparison of picomatch and minimatch.
+
+_(Pay special attention to the last three benchmarks. Minimatch freezes on long ranges.)_
+
+```
+# .makeRe star (*)
+ picomatch x 4,449,159 ops/sec ±0.24% (97 runs sampled)
+ minimatch x 632,772 ops/sec ±0.14% (98 runs sampled)
+
+# .makeRe star; dot=true (*)
+ picomatch x 3,500,079 ops/sec ±0.26% (99 runs sampled)
+ minimatch x 564,916 ops/sec ±0.23% (96 runs sampled)
+
+# .makeRe globstar (**)
+ picomatch x 3,261,000 ops/sec ±0.27% (98 runs sampled)
+ minimatch x 1,664,766 ops/sec ±0.20% (100 runs sampled)
+
+# .makeRe globstars (**/**/**)
+ picomatch x 3,284,469 ops/sec ±0.18% (97 runs sampled)
+ minimatch x 1,435,880 ops/sec ±0.34% (95 runs sampled)
+
+# .makeRe with leading star (*.txt)
+ picomatch x 3,100,197 ops/sec ±0.35% (99 runs sampled)
+ minimatch x 428,347 ops/sec ±0.42% (94 runs sampled)
+
+# .makeRe - basic braces ({a,b,c}*.txt)
+ picomatch x 443,578 ops/sec ±1.33% (89 runs sampled)
+ minimatch x 107,143 ops/sec ±0.35% (94 runs sampled)
+
+# .makeRe - short ranges ({a..z}*.txt)
+ picomatch x 415,484 ops/sec ±0.76% (96 runs sampled)
+ minimatch x 14,299 ops/sec ±0.26% (96 runs sampled)
+
+# .makeRe - medium ranges ({1..100000}*.txt)
+ picomatch x 395,020 ops/sec ±0.87% (89 runs sampled)
+ minimatch x 2 ops/sec ±4.59% (10 runs sampled)
+
+# .makeRe - long ranges ({1..10000000}*.txt)
+ picomatch x 400,036 ops/sec ±0.83% (90 runs sampled)
+ minimatch (FATAL ERROR: Ineffective mark-compacts near heap limit Allocation failed - JavaScript heap out of memory)
+```
+
+
+
+
+## Philosophies
+
+The goal of this library is to be blazing fast, without compromising on accuracy.
+
+**Accuracy**
+
+The number one of goal of this library is accuracy. However, it's not unusual for different glob implementations to have different rules for matching behavior, even with simple wildcard matching. It gets increasingly more complicated when combinations of different features are combined, like when extglobs are combined with globstars, braces, slashes, and so on: `!(**/{a,b,*/c})`.
+
+Thus, given that there is no canonical glob specification to use as a single source of truth when differences of opinion arise regarding behavior, sometimes we have to implement our best judgement and rely on feedback from users to make improvements.
+
+**Performance**
+
+Although this library performs well in benchmarks, and in most cases it's faster than other popular libraries we benchmarked against, we will always choose accuracy over performance. It's not helpful to anyone if our library is faster at returning the wrong answer.
+
+
+
+
+## About
+
+
+Contributing
+
+Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](../../issues/new).
+
+Please read the [contributing guide](.github/contributing.md) for advice on opening issues, pull requests, and coding standards.
+
+
+
+
+Running Tests
+
+Running and reviewing unit tests is a great way to get familiarized with a library and its API. You can install dependencies and run tests with the following command:
+
+```sh
+npm install && npm test
+```
+
+
+
+
+Building docs
+
+_(This project's readme.md is generated by [verb](https://github.com/verbose/verb-generate-readme), please don't edit the readme directly. Any changes to the readme must be made in the [.verb.md](.verb.md) readme template.)_
+
+To generate the readme, run the following command:
+
+```sh
+npm install -g verbose/verb#dev verb-generate-readme && verb
+```
+
+
+
+### Author
+
+**Jon Schlinkert**
+
+* [GitHub Profile](https://github.com/jonschlinkert)
+* [Twitter Profile](https://twitter.com/jonschlinkert)
+* [LinkedIn Profile](https://linkedin.com/in/jonschlinkert)
+
+### License
+
+Copyright © 2017-present, [Jon Schlinkert](https://github.com/jonschlinkert).
+Released under the [MIT License](LICENSE).
diff --git a/node_modules/picomatch/index.js b/node_modules/picomatch/index.js
new file mode 100644
index 0000000000000000000000000000000000000000..a753b1d9e843c93b62700aa155db920a1a940baa
--- /dev/null
+++ b/node_modules/picomatch/index.js
@@ -0,0 +1,17 @@
+'use strict';
+
+const pico = require('./lib/picomatch');
+const utils = require('./lib/utils');
+
+function picomatch(glob, options, returnState = false) {
+ // default to os.platform()
+ if (options && (options.windows === null || options.windows === undefined)) {
+ // don't mutate the original options object
+ options = { ...options, windows: utils.isWindows() };
+ }
+
+ return pico(glob, options, returnState);
+}
+
+Object.assign(picomatch, pico);
+module.exports = picomatch;
diff --git a/node_modules/picomatch/lib/constants.js b/node_modules/picomatch/lib/constants.js
new file mode 100644
index 0000000000000000000000000000000000000000..3f7ef7e53adaf9d3021fba01aaafe600b5ff772f
--- /dev/null
+++ b/node_modules/picomatch/lib/constants.js
@@ -0,0 +1,180 @@
+'use strict';
+
+const WIN_SLASH = '\\\\/';
+const WIN_NO_SLASH = `[^${WIN_SLASH}]`;
+
+/**
+ * Posix glob regex
+ */
+
+const DOT_LITERAL = '\\.';
+const PLUS_LITERAL = '\\+';
+const QMARK_LITERAL = '\\?';
+const SLASH_LITERAL = '\\/';
+const ONE_CHAR = '(?=.)';
+const QMARK = '[^/]';
+const END_ANCHOR = `(?:${SLASH_LITERAL}|$)`;
+const START_ANCHOR = `(?:^|${SLASH_LITERAL})`;
+const DOTS_SLASH = `${DOT_LITERAL}{1,2}${END_ANCHOR}`;
+const NO_DOT = `(?!${DOT_LITERAL})`;
+const NO_DOTS = `(?!${START_ANCHOR}${DOTS_SLASH})`;
+const NO_DOT_SLASH = `(?!${DOT_LITERAL}{0,1}${END_ANCHOR})`;
+const NO_DOTS_SLASH = `(?!${DOTS_SLASH})`;
+const QMARK_NO_DOT = `[^.${SLASH_LITERAL}]`;
+const STAR = `${QMARK}*?`;
+const SEP = '/';
+
+const POSIX_CHARS = {
+ DOT_LITERAL,
+ PLUS_LITERAL,
+ QMARK_LITERAL,
+ SLASH_LITERAL,
+ ONE_CHAR,
+ QMARK,
+ END_ANCHOR,
+ DOTS_SLASH,
+ NO_DOT,
+ NO_DOTS,
+ NO_DOT_SLASH,
+ NO_DOTS_SLASH,
+ QMARK_NO_DOT,
+ STAR,
+ START_ANCHOR,
+ SEP
+};
+
+/**
+ * Windows glob regex
+ */
+
+const WINDOWS_CHARS = {
+ ...POSIX_CHARS,
+
+ SLASH_LITERAL: `[${WIN_SLASH}]`,
+ QMARK: WIN_NO_SLASH,
+ STAR: `${WIN_NO_SLASH}*?`,
+ DOTS_SLASH: `${DOT_LITERAL}{1,2}(?:[${WIN_SLASH}]|$)`,
+ NO_DOT: `(?!${DOT_LITERAL})`,
+ NO_DOTS: `(?!(?:^|[${WIN_SLASH}])${DOT_LITERAL}{1,2}(?:[${WIN_SLASH}]|$))`,
+ NO_DOT_SLASH: `(?!${DOT_LITERAL}{0,1}(?:[${WIN_SLASH}]|$))`,
+ NO_DOTS_SLASH: `(?!${DOT_LITERAL}{1,2}(?:[${WIN_SLASH}]|$))`,
+ QMARK_NO_DOT: `[^.${WIN_SLASH}]`,
+ START_ANCHOR: `(?:^|[${WIN_SLASH}])`,
+ END_ANCHOR: `(?:[${WIN_SLASH}]|$)`,
+ SEP: '\\'
+};
+
+/**
+ * POSIX Bracket Regex
+ */
+
+const POSIX_REGEX_SOURCE = {
+ alnum: 'a-zA-Z0-9',
+ alpha: 'a-zA-Z',
+ ascii: '\\x00-\\x7F',
+ blank: ' \\t',
+ cntrl: '\\x00-\\x1F\\x7F',
+ digit: '0-9',
+ graph: '\\x21-\\x7E',
+ lower: 'a-z',
+ print: '\\x20-\\x7E ',
+ punct: '\\-!"#$%&\'()\\*+,./:;<=>?@[\\]^_`{|}~',
+ space: ' \\t\\r\\n\\v\\f',
+ upper: 'A-Z',
+ word: 'A-Za-z0-9_',
+ xdigit: 'A-Fa-f0-9'
+};
+
+module.exports = {
+ MAX_LENGTH: 1024 * 64,
+ POSIX_REGEX_SOURCE,
+
+ // regular expressions
+ REGEX_BACKSLASH: /\\(?![*+?^${}(|)[\]])/g,
+ REGEX_NON_SPECIAL_CHARS: /^[^@![\].,$*+?^{}()|\\/]+/,
+ REGEX_SPECIAL_CHARS: /[-*+?.^${}(|)[\]]/,
+ REGEX_SPECIAL_CHARS_BACKREF: /(\\?)((\W)(\3*))/g,
+ REGEX_SPECIAL_CHARS_GLOBAL: /([-*+?.^${}(|)[\]])/g,
+ REGEX_REMOVE_BACKSLASH: /(?:\[.*?[^\\]\]|\\(?=.))/g,
+
+ // Replace globs with equivalent patterns to reduce parsing time.
+ REPLACEMENTS: {
+ __proto__: null,
+ '***': '*',
+ '**/**': '**',
+ '**/**/**': '**'
+ },
+
+ // Digits
+ CHAR_0: 48, /* 0 */
+ CHAR_9: 57, /* 9 */
+
+ // Alphabet chars.
+ CHAR_UPPERCASE_A: 65, /* A */
+ CHAR_LOWERCASE_A: 97, /* a */
+ CHAR_UPPERCASE_Z: 90, /* Z */
+ CHAR_LOWERCASE_Z: 122, /* z */
+
+ CHAR_LEFT_PARENTHESES: 40, /* ( */
+ CHAR_RIGHT_PARENTHESES: 41, /* ) */
+
+ CHAR_ASTERISK: 42, /* * */
+
+ // Non-alphabetic chars.
+ CHAR_AMPERSAND: 38, /* & */
+ CHAR_AT: 64, /* @ */
+ CHAR_BACKWARD_SLASH: 92, /* \ */
+ CHAR_CARRIAGE_RETURN: 13, /* \r */
+ CHAR_CIRCUMFLEX_ACCENT: 94, /* ^ */
+ CHAR_COLON: 58, /* : */
+ CHAR_COMMA: 44, /* , */
+ CHAR_DOT: 46, /* . */
+ CHAR_DOUBLE_QUOTE: 34, /* " */
+ CHAR_EQUAL: 61, /* = */
+ CHAR_EXCLAMATION_MARK: 33, /* ! */
+ CHAR_FORM_FEED: 12, /* \f */
+ CHAR_FORWARD_SLASH: 47, /* / */
+ CHAR_GRAVE_ACCENT: 96, /* ` */
+ CHAR_HASH: 35, /* # */
+ CHAR_HYPHEN_MINUS: 45, /* - */
+ CHAR_LEFT_ANGLE_BRACKET: 60, /* < */
+ CHAR_LEFT_CURLY_BRACE: 123, /* { */
+ CHAR_LEFT_SQUARE_BRACKET: 91, /* [ */
+ CHAR_LINE_FEED: 10, /* \n */
+ CHAR_NO_BREAK_SPACE: 160, /* \u00A0 */
+ CHAR_PERCENT: 37, /* % */
+ CHAR_PLUS: 43, /* + */
+ CHAR_QUESTION_MARK: 63, /* ? */
+ CHAR_RIGHT_ANGLE_BRACKET: 62, /* > */
+ CHAR_RIGHT_CURLY_BRACE: 125, /* } */
+ CHAR_RIGHT_SQUARE_BRACKET: 93, /* ] */
+ CHAR_SEMICOLON: 59, /* ; */
+ CHAR_SINGLE_QUOTE: 39, /* ' */
+ CHAR_SPACE: 32, /* */
+ CHAR_TAB: 9, /* \t */
+ CHAR_UNDERSCORE: 95, /* _ */
+ CHAR_VERTICAL_LINE: 124, /* | */
+ CHAR_ZERO_WIDTH_NOBREAK_SPACE: 65279, /* \uFEFF */
+
+ /**
+ * Create EXTGLOB_CHARS
+ */
+
+ extglobChars(chars) {
+ return {
+ '!': { type: 'negate', open: '(?:(?!(?:', close: `))${chars.STAR})` },
+ '?': { type: 'qmark', open: '(?:', close: ')?' },
+ '+': { type: 'plus', open: '(?:', close: ')+' },
+ '*': { type: 'star', open: '(?:', close: ')*' },
+ '@': { type: 'at', open: '(?:', close: ')' }
+ };
+ },
+
+ /**
+ * Create GLOB_CHARS
+ */
+
+ globChars(win32) {
+ return win32 === true ? WINDOWS_CHARS : POSIX_CHARS;
+ }
+};
diff --git a/node_modules/picomatch/lib/parse.js b/node_modules/picomatch/lib/parse.js
new file mode 100644
index 0000000000000000000000000000000000000000..8fd8ff499d182f05ffb9aaa342f5ed7541f3d89e
--- /dev/null
+++ b/node_modules/picomatch/lib/parse.js
@@ -0,0 +1,1085 @@
+'use strict';
+
+const constants = require('./constants');
+const utils = require('./utils');
+
+/**
+ * Constants
+ */
+
+const {
+ MAX_LENGTH,
+ POSIX_REGEX_SOURCE,
+ REGEX_NON_SPECIAL_CHARS,
+ REGEX_SPECIAL_CHARS_BACKREF,
+ REPLACEMENTS
+} = constants;
+
+/**
+ * Helpers
+ */
+
+const expandRange = (args, options) => {
+ if (typeof options.expandRange === 'function') {
+ return options.expandRange(...args, options);
+ }
+
+ args.sort();
+ const value = `[${args.join('-')}]`;
+
+ try {
+ /* eslint-disable-next-line no-new */
+ new RegExp(value);
+ } catch (ex) {
+ return args.map(v => utils.escapeRegex(v)).join('..');
+ }
+
+ return value;
+};
+
+/**
+ * Create the message for a syntax error
+ */
+
+const syntaxError = (type, char) => {
+ return `Missing ${type}: "${char}" - use "\\\\${char}" to match literal characters`;
+};
+
+/**
+ * Parse the given input string.
+ * @param {String} input
+ * @param {Object} options
+ * @return {Object}
+ */
+
+const parse = (input, options) => {
+ if (typeof input !== 'string') {
+ throw new TypeError('Expected a string');
+ }
+
+ input = REPLACEMENTS[input] || input;
+
+ const opts = { ...options };
+ const max = typeof opts.maxLength === 'number' ? Math.min(MAX_LENGTH, opts.maxLength) : MAX_LENGTH;
+
+ let len = input.length;
+ if (len > max) {
+ throw new SyntaxError(`Input length: ${len}, exceeds maximum allowed length: ${max}`);
+ }
+
+ const bos = { type: 'bos', value: '', output: opts.prepend || '' };
+ const tokens = [bos];
+
+ const capture = opts.capture ? '' : '?:';
+
+ // create constants based on platform, for windows or posix
+ const PLATFORM_CHARS = constants.globChars(opts.windows);
+ const EXTGLOB_CHARS = constants.extglobChars(PLATFORM_CHARS);
+
+ const {
+ DOT_LITERAL,
+ PLUS_LITERAL,
+ SLASH_LITERAL,
+ ONE_CHAR,
+ DOTS_SLASH,
+ NO_DOT,
+ NO_DOT_SLASH,
+ NO_DOTS_SLASH,
+ QMARK,
+ QMARK_NO_DOT,
+ STAR,
+ START_ANCHOR
+ } = PLATFORM_CHARS;
+
+ const globstar = opts => {
+ return `(${capture}(?:(?!${START_ANCHOR}${opts.dot ? DOTS_SLASH : DOT_LITERAL}).)*?)`;
+ };
+
+ const nodot = opts.dot ? '' : NO_DOT;
+ const qmarkNoDot = opts.dot ? QMARK : QMARK_NO_DOT;
+ let star = opts.bash === true ? globstar(opts) : STAR;
+
+ if (opts.capture) {
+ star = `(${star})`;
+ }
+
+ // minimatch options support
+ if (typeof opts.noext === 'boolean') {
+ opts.noextglob = opts.noext;
+ }
+
+ const state = {
+ input,
+ index: -1,
+ start: 0,
+ dot: opts.dot === true,
+ consumed: '',
+ output: '',
+ prefix: '',
+ backtrack: false,
+ negated: false,
+ brackets: 0,
+ braces: 0,
+ parens: 0,
+ quotes: 0,
+ globstar: false,
+ tokens
+ };
+
+ input = utils.removePrefix(input, state);
+ len = input.length;
+
+ const extglobs = [];
+ const braces = [];
+ const stack = [];
+ let prev = bos;
+ let value;
+
+ /**
+ * Tokenizing helpers
+ */
+
+ const eos = () => state.index === len - 1;
+ const peek = state.peek = (n = 1) => input[state.index + n];
+ const advance = state.advance = () => input[++state.index] || '';
+ const remaining = () => input.slice(state.index + 1);
+ const consume = (value = '', num = 0) => {
+ state.consumed += value;
+ state.index += num;
+ };
+
+ const append = token => {
+ state.output += token.output != null ? token.output : token.value;
+ consume(token.value);
+ };
+
+ const negate = () => {
+ let count = 1;
+
+ while (peek() === '!' && (peek(2) !== '(' || peek(3) === '?')) {
+ advance();
+ state.start++;
+ count++;
+ }
+
+ if (count % 2 === 0) {
+ return false;
+ }
+
+ state.negated = true;
+ state.start++;
+ return true;
+ };
+
+ const increment = type => {
+ state[type]++;
+ stack.push(type);
+ };
+
+ const decrement = type => {
+ state[type]--;
+ stack.pop();
+ };
+
+ /**
+ * Push tokens onto the tokens array. This helper speeds up
+ * tokenizing by 1) helping us avoid backtracking as much as possible,
+ * and 2) helping us avoid creating extra tokens when consecutive
+ * characters are plain text. This improves performance and simplifies
+ * lookbehinds.
+ */
+
+ const push = tok => {
+ if (prev.type === 'globstar') {
+ const isBrace = state.braces > 0 && (tok.type === 'comma' || tok.type === 'brace');
+ const isExtglob = tok.extglob === true || (extglobs.length && (tok.type === 'pipe' || tok.type === 'paren'));
+
+ if (tok.type !== 'slash' && tok.type !== 'paren' && !isBrace && !isExtglob) {
+ state.output = state.output.slice(0, -prev.output.length);
+ prev.type = 'star';
+ prev.value = '*';
+ prev.output = star;
+ state.output += prev.output;
+ }
+ }
+
+ if (extglobs.length && tok.type !== 'paren') {
+ extglobs[extglobs.length - 1].inner += tok.value;
+ }
+
+ if (tok.value || tok.output) append(tok);
+ if (prev && prev.type === 'text' && tok.type === 'text') {
+ prev.output = (prev.output || prev.value) + tok.value;
+ prev.value += tok.value;
+ return;
+ }
+
+ tok.prev = prev;
+ tokens.push(tok);
+ prev = tok;
+ };
+
+ const extglobOpen = (type, value) => {
+ const token = { ...EXTGLOB_CHARS[value], conditions: 1, inner: '' };
+
+ token.prev = prev;
+ token.parens = state.parens;
+ token.output = state.output;
+ const output = (opts.capture ? '(' : '') + token.open;
+
+ increment('parens');
+ push({ type, value, output: state.output ? '' : ONE_CHAR });
+ push({ type: 'paren', extglob: true, value: advance(), output });
+ extglobs.push(token);
+ };
+
+ const extglobClose = token => {
+ let output = token.close + (opts.capture ? ')' : '');
+ let rest;
+
+ if (token.type === 'negate') {
+ let extglobStar = star;
+
+ if (token.inner && token.inner.length > 1 && token.inner.includes('/')) {
+ extglobStar = globstar(opts);
+ }
+
+ if (extglobStar !== star || eos() || /^\)+$/.test(remaining())) {
+ output = token.close = `)$))${extglobStar}`;
+ }
+
+ if (token.inner.includes('*') && (rest = remaining()) && /^\.[^\\/.]+$/.test(rest)) {
+ // Any non-magical string (`.ts`) or even nested expression (`.{ts,tsx}`) can follow after the closing parenthesis.
+ // In this case, we need to parse the string and use it in the output of the original pattern.
+ // Suitable patterns: `/!(*.d).ts`, `/!(*.d).{ts,tsx}`, `**/!(*-dbg).@(js)`.
+ //
+ // Disabling the `fastpaths` option due to a problem with parsing strings as `.ts` in the pattern like `**/!(*.d).ts`.
+ const expression = parse(rest, { ...options, fastpaths: false }).output;
+
+ output = token.close = `)${expression})${extglobStar})`;
+ }
+
+ if (token.prev.type === 'bos') {
+ state.negatedExtglob = true;
+ }
+ }
+
+ push({ type: 'paren', extglob: true, value, output });
+ decrement('parens');
+ };
+
+ /**
+ * Fast paths
+ */
+
+ if (opts.fastpaths !== false && !/(^[*!]|[/()[\]{}"])/.test(input)) {
+ let backslashes = false;
+
+ let output = input.replace(REGEX_SPECIAL_CHARS_BACKREF, (m, esc, chars, first, rest, index) => {
+ if (first === '\\') {
+ backslashes = true;
+ return m;
+ }
+
+ if (first === '?') {
+ if (esc) {
+ return esc + first + (rest ? QMARK.repeat(rest.length) : '');
+ }
+ if (index === 0) {
+ return qmarkNoDot + (rest ? QMARK.repeat(rest.length) : '');
+ }
+ return QMARK.repeat(chars.length);
+ }
+
+ if (first === '.') {
+ return DOT_LITERAL.repeat(chars.length);
+ }
+
+ if (first === '*') {
+ if (esc) {
+ return esc + first + (rest ? star : '');
+ }
+ return star;
+ }
+ return esc ? m : `\\${m}`;
+ });
+
+ if (backslashes === true) {
+ if (opts.unescape === true) {
+ output = output.replace(/\\/g, '');
+ } else {
+ output = output.replace(/\\+/g, m => {
+ return m.length % 2 === 0 ? '\\\\' : (m ? '\\' : '');
+ });
+ }
+ }
+
+ if (output === input && opts.contains === true) {
+ state.output = input;
+ return state;
+ }
+
+ state.output = utils.wrapOutput(output, state, options);
+ return state;
+ }
+
+ /**
+ * Tokenize input until we reach end-of-string
+ */
+
+ while (!eos()) {
+ value = advance();
+
+ if (value === '\u0000') {
+ continue;
+ }
+
+ /**
+ * Escaped characters
+ */
+
+ if (value === '\\') {
+ const next = peek();
+
+ if (next === '/' && opts.bash !== true) {
+ continue;
+ }
+
+ if (next === '.' || next === ';') {
+ continue;
+ }
+
+ if (!next) {
+ value += '\\';
+ push({ type: 'text', value });
+ continue;
+ }
+
+ // collapse slashes to reduce potential for exploits
+ const match = /^\\+/.exec(remaining());
+ let slashes = 0;
+
+ if (match && match[0].length > 2) {
+ slashes = match[0].length;
+ state.index += slashes;
+ if (slashes % 2 !== 0) {
+ value += '\\';
+ }
+ }
+
+ if (opts.unescape === true) {
+ value = advance();
+ } else {
+ value += advance();
+ }
+
+ if (state.brackets === 0) {
+ push({ type: 'text', value });
+ continue;
+ }
+ }
+
+ /**
+ * If we're inside a regex character class, continue
+ * until we reach the closing bracket.
+ */
+
+ if (state.brackets > 0 && (value !== ']' || prev.value === '[' || prev.value === '[^')) {
+ if (opts.posix !== false && value === ':') {
+ const inner = prev.value.slice(1);
+ if (inner.includes('[')) {
+ prev.posix = true;
+
+ if (inner.includes(':')) {
+ const idx = prev.value.lastIndexOf('[');
+ const pre = prev.value.slice(0, idx);
+ const rest = prev.value.slice(idx + 2);
+ const posix = POSIX_REGEX_SOURCE[rest];
+ if (posix) {
+ prev.value = pre + posix;
+ state.backtrack = true;
+ advance();
+
+ if (!bos.output && tokens.indexOf(prev) === 1) {
+ bos.output = ONE_CHAR;
+ }
+ continue;
+ }
+ }
+ }
+ }
+
+ if ((value === '[' && peek() !== ':') || (value === '-' && peek() === ']')) {
+ value = `\\${value}`;
+ }
+
+ if (value === ']' && (prev.value === '[' || prev.value === '[^')) {
+ value = `\\${value}`;
+ }
+
+ if (opts.posix === true && value === '!' && prev.value === '[') {
+ value = '^';
+ }
+
+ prev.value += value;
+ append({ value });
+ continue;
+ }
+
+ /**
+ * If we're inside a quoted string, continue
+ * until we reach the closing double quote.
+ */
+
+ if (state.quotes === 1 && value !== '"') {
+ value = utils.escapeRegex(value);
+ prev.value += value;
+ append({ value });
+ continue;
+ }
+
+ /**
+ * Double quotes
+ */
+
+ if (value === '"') {
+ state.quotes = state.quotes === 1 ? 0 : 1;
+ if (opts.keepQuotes === true) {
+ push({ type: 'text', value });
+ }
+ continue;
+ }
+
+ /**
+ * Parentheses
+ */
+
+ if (value === '(') {
+ increment('parens');
+ push({ type: 'paren', value });
+ continue;
+ }
+
+ if (value === ')') {
+ if (state.parens === 0 && opts.strictBrackets === true) {
+ throw new SyntaxError(syntaxError('opening', '('));
+ }
+
+ const extglob = extglobs[extglobs.length - 1];
+ if (extglob && state.parens === extglob.parens + 1) {
+ extglobClose(extglobs.pop());
+ continue;
+ }
+
+ push({ type: 'paren', value, output: state.parens ? ')' : '\\)' });
+ decrement('parens');
+ continue;
+ }
+
+ /**
+ * Square brackets
+ */
+
+ if (value === '[') {
+ if (opts.nobracket === true || !remaining().includes(']')) {
+ if (opts.nobracket !== true && opts.strictBrackets === true) {
+ throw new SyntaxError(syntaxError('closing', ']'));
+ }
+
+ value = `\\${value}`;
+ } else {
+ increment('brackets');
+ }
+
+ push({ type: 'bracket', value });
+ continue;
+ }
+
+ if (value === ']') {
+ if (opts.nobracket === true || (prev && prev.type === 'bracket' && prev.value.length === 1)) {
+ push({ type: 'text', value, output: `\\${value}` });
+ continue;
+ }
+
+ if (state.brackets === 0) {
+ if (opts.strictBrackets === true) {
+ throw new SyntaxError(syntaxError('opening', '['));
+ }
+
+ push({ type: 'text', value, output: `\\${value}` });
+ continue;
+ }
+
+ decrement('brackets');
+
+ const prevValue = prev.value.slice(1);
+ if (prev.posix !== true && prevValue[0] === '^' && !prevValue.includes('/')) {
+ value = `/${value}`;
+ }
+
+ prev.value += value;
+ append({ value });
+
+ // when literal brackets are explicitly disabled
+ // assume we should match with a regex character class
+ if (opts.literalBrackets === false || utils.hasRegexChars(prevValue)) {
+ continue;
+ }
+
+ const escaped = utils.escapeRegex(prev.value);
+ state.output = state.output.slice(0, -prev.value.length);
+
+ // when literal brackets are explicitly enabled
+ // assume we should escape the brackets to match literal characters
+ if (opts.literalBrackets === true) {
+ state.output += escaped;
+ prev.value = escaped;
+ continue;
+ }
+
+ // when the user specifies nothing, try to match both
+ prev.value = `(${capture}${escaped}|${prev.value})`;
+ state.output += prev.value;
+ continue;
+ }
+
+ /**
+ * Braces
+ */
+
+ if (value === '{' && opts.nobrace !== true) {
+ increment('braces');
+
+ const open = {
+ type: 'brace',
+ value,
+ output: '(',
+ outputIndex: state.output.length,
+ tokensIndex: state.tokens.length
+ };
+
+ braces.push(open);
+ push(open);
+ continue;
+ }
+
+ if (value === '}') {
+ const brace = braces[braces.length - 1];
+
+ if (opts.nobrace === true || !brace) {
+ push({ type: 'text', value, output: value });
+ continue;
+ }
+
+ let output = ')';
+
+ if (brace.dots === true) {
+ const arr = tokens.slice();
+ const range = [];
+
+ for (let i = arr.length - 1; i >= 0; i--) {
+ tokens.pop();
+ if (arr[i].type === 'brace') {
+ break;
+ }
+ if (arr[i].type !== 'dots') {
+ range.unshift(arr[i].value);
+ }
+ }
+
+ output = expandRange(range, opts);
+ state.backtrack = true;
+ }
+
+ if (brace.comma !== true && brace.dots !== true) {
+ const out = state.output.slice(0, brace.outputIndex);
+ const toks = state.tokens.slice(brace.tokensIndex);
+ brace.value = brace.output = '\\{';
+ value = output = '\\}';
+ state.output = out;
+ for (const t of toks) {
+ state.output += (t.output || t.value);
+ }
+ }
+
+ push({ type: 'brace', value, output });
+ decrement('braces');
+ braces.pop();
+ continue;
+ }
+
+ /**
+ * Pipes
+ */
+
+ if (value === '|') {
+ if (extglobs.length > 0) {
+ extglobs[extglobs.length - 1].conditions++;
+ }
+ push({ type: 'text', value });
+ continue;
+ }
+
+ /**
+ * Commas
+ */
+
+ if (value === ',') {
+ let output = value;
+
+ const brace = braces[braces.length - 1];
+ if (brace && stack[stack.length - 1] === 'braces') {
+ brace.comma = true;
+ output = '|';
+ }
+
+ push({ type: 'comma', value, output });
+ continue;
+ }
+
+ /**
+ * Slashes
+ */
+
+ if (value === '/') {
+ // if the beginning of the glob is "./", advance the start
+ // to the current index, and don't add the "./" characters
+ // to the state. This greatly simplifies lookbehinds when
+ // checking for BOS characters like "!" and "." (not "./")
+ if (prev.type === 'dot' && state.index === state.start + 1) {
+ state.start = state.index + 1;
+ state.consumed = '';
+ state.output = '';
+ tokens.pop();
+ prev = bos; // reset "prev" to the first token
+ continue;
+ }
+
+ push({ type: 'slash', value, output: SLASH_LITERAL });
+ continue;
+ }
+
+ /**
+ * Dots
+ */
+
+ if (value === '.') {
+ if (state.braces > 0 && prev.type === 'dot') {
+ if (prev.value === '.') prev.output = DOT_LITERAL;
+ const brace = braces[braces.length - 1];
+ prev.type = 'dots';
+ prev.output += value;
+ prev.value += value;
+ brace.dots = true;
+ continue;
+ }
+
+ if ((state.braces + state.parens) === 0 && prev.type !== 'bos' && prev.type !== 'slash') {
+ push({ type: 'text', value, output: DOT_LITERAL });
+ continue;
+ }
+
+ push({ type: 'dot', value, output: DOT_LITERAL });
+ continue;
+ }
+
+ /**
+ * Question marks
+ */
+
+ if (value === '?') {
+ const isGroup = prev && prev.value === '(';
+ if (!isGroup && opts.noextglob !== true && peek() === '(' && peek(2) !== '?') {
+ extglobOpen('qmark', value);
+ continue;
+ }
+
+ if (prev && prev.type === 'paren') {
+ const next = peek();
+ let output = value;
+
+ if ((prev.value === '(' && !/[!=<:]/.test(next)) || (next === '<' && !/<([!=]|\w+>)/.test(remaining()))) {
+ output = `\\${value}`;
+ }
+
+ push({ type: 'text', value, output });
+ continue;
+ }
+
+ if (opts.dot !== true && (prev.type === 'slash' || prev.type === 'bos')) {
+ push({ type: 'qmark', value, output: QMARK_NO_DOT });
+ continue;
+ }
+
+ push({ type: 'qmark', value, output: QMARK });
+ continue;
+ }
+
+ /**
+ * Exclamation
+ */
+
+ if (value === '!') {
+ if (opts.noextglob !== true && peek() === '(') {
+ if (peek(2) !== '?' || !/[!=<:]/.test(peek(3))) {
+ extglobOpen('negate', value);
+ continue;
+ }
+ }
+
+ if (opts.nonegate !== true && state.index === 0) {
+ negate();
+ continue;
+ }
+ }
+
+ /**
+ * Plus
+ */
+
+ if (value === '+') {
+ if (opts.noextglob !== true && peek() === '(' && peek(2) !== '?') {
+ extglobOpen('plus', value);
+ continue;
+ }
+
+ if ((prev && prev.value === '(') || opts.regex === false) {
+ push({ type: 'plus', value, output: PLUS_LITERAL });
+ continue;
+ }
+
+ if ((prev && (prev.type === 'bracket' || prev.type === 'paren' || prev.type === 'brace')) || state.parens > 0) {
+ push({ type: 'plus', value });
+ continue;
+ }
+
+ push({ type: 'plus', value: PLUS_LITERAL });
+ continue;
+ }
+
+ /**
+ * Plain text
+ */
+
+ if (value === '@') {
+ if (opts.noextglob !== true && peek() === '(' && peek(2) !== '?') {
+ push({ type: 'at', extglob: true, value, output: '' });
+ continue;
+ }
+
+ push({ type: 'text', value });
+ continue;
+ }
+
+ /**
+ * Plain text
+ */
+
+ if (value !== '*') {
+ if (value === '$' || value === '^') {
+ value = `\\${value}`;
+ }
+
+ const match = REGEX_NON_SPECIAL_CHARS.exec(remaining());
+ if (match) {
+ value += match[0];
+ state.index += match[0].length;
+ }
+
+ push({ type: 'text', value });
+ continue;
+ }
+
+ /**
+ * Stars
+ */
+
+ if (prev && (prev.type === 'globstar' || prev.star === true)) {
+ prev.type = 'star';
+ prev.star = true;
+ prev.value += value;
+ prev.output = star;
+ state.backtrack = true;
+ state.globstar = true;
+ consume(value);
+ continue;
+ }
+
+ let rest = remaining();
+ if (opts.noextglob !== true && /^\([^?]/.test(rest)) {
+ extglobOpen('star', value);
+ continue;
+ }
+
+ if (prev.type === 'star') {
+ if (opts.noglobstar === true) {
+ consume(value);
+ continue;
+ }
+
+ const prior = prev.prev;
+ const before = prior.prev;
+ const isStart = prior.type === 'slash' || prior.type === 'bos';
+ const afterStar = before && (before.type === 'star' || before.type === 'globstar');
+
+ if (opts.bash === true && (!isStart || (rest[0] && rest[0] !== '/'))) {
+ push({ type: 'star', value, output: '' });
+ continue;
+ }
+
+ const isBrace = state.braces > 0 && (prior.type === 'comma' || prior.type === 'brace');
+ const isExtglob = extglobs.length && (prior.type === 'pipe' || prior.type === 'paren');
+ if (!isStart && prior.type !== 'paren' && !isBrace && !isExtglob) {
+ push({ type: 'star', value, output: '' });
+ continue;
+ }
+
+ // strip consecutive `/**/`
+ while (rest.slice(0, 3) === '/**') {
+ const after = input[state.index + 4];
+ if (after && after !== '/') {
+ break;
+ }
+ rest = rest.slice(3);
+ consume('/**', 3);
+ }
+
+ if (prior.type === 'bos' && eos()) {
+ prev.type = 'globstar';
+ prev.value += value;
+ prev.output = globstar(opts);
+ state.output = prev.output;
+ state.globstar = true;
+ consume(value);
+ continue;
+ }
+
+ if (prior.type === 'slash' && prior.prev.type !== 'bos' && !afterStar && eos()) {
+ state.output = state.output.slice(0, -(prior.output + prev.output).length);
+ prior.output = `(?:${prior.output}`;
+
+ prev.type = 'globstar';
+ prev.output = globstar(opts) + (opts.strictSlashes ? ')' : '|$)');
+ prev.value += value;
+ state.globstar = true;
+ state.output += prior.output + prev.output;
+ consume(value);
+ continue;
+ }
+
+ if (prior.type === 'slash' && prior.prev.type !== 'bos' && rest[0] === '/') {
+ const end = rest[1] !== void 0 ? '|$' : '';
+
+ state.output = state.output.slice(0, -(prior.output + prev.output).length);
+ prior.output = `(?:${prior.output}`;
+
+ prev.type = 'globstar';
+ prev.output = `${globstar(opts)}${SLASH_LITERAL}|${SLASH_LITERAL}${end})`;
+ prev.value += value;
+
+ state.output += prior.output + prev.output;
+ state.globstar = true;
+
+ consume(value + advance());
+
+ push({ type: 'slash', value: '/', output: '' });
+ continue;
+ }
+
+ if (prior.type === 'bos' && rest[0] === '/') {
+ prev.type = 'globstar';
+ prev.value += value;
+ prev.output = `(?:^|${SLASH_LITERAL}|${globstar(opts)}${SLASH_LITERAL})`;
+ state.output = prev.output;
+ state.globstar = true;
+ consume(value + advance());
+ push({ type: 'slash', value: '/', output: '' });
+ continue;
+ }
+
+ // remove single star from output
+ state.output = state.output.slice(0, -prev.output.length);
+
+ // reset previous token to globstar
+ prev.type = 'globstar';
+ prev.output = globstar(opts);
+ prev.value += value;
+
+ // reset output with globstar
+ state.output += prev.output;
+ state.globstar = true;
+ consume(value);
+ continue;
+ }
+
+ const token = { type: 'star', value, output: star };
+
+ if (opts.bash === true) {
+ token.output = '.*?';
+ if (prev.type === 'bos' || prev.type === 'slash') {
+ token.output = nodot + token.output;
+ }
+ push(token);
+ continue;
+ }
+
+ if (prev && (prev.type === 'bracket' || prev.type === 'paren') && opts.regex === true) {
+ token.output = value;
+ push(token);
+ continue;
+ }
+
+ if (state.index === state.start || prev.type === 'slash' || prev.type === 'dot') {
+ if (prev.type === 'dot') {
+ state.output += NO_DOT_SLASH;
+ prev.output += NO_DOT_SLASH;
+
+ } else if (opts.dot === true) {
+ state.output += NO_DOTS_SLASH;
+ prev.output += NO_DOTS_SLASH;
+
+ } else {
+ state.output += nodot;
+ prev.output += nodot;
+ }
+
+ if (peek() !== '*') {
+ state.output += ONE_CHAR;
+ prev.output += ONE_CHAR;
+ }
+ }
+
+ push(token);
+ }
+
+ while (state.brackets > 0) {
+ if (opts.strictBrackets === true) throw new SyntaxError(syntaxError('closing', ']'));
+ state.output = utils.escapeLast(state.output, '[');
+ decrement('brackets');
+ }
+
+ while (state.parens > 0) {
+ if (opts.strictBrackets === true) throw new SyntaxError(syntaxError('closing', ')'));
+ state.output = utils.escapeLast(state.output, '(');
+ decrement('parens');
+ }
+
+ while (state.braces > 0) {
+ if (opts.strictBrackets === true) throw new SyntaxError(syntaxError('closing', '}'));
+ state.output = utils.escapeLast(state.output, '{');
+ decrement('braces');
+ }
+
+ if (opts.strictSlashes !== true && (prev.type === 'star' || prev.type === 'bracket')) {
+ push({ type: 'maybe_slash', value: '', output: `${SLASH_LITERAL}?` });
+ }
+
+ // rebuild the output if we had to backtrack at any point
+ if (state.backtrack === true) {
+ state.output = '';
+
+ for (const token of state.tokens) {
+ state.output += token.output != null ? token.output : token.value;
+
+ if (token.suffix) {
+ state.output += token.suffix;
+ }
+ }
+ }
+
+ return state;
+};
+
+/**
+ * Fast paths for creating regular expressions for common glob patterns.
+ * This can significantly speed up processing and has very little downside
+ * impact when none of the fast paths match.
+ */
+
+parse.fastpaths = (input, options) => {
+ const opts = { ...options };
+ const max = typeof opts.maxLength === 'number' ? Math.min(MAX_LENGTH, opts.maxLength) : MAX_LENGTH;
+ const len = input.length;
+ if (len > max) {
+ throw new SyntaxError(`Input length: ${len}, exceeds maximum allowed length: ${max}`);
+ }
+
+ input = REPLACEMENTS[input] || input;
+
+ // create constants based on platform, for windows or posix
+ const {
+ DOT_LITERAL,
+ SLASH_LITERAL,
+ ONE_CHAR,
+ DOTS_SLASH,
+ NO_DOT,
+ NO_DOTS,
+ NO_DOTS_SLASH,
+ STAR,
+ START_ANCHOR
+ } = constants.globChars(opts.windows);
+
+ const nodot = opts.dot ? NO_DOTS : NO_DOT;
+ const slashDot = opts.dot ? NO_DOTS_SLASH : NO_DOT;
+ const capture = opts.capture ? '' : '?:';
+ const state = { negated: false, prefix: '' };
+ let star = opts.bash === true ? '.*?' : STAR;
+
+ if (opts.capture) {
+ star = `(${star})`;
+ }
+
+ const globstar = opts => {
+ if (opts.noglobstar === true) return star;
+ return `(${capture}(?:(?!${START_ANCHOR}${opts.dot ? DOTS_SLASH : DOT_LITERAL}).)*?)`;
+ };
+
+ const create = str => {
+ switch (str) {
+ case '*':
+ return `${nodot}${ONE_CHAR}${star}`;
+
+ case '.*':
+ return `${DOT_LITERAL}${ONE_CHAR}${star}`;
+
+ case '*.*':
+ return `${nodot}${star}${DOT_LITERAL}${ONE_CHAR}${star}`;
+
+ case '*/*':
+ return `${nodot}${star}${SLASH_LITERAL}${ONE_CHAR}${slashDot}${star}`;
+
+ case '**':
+ return nodot + globstar(opts);
+
+ case '**/*':
+ return `(?:${nodot}${globstar(opts)}${SLASH_LITERAL})?${slashDot}${ONE_CHAR}${star}`;
+
+ case '**/*.*':
+ return `(?:${nodot}${globstar(opts)}${SLASH_LITERAL})?${slashDot}${star}${DOT_LITERAL}${ONE_CHAR}${star}`;
+
+ case '**/.*':
+ return `(?:${nodot}${globstar(opts)}${SLASH_LITERAL})?${DOT_LITERAL}${ONE_CHAR}${star}`;
+
+ default: {
+ const match = /^(.*?)\.(\w+)$/.exec(str);
+ if (!match) return;
+
+ const source = create(match[1]);
+ if (!source) return;
+
+ return source + DOT_LITERAL + match[2];
+ }
+ }
+ };
+
+ const output = utils.removePrefix(input, state);
+ let source = create(output);
+
+ if (source && opts.strictSlashes !== true) {
+ source += `${SLASH_LITERAL}?`;
+ }
+
+ return source;
+};
+
+module.exports = parse;
diff --git a/node_modules/picomatch/lib/picomatch.js b/node_modules/picomatch/lib/picomatch.js
new file mode 100644
index 0000000000000000000000000000000000000000..d0ebd9f163cf240a00998dec9ed69523d1405b4d
--- /dev/null
+++ b/node_modules/picomatch/lib/picomatch.js
@@ -0,0 +1,341 @@
+'use strict';
+
+const scan = require('./scan');
+const parse = require('./parse');
+const utils = require('./utils');
+const constants = require('./constants');
+const isObject = val => val && typeof val === 'object' && !Array.isArray(val);
+
+/**
+ * Creates a matcher function from one or more glob patterns. The
+ * returned function takes a string to match as its first argument,
+ * and returns true if the string is a match. The returned matcher
+ * function also takes a boolean as the second argument that, when true,
+ * returns an object with additional information.
+ *
+ * ```js
+ * const picomatch = require('picomatch');
+ * // picomatch(glob[, options]);
+ *
+ * const isMatch = picomatch('*.!(*a)');
+ * console.log(isMatch('a.a')); //=> false
+ * console.log(isMatch('a.b')); //=> true
+ * ```
+ * @name picomatch
+ * @param {String|Array} `globs` One or more glob patterns.
+ * @param {Object=} `options`
+ * @return {Function=} Returns a matcher function.
+ * @api public
+ */
+
+const picomatch = (glob, options, returnState = false) => {
+ if (Array.isArray(glob)) {
+ const fns = glob.map(input => picomatch(input, options, returnState));
+ const arrayMatcher = str => {
+ for (const isMatch of fns) {
+ const state = isMatch(str);
+ if (state) return state;
+ }
+ return false;
+ };
+ return arrayMatcher;
+ }
+
+ const isState = isObject(glob) && glob.tokens && glob.input;
+
+ if (glob === '' || (typeof glob !== 'string' && !isState)) {
+ throw new TypeError('Expected pattern to be a non-empty string');
+ }
+
+ const opts = options || {};
+ const posix = opts.windows;
+ const regex = isState
+ ? picomatch.compileRe(glob, options)
+ : picomatch.makeRe(glob, options, false, true);
+
+ const state = regex.state;
+ delete regex.state;
+
+ let isIgnored = () => false;
+ if (opts.ignore) {
+ const ignoreOpts = { ...options, ignore: null, onMatch: null, onResult: null };
+ isIgnored = picomatch(opts.ignore, ignoreOpts, returnState);
+ }
+
+ const matcher = (input, returnObject = false) => {
+ const { isMatch, match, output } = picomatch.test(input, regex, options, { glob, posix });
+ const result = { glob, state, regex, posix, input, output, match, isMatch };
+
+ if (typeof opts.onResult === 'function') {
+ opts.onResult(result);
+ }
+
+ if (isMatch === false) {
+ result.isMatch = false;
+ return returnObject ? result : false;
+ }
+
+ if (isIgnored(input)) {
+ if (typeof opts.onIgnore === 'function') {
+ opts.onIgnore(result);
+ }
+ result.isMatch = false;
+ return returnObject ? result : false;
+ }
+
+ if (typeof opts.onMatch === 'function') {
+ opts.onMatch(result);
+ }
+ return returnObject ? result : true;
+ };
+
+ if (returnState) {
+ matcher.state = state;
+ }
+
+ return matcher;
+};
+
+/**
+ * Test `input` with the given `regex`. This is used by the main
+ * `picomatch()` function to test the input string.
+ *
+ * ```js
+ * const picomatch = require('picomatch');
+ * // picomatch.test(input, regex[, options]);
+ *
+ * console.log(picomatch.test('foo/bar', /^(?:([^/]*?)\/([^/]*?))$/));
+ * // { isMatch: true, match: [ 'foo/', 'foo', 'bar' ], output: 'foo/bar' }
+ * ```
+ * @param {String} `input` String to test.
+ * @param {RegExp} `regex`
+ * @return {Object} Returns an object with matching info.
+ * @api public
+ */
+
+picomatch.test = (input, regex, options, { glob, posix } = {}) => {
+ if (typeof input !== 'string') {
+ throw new TypeError('Expected input to be a string');
+ }
+
+ if (input === '') {
+ return { isMatch: false, output: '' };
+ }
+
+ const opts = options || {};
+ const format = opts.format || (posix ? utils.toPosixSlashes : null);
+ let match = input === glob;
+ let output = (match && format) ? format(input) : input;
+
+ if (match === false) {
+ output = format ? format(input) : input;
+ match = output === glob;
+ }
+
+ if (match === false || opts.capture === true) {
+ if (opts.matchBase === true || opts.basename === true) {
+ match = picomatch.matchBase(input, regex, options, posix);
+ } else {
+ match = regex.exec(output);
+ }
+ }
+
+ return { isMatch: Boolean(match), match, output };
+};
+
+/**
+ * Match the basename of a filepath.
+ *
+ * ```js
+ * const picomatch = require('picomatch');
+ * // picomatch.matchBase(input, glob[, options]);
+ * console.log(picomatch.matchBase('foo/bar.js', '*.js'); // true
+ * ```
+ * @param {String} `input` String to test.
+ * @param {RegExp|String} `glob` Glob pattern or regex created by [.makeRe](#makeRe).
+ * @return {Boolean}
+ * @api public
+ */
+
+picomatch.matchBase = (input, glob, options) => {
+ const regex = glob instanceof RegExp ? glob : picomatch.makeRe(glob, options);
+ return regex.test(utils.basename(input));
+};
+
+/**
+ * Returns true if **any** of the given glob `patterns` match the specified `string`.
+ *
+ * ```js
+ * const picomatch = require('picomatch');
+ * // picomatch.isMatch(string, patterns[, options]);
+ *
+ * console.log(picomatch.isMatch('a.a', ['b.*', '*.a'])); //=> true
+ * console.log(picomatch.isMatch('a.a', 'b.*')); //=> false
+ * ```
+ * @param {String|Array} str The string to test.
+ * @param {String|Array} patterns One or more glob patterns to use for matching.
+ * @param {Object} [options] See available [options](#options).
+ * @return {Boolean} Returns true if any patterns match `str`
+ * @api public
+ */
+
+picomatch.isMatch = (str, patterns, options) => picomatch(patterns, options)(str);
+
+/**
+ * Parse a glob pattern to create the source string for a regular
+ * expression.
+ *
+ * ```js
+ * const picomatch = require('picomatch');
+ * const result = picomatch.parse(pattern[, options]);
+ * ```
+ * @param {String} `pattern`
+ * @param {Object} `options`
+ * @return {Object} Returns an object with useful properties and output to be used as a regex source string.
+ * @api public
+ */
+
+picomatch.parse = (pattern, options) => {
+ if (Array.isArray(pattern)) return pattern.map(p => picomatch.parse(p, options));
+ return parse(pattern, { ...options, fastpaths: false });
+};
+
+/**
+ * Scan a glob pattern to separate the pattern into segments.
+ *
+ * ```js
+ * const picomatch = require('picomatch');
+ * // picomatch.scan(input[, options]);
+ *
+ * const result = picomatch.scan('!./foo/*.js');
+ * console.log(result);
+ * { prefix: '!./',
+ * input: '!./foo/*.js',
+ * start: 3,
+ * base: 'foo',
+ * glob: '*.js',
+ * isBrace: false,
+ * isBracket: false,
+ * isGlob: true,
+ * isExtglob: false,
+ * isGlobstar: false,
+ * negated: true }
+ * ```
+ * @param {String} `input` Glob pattern to scan.
+ * @param {Object} `options`
+ * @return {Object} Returns an object with
+ * @api public
+ */
+
+picomatch.scan = (input, options) => scan(input, options);
+
+/**
+ * Compile a regular expression from the `state` object returned by the
+ * [parse()](#parse) method.
+ *
+ * @param {Object} `state`
+ * @param {Object} `options`
+ * @param {Boolean} `returnOutput` Intended for implementors, this argument allows you to return the raw output from the parser.
+ * @param {Boolean} `returnState` Adds the state to a `state` property on the returned regex. Useful for implementors and debugging.
+ * @return {RegExp}
+ * @api public
+ */
+
+picomatch.compileRe = (state, options, returnOutput = false, returnState = false) => {
+ if (returnOutput === true) {
+ return state.output;
+ }
+
+ const opts = options || {};
+ const prepend = opts.contains ? '' : '^';
+ const append = opts.contains ? '' : '$';
+
+ let source = `${prepend}(?:${state.output})${append}`;
+ if (state && state.negated === true) {
+ source = `^(?!${source}).*$`;
+ }
+
+ const regex = picomatch.toRegex(source, options);
+ if (returnState === true) {
+ regex.state = state;
+ }
+
+ return regex;
+};
+
+/**
+ * Create a regular expression from a parsed glob pattern.
+ *
+ * ```js
+ * const picomatch = require('picomatch');
+ * const state = picomatch.parse('*.js');
+ * // picomatch.compileRe(state[, options]);
+ *
+ * console.log(picomatch.compileRe(state));
+ * //=> /^(?:(?!\.)(?=.)[^/]*?\.js)$/
+ * ```
+ * @param {String} `state` The object returned from the `.parse` method.
+ * @param {Object} `options`
+ * @param {Boolean} `returnOutput` Implementors may use this argument to return the compiled output, instead of a regular expression. This is not exposed on the options to prevent end-users from mutating the result.
+ * @param {Boolean} `returnState` Implementors may use this argument to return the state from the parsed glob with the returned regular expression.
+ * @return {RegExp} Returns a regex created from the given pattern.
+ * @api public
+ */
+
+picomatch.makeRe = (input, options = {}, returnOutput = false, returnState = false) => {
+ if (!input || typeof input !== 'string') {
+ throw new TypeError('Expected a non-empty string');
+ }
+
+ let parsed = { negated: false, fastpaths: true };
+
+ if (options.fastpaths !== false && (input[0] === '.' || input[0] === '*')) {
+ parsed.output = parse.fastpaths(input, options);
+ }
+
+ if (!parsed.output) {
+ parsed = parse(input, options);
+ }
+
+ return picomatch.compileRe(parsed, options, returnOutput, returnState);
+};
+
+/**
+ * Create a regular expression from the given regex source string.
+ *
+ * ```js
+ * const picomatch = require('picomatch');
+ * // picomatch.toRegex(source[, options]);
+ *
+ * const { output } = picomatch.parse('*.js');
+ * console.log(picomatch.toRegex(output));
+ * //=> /^(?:(?!\.)(?=.)[^/]*?\.js)$/
+ * ```
+ * @param {String} `source` Regular expression source string.
+ * @param {Object} `options`
+ * @return {RegExp}
+ * @api public
+ */
+
+picomatch.toRegex = (source, options) => {
+ try {
+ const opts = options || {};
+ return new RegExp(source, opts.flags || (opts.nocase ? 'i' : ''));
+ } catch (err) {
+ if (options && options.debug === true) throw err;
+ return /$^/;
+ }
+};
+
+/**
+ * Picomatch constants.
+ * @return {Object}
+ */
+
+picomatch.constants = constants;
+
+/**
+ * Expose "picomatch"
+ */
+
+module.exports = picomatch;
diff --git a/node_modules/picomatch/lib/scan.js b/node_modules/picomatch/lib/scan.js
new file mode 100644
index 0000000000000000000000000000000000000000..e59cd7a1357b184b0c70409b161fcf0ce5433af1
--- /dev/null
+++ b/node_modules/picomatch/lib/scan.js
@@ -0,0 +1,391 @@
+'use strict';
+
+const utils = require('./utils');
+const {
+ CHAR_ASTERISK, /* * */
+ CHAR_AT, /* @ */
+ CHAR_BACKWARD_SLASH, /* \ */
+ CHAR_COMMA, /* , */
+ CHAR_DOT, /* . */
+ CHAR_EXCLAMATION_MARK, /* ! */
+ CHAR_FORWARD_SLASH, /* / */
+ CHAR_LEFT_CURLY_BRACE, /* { */
+ CHAR_LEFT_PARENTHESES, /* ( */
+ CHAR_LEFT_SQUARE_BRACKET, /* [ */
+ CHAR_PLUS, /* + */
+ CHAR_QUESTION_MARK, /* ? */
+ CHAR_RIGHT_CURLY_BRACE, /* } */
+ CHAR_RIGHT_PARENTHESES, /* ) */
+ CHAR_RIGHT_SQUARE_BRACKET /* ] */
+} = require('./constants');
+
+const isPathSeparator = code => {
+ return code === CHAR_FORWARD_SLASH || code === CHAR_BACKWARD_SLASH;
+};
+
+const depth = token => {
+ if (token.isPrefix !== true) {
+ token.depth = token.isGlobstar ? Infinity : 1;
+ }
+};
+
+/**
+ * Quickly scans a glob pattern and returns an object with a handful of
+ * useful properties, like `isGlob`, `path` (the leading non-glob, if it exists),
+ * `glob` (the actual pattern), `negated` (true if the path starts with `!` but not
+ * with `!(`) and `negatedExtglob` (true if the path starts with `!(`).
+ *
+ * ```js
+ * const pm = require('picomatch');
+ * console.log(pm.scan('foo/bar/*.js'));
+ * { isGlob: true, input: 'foo/bar/*.js', base: 'foo/bar', glob: '*.js' }
+ * ```
+ * @param {String} `str`
+ * @param {Object} `options`
+ * @return {Object} Returns an object with tokens and regex source string.
+ * @api public
+ */
+
+const scan = (input, options) => {
+ const opts = options || {};
+
+ const length = input.length - 1;
+ const scanToEnd = opts.parts === true || opts.scanToEnd === true;
+ const slashes = [];
+ const tokens = [];
+ const parts = [];
+
+ let str = input;
+ let index = -1;
+ let start = 0;
+ let lastIndex = 0;
+ let isBrace = false;
+ let isBracket = false;
+ let isGlob = false;
+ let isExtglob = false;
+ let isGlobstar = false;
+ let braceEscaped = false;
+ let backslashes = false;
+ let negated = false;
+ let negatedExtglob = false;
+ let finished = false;
+ let braces = 0;
+ let prev;
+ let code;
+ let token = { value: '', depth: 0, isGlob: false };
+
+ const eos = () => index >= length;
+ const peek = () => str.charCodeAt(index + 1);
+ const advance = () => {
+ prev = code;
+ return str.charCodeAt(++index);
+ };
+
+ while (index < length) {
+ code = advance();
+ let next;
+
+ if (code === CHAR_BACKWARD_SLASH) {
+ backslashes = token.backslashes = true;
+ code = advance();
+
+ if (code === CHAR_LEFT_CURLY_BRACE) {
+ braceEscaped = true;
+ }
+ continue;
+ }
+
+ if (braceEscaped === true || code === CHAR_LEFT_CURLY_BRACE) {
+ braces++;
+
+ while (eos() !== true && (code = advance())) {
+ if (code === CHAR_BACKWARD_SLASH) {
+ backslashes = token.backslashes = true;
+ advance();
+ continue;
+ }
+
+ if (code === CHAR_LEFT_CURLY_BRACE) {
+ braces++;
+ continue;
+ }
+
+ if (braceEscaped !== true && code === CHAR_DOT && (code = advance()) === CHAR_DOT) {
+ isBrace = token.isBrace = true;
+ isGlob = token.isGlob = true;
+ finished = true;
+
+ if (scanToEnd === true) {
+ continue;
+ }
+
+ break;
+ }
+
+ if (braceEscaped !== true && code === CHAR_COMMA) {
+ isBrace = token.isBrace = true;
+ isGlob = token.isGlob = true;
+ finished = true;
+
+ if (scanToEnd === true) {
+ continue;
+ }
+
+ break;
+ }
+
+ if (code === CHAR_RIGHT_CURLY_BRACE) {
+ braces--;
+
+ if (braces === 0) {
+ braceEscaped = false;
+ isBrace = token.isBrace = true;
+ finished = true;
+ break;
+ }
+ }
+ }
+
+ if (scanToEnd === true) {
+ continue;
+ }
+
+ break;
+ }
+
+ if (code === CHAR_FORWARD_SLASH) {
+ slashes.push(index);
+ tokens.push(token);
+ token = { value: '', depth: 0, isGlob: false };
+
+ if (finished === true) continue;
+ if (prev === CHAR_DOT && index === (start + 1)) {
+ start += 2;
+ continue;
+ }
+
+ lastIndex = index + 1;
+ continue;
+ }
+
+ if (opts.noext !== true) {
+ const isExtglobChar = code === CHAR_PLUS
+ || code === CHAR_AT
+ || code === CHAR_ASTERISK
+ || code === CHAR_QUESTION_MARK
+ || code === CHAR_EXCLAMATION_MARK;
+
+ if (isExtglobChar === true && peek() === CHAR_LEFT_PARENTHESES) {
+ isGlob = token.isGlob = true;
+ isExtglob = token.isExtglob = true;
+ finished = true;
+ if (code === CHAR_EXCLAMATION_MARK && index === start) {
+ negatedExtglob = true;
+ }
+
+ if (scanToEnd === true) {
+ while (eos() !== true && (code = advance())) {
+ if (code === CHAR_BACKWARD_SLASH) {
+ backslashes = token.backslashes = true;
+ code = advance();
+ continue;
+ }
+
+ if (code === CHAR_RIGHT_PARENTHESES) {
+ isGlob = token.isGlob = true;
+ finished = true;
+ break;
+ }
+ }
+ continue;
+ }
+ break;
+ }
+ }
+
+ if (code === CHAR_ASTERISK) {
+ if (prev === CHAR_ASTERISK) isGlobstar = token.isGlobstar = true;
+ isGlob = token.isGlob = true;
+ finished = true;
+
+ if (scanToEnd === true) {
+ continue;
+ }
+ break;
+ }
+
+ if (code === CHAR_QUESTION_MARK) {
+ isGlob = token.isGlob = true;
+ finished = true;
+
+ if (scanToEnd === true) {
+ continue;
+ }
+ break;
+ }
+
+ if (code === CHAR_LEFT_SQUARE_BRACKET) {
+ while (eos() !== true && (next = advance())) {
+ if (next === CHAR_BACKWARD_SLASH) {
+ backslashes = token.backslashes = true;
+ advance();
+ continue;
+ }
+
+ if (next === CHAR_RIGHT_SQUARE_BRACKET) {
+ isBracket = token.isBracket = true;
+ isGlob = token.isGlob = true;
+ finished = true;
+ break;
+ }
+ }
+
+ if (scanToEnd === true) {
+ continue;
+ }
+
+ break;
+ }
+
+ if (opts.nonegate !== true && code === CHAR_EXCLAMATION_MARK && index === start) {
+ negated = token.negated = true;
+ start++;
+ continue;
+ }
+
+ if (opts.noparen !== true && code === CHAR_LEFT_PARENTHESES) {
+ isGlob = token.isGlob = true;
+
+ if (scanToEnd === true) {
+ while (eos() !== true && (code = advance())) {
+ if (code === CHAR_LEFT_PARENTHESES) {
+ backslashes = token.backslashes = true;
+ code = advance();
+ continue;
+ }
+
+ if (code === CHAR_RIGHT_PARENTHESES) {
+ finished = true;
+ break;
+ }
+ }
+ continue;
+ }
+ break;
+ }
+
+ if (isGlob === true) {
+ finished = true;
+
+ if (scanToEnd === true) {
+ continue;
+ }
+
+ break;
+ }
+ }
+
+ if (opts.noext === true) {
+ isExtglob = false;
+ isGlob = false;
+ }
+
+ let base = str;
+ let prefix = '';
+ let glob = '';
+
+ if (start > 0) {
+ prefix = str.slice(0, start);
+ str = str.slice(start);
+ lastIndex -= start;
+ }
+
+ if (base && isGlob === true && lastIndex > 0) {
+ base = str.slice(0, lastIndex);
+ glob = str.slice(lastIndex);
+ } else if (isGlob === true) {
+ base = '';
+ glob = str;
+ } else {
+ base = str;
+ }
+
+ if (base && base !== '' && base !== '/' && base !== str) {
+ if (isPathSeparator(base.charCodeAt(base.length - 1))) {
+ base = base.slice(0, -1);
+ }
+ }
+
+ if (opts.unescape === true) {
+ if (glob) glob = utils.removeBackslashes(glob);
+
+ if (base && backslashes === true) {
+ base = utils.removeBackslashes(base);
+ }
+ }
+
+ const state = {
+ prefix,
+ input,
+ start,
+ base,
+ glob,
+ isBrace,
+ isBracket,
+ isGlob,
+ isExtglob,
+ isGlobstar,
+ negated,
+ negatedExtglob
+ };
+
+ if (opts.tokens === true) {
+ state.maxDepth = 0;
+ if (!isPathSeparator(code)) {
+ tokens.push(token);
+ }
+ state.tokens = tokens;
+ }
+
+ if (opts.parts === true || opts.tokens === true) {
+ let prevIndex;
+
+ for (let idx = 0; idx < slashes.length; idx++) {
+ const n = prevIndex ? prevIndex + 1 : start;
+ const i = slashes[idx];
+ const value = input.slice(n, i);
+ if (opts.tokens) {
+ if (idx === 0 && start !== 0) {
+ tokens[idx].isPrefix = true;
+ tokens[idx].value = prefix;
+ } else {
+ tokens[idx].value = value;
+ }
+ depth(tokens[idx]);
+ state.maxDepth += tokens[idx].depth;
+ }
+ if (idx !== 0 || value !== '') {
+ parts.push(value);
+ }
+ prevIndex = i;
+ }
+
+ if (prevIndex && prevIndex + 1 < input.length) {
+ const value = input.slice(prevIndex + 1);
+ parts.push(value);
+
+ if (opts.tokens) {
+ tokens[tokens.length - 1].value = value;
+ depth(tokens[tokens.length - 1]);
+ state.maxDepth += tokens[tokens.length - 1].depth;
+ }
+ }
+
+ state.slashes = slashes;
+ state.parts = parts;
+ }
+
+ return state;
+};
+
+module.exports = scan;
diff --git a/node_modules/picomatch/lib/utils.js b/node_modules/picomatch/lib/utils.js
new file mode 100644
index 0000000000000000000000000000000000000000..9c97cae222ca82d7fc6fa29f2770212e0270bc03
--- /dev/null
+++ b/node_modules/picomatch/lib/utils.js
@@ -0,0 +1,72 @@
+/*global navigator*/
+'use strict';
+
+const {
+ REGEX_BACKSLASH,
+ REGEX_REMOVE_BACKSLASH,
+ REGEX_SPECIAL_CHARS,
+ REGEX_SPECIAL_CHARS_GLOBAL
+} = require('./constants');
+
+exports.isObject = val => val !== null && typeof val === 'object' && !Array.isArray(val);
+exports.hasRegexChars = str => REGEX_SPECIAL_CHARS.test(str);
+exports.isRegexChar = str => str.length === 1 && exports.hasRegexChars(str);
+exports.escapeRegex = str => str.replace(REGEX_SPECIAL_CHARS_GLOBAL, '\\$1');
+exports.toPosixSlashes = str => str.replace(REGEX_BACKSLASH, '/');
+
+exports.isWindows = () => {
+ if (typeof navigator !== 'undefined' && navigator.platform) {
+ const platform = navigator.platform.toLowerCase();
+ return platform === 'win32' || platform === 'windows';
+ }
+
+ if (typeof process !== 'undefined' && process.platform) {
+ return process.platform === 'win32';
+ }
+
+ return false;
+};
+
+exports.removeBackslashes = str => {
+ return str.replace(REGEX_REMOVE_BACKSLASH, match => {
+ return match === '\\' ? '' : match;
+ });
+};
+
+exports.escapeLast = (input, char, lastIdx) => {
+ const idx = input.lastIndexOf(char, lastIdx);
+ if (idx === -1) return input;
+ if (input[idx - 1] === '\\') return exports.escapeLast(input, char, idx - 1);
+ return `${input.slice(0, idx)}\\${input.slice(idx)}`;
+};
+
+exports.removePrefix = (input, state = {}) => {
+ let output = input;
+ if (output.startsWith('./')) {
+ output = output.slice(2);
+ state.prefix = './';
+ }
+ return output;
+};
+
+exports.wrapOutput = (input, state = {}, options = {}) => {
+ const prepend = options.contains ? '' : '^';
+ const append = options.contains ? '' : '$';
+
+ let output = `${prepend}(?:${input})${append}`;
+ if (state.negated === true) {
+ output = `(?:^(?!${output}).*$)`;
+ }
+ return output;
+};
+
+exports.basename = (path, { windows } = {}) => {
+ const segs = path.split(windows ? /[\\/]/ : '/');
+ const last = segs[segs.length - 1];
+
+ if (last === '') {
+ return segs[segs.length - 2];
+ }
+
+ return last;
+};
diff --git a/node_modules/picomatch/package.json b/node_modules/picomatch/package.json
new file mode 100644
index 0000000000000000000000000000000000000000..372e27e05f412fd2d5ef4c28e4d79df1701bcf4a
--- /dev/null
+++ b/node_modules/picomatch/package.json
@@ -0,0 +1,83 @@
+{
+ "name": "picomatch",
+ "description": "Blazing fast and accurate glob matcher written in JavaScript, with no dependencies and full support for standard and extended Bash glob features, including braces, extglobs, POSIX brackets, and regular expressions.",
+ "version": "4.0.3",
+ "homepage": "https://github.com/micromatch/picomatch",
+ "author": "Jon Schlinkert (https://github.com/jonschlinkert)",
+ "funding": "https://github.com/sponsors/jonschlinkert",
+ "repository": "micromatch/picomatch",
+ "bugs": {
+ "url": "https://github.com/micromatch/picomatch/issues"
+ },
+ "license": "MIT",
+ "files": [
+ "index.js",
+ "posix.js",
+ "lib"
+ ],
+ "sideEffects": false,
+ "main": "index.js",
+ "engines": {
+ "node": ">=12"
+ },
+ "scripts": {
+ "lint": "eslint --cache --cache-location node_modules/.cache/.eslintcache --report-unused-disable-directives --ignore-path .gitignore .",
+ "mocha": "mocha --reporter dot",
+ "test": "npm run lint && npm run mocha",
+ "test:ci": "npm run test:cover",
+ "test:cover": "nyc npm run mocha"
+ },
+ "devDependencies": {
+ "eslint": "^8.57.0",
+ "fill-range": "^7.0.1",
+ "gulp-format-md": "^2.0.0",
+ "mocha": "^10.4.0",
+ "nyc": "^15.1.0",
+ "time-require": "github:jonschlinkert/time-require"
+ },
+ "keywords": [
+ "glob",
+ "match",
+ "picomatch"
+ ],
+ "nyc": {
+ "reporter": [
+ "html",
+ "lcov",
+ "text-summary"
+ ]
+ },
+ "verb": {
+ "toc": {
+ "render": true,
+ "method": "preWrite",
+ "maxdepth": 3
+ },
+ "layout": "empty",
+ "tasks": [
+ "readme"
+ ],
+ "plugins": [
+ "gulp-format-md"
+ ],
+ "lint": {
+ "reflinks": true
+ },
+ "related": {
+ "list": [
+ "braces",
+ "micromatch"
+ ]
+ },
+ "reflinks": [
+ "braces",
+ "expand-brackets",
+ "extglob",
+ "fill-range",
+ "micromatch",
+ "minimatch",
+ "nanomatch",
+ "picomatch"
+ ]
+ }
+}
diff --git a/node_modules/picomatch/posix.js b/node_modules/picomatch/posix.js
new file mode 100644
index 0000000000000000000000000000000000000000..d2f2bc59d0ac7c40b35c574c45bcedbf26263d75
--- /dev/null
+++ b/node_modules/picomatch/posix.js
@@ -0,0 +1,3 @@
+'use strict';
+
+module.exports = require('./lib/picomatch');
diff --git a/node_modules/pkg-dir/index.d.ts b/node_modules/pkg-dir/index.d.ts
new file mode 100644
index 0000000000000000000000000000000000000000..3696e88c87b167977b72aadaf9096105a9175402
--- /dev/null
+++ b/node_modules/pkg-dir/index.d.ts
@@ -0,0 +1,41 @@
+declare const pkgDir: {
+ /**
+ Synchronously find the root directory of a Node.js project or npm package.
+
+ @param cwd - Directory to start from. Default: `process.cwd()`.
+ @returns The project root path or `undefined` if it couldn't be found.
+ */
+ sync: (cwd?: string) => string | undefined;
+
+ /**
+ Find the root directory of a Node.js project or npm package.
+
+ @param cwd - Directory to start from. Default: `process.cwd()`.
+ @returns The project root path or `undefined` if it couldn't be found.
+
+ @example
+ ```
+ // /
+ // └── Users
+ // └── sindresorhus
+ // └── foo
+ // ├── package.json
+ // └── bar
+ // ├── baz
+ // └── example.js
+
+ // example.js
+ import pkgDir = require('pkg-dir');
+
+ (async () => {
+ const rootDir = await pkgDir(__dirname);
+
+ console.log(rootDir);
+ //=> '/Users/sindresorhus/foo'
+ })();
+ ```
+ */
+ (cwd?: string): Promise;
+};
+
+export = pkgDir;
diff --git a/node_modules/pkg-dir/index.js b/node_modules/pkg-dir/index.js
new file mode 100644
index 0000000000000000000000000000000000000000..0f6b1d140601b7d46b3d99c4e881146aef95809f
--- /dev/null
+++ b/node_modules/pkg-dir/index.js
@@ -0,0 +1,15 @@
+'use strict';
+const path = require('path');
+const findUp = require('find-up');
+
+const pkgDir = async cwd => {
+ const filePath = await findUp('package.json', {cwd});
+ return filePath && path.dirname(filePath);
+};
+
+module.exports = pkgDir;
+
+module.exports.sync = cwd => {
+ const filePath = findUp.sync('package.json', {cwd});
+ return filePath && path.dirname(filePath);
+};
diff --git a/node_modules/pkg-dir/license b/node_modules/pkg-dir/license
new file mode 100644
index 0000000000000000000000000000000000000000..fa7ceba3eb4a9657a9db7f3ffca4e4e97a9019de
--- /dev/null
+++ b/node_modules/pkg-dir/license
@@ -0,0 +1,9 @@
+MIT License
+
+Copyright (c) Sindre Sorhus (https://sindresorhus.com)
+
+Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
diff --git a/node_modules/pkg-dir/package.json b/node_modules/pkg-dir/package.json
new file mode 100644
index 0000000000000000000000000000000000000000..6da77163cd555b12d6f9be5440cc7dc13df39269
--- /dev/null
+++ b/node_modules/pkg-dir/package.json
@@ -0,0 +1,56 @@
+{
+ "name": "pkg-dir",
+ "version": "5.0.0",
+ "description": "Find the root directory of a Node.js project or npm package",
+ "license": "MIT",
+ "repository": "sindresorhus/pkg-dir",
+ "author": {
+ "name": "Sindre Sorhus",
+ "email": "sindresorhus@gmail.com",
+ "url": "https://sindresorhus.com"
+ },
+ "engines": {
+ "node": ">=10"
+ },
+ "scripts": {
+ "test": "xo && ava && tsd"
+ },
+ "files": [
+ "index.js",
+ "index.d.ts"
+ ],
+ "keywords": [
+ "package",
+ "json",
+ "root",
+ "npm",
+ "entry",
+ "find",
+ "up",
+ "find-up",
+ "findup",
+ "look-up",
+ "look",
+ "file",
+ "search",
+ "match",
+ "resolve",
+ "parent",
+ "parents",
+ "folder",
+ "directory",
+ "dir",
+ "walk",
+ "walking",
+ "path"
+ ],
+ "dependencies": {
+ "find-up": "^5.0.0"
+ },
+ "devDependencies": {
+ "ava": "^2.4.0",
+ "tempy": "^1.0.0",
+ "tsd": "^0.13.1",
+ "xo": "^0.33.1"
+ }
+}
diff --git a/node_modules/pkg-dir/readme.md b/node_modules/pkg-dir/readme.md
new file mode 100644
index 0000000000000000000000000000000000000000..a81d7afb171dcbb37dfeb571d314bb54814b0f6d
--- /dev/null
+++ b/node_modules/pkg-dir/readme.md
@@ -0,0 +1,69 @@
+# pkg-dir [](https://travis-ci.com/github/sindresorhus/pkg-dir)
+
+> Find the root directory of a Node.js project or npm package
+
+## Install
+
+```
+$ npm install pkg-dir
+```
+
+## Usage
+
+```
+/
+└── Users
+ └── sindresorhus
+ └── foo
+ ├── package.json
+ └── bar
+ ├── baz
+ └── example.js
+```
+
+```js
+// example.js
+const pkgDir = require('pkg-dir');
+
+(async () => {
+ const rootDir = await pkgDir(__dirname);
+
+ console.log(rootDir);
+ //=> '/Users/sindresorhus/foo'
+})();
+```
+
+## API
+
+### pkgDir(cwd?)
+
+Returns a `Promise` for either the project root path or `undefined` if it couldn't be found.
+
+### pkgDir.sync(cwd?)
+
+Returns the project root path or `undefined` if it couldn't be found.
+
+#### cwd
+
+Type: `string`\
+Default: `process.cwd()`
+
+Directory to start from.
+
+## Related
+
+- [pkg-dir-cli](https://github.com/sindresorhus/pkg-dir-cli) - CLI for this module
+- [pkg-up](https://github.com/sindresorhus/pkg-up) - Find the closest package.json file
+- [find-up](https://github.com/sindresorhus/find-up) - Find a file by walking up parent directories
+
+---
+
+
diff --git a/node_modules/playwright-core/LICENSE b/node_modules/playwright-core/LICENSE
new file mode 100644
index 0000000000000000000000000000000000000000..df112373eb2e23e459bf93ec412be1764dc5a38b
--- /dev/null
+++ b/node_modules/playwright-core/LICENSE
@@ -0,0 +1,202 @@
+ Apache License
+ Version 2.0, January 2004
+ http://www.apache.org/licenses/
+
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+ 1. Definitions.
+
+ "License" shall mean the terms and conditions for use, reproduction,
+ and distribution as defined by Sections 1 through 9 of this document.
+
+ "Licensor" shall mean the copyright owner or entity authorized by
+ the copyright owner that is granting the License.
+
+ "Legal Entity" shall mean the union of the acting entity and all
+ other entities that control, are controlled by, or are under common
+ control with that entity. For the purposes of this definition,
+ "control" means (i) the power, direct or indirect, to cause the
+ direction or management of such entity, whether by contract or
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
+ outstanding shares, or (iii) beneficial ownership of such entity.
+
+ "You" (or "Your") shall mean an individual or Legal Entity
+ exercising permissions granted by this License.
+
+ "Source" form shall mean the preferred form for making modifications,
+ including but not limited to software source code, documentation
+ source, and configuration files.
+
+ "Object" form shall mean any form resulting from mechanical
+ transformation or translation of a Source form, including but
+ not limited to compiled object code, generated documentation,
+ and conversions to other media types.
+
+ "Work" shall mean the work of authorship, whether in Source or
+ Object form, made available under the License, as indicated by a
+ copyright notice that is included in or attached to the work
+ (an example is provided in the Appendix below).
+
+ "Derivative Works" shall mean any work, whether in Source or Object
+ form, that is based on (or derived from) the Work and for which the
+ editorial revisions, annotations, elaborations, or other modifications
+ represent, as a whole, an original work of authorship. For the purposes
+ of this License, Derivative Works shall not include works that remain
+ separable from, or merely link (or bind by name) to the interfaces of,
+ the Work and Derivative Works thereof.
+
+ "Contribution" shall mean any work of authorship, including
+ the original version of the Work and any modifications or additions
+ to that Work or Derivative Works thereof, that is intentionally
+ submitted to Licensor for inclusion in the Work by the copyright owner
+ or by an individual or Legal Entity authorized to submit on behalf of
+ the copyright owner. For the purposes of this definition, "submitted"
+ means any form of electronic, verbal, or written communication sent
+ to the Licensor or its representatives, including but not limited to
+ communication on electronic mailing lists, source code control systems,
+ and issue tracking systems that are managed by, or on behalf of, the
+ Licensor for the purpose of discussing and improving the Work, but
+ excluding communication that is conspicuously marked or otherwise
+ designated in writing by the copyright owner as "Not a Contribution."
+
+ "Contributor" shall mean Licensor and any individual or Legal Entity
+ on behalf of whom a Contribution has been received by Licensor and
+ subsequently incorporated within the Work.
+
+ 2. Grant of Copyright License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ copyright license to reproduce, prepare Derivative Works of,
+ publicly display, publicly perform, sublicense, and distribute the
+ Work and such Derivative Works in Source or Object form.
+
+ 3. Grant of Patent License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ (except as stated in this section) patent license to make, have made,
+ use, offer to sell, sell, import, and otherwise transfer the Work,
+ where such license applies only to those patent claims licensable
+ by such Contributor that are necessarily infringed by their
+ Contribution(s) alone or by combination of their Contribution(s)
+ with the Work to which such Contribution(s) was submitted. If You
+ institute patent litigation against any entity (including a
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
+ or a Contribution incorporated within the Work constitutes direct
+ or contributory patent infringement, then any patent licenses
+ granted to You under this License for that Work shall terminate
+ as of the date such litigation is filed.
+
+ 4. Redistribution. You may reproduce and distribute copies of the
+ Work or Derivative Works thereof in any medium, with or without
+ modifications, and in Source or Object form, provided that You
+ meet the following conditions:
+
+ (a) You must give any other recipients of the Work or
+ Derivative Works a copy of this License; and
+
+ (b) You must cause any modified files to carry prominent notices
+ stating that You changed the files; and
+
+ (c) You must retain, in the Source form of any Derivative Works
+ that You distribute, all copyright, patent, trademark, and
+ attribution notices from the Source form of the Work,
+ excluding those notices that do not pertain to any part of
+ the Derivative Works; and
+
+ (d) If the Work includes a "NOTICE" text file as part of its
+ distribution, then any Derivative Works that You distribute must
+ include a readable copy of the attribution notices contained
+ within such NOTICE file, excluding those notices that do not
+ pertain to any part of the Derivative Works, in at least one
+ of the following places: within a NOTICE text file distributed
+ as part of the Derivative Works; within the Source form or
+ documentation, if provided along with the Derivative Works; or,
+ within a display generated by the Derivative Works, if and
+ wherever such third-party notices normally appear. The contents
+ of the NOTICE file are for informational purposes only and
+ do not modify the License. You may add Your own attribution
+ notices within Derivative Works that You distribute, alongside
+ or as an addendum to the NOTICE text from the Work, provided
+ that such additional attribution notices cannot be construed
+ as modifying the License.
+
+ You may add Your own copyright statement to Your modifications and
+ may provide additional or different license terms and conditions
+ for use, reproduction, or distribution of Your modifications, or
+ for any such Derivative Works as a whole, provided Your use,
+ reproduction, and distribution of the Work otherwise complies with
+ the conditions stated in this License.
+
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
+ any Contribution intentionally submitted for inclusion in the Work
+ by You to the Licensor shall be under the terms and conditions of
+ this License, without any additional terms or conditions.
+ Notwithstanding the above, nothing herein shall supersede or modify
+ the terms of any separate license agreement you may have executed
+ with Licensor regarding such Contributions.
+
+ 6. Trademarks. This License does not grant permission to use the trade
+ names, trademarks, service marks, or product names of the Licensor,
+ except as required for reasonable and customary use in describing the
+ origin of the Work and reproducing the content of the NOTICE file.
+
+ 7. Disclaimer of Warranty. Unless required by applicable law or
+ agreed to in writing, Licensor provides the Work (and each
+ Contributor provides its Contributions) on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ implied, including, without limitation, any warranties or conditions
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+ PARTICULAR PURPOSE. You are solely responsible for determining the
+ appropriateness of using or redistributing the Work and assume any
+ risks associated with Your exercise of permissions under this License.
+
+ 8. Limitation of Liability. In no event and under no legal theory,
+ whether in tort (including negligence), contract, or otherwise,
+ unless required by applicable law (such as deliberate and grossly
+ negligent acts) or agreed to in writing, shall any Contributor be
+ liable to You for damages, including any direct, indirect, special,
+ incidental, or consequential damages of any character arising as a
+ result of this License or out of the use or inability to use the
+ Work (including but not limited to damages for loss of goodwill,
+ work stoppage, computer failure or malfunction, or any and all
+ other commercial damages or losses), even if such Contributor
+ has been advised of the possibility of such damages.
+
+ 9. Accepting Warranty or Additional Liability. While redistributing
+ the Work or Derivative Works thereof, You may choose to offer,
+ and charge a fee for, acceptance of support, warranty, indemnity,
+ or other liability obligations and/or rights consistent with this
+ License. However, in accepting such obligations, You may act only
+ on Your own behalf and on Your sole responsibility, not on behalf
+ of any other Contributor, and only if You agree to indemnify,
+ defend, and hold each Contributor harmless for any liability
+ incurred by, or claims asserted against, such Contributor by reason
+ of your accepting any such warranty or additional liability.
+
+ END OF TERMS AND CONDITIONS
+
+ APPENDIX: How to apply the Apache License to your work.
+
+ To apply the Apache License to your work, attach the following
+ boilerplate notice, with the fields enclosed by brackets "[]"
+ replaced with your own identifying information. (Don't include
+ the brackets!) The text should be enclosed in the appropriate
+ comment syntax for the file format. We also recommend that a
+ file or class name and description of purpose be included on the
+ same "printed page" as the copyright notice for easier
+ identification within third-party archives.
+
+ Portions Copyright (c) Microsoft Corporation.
+ Portions Copyright 2017 Google Inc.
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
diff --git a/node_modules/playwright-core/NOTICE b/node_modules/playwright-core/NOTICE
new file mode 100644
index 0000000000000000000000000000000000000000..814ec1696f7ad36c1b524fb6adeef14b4b367fec
--- /dev/null
+++ b/node_modules/playwright-core/NOTICE
@@ -0,0 +1,5 @@
+Playwright
+Copyright (c) Microsoft Corporation
+
+This software contains code derived from the Puppeteer project (https://github.com/puppeteer/puppeteer),
+available under the Apache 2.0 license (https://github.com/puppeteer/puppeteer/blob/master/LICENSE).
diff --git a/node_modules/playwright-core/README.md b/node_modules/playwright-core/README.md
new file mode 100644
index 0000000000000000000000000000000000000000..422b3739f5bc7cbd70583365bbe277be845727ce
--- /dev/null
+++ b/node_modules/playwright-core/README.md
@@ -0,0 +1,3 @@
+# playwright-core
+
+This package contains the no-browser flavor of [Playwright](http://github.com/microsoft/playwright).
diff --git a/node_modules/playwright-core/ThirdPartyNotices.txt b/node_modules/playwright-core/ThirdPartyNotices.txt
new file mode 100644
index 0000000000000000000000000000000000000000..2fc50644723d98b3a6e9baecb6dbfdbbfcc208d3
--- /dev/null
+++ b/node_modules/playwright-core/ThirdPartyNotices.txt
@@ -0,0 +1,4076 @@
+microsoft/playwright-core
+
+THIRD-PARTY SOFTWARE NOTICES AND INFORMATION
+
+This project incorporates components from the projects listed below. The original copyright notices and the licenses under which Microsoft received such components are set forth below. Microsoft reserves all rights not expressly granted herein, whether by implication, estoppel or otherwise.
+
+- @hono/node-server@1.19.8 (https://github.com/honojs/node-server)
+- @lowire/loop@0.0.25 (https://github.com/pavelfeldman/lowire)
+- @modelcontextprotocol/sdk@1.25.2 (https://github.com/modelcontextprotocol/typescript-sdk)
+- accepts@2.0.0 (https://github.com/jshttp/accepts)
+- agent-base@7.1.4 (https://github.com/TooTallNate/proxy-agents)
+- ajv-formats@3.0.1 (https://github.com/ajv-validator/ajv-formats)
+- ajv@8.17.1 (https://github.com/ajv-validator/ajv)
+- balanced-match@1.0.2 (https://github.com/juliangruber/balanced-match)
+- body-parser@2.2.1 (https://github.com/expressjs/body-parser)
+- brace-expansion@1.1.12 (https://github.com/juliangruber/brace-expansion)
+- buffer-crc32@0.2.13 (https://github.com/brianloveswords/buffer-crc32)
+- bytes@3.1.2 (https://github.com/visionmedia/bytes.js)
+- call-bind-apply-helpers@1.0.2 (https://github.com/ljharb/call-bind-apply-helpers)
+- call-bound@1.0.4 (https://github.com/ljharb/call-bound)
+- codemirror@5.65.18 (https://github.com/codemirror/CodeMirror)
+- colors@1.4.0 (https://github.com/Marak/colors.js)
+- commander@13.1.0 (https://github.com/tj/commander.js)
+- concat-map@0.0.1 (https://github.com/substack/node-concat-map)
+- content-disposition@1.0.0 (https://github.com/jshttp/content-disposition)
+- content-type@1.0.5 (https://github.com/jshttp/content-type)
+- cookie-signature@1.2.2 (https://github.com/visionmedia/node-cookie-signature)
+- cookie@0.7.2 (https://github.com/jshttp/cookie)
+- cors@2.8.5 (https://github.com/expressjs/cors)
+- cross-spawn@7.0.6 (https://github.com/moxystudio/node-cross-spawn)
+- debug@4.3.4 (https://github.com/debug-js/debug)
+- debug@4.4.0 (https://github.com/debug-js/debug)
+- debug@4.4.3 (https://github.com/debug-js/debug)
+- define-lazy-prop@2.0.0 (https://github.com/sindresorhus/define-lazy-prop)
+- depd@2.0.0 (https://github.com/dougwilson/nodejs-depd)
+- diff@7.0.0 (https://github.com/kpdecker/jsdiff)
+- dotenv@16.4.5 (https://github.com/motdotla/dotenv)
+- dunder-proto@1.0.1 (https://github.com/es-shims/dunder-proto)
+- ee-first@1.1.1 (https://github.com/jonathanong/ee-first)
+- encodeurl@2.0.0 (https://github.com/pillarjs/encodeurl)
+- end-of-stream@1.4.4 (https://github.com/mafintosh/end-of-stream)
+- es-define-property@1.0.1 (https://github.com/ljharb/es-define-property)
+- es-errors@1.3.0 (https://github.com/ljharb/es-errors)
+- es-object-atoms@1.1.1 (https://github.com/ljharb/es-object-atoms)
+- escape-html@1.0.3 (https://github.com/component/escape-html)
+- etag@1.8.1 (https://github.com/jshttp/etag)
+- eventsource-parser@3.0.3 (https://github.com/rexxars/eventsource-parser)
+- eventsource@3.0.7 (git://git@github.com/EventSource/eventsource)
+- express-rate-limit@7.5.1 (https://github.com/express-rate-limit/express-rate-limit)
+- express@5.1.0 (https://github.com/expressjs/express)
+- fast-deep-equal@3.1.3 (https://github.com/epoberezkin/fast-deep-equal)
+- fast-uri@3.1.0 (https://github.com/fastify/fast-uri)
+- finalhandler@2.1.0 (https://github.com/pillarjs/finalhandler)
+- forwarded@0.2.0 (https://github.com/jshttp/forwarded)
+- fresh@2.0.0 (https://github.com/jshttp/fresh)
+- function-bind@1.1.2 (https://github.com/Raynos/function-bind)
+- get-intrinsic@1.3.0 (https://github.com/ljharb/get-intrinsic)
+- get-proto@1.0.1 (https://github.com/ljharb/get-proto)
+- get-stream@5.2.0 (https://github.com/sindresorhus/get-stream)
+- gopd@1.2.0 (https://github.com/ljharb/gopd)
+- graceful-fs@4.2.10 (https://github.com/isaacs/node-graceful-fs)
+- has-symbols@1.1.0 (https://github.com/inspect-js/has-symbols)
+- hasown@2.0.2 (https://github.com/inspect-js/hasOwn)
+- hono@4.11.3 (https://github.com/honojs/hono)
+- http-errors@2.0.1 (https://github.com/jshttp/http-errors)
+- https-proxy-agent@7.0.6 (https://github.com/TooTallNate/proxy-agents)
+- iconv-lite@0.7.0 (https://github.com/pillarjs/iconv-lite)
+- inherits@2.0.4 (https://github.com/isaacs/inherits)
+- ip-address@9.0.5 (https://github.com/beaugunderson/ip-address)
+- ipaddr.js@1.9.1 (https://github.com/whitequark/ipaddr.js)
+- is-docker@2.2.1 (https://github.com/sindresorhus/is-docker)
+- is-promise@4.0.0 (https://github.com/then/is-promise)
+- is-wsl@2.2.0 (https://github.com/sindresorhus/is-wsl)
+- isexe@2.0.0 (https://github.com/isaacs/isexe)
+- jose@6.1.3 (https://github.com/panva/jose)
+- jpeg-js@0.4.4 (https://github.com/eugeneware/jpeg-js)
+- jsbn@1.1.0 (https://github.com/andyperlitch/jsbn)
+- json-schema-traverse@1.0.0 (https://github.com/epoberezkin/json-schema-traverse)
+- json-schema-typed@8.0.2 (https://github.com/RemyRylan/json-schema-typed)
+- math-intrinsics@1.1.0 (https://github.com/es-shims/math-intrinsics)
+- media-typer@1.1.0 (https://github.com/jshttp/media-typer)
+- merge-descriptors@2.0.0 (https://github.com/sindresorhus/merge-descriptors)
+- mime-db@1.54.0 (https://github.com/jshttp/mime-db)
+- mime-types@3.0.1 (https://github.com/jshttp/mime-types)
+- mime@3.0.0 (https://github.com/broofa/mime)
+- minimatch@3.1.2 (https://github.com/isaacs/minimatch)
+- ms@2.1.2 (https://github.com/zeit/ms)
+- ms@2.1.3 (https://github.com/vercel/ms)
+- negotiator@1.0.0 (https://github.com/jshttp/negotiator)
+- object-assign@4.1.1 (https://github.com/sindresorhus/object-assign)
+- object-inspect@1.13.4 (https://github.com/inspect-js/object-inspect)
+- on-finished@2.4.1 (https://github.com/jshttp/on-finished)
+- once@1.4.0 (https://github.com/isaacs/once)
+- open@8.4.0 (https://github.com/sindresorhus/open)
+- parseurl@1.3.3 (https://github.com/pillarjs/parseurl)
+- path-key@3.1.1 (https://github.com/sindresorhus/path-key)
+- path-to-regexp@8.2.0 (https://github.com/pillarjs/path-to-regexp)
+- pend@1.2.0 (https://github.com/andrewrk/node-pend)
+- pkce-challenge@5.0.0 (https://github.com/crouchcd/pkce-challenge)
+- pngjs@6.0.0 (https://github.com/lukeapage/pngjs)
+- progress@2.0.3 (https://github.com/visionmedia/node-progress)
+- proxy-addr@2.0.7 (https://github.com/jshttp/proxy-addr)
+- proxy-from-env@1.1.0 (https://github.com/Rob--W/proxy-from-env)
+- pump@3.0.2 (https://github.com/mafintosh/pump)
+- qs@6.14.1 (https://github.com/ljharb/qs)
+- range-parser@1.2.1 (https://github.com/jshttp/range-parser)
+- raw-body@3.0.2 (https://github.com/stream-utils/raw-body)
+- require-from-string@2.0.2 (https://github.com/floatdrop/require-from-string)
+- retry@0.12.0 (https://github.com/tim-kos/node-retry)
+- router@2.2.0 (https://github.com/pillarjs/router)
+- safe-buffer@5.2.1 (https://github.com/feross/safe-buffer)
+- safer-buffer@2.1.2 (https://github.com/ChALkeR/safer-buffer)
+- send@1.2.0 (https://github.com/pillarjs/send)
+- serve-static@2.2.0 (https://github.com/expressjs/serve-static)
+- setprototypeof@1.2.0 (https://github.com/wesleytodd/setprototypeof)
+- shebang-command@2.0.0 (https://github.com/kevva/shebang-command)
+- shebang-regex@3.0.0 (https://github.com/sindresorhus/shebang-regex)
+- side-channel-list@1.0.0 (https://github.com/ljharb/side-channel-list)
+- side-channel-map@1.0.1 (https://github.com/ljharb/side-channel-map)
+- side-channel-weakmap@1.0.2 (https://github.com/ljharb/side-channel-weakmap)
+- side-channel@1.1.0 (https://github.com/ljharb/side-channel)
+- signal-exit@3.0.7 (https://github.com/tapjs/signal-exit)
+- smart-buffer@4.2.0 (https://github.com/JoshGlazebrook/smart-buffer)
+- socks-proxy-agent@8.0.5 (https://github.com/TooTallNate/proxy-agents)
+- socks@2.8.3 (https://github.com/JoshGlazebrook/socks)
+- sprintf-js@1.1.3 (https://github.com/alexei/sprintf.js)
+- statuses@2.0.2 (https://github.com/jshttp/statuses)
+- toidentifier@1.0.1 (https://github.com/component/toidentifier)
+- type-is@2.0.1 (https://github.com/jshttp/type-is)
+- unpipe@1.0.0 (https://github.com/stream-utils/unpipe)
+- vary@1.1.2 (https://github.com/jshttp/vary)
+- which@2.0.2 (https://github.com/isaacs/node-which)
+- wrappy@1.0.2 (https://github.com/npm/wrappy)
+- ws@8.17.1 (https://github.com/websockets/ws)
+- yaml@2.6.0 (https://github.com/eemeli/yaml)
+- yauzl@3.2.0 (https://github.com/thejoshwolfe/yauzl)
+- yazl@2.5.1 (https://github.com/thejoshwolfe/yazl)
+- zod-to-json-schema@3.25.1 (https://github.com/StefanTerdell/zod-to-json-schema)
+- zod@4.3.5 (https://github.com/colinhacks/zod)
+
+%% @hono/node-server@1.19.8 NOTICES AND INFORMATION BEGIN HERE
+=========================================
+# Node.js Adapter for Hono
+
+This adapter `@hono/node-server` allows you to run your Hono application on Node.js.
+Initially, Hono wasn't designed for Node.js, but with this adapter, you can now use Hono on Node.js.
+It utilizes web standard APIs implemented in Node.js version 18 or higher.
+
+## Benchmarks
+
+Hono is 3.5 times faster than Express.
+
+Express:
+
+```txt
+$ bombardier -d 10s --fasthttp http://localhost:3000/
+
+Statistics Avg Stdev Max
+ Reqs/sec 16438.94 1603.39 19155.47
+ Latency 7.60ms 7.51ms 559.89ms
+ HTTP codes:
+ 1xx - 0, 2xx - 164494, 3xx - 0, 4xx - 0, 5xx - 0
+ others - 0
+ Throughput: 4.55MB/s
+```
+
+Hono + `@hono/node-server`:
+
+```txt
+$ bombardier -d 10s --fasthttp http://localhost:3000/
+
+Statistics Avg Stdev Max
+ Reqs/sec 58296.56 5512.74 74403.56
+ Latency 2.14ms 1.46ms 190.92ms
+ HTTP codes:
+ 1xx - 0, 2xx - 583059, 3xx - 0, 4xx - 0, 5xx - 0
+ others - 0
+ Throughput: 12.56MB/s
+```
+
+## Requirements
+
+It works on Node.js versions greater than 18.x. The specific required Node.js versions are as follows:
+
+- 18.x => 18.14.1+
+- 19.x => 19.7.0+
+- 20.x => 20.0.0+
+
+Essentially, you can simply use the latest version of each major release.
+
+## Installation
+
+You can install it from the npm registry with `npm` command:
+
+```sh
+npm install @hono/node-server
+```
+
+Or use `yarn`:
+
+```sh
+yarn add @hono/node-server
+```
+
+## Usage
+
+Just import `@hono/node-server` at the top and write the code as usual.
+The same code that runs on Cloudflare Workers, Deno, and Bun will work.
+
+```ts
+import { serve } from '@hono/node-server'
+import { Hono } from 'hono'
+
+const app = new Hono()
+app.get('/', (c) => c.text('Hono meets Node.js'))
+
+serve(app, (info) => {
+ console.log(`Listening on http://localhost:${info.port}`) // Listening on http://localhost:3000
+})
+```
+
+For example, run it using `ts-node`. Then an HTTP server will be launched. The default port is `3000`.
+
+```sh
+ts-node ./index.ts
+```
+
+Open `http://localhost:3000` with your browser.
+
+## Options
+
+### `port`
+
+```ts
+serve({
+ fetch: app.fetch,
+ port: 8787, // Port number, default is 3000
+})
+```
+
+### `createServer`
+
+```ts
+import { createServer } from 'node:https'
+import fs from 'node:fs'
+
+//...
+
+serve({
+ fetch: app.fetch,
+ createServer: createServer,
+ serverOptions: {
+ key: fs.readFileSync('test/fixtures/keys/agent1-key.pem'),
+ cert: fs.readFileSync('test/fixtures/keys/agent1-cert.pem'),
+ },
+})
+```
+
+### `overrideGlobalObjects`
+
+The default value is `true`. The Node.js Adapter rewrites the global Request/Response and uses a lightweight Request/Response to improve performance. If you don't want to do that, set `false`.
+
+```ts
+serve({
+ fetch: app.fetch,
+ overrideGlobalObjects: false,
+})
+```
+
+### `autoCleanupIncoming`
+
+The default value is `true`. The Node.js Adapter automatically cleans up (explicitly call `destroy()` method) if application is not finished to consume the incoming request. If you don't want to do that, set `false`.
+
+If the application accepts connections from arbitrary clients, this cleanup must be done otherwise incomplete requests from clients may cause the application to stop responding. If your application only accepts connections from trusted clients, such as in a reverse proxy environment and there is no process that returns a response without reading the body of the POST request all the way through, you can improve performance by setting it to `false`.
+
+```ts
+serve({
+ fetch: app.fetch,
+ autoCleanupIncoming: false,
+})
+```
+
+## Middleware
+
+Most built-in middleware also works with Node.js.
+Read [the documentation](https://hono.dev/middleware/builtin/basic-auth) and use the Middleware of your liking.
+
+```ts
+import { serve } from '@hono/node-server'
+import { Hono } from 'hono'
+import { prettyJSON } from 'hono/pretty-json'
+
+const app = new Hono()
+
+app.get('*', prettyJSON())
+app.get('/', (c) => c.json({ 'Hono meets': 'Node.js' }))
+
+serve(app)
+```
+
+## Serve Static Middleware
+
+Use Serve Static Middleware that has been created for Node.js.
+
+```ts
+import { serveStatic } from '@hono/node-server/serve-static'
+
+//...
+
+app.use('/static/*', serveStatic({ root: './' }))
+```
+
+If using a relative path, `root` will be relative to the current working directory from which the app was started.
+
+This can cause confusion when running your application locally.
+
+Imagine your project structure is:
+
+```
+my-hono-project/
+ src/
+ index.ts
+ static/
+ index.html
+```
+
+Typically, you would run your app from the project's root directory (`my-hono-project`),
+so you would need the following code to serve the `static` folder:
+
+```ts
+app.use('/static/*', serveStatic({ root: './static' }))
+```
+
+Notice that `root` here is not relative to `src/index.ts`, rather to `my-hono-project`.
+
+### Options
+
+#### `rewriteRequestPath`
+
+If you want to serve files in `./.foojs` with the request path `/__foo/*`, you can write like the following.
+
+```ts
+app.use(
+ '/__foo/*',
+ serveStatic({
+ root: './.foojs/',
+ rewriteRequestPath: (path: string) => path.replace(/^\/__foo/, ''),
+ })
+)
+```
+
+#### `onFound`
+
+You can specify handling when the requested file is found with `onFound`.
+
+```ts
+app.use(
+ '/static/*',
+ serveStatic({
+ // ...
+ onFound: (_path, c) => {
+ c.header('Cache-Control', `public, immutable, max-age=31536000`)
+ },
+ })
+)
+```
+
+#### `onNotFound`
+
+The `onNotFound` is useful for debugging. You can write a handle for when a file is not found.
+
+```ts
+app.use(
+ '/static/*',
+ serveStatic({
+ root: './non-existent-dir',
+ onNotFound: (path, c) => {
+ console.log(`${path} is not found, request to ${c.req.path}`)
+ },
+ })
+)
+```
+
+#### `precompressed`
+
+The `precompressed` option checks if files with extensions like `.br` or `.gz` are available and serves them based on the `Accept-Encoding` header. It prioritizes Brotli, then Zstd, and Gzip. If none are available, it serves the original file.
+
+```ts
+app.use(
+ '/static/*',
+ serveStatic({
+ precompressed: true,
+ })
+)
+```
+
+## ConnInfo Helper
+
+You can use the [ConnInfo Helper](https://hono.dev/docs/helpers/conninfo) by importing `getConnInfo` from `@hono/node-server/conninfo`.
+
+```ts
+import { getConnInfo } from '@hono/node-server/conninfo'
+
+app.get('/', (c) => {
+ const info = getConnInfo(c) // info is `ConnInfo`
+ return c.text(`Your remote address is ${info.remote.address}`)
+})
+```
+
+## Accessing Node.js API
+
+You can access the Node.js API from `c.env` in Node.js. For example, if you want to specify a type, you can write the following.
+
+```ts
+import { serve } from '@hono/node-server'
+import type { HttpBindings } from '@hono/node-server'
+import { Hono } from 'hono'
+
+const app = new Hono<{ Bindings: HttpBindings }>()
+
+app.get('/', (c) => {
+ return c.json({
+ remoteAddress: c.env.incoming.socket.remoteAddress,
+ })
+})
+
+serve(app)
+```
+
+The APIs that you can get from `c.env` are as follows.
+
+```ts
+type HttpBindings = {
+ incoming: IncomingMessage
+ outgoing: ServerResponse
+}
+
+type Http2Bindings = {
+ incoming: Http2ServerRequest
+ outgoing: Http2ServerResponse
+}
+```
+
+## Direct response from Node.js API
+
+You can directly respond to the client from the Node.js API.
+In that case, the response from Hono should be ignored, so return `RESPONSE_ALREADY_SENT`.
+
+> [!NOTE]
+> This feature can be used when migrating existing Node.js applications to Hono, but we recommend using Hono's API for new applications.
+
+```ts
+import { serve } from '@hono/node-server'
+import type { HttpBindings } from '@hono/node-server'
+import { RESPONSE_ALREADY_SENT } from '@hono/node-server/utils/response'
+import { Hono } from 'hono'
+
+const app = new Hono<{ Bindings: HttpBindings }>()
+
+app.get('/', (c) => {
+ const { outgoing } = c.env
+ outgoing.writeHead(200, { 'Content-Type': 'text/plain' })
+ outgoing.end('Hello World\n')
+
+ return RESPONSE_ALREADY_SENT
+})
+
+serve(app)
+```
+
+## Listen to a UNIX domain socket
+
+You can configure the HTTP server to listen to a UNIX domain socket instead of a TCP port.
+
+```ts
+import { createAdaptorServer } from '@hono/node-server'
+
+// ...
+
+const socketPath ='/tmp/example.sock'
+
+const server = createAdaptorServer(app)
+server.listen(socketPath, () => {
+ console.log(`Listening on ${socketPath}`)
+})
+```
+
+## Related projects
+
+- Hono -
+- Hono GitHub repository -
+
+## Author
+
+Yusuke Wada
+
+## License
+
+MIT
+=========================================
+END OF @hono/node-server@1.19.8 AND INFORMATION
+
+%% @lowire/loop@0.0.25 NOTICES AND INFORMATION BEGIN HERE
+=========================================
+Apache License
+ Version 2.0, January 2004
+ http://www.apache.org/licenses/
+
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+ 1. Definitions.
+
+ "License" shall mean the terms and conditions for use, reproduction,
+ and distribution as defined by Sections 1 through 9 of this document.
+
+ "Licensor" shall mean the copyright owner or entity authorized by
+ the copyright owner that is granting the License.
+
+ "Legal Entity" shall mean the union of the acting entity and all
+ other entities that control, are controlled by, or are under common
+ control with that entity. For the purposes of this definition,
+ "control" means (i) the power, direct or indirect, to cause the
+ direction or management of such entity, whether by contract or
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
+ outstanding shares, or (iii) beneficial ownership of such entity.
+
+ "You" (or "Your") shall mean an individual or Legal Entity
+ exercising permissions granted by this License.
+
+ "Source" form shall mean the preferred form for making modifications,
+ including but not limited to software source code, documentation
+ source, and configuration files.
+
+ "Object" form shall mean any form resulting from mechanical
+ transformation or translation of a Source form, including but
+ not limited to compiled object code, generated documentation,
+ and conversions to other media types.
+
+ "Work" shall mean the work of authorship, whether in Source or
+ Object form, made available under the License, as indicated by a
+ copyright notice that is included in or attached to the work
+ (an example is provided in the Appendix below).
+
+ "Derivative Works" shall mean any work, whether in Source or Object
+ form, that is based on (or derived from) the Work and for which the
+ editorial revisions, annotations, elaborations, or other modifications
+ represent, as a whole, an original work of authorship. For the purposes
+ of this License, Derivative Works shall not include works that remain
+ separable from, or merely link (or bind by name) to the interfaces of,
+ the Work and Derivative Works thereof.
+
+ "Contribution" shall mean any work of authorship, including
+ the original version of the Work and any modifications or additions
+ to that Work or Derivative Works thereof, that is intentionally
+ submitted to Licensor for inclusion in the Work by the copyright owner
+ or by an individual or Legal Entity authorized to submit on behalf of
+ the copyright owner. For the purposes of this definition, "submitted"
+ means any form of electronic, verbal, or written communication sent
+ to the Licensor or its representatives, including but not limited to
+ communication on electronic mailing lists, source code control systems,
+ and issue tracking systems that are managed by, or on behalf of, the
+ Licensor for the purpose of discussing and improving the Work, but
+ excluding communication that is conspicuously marked or otherwise
+ designated in writing by the copyright owner as "Not a Contribution."
+
+ "Contributor" shall mean Licensor and any individual or Legal Entity
+ on behalf of whom a Contribution has been received by Licensor and
+ subsequently incorporated within the Work.
+
+ 2. Grant of Copyright License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ copyright license to reproduce, prepare Derivative Works of,
+ publicly display, publicly perform, sublicense, and distribute the
+ Work and such Derivative Works in Source or Object form.
+
+ 3. Grant of Patent License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ (except as stated in this section) patent license to make, have made,
+ use, offer to sell, sell, import, and otherwise transfer the Work,
+ where such license applies only to those patent claims licensable
+ by such Contributor that are necessarily infringed by their
+ Contribution(s) alone or by combination of their Contribution(s)
+ with the Work to which such Contribution(s) was submitted. If You
+ institute patent litigation against any entity (including a
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
+ or a Contribution incorporated within the Work constitutes direct
+ or contributory patent infringement, then any patent licenses
+ granted to You under this License for that Work shall terminate
+ as of the date such litigation is filed.
+
+ 4. Redistribution. You may reproduce and distribute copies of the
+ Work or Derivative Works thereof in any medium, with or without
+ modifications, and in Source or Object form, provided that You
+ meet the following conditions:
+
+ (a) You must give any other recipients of the Work or
+ Derivative Works a copy of this License; and
+
+ (b) You must cause any modified files to carry prominent notices
+ stating that You changed the files; and
+
+ (c) You must retain, in the Source form of any Derivative Works
+ that You distribute, all copyright, patent, trademark, and
+ attribution notices from the Source form of the Work,
+ excluding those notices that do not pertain to any part of
+ the Derivative Works; and
+
+ (d) If the Work includes a "NOTICE" text file as part of its
+ distribution, then any Derivative Works that You distribute must
+ include a readable copy of the attribution notices contained
+ within such NOTICE file, excluding those notices that do not
+ pertain to any part of the Derivative Works, in at least one
+ of the following places: within a NOTICE text file distributed
+ as part of the Derivative Works; within the Source form or
+ documentation, if provided along with the Derivative Works; or,
+ within a display generated by the Derivative Works, if and
+ wherever such third-party notices normally appear. The contents
+ of the NOTICE file are for informational purposes only and
+ do not modify the License. You may add Your own attribution
+ notices within Derivative Works that You distribute, alongside
+ or as an addendum to the NOTICE text from the Work, provided
+ that such additional attribution notices cannot be construed
+ as modifying the License.
+
+ You may add Your own copyright statement to Your modifications and
+ may provide additional or different license terms and conditions
+ for use, reproduction, or distribution of Your modifications, or
+ for any such Derivative Works as a whole, provided Your use,
+ reproduction, and distribution of the Work otherwise complies with
+ the conditions stated in this License.
+
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
+ any Contribution intentionally submitted for inclusion in the Work
+ by You to the Licensor shall be under the terms and conditions of
+ this License, without any additional terms or conditions.
+ Notwithstanding the above, nothing herein shall supersede or modify
+ the terms of any separate license agreement you may have executed
+ with Licensor regarding such Contributions.
+
+ 6. Trademarks. This License does not grant permission to use the trade
+ names, trademarks, service marks, or product names of the Licensor,
+ except as required for reasonable and customary use in describing the
+ origin of the Work and reproducing the content of the NOTICE file.
+
+ 7. Disclaimer of Warranty. Unless required by applicable law or
+ agreed to in writing, Licensor provides the Work (and each
+ Contributor provides its Contributions) on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ implied, including, without limitation, any warranties or conditions
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+ PARTICULAR PURPOSE. You are solely responsible for determining the
+ appropriateness of using or redistributing the Work and assume any
+ risks associated with Your exercise of permissions under this License.
+
+ 8. Limitation of Liability. In no event and under no legal theory,
+ whether in tort (including negligence), contract, or otherwise,
+ unless required by applicable law (such as deliberate and grossly
+ negligent acts) or agreed to in writing, shall any Contributor be
+ liable to You for damages, including any direct, indirect, special,
+ incidental, or consequential damages of any character arising as a
+ result of this License or out of the use or inability to use the
+ Work (including but not limited to damages for loss of goodwill,
+ work stoppage, computer failure or malfunction, or any and all
+ other commercial damages or losses), even if such Contributor
+ has been advised of the possibility of such damages.
+
+ 9. Accepting Warranty or Additional Liability. While redistributing
+ the Work or Derivative Works thereof, You may choose to offer,
+ and charge a fee for, acceptance of support, warranty, indemnity,
+ or other liability obligations and/or rights consistent with this
+ License. However, in accepting such obligations, You may act only
+ on Your own behalf and on Your sole responsibility, not on behalf
+ of any other Contributor, and only if You agree to indemnify,
+ defend, and hold each Contributor harmless for any liability
+ incurred by, or claims asserted against, such Contributor by reason
+ of your accepting any such warranty or additional liability.
+
+ END OF TERMS AND CONDITIONS
+
+ APPENDIX: How to apply the Apache License to your work.
+
+ To apply the Apache License to your work, attach the following
+ boilerplate notice, with the fields enclosed by brackets "[]"
+ replaced with your own identifying information. (Don't include
+ the brackets!) The text should be enclosed in the appropriate
+ comment syntax for the file format. We also recommend that a
+ file or class name and description of purpose be included on the
+ same "printed page" as the copyright notice for easier
+ identification within third-party archives.
+
+ Copyright (c) Microsoft Corporation.
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+=========================================
+END OF @lowire/loop@0.0.25 AND INFORMATION
+
+%% @modelcontextprotocol/sdk@1.25.2 NOTICES AND INFORMATION BEGIN HERE
+=========================================
+MIT License
+
+Copyright (c) 2024 Anthropic, PBC
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
+=========================================
+END OF @modelcontextprotocol/sdk@1.25.2 AND INFORMATION
+
+%% accepts@2.0.0 NOTICES AND INFORMATION BEGIN HERE
+=========================================
+(The MIT License)
+
+Copyright (c) 2014 Jonathan Ong
+Copyright (c) 2015 Douglas Christopher Wilson
+
+Permission is hereby granted, free of charge, to any person obtaining
+a copy of this software and associated documentation files (the
+'Software'), to deal in the Software without restriction, including
+without limitation the rights to use, copy, modify, merge, publish,
+distribute, sublicense, and/or sell copies of the Software, and to
+permit persons to whom the Software is furnished to do so, subject to
+the following conditions:
+
+The above copyright notice and this permission notice shall be
+included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
+CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+=========================================
+END OF accepts@2.0.0 AND INFORMATION
+
+%% agent-base@7.1.4 NOTICES AND INFORMATION BEGIN HERE
+=========================================
+(The MIT License)
+
+Copyright (c) 2013 Nathan Rajlich
+
+Permission is hereby granted, free of charge, to any person obtaining
+a copy of this software and associated documentation files (the
+'Software'), to deal in the Software without restriction, including
+without limitation the rights to use, copy, modify, merge, publish,
+distribute, sublicense, and/or sell copies of the Software, and to
+permit persons to whom the Software is furnished to do so, subject to
+the following conditions:
+
+The above copyright notice and this permission notice shall be
+included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
+CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+=========================================
+END OF agent-base@7.1.4 AND INFORMATION
+
+%% ajv-formats@3.0.1 NOTICES AND INFORMATION BEGIN HERE
+=========================================
+MIT License
+
+Copyright (c) 2020 Evgeny Poberezkin
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
+=========================================
+END OF ajv-formats@3.0.1 AND INFORMATION
+
+%% ajv@8.17.1 NOTICES AND INFORMATION BEGIN HERE
+=========================================
+The MIT License (MIT)
+
+Copyright (c) 2015-2021 Evgeny Poberezkin
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
+=========================================
+END OF ajv@8.17.1 AND INFORMATION
+
+%% balanced-match@1.0.2 NOTICES AND INFORMATION BEGIN HERE
+=========================================
+(MIT)
+
+Copyright (c) 2013 Julian Gruber <julian@juliangruber.com>
+
+Permission is hereby granted, free of charge, to any person obtaining a copy of
+this software and associated documentation files (the "Software"), to deal in
+the Software without restriction, including without limitation the rights to
+use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
+of the Software, and to permit persons to whom the Software is furnished to do
+so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
+=========================================
+END OF balanced-match@1.0.2 AND INFORMATION
+
+%% body-parser@2.2.1 NOTICES AND INFORMATION BEGIN HERE
+=========================================
+(The MIT License)
+
+Copyright (c) 2014 Jonathan Ong
+Copyright (c) 2014-2015 Douglas Christopher Wilson
+
+Permission is hereby granted, free of charge, to any person obtaining
+a copy of this software and associated documentation files (the
+'Software'), to deal in the Software without restriction, including
+without limitation the rights to use, copy, modify, merge, publish,
+distribute, sublicense, and/or sell copies of the Software, and to
+permit persons to whom the Software is furnished to do so, subject to
+the following conditions:
+
+The above copyright notice and this permission notice shall be
+included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
+CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+=========================================
+END OF body-parser@2.2.1 AND INFORMATION
+
+%% brace-expansion@1.1.12 NOTICES AND INFORMATION BEGIN HERE
+=========================================
+MIT License
+
+Copyright (c) 2013 Julian Gruber
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
+=========================================
+END OF brace-expansion@1.1.12 AND INFORMATION
+
+%% buffer-crc32@0.2.13 NOTICES AND INFORMATION BEGIN HERE
+=========================================
+The MIT License
+
+Copyright (c) 2013 Brian J. Brennan
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal in
+the Software without restriction, including without limitation the rights to use,
+copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the
+Software, and to permit persons to whom the Software is furnished to do so,
+subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
+INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
+PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
+FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
+ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+=========================================
+END OF buffer-crc32@0.2.13 AND INFORMATION
+
+%% bytes@3.1.2 NOTICES AND INFORMATION BEGIN HERE
+=========================================
+(The MIT License)
+
+Copyright (c) 2012-2014 TJ Holowaychuk
+Copyright (c) 2015 Jed Watson
+
+Permission is hereby granted, free of charge, to any person obtaining
+a copy of this software and associated documentation files (the
+'Software'), to deal in the Software without restriction, including
+without limitation the rights to use, copy, modify, merge, publish,
+distribute, sublicense, and/or sell copies of the Software, and to
+permit persons to whom the Software is furnished to do so, subject to
+the following conditions:
+
+The above copyright notice and this permission notice shall be
+included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
+CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+=========================================
+END OF bytes@3.1.2 AND INFORMATION
+
+%% call-bind-apply-helpers@1.0.2 NOTICES AND INFORMATION BEGIN HERE
+=========================================
+MIT License
+
+Copyright (c) 2024 Jordan Harband
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
+=========================================
+END OF call-bind-apply-helpers@1.0.2 AND INFORMATION
+
+%% call-bound@1.0.4 NOTICES AND INFORMATION BEGIN HERE
+=========================================
+MIT License
+
+Copyright (c) 2024 Jordan Harband
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
+=========================================
+END OF call-bound@1.0.4 AND INFORMATION
+
+%% codemirror@5.65.18 NOTICES AND INFORMATION BEGIN HERE
+=========================================
+MIT License
+
+Copyright (C) 2017 by Marijn Haverbeke and others
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+THE SOFTWARE.
+=========================================
+END OF codemirror@5.65.18 AND INFORMATION
+
+%% colors@1.4.0 NOTICES AND INFORMATION BEGIN HERE
+=========================================
+MIT License
+
+Original Library
+ - Copyright (c) Marak Squires
+
+Additional Functionality
+ - Copyright (c) Sindre Sorhus (sindresorhus.com)
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+THE SOFTWARE.
+=========================================
+END OF colors@1.4.0 AND INFORMATION
+
+%% commander@13.1.0 NOTICES AND INFORMATION BEGIN HERE
+=========================================
+(The MIT License)
+
+Copyright (c) 2011 TJ Holowaychuk
+
+Permission is hereby granted, free of charge, to any person obtaining
+a copy of this software and associated documentation files (the
+'Software'), to deal in the Software without restriction, including
+without limitation the rights to use, copy, modify, merge, publish,
+distribute, sublicense, and/or sell copies of the Software, and to
+permit persons to whom the Software is furnished to do so, subject to
+the following conditions:
+
+The above copyright notice and this permission notice shall be
+included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
+CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+=========================================
+END OF commander@13.1.0 AND INFORMATION
+
+%% concat-map@0.0.1 NOTICES AND INFORMATION BEGIN HERE
+=========================================
+This software is released under the MIT license:
+
+Permission is hereby granted, free of charge, to any person obtaining a copy of
+this software and associated documentation files (the "Software"), to deal in
+the Software without restriction, including without limitation the rights to
+use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
+the Software, and to permit persons to whom the Software is furnished to do so,
+subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
+FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
+COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
+IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+=========================================
+END OF concat-map@0.0.1 AND INFORMATION
+
+%% content-disposition@1.0.0 NOTICES AND INFORMATION BEGIN HERE
+=========================================
+(The MIT License)
+
+Copyright (c) 2014-2017 Douglas Christopher Wilson
+
+Permission is hereby granted, free of charge, to any person obtaining
+a copy of this software and associated documentation files (the
+'Software'), to deal in the Software without restriction, including
+without limitation the rights to use, copy, modify, merge, publish,
+distribute, sublicense, and/or sell copies of the Software, and to
+permit persons to whom the Software is furnished to do so, subject to
+the following conditions:
+
+The above copyright notice and this permission notice shall be
+included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
+CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+=========================================
+END OF content-disposition@1.0.0 AND INFORMATION
+
+%% content-type@1.0.5 NOTICES AND INFORMATION BEGIN HERE
+=========================================
+(The MIT License)
+
+Copyright (c) 2015 Douglas Christopher Wilson
+
+Permission is hereby granted, free of charge, to any person obtaining
+a copy of this software and associated documentation files (the
+'Software'), to deal in the Software without restriction, including
+without limitation the rights to use, copy, modify, merge, publish,
+distribute, sublicense, and/or sell copies of the Software, and to
+permit persons to whom the Software is furnished to do so, subject to
+the following conditions:
+
+The above copyright notice and this permission notice shall be
+included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
+CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+=========================================
+END OF content-type@1.0.5 AND INFORMATION
+
+%% cookie-signature@1.2.2 NOTICES AND INFORMATION BEGIN HERE
+=========================================
+(The MIT License)
+
+Copyright (c) 2012–2024 LearnBoost and other contributors;
+
+Permission is hereby granted, free of charge, to any person obtaining
+a copy of this software and associated documentation files (the
+'Software'), to deal in the Software without restriction, including
+without limitation the rights to use, copy, modify, merge, publish,
+distribute, sublicense, and/or sell copies of the Software, and to
+permit persons to whom the Software is furnished to do so, subject to
+the following conditions:
+
+The above copyright notice and this permission notice shall be
+included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
+CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+=========================================
+END OF cookie-signature@1.2.2 AND INFORMATION
+
+%% cookie@0.7.2 NOTICES AND INFORMATION BEGIN HERE
+=========================================
+(The MIT License)
+
+Copyright (c) 2012-2014 Roman Shtylman
+Copyright (c) 2015 Douglas Christopher Wilson
+
+Permission is hereby granted, free of charge, to any person obtaining
+a copy of this software and associated documentation files (the
+'Software'), to deal in the Software without restriction, including
+without limitation the rights to use, copy, modify, merge, publish,
+distribute, sublicense, and/or sell copies of the Software, and to
+permit persons to whom the Software is furnished to do so, subject to
+the following conditions:
+
+The above copyright notice and this permission notice shall be
+included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
+CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+=========================================
+END OF cookie@0.7.2 AND INFORMATION
+
+%% cors@2.8.5 NOTICES AND INFORMATION BEGIN HERE
+=========================================
+(The MIT License)
+
+Copyright (c) 2013 Troy Goode
+
+Permission is hereby granted, free of charge, to any person obtaining
+a copy of this software and associated documentation files (the
+'Software'), to deal in the Software without restriction, including
+without limitation the rights to use, copy, modify, merge, publish,
+distribute, sublicense, and/or sell copies of the Software, and to
+permit persons to whom the Software is furnished to do so, subject to
+the following conditions:
+
+The above copyright notice and this permission notice shall be
+included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
+CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+=========================================
+END OF cors@2.8.5 AND INFORMATION
+
+%% cross-spawn@7.0.6 NOTICES AND INFORMATION BEGIN HERE
+=========================================
+The MIT License (MIT)
+
+Copyright (c) 2018 Made With MOXY Lda
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+THE SOFTWARE.
+=========================================
+END OF cross-spawn@7.0.6 AND INFORMATION
+
+%% debug@4.3.4 NOTICES AND INFORMATION BEGIN HERE
+=========================================
+(The MIT License)
+
+Copyright (c) 2014-2017 TJ Holowaychuk
+Copyright (c) 2018-2021 Josh Junon
+
+Permission is hereby granted, free of charge, to any person obtaining a copy of this software
+and associated documentation files (the 'Software'), to deal in the Software without restriction,
+including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense,
+and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so,
+subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all copies or substantial
+portions of the Software.
+
+THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT
+LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+=========================================
+END OF debug@4.3.4 AND INFORMATION
+
+%% debug@4.4.0 NOTICES AND INFORMATION BEGIN HERE
+=========================================
+(The MIT License)
+
+Copyright (c) 2014-2017 TJ Holowaychuk
+Copyright (c) 2018-2021 Josh Junon
+
+Permission is hereby granted, free of charge, to any person obtaining a copy of this software
+and associated documentation files (the 'Software'), to deal in the Software without restriction,
+including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense,
+and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so,
+subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all copies or substantial
+portions of the Software.
+
+THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT
+LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+=========================================
+END OF debug@4.4.0 AND INFORMATION
+
+%% debug@4.4.3 NOTICES AND INFORMATION BEGIN HERE
+=========================================
+(The MIT License)
+
+Copyright (c) 2014-2017 TJ Holowaychuk
+Copyright (c) 2018-2021 Josh Junon
+
+Permission is hereby granted, free of charge, to any person obtaining a copy of this software
+and associated documentation files (the 'Software'), to deal in the Software without restriction,
+including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense,
+and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so,
+subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all copies or substantial
+portions of the Software.
+
+THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT
+LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+=========================================
+END OF debug@4.4.3 AND INFORMATION
+
+%% define-lazy-prop@2.0.0 NOTICES AND INFORMATION BEGIN HERE
+=========================================
+MIT License
+
+Copyright (c) Sindre Sorhus (sindresorhus.com)
+
+Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+=========================================
+END OF define-lazy-prop@2.0.0 AND INFORMATION
+
+%% depd@2.0.0 NOTICES AND INFORMATION BEGIN HERE
+=========================================
+(The MIT License)
+
+Copyright (c) 2014-2018 Douglas Christopher Wilson
+
+Permission is hereby granted, free of charge, to any person obtaining
+a copy of this software and associated documentation files (the
+'Software'), to deal in the Software without restriction, including
+without limitation the rights to use, copy, modify, merge, publish,
+distribute, sublicense, and/or sell copies of the Software, and to
+permit persons to whom the Software is furnished to do so, subject to
+the following conditions:
+
+The above copyright notice and this permission notice shall be
+included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
+CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+=========================================
+END OF depd@2.0.0 AND INFORMATION
+
+%% diff@7.0.0 NOTICES AND INFORMATION BEGIN HERE
+=========================================
+BSD 3-Clause License
+
+Copyright (c) 2009-2015, Kevin Decker
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are met:
+
+1. Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+2. Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following disclaimer in the documentation
+ and/or other materials provided with the distribution.
+
+3. Neither the name of the copyright holder nor the names of its
+ contributors may be used to endorse or promote products derived from
+ this software without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
+FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+=========================================
+END OF diff@7.0.0 AND INFORMATION
+
+%% dotenv@16.4.5 NOTICES AND INFORMATION BEGIN HERE
+=========================================
+Copyright (c) 2015, Scott Motte
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are met:
+
+* Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+* Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following disclaimer in the documentation
+ and/or other materials provided with the distribution.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
+FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+=========================================
+END OF dotenv@16.4.5 AND INFORMATION
+
+%% dunder-proto@1.0.1 NOTICES AND INFORMATION BEGIN HERE
+=========================================
+MIT License
+
+Copyright (c) 2024 ECMAScript Shims
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
+=========================================
+END OF dunder-proto@1.0.1 AND INFORMATION
+
+%% ee-first@1.1.1 NOTICES AND INFORMATION BEGIN HERE
+=========================================
+The MIT License (MIT)
+
+Copyright (c) 2014 Jonathan Ong me@jongleberry.com
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+THE SOFTWARE.
+=========================================
+END OF ee-first@1.1.1 AND INFORMATION
+
+%% encodeurl@2.0.0 NOTICES AND INFORMATION BEGIN HERE
+=========================================
+(The MIT License)
+
+Copyright (c) 2016 Douglas Christopher Wilson
+
+Permission is hereby granted, free of charge, to any person obtaining
+a copy of this software and associated documentation files (the
+'Software'), to deal in the Software without restriction, including
+without limitation the rights to use, copy, modify, merge, publish,
+distribute, sublicense, and/or sell copies of the Software, and to
+permit persons to whom the Software is furnished to do so, subject to
+the following conditions:
+
+The above copyright notice and this permission notice shall be
+included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
+CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+=========================================
+END OF encodeurl@2.0.0 AND INFORMATION
+
+%% end-of-stream@1.4.4 NOTICES AND INFORMATION BEGIN HERE
+=========================================
+The MIT License (MIT)
+
+Copyright (c) 2014 Mathias Buus
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+THE SOFTWARE.
+=========================================
+END OF end-of-stream@1.4.4 AND INFORMATION
+
+%% es-define-property@1.0.1 NOTICES AND INFORMATION BEGIN HERE
+=========================================
+MIT License
+
+Copyright (c) 2024 Jordan Harband
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
+=========================================
+END OF es-define-property@1.0.1 AND INFORMATION
+
+%% es-errors@1.3.0 NOTICES AND INFORMATION BEGIN HERE
+=========================================
+MIT License
+
+Copyright (c) 2024 Jordan Harband
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
+=========================================
+END OF es-errors@1.3.0 AND INFORMATION
+
+%% es-object-atoms@1.1.1 NOTICES AND INFORMATION BEGIN HERE
+=========================================
+MIT License
+
+Copyright (c) 2024 Jordan Harband
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
+=========================================
+END OF es-object-atoms@1.1.1 AND INFORMATION
+
+%% escape-html@1.0.3 NOTICES AND INFORMATION BEGIN HERE
+=========================================
+(The MIT License)
+
+Copyright (c) 2012-2013 TJ Holowaychuk
+Copyright (c) 2015 Andreas Lubbe
+Copyright (c) 2015 Tiancheng "Timothy" Gu
+
+Permission is hereby granted, free of charge, to any person obtaining
+a copy of this software and associated documentation files (the
+'Software'), to deal in the Software without restriction, including
+without limitation the rights to use, copy, modify, merge, publish,
+distribute, sublicense, and/or sell copies of the Software, and to
+permit persons to whom the Software is furnished to do so, subject to
+the following conditions:
+
+The above copyright notice and this permission notice shall be
+included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
+CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+=========================================
+END OF escape-html@1.0.3 AND INFORMATION
+
+%% etag@1.8.1 NOTICES AND INFORMATION BEGIN HERE
+=========================================
+(The MIT License)
+
+Copyright (c) 2014-2016 Douglas Christopher Wilson
+
+Permission is hereby granted, free of charge, to any person obtaining
+a copy of this software and associated documentation files (the
+'Software'), to deal in the Software without restriction, including
+without limitation the rights to use, copy, modify, merge, publish,
+distribute, sublicense, and/or sell copies of the Software, and to
+permit persons to whom the Software is furnished to do so, subject to
+the following conditions:
+
+The above copyright notice and this permission notice shall be
+included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
+CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+=========================================
+END OF etag@1.8.1 AND INFORMATION
+
+%% eventsource-parser@3.0.3 NOTICES AND INFORMATION BEGIN HERE
+=========================================
+MIT License
+
+Copyright (c) 2025 Espen Hovlandsdal