@gmod/cram 1.6.0 → 1.6.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +15 -2
- package/README.md +152 -114
- package/dist/craiIndex.js +2 -4
- package/dist/craiIndex.js.map +1 -1
- package/dist/cram-bundle.js +4 -15
- package/dist/cramFile/codecs/byteArrayLength.d.ts +1 -1
- package/dist/cramFile/codecs/byteArrayLength.js +1 -1
- package/dist/cramFile/codecs/byteArrayLength.js.map +1 -1
- package/dist/cramFile/codecs/byteArrayStop.js +1 -2
- package/dist/cramFile/codecs/byteArrayStop.js.map +1 -1
- package/dist/cramFile/codecs/external.js +1 -3
- package/dist/cramFile/codecs/external.js.map +1 -1
- package/dist/cramFile/container/compressionScheme.d.ts +1 -1
- package/dist/cramFile/container/compressionScheme.js +6 -4
- package/dist/cramFile/container/compressionScheme.js.map +1 -1
- package/dist/cramFile/file.js +19 -2
- package/dist/cramFile/file.js.map +1 -1
- package/dist/cramFile/slice/decodeRecord.js +62 -58
- package/dist/cramFile/slice/decodeRecord.js.map +1 -1
- package/dist/cramFile/slice/index.js +8 -5
- package/dist/cramFile/slice/index.js.map +1 -1
- package/dist/unzip-pako.d.ts +2 -0
- package/dist/unzip-pako.js +9 -0
- package/dist/unzip-pako.js.map +1 -0
- package/dist/unzip.d.ts +2 -0
- package/dist/unzip.js +6 -0
- package/dist/unzip.js.map +1 -0
- package/esm/craiIndex.js +2 -4
- package/esm/craiIndex.js.map +1 -1
- package/esm/cramFile/codecs/byteArrayLength.d.ts +1 -1
- package/esm/cramFile/codecs/byteArrayLength.js +1 -1
- package/esm/cramFile/codecs/byteArrayLength.js.map +1 -1
- package/esm/cramFile/codecs/byteArrayStop.js +1 -2
- package/esm/cramFile/codecs/byteArrayStop.js.map +1 -1
- package/esm/cramFile/codecs/external.js +1 -3
- package/esm/cramFile/codecs/external.js.map +1 -1
- package/esm/cramFile/container/compressionScheme.d.ts +1 -1
- package/esm/cramFile/container/compressionScheme.js +6 -4
- package/esm/cramFile/container/compressionScheme.js.map +1 -1
- package/esm/cramFile/file.js +19 -2
- package/esm/cramFile/file.js.map +1 -1
- package/esm/cramFile/slice/decodeRecord.js +63 -59
- package/esm/cramFile/slice/decodeRecord.js.map +1 -1
- package/esm/cramFile/slice/index.js +11 -7
- package/esm/cramFile/slice/index.js.map +1 -1
- package/esm/unzip-pako.d.ts +2 -0
- package/esm/unzip-pako.js +5 -0
- package/esm/unzip-pako.js.map +1 -0
- package/esm/unzip.d.ts +2 -0
- package/esm/unzip.js +3 -0
- package/esm/unzip.js.map +1 -0
- package/package.json +7 -2
- package/src/craiIndex.js +180 -0
- package/src/cramFile/codecs/_base.js +49 -0
- package/src/cramFile/codecs/beta.js +23 -0
- package/src/cramFile/codecs/byteArrayLength.js +55 -0
- package/src/cramFile/codecs/byteArrayStop.js +49 -0
- package/src/cramFile/codecs/external.js +52 -0
- package/src/cramFile/codecs/gamma.js +30 -0
- package/src/cramFile/codecs/huffman.js +137 -0
- package/src/cramFile/codecs/index.js +38 -0
- package/src/cramFile/codecs/subexp.js +32 -0
- package/src/cramFile/constants.js +55 -0
- package/src/cramFile/container/compressionScheme.js +143 -0
- package/src/cramFile/container/index.js +119 -0
- package/src/cramFile/file.js +363 -0
- package/src/cramFile/index.js +3 -0
- package/src/cramFile/record.js +337 -0
- package/src/cramFile/sectionParsers.js +379 -0
- package/src/cramFile/slice/decodeRecord.js +359 -0
- package/src/cramFile/slice/index.js +501 -0
- package/src/cramFile/util.js +169 -0
- package/src/errors.js +22 -0
- package/src/index.js +5 -0
- package/src/indexedCramFile.js +191 -0
- package/src/io/bufferCache.js +66 -0
- package/src/io/index.js +26 -0
- package/src/io/localFile.js +35 -0
- package/src/io/remoteFile.js +71 -0
- package/src/rans/README.md +1 -0
- package/src/rans/constants.js +5 -0
- package/src/rans/d04.js +83 -0
- package/src/rans/d14.js +59 -0
- package/src/rans/decoding.js +141 -0
- package/src/rans/frequencies.js +121 -0
- package/src/rans/index.js +249 -0
- package/src/sam.js +15 -0
- package/src/unzip-pako.ts +5 -0
- package/src/unzip.ts +2 -0
package/dist/cram-bundle.js
CHANGED
|
@@ -1,28 +1,17 @@
|
|
|
1
|
-
window.gmodCRAM=function(
|
|
1
|
+
window.gmodCRAM=function(t){var e={};function r(n){if(e[n])return e[n].exports;var i=e[n]={i:n,l:!1,exports:{}};return t[n].call(i.exports,i,i.exports,r),i.l=!0,i.exports}return r.m=t,r.c=e,r.d=function(t,e,n){r.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},r.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},r.t=function(t,e){if(1&e&&(t=r(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var i in t)r.d(n,i,function(e){return t[e]}.bind(null,i));return n},r.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return r.d(e,"a",e),e},r.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},r.p="",r(r.s=31)}([function(t,e,r){"use strict";var n,i=this&&this.__extends||(n=function(t,e){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function r(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)});Object.defineProperty(e,"__esModule",{value:!0}),e.CramArgumentError=e.CramSizeLimitError=e.CramBufferOverrunError=e.CramMalformedError=e.CramUnimplementedError=e.CramError=void 0;var o=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i(e,t),e}(Error);e.CramError=o;var a=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i(e,t),e}(Error);e.CramUnimplementedError=a;var s=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i(e,t),e}(o);e.CramMalformedError=s;var f=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i(e,t),e}(s);e.CramBufferOverrunError=f;var u=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i(e,t),e}(o);e.CramSizeLimitError=u;var c=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i(e,t),e}(o);e.CramArgumentError=c},function(t,e,r){"use strict";(function(t){
|
|
2
2
|
/*!
|
|
3
3
|
* The buffer module from node.js, for the browser.
|
|
4
4
|
*
|
|
5
5
|
* @author Feross Aboukhadijeh <http://feross.org>
|
|
6
6
|
* @license MIT
|
|
7
7
|
*/
|
|
8
|
-
var n=r(46),i=r(47),o=r(25);function a(){return f.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function s(e,t){if(a()<t)throw new RangeError("Invalid typed array length");return f.TYPED_ARRAY_SUPPORT?(e=new Uint8Array(t)).__proto__=f.prototype:(null===e&&(e=new f(t)),e.length=t),e}function f(e,t,r){if(!(f.TYPED_ARRAY_SUPPORT||this instanceof f))return new f(e,t,r);if("number"==typeof e){if("string"==typeof t)throw new Error("If encoding is specified then the first argument must be a string");return l(this,e)}return u(this,e,t,r)}function u(e,t,r,n){if("number"==typeof t)throw new TypeError('"value" argument must not be a number');return"undefined"!=typeof ArrayBuffer&&t instanceof ArrayBuffer?function(e,t,r,n){if(t.byteLength,r<0||t.byteLength<r)throw new RangeError("'offset' is out of bounds");if(t.byteLength<r+(n||0))throw new RangeError("'length' is out of bounds");t=void 0===r&&void 0===n?new Uint8Array(t):void 0===n?new Uint8Array(t,r):new Uint8Array(t,r,n);f.TYPED_ARRAY_SUPPORT?(e=t).__proto__=f.prototype:e=h(e,t);return e}(e,t,r,n):"string"==typeof t?function(e,t,r){"string"==typeof r&&""!==r||(r="utf8");if(!f.isEncoding(r))throw new TypeError('"encoding" must be a valid string encoding');var n=0|p(t,r),i=(e=s(e,n)).write(t,r);i!==n&&(e=e.slice(0,i));return e}(e,t,r):function(e,t){if(f.isBuffer(t)){var r=0|d(t.length);return 0===(e=s(e,r)).length||t.copy(e,0,0,r),e}if(t){if("undefined"!=typeof ArrayBuffer&&t.buffer instanceof ArrayBuffer||"length"in t)return"number"!=typeof t.length||(n=t.length)!=n?s(e,0):h(e,t);if("Buffer"===t.type&&o(t.data))return h(e,t.data)}var n;throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}(e,t)}function c(e){if("number"!=typeof e)throw new TypeError('"size" argument must be a number');if(e<0)throw new RangeError('"size" argument must not be negative')}function l(e,t){if(c(t),e=s(e,t<0?0:0|d(t)),!f.TYPED_ARRAY_SUPPORT)for(var r=0;r<t;++r)e[r]=0;return e}function h(e,t){var r=t.length<0?0:0|d(t.length);e=s(e,r);for(var n=0;n<r;n+=1)e[n]=255&t[n];return e}function d(e){if(e>=a())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+a().toString(16)+" bytes");return 0|e}function p(e,t){if(f.isBuffer(e))return e.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(e)||e instanceof ArrayBuffer))return e.byteLength;"string"!=typeof e&&(e=""+e);var r=e.length;if(0===r)return 0;for(var n=!1;;)switch(t){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":case void 0:return j(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return z(e).length;default:if(n)return j(e).length;t=(""+t).toLowerCase(),n=!0}}function g(e,t,r){var n=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if((r>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return B(this,t,r);case"utf8":case"utf-8":return k(this,t,r);case"ascii":return x(this,t,r);case"latin1":case"binary":return C(this,t,r);case"base64":return R(this,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return T(this,t,r);default:if(n)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),n=!0}}function y(e,t,r){var n=e[t];e[t]=e[r],e[r]=n}function v(e,t,r,n,i){if(0===e.length)return-1;if("string"==typeof r?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),r=+r,isNaN(r)&&(r=i?0:e.length-1),r<0&&(r=e.length+r),r>=e.length){if(i)return-1;r=e.length-1}else if(r<0){if(!i)return-1;r=0}if("string"==typeof t&&(t=f.from(t,n)),f.isBuffer(t))return 0===t.length?-1:m(e,t,r,n,i);if("number"==typeof t)return t&=255,f.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(e,t,r):Uint8Array.prototype.lastIndexOf.call(e,t,r):m(e,[t],r,n,i);throw new TypeError("val must be string, number or Buffer")}function m(e,t,r,n,i){var o,a=1,s=e.length,f=t.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(e.length<2||t.length<2)return-1;a=2,s/=2,f/=2,r/=2}function u(e,t){return 1===a?e[t]:e.readUInt16BE(t*a)}if(i){var c=-1;for(o=r;o<s;o++)if(u(e,o)===u(t,-1===c?0:o-c)){if(-1===c&&(c=o),o-c+1===f)return c*a}else-1!==c&&(o-=o-c),c=-1}else for(r+f>s&&(r=s-f),o=r;o>=0;o--){for(var l=!0,h=0;h<f;h++)if(u(e,o+h)!==u(t,h)){l=!1;break}if(l)return o}return-1}function b(e,t,r,n){r=Number(r)||0;var i=e.length-r;n?(n=Number(n))>i&&(n=i):n=i;var o=t.length;if(o%2!=0)throw new TypeError("Invalid hex string");n>o/2&&(n=o/2);for(var a=0;a<n;++a){var s=parseInt(t.substr(2*a,2),16);if(isNaN(s))return a;e[r+a]=s}return a}function _(e,t,r,n){return q(j(t,e.length-r),e,r,n)}function w(e,t,r,n){return q(function(e){for(var t=[],r=0;r<e.length;++r)t.push(255&e.charCodeAt(r));return t}(t),e,r,n)}function E(e,t,r,n){return w(e,t,r,n)}function S(e,t,r,n){return q(z(t),e,r,n)}function A(e,t,r,n){return q(function(e,t){for(var r,n,i,o=[],a=0;a<e.length&&!((t-=2)<0);++a)r=e.charCodeAt(a),n=r>>8,i=r%256,o.push(i),o.push(n);return o}(t,e.length-r),e,r,n)}function R(e,t,r){return 0===t&&r===e.length?n.fromByteArray(e):n.fromByteArray(e.slice(t,r))}function k(e,t,r){r=Math.min(e.length,r);for(var n=[],i=t;i<r;){var o,a,s,f,u=e[i],c=null,l=u>239?4:u>223?3:u>191?2:1;if(i+l<=r)switch(l){case 1:u<128&&(c=u);break;case 2:128==(192&(o=e[i+1]))&&(f=(31&u)<<6|63&o)>127&&(c=f);break;case 3:o=e[i+1],a=e[i+2],128==(192&o)&&128==(192&a)&&(f=(15&u)<<12|(63&o)<<6|63&a)>2047&&(f<55296||f>57343)&&(c=f);break;case 4:o=e[i+1],a=e[i+2],s=e[i+3],128==(192&o)&&128==(192&a)&&128==(192&s)&&(f=(15&u)<<18|(63&o)<<12|(63&a)<<6|63&s)>65535&&f<1114112&&(c=f)}null===c?(c=65533,l=1):c>65535&&(c-=65536,n.push(c>>>10&1023|55296),c=56320|1023&c),n.push(c),i+=l}return function(e){var t=e.length;if(t<=4096)return String.fromCharCode.apply(String,e);var r="",n=0;for(;n<t;)r+=String.fromCharCode.apply(String,e.slice(n,n+=4096));return r}(n)}t.Buffer=f,t.SlowBuffer=function(e){+e!=e&&(e=0);return f.alloc(+e)},t.INSPECT_MAX_BYTES=50,f.TYPED_ARRAY_SUPPORT=void 0!==e.TYPED_ARRAY_SUPPORT?e.TYPED_ARRAY_SUPPORT:function(){try{var e=new Uint8Array(1);return e.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},42===e.foo()&&"function"==typeof e.subarray&&0===e.subarray(1,1).byteLength}catch(e){return!1}}(),t.kMaxLength=a(),f.poolSize=8192,f._augment=function(e){return e.__proto__=f.prototype,e},f.from=function(e,t,r){return u(null,e,t,r)},f.TYPED_ARRAY_SUPPORT&&(f.prototype.__proto__=Uint8Array.prototype,f.__proto__=Uint8Array,"undefined"!=typeof Symbol&&Symbol.species&&f[Symbol.species]===f&&Object.defineProperty(f,Symbol.species,{value:null,configurable:!0})),f.alloc=function(e,t,r){return function(e,t,r,n){return c(t),t<=0?s(e,t):void 0!==r?"string"==typeof n?s(e,t).fill(r,n):s(e,t).fill(r):s(e,t)}(null,e,t,r)},f.allocUnsafe=function(e){return l(null,e)},f.allocUnsafeSlow=function(e){return l(null,e)},f.isBuffer=function(e){return!(null==e||!e._isBuffer)},f.compare=function(e,t){if(!f.isBuffer(e)||!f.isBuffer(t))throw new TypeError("Arguments must be Buffers");if(e===t)return 0;for(var r=e.length,n=t.length,i=0,o=Math.min(r,n);i<o;++i)if(e[i]!==t[i]){r=e[i],n=t[i];break}return r<n?-1:n<r?1:0},f.isEncoding=function(e){switch(String(e).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},f.concat=function(e,t){if(!o(e))throw new TypeError('"list" argument must be an Array of Buffers');if(0===e.length)return f.alloc(0);var r;if(void 0===t)for(t=0,r=0;r<e.length;++r)t+=e[r].length;var n=f.allocUnsafe(t),i=0;for(r=0;r<e.length;++r){var a=e[r];if(!f.isBuffer(a))throw new TypeError('"list" argument must be an Array of Buffers');a.copy(n,i),i+=a.length}return n},f.byteLength=p,f.prototype._isBuffer=!0,f.prototype.swap16=function(){var e=this.length;if(e%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var t=0;t<e;t+=2)y(this,t,t+1);return this},f.prototype.swap32=function(){var e=this.length;if(e%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var t=0;t<e;t+=4)y(this,t,t+3),y(this,t+1,t+2);return this},f.prototype.swap64=function(){var e=this.length;if(e%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var t=0;t<e;t+=8)y(this,t,t+7),y(this,t+1,t+6),y(this,t+2,t+5),y(this,t+3,t+4);return this},f.prototype.toString=function(){var e=0|this.length;return 0===e?"":0===arguments.length?k(this,0,e):g.apply(this,arguments)},f.prototype.equals=function(e){if(!f.isBuffer(e))throw new TypeError("Argument must be a Buffer");return this===e||0===f.compare(this,e)},f.prototype.inspect=function(){var e="",r=t.INSPECT_MAX_BYTES;return this.length>0&&(e=this.toString("hex",0,r).match(/.{2}/g).join(" "),this.length>r&&(e+=" ... ")),"<Buffer "+e+">"},f.prototype.compare=function(e,t,r,n,i){if(!f.isBuffer(e))throw new TypeError("Argument must be a Buffer");if(void 0===t&&(t=0),void 0===r&&(r=e?e.length:0),void 0===n&&(n=0),void 0===i&&(i=this.length),t<0||r>e.length||n<0||i>this.length)throw new RangeError("out of range index");if(n>=i&&t>=r)return 0;if(n>=i)return-1;if(t>=r)return 1;if(this===e)return 0;for(var o=(i>>>=0)-(n>>>=0),a=(r>>>=0)-(t>>>=0),s=Math.min(o,a),u=this.slice(n,i),c=e.slice(t,r),l=0;l<s;++l)if(u[l]!==c[l]){o=u[l],a=c[l];break}return o<a?-1:a<o?1:0},f.prototype.includes=function(e,t,r){return-1!==this.indexOf(e,t,r)},f.prototype.indexOf=function(e,t,r){return v(this,e,t,r,!0)},f.prototype.lastIndexOf=function(e,t,r){return v(this,e,t,r,!1)},f.prototype.write=function(e,t,r,n){if(void 0===t)n="utf8",r=this.length,t=0;else if(void 0===r&&"string"==typeof t)n=t,r=this.length,t=0;else{if(!isFinite(t))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");t|=0,isFinite(r)?(r|=0,void 0===n&&(n="utf8")):(n=r,r=void 0)}var i=this.length-t;if((void 0===r||r>i)&&(r=i),e.length>0&&(r<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");for(var o=!1;;)switch(n){case"hex":return b(this,e,t,r);case"utf8":case"utf-8":return _(this,e,t,r);case"ascii":return w(this,e,t,r);case"latin1":case"binary":return E(this,e,t,r);case"base64":return S(this,e,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return A(this,e,t,r);default:if(o)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),o=!0}},f.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function x(e,t,r){var n="";r=Math.min(e.length,r);for(var i=t;i<r;++i)n+=String.fromCharCode(127&e[i]);return n}function C(e,t,r){var n="";r=Math.min(e.length,r);for(var i=t;i<r;++i)n+=String.fromCharCode(e[i]);return n}function B(e,t,r){var n=e.length;(!t||t<0)&&(t=0),(!r||r<0||r>n)&&(r=n);for(var i="",o=t;o<r;++o)i+=D(e[o]);return i}function T(e,t,r){for(var n=e.slice(t,r),i="",o=0;o<n.length;o+=2)i+=String.fromCharCode(n[o]+256*n[o+1]);return i}function M(e,t,r){if(e%1!=0||e<0)throw new RangeError("offset is not uint");if(e+t>r)throw new RangeError("Trying to access beyond buffer length")}function O(e,t,r,n,i,o){if(!f.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>i||t<o)throw new RangeError('"value" argument is out of bounds');if(r+n>e.length)throw new RangeError("Index out of range")}function I(e,t,r,n){t<0&&(t=65535+t+1);for(var i=0,o=Math.min(e.length-r,2);i<o;++i)e[r+i]=(t&255<<8*(n?i:1-i))>>>8*(n?i:1-i)}function P(e,t,r,n){t<0&&(t=4294967295+t+1);for(var i=0,o=Math.min(e.length-r,4);i<o;++i)e[r+i]=t>>>8*(n?i:3-i)&255}function L(e,t,r,n,i,o){if(r+n>e.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function F(e,t,r,n,o){return o||L(e,0,r,4),i.write(e,t,r,n,23,4),r+4}function N(e,t,r,n,o){return o||L(e,0,r,8),i.write(e,t,r,n,52,8),r+8}f.prototype.slice=function(e,t){var r,n=this.length;if((e=~~e)<0?(e+=n)<0&&(e=0):e>n&&(e=n),(t=void 0===t?n:~~t)<0?(t+=n)<0&&(t=0):t>n&&(t=n),t<e&&(t=e),f.TYPED_ARRAY_SUPPORT)(r=this.subarray(e,t)).__proto__=f.prototype;else{var i=t-e;r=new f(i,void 0);for(var o=0;o<i;++o)r[o]=this[o+e]}return r},f.prototype.readUIntLE=function(e,t,r){e|=0,t|=0,r||M(e,t,this.length);for(var n=this[e],i=1,o=0;++o<t&&(i*=256);)n+=this[e+o]*i;return n},f.prototype.readUIntBE=function(e,t,r){e|=0,t|=0,r||M(e,t,this.length);for(var n=this[e+--t],i=1;t>0&&(i*=256);)n+=this[e+--t]*i;return n},f.prototype.readUInt8=function(e,t){return t||M(e,1,this.length),this[e]},f.prototype.readUInt16LE=function(e,t){return t||M(e,2,this.length),this[e]|this[e+1]<<8},f.prototype.readUInt16BE=function(e,t){return t||M(e,2,this.length),this[e]<<8|this[e+1]},f.prototype.readUInt32LE=function(e,t){return t||M(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},f.prototype.readUInt32BE=function(e,t){return t||M(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},f.prototype.readIntLE=function(e,t,r){e|=0,t|=0,r||M(e,t,this.length);for(var n=this[e],i=1,o=0;++o<t&&(i*=256);)n+=this[e+o]*i;return n>=(i*=128)&&(n-=Math.pow(2,8*t)),n},f.prototype.readIntBE=function(e,t,r){e|=0,t|=0,r||M(e,t,this.length);for(var n=t,i=1,o=this[e+--n];n>0&&(i*=256);)o+=this[e+--n]*i;return o>=(i*=128)&&(o-=Math.pow(2,8*t)),o},f.prototype.readInt8=function(e,t){return t||M(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},f.prototype.readInt16LE=function(e,t){t||M(e,2,this.length);var r=this[e]|this[e+1]<<8;return 32768&r?4294901760|r:r},f.prototype.readInt16BE=function(e,t){t||M(e,2,this.length);var r=this[e+1]|this[e]<<8;return 32768&r?4294901760|r:r},f.prototype.readInt32LE=function(e,t){return t||M(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},f.prototype.readInt32BE=function(e,t){return t||M(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},f.prototype.readFloatLE=function(e,t){return t||M(e,4,this.length),i.read(this,e,!0,23,4)},f.prototype.readFloatBE=function(e,t){return t||M(e,4,this.length),i.read(this,e,!1,23,4)},f.prototype.readDoubleLE=function(e,t){return t||M(e,8,this.length),i.read(this,e,!0,52,8)},f.prototype.readDoubleBE=function(e,t){return t||M(e,8,this.length),i.read(this,e,!1,52,8)},f.prototype.writeUIntLE=function(e,t,r,n){(e=+e,t|=0,r|=0,n)||O(this,e,t,r,Math.pow(2,8*r)-1,0);var i=1,o=0;for(this[t]=255&e;++o<r&&(i*=256);)this[t+o]=e/i&255;return t+r},f.prototype.writeUIntBE=function(e,t,r,n){(e=+e,t|=0,r|=0,n)||O(this,e,t,r,Math.pow(2,8*r)-1,0);var i=r-1,o=1;for(this[t+i]=255&e;--i>=0&&(o*=256);)this[t+i]=e/o&255;return t+r},f.prototype.writeUInt8=function(e,t,r){return e=+e,t|=0,r||O(this,e,t,1,255,0),f.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),this[t]=255&e,t+1},f.prototype.writeUInt16LE=function(e,t,r){return e=+e,t|=0,r||O(this,e,t,2,65535,0),f.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):I(this,e,t,!0),t+2},f.prototype.writeUInt16BE=function(e,t,r){return e=+e,t|=0,r||O(this,e,t,2,65535,0),f.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):I(this,e,t,!1),t+2},f.prototype.writeUInt32LE=function(e,t,r){return e=+e,t|=0,r||O(this,e,t,4,4294967295,0),f.TYPED_ARRAY_SUPPORT?(this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e):P(this,e,t,!0),t+4},f.prototype.writeUInt32BE=function(e,t,r){return e=+e,t|=0,r||O(this,e,t,4,4294967295,0),f.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):P(this,e,t,!1),t+4},f.prototype.writeIntLE=function(e,t,r,n){if(e=+e,t|=0,!n){var i=Math.pow(2,8*r-1);O(this,e,t,r,i-1,-i)}var o=0,a=1,s=0;for(this[t]=255&e;++o<r&&(a*=256);)e<0&&0===s&&0!==this[t+o-1]&&(s=1),this[t+o]=(e/a>>0)-s&255;return t+r},f.prototype.writeIntBE=function(e,t,r,n){if(e=+e,t|=0,!n){var i=Math.pow(2,8*r-1);O(this,e,t,r,i-1,-i)}var o=r-1,a=1,s=0;for(this[t+o]=255&e;--o>=0&&(a*=256);)e<0&&0===s&&0!==this[t+o+1]&&(s=1),this[t+o]=(e/a>>0)-s&255;return t+r},f.prototype.writeInt8=function(e,t,r){return e=+e,t|=0,r||O(this,e,t,1,127,-128),f.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),e<0&&(e=255+e+1),this[t]=255&e,t+1},f.prototype.writeInt16LE=function(e,t,r){return e=+e,t|=0,r||O(this,e,t,2,32767,-32768),f.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):I(this,e,t,!0),t+2},f.prototype.writeInt16BE=function(e,t,r){return e=+e,t|=0,r||O(this,e,t,2,32767,-32768),f.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):I(this,e,t,!1),t+2},f.prototype.writeInt32LE=function(e,t,r){return e=+e,t|=0,r||O(this,e,t,4,2147483647,-2147483648),f.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24):P(this,e,t,!0),t+4},f.prototype.writeInt32BE=function(e,t,r){return e=+e,t|=0,r||O(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),f.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):P(this,e,t,!1),t+4},f.prototype.writeFloatLE=function(e,t,r){return F(this,e,t,!0,r)},f.prototype.writeFloatBE=function(e,t,r){return F(this,e,t,!1,r)},f.prototype.writeDoubleLE=function(e,t,r){return N(this,e,t,!0,r)},f.prototype.writeDoubleBE=function(e,t,r){return N(this,e,t,!1,r)},f.prototype.copy=function(e,t,r,n){if(r||(r=0),n||0===n||(n=this.length),t>=e.length&&(t=e.length),t||(t=0),n>0&&n<r&&(n=r),n===r)return 0;if(0===e.length||0===this.length)return 0;if(t<0)throw new RangeError("targetStart out of bounds");if(r<0||r>=this.length)throw new RangeError("sourceStart out of bounds");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),e.length-t<n-r&&(n=e.length-t+r);var i,o=n-r;if(this===e&&r<t&&t<n)for(i=o-1;i>=0;--i)e[i+t]=this[i+r];else if(o<1e3||!f.TYPED_ARRAY_SUPPORT)for(i=0;i<o;++i)e[i+t]=this[i+r];else Uint8Array.prototype.set.call(e,this.subarray(r,r+o),t);return o},f.prototype.fill=function(e,t,r,n){if("string"==typeof e){if("string"==typeof t?(n=t,t=0,r=this.length):"string"==typeof r&&(n=r,r=this.length),1===e.length){var i=e.charCodeAt(0);i<256&&(e=i)}if(void 0!==n&&"string"!=typeof n)throw new TypeError("encoding must be a string");if("string"==typeof n&&!f.isEncoding(n))throw new TypeError("Unknown encoding: "+n)}else"number"==typeof e&&(e&=255);if(t<0||this.length<t||this.length<r)throw new RangeError("Out of range index");if(r<=t)return this;var o;if(t>>>=0,r=void 0===r?this.length:r>>>0,e||(e=0),"number"==typeof e)for(o=t;o<r;++o)this[o]=e;else{var a=f.isBuffer(e)?e:j(new f(e,n).toString()),s=a.length;for(o=0;o<r-t;++o)this[o+t]=a[o%s]}return this};var U=/[^+\/0-9A-Za-z-_]/g;function D(e){return e<16?"0"+e.toString(16):e.toString(16)}function j(e,t){var r;t=t||1/0;for(var n=e.length,i=null,o=[],a=0;a<n;++a){if((r=e.charCodeAt(a))>55295&&r<57344){if(!i){if(r>56319){(t-=3)>-1&&o.push(239,191,189);continue}if(a+1===n){(t-=3)>-1&&o.push(239,191,189);continue}i=r;continue}if(r<56320){(t-=3)>-1&&o.push(239,191,189),i=r;continue}r=65536+(i-55296<<10|r-56320)}else i&&(t-=3)>-1&&o.push(239,191,189);if(i=null,r<128){if((t-=1)<0)break;o.push(r)}else if(r<2048){if((t-=2)<0)break;o.push(r>>6|192,63&r|128)}else if(r<65536){if((t-=3)<0)break;o.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;o.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return o}function z(e){return n.toByteArray(function(e){if((e=function(e){return e.trim?e.trim():e.replace(/^\s+|\s+$/g,"")}(e).replace(U,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function q(e,t,r,n){for(var i=0;i<n&&!(i+r>=t.length||i>=e.length);++i)t[i+r]=e[i];return i}}).call(this,r(2))},function(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0}),t.CramArgumentError=t.CramSizeLimitError=t.CramBufferOverrunError=t.CramMalformedError=t.CramUnimplementedError=t.CramError=void 0;var o=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return i(t,e),t}(Error);t.CramError=o;var a=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return i(t,e),t}(Error);t.CramUnimplementedError=a;var s=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return i(t,e),t}(o);t.CramMalformedError=s;var f=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return i(t,e),t}(s);t.CramBufferOverrunError=f;var u=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return i(t,e),t}(o);t.CramSizeLimitError=u;var c=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return i(t,e),t}(o);t.CramArgumentError=c},function(e,t){var r;r=function(){return this}();try{r=r||new Function("return this")()}catch(e){"object"==typeof window&&(r=window)}e.exports=r},function(e,t){var r,n,i=e.exports={};function o(){throw new Error("setTimeout has not been defined")}function a(){throw new Error("clearTimeout has not been defined")}function s(e){if(r===setTimeout)return setTimeout(e,0);if((r===o||!r)&&setTimeout)return r=setTimeout,setTimeout(e,0);try{return r(e,0)}catch(t){try{return r.call(null,e,0)}catch(t){return r.call(this,e,0)}}}!function(){try{r="function"==typeof setTimeout?setTimeout:o}catch(e){r=o}try{n="function"==typeof clearTimeout?clearTimeout:a}catch(e){n=a}}();var f,u=[],c=!1,l=-1;function h(){c&&f&&(c=!1,f.length?u=f.concat(u):l=-1,u.length&&d())}function d(){if(!c){var e=s(h);c=!0;for(var t=u.length;t;){for(f=u,u=[];++l<t;)f&&f[l].run();l=-1,t=u.length}f=null,c=!1,function(e){if(n===clearTimeout)return clearTimeout(e);if((n===a||!n)&&clearTimeout)return n=clearTimeout,clearTimeout(e);try{n(e)}catch(t){try{return n.call(null,e)}catch(t){return n.call(this,e)}}}(e)}}function p(e,t){this.fun=e,this.array=t}function g(){}i.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var r=1;r<arguments.length;r++)t[r-1]=arguments[r];u.push(new p(e,t)),1!==u.length||c||s(d)},p.prototype.run=function(){this.fun.apply(null,this.array)},i.title="browser",i.browser=!0,i.env={},i.argv=[],i.version="",i.versions={},i.on=g,i.addListener=g,i.once=g,i.off=g,i.removeListener=g,i.removeAllListeners=g,i.emit=g,i.prependListener=g,i.prependOnceListener=g,i.listeners=function(e){return[]},i.binding=function(e){throw new Error("process.binding is not supported")},i.cwd=function(){return"/"},i.chdir=function(e){throw new Error("process.chdir is not supported")},i.umask=function(){return 0}},function(e,t,r){"use strict";var n=r(10),i=Object.keys||function(e){var t=[];for(var r in e)t.push(r);return t};e.exports=l;var o=Object.create(r(7));o.inherits=r(6);var a=r(27),s=r(18);o.inherits(l,a);for(var f=i(s.prototype),u=0;u<f.length;u++){var c=f[u];l.prototype[c]||(l.prototype[c]=s.prototype[c])}function l(e){if(!(this instanceof l))return new l(e);a.call(this,e),s.call(this,e),e&&!1===e.readable&&(this.readable=!1),e&&!1===e.writable&&(this.writable=!1),this.allowHalfOpen=!0,e&&!1===e.allowHalfOpen&&(this.allowHalfOpen=!1),this.once("end",h)}function h(){this.allowHalfOpen||this._writableState.ended||n.nextTick(d,this)}function d(e){e.end()}Object.defineProperty(l.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),Object.defineProperty(l.prototype,"destroyed",{get:function(){return void 0!==this._readableState&&void 0!==this._writableState&&(this._readableState.destroyed&&this._writableState.destroyed)},set:function(e){void 0!==this._readableState&&void 0!==this._writableState&&(this._readableState.destroyed=e,this._writableState.destroyed=e)}}),l.prototype._destroy=function(e,t){this.push(null),this.end(),n.nextTick(t,e)}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(1),i={int:!0,byte:!0,long:!0,byteArray:!0,byteArrayBlock:!0},o=function(){function e(e,t){if(void 0===e&&(e={}),this.parameters=e,this.dataType=t,!t)throw new TypeError("must provide a data type to codec constructor");if(!i[t])throw new TypeError("invalid data type ".concat(t))}return e.prototype._getBits=function(e,t,r){var i=0;if(t.bytePosition+(7-t.bitPosition+r)/8>e.length)throw new n.CramBufferOverrunError("read error during decoding. the file seems to be truncated.");for(var o=r;o;o-=1)i<<=1,i|=e[t.bytePosition]>>t.bitPosition&1,t.bitPosition-=1,t.bitPosition<0&&(t.bytePosition+=1),t.bitPosition&=7;return i},e}();t.default=o},function(e,t){"function"==typeof Object.create?e.exports=function(e,t){t&&(e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:e.exports=function(e,t){if(t){e.super_=t;var r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e}}},function(e,t,r){function n(e){return Object.prototype.toString.call(e)}t.isArray=function(e){return Array.isArray?Array.isArray(e):"[object Array]"===n(e)},t.isBoolean=function(e){return"boolean"==typeof e},t.isNull=function(e){return null===e},t.isNullOrUndefined=function(e){return null==e},t.isNumber=function(e){return"number"==typeof e},t.isString=function(e){return"string"==typeof e},t.isSymbol=function(e){return"symbol"==typeof e},t.isUndefined=function(e){return void 0===e},t.isRegExp=function(e){return"[object RegExp]"===n(e)},t.isObject=function(e){return"object"==typeof e&&null!==e},t.isDate=function(e){return"[object Date]"===n(e)},t.isError=function(e){return"[object Error]"===n(e)||e instanceof Error},t.isFunction=function(e){return"function"==typeof e},t.isPrimitive=function(e){return null===e||"boolean"==typeof e||"number"==typeof e||"string"==typeof e||"symbol"==typeof e||void 0===e},t.isBuffer=r(0).Buffer.isBuffer},function(e,t,r){(function(t){e.exports=class{constructor(e,r=0,n=0){0!=n?(this.buf=t.allocUnsafe(n),this.length=n):(this.buf=e,this.length=e.length),this.pos=r}EOF(){return this.pos>=this.length}ReadData(e){var t=this.buf.slice(this.pos,this.pos+e);return this.pos+=e,t}ReadByte(){const e=this.buf[this.pos];return this.pos++,e}ReadChar(){const e=this.buf[this.pos];return this.pos++,String.fromCharCode(e)}ReadUint16(){var e=this.ReadByte();return e|=this.ReadByte()<<8}ReadUint32(){const e=this.buf.readInt32LE(this.pos);return this.pos+=4,e}ReadString(){var e="";do{var t=this.buf[this.pos++];t&&(e+=String.fromCharCode(t))}while(t);return e}ReadUint7(){var e=0;do{var t=this.ReadByte();e=e<<7|127&t}while(128&t);return e}ReadITF8(){var e=this.buf[this.pos];return this.pos++,e>=240?(e=(15&e)<<28,e+=(this.buf[this.pos+0]<<20)+(this.buf[this.pos+1]<<12)+(this.buf[this.pos+2]<<4)+(this.buf[this.pos+3]>>4),this.pos+=4):e>=224?(e=(15&e)<<24,e+=(this.buf[this.pos+0]<<16)+(this.buf[this.pos+1]<<8)+(this.buf[this.pos+2]<<0),this.pos+=3):e>=192?(e=(31&e)<<16,e+=(this.buf[this.pos+0]<<8)+(this.buf[this.pos+1]<<0),this.pos+=2):e>=128&&(e=(63&e)<<8,e+=this.buf[this.pos],this.pos++),e}WriteByte(e){this.buf[this.pos++]=e}WriteChar(e){this.buf[this.pos++]=e.charCodeAt(0)}WriteString(e){for(var t=0;t<e.length;t++)this.buf[this.pos++]=e.charCodeAt(t);this.buf[this.pos++]=0}WriteData(e,t){for(var r=0;r<t;r++)this.buf[this.pos++]=e[r]}WriteStream(e){this.WriteData(e.buf,e.pos)}WriteUint16(e){this.WriteByte(255&e),this.WriteByte(e>>8&255)}WriteUint32(e){this.buf.writeInt32LE(e,this.pos),this.pos+=4}WriteUint7(e){var t=0,r=e;do{t+=7,r>>=7}while(r>0);do{t-=7,this.WriteByte((e>>t&127)+((t>0)<<7))}while(t>0)}WriteITF8(e){e<0&&(e=1+e),e<=127?this.buf[this.pos++]=e:e<=16383?(this.buf[this.pos++]=128|Math.floor(e/256),this.buf[this.pos++]=255&e):e<131071?(this.buf[this.pos++]=192|Math.floor(e/65536),this.buf[this.pos++]=255&Math.floor(e/256),this.buf[this.pos++]=255&e):e<268435455?(this.buf[this.pos++]=224|Math.floor(e/16777216),this.buf[this.pos++]=255&Math.floor(e/65536),this.buf[this.pos++]=255&Math.floor(e/256),this.buf[this.pos++]=255&e):(this.buf[this.pos++]=240|Math.floor(e/268435456),this.buf[this.pos++]=255&Math.floor(e/1048576),this.buf[this.pos++]=255&Math.floor(e/4096),this.buf[this.pos++]=255&Math.floor(e/4),this.buf[this.pos++]=15&e)}WriteByteNeg(e){this.buf[--this.pos]=e}}}).call(this,r(0).Buffer)},function(e,t,r){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.sequenceMD5=t.tinyMemoize=t.parseItem=t.parseItf8=t.itf8Size=void 0;var i=n(r(88)),o=r(1);t.itf8Size=function(e){return-128&e?-16384&e?-2097152&e?-268435456&e?5:4:3:2:1},t.parseItf8=function(e,t){var r,n=t,i=e[n];if(i<128?(r=i,n+=1):i<192?(r=16383&(i<<8|e[n+1]),n+=2):i<224?(r=2097151&(i<<16|e[n+1]<<8|e[n+2]),n+=3):i<240?(r=268435455&(i<<24|e[n+1]<<16|e[n+2]<<8|e[n+3]),n+=4):(r=(15&i)<<28|e[n+1]<<20|e[n+2]<<12|e[n+3]<<4|15&e[n+4],n+=5),n>e.length)throw new o.CramBufferOverrunError("Attempted to read beyond end of buffer; this file seems truncated.");return[r,n-t]},t.parseItem=function(e,t,r,n){void 0===r&&(r=0),void 0===n&&(n=0);var i=t.parse(e),o=i.offset,a=i.result;return a._endPosition=o+n,a._size=o-r,a},t.tinyMemoize=function(e,t){var r=e.prototype[t],n="_memo_".concat(t);e.prototype[t]=function(){var e=this;if(!(n in this)){var t=r.call(this);this[n]=t,Promise.resolve(t).catch((function(){delete e[n]}))}return this[n]}},t.sequenceMD5=function(e){return(0,i.default)(e.toUpperCase().replace(/[^\x21-\x7e]/g,""))}},function(e,t,r){"use strict";(function(t){void 0===t||!t.version||0===t.version.indexOf("v0.")||0===t.version.indexOf("v1.")&&0!==t.version.indexOf("v1.8.")?e.exports={nextTick:function(e,r,n,i){if("function"!=typeof e)throw new TypeError('"callback" argument must be a function');var o,a,s=arguments.length;switch(s){case 0:case 1:return t.nextTick(e);case 2:return t.nextTick((function(){e.call(null,r)}));case 3:return t.nextTick((function(){e.call(null,r,n)}));case 4:return t.nextTick((function(){e.call(null,r,n,i)}));default:for(o=new Array(s-1),a=0;a<o.length;)o[a++]=arguments[a];return t.nextTick((function(){e.apply(null,o)}))}}}:e.exports=t}).call(this,r(3))},function(e,t,r){"use strict";var n="undefined"!=typeof Uint8Array&&"undefined"!=typeof Uint16Array&&"undefined"!=typeof Int32Array;function i(e,t){return Object.prototype.hasOwnProperty.call(e,t)}t.assign=function(e){for(var t=Array.prototype.slice.call(arguments,1);t.length;){var r=t.shift();if(r){if("object"!=typeof r)throw new TypeError(r+"must be non-object");for(var n in r)i(r,n)&&(e[n]=r[n])}}return e},t.shrinkBuf=function(e,t){return e.length===t?e:e.subarray?e.subarray(0,t):(e.length=t,e)};var o={arraySet:function(e,t,r,n,i){if(t.subarray&&e.subarray)e.set(t.subarray(r,r+n),i);else for(var o=0;o<n;o++)e[i+o]=t[r+o]},flattenChunks:function(e){var t,r,n,i,o,a;for(n=0,t=0,r=e.length;t<r;t++)n+=e[t].length;for(a=new Uint8Array(n),i=0,t=0,r=e.length;t<r;t++)o=e[t],a.set(o,i),i+=o.length;return a}},a={arraySet:function(e,t,r,n,i){for(var o=0;o<n;o++)e[i+o]=t[r+o]},flattenChunks:function(e){return[].concat.apply([],e)}};t.setTyped=function(e){e?(t.Buf8=Uint8Array,t.Buf16=Uint16Array,t.Buf32=Int32Array,t.assign(t,o)):(t.Buf8=Array,t.Buf16=Array,t.Buf32=Array,t.assign(t,a))},t.setTyped(n)},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(1),i=r(13),o=function(){this.F=void 0,this.C=void 0},a=function(){this.fc=new Array(256);for(var e=0;e<this.fc.length;e+=1)this.fc[e]=new o;this.R=null};function s(e,t,r,n){return r*(e>>n)+(e&(1<<n)-1)-t}var f={FC:o,AriDecoder:a,Symbol:function(){this.start=void 0,this.freq=void 0},symbolInit:function(e,t,r){if(!(t<=65536))throw new n.CramMalformedError("assertion failed: start <= 1<<16");if(!(r<=65536-t))throw new n.CramMalformedError("assertion failed: freq <= 1<<16");e.start=t,e.freq=r},advanceStep:s,advanceSymbolStep:function(e,t,r){return s(e,t.start,t.freq,r)},get:function(e,t){return e&(1<<t)-1},advanceSymbol:function(e,t,r,n){return function(e,t,r,n,o){if((e=n*(e>>o)+(e&(1<<o)-1)-r)<i.RANS_BYTE_L)do{e=e<<8|255&t.get()}while(e<i.RANS_BYTE_L);return e}(e,t,r.start,r.freq,n)},renormalize:function(e,t){if(e<i.RANS_BYTE_L)do{e=e<<8|255&t.get()}while(e<i.RANS_BYTE_L);return e}};t.default=f},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.RANS_BYTE_L=t.TOTFREQ=t.TF_SHIFT=void 0;t.TF_SHIFT=12;t.TOTFREQ=4096;t.RANS_BYTE_L=1<<23},function(e,t){e.exports=function(e){return e&&e.__esModule?e:{default:e}},e.exports.__esModule=!0,e.exports.default=e.exports},function(e,t,r){"use strict";var n,i="object"==typeof Reflect?Reflect:null,o=i&&"function"==typeof i.apply?i.apply:function(e,t,r){return Function.prototype.apply.call(e,t,r)};n=i&&"function"==typeof i.ownKeys?i.ownKeys:Object.getOwnPropertySymbols?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:function(e){return Object.getOwnPropertyNames(e)};var a=Number.isNaN||function(e){return e!=e};function s(){s.init.call(this)}e.exports=s,e.exports.once=function(e,t){return new Promise((function(r,n){function i(r){e.removeListener(t,o),n(r)}function o(){"function"==typeof e.removeListener&&e.removeListener("error",i),r([].slice.call(arguments))}v(e,t,o,{once:!0}),"error"!==t&&function(e,t,r){"function"==typeof e.on&&v(e,"error",t,r)}(e,i,{once:!0})}))},s.EventEmitter=s,s.prototype._events=void 0,s.prototype._eventsCount=0,s.prototype._maxListeners=void 0;var f=10;function u(e){if("function"!=typeof e)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof e)}function c(e){return void 0===e._maxListeners?s.defaultMaxListeners:e._maxListeners}function l(e,t,r,n){var i,o,a,s;if(u(r),void 0===(o=e._events)?(o=e._events=Object.create(null),e._eventsCount=0):(void 0!==o.newListener&&(e.emit("newListener",t,r.listener?r.listener:r),o=e._events),a=o[t]),void 0===a)a=o[t]=r,++e._eventsCount;else if("function"==typeof a?a=o[t]=n?[r,a]:[a,r]:n?a.unshift(r):a.push(r),(i=c(e))>0&&a.length>i&&!a.warned){a.warned=!0;var f=new Error("Possible EventEmitter memory leak detected. "+a.length+" "+String(t)+" listeners added. Use emitter.setMaxListeners() to increase limit");f.name="MaxListenersExceededWarning",f.emitter=e,f.type=t,f.count=a.length,s=f,console&&console.warn&&console.warn(s)}return e}function h(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function d(e,t,r){var n={fired:!1,wrapFn:void 0,target:e,type:t,listener:r},i=h.bind(n);return i.listener=r,n.wrapFn=i,i}function p(e,t,r){var n=e._events;if(void 0===n)return[];var i=n[t];return void 0===i?[]:"function"==typeof i?r?[i.listener||i]:[i]:r?function(e){for(var t=new Array(e.length),r=0;r<t.length;++r)t[r]=e[r].listener||e[r];return t}(i):y(i,i.length)}function g(e){var t=this._events;if(void 0!==t){var r=t[e];if("function"==typeof r)return 1;if(void 0!==r)return r.length}return 0}function y(e,t){for(var r=new Array(t),n=0;n<t;++n)r[n]=e[n];return r}function v(e,t,r,n){if("function"==typeof e.on)n.once?e.once(t,r):e.on(t,r);else{if("function"!=typeof e.addEventListener)throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof e);e.addEventListener(t,(function i(o){n.once&&e.removeEventListener(t,i),r(o)}))}}Object.defineProperty(s,"defaultMaxListeners",{enumerable:!0,get:function(){return f},set:function(e){if("number"!=typeof e||e<0||a(e))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+e+".");f=e}}),s.init=function(){void 0!==this._events&&this._events!==Object.getPrototypeOf(this)._events||(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},s.prototype.setMaxListeners=function(e){if("number"!=typeof e||e<0||a(e))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+e+".");return this._maxListeners=e,this},s.prototype.getMaxListeners=function(){return c(this)},s.prototype.emit=function(e){for(var t=[],r=1;r<arguments.length;r++)t.push(arguments[r]);var n="error"===e,i=this._events;if(void 0!==i)n=n&&void 0===i.error;else if(!n)return!1;if(n){var a;if(t.length>0&&(a=t[0]),a instanceof Error)throw a;var s=new Error("Unhandled error."+(a?" ("+a.message+")":""));throw s.context=a,s}var f=i[e];if(void 0===f)return!1;if("function"==typeof f)o(f,this,t);else{var u=f.length,c=y(f,u);for(r=0;r<u;++r)o(c[r],this,t)}return!0},s.prototype.addListener=function(e,t){return l(this,e,t,!1)},s.prototype.on=s.prototype.addListener,s.prototype.prependListener=function(e,t){return l(this,e,t,!0)},s.prototype.once=function(e,t){return u(t),this.on(e,d(this,e,t)),this},s.prototype.prependOnceListener=function(e,t){return u(t),this.prependListener(e,d(this,e,t)),this},s.prototype.removeListener=function(e,t){var r,n,i,o,a;if(u(t),void 0===(n=this._events))return this;if(void 0===(r=n[e]))return this;if(r===t||r.listener===t)0==--this._eventsCount?this._events=Object.create(null):(delete n[e],n.removeListener&&this.emit("removeListener",e,r.listener||t));else if("function"!=typeof r){for(i=-1,o=r.length-1;o>=0;o--)if(r[o]===t||r[o].listener===t){a=r[o].listener,i=o;break}if(i<0)return this;0===i?r.shift():function(e,t){for(;t+1<e.length;t++)e[t]=e[t+1];e.pop()}(r,i),1===r.length&&(n[e]=r[0]),void 0!==n.removeListener&&this.emit("removeListener",e,a||t)}return this},s.prototype.off=s.prototype.removeListener,s.prototype.removeAllListeners=function(e){var t,r,n;if(void 0===(r=this._events))return this;if(void 0===r.removeListener)return 0===arguments.length?(this._events=Object.create(null),this._eventsCount=0):void 0!==r[e]&&(0==--this._eventsCount?this._events=Object.create(null):delete r[e]),this;if(0===arguments.length){var i,o=Object.keys(r);for(n=0;n<o.length;++n)"removeListener"!==(i=o[n])&&this.removeAllListeners(i);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if("function"==typeof(t=r[e]))this.removeListener(e,t);else if(void 0!==t)for(n=t.length-1;n>=0;n--)this.removeListener(e,t[n]);return this},s.prototype.listeners=function(e){return p(this,e,!0)},s.prototype.rawListeners=function(e){return p(this,e,!1)},s.listenerCount=function(e,t){return"function"==typeof e.listenerCount?e.listenerCount(t):g.call(e,t)},s.prototype.listenerCount=g,s.prototype.eventNames=function(){return this._eventsCount>0?n(this._events):[]}},function(e,t,r){(t=e.exports=r(27)).Stream=t,t.Readable=t,t.Writable=r(18),t.Duplex=r(4),t.Transform=r(31),t.PassThrough=r(56)},function(e,t,r){var n=r(0),i=n.Buffer;function o(e,t){for(var r in e)t[r]=e[r]}function a(e,t,r){return i(e,t,r)}i.from&&i.alloc&&i.allocUnsafe&&i.allocUnsafeSlow?e.exports=n:(o(n,t),t.Buffer=a),o(i,a),a.from=function(e,t,r){if("number"==typeof e)throw new TypeError("Argument must not be a number");return i(e,t,r)},a.alloc=function(e,t,r){if("number"!=typeof e)throw new TypeError("Argument must be a number");var n=i(e);return void 0!==t?"string"==typeof r?n.fill(t,r):n.fill(t):n.fill(0),n},a.allocUnsafe=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return i(e)},a.allocUnsafeSlow=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return n.SlowBuffer(e)}},function(e,t,r){"use strict";(function(t,n,i){var o=r(10);function a(e){var t=this;this.next=null,this.entry=null,this.finish=function(){!function(e,t,r){var n=e.entry;e.entry=null;for(;n;){var i=n.callback;t.pendingcb--,i(r),n=n.next}t.corkedRequestsFree?t.corkedRequestsFree.next=e:t.corkedRequestsFree=e}(t,e)}}e.exports=m;var s,f=!t.browser&&["v0.10","v0.9."].indexOf(t.version.slice(0,5))>-1?n:o.nextTick;m.WritableState=v;var u=Object.create(r(7));u.inherits=r(6);var c={deprecate:r(54)},l=r(28),h=r(17).Buffer,d=i.Uint8Array||function(){};var p,g=r(29);function y(){}function v(e,t){s=s||r(4),e=e||{};var n=t instanceof s;this.objectMode=!!e.objectMode,n&&(this.objectMode=this.objectMode||!!e.writableObjectMode);var i=e.highWaterMark,u=e.writableHighWaterMark,c=this.objectMode?16:16384;this.highWaterMark=i||0===i?i:n&&(u||0===u)?u:c,this.highWaterMark=Math.floor(this.highWaterMark),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var l=!1===e.decodeStrings;this.decodeStrings=!l,this.defaultEncoding=e.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(e){!function(e,t){var r=e._writableState,n=r.sync,i=r.writecb;if(function(e){e.writing=!1,e.writecb=null,e.length-=e.writelen,e.writelen=0}(r),t)!function(e,t,r,n,i){--t.pendingcb,r?(o.nextTick(i,n),o.nextTick(A,e,t),e._writableState.errorEmitted=!0,e.emit("error",n)):(i(n),e._writableState.errorEmitted=!0,e.emit("error",n),A(e,t))}(e,r,n,t,i);else{var a=E(r);a||r.corked||r.bufferProcessing||!r.bufferedRequest||w(e,r),n?f(_,e,r,a,i):_(e,r,a,i)}}(t,e)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.bufferedRequestCount=0,this.corkedRequestsFree=new a(this)}function m(e){if(s=s||r(4),!(p.call(m,this)||this instanceof s))return new m(e);this._writableState=new v(e,this),this.writable=!0,e&&("function"==typeof e.write&&(this._write=e.write),"function"==typeof e.writev&&(this._writev=e.writev),"function"==typeof e.destroy&&(this._destroy=e.destroy),"function"==typeof e.final&&(this._final=e.final)),l.call(this)}function b(e,t,r,n,i,o,a){t.writelen=n,t.writecb=a,t.writing=!0,t.sync=!0,r?e._writev(i,t.onwrite):e._write(i,o,t.onwrite),t.sync=!1}function _(e,t,r,n){r||function(e,t){0===t.length&&t.needDrain&&(t.needDrain=!1,e.emit("drain"))}(e,t),t.pendingcb--,n(),A(e,t)}function w(e,t){t.bufferProcessing=!0;var r=t.bufferedRequest;if(e._writev&&r&&r.next){var n=t.bufferedRequestCount,i=new Array(n),o=t.corkedRequestsFree;o.entry=r;for(var s=0,f=!0;r;)i[s]=r,r.isBuf||(f=!1),r=r.next,s+=1;i.allBuffers=f,b(e,t,!0,t.length,i,"",o.finish),t.pendingcb++,t.lastBufferedRequest=null,o.next?(t.corkedRequestsFree=o.next,o.next=null):t.corkedRequestsFree=new a(t),t.bufferedRequestCount=0}else{for(;r;){var u=r.chunk,c=r.encoding,l=r.callback;if(b(e,t,!1,t.objectMode?1:u.length,u,c,l),r=r.next,t.bufferedRequestCount--,t.writing)break}null===r&&(t.lastBufferedRequest=null)}t.bufferedRequest=r,t.bufferProcessing=!1}function E(e){return e.ending&&0===e.length&&null===e.bufferedRequest&&!e.finished&&!e.writing}function S(e,t){e._final((function(r){t.pendingcb--,r&&e.emit("error",r),t.prefinished=!0,e.emit("prefinish"),A(e,t)}))}function A(e,t){var r=E(t);return r&&(!function(e,t){t.prefinished||t.finalCalled||("function"==typeof e._final?(t.pendingcb++,t.finalCalled=!0,o.nextTick(S,e,t)):(t.prefinished=!0,e.emit("prefinish")))}(e,t),0===t.pendingcb&&(t.finished=!0,e.emit("finish"))),r}u.inherits(m,l),v.prototype.getBuffer=function(){for(var e=this.bufferedRequest,t=[];e;)t.push(e),e=e.next;return t},function(){try{Object.defineProperty(v.prototype,"buffer",{get:c.deprecate((function(){return this.getBuffer()}),"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch(e){}}(),"function"==typeof Symbol&&Symbol.hasInstance&&"function"==typeof Function.prototype[Symbol.hasInstance]?(p=Function.prototype[Symbol.hasInstance],Object.defineProperty(m,Symbol.hasInstance,{value:function(e){return!!p.call(this,e)||this===m&&(e&&e._writableState instanceof v)}})):p=function(e){return e instanceof this},m.prototype.pipe=function(){this.emit("error",new Error("Cannot pipe, not readable"))},m.prototype.write=function(e,t,r){var n,i=this._writableState,a=!1,s=!i.objectMode&&(n=e,h.isBuffer(n)||n instanceof d);return s&&!h.isBuffer(e)&&(e=function(e){return h.from(e)}(e)),"function"==typeof t&&(r=t,t=null),s?t="buffer":t||(t=i.defaultEncoding),"function"!=typeof r&&(r=y),i.ended?function(e,t){var r=new Error("write after end");e.emit("error",r),o.nextTick(t,r)}(this,r):(s||function(e,t,r,n){var i=!0,a=!1;return null===r?a=new TypeError("May not write null values to stream"):"string"==typeof r||void 0===r||t.objectMode||(a=new TypeError("Invalid non-string/buffer chunk")),a&&(e.emit("error",a),o.nextTick(n,a),i=!1),i}(this,i,e,r))&&(i.pendingcb++,a=function(e,t,r,n,i,o){if(!r){var a=function(e,t,r){e.objectMode||!1===e.decodeStrings||"string"!=typeof t||(t=h.from(t,r));return t}(t,n,i);n!==a&&(r=!0,i="buffer",n=a)}var s=t.objectMode?1:n.length;t.length+=s;var f=t.length<t.highWaterMark;f||(t.needDrain=!0);if(t.writing||t.corked){var u=t.lastBufferedRequest;t.lastBufferedRequest={chunk:n,encoding:i,isBuf:r,callback:o,next:null},u?u.next=t.lastBufferedRequest:t.bufferedRequest=t.lastBufferedRequest,t.bufferedRequestCount+=1}else b(e,t,!1,s,n,i,o);return f}(this,i,s,e,t,r)),a},m.prototype.cork=function(){this._writableState.corked++},m.prototype.uncork=function(){var e=this._writableState;e.corked&&(e.corked--,e.writing||e.corked||e.finished||e.bufferProcessing||!e.bufferedRequest||w(this,e))},m.prototype.setDefaultEncoding=function(e){if("string"==typeof e&&(e=e.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((e+"").toLowerCase())>-1))throw new TypeError("Unknown encoding: "+e);return this._writableState.defaultEncoding=e,this},Object.defineProperty(m.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),m.prototype._write=function(e,t,r){r(new Error("_write() is not implemented"))},m.prototype._writev=null,m.prototype.end=function(e,t,r){var n=this._writableState;"function"==typeof e?(r=e,e=null,t=null):"function"==typeof t&&(r=t,t=null),null!=e&&this.write(e,t),n.corked&&(n.corked=1,this.uncork()),n.ending||n.finished||function(e,t,r){t.ending=!0,A(e,t),r&&(t.finished?o.nextTick(r):e.once("finish",r));t.ended=!0,e.writable=!1}(this,n,r)},Object.defineProperty(m.prototype,"destroyed",{get:function(){return void 0!==this._writableState&&this._writableState.destroyed},set:function(e){this._writableState&&(this._writableState.destroyed=e)}}),m.prototype.destroy=g.destroy,m.prototype._undestroy=g.undestroy,m.prototype._destroy=function(e,t){this.end(),t(e)}}).call(this,r(3),r(52).setImmediate,r(2))},function(e,t,r){"use strict";class n{constructor(e={}){if(!(e.maxSize&&e.maxSize>0))throw new TypeError("`maxSize` must be a number greater than 0");this.maxSize=e.maxSize,this.cache=new Map,this.oldCache=new Map,this._size=0}_set(e,t){this.cache.set(e,t),this._size++,this._size>=this.maxSize&&(this._size=0,this.oldCache=this.cache,this.cache=new Map)}get(e){if(this.cache.has(e))return this.cache.get(e);if(this.oldCache.has(e)){const t=this.oldCache.get(e);return this._set(e,t),t}}set(e,t){return this.cache.has(e)?this.cache.set(e,t):this._set(e,t),this}has(e){return this.cache.has(e)||this.oldCache.has(e)}peek(e){return this.cache.has(e)?this.cache.get(e):this.oldCache.has(e)?this.oldCache.get(e):void 0}delete(e){const t=this.cache.delete(e);return t&&this._size--,this.oldCache.delete(e)||t}clear(){this.cache.clear(),this.oldCache.clear(),this._size=0}*keys(){for(const[e]of this)yield e}*values(){for(const[,e]of this)yield e}*[Symbol.iterator](){for(const e of this.cache)yield e;for(const e of this.oldCache){const[t]=e;this.cache.has(t)||(yield e)}}get size(){let e=0;for(const t of this.oldCache.keys())this.cache.has(t)||e++;return this._size+e}}e.exports=n},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.default={CRAM_FLAG_PRESERVE_QUAL_SCORES:1,CRAM_FLAG_DETACHED:2,CRAM_FLAG_MATE_DOWNSTREAM:4,CRAM_FLAG_NO_SEQ:8,CRAM_FLAG_MASK:15,CRAM_M_REVERSE:1,CRAM_M_UNMAP:2,BAM_FPAIRED:1,BAM_FPROPER_PAIR:2,BAM_FUNMAP:4,BAM_FMUNMAP:8,BAM_FREVERSE:16,BAM_FMREVERSE:32,BAM_FREAD1:64,BAM_FREAD2:128,BAM_FSECONDARY:256,BAM_FQCFAIL:512,BAM_FDUP:1024,BAM_FSUPPLEMENTARY:2048,BAM_CMATCH:0,BAM_CINS:1,BAM_CDEL:2,BAM_CREF_SKIP:3,BAM_CSOFT_CLIP:4,BAM_CHARD_CLIP:5,BAM_CPAD:6,BAM_CEQUAL:7,BAM_CDIFF:8,BAM_CBACK:9,BAM_CIGAR_STR:"MIDNSHP:XB",BAM_CIGAR_SHIFT:4,BAM_CIGAR_MASK:15,BAM_CIGAR_TYPE:246183}},function(e,t){e.exports=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},e.exports.__esModule=!0,e.exports.default=e.exports},function(e,t){function r(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}e.exports=function(e,t,n){return t&&r(e.prototype,t),n&&r(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e},e.exports.__esModule=!0,e.exports.default=e.exports},function(e,t){e.exports=function(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e},e.exports.__esModule=!0,e.exports.default=e.exports},function(e,t,r){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var i=n(r(45));t.default=i.default},function(e,t){var r={}.toString;e.exports=Array.isArray||function(e){return"[object Array]"==r.call(e)}},function(e,t,r){"use strict";(function(e){var n=r(0).Buffer,i=r(48).Transform,o=r(61),a=r(33),s=r(32).ok,f=r(0).kMaxLength,u="Cannot create final Buffer. It would be larger than 0x"+f.toString(16)+" bytes";o.Z_MIN_WINDOWBITS=8,o.Z_MAX_WINDOWBITS=15,o.Z_DEFAULT_WINDOWBITS=15,o.Z_MIN_CHUNK=64,o.Z_MAX_CHUNK=1/0,o.Z_DEFAULT_CHUNK=16384,o.Z_MIN_MEMLEVEL=1,o.Z_MAX_MEMLEVEL=9,o.Z_DEFAULT_MEMLEVEL=8,o.Z_MIN_LEVEL=-1,o.Z_MAX_LEVEL=9,o.Z_DEFAULT_LEVEL=o.Z_DEFAULT_COMPRESSION;for(var c=Object.keys(o),l=0;l<c.length;l++){var h=c[l];h.match(/^Z/)&&Object.defineProperty(t,h,{enumerable:!0,value:o[h],writable:!1})}for(var d={Z_OK:o.Z_OK,Z_STREAM_END:o.Z_STREAM_END,Z_NEED_DICT:o.Z_NEED_DICT,Z_ERRNO:o.Z_ERRNO,Z_STREAM_ERROR:o.Z_STREAM_ERROR,Z_DATA_ERROR:o.Z_DATA_ERROR,Z_MEM_ERROR:o.Z_MEM_ERROR,Z_BUF_ERROR:o.Z_BUF_ERROR,Z_VERSION_ERROR:o.Z_VERSION_ERROR},p=Object.keys(d),g=0;g<p.length;g++){var y=p[g];d[d[y]]=y}function v(e,t,r){var i=[],o=0;function a(){for(var t;null!==(t=e.read());)i.push(t),o+=t.length;e.once("readable",a)}function s(){var t,a=null;o>=f?a=new RangeError(u):t=n.concat(i,o),i=[],e.close(),r(a,t)}e.on("error",(function(t){e.removeListener("end",s),e.removeListener("readable",a),r(t)})),e.on("end",s),e.end(t),a()}function m(e,t){if("string"==typeof t&&(t=n.from(t)),!n.isBuffer(t))throw new TypeError("Not a string or buffer");var r=e._finishFlushFlag;return e._processChunk(t,r)}function b(e){if(!(this instanceof b))return new b(e);x.call(this,e,o.DEFLATE)}function _(e){if(!(this instanceof _))return new _(e);x.call(this,e,o.INFLATE)}function w(e){if(!(this instanceof w))return new w(e);x.call(this,e,o.GZIP)}function E(e){if(!(this instanceof E))return new E(e);x.call(this,e,o.GUNZIP)}function S(e){if(!(this instanceof S))return new S(e);x.call(this,e,o.DEFLATERAW)}function A(e){if(!(this instanceof A))return new A(e);x.call(this,e,o.INFLATERAW)}function R(e){if(!(this instanceof R))return new R(e);x.call(this,e,o.UNZIP)}function k(e){return e===o.Z_NO_FLUSH||e===o.Z_PARTIAL_FLUSH||e===o.Z_SYNC_FLUSH||e===o.Z_FULL_FLUSH||e===o.Z_FINISH||e===o.Z_BLOCK}function x(e,r){var a=this;if(this._opts=e=e||{},this._chunkSize=e.chunkSize||t.Z_DEFAULT_CHUNK,i.call(this,e),e.flush&&!k(e.flush))throw new Error("Invalid flush flag: "+e.flush);if(e.finishFlush&&!k(e.finishFlush))throw new Error("Invalid flush flag: "+e.finishFlush);if(this._flushFlag=e.flush||o.Z_NO_FLUSH,this._finishFlushFlag=void 0!==e.finishFlush?e.finishFlush:o.Z_FINISH,e.chunkSize&&(e.chunkSize<t.Z_MIN_CHUNK||e.chunkSize>t.Z_MAX_CHUNK))throw new Error("Invalid chunk size: "+e.chunkSize);if(e.windowBits&&(e.windowBits<t.Z_MIN_WINDOWBITS||e.windowBits>t.Z_MAX_WINDOWBITS))throw new Error("Invalid windowBits: "+e.windowBits);if(e.level&&(e.level<t.Z_MIN_LEVEL||e.level>t.Z_MAX_LEVEL))throw new Error("Invalid compression level: "+e.level);if(e.memLevel&&(e.memLevel<t.Z_MIN_MEMLEVEL||e.memLevel>t.Z_MAX_MEMLEVEL))throw new Error("Invalid memLevel: "+e.memLevel);if(e.strategy&&e.strategy!=t.Z_FILTERED&&e.strategy!=t.Z_HUFFMAN_ONLY&&e.strategy!=t.Z_RLE&&e.strategy!=t.Z_FIXED&&e.strategy!=t.Z_DEFAULT_STRATEGY)throw new Error("Invalid strategy: "+e.strategy);if(e.dictionary&&!n.isBuffer(e.dictionary))throw new Error("Invalid dictionary: it should be a Buffer instance");this._handle=new o.Zlib(r);var s=this;this._hadError=!1,this._handle.onerror=function(e,r){C(s),s._hadError=!0;var n=new Error(e);n.errno=r,n.code=t.codes[r],s.emit("error",n)};var f=t.Z_DEFAULT_COMPRESSION;"number"==typeof e.level&&(f=e.level);var u=t.Z_DEFAULT_STRATEGY;"number"==typeof e.strategy&&(u=e.strategy),this._handle.init(e.windowBits||t.Z_DEFAULT_WINDOWBITS,f,e.memLevel||t.Z_DEFAULT_MEMLEVEL,u,e.dictionary),this._buffer=n.allocUnsafe(this._chunkSize),this._offset=0,this._level=f,this._strategy=u,this.once("end",this.close),Object.defineProperty(this,"_closed",{get:function(){return!a._handle},configurable:!0,enumerable:!0})}function C(t,r){r&&e.nextTick(r),t._handle&&(t._handle.close(),t._handle=null)}function B(e){e.emit("close")}Object.defineProperty(t,"codes",{enumerable:!0,value:Object.freeze(d),writable:!1}),t.Deflate=b,t.Inflate=_,t.Gzip=w,t.Gunzip=E,t.DeflateRaw=S,t.InflateRaw=A,t.Unzip=R,t.createDeflate=function(e){return new b(e)},t.createInflate=function(e){return new _(e)},t.createDeflateRaw=function(e){return new S(e)},t.createInflateRaw=function(e){return new A(e)},t.createGzip=function(e){return new w(e)},t.createGunzip=function(e){return new E(e)},t.createUnzip=function(e){return new R(e)},t.deflate=function(e,t,r){return"function"==typeof t&&(r=t,t={}),v(new b(t),e,r)},t.deflateSync=function(e,t){return m(new b(t),e)},t.gzip=function(e,t,r){return"function"==typeof t&&(r=t,t={}),v(new w(t),e,r)},t.gzipSync=function(e,t){return m(new w(t),e)},t.deflateRaw=function(e,t,r){return"function"==typeof t&&(r=t,t={}),v(new S(t),e,r)},t.deflateRawSync=function(e,t){return m(new S(t),e)},t.unzip=function(e,t,r){return"function"==typeof t&&(r=t,t={}),v(new R(t),e,r)},t.unzipSync=function(e,t){return m(new R(t),e)},t.inflate=function(e,t,r){return"function"==typeof t&&(r=t,t={}),v(new _(t),e,r)},t.inflateSync=function(e,t){return m(new _(t),e)},t.gunzip=function(e,t,r){return"function"==typeof t&&(r=t,t={}),v(new E(t),e,r)},t.gunzipSync=function(e,t){return m(new E(t),e)},t.inflateRaw=function(e,t,r){return"function"==typeof t&&(r=t,t={}),v(new A(t),e,r)},t.inflateRawSync=function(e,t){return m(new A(t),e)},a.inherits(x,i),x.prototype.params=function(r,n,i){if(r<t.Z_MIN_LEVEL||r>t.Z_MAX_LEVEL)throw new RangeError("Invalid compression level: "+r);if(n!=t.Z_FILTERED&&n!=t.Z_HUFFMAN_ONLY&&n!=t.Z_RLE&&n!=t.Z_FIXED&&n!=t.Z_DEFAULT_STRATEGY)throw new TypeError("Invalid strategy: "+n);if(this._level!==r||this._strategy!==n){var a=this;this.flush(o.Z_SYNC_FLUSH,(function(){s(a._handle,"zlib binding closed"),a._handle.params(r,n),a._hadError||(a._level=r,a._strategy=n,i&&i())}))}else e.nextTick(i)},x.prototype.reset=function(){return s(this._handle,"zlib binding closed"),this._handle.reset()},x.prototype._flush=function(e){this._transform(n.alloc(0),"",e)},x.prototype.flush=function(t,r){var i=this,a=this._writableState;("function"==typeof t||void 0===t&&!r)&&(r=t,t=o.Z_FULL_FLUSH),a.ended?r&&e.nextTick(r):a.ending?r&&this.once("end",r):a.needDrain?r&&this.once("drain",(function(){return i.flush(t,r)})):(this._flushFlag=t,this.write(n.alloc(0),"",r))},x.prototype.close=function(t){C(this,t),e.nextTick(B,this)},x.prototype._transform=function(e,t,r){var i,a=this._writableState,s=(a.ending||a.ended)&&(!e||a.length===e.length);return null===e||n.isBuffer(e)?this._handle?(s?i=this._finishFlushFlag:(i=this._flushFlag,e.length>=a.length&&(this._flushFlag=this._opts.flush||o.Z_NO_FLUSH)),void this._processChunk(e,i,r)):r(new Error("zlib binding closed")):r(new Error("invalid input"))},x.prototype._processChunk=function(e,t,r){var i=e&&e.length,o=this._chunkSize-this._offset,a=0,c=this,l="function"==typeof r;if(!l){var h,d=[],p=0;this.on("error",(function(e){h=e})),s(this._handle,"zlib binding closed");do{var g=this._handle.writeSync(t,e,a,i,this._buffer,this._offset,o)}while(!this._hadError&&m(g[0],g[1]));if(this._hadError)throw h;if(p>=f)throw C(this),new RangeError(u);var y=n.concat(d,p);return C(this),y}s(this._handle,"zlib binding closed");var v=this._handle.write(t,e,a,i,this._buffer,this._offset,o);function m(f,u){if(this&&(this.buffer=null,this.callback=null),!c._hadError){var h=o-u;if(s(h>=0,"have should not go down"),h>0){var g=c._buffer.slice(c._offset,c._offset+h);c._offset+=h,l?c.push(g):(d.push(g),p+=g.length)}if((0===u||c._offset>=c._chunkSize)&&(o=c._chunkSize,c._offset=0,c._buffer=n.allocUnsafe(c._chunkSize)),0===u){if(a+=i-f,i=f,!l)return!0;var y=c._handle.write(t,e,a,i,c._buffer,c._offset,c._chunkSize);return y.callback=m,void(y.buffer=e)}if(!l)return!1;r()}}v.buffer=e,v.callback=m},a.inherits(b,x),a.inherits(_,x),a.inherits(w,x),a.inherits(E,x),a.inherits(S,x),a.inherits(A,x),a.inherits(R,x)}).call(this,r(3))},function(e,t,r){"use strict";(function(t,n){var i=r(10);e.exports=b;var o,a=r(25);b.ReadableState=m;r(15).EventEmitter;var s=function(e,t){return e.listeners(t).length},f=r(28),u=r(17).Buffer,c=t.Uint8Array||function(){};var l=Object.create(r(7));l.inherits=r(6);var h=r(49),d=void 0;d=h&&h.debuglog?h.debuglog("stream"):function(){};var p,g=r(50),y=r(29);l.inherits(b,f);var v=["error","close","destroy","pause","resume"];function m(e,t){e=e||{};var n=t instanceof(o=o||r(4));this.objectMode=!!e.objectMode,n&&(this.objectMode=this.objectMode||!!e.readableObjectMode);var i=e.highWaterMark,a=e.readableHighWaterMark,s=this.objectMode?16:16384;this.highWaterMark=i||0===i?i:n&&(a||0===a)?a:s,this.highWaterMark=Math.floor(this.highWaterMark),this.buffer=new g,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.destroyed=!1,this.defaultEncoding=e.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,e.encoding&&(p||(p=r(30).StringDecoder),this.decoder=new p(e.encoding),this.encoding=e.encoding)}function b(e){if(o=o||r(4),!(this instanceof b))return new b(e);this._readableState=new m(e,this),this.readable=!0,e&&("function"==typeof e.read&&(this._read=e.read),"function"==typeof e.destroy&&(this._destroy=e.destroy)),f.call(this)}function _(e,t,r,n,i){var o,a=e._readableState;null===t?(a.reading=!1,function(e,t){if(t.ended)return;if(t.decoder){var r=t.decoder.end();r&&r.length&&(t.buffer.push(r),t.length+=t.objectMode?1:r.length)}t.ended=!0,S(e)}(e,a)):(i||(o=function(e,t){var r;n=t,u.isBuffer(n)||n instanceof c||"string"==typeof t||void 0===t||e.objectMode||(r=new TypeError("Invalid non-string/buffer chunk"));var n;return r}(a,t)),o?e.emit("error",o):a.objectMode||t&&t.length>0?("string"==typeof t||a.objectMode||Object.getPrototypeOf(t)===u.prototype||(t=function(e){return u.from(e)}(t)),n?a.endEmitted?e.emit("error",new Error("stream.unshift() after end event")):w(e,a,t,!0):a.ended?e.emit("error",new Error("stream.push() after EOF")):(a.reading=!1,a.decoder&&!r?(t=a.decoder.write(t),a.objectMode||0!==t.length?w(e,a,t,!1):R(e,a)):w(e,a,t,!1))):n||(a.reading=!1));return function(e){return!e.ended&&(e.needReadable||e.length<e.highWaterMark||0===e.length)}(a)}function w(e,t,r,n){t.flowing&&0===t.length&&!t.sync?(e.emit("data",r),e.read(0)):(t.length+=t.objectMode?1:r.length,n?t.buffer.unshift(r):t.buffer.push(r),t.needReadable&&S(e)),R(e,t)}Object.defineProperty(b.prototype,"destroyed",{get:function(){return void 0!==this._readableState&&this._readableState.destroyed},set:function(e){this._readableState&&(this._readableState.destroyed=e)}}),b.prototype.destroy=y.destroy,b.prototype._undestroy=y.undestroy,b.prototype._destroy=function(e,t){this.push(null),t(e)},b.prototype.push=function(e,t){var r,n=this._readableState;return n.objectMode?r=!0:"string"==typeof e&&((t=t||n.defaultEncoding)!==n.encoding&&(e=u.from(e,t),t=""),r=!0),_(this,e,t,!1,r)},b.prototype.unshift=function(e){return _(this,e,null,!0,!1)},b.prototype.isPaused=function(){return!1===this._readableState.flowing},b.prototype.setEncoding=function(e){return p||(p=r(30).StringDecoder),this._readableState.decoder=new p(e),this._readableState.encoding=e,this};function E(e,t){return e<=0||0===t.length&&t.ended?0:t.objectMode?1:e!=e?t.flowing&&t.length?t.buffer.head.data.length:t.length:(e>t.highWaterMark&&(t.highWaterMark=function(e){return e>=8388608?e=8388608:(e--,e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,e|=e>>>16,e++),e}(e)),e<=t.length?e:t.ended?t.length:(t.needReadable=!0,0))}function S(e){var t=e._readableState;t.needReadable=!1,t.emittedReadable||(d("emitReadable",t.flowing),t.emittedReadable=!0,t.sync?i.nextTick(A,e):A(e))}function A(e){d("emit readable"),e.emit("readable"),B(e)}function R(e,t){t.readingMore||(t.readingMore=!0,i.nextTick(k,e,t))}function k(e,t){for(var r=t.length;!t.reading&&!t.flowing&&!t.ended&&t.length<t.highWaterMark&&(d("maybeReadMore read 0"),e.read(0),r!==t.length);)r=t.length;t.readingMore=!1}function x(e){d("readable nexttick read 0"),e.read(0)}function C(e,t){t.reading||(d("resume read 0"),e.read(0)),t.resumeScheduled=!1,t.awaitDrain=0,e.emit("resume"),B(e),t.flowing&&!t.reading&&e.read(0)}function B(e){var t=e._readableState;for(d("flow",t.flowing);t.flowing&&null!==e.read(););}function T(e,t){return 0===t.length?null:(t.objectMode?r=t.buffer.shift():!e||e>=t.length?(r=t.decoder?t.buffer.join(""):1===t.buffer.length?t.buffer.head.data:t.buffer.concat(t.length),t.buffer.clear()):r=function(e,t,r){var n;e<t.head.data.length?(n=t.head.data.slice(0,e),t.head.data=t.head.data.slice(e)):n=e===t.head.data.length?t.shift():r?function(e,t){var r=t.head,n=1,i=r.data;e-=i.length;for(;r=r.next;){var o=r.data,a=e>o.length?o.length:e;if(a===o.length?i+=o:i+=o.slice(0,e),0===(e-=a)){a===o.length?(++n,r.next?t.head=r.next:t.head=t.tail=null):(t.head=r,r.data=o.slice(a));break}++n}return t.length-=n,i}(e,t):function(e,t){var r=u.allocUnsafe(e),n=t.head,i=1;n.data.copy(r),e-=n.data.length;for(;n=n.next;){var o=n.data,a=e>o.length?o.length:e;if(o.copy(r,r.length-e,0,a),0===(e-=a)){a===o.length?(++i,n.next?t.head=n.next:t.head=t.tail=null):(t.head=n,n.data=o.slice(a));break}++i}return t.length-=i,r}(e,t);return n}(e,t.buffer,t.decoder),r);var r}function M(e){var t=e._readableState;if(t.length>0)throw new Error('"endReadable()" called on non-empty stream');t.endEmitted||(t.ended=!0,i.nextTick(O,t,e))}function O(e,t){e.endEmitted||0!==e.length||(e.endEmitted=!0,t.readable=!1,t.emit("end"))}function I(e,t){for(var r=0,n=e.length;r<n;r++)if(e[r]===t)return r;return-1}b.prototype.read=function(e){d("read",e),e=parseInt(e,10);var t=this._readableState,r=e;if(0!==e&&(t.emittedReadable=!1),0===e&&t.needReadable&&(t.length>=t.highWaterMark||t.ended))return d("read: emitReadable",t.length,t.ended),0===t.length&&t.ended?M(this):S(this),null;if(0===(e=E(e,t))&&t.ended)return 0===t.length&&M(this),null;var n,i=t.needReadable;return d("need readable",i),(0===t.length||t.length-e<t.highWaterMark)&&d("length less than watermark",i=!0),t.ended||t.reading?d("reading or ended",i=!1):i&&(d("do read"),t.reading=!0,t.sync=!0,0===t.length&&(t.needReadable=!0),this._read(t.highWaterMark),t.sync=!1,t.reading||(e=E(r,t))),null===(n=e>0?T(e,t):null)?(t.needReadable=!0,e=0):t.length-=e,0===t.length&&(t.ended||(t.needReadable=!0),r!==e&&t.ended&&M(this)),null!==n&&this.emit("data",n),n},b.prototype._read=function(e){this.emit("error",new Error("_read() is not implemented"))},b.prototype.pipe=function(e,t){var r=this,o=this._readableState;switch(o.pipesCount){case 0:o.pipes=e;break;case 1:o.pipes=[o.pipes,e];break;default:o.pipes.push(e)}o.pipesCount+=1,d("pipe count=%d opts=%j",o.pipesCount,t);var f=(!t||!1!==t.end)&&e!==n.stdout&&e!==n.stderr?c:b;function u(t,n){d("onunpipe"),t===r&&n&&!1===n.hasUnpiped&&(n.hasUnpiped=!0,d("cleanup"),e.removeListener("close",v),e.removeListener("finish",m),e.removeListener("drain",l),e.removeListener("error",y),e.removeListener("unpipe",u),r.removeListener("end",c),r.removeListener("end",b),r.removeListener("data",g),h=!0,!o.awaitDrain||e._writableState&&!e._writableState.needDrain||l())}function c(){d("onend"),e.end()}o.endEmitted?i.nextTick(f):r.once("end",f),e.on("unpipe",u);var l=function(e){return function(){var t=e._readableState;d("pipeOnDrain",t.awaitDrain),t.awaitDrain&&t.awaitDrain--,0===t.awaitDrain&&s(e,"data")&&(t.flowing=!0,B(e))}}(r);e.on("drain",l);var h=!1;var p=!1;function g(t){d("ondata"),p=!1,!1!==e.write(t)||p||((1===o.pipesCount&&o.pipes===e||o.pipesCount>1&&-1!==I(o.pipes,e))&&!h&&(d("false write response, pause",r._readableState.awaitDrain),r._readableState.awaitDrain++,p=!0),r.pause())}function y(t){d("onerror",t),b(),e.removeListener("error",y),0===s(e,"error")&&e.emit("error",t)}function v(){e.removeListener("finish",m),b()}function m(){d("onfinish"),e.removeListener("close",v),b()}function b(){d("unpipe"),r.unpipe(e)}return r.on("data",g),function(e,t,r){if("function"==typeof e.prependListener)return e.prependListener(t,r);e._events&&e._events[t]?a(e._events[t])?e._events[t].unshift(r):e._events[t]=[r,e._events[t]]:e.on(t,r)}(e,"error",y),e.once("close",v),e.once("finish",m),e.emit("pipe",r),o.flowing||(d("pipe resume"),r.resume()),e},b.prototype.unpipe=function(e){var t=this._readableState,r={hasUnpiped:!1};if(0===t.pipesCount)return this;if(1===t.pipesCount)return e&&e!==t.pipes||(e||(e=t.pipes),t.pipes=null,t.pipesCount=0,t.flowing=!1,e&&e.emit("unpipe",this,r)),this;if(!e){var n=t.pipes,i=t.pipesCount;t.pipes=null,t.pipesCount=0,t.flowing=!1;for(var o=0;o<i;o++)n[o].emit("unpipe",this,r);return this}var a=I(t.pipes,e);return-1===a||(t.pipes.splice(a,1),t.pipesCount-=1,1===t.pipesCount&&(t.pipes=t.pipes[0]),e.emit("unpipe",this,r)),this},b.prototype.on=function(e,t){var r=f.prototype.on.call(this,e,t);if("data"===e)!1!==this._readableState.flowing&&this.resume();else if("readable"===e){var n=this._readableState;n.endEmitted||n.readableListening||(n.readableListening=n.needReadable=!0,n.emittedReadable=!1,n.reading?n.length&&S(this):i.nextTick(x,this))}return r},b.prototype.addListener=b.prototype.on,b.prototype.resume=function(){var e=this._readableState;return e.flowing||(d("resume"),e.flowing=!0,function(e,t){t.resumeScheduled||(t.resumeScheduled=!0,i.nextTick(C,e,t))}(this,e)),this},b.prototype.pause=function(){return d("call pause flowing=%j",this._readableState.flowing),!1!==this._readableState.flowing&&(d("pause"),this._readableState.flowing=!1,this.emit("pause")),this},b.prototype.wrap=function(e){var t=this,r=this._readableState,n=!1;for(var i in e.on("end",(function(){if(d("wrapped end"),r.decoder&&!r.ended){var e=r.decoder.end();e&&e.length&&t.push(e)}t.push(null)})),e.on("data",(function(i){(d("wrapped data"),r.decoder&&(i=r.decoder.write(i)),r.objectMode&&null==i)||(r.objectMode||i&&i.length)&&(t.push(i)||(n=!0,e.pause()))})),e)void 0===this[i]&&"function"==typeof e[i]&&(this[i]=function(t){return function(){return e[t].apply(e,arguments)}}(i));for(var o=0;o<v.length;o++)e.on(v[o],this.emit.bind(this,v[o]));return this._read=function(t){d("wrapped _read",t),n&&(n=!1,e.resume())},this},Object.defineProperty(b.prototype,"readableHighWaterMark",{enumerable:!1,get:function(){return this._readableState.highWaterMark}}),b._fromList=T}).call(this,r(2),r(3))},function(e,t,r){e.exports=r(15).EventEmitter},function(e,t,r){"use strict";var n=r(10);function i(e,t){e.emit("error",t)}e.exports={destroy:function(e,t){var r=this,o=this._readableState&&this._readableState.destroyed,a=this._writableState&&this._writableState.destroyed;return o||a?(t?t(e):!e||this._writableState&&this._writableState.errorEmitted||n.nextTick(i,this,e),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(e||null,(function(e){!t&&e?(n.nextTick(i,r,e),r._writableState&&(r._writableState.errorEmitted=!0)):t&&t(e)})),this)},undestroy:function(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)}}},function(e,t,r){"use strict";var n=r(55).Buffer,i=n.isEncoding||function(e){switch((e=""+e)&&e.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function o(e){var t;switch(this.encoding=function(e){var t=function(e){if(!e)return"utf8";for(var t;;)switch(e){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return e;default:if(t)return;e=(""+e).toLowerCase(),t=!0}}(e);if("string"!=typeof t&&(n.isEncoding===i||!i(e)))throw new Error("Unknown encoding: "+e);return t||e}(e),this.encoding){case"utf16le":this.text=f,this.end=u,t=4;break;case"utf8":this.fillLast=s,t=4;break;case"base64":this.text=c,this.end=l,t=3;break;default:return this.write=h,void(this.end=d)}this.lastNeed=0,this.lastTotal=0,this.lastChar=n.allocUnsafe(t)}function a(e){return e<=127?0:e>>5==6?2:e>>4==14?3:e>>3==30?4:e>>6==2?-1:-2}function s(e){var t=this.lastTotal-this.lastNeed,r=function(e,t,r){if(128!=(192&t[0]))return e.lastNeed=0,"�";if(e.lastNeed>1&&t.length>1){if(128!=(192&t[1]))return e.lastNeed=1,"�";if(e.lastNeed>2&&t.length>2&&128!=(192&t[2]))return e.lastNeed=2,"�"}}(this,e);return void 0!==r?r:this.lastNeed<=e.length?(e.copy(this.lastChar,t,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal)):(e.copy(this.lastChar,t,0,e.length),void(this.lastNeed-=e.length))}function f(e,t){if((e.length-t)%2==0){var r=e.toString("utf16le",t);if(r){var n=r.charCodeAt(r.length-1);if(n>=55296&&n<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1],r.slice(0,-1)}return r}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=e[e.length-1],e.toString("utf16le",t,e.length-1)}function u(e){var t=e&&e.length?this.write(e):"";if(this.lastNeed){var r=this.lastTotal-this.lastNeed;return t+this.lastChar.toString("utf16le",0,r)}return t}function c(e,t){var r=(e.length-t)%3;return 0===r?e.toString("base64",t):(this.lastNeed=3-r,this.lastTotal=3,1===r?this.lastChar[0]=e[e.length-1]:(this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1]),e.toString("base64",t,e.length-r))}function l(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+this.lastChar.toString("base64",0,3-this.lastNeed):t}function h(e){return e.toString(this.encoding)}function d(e){return e&&e.length?this.write(e):""}t.StringDecoder=o,o.prototype.write=function(e){if(0===e.length)return"";var t,r;if(this.lastNeed){if(void 0===(t=this.fillLast(e)))return"";r=this.lastNeed,this.lastNeed=0}else r=0;return r<e.length?t?t+this.text(e,r):this.text(e,r):t||""},o.prototype.end=function(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+"�":t},o.prototype.text=function(e,t){var r=function(e,t,r){var n=t.length-1;if(n<r)return 0;var i=a(t[n]);if(i>=0)return i>0&&(e.lastNeed=i-1),i;if(--n<r||-2===i)return 0;if((i=a(t[n]))>=0)return i>0&&(e.lastNeed=i-2),i;if(--n<r||-2===i)return 0;if((i=a(t[n]))>=0)return i>0&&(2===i?i=0:e.lastNeed=i-3),i;return 0}(this,e,t);if(!this.lastNeed)return e.toString("utf8",t);this.lastTotal=r;var n=e.length-(r-this.lastNeed);return e.copy(this.lastChar,0,n),e.toString("utf8",t,n)},o.prototype.fillLast=function(e){if(this.lastNeed<=e.length)return e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,e.length),this.lastNeed-=e.length}},function(e,t,r){"use strict";e.exports=a;var n=r(4),i=Object.create(r(7));function o(e,t){var r=this._transformState;r.transforming=!1;var n=r.writecb;if(!n)return this.emit("error",new Error("write callback called multiple times"));r.writechunk=null,r.writecb=null,null!=t&&this.push(t),n(e);var i=this._readableState;i.reading=!1,(i.needReadable||i.length<i.highWaterMark)&&this._read(i.highWaterMark)}function a(e){if(!(this instanceof a))return new a(e);n.call(this,e),this._transformState={afterTransform:o.bind(this),needTransform:!1,transforming:!1,writecb:null,writechunk:null,writeencoding:null},this._readableState.needReadable=!0,this._readableState.sync=!1,e&&("function"==typeof e.transform&&(this._transform=e.transform),"function"==typeof e.flush&&(this._flush=e.flush)),this.on("prefinish",s)}function s(){var e=this;"function"==typeof this._flush?this._flush((function(t,r){f(e,t,r)})):f(this,null,null)}function f(e,t,r){if(t)return e.emit("error",t);if(null!=r&&e.push(r),e._writableState.length)throw new Error("Calling transform done when ws.length != 0");if(e._transformState.transforming)throw new Error("Calling transform done when still transforming");return e.push(null)}i.inherits=r(6),i.inherits(a,n),a.prototype.push=function(e,t){return this._transformState.needTransform=!1,n.prototype.push.call(this,e,t)},a.prototype._transform=function(e,t,r){throw new Error("_transform() is not implemented")},a.prototype._write=function(e,t,r){var n=this._transformState;if(n.writecb=r,n.writechunk=e,n.writeencoding=t,!n.transforming){var i=this._readableState;(n.needTransform||i.needReadable||i.length<i.highWaterMark)&&this._read(i.highWaterMark)}},a.prototype._read=function(e){var t=this._transformState;null!==t.writechunk&&t.writecb&&!t.transforming?(t.transforming=!0,this._transform(t.writechunk,t.writeencoding,t.afterTransform)):t.needTransform=!0},a.prototype._destroy=function(e,t){var r=this;n.prototype._destroy.call(this,e,(function(e){t(e),r.emit("close")}))}},function(e,t,r){"use strict";(function(t){var n=r(62);
|
|
9
|
-
/*!
|
|
10
|
-
* The buffer module from node.js, for the browser.
|
|
11
|
-
*
|
|
12
|
-
* @author Feross Aboukhadijeh <feross@feross.org> <http://feross.org>
|
|
13
|
-
* @license MIT
|
|
14
|
-
*/function i(e,t){if(e===t)return 0;for(var r=e.length,n=t.length,i=0,o=Math.min(r,n);i<o;++i)if(e[i]!==t[i]){r=e[i],n=t[i];break}return r<n?-1:n<r?1:0}function o(e){return t.Buffer&&"function"==typeof t.Buffer.isBuffer?t.Buffer.isBuffer(e):!(null==e||!e._isBuffer)}var a=r(33),s=Object.prototype.hasOwnProperty,f=Array.prototype.slice,u="foo"===function(){}.name;function c(e){return Object.prototype.toString.call(e)}function l(e){return!o(e)&&("function"==typeof t.ArrayBuffer&&("function"==typeof ArrayBuffer.isView?ArrayBuffer.isView(e):!!e&&(e instanceof DataView||!!(e.buffer&&e.buffer instanceof ArrayBuffer))))}var h=e.exports=m,d=/\s*function\s+([^\(\s]*)\s*/;function p(e){if(a.isFunction(e)){if(u)return e.name;var t=e.toString().match(d);return t&&t[1]}}function g(e,t){return"string"==typeof e?e.length<t?e:e.slice(0,t):e}function y(e){if(u||!a.isFunction(e))return a.inspect(e);var t=p(e);return"[Function"+(t?": "+t:"")+"]"}function v(e,t,r,n,i){throw new h.AssertionError({message:r,actual:e,expected:t,operator:n,stackStartFunction:i})}function m(e,t){e||v(e,!0,t,"==",h.ok)}function b(e,t,r,n){if(e===t)return!0;if(o(e)&&o(t))return 0===i(e,t);if(a.isDate(e)&&a.isDate(t))return e.getTime()===t.getTime();if(a.isRegExp(e)&&a.isRegExp(t))return e.source===t.source&&e.global===t.global&&e.multiline===t.multiline&&e.lastIndex===t.lastIndex&&e.ignoreCase===t.ignoreCase;if(null!==e&&"object"==typeof e||null!==t&&"object"==typeof t){if(l(e)&&l(t)&&c(e)===c(t)&&!(e instanceof Float32Array||e instanceof Float64Array))return 0===i(new Uint8Array(e.buffer),new Uint8Array(t.buffer));if(o(e)!==o(t))return!1;var s=(n=n||{actual:[],expected:[]}).actual.indexOf(e);return-1!==s&&s===n.expected.indexOf(t)||(n.actual.push(e),n.expected.push(t),function(e,t,r,n){if(null==e||null==t)return!1;if(a.isPrimitive(e)||a.isPrimitive(t))return e===t;if(r&&Object.getPrototypeOf(e)!==Object.getPrototypeOf(t))return!1;var i=_(e),o=_(t);if(i&&!o||!i&&o)return!1;if(i)return e=f.call(e),t=f.call(t),b(e,t,r);var s,u,c=S(e),l=S(t);if(c.length!==l.length)return!1;for(c.sort(),l.sort(),u=c.length-1;u>=0;u--)if(c[u]!==l[u])return!1;for(u=c.length-1;u>=0;u--)if(s=c[u],!b(e[s],t[s],r,n))return!1;return!0}(e,t,r,n))}return r?e===t:e==t}function _(e){return"[object Arguments]"==Object.prototype.toString.call(e)}function w(e,t){if(!e||!t)return!1;if("[object RegExp]"==Object.prototype.toString.call(t))return t.test(e);try{if(e instanceof t)return!0}catch(e){}return!Error.isPrototypeOf(t)&&!0===t.call({},e)}function E(e,t,r,n){var i;if("function"!=typeof t)throw new TypeError('"block" argument must be a function');"string"==typeof r&&(n=r,r=null),i=function(e){var t;try{e()}catch(e){t=e}return t}(t),n=(r&&r.name?" ("+r.name+").":".")+(n?" "+n:"."),e&&!i&&v(i,r,"Missing expected exception"+n);var o="string"==typeof n,s=!e&&i&&!r;if((!e&&a.isError(i)&&o&&w(i,r)||s)&&v(i,r,"Got unwanted exception"+n),e&&i&&r&&!w(i,r)||!e&&i)throw i}h.AssertionError=function(e){this.name="AssertionError",this.actual=e.actual,this.expected=e.expected,this.operator=e.operator,e.message?(this.message=e.message,this.generatedMessage=!1):(this.message=function(e){return g(y(e.actual),128)+" "+e.operator+" "+g(y(e.expected),128)}(this),this.generatedMessage=!0);var t=e.stackStartFunction||v;if(Error.captureStackTrace)Error.captureStackTrace(this,t);else{var r=new Error;if(r.stack){var n=r.stack,i=p(t),o=n.indexOf("\n"+i);if(o>=0){var a=n.indexOf("\n",o+1);n=n.substring(a+1)}this.stack=n}}},a.inherits(h.AssertionError,Error),h.fail=v,h.ok=m,h.equal=function(e,t,r){e!=t&&v(e,t,r,"==",h.equal)},h.notEqual=function(e,t,r){e==t&&v(e,t,r,"!=",h.notEqual)},h.deepEqual=function(e,t,r){b(e,t,!1)||v(e,t,r,"deepEqual",h.deepEqual)},h.deepStrictEqual=function(e,t,r){b(e,t,!0)||v(e,t,r,"deepStrictEqual",h.deepStrictEqual)},h.notDeepEqual=function(e,t,r){b(e,t,!1)&&v(e,t,r,"notDeepEqual",h.notDeepEqual)},h.notDeepStrictEqual=function e(t,r,n){b(t,r,!0)&&v(t,r,n,"notDeepStrictEqual",e)},h.strictEqual=function(e,t,r){e!==t&&v(e,t,r,"===",h.strictEqual)},h.notStrictEqual=function(e,t,r){e===t&&v(e,t,r,"!==",h.notStrictEqual)},h.throws=function(e,t,r){E(!0,e,t,r)},h.doesNotThrow=function(e,t,r){E(!1,e,t,r)},h.ifError=function(e){if(e)throw e},h.strict=n((function e(t,r){t||v(t,!0,r,"==",e)}),h,{equal:h.strictEqual,deepEqual:h.deepStrictEqual,notEqual:h.notStrictEqual,notDeepEqual:h.notDeepStrictEqual}),h.strict.strict=h.strict;var S=Object.keys||function(e){var t=[];for(var r in e)s.call(e,r)&&t.push(r);return t}}).call(this,r(2))},function(e,t,r){(function(e){var n=Object.getOwnPropertyDescriptors||function(e){for(var t=Object.keys(e),r={},n=0;n<t.length;n++)r[t[n]]=Object.getOwnPropertyDescriptor(e,t[n]);return r},i=/%[sdj%]/g;t.format=function(e){if(!v(e)){for(var t=[],r=0;r<arguments.length;r++)t.push(s(arguments[r]));return t.join(" ")}r=1;for(var n=arguments,o=n.length,a=String(e).replace(i,(function(e){if("%%"===e)return"%";if(r>=o)return e;switch(e){case"%s":return String(n[r++]);case"%d":return Number(n[r++]);case"%j":try{return JSON.stringify(n[r++])}catch(e){return"[Circular]"}default:return e}})),f=n[r];r<o;f=n[++r])g(f)||!_(f)?a+=" "+f:a+=" "+s(f);return a},t.deprecate=function(r,n){if(void 0!==e&&!0===e.noDeprecation)return r;if(void 0===e)return function(){return t.deprecate(r,n).apply(this,arguments)};var i=!1;return function(){if(!i){if(e.throwDeprecation)throw new Error(n);e.traceDeprecation?console.trace(n):console.error(n),i=!0}return r.apply(this,arguments)}};var o,a={};function s(e,r){var n={seen:[],stylize:u};return arguments.length>=3&&(n.depth=arguments[2]),arguments.length>=4&&(n.colors=arguments[3]),p(r)?n.showHidden=r:r&&t._extend(n,r),m(n.showHidden)&&(n.showHidden=!1),m(n.depth)&&(n.depth=2),m(n.colors)&&(n.colors=!1),m(n.customInspect)&&(n.customInspect=!0),n.colors&&(n.stylize=f),c(n,e,n.depth)}function f(e,t){var r=s.styles[t];return r?"["+s.colors[r][0]+"m"+e+"["+s.colors[r][1]+"m":e}function u(e,t){return e}function c(e,r,n){if(e.customInspect&&r&&S(r.inspect)&&r.inspect!==t.inspect&&(!r.constructor||r.constructor.prototype!==r)){var i=r.inspect(n,e);return v(i)||(i=c(e,i,n)),i}var o=function(e,t){if(m(t))return e.stylize("undefined","undefined");if(v(t)){var r="'"+JSON.stringify(t).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return e.stylize(r,"string")}if(y(t))return e.stylize(""+t,"number");if(p(t))return e.stylize(""+t,"boolean");if(g(t))return e.stylize("null","null")}(e,r);if(o)return o;var a=Object.keys(r),s=function(e){var t={};return e.forEach((function(e,r){t[e]=!0})),t}(a);if(e.showHidden&&(a=Object.getOwnPropertyNames(r)),E(r)&&(a.indexOf("message")>=0||a.indexOf("description")>=0))return l(r);if(0===a.length){if(S(r)){var f=r.name?": "+r.name:"";return e.stylize("[Function"+f+"]","special")}if(b(r))return e.stylize(RegExp.prototype.toString.call(r),"regexp");if(w(r))return e.stylize(Date.prototype.toString.call(r),"date");if(E(r))return l(r)}var u,_="",A=!1,R=["{","}"];(d(r)&&(A=!0,R=["[","]"]),S(r))&&(_=" [Function"+(r.name?": "+r.name:"")+"]");return b(r)&&(_=" "+RegExp.prototype.toString.call(r)),w(r)&&(_=" "+Date.prototype.toUTCString.call(r)),E(r)&&(_=" "+l(r)),0!==a.length||A&&0!=r.length?n<0?b(r)?e.stylize(RegExp.prototype.toString.call(r),"regexp"):e.stylize("[Object]","special"):(e.seen.push(r),u=A?function(e,t,r,n,i){for(var o=[],a=0,s=t.length;a<s;++a)C(t,String(a))?o.push(h(e,t,r,n,String(a),!0)):o.push("");return i.forEach((function(i){i.match(/^\d+$/)||o.push(h(e,t,r,n,i,!0))})),o}(e,r,n,s,a):a.map((function(t){return h(e,r,n,s,t,A)})),e.seen.pop(),function(e,t,r){if(e.reduce((function(e,t){return t.indexOf("\n")>=0&&0,e+t.replace(/\u001b\[\d\d?m/g,"").length+1}),0)>60)return r[0]+(""===t?"":t+"\n ")+" "+e.join(",\n ")+" "+r[1];return r[0]+t+" "+e.join(", ")+" "+r[1]}(u,_,R)):R[0]+_+R[1]}function l(e){return"["+Error.prototype.toString.call(e)+"]"}function h(e,t,r,n,i,o){var a,s,f;if((f=Object.getOwnPropertyDescriptor(t,i)||{value:t[i]}).get?s=f.set?e.stylize("[Getter/Setter]","special"):e.stylize("[Getter]","special"):f.set&&(s=e.stylize("[Setter]","special")),C(n,i)||(a="["+i+"]"),s||(e.seen.indexOf(f.value)<0?(s=g(r)?c(e,f.value,null):c(e,f.value,r-1)).indexOf("\n")>-1&&(s=o?s.split("\n").map((function(e){return" "+e})).join("\n").substr(2):"\n"+s.split("\n").map((function(e){return" "+e})).join("\n")):s=e.stylize("[Circular]","special")),m(a)){if(o&&i.match(/^\d+$/))return s;(a=JSON.stringify(""+i)).match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(a=a.substr(1,a.length-2),a=e.stylize(a,"name")):(a=a.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),a=e.stylize(a,"string"))}return a+": "+s}function d(e){return Array.isArray(e)}function p(e){return"boolean"==typeof e}function g(e){return null===e}function y(e){return"number"==typeof e}function v(e){return"string"==typeof e}function m(e){return void 0===e}function b(e){return _(e)&&"[object RegExp]"===A(e)}function _(e){return"object"==typeof e&&null!==e}function w(e){return _(e)&&"[object Date]"===A(e)}function E(e){return _(e)&&("[object Error]"===A(e)||e instanceof Error)}function S(e){return"function"==typeof e}function A(e){return Object.prototype.toString.call(e)}function R(e){return e<10?"0"+e.toString(10):e.toString(10)}t.debuglog=function(r){if(m(o)&&(o=e.env.NODE_DEBUG||""),r=r.toUpperCase(),!a[r])if(new RegExp("\\b"+r+"\\b","i").test(o)){var n=e.pid;a[r]=function(){var e=t.format.apply(t,arguments);console.error("%s %d: %s",r,n,e)}}else a[r]=function(){};return a[r]},t.inspect=s,s.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},s.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"},t.isArray=d,t.isBoolean=p,t.isNull=g,t.isNullOrUndefined=function(e){return null==e},t.isNumber=y,t.isString=v,t.isSymbol=function(e){return"symbol"==typeof e},t.isUndefined=m,t.isRegExp=b,t.isObject=_,t.isDate=w,t.isError=E,t.isFunction=S,t.isPrimitive=function(e){return null===e||"boolean"==typeof e||"number"==typeof e||"string"==typeof e||"symbol"==typeof e||void 0===e},t.isBuffer=r(63);var k=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function x(){var e=new Date,t=[R(e.getHours()),R(e.getMinutes()),R(e.getSeconds())].join(":");return[e.getDate(),k[e.getMonth()],t].join(" ")}function C(e,t){return Object.prototype.hasOwnProperty.call(e,t)}t.log=function(){console.log("%s - %s",x(),t.format.apply(t,arguments))},t.inherits=r(64),t._extend=function(e,t){if(!t||!_(t))return e;for(var r=Object.keys(t),n=r.length;n--;)e[r[n]]=t[r[n]];return e};var B="undefined"!=typeof Symbol?Symbol("util.promisify.custom"):void 0;function T(e,t){if(!e){var r=new Error("Promise was rejected with a falsy value");r.reason=e,e=r}return t(e)}t.promisify=function(e){if("function"!=typeof e)throw new TypeError('The "original" argument must be of type Function');if(B&&e[B]){var t;if("function"!=typeof(t=e[B]))throw new TypeError('The "util.promisify.custom" argument must be of type Function');return Object.defineProperty(t,B,{value:t,enumerable:!1,writable:!1,configurable:!0}),t}function t(){for(var t,r,n=new Promise((function(e,n){t=e,r=n})),i=[],o=0;o<arguments.length;o++)i.push(arguments[o]);i.push((function(e,n){e?r(e):t(n)}));try{e.apply(this,i)}catch(e){r(e)}return n}return Object.setPrototypeOf(t,Object.getPrototypeOf(e)),B&&Object.defineProperty(t,B,{value:t,enumerable:!1,writable:!1,configurable:!0}),Object.defineProperties(t,n(e))},t.promisify.custom=B,t.callbackify=function(t){if("function"!=typeof t)throw new TypeError('The "original" argument must be of type Function');function r(){for(var r=[],n=0;n<arguments.length;n++)r.push(arguments[n]);var i=r.pop();if("function"!=typeof i)throw new TypeError("The last argument must be of type Function");var o=this,a=function(){return i.apply(o,arguments)};t.apply(this,r).then((function(t){e.nextTick(a,null,t)}),(function(t){e.nextTick(T,t,a)}))}return Object.setPrototypeOf(r,Object.getPrototypeOf(t)),Object.defineProperties(r,n(t)),r}}).call(this,r(3))},function(e,t,r){"use strict";e.exports=function(e,t,r,n){for(var i=65535&e|0,o=e>>>16&65535|0,a=0;0!==r;){r-=a=r>2e3?2e3:r;do{o=o+(i=i+t[n++]|0)|0}while(--a);i%=65521,o%=65521}return i|o<<16|0}},function(e,t,r){"use strict";var n=function(){for(var e,t=[],r=0;r<256;r++){e=r;for(var n=0;n<8;n++)e=1&e?3988292384^e>>>1:e>>>1;t[r]=e}return t}();e.exports=function(e,t,r,i){var o=n,a=i+r;e^=-1;for(var s=i;s<a;s++)e=e>>>8^o[255&(e^t[s])];return-1^e}},function(e,t){e.exports=n;var r=null;try{r=new WebAssembly.Instance(new WebAssembly.Module(new Uint8Array([0,97,115,109,1,0,0,0,1,13,2,96,0,1,127,96,4,127,127,127,127,1,127,3,7,6,0,1,1,1,1,1,6,6,1,127,1,65,0,11,7,50,6,3,109,117,108,0,1,5,100,105,118,95,115,0,2,5,100,105,118,95,117,0,3,5,114,101,109,95,115,0,4,5,114,101,109,95,117,0,5,8,103,101,116,95,104,105,103,104,0,0,10,191,1,6,4,0,35,0,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,126,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,127,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,128,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,129,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,130,34,4,66,32,135,167,36,0,32,4,167,11])),{}).exports}catch(e){}function n(e,t,r){this.low=0|e,this.high=0|t,this.unsigned=!!r}function i(e){return!0===(e&&e.__isLong__)}n.prototype.__isLong__,Object.defineProperty(n.prototype,"__isLong__",{value:!0}),n.isLong=i;var o={},a={};function s(e,t){var r,n,i;return t?(i=0<=(e>>>=0)&&e<256)&&(n=a[e])?n:(r=u(e,(0|e)<0?-1:0,!0),i&&(a[e]=r),r):(i=-128<=(e|=0)&&e<128)&&(n=o[e])?n:(r=u(e,e<0?-1:0,!1),i&&(o[e]=r),r)}function f(e,t){if(isNaN(e))return t?m:v;if(t){if(e<0)return m;if(e>=p)return S}else{if(e<=-g)return A;if(e+1>=g)return E}return e<0?f(-e,t).neg():u(e%d|0,e/d|0,t)}function u(e,t,r){return new n(e,t,r)}n.fromInt=s,n.fromNumber=f,n.fromBits=u;var c=Math.pow;function l(e,t,r){if(0===e.length)throw Error("empty string");if("NaN"===e||"Infinity"===e||"+Infinity"===e||"-Infinity"===e)return v;if("number"==typeof t?(r=t,t=!1):t=!!t,(r=r||10)<2||36<r)throw RangeError("radix");var n;if((n=e.indexOf("-"))>0)throw Error("interior hyphen");if(0===n)return l(e.substring(1),t,r).neg();for(var i=f(c(r,8)),o=v,a=0;a<e.length;a+=8){var s=Math.min(8,e.length-a),u=parseInt(e.substring(a,a+s),r);if(s<8){var h=f(c(r,s));o=o.mul(h).add(f(u))}else o=(o=o.mul(i)).add(f(u))}return o.unsigned=t,o}function h(e,t){return"number"==typeof e?f(e,t):"string"==typeof e?l(e,t):u(e.low,e.high,"boolean"==typeof t?t:e.unsigned)}n.fromString=l,n.fromValue=h;var d=4294967296,p=d*d,g=p/2,y=s(1<<24),v=s(0);n.ZERO=v;var m=s(0,!0);n.UZERO=m;var b=s(1);n.ONE=b;var _=s(1,!0);n.UONE=_;var w=s(-1);n.NEG_ONE=w;var E=u(-1,2147483647,!1);n.MAX_VALUE=E;var S=u(-1,-1,!0);n.MAX_UNSIGNED_VALUE=S;var A=u(0,-2147483648,!1);n.MIN_VALUE=A;var R=n.prototype;R.toInt=function(){return this.unsigned?this.low>>>0:this.low},R.toNumber=function(){return this.unsigned?(this.high>>>0)*d+(this.low>>>0):this.high*d+(this.low>>>0)},R.toString=function(e){if((e=e||10)<2||36<e)throw RangeError("radix");if(this.isZero())return"0";if(this.isNegative()){if(this.eq(A)){var t=f(e),r=this.div(t),n=r.mul(t).sub(this);return r.toString(e)+n.toInt().toString(e)}return"-"+this.neg().toString(e)}for(var i=f(c(e,6),this.unsigned),o=this,a="";;){var s=o.div(i),u=(o.sub(s.mul(i)).toInt()>>>0).toString(e);if((o=s).isZero())return u+a;for(;u.length<6;)u="0"+u;a=""+u+a}},R.getHighBits=function(){return this.high},R.getHighBitsUnsigned=function(){return this.high>>>0},R.getLowBits=function(){return this.low},R.getLowBitsUnsigned=function(){return this.low>>>0},R.getNumBitsAbs=function(){if(this.isNegative())return this.eq(A)?64:this.neg().getNumBitsAbs();for(var e=0!=this.high?this.high:this.low,t=31;t>0&&0==(e&1<<t);t--);return 0!=this.high?t+33:t+1},R.isZero=function(){return 0===this.high&&0===this.low},R.eqz=R.isZero,R.isNegative=function(){return!this.unsigned&&this.high<0},R.isPositive=function(){return this.unsigned||this.high>=0},R.isOdd=function(){return 1==(1&this.low)},R.isEven=function(){return 0==(1&this.low)},R.equals=function(e){return i(e)||(e=h(e)),(this.unsigned===e.unsigned||this.high>>>31!=1||e.high>>>31!=1)&&(this.high===e.high&&this.low===e.low)},R.eq=R.equals,R.notEquals=function(e){return!this.eq(e)},R.neq=R.notEquals,R.ne=R.notEquals,R.lessThan=function(e){return this.comp(e)<0},R.lt=R.lessThan,R.lessThanOrEqual=function(e){return this.comp(e)<=0},R.lte=R.lessThanOrEqual,R.le=R.lessThanOrEqual,R.greaterThan=function(e){return this.comp(e)>0},R.gt=R.greaterThan,R.greaterThanOrEqual=function(e){return this.comp(e)>=0},R.gte=R.greaterThanOrEqual,R.ge=R.greaterThanOrEqual,R.compare=function(e){if(i(e)||(e=h(e)),this.eq(e))return 0;var t=this.isNegative(),r=e.isNegative();return t&&!r?-1:!t&&r?1:this.unsigned?e.high>>>0>this.high>>>0||e.high===this.high&&e.low>>>0>this.low>>>0?-1:1:this.sub(e).isNegative()?-1:1},R.comp=R.compare,R.negate=function(){return!this.unsigned&&this.eq(A)?A:this.not().add(b)},R.neg=R.negate,R.add=function(e){i(e)||(e=h(e));var t=this.high>>>16,r=65535&this.high,n=this.low>>>16,o=65535&this.low,a=e.high>>>16,s=65535&e.high,f=e.low>>>16,c=0,l=0,d=0,p=0;return d+=(p+=o+(65535&e.low))>>>16,l+=(d+=n+f)>>>16,c+=(l+=r+s)>>>16,c+=t+a,u((d&=65535)<<16|(p&=65535),(c&=65535)<<16|(l&=65535),this.unsigned)},R.subtract=function(e){return i(e)||(e=h(e)),this.add(e.neg())},R.sub=R.subtract,R.multiply=function(e){if(this.isZero())return v;if(i(e)||(e=h(e)),r)return u(r.mul(this.low,this.high,e.low,e.high),r.get_high(),this.unsigned);if(e.isZero())return v;if(this.eq(A))return e.isOdd()?A:v;if(e.eq(A))return this.isOdd()?A:v;if(this.isNegative())return e.isNegative()?this.neg().mul(e.neg()):this.neg().mul(e).neg();if(e.isNegative())return this.mul(e.neg()).neg();if(this.lt(y)&&e.lt(y))return f(this.toNumber()*e.toNumber(),this.unsigned);var t=this.high>>>16,n=65535&this.high,o=this.low>>>16,a=65535&this.low,s=e.high>>>16,c=65535&e.high,l=e.low>>>16,d=65535&e.low,p=0,g=0,m=0,b=0;return m+=(b+=a*d)>>>16,g+=(m+=o*d)>>>16,m&=65535,g+=(m+=a*l)>>>16,p+=(g+=n*d)>>>16,g&=65535,p+=(g+=o*l)>>>16,g&=65535,p+=(g+=a*c)>>>16,p+=t*d+n*l+o*c+a*s,u((m&=65535)<<16|(b&=65535),(p&=65535)<<16|(g&=65535),this.unsigned)},R.mul=R.multiply,R.divide=function(e){if(i(e)||(e=h(e)),e.isZero())throw Error("division by zero");var t,n,o;if(r)return this.unsigned||-2147483648!==this.high||-1!==e.low||-1!==e.high?u((this.unsigned?r.div_u:r.div_s)(this.low,this.high,e.low,e.high),r.get_high(),this.unsigned):this;if(this.isZero())return this.unsigned?m:v;if(this.unsigned){if(e.unsigned||(e=e.toUnsigned()),e.gt(this))return m;if(e.gt(this.shru(1)))return _;o=m}else{if(this.eq(A))return e.eq(b)||e.eq(w)?A:e.eq(A)?b:(t=this.shr(1).div(e).shl(1)).eq(v)?e.isNegative()?b:w:(n=this.sub(e.mul(t)),o=t.add(n.div(e)));if(e.eq(A))return this.unsigned?m:v;if(this.isNegative())return e.isNegative()?this.neg().div(e.neg()):this.neg().div(e).neg();if(e.isNegative())return this.div(e.neg()).neg();o=v}for(n=this;n.gte(e);){t=Math.max(1,Math.floor(n.toNumber()/e.toNumber()));for(var a=Math.ceil(Math.log(t)/Math.LN2),s=a<=48?1:c(2,a-48),l=f(t),d=l.mul(e);d.isNegative()||d.gt(n);)d=(l=f(t-=s,this.unsigned)).mul(e);l.isZero()&&(l=b),o=o.add(l),n=n.sub(d)}return o},R.div=R.divide,R.modulo=function(e){return i(e)||(e=h(e)),r?u((this.unsigned?r.rem_u:r.rem_s)(this.low,this.high,e.low,e.high),r.get_high(),this.unsigned):this.sub(this.div(e).mul(e))},R.mod=R.modulo,R.rem=R.modulo,R.not=function(){return u(~this.low,~this.high,this.unsigned)},R.and=function(e){return i(e)||(e=h(e)),u(this.low&e.low,this.high&e.high,this.unsigned)},R.or=function(e){return i(e)||(e=h(e)),u(this.low|e.low,this.high|e.high,this.unsigned)},R.xor=function(e){return i(e)||(e=h(e)),u(this.low^e.low,this.high^e.high,this.unsigned)},R.shiftLeft=function(e){return i(e)&&(e=e.toInt()),0==(e&=63)?this:e<32?u(this.low<<e,this.high<<e|this.low>>>32-e,this.unsigned):u(0,this.low<<e-32,this.unsigned)},R.shl=R.shiftLeft,R.shiftRight=function(e){return i(e)&&(e=e.toInt()),0==(e&=63)?this:e<32?u(this.low>>>e|this.high<<32-e,this.high>>e,this.unsigned):u(this.high>>e-32,this.high>=0?0:-1,this.unsigned)},R.shr=R.shiftRight,R.shiftRightUnsigned=function(e){if(i(e)&&(e=e.toInt()),0===(e&=63))return this;var t=this.high;return e<32?u(this.low>>>e|t<<32-e,t>>>e,this.unsigned):u(32===e?t:t>>>e-32,0,this.unsigned)},R.shru=R.shiftRightUnsigned,R.shr_u=R.shiftRightUnsigned,R.toSigned=function(){return this.unsigned?u(this.low,this.high,!1):this},R.toUnsigned=function(){return this.unsigned?this:u(this.low,this.high,!0)},R.toBytes=function(e){return e?this.toBytesLE():this.toBytesBE()},R.toBytesLE=function(){var e=this.high,t=this.low;return[255&t,t>>>8&255,t>>>16&255,t>>>24,255&e,e>>>8&255,e>>>16&255,e>>>24]},R.toBytesBE=function(){var e=this.high,t=this.low;return[e>>>24,e>>>16&255,e>>>8&255,255&e,t>>>24,t>>>16&255,t>>>8&255,255&t]},n.fromBytes=function(e,t,r){return r?n.fromBytesLE(e,t):n.fromBytesBE(e,t)},n.fromBytesLE=function(e,t){return new n(e[0]|e[1]<<8|e[2]<<16|e[3]<<24,e[4]|e[5]<<8|e[6]<<16|e[7]<<24,t)},n.fromBytesBE=function(e,t){return new n(e[4]<<24|e[5]<<16|e[6]<<8|e[7],e[0]<<24|e[1]<<16|e[2]<<8|e[3],t)}},function(e,t,r){(function(t){const n=r(8);function i(e,t){return e&(1<<t)-1}function o(e,t){for(var r=0;t>=e[r+1];)r++;return r}function a(e,t){for(var r=1<<t,n=new Array(r),i=0,o=0;o<r;o++){for(;o>=e[i+1];)i++;n[o]=i}return n}function s(e,t,r,n){return r*(e>>n)+(e&(1<<n)-1)-t}function f(e,t){return t<32768&&(t=(t<<16)+e.ReadUint16()),t}function u(e,t){t.WriteByteNeg(e>>24&255),t.WriteByteNeg(e>>16&255),t.WriteByteNeg(e>>8&255),t.WriteByteNeg(e>>0&255)}function c(e,t,r,n,i){return e=function(e,t,r,n){for(var i=(1<<31-n)*r;e>=i;)t.WriteByteNeg(e>>8&255),t.WriteByteNeg(255&e),e>>=16;return e}(e,t,n,i),e=(Math.floor(e/n)<<i)+e%n+r}function l(e,t,r){0==r&&(r=4);for(var i=new Array(r),o=new Array(r),a=0;a<r;a++)o[a]=Math.floor(t.length/r)+(t.length%r>a),i[a]=new Array(o[a]);for(var s=0,f=0;f<t.length;f+=r,s++)for(var u=0;u<r;u++)s<i[u].length&&(i[u][s]=t[f+u]);var c=new Array(r),l=0;for(a=0;a<r;a++){var h=d(i[a],0),p=d(i[a],1);c[a]=p.length<h.length?p:h,l+=c[a].length}var g=new n("",0,l+5*r+1);g.WriteByte(r);for(a=0;a<r;a++)g.WriteUint7(c[a].length);for(a=0;a<r;a++)g.WriteData(c[a],c[a].length);return g.buf.slice(0,g.buf.pos)}function h(e,r){var u=e.ReadByte(),c=1&u,l=8&u,d=32&u,y=64&u,m=128&u;if(16&u||(r=e.ReadUint7()),l)return function(e,r){for(var n=e.ReadByte(),i=new Array(n),o=new Array(n),a=0;a<n;a++)i[a]=e.ReadUint7();var s=new Array(n);for(a=0;a<n;a++)o[a]=Math.floor(r/n)+(r%n>a),s[a]=h(e,o[a]);var f=new t.allocUnsafe(r);for(a=0;a<n;a++)for(var u=0;u<o[a];u++)f[u*n+a]=s[a][u];return f}(e,r);if(m)var b=r,[_,w,r]=function(e){for(var t=e.ReadByte(),r=new Array(t),n=0;n<t;n++)r[n]=e.ReadByte();return[r,t,e.ReadUint7()]}(e);if(y)var E=r,[S,A,r]=function(e){var t=e.ReadUint7(),r=e.ReadUint7();if(1&t)var i=e.ReadData((t-1)/2);else{var o=e.ReadUint7();i=e.ReadData(o);i=g(new n(i),t/2)}i=new n(i);var a=new Array(256),s=i.ReadByte();0==s&&(s=256);for(var f=0;f<s;f++)a[i.ReadByte()]=1;return[a,i,r]}(e);if(d)var R=e.ReadData(r);else if(0==c)R=g(e,r);else R=function(e,r){var u=(d=e.ReadByte())>>4,c=e;if(1&d){var l=e.ReadUint7(),h=e.ReadUint7(),d=new n(e.ReadData(h));c=new n(g(d,l))}var y=new Array(256),m=new Array(256);!function(e,t,r,n){for(var i=0;i<256;i++){t[i]=new Array(256),r[i]=new Array(256);for(var o=0;o<256;o++)t[i][o]=0}var a=p(e);for(i=0;i<256;i++)if(a[i]){var s=0;for(o=0;o<256;o++)a[o]&&(s>0?s--:(t[i][o]=e.ReadUint7(),0==t[i][o]&&(s=e.ReadByte())));v(t[i],n),r[i][0]=0;for(o=0;o<256;o++)r[i][o+1]=r[i][o]+t[i][o]}}(c,y,m,u);for(var b=new Array(256),_=0;_<256;_++)b[_]=a(m[_],u);for(var w=new Array(4),E=new Array(4),S=0;S<4;S++)w[S]=e.ReadUint32(),E[S]=0;var A=new t.allocUnsafe(r),R=Math.floor(r/4);for(_=0;_<R;_++)for(S=0;S<4;S++){var k=i(w[S],u),x=b[E[S]][k];A[_+S*R]=x,w[S]=s(w[S],m[E[S]][x],y[E[S]][x],u),w[S]=f(e,w[S]),E[S]=x}_*=4;for(;_<r;){k=i(w[3],u),x=o(m[E[3]],k);A[_++]=x,w[3]=s(w[3],m[E[3]][x],y[E[3]][x],u),w[3]=f(e,w[3]),E[3]=x}return A}(e,r);return y&&(R=function(e,r,i,o){new n(e);for(var a=new t.allocUnsafe(o),s=0,f=0;s<o;f++){var u=e[f];if(r[u])for(var c=i.ReadUint7(),l=0;l<=c;l++)a[s++]=u;else a[s++]=u}return a}(R,S,A,E)),m&&(R=function(e,r,n,i){var o=new t.allocUnsafe(i),a=0;if(n<=1)for(var s=0;s<i;s++)o[s]=r[0];else if(n<=2)for(s=0;s<i;s++){if(s%8==0)var f=e[a++];o[s]=r[1&f],f>>=1}else if(n<=4)for(s=0;s<i;s++){if(s%4==0)f=e[a++];o[s]=r[3&f],f>>=2}else if(n<=16)for(s=0;s<i;s++){if(s%2==0)f=e[a++];o[s]=r[15&f],f>>=4}return o}(R,_,w,b)),R}function d(e,r){var i=new n("",0,10);i.WriteByte(r);var o=1&r,a=8&r,s=32&r,f=64&r,h=128&r,d=r>>8;if(16&r||i.WriteUint7(e.length),a)return t.concat([i.buf.slice(0,i.pos),l(0,e,d)]);var p=new t.alloc(0);h&&([p,e]=function(e){for(var r=new Array(256),i=0;i<256;i++)r[i]=0;for(i=0;i<e.length;i++)r[e[i]]++;var o=new Array(256),a=0;for(i=0;i<256;i++)r[i]>0&&(o[i]=a++);if(!(a>16)){if(a<=1)var s=new t.allocUnsafe(0);else if(a<=2){s=new t.allocUnsafe(Math.ceil(e.length/8));var f=-1;for(i=0;i<e.length;i++)i%8==0&&(s[++f]=0),s[f]+=o[e[i]]<<i%8}else if(a<=4){s=new t.allocUnsafe(Math.ceil(e.length/4)),f=-1;for(i=0;i<e.length;i++)i%4==0&&(s[++f]=0),s[f]+=o[e[i]]<<i%4*2}else{s=new t.allocUnsafe(Math.ceil(e.length/2)),f=-1;for(i=0;i<e.length;i++)i%2==0&&(s[++f]=0),s[f]+=o[e[i]]<<i%2*4}var u=new n("",0,a+5);u.WriteByte(a);for(f=0,i=0;i<256;i++)r[i]>0&&(r[i]=f++,u.WriteByte(i));return u.WriteUint7(s.length),[u.buf.slice(0,u.pos),s]}}(e));var g=new t.alloc(0);if(f&&([g,e]=function(e){for(var r=new Array(256),i=0;i<256;i++)r[i]=0;var o=-1;for(i=0;i<e.length;i++)r[e[i]]+=e[i]==o?1:-1,o=e[i];var a=0;for(i=0;i<256;i++)r[i]>0&&a++;for(a||(a=1,r[0]=1),(c=new n("",0,a+1+e.length)).WriteByte(a),i=0;i<256;i++)r[i]>0&&c.WriteByte(i);var s=new t.allocUnsafe(e.length),f=0;for(i=0;i<e.length;i++)if(s[f++]=e[i],r[e[i]]>0){o=e[i];for(var u=0;i+u+1<e.length&&e[i+u+1]==o;)u++;c.WriteUint7(u),i+=u}var c,l=b(c.buf.slice(0,c.pos)),h=new n("",0,16);return h.WriteUint7(2*c.pos),h.WriteUint7(f),h.WriteUint7(l.length),[c=t.concat([h.buf.slice(0,h.pos),l]),s.slice(0,f)]}(e)),e.length<4&&1==o&&(o=0,i.buf[0]&=-2),s)var _=e;else if(0==o)_=b(e);else _=function(e){const r=e.length;for(var i=new n("",0,198156),o=new Array(256),a=new Array(256),s=new Array(256),f=0;f<256;f++)a[f]=new Array(256),s[f]=new Array(256);(function(e,t,r){for(var n=0;n<256;n++){r[n]=0;for(var i=0;i<256;i++)t[n][i]=0}var o=0;for(n=0;n<e.length;n++)r[o]++,t[o][e[n]]++,o=e[n];r[o]++,t[0][e[1*(e.length>>2)]]++,t[0][e[2*(e.length>>2)]]++,t[0][e[3*(e.length>>2)]]++,r[0]+=3})(e,a,o),function(e,t,r){for(var n=0;n<256;n++)if(t[n]){var i=Math.ceil(Math.log2(t[n]));i>r&&(i=r),y(e[n],i)}}(a,o,12);var l=new n("",0,198156);!function(e,t,r){m(e,r);for(var n=0;n<256;n++)if(r[n])for(var i=0,o=0;o<256;o++)if(r[o])if(i)i--;else if(e.WriteUint7(t[n][o]),!t[n][o]){for(var a=o+1;a<256;a++)if(r[a]){if(0!=t[n][a])break;i++}e.WriteByte(i)}}(l,a,o);var h=b(l.buf.slice(0,l.pos));h.length<l.pos?(i.WriteByte(193),i.WriteUint7(l.pos),i.WriteUint7(h.length),i.WriteData(h,h.length)):(i.WriteByte(192),i.WriteData(l.buf,l.pos));!function(e,t,r){for(var n=0;n<256;n++)t[n]&&v(e[n],r)}(a,o,12);for(f=0;f<256;f++)if(o[f]){s[f][0]=0;for(var d=1;d<256;d++)s[f][d]=s[f][d-1]+a[f][d-1]}var p=new Array(4),g=new Array(4);for(d=0;d<4;d++)p[d]=32768,g[d]=0;var _=new n("",1.05*r+100>>0,1.05*r+100>>0),w=Math.floor(r/4),E=new Array(4),S=new Array(4);for(d=0;d<4;d++)E[d]=(d+1)*w-2,S[d]=e[E[d]+1];S[3]=e[r-1];for(f=r-2;f>4*w-2;f--)p[3]=c(p[3],_,s[e[f]][S[3]],a[e[f]][S[3]],12),S[3]=e[f];for(;E[0]>=0;)for(d=3;d>=0;d--){var A=e[E[d]];p[d]=c(p[d],_,s[A][S[d]],a[A][S[d]],12),S[d]=A,E[d]--}for(d=3;d>=0;d--)p[d]=c(p[d],_,s[0][S[d]],a[0][S[d]],12);for(f=3;f>=0;f--)u(p[f],_);return t.concat([i.buf.slice(0,i.pos),_.buf.slice(_.pos,_.length)],i.pos+_.length-_.pos)}(e);return t.concat([i.buf.slice(0,i.pos),p,g,_])}function p(e){for(var t=new Array(256),r=0;r<256;r++)t[r]=0;var n=0,i=e.ReadByte(),o=i;do{t[i]=1,n>0?(n--,i++):(i=e.ReadByte())==o+1&&(n=e.ReadByte()),o=i}while(0!=i);return t}function g(e,r){var n=new Array(256),o=new Array(256);!function(e,t,r){for(var n=0;n<256;n++)t[n]=0;var i=p(e);for(n=0;n<256;n++)i[n]>0&&(t[n]=e.ReadUint7());for(v(t,12),r[0]=0,n=0;n<=255;n++)r[n+1]=r[n]+t[n]}(e,n,o);for(var u=a(o,12),c=new Array(4),l=0;l<4;l++)c[l]=e.ReadUint32();var h=new t.allocUnsafe(r);for(l=0;l<r;l++){var d=l%4,g=u[i(c[d],12)];h[l]=g,c[d]=s(c[d],o[g],n[g],12),c[d]=f(e,c[d])}return h}function y(e,t){for(var r=0,n=0;n<256;n++)r+=e[n];const i=1<<t;var o=i/r;do{var a=0,s=0,f=0;r=0;for(n=0;n<256;n++)0!=e[n]&&(a<e[n]&&(a=e[n],s=n),e[n]=Math.floor(e[n]*o),0==e[n]&&(e[n]=1),r+=e[n]);r<i?e[s]+=i-r:r-i<e[s]/2&&e[s]>2?e[s]-=r-i:r!=i&&(o=i/r,f=1)}while(f)}function v(e,t){for(var r=0,n=0;n<256;n++)r+=e[n];if(0!=r&&r!=1<<t){for(var i=0;r<1<<t;)r*=2,i++;for(n=0;n<256;n++)e[n]<<=i}}function m(e,t){for(var r=0,n=0;n<256;n++)if(t[n])if(r>0)r--;else if(e.WriteByte(n),n>0&&t[n-1]>0){for(r=n+1;r<256&&t[r];r++);r-=n+1,e.WriteByte(r)}e.WriteByte(0)}function b(e){const r=e.length;var i=new n("",0,780),o=new Array(256);!function(e,t){for(var r=0;r<256;r++)t[r]=0;for(r=0;r<e.length;r++)t[e[r]]++}(e,o);var a=Math.ceil(Math.log2(r));a>12&&(a=12),y(o,a),function(e,t){m(e,t);for(var r=0;r<256;r++)t[r]&&e.WriteUint7(t[r])}(i,o),y(o,12);var s=new Array(256);s[0]=0;for(var f=1;f<256;f++)s[f]=s[f-1]+o[f-1];var l=new Array(4);for(f=0;f<4;f++)l[f]=32768;var h=new n("",1.05*r+100>>0,1.05*r+100>>0);for(f=r-1;f>=0;f--)l[f%4]=c(l[f%4],h,s[e[f]],o[e[f]],12);for(f=3;f>=0;f--)u(l[f],h);return t.concat([i.buf.slice(0,i.pos),h.buf.slice(h.pos,h.length)],i.pos+h.length-h.pos)}e.exports={decode:function(e){return h(new n(e),0)},encode:d}}).call(this,r(0).Buffer)},function(e,t,r){(function(t){const n=r(39),i=r(8),o=r(40),a=r(84);e.exports=class{decode(e){return this.stream=new i(e),this.decodeStream(this.stream)}decodeStream(e,t=0){var r=this.stream.ReadByte();16&r||(t=this.stream.ReadUint7());var n,i=t,o=1&r;if(8&r)return this.decodeStripe(this.stream,t);128&r&&([n,i]=this.decodePackMeta(this.stream));if(32&r)var a=this.decodeCat(this.stream,i);else if(4&r)a=this.decodeExt(this.stream,i);else if(64&r)a=o?this.decodeRLE1(this.stream,i):this.decodeRLE0(this.stream,i);else a=o?this.decode1(this.stream,i):this.decode0(this.stream,i);return 128&r&&(a=this.decodePack(a,n,t)),a}encode(e,r){if(this.stream=new i("",0,1.1*e.length+100),this.stream.WriteByte(r),16&r||this.stream.WriteUint7(e.length),8&r)return t.concat([this.stream.buf.slice(0,this.stream.pos),this.encodeStripe(this.stream,e,r>>8)]);var n,o=1&r,a=e.length;return 128&r&&([n,e,a]=this.encodePack(e)),128&r&&this.stream.WriteStream(n),64&r?o?this.encodeRLE1(e,a,this.stream):this.encodeRLE0(e,a,this.stream):o?this.encode1(e,a,this.stream):this.encode0(e,a,this.stream)}decode0(e,r){var i=new t.allocUnsafe(r),a=e.ReadByte();0==a&&(a=256);var s=new o(a),f=new n(e);f.RangeStartDecode(e);for(var u=0;u<r;u++)i[u]=s.ModelDecode(e,f);return i}encode0(e,t,r){for(var i=0,a=0;a<t;a++)i<e[a]&&(i=e[a]);i++;var s=new o(i);r.WriteByte(i);var f=new n(r);for(a=0;a<t;a++)s.ModelEncode(r,f,e[a]);return f.RangeFinishEncode(r),r.buf.slice(0,r.pos)}decode1(e,r){var i=new t.allocUnsafe(r),a=e.ReadByte();0==a&&(a=256);for(var s=new Array(a),f=0;f<a;f++)s[f]=new o(a);var u=new n(e);u.RangeStartDecode(e);var c=0;for(f=0;f<r;f++)i[f]=s[c].ModelDecode(e,u),c=i[f];return i}encode1(e,t,r){for(var i=0,a=0;a<t;a++)i<e[a]&&(i=e[a]);i++;var s=new Array(i);for(a=0;a<i;a++)s[a]=new o(i);r.WriteByte(i);var f=new n(r),u=0;for(a=0;a<t;a++)s[u].ModelEncode(r,f,e[a]),u=e[a];return f.RangeFinishEncode(r),r.buf.slice(0,r.pos)}decodeExt(e,r){var n=new t.allocUnsafe(r),i=a.array(e.buf.slice(e.pos)),o=a.header(i),s=0;do{var f=a.decompress(i,o);-1!=f&&(t.from(f).copy(n,s),s+=f.length,o-=f.length)}while(-1!=f);return n}encodeExt(e,t){}decodeRLE0(e,r){var i=new t.allocUnsafe(r),a=e.ReadByte();0==a&&(a=256);for(var s=new o(a),f=new Array(258),u=0;u<=257;u++)f[u]=new o(4);var c=new n(e);c.RangeStartDecode(e);for(u=0;u<r;){i[u]=s.ModelDecode(e,c);for(var l=f[i[u]].ModelDecode(e,c),h=l,d=256;3==l;)l=f[d].ModelDecode(e,c),d=257,h+=l;for(var p=1;p<=h;p++)i[u+p]=i[u];u+=h+1}return i}encodeRLE0(e,t,r){for(var i=0,a=0;a<t;a++)i<e[a]&&(i=e[a]);i++;var s=new o(i),f=new Array(258);for(a=0;a<=257;a++)f[a]=new o(4);r.WriteByte(i);var u=new n(r);for(a=0;a<t;){s.ModelEncode(r,u,e[a]);for(var c=1;a+c<t&&e[a+c]==e[a];)c++;c--;var l=e[a];e[a];a+=c+1;var h=c>=3?3:c;for(f[l].ModelEncode(r,u,h),c-=h,l=256;3==h;)h=c>=3?3:c,f[l].ModelEncode(r,u,h),l=257,c-=h}return u.RangeFinishEncode(r),r.buf.slice(0,r.pos)}decodeRLE1(e,r){var i=new t.allocUnsafe(r),a=e.ReadByte();0==a&&(a=256);for(var s=new Array(a),f=0;f<a;f++)s[f]=new o(a);var u=new Array(258);for(f=0;f<=257;f++)u[f]=new o(4);var c=new n(e);c.RangeStartDecode(e);var l=0;for(f=0;f<r;){i[f]=s[l].ModelDecode(e,c),l=i[f];for(var h=u[i[f]].ModelDecode(e,c),d=h,p=256;3==h;)h=u[p].ModelDecode(e,c),p=257,d+=h;for(var g=1;g<=d;g++)i[f+g]=i[f];f+=d+1}return i}encodeRLE1(e,t,r){for(var i=0,a=0;a<t;a++)i<e[a]&&(i=e[a]);i++;var s=new Array(i);for(a=0;a<i;a++)s[a]=new o(i);var f=new Array(258);for(a=0;a<=257;a++)f[a]=new o(4);r.WriteByte(i);for(var u=new n(r),c=(a=0,0);a<t;){s[c].ModelEncode(r,u,e[a]);for(var l=1;a+l<t&&e[a+l]==e[a];)l++;l--;var h=e[a];c=e[a],a+=l+1;var d=l>=3?3:l;for(f[h].ModelEncode(r,u,d),l-=d,h=256;3==d;)d=l>=3?3:l,f[h].ModelEncode(r,u,d),h=257,l-=d}return u.RangeFinishEncode(r),r.buf.slice(0,r.pos)}decodePackMeta(e){this.nsym=e.ReadByte();for(var t=new Array(this.nsym),r=0;r<this.nsym;r++)t[r]=e.ReadByte();return[t,e.ReadUint7()]}decodePack(e,r,n){var i=new t.allocUnsafe(n);if(this.nsym<=1)for(var o=0;o<n;o++)i[o]=r[0];else if(this.nsym<=2){o=0;for(var a=0;o<n;o++){if(o%8==0)var s=e[a++];i[o]=r[1&s],s>>=1}}else if(this.nsym<=4)for(o=0,a=0;o<n;o++){if(o%4==0)s=e[a++];i[o]=r[3&s],s>>=2}else{if(!(this.nsym<=16))return e;for(o=0,a=0;o<n;o++){if(o%2==0)s=e[a++];i[o]=r[15&s],s>>=4}}return i}packMeta(e){for(var t=new i("",0,1024),r=new Array(256),n=0;n<e.length;n++)r[e[n]]=1;var o=0;for(n=0;n<256;n++)r[n]&&(r[n]=++o);t.WriteByte(o);for(n=0;n<256;n++)r[n]&&(t.WriteByte(n),r[n]--);return[t,r,o]}encodePack(e){var r,n,i;[r,n,i]=this.packMeta(e);var o=e.length,a=0;if(i<=1)return r.WriteUint7(0),[r,new t.allocUnsafe(0),0];if(i<=2){for(var s=new t.allocUnsafe(Math.floor((o+7)/8)),f=(a=0,0);a<(-8&o);a+=8,f++)s[f]=(n[e[a+0]]<<0)+(n[e[a+1]]<<1)+(n[e[a+2]]<<2)+(n[e[a+3]]<<3)+(n[e[a+4]]<<4)+(n[e[a+5]]<<5)+(n[e[a+6]]<<6)+(n[e[a+7]]<<7);if(a<o){s[f]=0;for(var u=0;a<o;)s[f]|=n[e[a++]]<<u,u++;f++}return r.WriteUint7(f),[r,s,s.length]}if(i<=4){for(s=new t.allocUnsafe(Math.floor((o+3)/4)),a=0,f=0;a<(-4&o);a+=4,f++)s[f]=(n[e[a+0]]<<0)+(n[e[a+1]]<<2)+(n[e[a+2]]<<4)+(n[e[a+3]]<<6);if(a<o){s[f]=0;for(u=0;a<o;)s[f]|=n[e[a++]]<<u,u+=2;f++}return r.WriteUint7(f),[r,s,s.length]}if(i<=16){for(s=new t.allocUnsafe(Math.floor((o+1)/2)),a=0,f=0;a<(-2&o);a+=2,f++)s[f]=(n[e[a+0]]<<0)+(n[e[a+1]]<<4);return a<o&&(s[f++]=n[e[a++]]),r.WriteUint7(f),[r,s,s.length]}return r.WriteUint7(e.length),[r,e,e.length]}encodeStripe(e,t,r){0==r&&(r=4);for(var n=new Array(r),o=new Array(r),a=0;a<r;a++)o[a]=Math.floor(t.length/r)+(t.length%r>a),n[a]=new Array(o[a]);for(var s=0,f=0;f<t.length;f+=r,s++)for(var u=0;u<r;u++)s<n[u].length&&(n[u][s]=t[f+u]);var c=new Array(r),l=0;for(a=0;a<r;a++){var h=this.encode(n[a],0),d=this.encode(n[a],1);c[a]=d.length<h.length?d:h,l+=c[a].length}var p=new i("",0,l+5*r+1);p.WriteByte(r);for(a=0;a<r;a++)p.WriteUint7(c[a].length);for(a=0;a<r;a++)p.WriteData(c[a],c[a].length);return p.buf.slice(0,p.buf.pos)}decodeStripe(e,r){for(var n=e.ReadByte(),i=new Array(n),o=new Array(n),a=0;a<n;a++)i[a]=e.ReadUint7();var s=new Array(n);for(a=0;a<n;a++)o[a]=Math.floor(r/n)+(r%n>a),s[a]=this.decodeStream(e,o[a]);var f=new t.allocUnsafe(r);for(a=0;a<n;a++)for(var u=0;u<o[a];u++)f[u*n+a]=s[a][u];return f}decodeCat(e,r){for(var n=new t.allocUnsafe(r),i=0;i<r;i++)n[i]=e.ReadByte();return n}}}).call(this,r(0).Buffer)},function(e,t){e.exports=class{constructor(e){this.low=0,this.range=4294967295,this.code=0,this.FFnum=0,this.carry=0,this.cache=0}RangeStartDecode(e){for(var t=0;t<5;t++)this.code=(this.code<<8)+e.ReadByte();this.code&=4294967295,this.code>>>=0}RangeGetFrequency(e){return this.range=Math.floor(this.range/e),Math.floor(this.code/this.range)}RangeDecode(e,t,r,n){for(this.code-=t*this.range,this.range*=r;this.range<1<<24;)this.range*=256,this.code=256*this.code+e.ReadByte()}RangeShiftLow(e){if(this.low<4278190080|this.carry){for(e.WriteByte(this.cache+this.carry);this.FFnum;)e.WriteByte(this.carry-1),this.FFnum--;this.cache=this.low>>>24,this.carry=0}else this.FFnum++;this.low<<=8,this.low>>>=0}RangeEncode(e,t,r,n){var i=this.low;for(this.range=Math.floor(this.range/n),this.low+=t*this.range,this.low>>>=0,this.range*=r,this.low<i&&(0!=this.carry&&console.log("ERROR: Multiple carry"),this.carry=1);this.range<1<<24;)this.range*=256,this.RangeShiftLow(e)}RangeFinishEncode(e){for(var t=0;t<5;t++)this.RangeShiftLow(e)}}},function(e,t){e.exports=class{constructor(e=256){this.total_freq=e,this.max_sym=e-1,this.S=new Array,this.F=new Array;for(var t=0;t<=this.max_sym;t++)this.S[t]=t,this.F[t]=1}ModelDecode(e,t){for(var r=t.RangeGetFrequency(this.total_freq),n=0,i=0;n+this.F[i]<=r;)n+=this.F[i++];t.RangeDecode(e,n,this.F[i],this.total_freq),this.F[i]+=16,this.total_freq+=16,this.total_freq>65519&&this.ModelRenormalise();var o=this.S[i];if(i>0&&this.F[i]>this.F[i-1]){var a=this.F[i];this.F[i]=this.F[i-1],this.F[i-1]=a,a=this.S[i],this.S[i]=this.S[i-1],this.S[i-1]=a}return o}ModelRenormalise(){this.total_freq=0;for(var e=0;e<=this.max_sym;e++)this.F[e]-=Math.floor(this.F[e]/2),this.total_freq+=this.F[e]}ModelEncode(e,t,r){for(var n=0,i=0;this.S[i]!=r;i++)n+=this.F[i];t.RangeEncode(e,n,this.F[i],this.total_freq),this.F[i]+=16,this.total_freq+=16,this.total_freq>65519&&this.ModelRenormalise();r=this.S[i];if(i>0&&this.F[i]>this.F[i-1]){var o=this.F[i];this.F[i]=this.F[i-1],this.F[i-1]=o,o=this.S[i],this.S[i]=this.S[i-1],this.S[i-1]=o}}}},function(e,t){var r={utf8:{stringToBytes:function(e){return r.bin.stringToBytes(unescape(encodeURIComponent(e)))},bytesToString:function(e){return decodeURIComponent(escape(r.bin.bytesToString(e)))}},bin:{stringToBytes:function(e){for(var t=[],r=0;r<e.length;r++)t.push(255&e.charCodeAt(r));return t},bytesToString:function(e){for(var t=[],r=0;r<e.length;r++)t.push(String.fromCharCode(e[r]));return t.join("")}}};e.exports=r},function(e,t,r){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.open=t.fromUrl=t.RemoteFile=t.LocalFile=void 0;var i=n(r(103)),o=n(r(110));t.RemoteFile=o.default;var a=n(r(113));function s(e){var t=i.default.parse(e),r=t.protocol,n=t.pathname;return"file:"===r?new a.default(unescape(n)):new o.default(e)}t.LocalFile=a.default,t.fromUrl=s,t.open=function(e,t,r){if(r)return r;if(e)return s(e);if(t)return new a.default(t);throw new Error("no url, path, or filehandle provided, cannot open")}},function(e,t,r){"use strict";(function(e){Object.defineProperty(t,"__esModule",{value:!0}),t.AbortSignal=t.AbortController=void 0;var n=r(120),i=function(){if("undefined"!=typeof self)return self;if("undefined"!=typeof window)return window;if(void 0!==e)return e;throw new Error("unable to locate global object")},o=void 0===i().AbortController?n.AbortController:i().AbortController;t.AbortController=o;var a=void 0===i().AbortController?n.AbortSignal:i().AbortSignal;t.AbortSignal=a}).call(this,r(2))},function(e,t,r){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.CraiIndex=t.IndexedCramFile=t.CramFile=void 0;var i=n(r(24));t.CramFile=i.default;var o=n(r(115));t.IndexedCramFile=o.default;var a=n(r(116));t.CraiIndex=a.default},function(e,t,r){"use strict";(function(e){var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function a(e){try{f(n.next(e))}catch(e){o(e)}}function s(e){try{f(n.throw(e))}catch(e){o(e)}}function f(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}f((n=n.apply(e,t||[])).next())}))},i=this&&this.__generator||function(e,t){var r,n,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(r)throw new TypeError("Generator is already executing.");for(;a;)try{if(r=1,n&&(i=2&o[0]?n.return:o[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,o[1])).done)return i;switch(n=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,n=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!(i=a.trys,(i=i.length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){a.label=o[1];break}if(6===o[0]&&a.label<i[1]){a.label=i[1],i=o;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(o);break}i[2]&&a.ops.pop(),a.trys.pop();continue}o=t.call(e,a)}catch(e){o=[6,e],n=0}finally{r=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,s])}}},o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var a=o(r(26)),s=o(r(73)),f=o(r(19)),u=r(1),c=o(r(74)),l=r(78),h=o(r(82)),d=o(r(87)),p=r(42),g=r(9),y=r(114),v=function(){function t(e){this.file=(0,p.open)(e.url,e.path,e.filehandle),this.validateChecksums=!0,this.fetchReferenceSequenceCallback=e.seqFetch,this.options={checkSequenceMD5:!1!==e.checkSequenceMD5,cacheSize:void 0!==e.cacheSize?e.cacheSize:2e4},this.featureCache=new f.default({maxSize:this.options.cacheSize})}return t.prototype.toString=function(){return this.file.filename?this.file.filename:this.file.url?this.file.url:"(cram file)"},t.prototype.read=function(e,t,r,n){return this.file.read(e,t,r,n)},t.prototype.stat=function(){return this.file.stat()},t.prototype.getDefinition=function(){return n(this,void 0,void 0,(function(){var t,r;return i(this,(function(n){switch(n.label){case 0:return t=e.allocUnsafe(l.cramFileDefinition.maxLength),[4,this.file.read(t,0,l.cramFileDefinition.maxLength,0)];case 1:if(n.sent(),2!==(r=l.cramFileDefinition.parser.parse(t).result).majorVersion&&3!==r.majorVersion)throw new u.CramUnimplementedError("CRAM version ".concat(r.majorVersion," not supported"));return[2,r]}}))}))},t.prototype.getSamHeader=function(){return n(this,void 0,void 0,(function(){var e,t,r,n;return i(this,(function(i){switch(i.label){case 0:return[4,this.getContainerById(0)];case 1:if(!(e=i.sent()))throw new u.CramMalformedError("file contains no containers");return[4,e.getFirstBlock()];case 2:return t=i.sent().content,r=t.readInt32LE(0),4,n=t.toString("utf8",4,4+r),this.header=n,[2,(0,y.parseHeaderText)(n)]}}))}))},t.prototype.getHeaderText=function(){return n(this,void 0,void 0,(function(){return i(this,(function(e){switch(e.label){case 0:return[4,this.getSamHeader()];case 1:return e.sent(),[2,this.header]}}))}))},t.prototype.getSectionParsers=function(){return n(this,void 0,void 0,(function(){var e;return i(this,(function(t){switch(t.label){case 0:return[4,this.getDefinition()];case 1:return e=t.sent().majorVersion,[2,(0,l.getSectionParsers)(e)]}}))}))},t.prototype.getContainerById=function(e){return n(this,void 0,void 0,(function(){var t,r,n,o,a,s,f,c,l;return i(this,(function(i){switch(i.label){case 0:return[4,this.getSectionParsers()];case 1:return t=i.sent(),r=t.cramFileDefinition.maxLength,[4,this.file.stat()];case 2:n=i.sent().size,o=t.cramContainerHeader1,s=0,i.label=3;case 3:return s<=e?r+o.maxLength+8>=n?[2,void 0]:[4,(a=this.getContainerAtPosition(r)).getHeader()]:[3,11];case 4:if(!(f=i.sent()))throw new u.CramMalformedError("container ".concat(e," not found in file"));if(0!==s)return[3,9];r=f._endPosition,c=0,i.label=5;case 5:return c<f.numBlocks?[4,this.readBlock(r)]:[3,8];case 6:l=i.sent(),r=l._endPosition,i.label=7;case 7:return c+=1,[3,5];case 8:return[3,10];case 9:r+=f._size+f.length,i.label=10;case 10:return s+=1,[3,3];case 11:return[2,a]}}))}))},t.prototype.checkCrc32=function(t,r,o,a){return n(this,void 0,void 0,(function(){var n,f;return i(this,(function(i){switch(i.label){case 0:return n=e.allocUnsafe(r),[4,this.file.read(n,0,r,t)];case 1:if(i.sent(),(f=s.default.unsigned(n))!==o)throw new u.CramMalformedError("crc mismatch in ".concat(a,": recorded CRC32 = ").concat(o,", but calculated CRC32 = ").concat(f));return[2]}}))}))},t.prototype.containerCount=function(){return n(this,void 0,void 0,(function(){var e,t,r,n,o,a,s,f;return i(this,(function(i){switch(i.label){case 0:return[4,this.getSectionParsers()];case 1:return e=i.sent(),[4,this.file.stat()];case 2:t=i.sent().size,r=e.cramContainerHeader1,n=0,o=e.cramFileDefinition.maxLength,i.label=3;case 3:return o+r.maxLength+8<t?[4,this.getContainerAtPosition(o).getHeader()]:[3,11];case 4:if(!(a=i.sent()))return[3,11];if(0!==n)return[3,9];o=a._endPosition,s=0,i.label=5;case 5:return s<a.numBlocks?[4,this.readBlock(o)]:[3,8];case 6:f=i.sent(),o=f._endPosition,i.label=7;case 7:return s+=1,[3,5];case 8:return[3,10];case 9:o+=a._size+a.length,i.label=10;case 10:return n+=1,[3,3];case 11:return[2,n]}}))}))},t.prototype.getContainerAtPosition=function(e){return new d.default(this,e)},t.prototype.readBlockHeader=function(t){return n(this,void 0,void 0,(function(){var r,n,o,a;return i(this,(function(i){switch(i.label){case 0:return[4,this.getSectionParsers()];case 1:return r=i.sent(),n=r.cramBlockHeader,[4,this.file.stat()];case 2:return o=i.sent().size,t+n.maxLength>=o?[2,void 0]:(a=e.allocUnsafe(n.maxLength),[4,this.file.read(a,0,n.maxLength,t)]);case 3:return i.sent(),[2,(0,g.parseItem)(a,n.parser,0,t)]}}))}))},t.prototype._parseSection=function(t,r,o,a){return void 0===o&&(o=t.maxLength),n(this,void 0,void 0,(function(){var n,s,f;return i(this,(function(i){switch(i.label){case 0:return a?(n=a,[3,4]):[3,1];case 1:return[4,this.file.stat()];case 2:return s=i.sent().size,r+o>=s?[2,void 0]:(n=e.allocUnsafe(o),[4,this.file.read(n,0,o,r)]);case 3:i.sent(),i.label=4;case 4:if((f=(0,g.parseItem)(n,t.parser,0,r))._size!==o)throw new u.CramMalformedError("section read error: requested size ".concat(o," does not equal parsed size ").concat(f._size));return[2,f]}}))}))},t.prototype._uncompress=function(t,r,n){if("gzip"===t)a.default.gunzipSync(r).copy(n);else if("bzip2"===t){var i=bzip2.array(r),o=bzip2.header(i),s=0;do{var f=bzip2.decompress(i,o);-1!=f&&(e.from(f).copy(n,s),s+=f.length,o-=f.length)}while(-1!=f)}else if("rans"===t)(0,c.default)(r,n);else if("rans4x16"===t)h.default.r4x16_uncompress(r,n);else if("arith"===t)h.default.arith_uncompress(r,n);else if("fqzcomp"===t)h.default.fqzcomp_uncompress(r,n);else{if("tok3"!==t)throw new u.CramUnimplementedError("".concat(t," decompression not yet implemented"));h.default.tok3_uncompress(r,n)}},t.prototype.readBlock=function(t){return n(this,void 0,void 0,(function(){var r,n,o,a,s,f,u;return i(this,(function(i){switch(i.label){case 0:return[4,this.getDefinition()];case 1:return r=i.sent().majorVersion,[4,this.getSectionParsers()];case 2:return n=i.sent(),[4,this.readBlockHeader(t)];case 3:return o=i.sent(),a=o._endPosition,o.contentPosition=o._endPosition,s=e.allocUnsafe(o.uncompressedSize),"raw"===o.compressionMethod?[3,5]:(f=e.allocUnsafe(o.compressedSize),[4,this.read(f,0,o.compressedSize,a)]);case 4:return i.sent(),this._uncompress(o.compressionMethod,f,s),[3,7];case 5:return[4,this.read(s,0,o.uncompressedSize,a)];case 6:i.sent(),i.label=7;case 7:return o.content=s,r>=3?[4,this._parseSection(n.cramBlockCrc32,a+o.compressedSize)]:[3,11];case 8:return u=i.sent(),o.crc32=u.crc32,this.validateChecksums?[4,this.checkCrc32(t,o._size+o.compressedSize,o.crc32,"block data")]:[3,10];case 9:i.sent(),i.label=10;case 10:return o._endPosition=u._endPosition,o._size=o.compressedSize+n.cramBlockCrc32.maxLength,[3,12];case 11:o._endPosition=a+o.compressedSize,o._size=o.compressedSize,i.label=12;case 12:return[2,o]}}))}))},t}();t.default=v,"getDefinition getSectionParsers getSamHeader".split(" ").forEach((function(e){return(0,g.tinyMemoize)(v,e)}))}).call(this,r(0).Buffer)},function(e,t,r){"use strict";t.byteLength=function(e){var t=u(e),r=t[0],n=t[1];return 3*(r+n)/4-n},t.toByteArray=function(e){var t,r,n=u(e),a=n[0],s=n[1],f=new o(function(e,t,r){return 3*(t+r)/4-r}(0,a,s)),c=0,l=s>0?a-4:a;for(r=0;r<l;r+=4)t=i[e.charCodeAt(r)]<<18|i[e.charCodeAt(r+1)]<<12|i[e.charCodeAt(r+2)]<<6|i[e.charCodeAt(r+3)],f[c++]=t>>16&255,f[c++]=t>>8&255,f[c++]=255&t;2===s&&(t=i[e.charCodeAt(r)]<<2|i[e.charCodeAt(r+1)]>>4,f[c++]=255&t);1===s&&(t=i[e.charCodeAt(r)]<<10|i[e.charCodeAt(r+1)]<<4|i[e.charCodeAt(r+2)]>>2,f[c++]=t>>8&255,f[c++]=255&t);return f},t.fromByteArray=function(e){for(var t,r=e.length,i=r%3,o=[],a=0,s=r-i;a<s;a+=16383)o.push(c(e,a,a+16383>s?s:a+16383));1===i?(t=e[r-1],o.push(n[t>>2]+n[t<<4&63]+"==")):2===i&&(t=(e[r-2]<<8)+e[r-1],o.push(n[t>>10]+n[t>>4&63]+n[t<<2&63]+"="));return o.join("")};for(var n=[],i=[],o="undefined"!=typeof Uint8Array?Uint8Array:Array,a="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",s=0,f=a.length;s<f;++s)n[s]=a[s],i[a.charCodeAt(s)]=s;function u(e){var t=e.length;if(t%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var r=e.indexOf("=");return-1===r&&(r=t),[r,r===t?0:4-r%4]}function c(e,t,r){for(var i,o,a=[],s=t;s<r;s+=3)i=(e[s]<<16&16711680)+(e[s+1]<<8&65280)+(255&e[s+2]),a.push(n[(o=i)>>18&63]+n[o>>12&63]+n[o>>6&63]+n[63&o]);return a.join("")}i["-".charCodeAt(0)]=62,i["_".charCodeAt(0)]=63},function(e,t){
|
|
8
|
+
var n=r(33),i=r(34),o=r(35);function a(){return f.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function s(t,e){if(a()<e)throw new RangeError("Invalid typed array length");return f.TYPED_ARRAY_SUPPORT?(t=new Uint8Array(e)).__proto__=f.prototype:(null===t&&(t=new f(e)),t.length=e),t}function f(t,e,r){if(!(f.TYPED_ARRAY_SUPPORT||this instanceof f))return new f(t,e,r);if("number"==typeof t){if("string"==typeof e)throw new Error("If encoding is specified then the first argument must be a string");return h(this,t)}return u(this,t,e,r)}function u(t,e,r,n){if("number"==typeof e)throw new TypeError('"value" argument must not be a number');return"undefined"!=typeof ArrayBuffer&&e instanceof ArrayBuffer?function(t,e,r,n){if(e.byteLength,r<0||e.byteLength<r)throw new RangeError("'offset' is out of bounds");if(e.byteLength<r+(n||0))throw new RangeError("'length' is out of bounds");e=void 0===r&&void 0===n?new Uint8Array(e):void 0===n?new Uint8Array(e,r):new Uint8Array(e,r,n);f.TYPED_ARRAY_SUPPORT?(t=e).__proto__=f.prototype:t=l(t,e);return t}(t,e,r,n):"string"==typeof e?function(t,e,r){"string"==typeof r&&""!==r||(r="utf8");if(!f.isEncoding(r))throw new TypeError('"encoding" must be a valid string encoding');var n=0|p(e,r),i=(t=s(t,n)).write(e,r);i!==n&&(t=t.slice(0,i));return t}(t,e,r):function(t,e){if(f.isBuffer(e)){var r=0|d(e.length);return 0===(t=s(t,r)).length||e.copy(t,0,0,r),t}if(e){if("undefined"!=typeof ArrayBuffer&&e.buffer instanceof ArrayBuffer||"length"in e)return"number"!=typeof e.length||(n=e.length)!=n?s(t,0):l(t,e);if("Buffer"===e.type&&o(e.data))return l(t,e.data)}var n;throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}(t,e)}function c(t){if("number"!=typeof t)throw new TypeError('"size" argument must be a number');if(t<0)throw new RangeError('"size" argument must not be negative')}function h(t,e){if(c(e),t=s(t,e<0?0:0|d(e)),!f.TYPED_ARRAY_SUPPORT)for(var r=0;r<e;++r)t[r]=0;return t}function l(t,e){var r=e.length<0?0:0|d(e.length);t=s(t,r);for(var n=0;n<r;n+=1)t[n]=255&e[n];return t}function d(t){if(t>=a())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+a().toString(16)+" bytes");return 0|t}function p(t,e){if(f.isBuffer(t))return t.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(t)||t instanceof ArrayBuffer))return t.byteLength;"string"!=typeof t&&(t=""+t);var r=t.length;if(0===r)return 0;for(var n=!1;;)switch(e){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":case void 0:return D(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return q(t).length;default:if(n)return D(t).length;e=(""+e).toLowerCase(),n=!0}}function g(t,e,r){var n=!1;if((void 0===e||e<0)&&(e=0),e>this.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if((r>>>=0)<=(e>>>=0))return"";for(t||(t="utf8");;)switch(t){case"hex":return x(this,e,r);case"utf8":case"utf-8":return B(this,e,r);case"ascii":return k(this,e,r);case"latin1":case"binary":return R(this,e,r);case"base64":return C(this,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return M(this,e,r);default:if(n)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),n=!0}}function y(t,e,r){var n=t[e];t[e]=t[r],t[r]=n}function v(t,e,r,n,i){if(0===t.length)return-1;if("string"==typeof r?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),r=+r,isNaN(r)&&(r=i?0:t.length-1),r<0&&(r=t.length+r),r>=t.length){if(i)return-1;r=t.length-1}else if(r<0){if(!i)return-1;r=0}if("string"==typeof e&&(e=f.from(e,n)),f.isBuffer(e))return 0===e.length?-1:m(t,e,r,n,i);if("number"==typeof e)return e&=255,f.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(t,e,r):Uint8Array.prototype.lastIndexOf.call(t,e,r):m(t,[e],r,n,i);throw new TypeError("val must be string, number or Buffer")}function m(t,e,r,n,i){var o,a=1,s=t.length,f=e.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(t.length<2||e.length<2)return-1;a=2,s/=2,f/=2,r/=2}function u(t,e){return 1===a?t[e]:t.readUInt16BE(e*a)}if(i){var c=-1;for(o=r;o<s;o++)if(u(t,o)===u(e,-1===c?0:o-c)){if(-1===c&&(c=o),o-c+1===f)return c*a}else-1!==c&&(o-=o-c),c=-1}else for(r+f>s&&(r=s-f),o=r;o>=0;o--){for(var h=!0,l=0;l<f;l++)if(u(t,o+l)!==u(e,l)){h=!1;break}if(h)return o}return-1}function b(t,e,r,n){r=Number(r)||0;var i=t.length-r;n?(n=Number(n))>i&&(n=i):n=i;var o=e.length;if(o%2!=0)throw new TypeError("Invalid hex string");n>o/2&&(n=o/2);for(var a=0;a<n;++a){var s=parseInt(e.substr(2*a,2),16);if(isNaN(s))return a;t[r+a]=s}return a}function _(t,e,r,n){return j(D(e,t.length-r),t,r,n)}function w(t,e,r,n){return j(function(t){for(var e=[],r=0;r<t.length;++r)e.push(255&t.charCodeAt(r));return e}(e),t,r,n)}function A(t,e,r,n){return w(t,e,r,n)}function S(t,e,r,n){return j(q(e),t,r,n)}function E(t,e,r,n){return j(function(t,e){for(var r,n,i,o=[],a=0;a<t.length&&!((e-=2)<0);++a)r=t.charCodeAt(a),n=r>>8,i=r%256,o.push(i),o.push(n);return o}(e,t.length-r),t,r,n)}function C(t,e,r){return 0===e&&r===t.length?n.fromByteArray(t):n.fromByteArray(t.slice(e,r))}function B(t,e,r){r=Math.min(t.length,r);for(var n=[],i=e;i<r;){var o,a,s,f,u=t[i],c=null,h=u>239?4:u>223?3:u>191?2:1;if(i+h<=r)switch(h){case 1:u<128&&(c=u);break;case 2:128==(192&(o=t[i+1]))&&(f=(31&u)<<6|63&o)>127&&(c=f);break;case 3:o=t[i+1],a=t[i+2],128==(192&o)&&128==(192&a)&&(f=(15&u)<<12|(63&o)<<6|63&a)>2047&&(f<55296||f>57343)&&(c=f);break;case 4:o=t[i+1],a=t[i+2],s=t[i+3],128==(192&o)&&128==(192&a)&&128==(192&s)&&(f=(15&u)<<18|(63&o)<<12|(63&a)<<6|63&s)>65535&&f<1114112&&(c=f)}null===c?(c=65533,h=1):c>65535&&(c-=65536,n.push(c>>>10&1023|55296),c=56320|1023&c),n.push(c),i+=h}return function(t){var e=t.length;if(e<=4096)return String.fromCharCode.apply(String,t);var r="",n=0;for(;n<e;)r+=String.fromCharCode.apply(String,t.slice(n,n+=4096));return r}(n)}e.Buffer=f,e.SlowBuffer=function(t){+t!=t&&(t=0);return f.alloc(+t)},e.INSPECT_MAX_BYTES=50,f.TYPED_ARRAY_SUPPORT=void 0!==t.TYPED_ARRAY_SUPPORT?t.TYPED_ARRAY_SUPPORT:function(){try{var t=new Uint8Array(1);return t.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},42===t.foo()&&"function"==typeof t.subarray&&0===t.subarray(1,1).byteLength}catch(t){return!1}}(),e.kMaxLength=a(),f.poolSize=8192,f._augment=function(t){return t.__proto__=f.prototype,t},f.from=function(t,e,r){return u(null,t,e,r)},f.TYPED_ARRAY_SUPPORT&&(f.prototype.__proto__=Uint8Array.prototype,f.__proto__=Uint8Array,"undefined"!=typeof Symbol&&Symbol.species&&f[Symbol.species]===f&&Object.defineProperty(f,Symbol.species,{value:null,configurable:!0})),f.alloc=function(t,e,r){return function(t,e,r,n){return c(e),e<=0?s(t,e):void 0!==r?"string"==typeof n?s(t,e).fill(r,n):s(t,e).fill(r):s(t,e)}(null,t,e,r)},f.allocUnsafe=function(t){return h(null,t)},f.allocUnsafeSlow=function(t){return h(null,t)},f.isBuffer=function(t){return!(null==t||!t._isBuffer)},f.compare=function(t,e){if(!f.isBuffer(t)||!f.isBuffer(e))throw new TypeError("Arguments must be Buffers");if(t===e)return 0;for(var r=t.length,n=e.length,i=0,o=Math.min(r,n);i<o;++i)if(t[i]!==e[i]){r=t[i],n=e[i];break}return r<n?-1:n<r?1:0},f.isEncoding=function(t){switch(String(t).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},f.concat=function(t,e){if(!o(t))throw new TypeError('"list" argument must be an Array of Buffers');if(0===t.length)return f.alloc(0);var r;if(void 0===e)for(e=0,r=0;r<t.length;++r)e+=t[r].length;var n=f.allocUnsafe(e),i=0;for(r=0;r<t.length;++r){var a=t[r];if(!f.isBuffer(a))throw new TypeError('"list" argument must be an Array of Buffers');a.copy(n,i),i+=a.length}return n},f.byteLength=p,f.prototype._isBuffer=!0,f.prototype.swap16=function(){var t=this.length;if(t%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var e=0;e<t;e+=2)y(this,e,e+1);return this},f.prototype.swap32=function(){var t=this.length;if(t%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var e=0;e<t;e+=4)y(this,e,e+3),y(this,e+1,e+2);return this},f.prototype.swap64=function(){var t=this.length;if(t%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var e=0;e<t;e+=8)y(this,e,e+7),y(this,e+1,e+6),y(this,e+2,e+5),y(this,e+3,e+4);return this},f.prototype.toString=function(){var t=0|this.length;return 0===t?"":0===arguments.length?B(this,0,t):g.apply(this,arguments)},f.prototype.equals=function(t){if(!f.isBuffer(t))throw new TypeError("Argument must be a Buffer");return this===t||0===f.compare(this,t)},f.prototype.inspect=function(){var t="",r=e.INSPECT_MAX_BYTES;return this.length>0&&(t=this.toString("hex",0,r).match(/.{2}/g).join(" "),this.length>r&&(t+=" ... ")),"<Buffer "+t+">"},f.prototype.compare=function(t,e,r,n,i){if(!f.isBuffer(t))throw new TypeError("Argument must be a Buffer");if(void 0===e&&(e=0),void 0===r&&(r=t?t.length:0),void 0===n&&(n=0),void 0===i&&(i=this.length),e<0||r>t.length||n<0||i>this.length)throw new RangeError("out of range index");if(n>=i&&e>=r)return 0;if(n>=i)return-1;if(e>=r)return 1;if(this===t)return 0;for(var o=(i>>>=0)-(n>>>=0),a=(r>>>=0)-(e>>>=0),s=Math.min(o,a),u=this.slice(n,i),c=t.slice(e,r),h=0;h<s;++h)if(u[h]!==c[h]){o=u[h],a=c[h];break}return o<a?-1:a<o?1:0},f.prototype.includes=function(t,e,r){return-1!==this.indexOf(t,e,r)},f.prototype.indexOf=function(t,e,r){return v(this,t,e,r,!0)},f.prototype.lastIndexOf=function(t,e,r){return v(this,t,e,r,!1)},f.prototype.write=function(t,e,r,n){if(void 0===e)n="utf8",r=this.length,e=0;else if(void 0===r&&"string"==typeof e)n=e,r=this.length,e=0;else{if(!isFinite(e))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");e|=0,isFinite(r)?(r|=0,void 0===n&&(n="utf8")):(n=r,r=void 0)}var i=this.length-e;if((void 0===r||r>i)&&(r=i),t.length>0&&(r<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");for(var o=!1;;)switch(n){case"hex":return b(this,t,e,r);case"utf8":case"utf-8":return _(this,t,e,r);case"ascii":return w(this,t,e,r);case"latin1":case"binary":return A(this,t,e,r);case"base64":return S(this,t,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return E(this,t,e,r);default:if(o)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),o=!0}},f.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function k(t,e,r){var n="";r=Math.min(t.length,r);for(var i=e;i<r;++i)n+=String.fromCharCode(127&t[i]);return n}function R(t,e,r){var n="";r=Math.min(t.length,r);for(var i=e;i<r;++i)n+=String.fromCharCode(t[i]);return n}function x(t,e,r){var n=t.length;(!e||e<0)&&(e=0),(!r||r<0||r>n)&&(r=n);for(var i="",o=e;o<r;++o)i+=z(t[o]);return i}function M(t,e,r){for(var n=t.slice(e,r),i="",o=0;o<n.length;o+=2)i+=String.fromCharCode(n[o]+256*n[o+1]);return i}function T(t,e,r){if(t%1!=0||t<0)throw new RangeError("offset is not uint");if(t+e>r)throw new RangeError("Trying to access beyond buffer length")}function P(t,e,r,n,i,o){if(!f.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>i||e<o)throw new RangeError('"value" argument is out of bounds');if(r+n>t.length)throw new RangeError("Index out of range")}function I(t,e,r,n){e<0&&(e=65535+e+1);for(var i=0,o=Math.min(t.length-r,2);i<o;++i)t[r+i]=(e&255<<8*(n?i:1-i))>>>8*(n?i:1-i)}function O(t,e,r,n){e<0&&(e=4294967295+e+1);for(var i=0,o=Math.min(t.length-r,4);i<o;++i)t[r+i]=e>>>8*(n?i:3-i)&255}function F(t,e,r,n,i,o){if(r+n>t.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function U(t,e,r,n,o){return o||F(t,0,r,4),i.write(t,e,r,n,23,4),r+4}function L(t,e,r,n,o){return o||F(t,0,r,8),i.write(t,e,r,n,52,8),r+8}f.prototype.slice=function(t,e){var r,n=this.length;if((t=~~t)<0?(t+=n)<0&&(t=0):t>n&&(t=n),(e=void 0===e?n:~~e)<0?(e+=n)<0&&(e=0):e>n&&(e=n),e<t&&(e=t),f.TYPED_ARRAY_SUPPORT)(r=this.subarray(t,e)).__proto__=f.prototype;else{var i=e-t;r=new f(i,void 0);for(var o=0;o<i;++o)r[o]=this[o+t]}return r},f.prototype.readUIntLE=function(t,e,r){t|=0,e|=0,r||T(t,e,this.length);for(var n=this[t],i=1,o=0;++o<e&&(i*=256);)n+=this[t+o]*i;return n},f.prototype.readUIntBE=function(t,e,r){t|=0,e|=0,r||T(t,e,this.length);for(var n=this[t+--e],i=1;e>0&&(i*=256);)n+=this[t+--e]*i;return n},f.prototype.readUInt8=function(t,e){return e||T(t,1,this.length),this[t]},f.prototype.readUInt16LE=function(t,e){return e||T(t,2,this.length),this[t]|this[t+1]<<8},f.prototype.readUInt16BE=function(t,e){return e||T(t,2,this.length),this[t]<<8|this[t+1]},f.prototype.readUInt32LE=function(t,e){return e||T(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},f.prototype.readUInt32BE=function(t,e){return e||T(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},f.prototype.readIntLE=function(t,e,r){t|=0,e|=0,r||T(t,e,this.length);for(var n=this[t],i=1,o=0;++o<e&&(i*=256);)n+=this[t+o]*i;return n>=(i*=128)&&(n-=Math.pow(2,8*e)),n},f.prototype.readIntBE=function(t,e,r){t|=0,e|=0,r||T(t,e,this.length);for(var n=e,i=1,o=this[t+--n];n>0&&(i*=256);)o+=this[t+--n]*i;return o>=(i*=128)&&(o-=Math.pow(2,8*e)),o},f.prototype.readInt8=function(t,e){return e||T(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},f.prototype.readInt16LE=function(t,e){e||T(t,2,this.length);var r=this[t]|this[t+1]<<8;return 32768&r?4294901760|r:r},f.prototype.readInt16BE=function(t,e){e||T(t,2,this.length);var r=this[t+1]|this[t]<<8;return 32768&r?4294901760|r:r},f.prototype.readInt32LE=function(t,e){return e||T(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},f.prototype.readInt32BE=function(t,e){return e||T(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},f.prototype.readFloatLE=function(t,e){return e||T(t,4,this.length),i.read(this,t,!0,23,4)},f.prototype.readFloatBE=function(t,e){return e||T(t,4,this.length),i.read(this,t,!1,23,4)},f.prototype.readDoubleLE=function(t,e){return e||T(t,8,this.length),i.read(this,t,!0,52,8)},f.prototype.readDoubleBE=function(t,e){return e||T(t,8,this.length),i.read(this,t,!1,52,8)},f.prototype.writeUIntLE=function(t,e,r,n){(t=+t,e|=0,r|=0,n)||P(this,t,e,r,Math.pow(2,8*r)-1,0);var i=1,o=0;for(this[e]=255&t;++o<r&&(i*=256);)this[e+o]=t/i&255;return e+r},f.prototype.writeUIntBE=function(t,e,r,n){(t=+t,e|=0,r|=0,n)||P(this,t,e,r,Math.pow(2,8*r)-1,0);var i=r-1,o=1;for(this[e+i]=255&t;--i>=0&&(o*=256);)this[e+i]=t/o&255;return e+r},f.prototype.writeUInt8=function(t,e,r){return t=+t,e|=0,r||P(this,t,e,1,255,0),f.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),this[e]=255&t,e+1},f.prototype.writeUInt16LE=function(t,e,r){return t=+t,e|=0,r||P(this,t,e,2,65535,0),f.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8):I(this,t,e,!0),e+2},f.prototype.writeUInt16BE=function(t,e,r){return t=+t,e|=0,r||P(this,t,e,2,65535,0),f.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=255&t):I(this,t,e,!1),e+2},f.prototype.writeUInt32LE=function(t,e,r){return t=+t,e|=0,r||P(this,t,e,4,4294967295,0),f.TYPED_ARRAY_SUPPORT?(this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=255&t):O(this,t,e,!0),e+4},f.prototype.writeUInt32BE=function(t,e,r){return t=+t,e|=0,r||P(this,t,e,4,4294967295,0),f.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t):O(this,t,e,!1),e+4},f.prototype.writeIntLE=function(t,e,r,n){if(t=+t,e|=0,!n){var i=Math.pow(2,8*r-1);P(this,t,e,r,i-1,-i)}var o=0,a=1,s=0;for(this[e]=255&t;++o<r&&(a*=256);)t<0&&0===s&&0!==this[e+o-1]&&(s=1),this[e+o]=(t/a>>0)-s&255;return e+r},f.prototype.writeIntBE=function(t,e,r,n){if(t=+t,e|=0,!n){var i=Math.pow(2,8*r-1);P(this,t,e,r,i-1,-i)}var o=r-1,a=1,s=0;for(this[e+o]=255&t;--o>=0&&(a*=256);)t<0&&0===s&&0!==this[e+o+1]&&(s=1),this[e+o]=(t/a>>0)-s&255;return e+r},f.prototype.writeInt8=function(t,e,r){return t=+t,e|=0,r||P(this,t,e,1,127,-128),f.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),t<0&&(t=255+t+1),this[e]=255&t,e+1},f.prototype.writeInt16LE=function(t,e,r){return t=+t,e|=0,r||P(this,t,e,2,32767,-32768),f.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8):I(this,t,e,!0),e+2},f.prototype.writeInt16BE=function(t,e,r){return t=+t,e|=0,r||P(this,t,e,2,32767,-32768),f.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=255&t):I(this,t,e,!1),e+2},f.prototype.writeInt32LE=function(t,e,r){return t=+t,e|=0,r||P(this,t,e,4,2147483647,-2147483648),f.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24):O(this,t,e,!0),e+4},f.prototype.writeInt32BE=function(t,e,r){return t=+t,e|=0,r||P(this,t,e,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),f.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t):O(this,t,e,!1),e+4},f.prototype.writeFloatLE=function(t,e,r){return U(this,t,e,!0,r)},f.prototype.writeFloatBE=function(t,e,r){return U(this,t,e,!1,r)},f.prototype.writeDoubleLE=function(t,e,r){return L(this,t,e,!0,r)},f.prototype.writeDoubleBE=function(t,e,r){return L(this,t,e,!1,r)},f.prototype.copy=function(t,e,r,n){if(r||(r=0),n||0===n||(n=this.length),e>=t.length&&(e=t.length),e||(e=0),n>0&&n<r&&(n=r),n===r)return 0;if(0===t.length||0===this.length)return 0;if(e<0)throw new RangeError("targetStart out of bounds");if(r<0||r>=this.length)throw new RangeError("sourceStart out of bounds");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),t.length-e<n-r&&(n=t.length-e+r);var i,o=n-r;if(this===t&&r<e&&e<n)for(i=o-1;i>=0;--i)t[i+e]=this[i+r];else if(o<1e3||!f.TYPED_ARRAY_SUPPORT)for(i=0;i<o;++i)t[i+e]=this[i+r];else Uint8Array.prototype.set.call(t,this.subarray(r,r+o),e);return o},f.prototype.fill=function(t,e,r,n){if("string"==typeof t){if("string"==typeof e?(n=e,e=0,r=this.length):"string"==typeof r&&(n=r,r=this.length),1===t.length){var i=t.charCodeAt(0);i<256&&(t=i)}if(void 0!==n&&"string"!=typeof n)throw new TypeError("encoding must be a string");if("string"==typeof n&&!f.isEncoding(n))throw new TypeError("Unknown encoding: "+n)}else"number"==typeof t&&(t&=255);if(e<0||this.length<e||this.length<r)throw new RangeError("Out of range index");if(r<=e)return this;var o;if(e>>>=0,r=void 0===r?this.length:r>>>0,t||(t=0),"number"==typeof t)for(o=e;o<r;++o)this[o]=t;else{var a=f.isBuffer(t)?t:D(new f(t,n).toString()),s=a.length;for(o=0;o<r-e;++o)this[o+e]=a[o%s]}return this};var N=/[^+\/0-9A-Za-z-_]/g;function z(t){return t<16?"0"+t.toString(16):t.toString(16)}function D(t,e){var r;e=e||1/0;for(var n=t.length,i=null,o=[],a=0;a<n;++a){if((r=t.charCodeAt(a))>55295&&r<57344){if(!i){if(r>56319){(e-=3)>-1&&o.push(239,191,189);continue}if(a+1===n){(e-=3)>-1&&o.push(239,191,189);continue}i=r;continue}if(r<56320){(e-=3)>-1&&o.push(239,191,189),i=r;continue}r=65536+(i-55296<<10|r-56320)}else i&&(e-=3)>-1&&o.push(239,191,189);if(i=null,r<128){if((e-=1)<0)break;o.push(r)}else if(r<2048){if((e-=2)<0)break;o.push(r>>6|192,63&r|128)}else if(r<65536){if((e-=3)<0)break;o.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((e-=4)<0)break;o.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return o}function q(t){return n.toByteArray(function(t){if((t=function(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")}(t).replace(N,"")).length<2)return"";for(;t.length%4!=0;)t+="=";return t}(t))}function j(t,e,r,n){for(var i=0;i<n&&!(i+r>=e.length||i>=t.length);++i)e[i+r]=t[i];return i}}).call(this,r(9))},function(t,e,r){"use strict";var n="undefined"!=typeof Uint8Array&&"undefined"!=typeof Uint16Array&&"undefined"!=typeof Int32Array;function i(t,e){return Object.prototype.hasOwnProperty.call(t,e)}e.assign=function(t){for(var e=Array.prototype.slice.call(arguments,1);e.length;){var r=e.shift();if(r){if("object"!=typeof r)throw new TypeError(r+"must be non-object");for(var n in r)i(r,n)&&(t[n]=r[n])}}return t},e.shrinkBuf=function(t,e){return t.length===e?t:t.subarray?t.subarray(0,e):(t.length=e,t)};var o={arraySet:function(t,e,r,n,i){if(e.subarray&&t.subarray)t.set(e.subarray(r,r+n),i);else for(var o=0;o<n;o++)t[i+o]=e[r+o]},flattenChunks:function(t){var e,r,n,i,o,a;for(n=0,e=0,r=t.length;e<r;e++)n+=t[e].length;for(a=new Uint8Array(n),i=0,e=0,r=t.length;e<r;e++)o=t[e],a.set(o,i),i+=o.length;return a}},a={arraySet:function(t,e,r,n,i){for(var o=0;o<n;o++)t[i+o]=e[r+o]},flattenChunks:function(t){return[].concat.apply([],t)}};e.setTyped=function(t){t?(e.Buf8=Uint8Array,e.Buf16=Uint16Array,e.Buf32=Int32Array,e.assign(e,o)):(e.Buf8=Array,e.Buf16=Array,e.Buf32=Array,e.assign(e,a))},e.setTyped(n)},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=r(0),i={int:!0,byte:!0,long:!0,byteArray:!0,byteArrayBlock:!0},o=function(){function t(t,e){if(void 0===t&&(t={}),this.parameters=t,this.dataType=e,!e)throw new TypeError("must provide a data type to codec constructor");if(!i[e])throw new TypeError("invalid data type ".concat(e))}return t.prototype._getBits=function(t,e,r){var i=0;if(e.bytePosition+(7-e.bitPosition+r)/8>t.length)throw new n.CramBufferOverrunError("read error during decoding. the file seems to be truncated.");for(var o=r;o;o-=1)i<<=1,i|=t[e.bytePosition]>>e.bitPosition&1,e.bitPosition-=1,e.bitPosition<0&&(e.bytePosition+=1),e.bitPosition&=7;return i},t}();e.default=o},function(t,e,r){(function(e){t.exports=class{constructor(t,r=0,n=0){0!=n?(this.buf=e.allocUnsafe(n),this.length=n):(this.buf=t,this.length=t.length),this.pos=r}EOF(){return this.pos>=this.length}ReadData(t){var e=this.buf.slice(this.pos,this.pos+t);return this.pos+=t,e}ReadByte(){const t=this.buf[this.pos];return this.pos++,t}ReadChar(){const t=this.buf[this.pos];return this.pos++,String.fromCharCode(t)}ReadUint16(){var t=this.ReadByte();return t|=this.ReadByte()<<8}ReadUint32(){const t=this.buf.readInt32LE(this.pos);return this.pos+=4,t}ReadString(){var t="";do{var e=this.buf[this.pos++];e&&(t+=String.fromCharCode(e))}while(e);return t}ReadUint7(){var t=0;do{var e=this.ReadByte();t=t<<7|127&e}while(128&e);return t}ReadITF8(){var t=this.buf[this.pos];return this.pos++,t>=240?(t=(15&t)<<28,t+=(this.buf[this.pos+0]<<20)+(this.buf[this.pos+1]<<12)+(this.buf[this.pos+2]<<4)+(this.buf[this.pos+3]>>4),this.pos+=4):t>=224?(t=(15&t)<<24,t+=(this.buf[this.pos+0]<<16)+(this.buf[this.pos+1]<<8)+(this.buf[this.pos+2]<<0),this.pos+=3):t>=192?(t=(31&t)<<16,t+=(this.buf[this.pos+0]<<8)+(this.buf[this.pos+1]<<0),this.pos+=2):t>=128&&(t=(63&t)<<8,t+=this.buf[this.pos],this.pos++),t}WriteByte(t){this.buf[this.pos++]=t}WriteChar(t){this.buf[this.pos++]=t.charCodeAt(0)}WriteString(t){for(var e=0;e<t.length;e++)this.buf[this.pos++]=t.charCodeAt(e);this.buf[this.pos++]=0}WriteData(t,e){for(var r=0;r<e;r++)this.buf[this.pos++]=t[r]}WriteStream(t){this.WriteData(t.buf,t.pos)}WriteUint16(t){this.WriteByte(255&t),this.WriteByte(t>>8&255)}WriteUint32(t){this.buf.writeInt32LE(t,this.pos),this.pos+=4}WriteUint7(t){var e=0,r=t;do{e+=7,r>>=7}while(r>0);do{e-=7,this.WriteByte((t>>e&127)+((e>0)<<7))}while(e>0)}WriteITF8(t){t<0&&(t=1+t),t<=127?this.buf[this.pos++]=t:t<=16383?(this.buf[this.pos++]=128|Math.floor(t/256),this.buf[this.pos++]=255&t):t<131071?(this.buf[this.pos++]=192|Math.floor(t/65536),this.buf[this.pos++]=255&Math.floor(t/256),this.buf[this.pos++]=255&t):t<268435455?(this.buf[this.pos++]=224|Math.floor(t/16777216),this.buf[this.pos++]=255&Math.floor(t/65536),this.buf[this.pos++]=255&Math.floor(t/256),this.buf[this.pos++]=255&t):(this.buf[this.pos++]=240|Math.floor(t/268435456),this.buf[this.pos++]=255&Math.floor(t/1048576),this.buf[this.pos++]=255&Math.floor(t/4096),this.buf[this.pos++]=255&Math.floor(t/4),this.buf[this.pos++]=15&t)}WriteByteNeg(t){this.buf[--this.pos]=t}}}).call(this,r(1).Buffer)},function(t,e,r){"use strict";var n=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.sequenceMD5=e.tinyMemoize=e.parseItem=e.parseItf8=e.itf8Size=void 0;var i=n(r(61)),o=r(0);e.itf8Size=function(t){return-128&t?-16384&t?-2097152&t?-268435456&t?5:4:3:2:1},e.parseItf8=function(t,e){var r,n=e,i=t[n];if(i<128?(r=i,n+=1):i<192?(r=16383&(i<<8|t[n+1]),n+=2):i<224?(r=2097151&(i<<16|t[n+1]<<8|t[n+2]),n+=3):i<240?(r=268435455&(i<<24|t[n+1]<<16|t[n+2]<<8|t[n+3]),n+=4):(r=(15&i)<<28|t[n+1]<<20|t[n+2]<<12|t[n+3]<<4|15&t[n+4],n+=5),n>t.length)throw new o.CramBufferOverrunError("Attempted to read beyond end of buffer; this file seems truncated.");return[r,n-e]},e.parseItem=function(t,e,r,n){void 0===r&&(r=0),void 0===n&&(n=0);var i=e.parse(t),o=i.offset,a=i.result;return a._endPosition=o+n,a._size=o-r,a},e.tinyMemoize=function(t,e){var r=t.prototype[e],n="_memo_".concat(e);t.prototype[e]=function(){var t=this;if(!(n in this)){var e=r.call(this);this[n]=e,Promise.resolve(e).catch((function(){delete t[n]}))}return this[n]}},e.sequenceMD5=function(t){return(0,i.default)(t.toUpperCase().replace(/[^\x21-\x7e]/g,""))}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=r(0),i=r(7),o=function(){this.F=void 0,this.C=void 0},a=function(){this.fc=new Array(256);for(var t=0;t<this.fc.length;t+=1)this.fc[t]=new o;this.R=null};function s(t,e,r,n){return r*(t>>n)+(t&(1<<n)-1)-e}var f={FC:o,AriDecoder:a,Symbol:function(){this.start=void 0,this.freq=void 0},symbolInit:function(t,e,r){if(!(e<=65536))throw new n.CramMalformedError("assertion failed: start <= 1<<16");if(!(r<=65536-e))throw new n.CramMalformedError("assertion failed: freq <= 1<<16");t.start=e,t.freq=r},advanceStep:s,advanceSymbolStep:function(t,e,r){return s(t,e.start,e.freq,r)},get:function(t,e){return t&(1<<e)-1},advanceSymbol:function(t,e,r,n){return function(t,e,r,n,o){if((t=n*(t>>o)+(t&(1<<o)-1)-r)<i.RANS_BYTE_L)do{t=t<<8|255&e.get()}while(t<i.RANS_BYTE_L);return t}(t,e,r.start,r.freq,n)},renormalize:function(t,e){if(t<i.RANS_BYTE_L)do{t=t<<8|255&e.get()}while(t<i.RANS_BYTE_L);return t}};e.default=f},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.RANS_BYTE_L=e.TOTFREQ=e.TF_SHIFT=void 0;e.TF_SHIFT=12;e.TOTFREQ=4096;e.RANS_BYTE_L=1<<23},function(t,e){t.exports=function(t){return t&&t.__esModule?t:{default:t}},t.exports.__esModule=!0,t.exports.default=t.exports},function(t,e){var r;r=function(){return this}();try{r=r||new Function("return this")()}catch(t){"object"==typeof window&&(r=window)}t.exports=r},function(t,e,r){"use strict";t.exports={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"}},function(t,e,r){"use strict";class n{constructor(t={}){if(!(t.maxSize&&t.maxSize>0))throw new TypeError("`maxSize` must be a number greater than 0");this.maxSize=t.maxSize,this.cache=new Map,this.oldCache=new Map,this._size=0}_set(t,e){this.cache.set(t,e),this._size++,this._size>=this.maxSize&&(this._size=0,this.oldCache=this.cache,this.cache=new Map)}get(t){if(this.cache.has(t))return this.cache.get(t);if(this.oldCache.has(t)){const e=this.oldCache.get(t);return this._set(t,e),e}}set(t,e){return this.cache.has(t)?this.cache.set(t,e):this._set(t,e),this}has(t){return this.cache.has(t)||this.oldCache.has(t)}peek(t){return this.cache.has(t)?this.cache.get(t):this.oldCache.has(t)?this.oldCache.get(t):void 0}delete(t){const e=this.cache.delete(t);return e&&this._size--,this.oldCache.delete(t)||e}clear(){this.cache.clear(),this.oldCache.clear(),this._size=0}*keys(){for(const[t]of this)yield t}*values(){for(const[,t]of this)yield t}*[Symbol.iterator](){for(const t of this.cache)yield t;for(const t of this.oldCache){const[e]=t;this.cache.has(e)||(yield t)}}get size(){let t=0;for(const e of this.oldCache.keys())this.cache.has(e)||t++;return this._size+t}}t.exports=n},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.default={CRAM_FLAG_PRESERVE_QUAL_SCORES:1,CRAM_FLAG_DETACHED:2,CRAM_FLAG_MATE_DOWNSTREAM:4,CRAM_FLAG_NO_SEQ:8,CRAM_FLAG_MASK:15,CRAM_M_REVERSE:1,CRAM_M_UNMAP:2,BAM_FPAIRED:1,BAM_FPROPER_PAIR:2,BAM_FUNMAP:4,BAM_FMUNMAP:8,BAM_FREVERSE:16,BAM_FMREVERSE:32,BAM_FREAD1:64,BAM_FREAD2:128,BAM_FSECONDARY:256,BAM_FQCFAIL:512,BAM_FDUP:1024,BAM_FSUPPLEMENTARY:2048,BAM_CMATCH:0,BAM_CINS:1,BAM_CDEL:2,BAM_CREF_SKIP:3,BAM_CSOFT_CLIP:4,BAM_CHARD_CLIP:5,BAM_CPAD:6,BAM_CEQUAL:7,BAM_CDIFF:8,BAM_CBACK:9,BAM_CIGAR_STR:"MIDNSHP:XB",BAM_CIGAR_SHIFT:4,BAM_CIGAR_MASK:15,BAM_CIGAR_TYPE:246183}},function(t,e){t.exports=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")},t.exports.__esModule=!0,t.exports.default=t.exports},function(t,e){function r(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}t.exports=function(t,e,n){return e&&r(t.prototype,e),n&&r(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t},t.exports.__esModule=!0,t.exports.default=t.exports},function(t,e){t.exports=function(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t},t.exports.__esModule=!0,t.exports.default=t.exports},function(t,e,r){"use strict";var n=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var i=n(r(32));e.default=i.default},function(t,e,r){"use strict";(function(t){Object.defineProperty(e,"__esModule",{value:!0}),e.unzip=void 0;var n=r(36);e.unzip=function(e){return t.from((0,n.inflate)(e))}}).call(this,r(1).Buffer)},function(t,e,r){"use strict";t.exports=function(t,e,r,n){for(var i=65535&t|0,o=t>>>16&65535|0,a=0;0!==r;){r-=a=r>2e3?2e3:r;do{o=o+(i=i+e[n++]|0)|0}while(--a);i%=65521,o%=65521}return i|o<<16|0}},function(t,e,r){"use strict";var n=function(){for(var t,e=[],r=0;r<256;r++){t=r;for(var n=0;n<8;n++)t=1&t?3988292384^t>>>1:t>>>1;e[r]=t}return e}();t.exports=function(t,e,r,i){var o=n,a=i+r;t^=-1;for(var s=i;s<a;s++)t=t>>>8^o[255&(t^e[s])];return-1^t}},function(t,e,r){"use strict";var n=r(2),i=!0,o=!0;try{String.fromCharCode.apply(null,[0])}catch(t){i=!1}try{String.fromCharCode.apply(null,new Uint8Array(1))}catch(t){o=!1}for(var a=new n.Buf8(256),s=0;s<256;s++)a[s]=s>=252?6:s>=248?5:s>=240?4:s>=224?3:s>=192?2:1;function f(t,e){if(e<65534&&(t.subarray&&o||!t.subarray&&i))return String.fromCharCode.apply(null,n.shrinkBuf(t,e));for(var r="",a=0;a<e;a++)r+=String.fromCharCode(t[a]);return r}a[254]=a[254]=1,e.string2buf=function(t){var e,r,i,o,a,s=t.length,f=0;for(o=0;o<s;o++)55296==(64512&(r=t.charCodeAt(o)))&&o+1<s&&56320==(64512&(i=t.charCodeAt(o+1)))&&(r=65536+(r-55296<<10)+(i-56320),o++),f+=r<128?1:r<2048?2:r<65536?3:4;for(e=new n.Buf8(f),a=0,o=0;a<f;o++)55296==(64512&(r=t.charCodeAt(o)))&&o+1<s&&56320==(64512&(i=t.charCodeAt(o+1)))&&(r=65536+(r-55296<<10)+(i-56320),o++),r<128?e[a++]=r:r<2048?(e[a++]=192|r>>>6,e[a++]=128|63&r):r<65536?(e[a++]=224|r>>>12,e[a++]=128|r>>>6&63,e[a++]=128|63&r):(e[a++]=240|r>>>18,e[a++]=128|r>>>12&63,e[a++]=128|r>>>6&63,e[a++]=128|63&r);return e},e.buf2binstring=function(t){return f(t,t.length)},e.binstring2buf=function(t){for(var e=new n.Buf8(t.length),r=0,i=e.length;r<i;r++)e[r]=t.charCodeAt(r);return e},e.buf2string=function(t,e){var r,n,i,o,s=e||t.length,u=new Array(2*s);for(n=0,r=0;r<s;)if((i=t[r++])<128)u[n++]=i;else if((o=a[i])>4)u[n++]=65533,r+=o-1;else{for(i&=2===o?31:3===o?15:7;o>1&&r<s;)i=i<<6|63&t[r++],o--;o>1?u[n++]=65533:i<65536?u[n++]=i:(i-=65536,u[n++]=55296|i>>10&1023,u[n++]=56320|1023&i)}return f(u,n)},e.utf8border=function(t,e){var r;for((e=e||t.length)>t.length&&(e=t.length),r=e-1;r>=0&&128==(192&t[r]);)r--;return r<0||0===r?e:r+a[t[r]]>e?r:e}},function(t,e,r){"use strict";t.exports=function(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}},function(t,e,r){"use strict";t.exports={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,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_BUF_ERROR:-5,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,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8}},function(t,e){t.exports=n;var r=null;try{r=new WebAssembly.Instance(new WebAssembly.Module(new Uint8Array([0,97,115,109,1,0,0,0,1,13,2,96,0,1,127,96,4,127,127,127,127,1,127,3,7,6,0,1,1,1,1,1,6,6,1,127,1,65,0,11,7,50,6,3,109,117,108,0,1,5,100,105,118,95,115,0,2,5,100,105,118,95,117,0,3,5,114,101,109,95,115,0,4,5,114,101,109,95,117,0,5,8,103,101,116,95,104,105,103,104,0,0,10,191,1,6,4,0,35,0,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,126,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,127,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,128,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,129,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,130,34,4,66,32,135,167,36,0,32,4,167,11])),{}).exports}catch(t){}function n(t,e,r){this.low=0|t,this.high=0|e,this.unsigned=!!r}function i(t){return!0===(t&&t.__isLong__)}n.prototype.__isLong__,Object.defineProperty(n.prototype,"__isLong__",{value:!0}),n.isLong=i;var o={},a={};function s(t,e){var r,n,i;return e?(i=0<=(t>>>=0)&&t<256)&&(n=a[t])?n:(r=u(t,(0|t)<0?-1:0,!0),i&&(a[t]=r),r):(i=-128<=(t|=0)&&t<128)&&(n=o[t])?n:(r=u(t,t<0?-1:0,!1),i&&(o[t]=r),r)}function f(t,e){if(isNaN(t))return e?m:v;if(e){if(t<0)return m;if(t>=p)return S}else{if(t<=-g)return E;if(t+1>=g)return A}return t<0?f(-t,e).neg():u(t%d|0,t/d|0,e)}function u(t,e,r){return new n(t,e,r)}n.fromInt=s,n.fromNumber=f,n.fromBits=u;var c=Math.pow;function h(t,e,r){if(0===t.length)throw Error("empty string");if("NaN"===t||"Infinity"===t||"+Infinity"===t||"-Infinity"===t)return v;if("number"==typeof e?(r=e,e=!1):e=!!e,(r=r||10)<2||36<r)throw RangeError("radix");var n;if((n=t.indexOf("-"))>0)throw Error("interior hyphen");if(0===n)return h(t.substring(1),e,r).neg();for(var i=f(c(r,8)),o=v,a=0;a<t.length;a+=8){var s=Math.min(8,t.length-a),u=parseInt(t.substring(a,a+s),r);if(s<8){var l=f(c(r,s));o=o.mul(l).add(f(u))}else o=(o=o.mul(i)).add(f(u))}return o.unsigned=e,o}function l(t,e){return"number"==typeof t?f(t,e):"string"==typeof t?h(t,e):u(t.low,t.high,"boolean"==typeof e?e:t.unsigned)}n.fromString=h,n.fromValue=l;var d=4294967296,p=d*d,g=p/2,y=s(1<<24),v=s(0);n.ZERO=v;var m=s(0,!0);n.UZERO=m;var b=s(1);n.ONE=b;var _=s(1,!0);n.UONE=_;var w=s(-1);n.NEG_ONE=w;var A=u(-1,2147483647,!1);n.MAX_VALUE=A;var S=u(-1,-1,!0);n.MAX_UNSIGNED_VALUE=S;var E=u(0,-2147483648,!1);n.MIN_VALUE=E;var C=n.prototype;C.toInt=function(){return this.unsigned?this.low>>>0:this.low},C.toNumber=function(){return this.unsigned?(this.high>>>0)*d+(this.low>>>0):this.high*d+(this.low>>>0)},C.toString=function(t){if((t=t||10)<2||36<t)throw RangeError("radix");if(this.isZero())return"0";if(this.isNegative()){if(this.eq(E)){var e=f(t),r=this.div(e),n=r.mul(e).sub(this);return r.toString(t)+n.toInt().toString(t)}return"-"+this.neg().toString(t)}for(var i=f(c(t,6),this.unsigned),o=this,a="";;){var s=o.div(i),u=(o.sub(s.mul(i)).toInt()>>>0).toString(t);if((o=s).isZero())return u+a;for(;u.length<6;)u="0"+u;a=""+u+a}},C.getHighBits=function(){return this.high},C.getHighBitsUnsigned=function(){return this.high>>>0},C.getLowBits=function(){return this.low},C.getLowBitsUnsigned=function(){return this.low>>>0},C.getNumBitsAbs=function(){if(this.isNegative())return this.eq(E)?64:this.neg().getNumBitsAbs();for(var t=0!=this.high?this.high:this.low,e=31;e>0&&0==(t&1<<e);e--);return 0!=this.high?e+33:e+1},C.isZero=function(){return 0===this.high&&0===this.low},C.eqz=C.isZero,C.isNegative=function(){return!this.unsigned&&this.high<0},C.isPositive=function(){return this.unsigned||this.high>=0},C.isOdd=function(){return 1==(1&this.low)},C.isEven=function(){return 0==(1&this.low)},C.equals=function(t){return i(t)||(t=l(t)),(this.unsigned===t.unsigned||this.high>>>31!=1||t.high>>>31!=1)&&(this.high===t.high&&this.low===t.low)},C.eq=C.equals,C.notEquals=function(t){return!this.eq(t)},C.neq=C.notEquals,C.ne=C.notEquals,C.lessThan=function(t){return this.comp(t)<0},C.lt=C.lessThan,C.lessThanOrEqual=function(t){return this.comp(t)<=0},C.lte=C.lessThanOrEqual,C.le=C.lessThanOrEqual,C.greaterThan=function(t){return this.comp(t)>0},C.gt=C.greaterThan,C.greaterThanOrEqual=function(t){return this.comp(t)>=0},C.gte=C.greaterThanOrEqual,C.ge=C.greaterThanOrEqual,C.compare=function(t){if(i(t)||(t=l(t)),this.eq(t))return 0;var e=this.isNegative(),r=t.isNegative();return e&&!r?-1:!e&&r?1:this.unsigned?t.high>>>0>this.high>>>0||t.high===this.high&&t.low>>>0>this.low>>>0?-1:1:this.sub(t).isNegative()?-1:1},C.comp=C.compare,C.negate=function(){return!this.unsigned&&this.eq(E)?E:this.not().add(b)},C.neg=C.negate,C.add=function(t){i(t)||(t=l(t));var e=this.high>>>16,r=65535&this.high,n=this.low>>>16,o=65535&this.low,a=t.high>>>16,s=65535&t.high,f=t.low>>>16,c=0,h=0,d=0,p=0;return d+=(p+=o+(65535&t.low))>>>16,h+=(d+=n+f)>>>16,c+=(h+=r+s)>>>16,c+=e+a,u((d&=65535)<<16|(p&=65535),(c&=65535)<<16|(h&=65535),this.unsigned)},C.subtract=function(t){return i(t)||(t=l(t)),this.add(t.neg())},C.sub=C.subtract,C.multiply=function(t){if(this.isZero())return v;if(i(t)||(t=l(t)),r)return u(r.mul(this.low,this.high,t.low,t.high),r.get_high(),this.unsigned);if(t.isZero())return v;if(this.eq(E))return t.isOdd()?E:v;if(t.eq(E))return this.isOdd()?E:v;if(this.isNegative())return t.isNegative()?this.neg().mul(t.neg()):this.neg().mul(t).neg();if(t.isNegative())return this.mul(t.neg()).neg();if(this.lt(y)&&t.lt(y))return f(this.toNumber()*t.toNumber(),this.unsigned);var e=this.high>>>16,n=65535&this.high,o=this.low>>>16,a=65535&this.low,s=t.high>>>16,c=65535&t.high,h=t.low>>>16,d=65535&t.low,p=0,g=0,m=0,b=0;return m+=(b+=a*d)>>>16,g+=(m+=o*d)>>>16,m&=65535,g+=(m+=a*h)>>>16,p+=(g+=n*d)>>>16,g&=65535,p+=(g+=o*h)>>>16,g&=65535,p+=(g+=a*c)>>>16,p+=e*d+n*h+o*c+a*s,u((m&=65535)<<16|(b&=65535),(p&=65535)<<16|(g&=65535),this.unsigned)},C.mul=C.multiply,C.divide=function(t){if(i(t)||(t=l(t)),t.isZero())throw Error("division by zero");var e,n,o;if(r)return this.unsigned||-2147483648!==this.high||-1!==t.low||-1!==t.high?u((this.unsigned?r.div_u:r.div_s)(this.low,this.high,t.low,t.high),r.get_high(),this.unsigned):this;if(this.isZero())return this.unsigned?m:v;if(this.unsigned){if(t.unsigned||(t=t.toUnsigned()),t.gt(this))return m;if(t.gt(this.shru(1)))return _;o=m}else{if(this.eq(E))return t.eq(b)||t.eq(w)?E:t.eq(E)?b:(e=this.shr(1).div(t).shl(1)).eq(v)?t.isNegative()?b:w:(n=this.sub(t.mul(e)),o=e.add(n.div(t)));if(t.eq(E))return this.unsigned?m:v;if(this.isNegative())return t.isNegative()?this.neg().div(t.neg()):this.neg().div(t).neg();if(t.isNegative())return this.div(t.neg()).neg();o=v}for(n=this;n.gte(t);){e=Math.max(1,Math.floor(n.toNumber()/t.toNumber()));for(var a=Math.ceil(Math.log(e)/Math.LN2),s=a<=48?1:c(2,a-48),h=f(e),d=h.mul(t);d.isNegative()||d.gt(n);)d=(h=f(e-=s,this.unsigned)).mul(t);h.isZero()&&(h=b),o=o.add(h),n=n.sub(d)}return o},C.div=C.divide,C.modulo=function(t){return i(t)||(t=l(t)),r?u((this.unsigned?r.rem_u:r.rem_s)(this.low,this.high,t.low,t.high),r.get_high(),this.unsigned):this.sub(this.div(t).mul(t))},C.mod=C.modulo,C.rem=C.modulo,C.not=function(){return u(~this.low,~this.high,this.unsigned)},C.and=function(t){return i(t)||(t=l(t)),u(this.low&t.low,this.high&t.high,this.unsigned)},C.or=function(t){return i(t)||(t=l(t)),u(this.low|t.low,this.high|t.high,this.unsigned)},C.xor=function(t){return i(t)||(t=l(t)),u(this.low^t.low,this.high^t.high,this.unsigned)},C.shiftLeft=function(t){return i(t)&&(t=t.toInt()),0==(t&=63)?this:t<32?u(this.low<<t,this.high<<t|this.low>>>32-t,this.unsigned):u(0,this.low<<t-32,this.unsigned)},C.shl=C.shiftLeft,C.shiftRight=function(t){return i(t)&&(t=t.toInt()),0==(t&=63)?this:t<32?u(this.low>>>t|this.high<<32-t,this.high>>t,this.unsigned):u(this.high>>t-32,this.high>=0?0:-1,this.unsigned)},C.shr=C.shiftRight,C.shiftRightUnsigned=function(t){if(i(t)&&(t=t.toInt()),0===(t&=63))return this;var e=this.high;return t<32?u(this.low>>>t|e<<32-t,e>>>t,this.unsigned):u(32===t?e:e>>>t-32,0,this.unsigned)},C.shru=C.shiftRightUnsigned,C.shr_u=C.shiftRightUnsigned,C.toSigned=function(){return this.unsigned?u(this.low,this.high,!1):this},C.toUnsigned=function(){return this.unsigned?this:u(this.low,this.high,!0)},C.toBytes=function(t){return t?this.toBytesLE():this.toBytesBE()},C.toBytesLE=function(){var t=this.high,e=this.low;return[255&e,e>>>8&255,e>>>16&255,e>>>24,255&t,t>>>8&255,t>>>16&255,t>>>24]},C.toBytesBE=function(){var t=this.high,e=this.low;return[t>>>24,t>>>16&255,t>>>8&255,255&t,e>>>24,e>>>16&255,e>>>8&255,255&e]},n.fromBytes=function(t,e,r){return r?n.fromBytesLE(t,e):n.fromBytesBE(t,e)},n.fromBytesLE=function(t,e){return new n(t[0]|t[1]<<8|t[2]<<16|t[3]<<24,t[4]|t[5]<<8|t[6]<<16|t[7]<<24,e)},n.fromBytesBE=function(t,e){return new n(t[4]<<24|t[5]<<16|t[6]<<8|t[7],t[0]<<24|t[1]<<16|t[2]<<8|t[3],e)}},function(t,e,r){(function(e){const n=r(4);function i(t,e){return t&(1<<e)-1}function o(t,e){for(var r=0;e>=t[r+1];)r++;return r}function a(t,e){for(var r=1<<e,n=new Array(r),i=0,o=0;o<r;o++){for(;o>=t[i+1];)i++;n[o]=i}return n}function s(t,e,r,n){return r*(t>>n)+(t&(1<<n)-1)-e}function f(t,e){return e<32768&&(e=(e<<16)+t.ReadUint16()),e}function u(t,e){e.WriteByteNeg(t>>24&255),e.WriteByteNeg(t>>16&255),e.WriteByteNeg(t>>8&255),e.WriteByteNeg(t>>0&255)}function c(t,e,r,n,i){return t=function(t,e,r,n){for(var i=(1<<31-n)*r;t>=i;)e.WriteByteNeg(t>>8&255),e.WriteByteNeg(255&t),t>>=16;return t}(t,e,n,i),t=(Math.floor(t/n)<<i)+t%n+r}function h(t,e,r){0==r&&(r=4);for(var i=new Array(r),o=new Array(r),a=0;a<r;a++)o[a]=Math.floor(e.length/r)+(e.length%r>a),i[a]=new Array(o[a]);for(var s=0,f=0;f<e.length;f+=r,s++)for(var u=0;u<r;u++)s<i[u].length&&(i[u][s]=e[f+u]);var c=new Array(r),h=0;for(a=0;a<r;a++){var l=d(i[a],0),p=d(i[a],1);c[a]=p.length<l.length?p:l,h+=c[a].length}var g=new n("",0,h+5*r+1);g.WriteByte(r);for(a=0;a<r;a++)g.WriteUint7(c[a].length);for(a=0;a<r;a++)g.WriteData(c[a],c[a].length);return g.buf.slice(0,g.buf.pos)}function l(t,r){var u=t.ReadByte(),c=1&u,h=8&u,d=32&u,y=64&u,m=128&u;if(16&u||(r=t.ReadUint7()),h)return function(t,r){for(var n=t.ReadByte(),i=new Array(n),o=new Array(n),a=0;a<n;a++)i[a]=t.ReadUint7();var s=new Array(n);for(a=0;a<n;a++)o[a]=Math.floor(r/n)+(r%n>a),s[a]=l(t,o[a]);var f=new e.allocUnsafe(r);for(a=0;a<n;a++)for(var u=0;u<o[a];u++)f[u*n+a]=s[a][u];return f}(t,r);if(m)var b=r,[_,w,r]=function(t){for(var e=t.ReadByte(),r=new Array(e),n=0;n<e;n++)r[n]=t.ReadByte();return[r,e,t.ReadUint7()]}(t);if(y)var A=r,[S,E,r]=function(t){var e=t.ReadUint7(),r=t.ReadUint7();if(1&e)var i=t.ReadData((e-1)/2);else{var o=t.ReadUint7();i=t.ReadData(o);i=g(new n(i),e/2)}i=new n(i);var a=new Array(256),s=i.ReadByte();0==s&&(s=256);for(var f=0;f<s;f++)a[i.ReadByte()]=1;return[a,i,r]}(t);if(d)var C=t.ReadData(r);else if(0==c)C=g(t,r);else C=function(t,r){var u=(d=t.ReadByte())>>4,c=t;if(1&d){var h=t.ReadUint7(),l=t.ReadUint7(),d=new n(t.ReadData(l));c=new n(g(d,h))}var y=new Array(256),m=new Array(256);!function(t,e,r,n){for(var i=0;i<256;i++){e[i]=new Array(256),r[i]=new Array(256);for(var o=0;o<256;o++)e[i][o]=0}var a=p(t);for(i=0;i<256;i++)if(a[i]){var s=0;for(o=0;o<256;o++)a[o]&&(s>0?s--:(e[i][o]=t.ReadUint7(),0==e[i][o]&&(s=t.ReadByte())));v(e[i],n),r[i][0]=0;for(o=0;o<256;o++)r[i][o+1]=r[i][o]+e[i][o]}}(c,y,m,u);for(var b=new Array(256),_=0;_<256;_++)b[_]=a(m[_],u);for(var w=new Array(4),A=new Array(4),S=0;S<4;S++)w[S]=t.ReadUint32(),A[S]=0;var E=new e.allocUnsafe(r),C=Math.floor(r/4);for(_=0;_<C;_++)for(S=0;S<4;S++){var B=i(w[S],u),k=b[A[S]][B];E[_+S*C]=k,w[S]=s(w[S],m[A[S]][k],y[A[S]][k],u),w[S]=f(t,w[S]),A[S]=k}_*=4;for(;_<r;){B=i(w[3],u),k=o(m[A[3]],B);E[_++]=k,w[3]=s(w[3],m[A[3]][k],y[A[3]][k],u),w[3]=f(t,w[3]),A[3]=k}return E}(t,r);return y&&(C=function(t,r,i,o){new n(t);for(var a=new e.allocUnsafe(o),s=0,f=0;s<o;f++){var u=t[f];if(r[u])for(var c=i.ReadUint7(),h=0;h<=c;h++)a[s++]=u;else a[s++]=u}return a}(C,S,E,A)),m&&(C=function(t,r,n,i){var o=new e.allocUnsafe(i),a=0;if(n<=1)for(var s=0;s<i;s++)o[s]=r[0];else if(n<=2)for(s=0;s<i;s++){if(s%8==0)var f=t[a++];o[s]=r[1&f],f>>=1}else if(n<=4)for(s=0;s<i;s++){if(s%4==0)f=t[a++];o[s]=r[3&f],f>>=2}else if(n<=16)for(s=0;s<i;s++){if(s%2==0)f=t[a++];o[s]=r[15&f],f>>=4}return o}(C,_,w,b)),C}function d(t,r){var i=new n("",0,10);i.WriteByte(r);var o=1&r,a=8&r,s=32&r,f=64&r,l=128&r,d=r>>8;if(16&r||i.WriteUint7(t.length),a)return e.concat([i.buf.slice(0,i.pos),h(0,t,d)]);var p=new e.alloc(0);l&&([p,t]=function(t){for(var r=new Array(256),i=0;i<256;i++)r[i]=0;for(i=0;i<t.length;i++)r[t[i]]++;var o=new Array(256),a=0;for(i=0;i<256;i++)r[i]>0&&(o[i]=a++);if(!(a>16)){if(a<=1)var s=new e.allocUnsafe(0);else if(a<=2){s=new e.allocUnsafe(Math.ceil(t.length/8));var f=-1;for(i=0;i<t.length;i++)i%8==0&&(s[++f]=0),s[f]+=o[t[i]]<<i%8}else if(a<=4){s=new e.allocUnsafe(Math.ceil(t.length/4)),f=-1;for(i=0;i<t.length;i++)i%4==0&&(s[++f]=0),s[f]+=o[t[i]]<<i%4*2}else{s=new e.allocUnsafe(Math.ceil(t.length/2)),f=-1;for(i=0;i<t.length;i++)i%2==0&&(s[++f]=0),s[f]+=o[t[i]]<<i%2*4}var u=new n("",0,a+5);u.WriteByte(a);for(f=0,i=0;i<256;i++)r[i]>0&&(r[i]=f++,u.WriteByte(i));return u.WriteUint7(s.length),[u.buf.slice(0,u.pos),s]}}(t));var g=new e.alloc(0);if(f&&([g,t]=function(t){for(var r=new Array(256),i=0;i<256;i++)r[i]=0;var o=-1;for(i=0;i<t.length;i++)r[t[i]]+=t[i]==o?1:-1,o=t[i];var a=0;for(i=0;i<256;i++)r[i]>0&&a++;for(a||(a=1,r[0]=1),(c=new n("",0,a+1+t.length)).WriteByte(a),i=0;i<256;i++)r[i]>0&&c.WriteByte(i);var s=new e.allocUnsafe(t.length),f=0;for(i=0;i<t.length;i++)if(s[f++]=t[i],r[t[i]]>0){o=t[i];for(var u=0;i+u+1<t.length&&t[i+u+1]==o;)u++;c.WriteUint7(u),i+=u}var c,h=b(c.buf.slice(0,c.pos)),l=new n("",0,16);return l.WriteUint7(2*c.pos),l.WriteUint7(f),l.WriteUint7(h.length),[c=e.concat([l.buf.slice(0,l.pos),h]),s.slice(0,f)]}(t)),t.length<4&&1==o&&(o=0,i.buf[0]&=-2),s)var _=t;else if(0==o)_=b(t);else _=function(t){const r=t.length;for(var i=new n("",0,198156),o=new Array(256),a=new Array(256),s=new Array(256),f=0;f<256;f++)a[f]=new Array(256),s[f]=new Array(256);(function(t,e,r){for(var n=0;n<256;n++){r[n]=0;for(var i=0;i<256;i++)e[n][i]=0}var o=0;for(n=0;n<t.length;n++)r[o]++,e[o][t[n]]++,o=t[n];r[o]++,e[0][t[1*(t.length>>2)]]++,e[0][t[2*(t.length>>2)]]++,e[0][t[3*(t.length>>2)]]++,r[0]+=3})(t,a,o),function(t,e,r){for(var n=0;n<256;n++)if(e[n]){var i=Math.ceil(Math.log2(e[n]));i>r&&(i=r),y(t[n],i)}}(a,o,12);var h=new n("",0,198156);!function(t,e,r){m(t,r);for(var n=0;n<256;n++)if(r[n])for(var i=0,o=0;o<256;o++)if(r[o])if(i)i--;else if(t.WriteUint7(e[n][o]),!e[n][o]){for(var a=o+1;a<256;a++)if(r[a]){if(0!=e[n][a])break;i++}t.WriteByte(i)}}(h,a,o);var l=b(h.buf.slice(0,h.pos));l.length<h.pos?(i.WriteByte(193),i.WriteUint7(h.pos),i.WriteUint7(l.length),i.WriteData(l,l.length)):(i.WriteByte(192),i.WriteData(h.buf,h.pos));!function(t,e,r){for(var n=0;n<256;n++)e[n]&&v(t[n],r)}(a,o,12);for(f=0;f<256;f++)if(o[f]){s[f][0]=0;for(var d=1;d<256;d++)s[f][d]=s[f][d-1]+a[f][d-1]}var p=new Array(4),g=new Array(4);for(d=0;d<4;d++)p[d]=32768,g[d]=0;var _=new n("",1.05*r+100>>0,1.05*r+100>>0),w=Math.floor(r/4),A=new Array(4),S=new Array(4);for(d=0;d<4;d++)A[d]=(d+1)*w-2,S[d]=t[A[d]+1];S[3]=t[r-1];for(f=r-2;f>4*w-2;f--)p[3]=c(p[3],_,s[t[f]][S[3]],a[t[f]][S[3]],12),S[3]=t[f];for(;A[0]>=0;)for(d=3;d>=0;d--){var E=t[A[d]];p[d]=c(p[d],_,s[E][S[d]],a[E][S[d]],12),S[d]=E,A[d]--}for(d=3;d>=0;d--)p[d]=c(p[d],_,s[0][S[d]],a[0][S[d]],12);for(f=3;f>=0;f--)u(p[f],_);return e.concat([i.buf.slice(0,i.pos),_.buf.slice(_.pos,_.length)],i.pos+_.length-_.pos)}(t);return e.concat([i.buf.slice(0,i.pos),p,g,_])}function p(t){for(var e=new Array(256),r=0;r<256;r++)e[r]=0;var n=0,i=t.ReadByte(),o=i;do{e[i]=1,n>0?(n--,i++):(i=t.ReadByte())==o+1&&(n=t.ReadByte()),o=i}while(0!=i);return e}function g(t,r){var n=new Array(256),o=new Array(256);!function(t,e,r){for(var n=0;n<256;n++)e[n]=0;var i=p(t);for(n=0;n<256;n++)i[n]>0&&(e[n]=t.ReadUint7());for(v(e,12),r[0]=0,n=0;n<=255;n++)r[n+1]=r[n]+e[n]}(t,n,o);for(var u=a(o,12),c=new Array(4),h=0;h<4;h++)c[h]=t.ReadUint32();var l=new e.allocUnsafe(r);for(h=0;h<r;h++){var d=h%4,g=u[i(c[d],12)];l[h]=g,c[d]=s(c[d],o[g],n[g],12),c[d]=f(t,c[d])}return l}function y(t,e){for(var r=0,n=0;n<256;n++)r+=t[n];const i=1<<e;var o=i/r;do{var a=0,s=0,f=0;r=0;for(n=0;n<256;n++)0!=t[n]&&(a<t[n]&&(a=t[n],s=n),t[n]=Math.floor(t[n]*o),0==t[n]&&(t[n]=1),r+=t[n]);r<i?t[s]+=i-r:r-i<t[s]/2&&t[s]>2?t[s]-=r-i:r!=i&&(o=i/r,f=1)}while(f)}function v(t,e){for(var r=0,n=0;n<256;n++)r+=t[n];if(0!=r&&r!=1<<e){for(var i=0;r<1<<e;)r*=2,i++;for(n=0;n<256;n++)t[n]<<=i}}function m(t,e){for(var r=0,n=0;n<256;n++)if(e[n])if(r>0)r--;else if(t.WriteByte(n),n>0&&e[n-1]>0){for(r=n+1;r<256&&e[r];r++);r-=n+1,t.WriteByte(r)}t.WriteByte(0)}function b(t){const r=t.length;var i=new n("",0,780),o=new Array(256);!function(t,e){for(var r=0;r<256;r++)e[r]=0;for(r=0;r<t.length;r++)e[t[r]]++}(t,o);var a=Math.ceil(Math.log2(r));a>12&&(a=12),y(o,a),function(t,e){m(t,e);for(var r=0;r<256;r++)e[r]&&t.WriteUint7(e[r])}(i,o),y(o,12);var s=new Array(256);s[0]=0;for(var f=1;f<256;f++)s[f]=s[f-1]+o[f-1];var h=new Array(4);for(f=0;f<4;f++)h[f]=32768;var l=new n("",1.05*r+100>>0,1.05*r+100>>0);for(f=r-1;f>=0;f--)h[f%4]=c(h[f%4],l,s[t[f]],o[t[f]],12);for(f=3;f>=0;f--)u(h[f],l);return e.concat([i.buf.slice(0,i.pos),l.buf.slice(l.pos,l.length)],i.pos+l.length-l.pos)}t.exports={decode:function(t){return l(new n(t),0)},encode:d}}).call(this,r(1).Buffer)},function(t,e,r){(function(e){const n=r(26),i=r(4),o=r(27),a=r(56);t.exports=class{decode(t){return this.stream=new i(t),this.decodeStream(this.stream)}decodeStream(t,e=0){var r=this.stream.ReadByte();16&r||(e=this.stream.ReadUint7());var n,i=e,o=1&r;if(8&r)return this.decodeStripe(this.stream,e);128&r&&([n,i]=this.decodePackMeta(this.stream));if(32&r)var a=this.decodeCat(this.stream,i);else if(4&r)a=this.decodeExt(this.stream,i);else if(64&r)a=o?this.decodeRLE1(this.stream,i):this.decodeRLE0(this.stream,i);else a=o?this.decode1(this.stream,i):this.decode0(this.stream,i);return 128&r&&(a=this.decodePack(a,n,e)),a}encode(t,r){if(this.stream=new i("",0,1.1*t.length+100),this.stream.WriteByte(r),16&r||this.stream.WriteUint7(t.length),8&r)return e.concat([this.stream.buf.slice(0,this.stream.pos),this.encodeStripe(this.stream,t,r>>8)]);var n,o=1&r,a=t.length;return 128&r&&([n,t,a]=this.encodePack(t)),128&r&&this.stream.WriteStream(n),64&r?o?this.encodeRLE1(t,a,this.stream):this.encodeRLE0(t,a,this.stream):o?this.encode1(t,a,this.stream):this.encode0(t,a,this.stream)}decode0(t,r){var i=new e.allocUnsafe(r),a=t.ReadByte();0==a&&(a=256);var s=new o(a),f=new n(t);f.RangeStartDecode(t);for(var u=0;u<r;u++)i[u]=s.ModelDecode(t,f);return i}encode0(t,e,r){for(var i=0,a=0;a<e;a++)i<t[a]&&(i=t[a]);i++;var s=new o(i);r.WriteByte(i);var f=new n(r);for(a=0;a<e;a++)s.ModelEncode(r,f,t[a]);return f.RangeFinishEncode(r),r.buf.slice(0,r.pos)}decode1(t,r){var i=new e.allocUnsafe(r),a=t.ReadByte();0==a&&(a=256);for(var s=new Array(a),f=0;f<a;f++)s[f]=new o(a);var u=new n(t);u.RangeStartDecode(t);var c=0;for(f=0;f<r;f++)i[f]=s[c].ModelDecode(t,u),c=i[f];return i}encode1(t,e,r){for(var i=0,a=0;a<e;a++)i<t[a]&&(i=t[a]);i++;var s=new Array(i);for(a=0;a<i;a++)s[a]=new o(i);r.WriteByte(i);var f=new n(r),u=0;for(a=0;a<e;a++)s[u].ModelEncode(r,f,t[a]),u=t[a];return f.RangeFinishEncode(r),r.buf.slice(0,r.pos)}decodeExt(t,r){var n=new e.allocUnsafe(r),i=a.array(t.buf.slice(t.pos)),o=a.header(i),s=0;do{var f=a.decompress(i,o);-1!=f&&(e.from(f).copy(n,s),s+=f.length,o-=f.length)}while(-1!=f);return n}encodeExt(t,e){}decodeRLE0(t,r){var i=new e.allocUnsafe(r),a=t.ReadByte();0==a&&(a=256);for(var s=new o(a),f=new Array(258),u=0;u<=257;u++)f[u]=new o(4);var c=new n(t);c.RangeStartDecode(t);for(u=0;u<r;){i[u]=s.ModelDecode(t,c);for(var h=f[i[u]].ModelDecode(t,c),l=h,d=256;3==h;)h=f[d].ModelDecode(t,c),d=257,l+=h;for(var p=1;p<=l;p++)i[u+p]=i[u];u+=l+1}return i}encodeRLE0(t,e,r){for(var i=0,a=0;a<e;a++)i<t[a]&&(i=t[a]);i++;var s=new o(i),f=new Array(258);for(a=0;a<=257;a++)f[a]=new o(4);r.WriteByte(i);var u=new n(r);for(a=0;a<e;){s.ModelEncode(r,u,t[a]);for(var c=1;a+c<e&&t[a+c]==t[a];)c++;c--;var h=t[a];t[a];a+=c+1;var l=c>=3?3:c;for(f[h].ModelEncode(r,u,l),c-=l,h=256;3==l;)l=c>=3?3:c,f[h].ModelEncode(r,u,l),h=257,c-=l}return u.RangeFinishEncode(r),r.buf.slice(0,r.pos)}decodeRLE1(t,r){var i=new e.allocUnsafe(r),a=t.ReadByte();0==a&&(a=256);for(var s=new Array(a),f=0;f<a;f++)s[f]=new o(a);var u=new Array(258);for(f=0;f<=257;f++)u[f]=new o(4);var c=new n(t);c.RangeStartDecode(t);var h=0;for(f=0;f<r;){i[f]=s[h].ModelDecode(t,c),h=i[f];for(var l=u[i[f]].ModelDecode(t,c),d=l,p=256;3==l;)l=u[p].ModelDecode(t,c),p=257,d+=l;for(var g=1;g<=d;g++)i[f+g]=i[f];f+=d+1}return i}encodeRLE1(t,e,r){for(var i=0,a=0;a<e;a++)i<t[a]&&(i=t[a]);i++;var s=new Array(i);for(a=0;a<i;a++)s[a]=new o(i);var f=new Array(258);for(a=0;a<=257;a++)f[a]=new o(4);r.WriteByte(i);for(var u=new n(r),c=(a=0,0);a<e;){s[c].ModelEncode(r,u,t[a]);for(var h=1;a+h<e&&t[a+h]==t[a];)h++;h--;var l=t[a];c=t[a],a+=h+1;var d=h>=3?3:h;for(f[l].ModelEncode(r,u,d),h-=d,l=256;3==d;)d=h>=3?3:h,f[l].ModelEncode(r,u,d),l=257,h-=d}return u.RangeFinishEncode(r),r.buf.slice(0,r.pos)}decodePackMeta(t){this.nsym=t.ReadByte();for(var e=new Array(this.nsym),r=0;r<this.nsym;r++)e[r]=t.ReadByte();return[e,t.ReadUint7()]}decodePack(t,r,n){var i=new e.allocUnsafe(n);if(this.nsym<=1)for(var o=0;o<n;o++)i[o]=r[0];else if(this.nsym<=2){o=0;for(var a=0;o<n;o++){if(o%8==0)var s=t[a++];i[o]=r[1&s],s>>=1}}else if(this.nsym<=4)for(o=0,a=0;o<n;o++){if(o%4==0)s=t[a++];i[o]=r[3&s],s>>=2}else{if(!(this.nsym<=16))return t;for(o=0,a=0;o<n;o++){if(o%2==0)s=t[a++];i[o]=r[15&s],s>>=4}}return i}packMeta(t){for(var e=new i("",0,1024),r=new Array(256),n=0;n<t.length;n++)r[t[n]]=1;var o=0;for(n=0;n<256;n++)r[n]&&(r[n]=++o);e.WriteByte(o);for(n=0;n<256;n++)r[n]&&(e.WriteByte(n),r[n]--);return[e,r,o]}encodePack(t){var r,n,i;[r,n,i]=this.packMeta(t);var o=t.length,a=0;if(i<=1)return r.WriteUint7(0),[r,new e.allocUnsafe(0),0];if(i<=2){for(var s=new e.allocUnsafe(Math.floor((o+7)/8)),f=(a=0,0);a<(-8&o);a+=8,f++)s[f]=(n[t[a+0]]<<0)+(n[t[a+1]]<<1)+(n[t[a+2]]<<2)+(n[t[a+3]]<<3)+(n[t[a+4]]<<4)+(n[t[a+5]]<<5)+(n[t[a+6]]<<6)+(n[t[a+7]]<<7);if(a<o){s[f]=0;for(var u=0;a<o;)s[f]|=n[t[a++]]<<u,u++;f++}return r.WriteUint7(f),[r,s,s.length]}if(i<=4){for(s=new e.allocUnsafe(Math.floor((o+3)/4)),a=0,f=0;a<(-4&o);a+=4,f++)s[f]=(n[t[a+0]]<<0)+(n[t[a+1]]<<2)+(n[t[a+2]]<<4)+(n[t[a+3]]<<6);if(a<o){s[f]=0;for(u=0;a<o;)s[f]|=n[t[a++]]<<u,u+=2;f++}return r.WriteUint7(f),[r,s,s.length]}if(i<=16){for(s=new e.allocUnsafe(Math.floor((o+1)/2)),a=0,f=0;a<(-2&o);a+=2,f++)s[f]=(n[t[a+0]]<<0)+(n[t[a+1]]<<4);return a<o&&(s[f++]=n[t[a++]]),r.WriteUint7(f),[r,s,s.length]}return r.WriteUint7(t.length),[r,t,t.length]}encodeStripe(t,e,r){0==r&&(r=4);for(var n=new Array(r),o=new Array(r),a=0;a<r;a++)o[a]=Math.floor(e.length/r)+(e.length%r>a),n[a]=new Array(o[a]);for(var s=0,f=0;f<e.length;f+=r,s++)for(var u=0;u<r;u++)s<n[u].length&&(n[u][s]=e[f+u]);var c=new Array(r),h=0;for(a=0;a<r;a++){var l=this.encode(n[a],0),d=this.encode(n[a],1);c[a]=d.length<l.length?d:l,h+=c[a].length}var p=new i("",0,h+5*r+1);p.WriteByte(r);for(a=0;a<r;a++)p.WriteUint7(c[a].length);for(a=0;a<r;a++)p.WriteData(c[a],c[a].length);return p.buf.slice(0,p.buf.pos)}decodeStripe(t,r){for(var n=t.ReadByte(),i=new Array(n),o=new Array(n),a=0;a<n;a++)i[a]=t.ReadUint7();var s=new Array(n);for(a=0;a<n;a++)o[a]=Math.floor(r/n)+(r%n>a),s[a]=this.decodeStream(t,o[a]);var f=new e.allocUnsafe(r);for(a=0;a<n;a++)for(var u=0;u<o[a];u++)f[u*n+a]=s[a][u];return f}decodeCat(t,r){for(var n=new e.allocUnsafe(r),i=0;i<r;i++)n[i]=t.ReadByte();return n}}}).call(this,r(1).Buffer)},function(t,e){t.exports=class{constructor(t){this.low=0,this.range=4294967295,this.code=0,this.FFnum=0,this.carry=0,this.cache=0}RangeStartDecode(t){for(var e=0;e<5;e++)this.code=(this.code<<8)+t.ReadByte();this.code&=4294967295,this.code>>>=0}RangeGetFrequency(t){return this.range=Math.floor(this.range/t),Math.floor(this.code/this.range)}RangeDecode(t,e,r,n){for(this.code-=e*this.range,this.range*=r;this.range<1<<24;)this.range*=256,this.code=256*this.code+t.ReadByte()}RangeShiftLow(t){if(this.low<4278190080|this.carry){for(t.WriteByte(this.cache+this.carry);this.FFnum;)t.WriteByte(this.carry-1),this.FFnum--;this.cache=this.low>>>24,this.carry=0}else this.FFnum++;this.low<<=8,this.low>>>=0}RangeEncode(t,e,r,n){var i=this.low;for(this.range=Math.floor(this.range/n),this.low+=e*this.range,this.low>>>=0,this.range*=r,this.low<i&&(0!=this.carry&&console.log("ERROR: Multiple carry"),this.carry=1);this.range<1<<24;)this.range*=256,this.RangeShiftLow(t)}RangeFinishEncode(t){for(var e=0;e<5;e++)this.RangeShiftLow(t)}}},function(t,e){t.exports=class{constructor(t=256){this.total_freq=t,this.max_sym=t-1,this.S=new Array,this.F=new Array;for(var e=0;e<=this.max_sym;e++)this.S[e]=e,this.F[e]=1}ModelDecode(t,e){for(var r=e.RangeGetFrequency(this.total_freq),n=0,i=0;n+this.F[i]<=r;)n+=this.F[i++];e.RangeDecode(t,n,this.F[i],this.total_freq),this.F[i]+=16,this.total_freq+=16,this.total_freq>65519&&this.ModelRenormalise();var o=this.S[i];if(i>0&&this.F[i]>this.F[i-1]){var a=this.F[i];this.F[i]=this.F[i-1],this.F[i-1]=a,a=this.S[i],this.S[i]=this.S[i-1],this.S[i-1]=a}return o}ModelRenormalise(){this.total_freq=0;for(var t=0;t<=this.max_sym;t++)this.F[t]-=Math.floor(this.F[t]/2),this.total_freq+=this.F[t]}ModelEncode(t,e,r){for(var n=0,i=0;this.S[i]!=r;i++)n+=this.F[i];e.RangeEncode(t,n,this.F[i],this.total_freq),this.F[i]+=16,this.total_freq+=16,this.total_freq>65519&&this.ModelRenormalise();r=this.S[i];if(i>0&&this.F[i]>this.F[i-1]){var o=this.F[i];this.F[i]=this.F[i-1],this.F[i-1]=o,o=this.S[i],this.S[i]=this.S[i-1],this.S[i-1]=o}}}},function(t,e){var r={utf8:{stringToBytes:function(t){return r.bin.stringToBytes(unescape(encodeURIComponent(t)))},bytesToString:function(t){return decodeURIComponent(escape(r.bin.bytesToString(t)))}},bin:{stringToBytes:function(t){for(var e=[],r=0;r<t.length;r++)e.push(255&t.charCodeAt(r));return e},bytesToString:function(t){for(var e=[],r=0;r<t.length;r++)e.push(String.fromCharCode(t[r]));return e.join("")}}};t.exports=r},function(t,e,r){"use strict";var n=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.open=e.fromUrl=e.RemoteFile=e.LocalFile=void 0;var i=n(r(76)),o=n(r(83));e.RemoteFile=o.default;var a=n(r(86));function s(t){var e=i.default.parse(t),r=e.protocol,n=e.pathname;return"file:"===r?new a.default(unescape(n)):new o.default(t)}e.LocalFile=a.default,e.fromUrl=s,e.open=function(t,e,r){if(r)return r;if(t)return s(t);if(e)return new a.default(e);throw new Error("no url, path, or filehandle provided, cannot open")}},function(t,e,r){"use strict";(function(t){Object.defineProperty(e,"__esModule",{value:!0}),e.AbortSignal=e.AbortController=void 0;var n=r(93),i=function(){if("undefined"!=typeof self)return self;if("undefined"!=typeof window)return window;if(void 0!==t)return t;throw new Error("unable to locate global object")},o=void 0===i().AbortController?n.AbortController:i().AbortController;e.AbortController=o;var a=void 0===i().AbortController?n.AbortSignal:i().AbortSignal;e.AbortSignal=a}).call(this,r(9))},function(t,e,r){"use strict";var n=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.CraiIndex=e.IndexedCramFile=e.CramFile=void 0;var i=n(r(16));e.CramFile=i.default;var o=n(r(88));e.IndexedCramFile=o.default;var a=n(r(89));e.CraiIndex=a.default},function(t,e,r){"use strict";(function(t){var n=this&&this.__awaiter||function(t,e,r,n){return new(r||(r=Promise))((function(i,o){function a(t){try{f(n.next(t))}catch(t){o(t)}}function s(t){try{f(n.throw(t))}catch(t){o(t)}}function f(t){var e;t.done?i(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(a,s)}f((n=n.apply(t,e||[])).next())}))},i=this&&this.__generator||function(t,e){var r,n,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(r)throw new TypeError("Generator is already executing.");for(;a;)try{if(r=1,n&&(i=2&o[0]?n.return:o[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,o[1])).done)return i;switch(n=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,n=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!(i=a.trys,(i=i.length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){a.label=o[1];break}if(6===o[0]&&a.label<i[1]){a.label=i[1],i=o;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(o);break}i[2]&&a.ops.pop(),a.trys.pop();continue}o=e.call(t,a)}catch(t){o=[6,t],n=0}finally{r=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,s])}}},o=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var a=r(17),s=o(r(45)),f=o(r(11)),u=r(0),c=o(r(46)),h=r(50),l=o(r(54)),d=o(r(60)),p=r(29),g=r(5),y=r(87);var v=function(){function e(t){if(this.file=(0,p.open)(t.url,t.path,t.filehandle),this.validateChecksums=!0,this.fetchReferenceSequenceCallback=t.seqFetch,this.options={checkSequenceMD5:!1!==t.checkSequenceMD5,cacheSize:void 0!==t.cacheSize?t.cacheSize:2e4},this.featureCache=new f.default({maxSize:this.options.cacheSize}),e=new Uint32Array([287454020]),(68===(r=new Uint8Array(e.buffer))[0]?0:17===r[0]?1:2)>0)throw new Error("Detected big-endian machine, may be unable to run");var e,r}return e.prototype.toString=function(){return this.file.filename?this.file.filename:this.file.url?this.file.url:"(cram file)"},e.prototype.read=function(t,e,r,n){return this.file.read(t,e,r,n)},e.prototype.stat=function(){return this.file.stat()},e.prototype.getDefinition=function(){return n(this,void 0,void 0,(function(){var e,r;return i(this,(function(n){switch(n.label){case 0:return e=t.allocUnsafe(h.cramFileDefinition.maxLength),[4,this.file.read(e,0,h.cramFileDefinition.maxLength,0)];case 1:if(n.sent(),2!==(r=h.cramFileDefinition.parser.parse(e).result).majorVersion&&3!==r.majorVersion)throw new u.CramUnimplementedError("CRAM version ".concat(r.majorVersion," not supported"));return[2,r]}}))}))},e.prototype.getSamHeader=function(){return n(this,void 0,void 0,(function(){var t,e,r,n;return i(this,(function(i){switch(i.label){case 0:return[4,this.getContainerById(0)];case 1:if(!(t=i.sent()))throw new u.CramMalformedError("file contains no containers");return[4,t.getFirstBlock()];case 2:return e=i.sent().content,r=e.readInt32LE(0),4,n=e.toString("utf8",4,4+r),this.header=n,[2,(0,y.parseHeaderText)(n)]}}))}))},e.prototype.getHeaderText=function(){return n(this,void 0,void 0,(function(){return i(this,(function(t){switch(t.label){case 0:return[4,this.getSamHeader()];case 1:return t.sent(),[2,this.header]}}))}))},e.prototype.getSectionParsers=function(){return n(this,void 0,void 0,(function(){var t;return i(this,(function(e){switch(e.label){case 0:return[4,this.getDefinition()];case 1:return t=e.sent().majorVersion,[2,(0,h.getSectionParsers)(t)]}}))}))},e.prototype.getContainerById=function(t){return n(this,void 0,void 0,(function(){var e,r,n,o,a,s,f,c,h;return i(this,(function(i){switch(i.label){case 0:return[4,this.getSectionParsers()];case 1:return e=i.sent(),r=e.cramFileDefinition.maxLength,[4,this.file.stat()];case 2:n=i.sent().size,o=e.cramContainerHeader1,s=0,i.label=3;case 3:return s<=t?r+o.maxLength+8>=n?[2,void 0]:[4,(a=this.getContainerAtPosition(r)).getHeader()]:[3,11];case 4:if(!(f=i.sent()))throw new u.CramMalformedError("container ".concat(t," not found in file"));if(0!==s)return[3,9];r=f._endPosition,c=0,i.label=5;case 5:return c<f.numBlocks?[4,this.readBlock(r)]:[3,8];case 6:h=i.sent(),r=h._endPosition,i.label=7;case 7:return c+=1,[3,5];case 8:return[3,10];case 9:r+=f._size+f.length,i.label=10;case 10:return s+=1,[3,3];case 11:return[2,a]}}))}))},e.prototype.checkCrc32=function(e,r,o,a){return n(this,void 0,void 0,(function(){var n,f;return i(this,(function(i){switch(i.label){case 0:return n=t.allocUnsafe(r),[4,this.file.read(n,0,r,e)];case 1:if(i.sent(),(f=s.default.unsigned(n))!==o)throw new u.CramMalformedError("crc mismatch in ".concat(a,": recorded CRC32 = ").concat(o,", but calculated CRC32 = ").concat(f));return[2]}}))}))},e.prototype.containerCount=function(){return n(this,void 0,void 0,(function(){var t,e,r,n,o,a,s,f;return i(this,(function(i){switch(i.label){case 0:return[4,this.getSectionParsers()];case 1:return t=i.sent(),[4,this.file.stat()];case 2:e=i.sent().size,r=t.cramContainerHeader1,n=0,o=t.cramFileDefinition.maxLength,i.label=3;case 3:return o+r.maxLength+8<e?[4,this.getContainerAtPosition(o).getHeader()]:[3,11];case 4:if(!(a=i.sent()))return[3,11];if(0!==n)return[3,9];o=a._endPosition,s=0,i.label=5;case 5:return s<a.numBlocks?[4,this.readBlock(o)]:[3,8];case 6:f=i.sent(),o=f._endPosition,i.label=7;case 7:return s+=1,[3,5];case 8:return[3,10];case 9:o+=a._size+a.length,i.label=10;case 10:return n+=1,[3,3];case 11:return[2,n]}}))}))},e.prototype.getContainerAtPosition=function(t){return new d.default(this,t)},e.prototype.readBlockHeader=function(e){return n(this,void 0,void 0,(function(){var r,n,o,a;return i(this,(function(i){switch(i.label){case 0:return[4,this.getSectionParsers()];case 1:return r=i.sent(),n=r.cramBlockHeader,[4,this.file.stat()];case 2:return o=i.sent().size,e+n.maxLength>=o?[2,void 0]:(a=t.allocUnsafe(n.maxLength),[4,this.file.read(a,0,n.maxLength,e)]);case 3:return i.sent(),[2,(0,g.parseItem)(a,n.parser,0,e)]}}))}))},e.prototype._parseSection=function(e,r,o,a){return void 0===o&&(o=e.maxLength),n(this,void 0,void 0,(function(){var n,s,f;return i(this,(function(i){switch(i.label){case 0:return a?(n=a,[3,4]):[3,1];case 1:return[4,this.file.stat()];case 2:return s=i.sent().size,r+o>=s?[2,void 0]:(n=t.allocUnsafe(o),[4,this.file.read(n,0,o,r)]);case 3:i.sent(),i.label=4;case 4:if((f=(0,g.parseItem)(n,e.parser,0,r))._size!==o)throw new u.CramMalformedError("section read error: requested size ".concat(o," does not equal parsed size ").concat(f._size));return[2,f]}}))}))},e.prototype._uncompress=function(e,r,n){if("gzip"===e)(0,a.unzip)(r).copy(n);else if("bzip2"===e){var i=bzip2.array(r),o=bzip2.header(i),s=0;do{var f=bzip2.decompress(i,o);-1!=f&&(t.from(f).copy(n,s),s+=f.length,o-=f.length)}while(-1!=f)}else if("rans"===e)(0,c.default)(r,n);else if("rans4x16"===e)l.default.r4x16_uncompress(r,n);else if("arith"===e)l.default.arith_uncompress(r,n);else if("fqzcomp"===e)l.default.fqzcomp_uncompress(r,n);else{if("tok3"!==e)throw new u.CramUnimplementedError("".concat(e," decompression not yet implemented"));l.default.tok3_uncompress(r,n)}},e.prototype.readBlock=function(e){return n(this,void 0,void 0,(function(){var r,n,o,a,s,f,u;return i(this,(function(i){switch(i.label){case 0:return[4,this.getDefinition()];case 1:return r=i.sent().majorVersion,[4,this.getSectionParsers()];case 2:return n=i.sent(),[4,this.readBlockHeader(e)];case 3:return o=i.sent(),a=o._endPosition,o.contentPosition=o._endPosition,s=t.allocUnsafe(o.uncompressedSize),"raw"===o.compressionMethod?[3,5]:(f=t.allocUnsafe(o.compressedSize),[4,this.read(f,0,o.compressedSize,a)]);case 4:return i.sent(),this._uncompress(o.compressionMethod,f,s),[3,7];case 5:return[4,this.read(s,0,o.uncompressedSize,a)];case 6:i.sent(),i.label=7;case 7:return o.content=s,r>=3?[4,this._parseSection(n.cramBlockCrc32,a+o.compressedSize)]:[3,11];case 8:return u=i.sent(),o.crc32=u.crc32,this.validateChecksums?[4,this.checkCrc32(e,o._size+o.compressedSize,o.crc32,"block data")]:[3,10];case 9:i.sent(),i.label=10;case 10:return o._endPosition=u._endPosition,o._size=o.compressedSize+n.cramBlockCrc32.maxLength,[3,12];case 11:o._endPosition=a+o.compressedSize,o._size=o.compressedSize,i.label=12;case 12:return[2,o]}}))}))},e}();e.default=v,"getDefinition getSectionParsers getSamHeader".split(" ").forEach((function(t){return(0,g.tinyMemoize)(v,t)}))}).call(this,r(1).Buffer)},function(t,e,r){"use strict";e.byteLength=function(t){var e=u(t),r=e[0],n=e[1];return 3*(r+n)/4-n},e.toByteArray=function(t){var e,r,n=u(t),a=n[0],s=n[1],f=new o(function(t,e,r){return 3*(e+r)/4-r}(0,a,s)),c=0,h=s>0?a-4:a;for(r=0;r<h;r+=4)e=i[t.charCodeAt(r)]<<18|i[t.charCodeAt(r+1)]<<12|i[t.charCodeAt(r+2)]<<6|i[t.charCodeAt(r+3)],f[c++]=e>>16&255,f[c++]=e>>8&255,f[c++]=255&e;2===s&&(e=i[t.charCodeAt(r)]<<2|i[t.charCodeAt(r+1)]>>4,f[c++]=255&e);1===s&&(e=i[t.charCodeAt(r)]<<10|i[t.charCodeAt(r+1)]<<4|i[t.charCodeAt(r+2)]>>2,f[c++]=e>>8&255,f[c++]=255&e);return f},e.fromByteArray=function(t){for(var e,r=t.length,i=r%3,o=[],a=0,s=r-i;a<s;a+=16383)o.push(c(t,a,a+16383>s?s:a+16383));1===i?(e=t[r-1],o.push(n[e>>2]+n[e<<4&63]+"==")):2===i&&(e=(t[r-2]<<8)+t[r-1],o.push(n[e>>10]+n[e>>4&63]+n[e<<2&63]+"="));return o.join("")};for(var n=[],i=[],o="undefined"!=typeof Uint8Array?Uint8Array:Array,a="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",s=0,f=a.length;s<f;++s)n[s]=a[s],i[a.charCodeAt(s)]=s;function u(t){var e=t.length;if(e%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var r=t.indexOf("=");return-1===r&&(r=e),[r,r===e?0:4-r%4]}function c(t,e,r){for(var i,o,a=[],s=e;s<r;s+=3)i=(t[s]<<16&16711680)+(t[s+1]<<8&65280)+(255&t[s+2]),a.push(n[(o=i)>>18&63]+n[o>>12&63]+n[o>>6&63]+n[63&o]);return a.join("")}i["-".charCodeAt(0)]=62,i["_".charCodeAt(0)]=63},function(t,e){
|
|
15
9
|
/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */
|
|
16
|
-
t.read=function(e,t,r,n,i){var o,a,s=8*i-n-1,f=(1<<s)-1,u=f>>1,c=-7,l=r?i-1:0,h=r?-1:1,d=e[t+l];for(l+=h,o=d&(1<<-c)-1,d>>=-c,c+=s;c>0;o=256*o+e[t+l],l+=h,c-=8);for(a=o&(1<<-c)-1,o>>=-c,c+=n;c>0;a=256*a+e[t+l],l+=h,c-=8);if(0===o)o=1-u;else{if(o===f)return a?NaN:1/0*(d?-1:1);a+=Math.pow(2,n),o-=u}return(d?-1:1)*a*Math.pow(2,o-n)},t.write=function(e,t,r,n,i,o){var a,s,f,u=8*o-i-1,c=(1<<u)-1,l=c>>1,h=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,d=n?0:o-1,p=n?1:-1,g=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(s=isNaN(t)?1:0,a=c):(a=Math.floor(Math.log(t)/Math.LN2),t*(f=Math.pow(2,-a))<1&&(a--,f*=2),(t+=a+l>=1?h/f:h*Math.pow(2,1-l))*f>=2&&(a++,f/=2),a+l>=c?(s=0,a=c):a+l>=1?(s=(t*f-1)*Math.pow(2,i),a+=l):(s=t*Math.pow(2,l-1)*Math.pow(2,i),a=0));i>=8;e[r+d]=255&s,d+=p,s/=256,i-=8);for(a=a<<i|s,u+=i;u>0;e[r+d]=255&a,d+=p,a/=256,u-=8);e[r+d-p]|=128*g}},function(e,t,r){e.exports=i;var n=r(15).EventEmitter;function i(){n.call(this)}r(6)(i,n),i.Readable=r(16),i.Writable=r(57),i.Duplex=r(58),i.Transform=r(59),i.PassThrough=r(60),i.Stream=i,i.prototype.pipe=function(e,t){var r=this;function i(t){e.writable&&!1===e.write(t)&&r.pause&&r.pause()}function o(){r.readable&&r.resume&&r.resume()}r.on("data",i),e.on("drain",o),e._isStdio||t&&!1===t.end||(r.on("end",s),r.on("close",f));var a=!1;function s(){a||(a=!0,e.end())}function f(){a||(a=!0,"function"==typeof e.destroy&&e.destroy())}function u(e){if(c(),0===n.listenerCount(this,"error"))throw e}function c(){r.removeListener("data",i),e.removeListener("drain",o),r.removeListener("end",s),r.removeListener("close",f),r.removeListener("error",u),e.removeListener("error",u),r.removeListener("end",c),r.removeListener("close",c),e.removeListener("close",c)}return r.on("error",u),e.on("error",u),r.on("end",c),r.on("close",c),e.on("close",c),e.emit("pipe",r),e}},function(e,t){},function(e,t,r){"use strict";var n=r(17).Buffer,i=r(51);e.exports=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.head=null,this.tail=null,this.length=0}return e.prototype.push=function(e){var t={data:e,next:null};this.length>0?this.tail.next=t:this.head=t,this.tail=t,++this.length},e.prototype.unshift=function(e){var t={data:e,next:this.head};0===this.length&&(this.tail=t),this.head=t,++this.length},e.prototype.shift=function(){if(0!==this.length){var e=this.head.data;return 1===this.length?this.head=this.tail=null:this.head=this.head.next,--this.length,e}},e.prototype.clear=function(){this.head=this.tail=null,this.length=0},e.prototype.join=function(e){if(0===this.length)return"";for(var t=this.head,r=""+t.data;t=t.next;)r+=e+t.data;return r},e.prototype.concat=function(e){if(0===this.length)return n.alloc(0);if(1===this.length)return this.head.data;for(var t,r,i,o=n.allocUnsafe(e>>>0),a=this.head,s=0;a;)t=a.data,r=o,i=s,t.copy(r,i),s+=a.data.length,a=a.next;return o},e}(),i&&i.inspect&&i.inspect.custom&&(e.exports.prototype[i.inspect.custom]=function(){var e=i.inspect({length:this.length});return this.constructor.name+" "+e})},function(e,t){},function(e,t,r){(function(e){var n=void 0!==e&&e||"undefined"!=typeof self&&self||window,i=Function.prototype.apply;function o(e,t){this._id=e,this._clearFn=t}t.setTimeout=function(){return new o(i.call(setTimeout,n,arguments),clearTimeout)},t.setInterval=function(){return new o(i.call(setInterval,n,arguments),clearInterval)},t.clearTimeout=t.clearInterval=function(e){e&&e.close()},o.prototype.unref=o.prototype.ref=function(){},o.prototype.close=function(){this._clearFn.call(n,this._id)},t.enroll=function(e,t){clearTimeout(e._idleTimeoutId),e._idleTimeout=t},t.unenroll=function(e){clearTimeout(e._idleTimeoutId),e._idleTimeout=-1},t._unrefActive=t.active=function(e){clearTimeout(e._idleTimeoutId);var t=e._idleTimeout;t>=0&&(e._idleTimeoutId=setTimeout((function(){e._onTimeout&&e._onTimeout()}),t))},r(53),t.setImmediate="undefined"!=typeof self&&self.setImmediate||void 0!==e&&e.setImmediate||this&&this.setImmediate,t.clearImmediate="undefined"!=typeof self&&self.clearImmediate||void 0!==e&&e.clearImmediate||this&&this.clearImmediate}).call(this,r(2))},function(e,t,r){(function(e,t){!function(e,r){"use strict";if(!e.setImmediate){var n,i,o,a,s,f=1,u={},c=!1,l=e.document,h=Object.getPrototypeOf&&Object.getPrototypeOf(e);h=h&&h.setTimeout?h:e,"[object process]"==={}.toString.call(e.process)?n=function(e){t.nextTick((function(){p(e)}))}:!function(){if(e.postMessage&&!e.importScripts){var t=!0,r=e.onmessage;return e.onmessage=function(){t=!1},e.postMessage("","*"),e.onmessage=r,t}}()?e.MessageChannel?((o=new MessageChannel).port1.onmessage=function(e){p(e.data)},n=function(e){o.port2.postMessage(e)}):l&&"onreadystatechange"in l.createElement("script")?(i=l.documentElement,n=function(e){var t=l.createElement("script");t.onreadystatechange=function(){p(e),t.onreadystatechange=null,i.removeChild(t),t=null},i.appendChild(t)}):n=function(e){setTimeout(p,0,e)}:(a="setImmediate$"+Math.random()+"$",s=function(t){t.source===e&&"string"==typeof t.data&&0===t.data.indexOf(a)&&p(+t.data.slice(a.length))},e.addEventListener?e.addEventListener("message",s,!1):e.attachEvent("onmessage",s),n=function(t){e.postMessage(a+t,"*")}),h.setImmediate=function(e){"function"!=typeof e&&(e=new Function(""+e));for(var t=new Array(arguments.length-1),r=0;r<t.length;r++)t[r]=arguments[r+1];var i={callback:e,args:t};return u[f]=i,n(f),f++},h.clearImmediate=d}function d(e){delete u[e]}function p(e){if(c)setTimeout(p,0,e);else{var t=u[e];if(t){c=!0;try{!function(e){var t=e.callback,r=e.args;switch(r.length){case 0:t();break;case 1:t(r[0]);break;case 2:t(r[0],r[1]);break;case 3:t(r[0],r[1],r[2]);break;default:t.apply(void 0,r)}}(t)}finally{d(e),c=!1}}}}}("undefined"==typeof self?void 0===e?this:e:self)}).call(this,r(2),r(3))},function(e,t,r){(function(t){function r(e){try{if(!t.localStorage)return!1}catch(e){return!1}var r=t.localStorage[e];return null!=r&&"true"===String(r).toLowerCase()}e.exports=function(e,t){if(r("noDeprecation"))return e;var n=!1;return function(){if(!n){if(r("throwDeprecation"))throw new Error(t);r("traceDeprecation")?console.trace(t):console.warn(t),n=!0}return e.apply(this,arguments)}}}).call(this,r(2))},function(e,t,r){var n=r(0),i=n.Buffer;function o(e,t){for(var r in e)t[r]=e[r]}function a(e,t,r){return i(e,t,r)}i.from&&i.alloc&&i.allocUnsafe&&i.allocUnsafeSlow?e.exports=n:(o(n,t),t.Buffer=a),o(i,a),a.from=function(e,t,r){if("number"==typeof e)throw new TypeError("Argument must not be a number");return i(e,t,r)},a.alloc=function(e,t,r){if("number"!=typeof e)throw new TypeError("Argument must be a number");var n=i(e);return void 0!==t?"string"==typeof r?n.fill(t,r):n.fill(t):n.fill(0),n},a.allocUnsafe=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return i(e)},a.allocUnsafeSlow=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return n.SlowBuffer(e)}},function(e,t,r){"use strict";e.exports=o;var n=r(31),i=Object.create(r(7));function o(e){if(!(this instanceof o))return new o(e);n.call(this,e)}i.inherits=r(6),i.inherits(o,n),o.prototype._transform=function(e,t,r){r(null,e)}},function(e,t,r){e.exports=r(18)},function(e,t,r){e.exports=r(4)},function(e,t,r){e.exports=r(16).Transform},function(e,t,r){e.exports=r(16).PassThrough},function(e,t,r){"use strict";(function(e,n){var i=r(32),o=r(65),a=r(66),s=r(69),f=r(72);for(var u in f)t[u]=f[u];t.NONE=0,t.DEFLATE=1,t.INFLATE=2,t.GZIP=3,t.GUNZIP=4,t.DEFLATERAW=5,t.INFLATERAW=6,t.UNZIP=7;function c(e){if("number"!=typeof e||e<t.DEFLATE||e>t.UNZIP)throw new TypeError("Bad argument");this.dictionary=null,this.err=0,this.flush=0,this.init_done=!1,this.level=0,this.memLevel=0,this.mode=e,this.strategy=0,this.windowBits=0,this.write_in_progress=!1,this.pending_close=!1,this.gzip_id_bytes_read=0}c.prototype.close=function(){this.write_in_progress?this.pending_close=!0:(this.pending_close=!1,i(this.init_done,"close before init"),i(this.mode<=t.UNZIP),this.mode===t.DEFLATE||this.mode===t.GZIP||this.mode===t.DEFLATERAW?a.deflateEnd(this.strm):this.mode!==t.INFLATE&&this.mode!==t.GUNZIP&&this.mode!==t.INFLATERAW&&this.mode!==t.UNZIP||s.inflateEnd(this.strm),this.mode=t.NONE,this.dictionary=null)},c.prototype.write=function(e,t,r,n,i,o,a){return this._write(!0,e,t,r,n,i,o,a)},c.prototype.writeSync=function(e,t,r,n,i,o,a){return this._write(!1,e,t,r,n,i,o,a)},c.prototype._write=function(r,o,a,s,f,u,c,l){if(i.equal(arguments.length,8),i(this.init_done,"write before init"),i(this.mode!==t.NONE,"already finalized"),i.equal(!1,this.write_in_progress,"write already in progress"),i.equal(!1,this.pending_close,"close is pending"),this.write_in_progress=!0,i.equal(!1,void 0===o,"must provide flush value"),this.write_in_progress=!0,o!==t.Z_NO_FLUSH&&o!==t.Z_PARTIAL_FLUSH&&o!==t.Z_SYNC_FLUSH&&o!==t.Z_FULL_FLUSH&&o!==t.Z_FINISH&&o!==t.Z_BLOCK)throw new Error("Invalid flush value");if(null==a&&(a=e.alloc(0),f=0,s=0),this.strm.avail_in=f,this.strm.input=a,this.strm.next_in=s,this.strm.avail_out=l,this.strm.output=u,this.strm.next_out=c,this.flush=o,!r)return this._process(),this._checkError()?this._afterSync():void 0;var h=this;return n.nextTick((function(){h._process(),h._after()})),this},c.prototype._afterSync=function(){var e=this.strm.avail_out,t=this.strm.avail_in;return this.write_in_progress=!1,[t,e]},c.prototype._process=function(){var e=null;switch(this.mode){case t.DEFLATE:case t.GZIP:case t.DEFLATERAW:this.err=a.deflate(this.strm,this.flush);break;case t.UNZIP:switch(this.strm.avail_in>0&&(e=this.strm.next_in),this.gzip_id_bytes_read){case 0:if(null===e)break;if(31!==this.strm.input[e]){this.mode=t.INFLATE;break}if(this.gzip_id_bytes_read=1,e++,1===this.strm.avail_in)break;case 1:if(null===e)break;139===this.strm.input[e]?(this.gzip_id_bytes_read=2,this.mode=t.GUNZIP):this.mode=t.INFLATE;break;default:throw new Error("invalid number of gzip magic number bytes read")}case t.INFLATE:case t.GUNZIP:case t.INFLATERAW:for(this.err=s.inflate(this.strm,this.flush),this.err===t.Z_NEED_DICT&&this.dictionary&&(this.err=s.inflateSetDictionary(this.strm,this.dictionary),this.err===t.Z_OK?this.err=s.inflate(this.strm,this.flush):this.err===t.Z_DATA_ERROR&&(this.err=t.Z_NEED_DICT));this.strm.avail_in>0&&this.mode===t.GUNZIP&&this.err===t.Z_STREAM_END&&0!==this.strm.next_in[0];)this.reset(),this.err=s.inflate(this.strm,this.flush);break;default:throw new Error("Unknown mode "+this.mode)}},c.prototype._checkError=function(){switch(this.err){case t.Z_OK:case t.Z_BUF_ERROR:if(0!==this.strm.avail_out&&this.flush===t.Z_FINISH)return this._error("unexpected end of file"),!1;break;case t.Z_STREAM_END:break;case t.Z_NEED_DICT:return null==this.dictionary?this._error("Missing dictionary"):this._error("Bad dictionary"),!1;default:return this._error("Zlib error"),!1}return!0},c.prototype._after=function(){if(this._checkError()){var e=this.strm.avail_out,t=this.strm.avail_in;this.write_in_progress=!1,this.callback(t,e),this.pending_close&&this.close()}},c.prototype._error=function(e){this.strm.msg&&(e=this.strm.msg),this.onerror(e,this.err),this.write_in_progress=!1,this.pending_close&&this.close()},c.prototype.init=function(e,r,n,o,a){i(4===arguments.length||5===arguments.length,"init(windowBits, level, memLevel, strategy, [dictionary])"),i(e>=8&&e<=15,"invalid windowBits"),i(r>=-1&&r<=9,"invalid compression level"),i(n>=1&&n<=9,"invalid memlevel"),i(o===t.Z_FILTERED||o===t.Z_HUFFMAN_ONLY||o===t.Z_RLE||o===t.Z_FIXED||o===t.Z_DEFAULT_STRATEGY,"invalid strategy"),this._init(r,e,n,o,a),this._setDictionary()},c.prototype.params=function(){throw new Error("deflateParams Not supported")},c.prototype.reset=function(){this._reset(),this._setDictionary()},c.prototype._init=function(e,r,n,i,f){switch(this.level=e,this.windowBits=r,this.memLevel=n,this.strategy=i,this.flush=t.Z_NO_FLUSH,this.err=t.Z_OK,this.mode!==t.GZIP&&this.mode!==t.GUNZIP||(this.windowBits+=16),this.mode===t.UNZIP&&(this.windowBits+=32),this.mode!==t.DEFLATERAW&&this.mode!==t.INFLATERAW||(this.windowBits=-1*this.windowBits),this.strm=new o,this.mode){case t.DEFLATE:case t.GZIP:case t.DEFLATERAW:this.err=a.deflateInit2(this.strm,this.level,t.Z_DEFLATED,this.windowBits,this.memLevel,this.strategy);break;case t.INFLATE:case t.GUNZIP:case t.INFLATERAW:case t.UNZIP:this.err=s.inflateInit2(this.strm,this.windowBits);break;default:throw new Error("Unknown mode "+this.mode)}this.err!==t.Z_OK&&this._error("Init error"),this.dictionary=f,this.write_in_progress=!1,this.init_done=!0},c.prototype._setDictionary=function(){if(null!=this.dictionary){switch(this.err=t.Z_OK,this.mode){case t.DEFLATE:case t.DEFLATERAW:this.err=a.deflateSetDictionary(this.strm,this.dictionary)}this.err!==t.Z_OK&&this._error("Failed to set dictionary")}},c.prototype._reset=function(){switch(this.err=t.Z_OK,this.mode){case t.DEFLATE:case t.DEFLATERAW:case t.GZIP:this.err=a.deflateReset(this.strm);break;case t.INFLATE:case t.INFLATERAW:case t.GUNZIP:this.err=s.inflateReset(this.strm)}this.err!==t.Z_OK&&this._error("Failed to reset stream")},t.Zlib=c}).call(this,r(0).Buffer,r(3))},function(e,t,r){"use strict";
|
|
17
|
-
/*
|
|
18
|
-
object-assign
|
|
19
|
-
(c) Sindre Sorhus
|
|
20
|
-
@license MIT
|
|
21
|
-
*/var n=Object.getOwnPropertySymbols,i=Object.prototype.hasOwnProperty,o=Object.prototype.propertyIsEnumerable;function a(e){if(null==e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}e.exports=function(){try{if(!Object.assign)return!1;var e=new String("abc");if(e[5]="de","5"===Object.getOwnPropertyNames(e)[0])return!1;for(var t={},r=0;r<10;r++)t["_"+String.fromCharCode(r)]=r;if("0123456789"!==Object.getOwnPropertyNames(t).map((function(e){return t[e]})).join(""))return!1;var n={};return"abcdefghijklmnopqrst".split("").forEach((function(e){n[e]=e})),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},n)).join("")}catch(e){return!1}}()?Object.assign:function(e,t){for(var r,s,f=a(e),u=1;u<arguments.length;u++){for(var c in r=Object(arguments[u]))i.call(r,c)&&(f[c]=r[c]);if(n){s=n(r);for(var l=0;l<s.length;l++)o.call(r,s[l])&&(f[s[l]]=r[s[l]])}}return f}},function(e,t){e.exports=function(e){return e&&"object"==typeof e&&"function"==typeof e.copy&&"function"==typeof e.fill&&"function"==typeof e.readUInt8}},function(e,t){"function"==typeof Object.create?e.exports=function(e,t){e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}})}:e.exports=function(e,t){e.super_=t;var r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e}},function(e,t,r){"use strict";e.exports=function(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}},function(e,t,r){"use strict";var n,i=r(11),o=r(67),a=r(34),s=r(35),f=r(68);function u(e,t){return e.msg=f[t],t}function c(e){return(e<<1)-(e>4?9:0)}function l(e){for(var t=e.length;--t>=0;)e[t]=0}function h(e){var t=e.state,r=t.pending;r>e.avail_out&&(r=e.avail_out),0!==r&&(i.arraySet(e.output,t.pending_buf,t.pending_out,r,e.next_out),e.next_out+=r,t.pending_out+=r,e.total_out+=r,e.avail_out-=r,t.pending-=r,0===t.pending&&(t.pending_out=0))}function d(e,t){o._tr_flush_block(e,e.block_start>=0?e.block_start:-1,e.strstart-e.block_start,t),e.block_start=e.strstart,h(e.strm)}function p(e,t){e.pending_buf[e.pending++]=t}function g(e,t){e.pending_buf[e.pending++]=t>>>8&255,e.pending_buf[e.pending++]=255&t}function y(e,t,r,n){var o=e.avail_in;return o>n&&(o=n),0===o?0:(e.avail_in-=o,i.arraySet(t,e.input,e.next_in,o,r),1===e.state.wrap?e.adler=a(e.adler,t,o,r):2===e.state.wrap&&(e.adler=s(e.adler,t,o,r)),e.next_in+=o,e.total_in+=o,o)}function v(e,t){var r,n,i=e.max_chain_length,o=e.strstart,a=e.prev_length,s=e.nice_match,f=e.strstart>e.w_size-262?e.strstart-(e.w_size-262):0,u=e.window,c=e.w_mask,l=e.prev,h=e.strstart+258,d=u[o+a-1],p=u[o+a];e.prev_length>=e.good_match&&(i>>=2),s>e.lookahead&&(s=e.lookahead);do{if(u[(r=t)+a]===p&&u[r+a-1]===d&&u[r]===u[o]&&u[++r]===u[o+1]){o+=2,r++;do{}while(u[++o]===u[++r]&&u[++o]===u[++r]&&u[++o]===u[++r]&&u[++o]===u[++r]&&u[++o]===u[++r]&&u[++o]===u[++r]&&u[++o]===u[++r]&&u[++o]===u[++r]&&o<h);if(n=258-(h-o),o=h-258,n>a){if(e.match_start=t,a=n,n>=s)break;d=u[o+a-1],p=u[o+a]}}}while((t=l[t&c])>f&&0!=--i);return a<=e.lookahead?a:e.lookahead}function m(e){var t,r,n,o,a,s=e.w_size;do{if(o=e.window_size-e.lookahead-e.strstart,e.strstart>=s+(s-262)){i.arraySet(e.window,e.window,s,s,0),e.match_start-=s,e.strstart-=s,e.block_start-=s,t=r=e.hash_size;do{n=e.head[--t],e.head[t]=n>=s?n-s:0}while(--r);t=r=s;do{n=e.prev[--t],e.prev[t]=n>=s?n-s:0}while(--r);o+=s}if(0===e.strm.avail_in)break;if(r=y(e.strm,e.window,e.strstart+e.lookahead,o),e.lookahead+=r,e.lookahead+e.insert>=3)for(a=e.strstart-e.insert,e.ins_h=e.window[a],e.ins_h=(e.ins_h<<e.hash_shift^e.window[a+1])&e.hash_mask;e.insert&&(e.ins_h=(e.ins_h<<e.hash_shift^e.window[a+3-1])&e.hash_mask,e.prev[a&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=a,a++,e.insert--,!(e.lookahead+e.insert<3)););}while(e.lookahead<262&&0!==e.strm.avail_in)}function b(e,t){for(var r,n;;){if(e.lookahead<262){if(m(e),e.lookahead<262&&0===t)return 1;if(0===e.lookahead)break}if(r=0,e.lookahead>=3&&(e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+3-1])&e.hash_mask,r=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart),0!==r&&e.strstart-r<=e.w_size-262&&(e.match_length=v(e,r)),e.match_length>=3)if(n=o._tr_tally(e,e.strstart-e.match_start,e.match_length-3),e.lookahead-=e.match_length,e.match_length<=e.max_lazy_match&&e.lookahead>=3){e.match_length--;do{e.strstart++,e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+3-1])&e.hash_mask,r=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart}while(0!=--e.match_length);e.strstart++}else e.strstart+=e.match_length,e.match_length=0,e.ins_h=e.window[e.strstart],e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+1])&e.hash_mask;else n=o._tr_tally(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++;if(n&&(d(e,!1),0===e.strm.avail_out))return 1}return e.insert=e.strstart<2?e.strstart:2,4===t?(d(e,!0),0===e.strm.avail_out?3:4):e.last_lit&&(d(e,!1),0===e.strm.avail_out)?1:2}function _(e,t){for(var r,n,i;;){if(e.lookahead<262){if(m(e),e.lookahead<262&&0===t)return 1;if(0===e.lookahead)break}if(r=0,e.lookahead>=3&&(e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+3-1])&e.hash_mask,r=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart),e.prev_length=e.match_length,e.prev_match=e.match_start,e.match_length=2,0!==r&&e.prev_length<e.max_lazy_match&&e.strstart-r<=e.w_size-262&&(e.match_length=v(e,r),e.match_length<=5&&(1===e.strategy||3===e.match_length&&e.strstart-e.match_start>4096)&&(e.match_length=2)),e.prev_length>=3&&e.match_length<=e.prev_length){i=e.strstart+e.lookahead-3,n=o._tr_tally(e,e.strstart-1-e.prev_match,e.prev_length-3),e.lookahead-=e.prev_length-1,e.prev_length-=2;do{++e.strstart<=i&&(e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+3-1])&e.hash_mask,r=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart)}while(0!=--e.prev_length);if(e.match_available=0,e.match_length=2,e.strstart++,n&&(d(e,!1),0===e.strm.avail_out))return 1}else if(e.match_available){if((n=o._tr_tally(e,0,e.window[e.strstart-1]))&&d(e,!1),e.strstart++,e.lookahead--,0===e.strm.avail_out)return 1}else e.match_available=1,e.strstart++,e.lookahead--}return e.match_available&&(n=o._tr_tally(e,0,e.window[e.strstart-1]),e.match_available=0),e.insert=e.strstart<2?e.strstart:2,4===t?(d(e,!0),0===e.strm.avail_out?3:4):e.last_lit&&(d(e,!1),0===e.strm.avail_out)?1:2}function w(e,t,r,n,i){this.good_length=e,this.max_lazy=t,this.nice_length=r,this.max_chain=n,this.func=i}function E(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=8,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new i.Buf16(1146),this.dyn_dtree=new i.Buf16(122),this.bl_tree=new i.Buf16(78),l(this.dyn_ltree),l(this.dyn_dtree),l(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new i.Buf16(16),this.heap=new i.Buf16(573),l(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new i.Buf16(573),l(this.depth),this.l_buf=0,this.lit_bufsize=0,this.last_lit=0,this.d_buf=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}function S(e){var t;return e&&e.state?(e.total_in=e.total_out=0,e.data_type=2,(t=e.state).pending=0,t.pending_out=0,t.wrap<0&&(t.wrap=-t.wrap),t.status=t.wrap?42:113,e.adler=2===t.wrap?0:1,t.last_flush=0,o._tr_init(t),0):u(e,-2)}function A(e){var t,r=S(e);return 0===r&&((t=e.state).window_size=2*t.w_size,l(t.head),t.max_lazy_match=n[t.level].max_lazy,t.good_match=n[t.level].good_length,t.nice_match=n[t.level].nice_length,t.max_chain_length=n[t.level].max_chain,t.strstart=0,t.block_start=0,t.lookahead=0,t.insert=0,t.match_length=t.prev_length=2,t.match_available=0,t.ins_h=0),r}function R(e,t,r,n,o,a){if(!e)return-2;var s=1;if(-1===t&&(t=6),n<0?(s=0,n=-n):n>15&&(s=2,n-=16),o<1||o>9||8!==r||n<8||n>15||t<0||t>9||a<0||a>4)return u(e,-2);8===n&&(n=9);var f=new E;return e.state=f,f.strm=e,f.wrap=s,f.gzhead=null,f.w_bits=n,f.w_size=1<<f.w_bits,f.w_mask=f.w_size-1,f.hash_bits=o+7,f.hash_size=1<<f.hash_bits,f.hash_mask=f.hash_size-1,f.hash_shift=~~((f.hash_bits+3-1)/3),f.window=new i.Buf8(2*f.w_size),f.head=new i.Buf16(f.hash_size),f.prev=new i.Buf16(f.w_size),f.lit_bufsize=1<<o+6,f.pending_buf_size=4*f.lit_bufsize,f.pending_buf=new i.Buf8(f.pending_buf_size),f.d_buf=1*f.lit_bufsize,f.l_buf=3*f.lit_bufsize,f.level=t,f.strategy=a,f.method=r,A(e)}n=[new w(0,0,0,0,(function(e,t){var r=65535;for(r>e.pending_buf_size-5&&(r=e.pending_buf_size-5);;){if(e.lookahead<=1){if(m(e),0===e.lookahead&&0===t)return 1;if(0===e.lookahead)break}e.strstart+=e.lookahead,e.lookahead=0;var n=e.block_start+r;if((0===e.strstart||e.strstart>=n)&&(e.lookahead=e.strstart-n,e.strstart=n,d(e,!1),0===e.strm.avail_out))return 1;if(e.strstart-e.block_start>=e.w_size-262&&(d(e,!1),0===e.strm.avail_out))return 1}return e.insert=0,4===t?(d(e,!0),0===e.strm.avail_out?3:4):(e.strstart>e.block_start&&(d(e,!1),e.strm.avail_out),1)})),new w(4,4,8,4,b),new w(4,5,16,8,b),new w(4,6,32,32,b),new w(4,4,16,16,_),new w(8,16,32,32,_),new w(8,16,128,128,_),new w(8,32,128,256,_),new w(32,128,258,1024,_),new w(32,258,258,4096,_)],t.deflateInit=function(e,t){return R(e,t,8,15,8,0)},t.deflateInit2=R,t.deflateReset=A,t.deflateResetKeep=S,t.deflateSetHeader=function(e,t){return e&&e.state?2!==e.state.wrap?-2:(e.state.gzhead=t,0):-2},t.deflate=function(e,t){var r,i,a,f;if(!e||!e.state||t>5||t<0)return e?u(e,-2):-2;if(i=e.state,!e.output||!e.input&&0!==e.avail_in||666===i.status&&4!==t)return u(e,0===e.avail_out?-5:-2);if(i.strm=e,r=i.last_flush,i.last_flush=t,42===i.status)if(2===i.wrap)e.adler=0,p(i,31),p(i,139),p(i,8),i.gzhead?(p(i,(i.gzhead.text?1:0)+(i.gzhead.hcrc?2:0)+(i.gzhead.extra?4:0)+(i.gzhead.name?8:0)+(i.gzhead.comment?16:0)),p(i,255&i.gzhead.time),p(i,i.gzhead.time>>8&255),p(i,i.gzhead.time>>16&255),p(i,i.gzhead.time>>24&255),p(i,9===i.level?2:i.strategy>=2||i.level<2?4:0),p(i,255&i.gzhead.os),i.gzhead.extra&&i.gzhead.extra.length&&(p(i,255&i.gzhead.extra.length),p(i,i.gzhead.extra.length>>8&255)),i.gzhead.hcrc&&(e.adler=s(e.adler,i.pending_buf,i.pending,0)),i.gzindex=0,i.status=69):(p(i,0),p(i,0),p(i,0),p(i,0),p(i,0),p(i,9===i.level?2:i.strategy>=2||i.level<2?4:0),p(i,3),i.status=113);else{var y=8+(i.w_bits-8<<4)<<8;y|=(i.strategy>=2||i.level<2?0:i.level<6?1:6===i.level?2:3)<<6,0!==i.strstart&&(y|=32),y+=31-y%31,i.status=113,g(i,y),0!==i.strstart&&(g(i,e.adler>>>16),g(i,65535&e.adler)),e.adler=1}if(69===i.status)if(i.gzhead.extra){for(a=i.pending;i.gzindex<(65535&i.gzhead.extra.length)&&(i.pending!==i.pending_buf_size||(i.gzhead.hcrc&&i.pending>a&&(e.adler=s(e.adler,i.pending_buf,i.pending-a,a)),h(e),a=i.pending,i.pending!==i.pending_buf_size));)p(i,255&i.gzhead.extra[i.gzindex]),i.gzindex++;i.gzhead.hcrc&&i.pending>a&&(e.adler=s(e.adler,i.pending_buf,i.pending-a,a)),i.gzindex===i.gzhead.extra.length&&(i.gzindex=0,i.status=73)}else i.status=73;if(73===i.status)if(i.gzhead.name){a=i.pending;do{if(i.pending===i.pending_buf_size&&(i.gzhead.hcrc&&i.pending>a&&(e.adler=s(e.adler,i.pending_buf,i.pending-a,a)),h(e),a=i.pending,i.pending===i.pending_buf_size)){f=1;break}f=i.gzindex<i.gzhead.name.length?255&i.gzhead.name.charCodeAt(i.gzindex++):0,p(i,f)}while(0!==f);i.gzhead.hcrc&&i.pending>a&&(e.adler=s(e.adler,i.pending_buf,i.pending-a,a)),0===f&&(i.gzindex=0,i.status=91)}else i.status=91;if(91===i.status)if(i.gzhead.comment){a=i.pending;do{if(i.pending===i.pending_buf_size&&(i.gzhead.hcrc&&i.pending>a&&(e.adler=s(e.adler,i.pending_buf,i.pending-a,a)),h(e),a=i.pending,i.pending===i.pending_buf_size)){f=1;break}f=i.gzindex<i.gzhead.comment.length?255&i.gzhead.comment.charCodeAt(i.gzindex++):0,p(i,f)}while(0!==f);i.gzhead.hcrc&&i.pending>a&&(e.adler=s(e.adler,i.pending_buf,i.pending-a,a)),0===f&&(i.status=103)}else i.status=103;if(103===i.status&&(i.gzhead.hcrc?(i.pending+2>i.pending_buf_size&&h(e),i.pending+2<=i.pending_buf_size&&(p(i,255&e.adler),p(i,e.adler>>8&255),e.adler=0,i.status=113)):i.status=113),0!==i.pending){if(h(e),0===e.avail_out)return i.last_flush=-1,0}else if(0===e.avail_in&&c(t)<=c(r)&&4!==t)return u(e,-5);if(666===i.status&&0!==e.avail_in)return u(e,-5);if(0!==e.avail_in||0!==i.lookahead||0!==t&&666!==i.status){var v=2===i.strategy?function(e,t){for(var r;;){if(0===e.lookahead&&(m(e),0===e.lookahead)){if(0===t)return 1;break}if(e.match_length=0,r=o._tr_tally(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++,r&&(d(e,!1),0===e.strm.avail_out))return 1}return e.insert=0,4===t?(d(e,!0),0===e.strm.avail_out?3:4):e.last_lit&&(d(e,!1),0===e.strm.avail_out)?1:2}(i,t):3===i.strategy?function(e,t){for(var r,n,i,a,s=e.window;;){if(e.lookahead<=258){if(m(e),e.lookahead<=258&&0===t)return 1;if(0===e.lookahead)break}if(e.match_length=0,e.lookahead>=3&&e.strstart>0&&(n=s[i=e.strstart-1])===s[++i]&&n===s[++i]&&n===s[++i]){a=e.strstart+258;do{}while(n===s[++i]&&n===s[++i]&&n===s[++i]&&n===s[++i]&&n===s[++i]&&n===s[++i]&&n===s[++i]&&n===s[++i]&&i<a);e.match_length=258-(a-i),e.match_length>e.lookahead&&(e.match_length=e.lookahead)}if(e.match_length>=3?(r=o._tr_tally(e,1,e.match_length-3),e.lookahead-=e.match_length,e.strstart+=e.match_length,e.match_length=0):(r=o._tr_tally(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++),r&&(d(e,!1),0===e.strm.avail_out))return 1}return e.insert=0,4===t?(d(e,!0),0===e.strm.avail_out?3:4):e.last_lit&&(d(e,!1),0===e.strm.avail_out)?1:2}(i,t):n[i.level].func(i,t);if(3!==v&&4!==v||(i.status=666),1===v||3===v)return 0===e.avail_out&&(i.last_flush=-1),0;if(2===v&&(1===t?o._tr_align(i):5!==t&&(o._tr_stored_block(i,0,0,!1),3===t&&(l(i.head),0===i.lookahead&&(i.strstart=0,i.block_start=0,i.insert=0))),h(e),0===e.avail_out))return i.last_flush=-1,0}return 4!==t?0:i.wrap<=0?1:(2===i.wrap?(p(i,255&e.adler),p(i,e.adler>>8&255),p(i,e.adler>>16&255),p(i,e.adler>>24&255),p(i,255&e.total_in),p(i,e.total_in>>8&255),p(i,e.total_in>>16&255),p(i,e.total_in>>24&255)):(g(i,e.adler>>>16),g(i,65535&e.adler)),h(e),i.wrap>0&&(i.wrap=-i.wrap),0!==i.pending?0:1)},t.deflateEnd=function(e){var t;return e&&e.state?42!==(t=e.state.status)&&69!==t&&73!==t&&91!==t&&103!==t&&113!==t&&666!==t?u(e,-2):(e.state=null,113===t?u(e,-3):0):-2},t.deflateSetDictionary=function(e,t){var r,n,o,s,f,u,c,h,d=t.length;if(!e||!e.state)return-2;if(2===(s=(r=e.state).wrap)||1===s&&42!==r.status||r.lookahead)return-2;for(1===s&&(e.adler=a(e.adler,t,d,0)),r.wrap=0,d>=r.w_size&&(0===s&&(l(r.head),r.strstart=0,r.block_start=0,r.insert=0),h=new i.Buf8(r.w_size),i.arraySet(h,t,d-r.w_size,r.w_size,0),t=h,d=r.w_size),f=e.avail_in,u=e.next_in,c=e.input,e.avail_in=d,e.next_in=0,e.input=t,m(r);r.lookahead>=3;){n=r.strstart,o=r.lookahead-2;do{r.ins_h=(r.ins_h<<r.hash_shift^r.window[n+3-1])&r.hash_mask,r.prev[n&r.w_mask]=r.head[r.ins_h],r.head[r.ins_h]=n,n++}while(--o);r.strstart=n,r.lookahead=2,m(r)}return r.strstart+=r.lookahead,r.block_start=r.strstart,r.insert=r.lookahead,r.lookahead=0,r.match_length=r.prev_length=2,r.match_available=0,e.next_in=u,e.input=c,e.avail_in=f,r.wrap=s,0},t.deflateInfo="pako deflate (from Nodeca project)"},function(e,t,r){"use strict";var n=r(11);function i(e){for(var t=e.length;--t>=0;)e[t]=0}var o=[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],a=[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],s=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7],f=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],u=new Array(576);i(u);var c=new Array(60);i(c);var l=new Array(512);i(l);var h=new Array(256);i(h);var d=new Array(29);i(d);var p,g,y,v=new Array(30);function m(e,t,r,n,i){this.static_tree=e,this.extra_bits=t,this.extra_base=r,this.elems=n,this.max_length=i,this.has_stree=e&&e.length}function b(e,t){this.dyn_tree=e,this.max_code=0,this.stat_desc=t}function _(e){return e<256?l[e]:l[256+(e>>>7)]}function w(e,t){e.pending_buf[e.pending++]=255&t,e.pending_buf[e.pending++]=t>>>8&255}function E(e,t,r){e.bi_valid>16-r?(e.bi_buf|=t<<e.bi_valid&65535,w(e,e.bi_buf),e.bi_buf=t>>16-e.bi_valid,e.bi_valid+=r-16):(e.bi_buf|=t<<e.bi_valid&65535,e.bi_valid+=r)}function S(e,t,r){E(e,r[2*t],r[2*t+1])}function A(e,t){var r=0;do{r|=1&e,e>>>=1,r<<=1}while(--t>0);return r>>>1}function R(e,t,r){var n,i,o=new Array(16),a=0;for(n=1;n<=15;n++)o[n]=a=a+r[n-1]<<1;for(i=0;i<=t;i++){var s=e[2*i+1];0!==s&&(e[2*i]=A(o[s]++,s))}}function k(e){var t;for(t=0;t<286;t++)e.dyn_ltree[2*t]=0;for(t=0;t<30;t++)e.dyn_dtree[2*t]=0;for(t=0;t<19;t++)e.bl_tree[2*t]=0;e.dyn_ltree[512]=1,e.opt_len=e.static_len=0,e.last_lit=e.matches=0}function x(e){e.bi_valid>8?w(e,e.bi_buf):e.bi_valid>0&&(e.pending_buf[e.pending++]=e.bi_buf),e.bi_buf=0,e.bi_valid=0}function C(e,t,r,n){var i=2*t,o=2*r;return e[i]<e[o]||e[i]===e[o]&&n[t]<=n[r]}function B(e,t,r){for(var n=e.heap[r],i=r<<1;i<=e.heap_len&&(i<e.heap_len&&C(t,e.heap[i+1],e.heap[i],e.depth)&&i++,!C(t,n,e.heap[i],e.depth));)e.heap[r]=e.heap[i],r=i,i<<=1;e.heap[r]=n}function T(e,t,r){var n,i,s,f,u=0;if(0!==e.last_lit)do{n=e.pending_buf[e.d_buf+2*u]<<8|e.pending_buf[e.d_buf+2*u+1],i=e.pending_buf[e.l_buf+u],u++,0===n?S(e,i,t):(S(e,(s=h[i])+256+1,t),0!==(f=o[s])&&E(e,i-=d[s],f),S(e,s=_(--n),r),0!==(f=a[s])&&E(e,n-=v[s],f))}while(u<e.last_lit);S(e,256,t)}function M(e,t){var r,n,i,o=t.dyn_tree,a=t.stat_desc.static_tree,s=t.stat_desc.has_stree,f=t.stat_desc.elems,u=-1;for(e.heap_len=0,e.heap_max=573,r=0;r<f;r++)0!==o[2*r]?(e.heap[++e.heap_len]=u=r,e.depth[r]=0):o[2*r+1]=0;for(;e.heap_len<2;)o[2*(i=e.heap[++e.heap_len]=u<2?++u:0)]=1,e.depth[i]=0,e.opt_len--,s&&(e.static_len-=a[2*i+1]);for(t.max_code=u,r=e.heap_len>>1;r>=1;r--)B(e,o,r);i=f;do{r=e.heap[1],e.heap[1]=e.heap[e.heap_len--],B(e,o,1),n=e.heap[1],e.heap[--e.heap_max]=r,e.heap[--e.heap_max]=n,o[2*i]=o[2*r]+o[2*n],e.depth[i]=(e.depth[r]>=e.depth[n]?e.depth[r]:e.depth[n])+1,o[2*r+1]=o[2*n+1]=i,e.heap[1]=i++,B(e,o,1)}while(e.heap_len>=2);e.heap[--e.heap_max]=e.heap[1],function(e,t){var r,n,i,o,a,s,f=t.dyn_tree,u=t.max_code,c=t.stat_desc.static_tree,l=t.stat_desc.has_stree,h=t.stat_desc.extra_bits,d=t.stat_desc.extra_base,p=t.stat_desc.max_length,g=0;for(o=0;o<=15;o++)e.bl_count[o]=0;for(f[2*e.heap[e.heap_max]+1]=0,r=e.heap_max+1;r<573;r++)(o=f[2*f[2*(n=e.heap[r])+1]+1]+1)>p&&(o=p,g++),f[2*n+1]=o,n>u||(e.bl_count[o]++,a=0,n>=d&&(a=h[n-d]),s=f[2*n],e.opt_len+=s*(o+a),l&&(e.static_len+=s*(c[2*n+1]+a)));if(0!==g){do{for(o=p-1;0===e.bl_count[o];)o--;e.bl_count[o]--,e.bl_count[o+1]+=2,e.bl_count[p]--,g-=2}while(g>0);for(o=p;0!==o;o--)for(n=e.bl_count[o];0!==n;)(i=e.heap[--r])>u||(f[2*i+1]!==o&&(e.opt_len+=(o-f[2*i+1])*f[2*i],f[2*i+1]=o),n--)}}(e,t),R(o,u,e.bl_count)}function O(e,t,r){var n,i,o=-1,a=t[1],s=0,f=7,u=4;for(0===a&&(f=138,u=3),t[2*(r+1)+1]=65535,n=0;n<=r;n++)i=a,a=t[2*(n+1)+1],++s<f&&i===a||(s<u?e.bl_tree[2*i]+=s:0!==i?(i!==o&&e.bl_tree[2*i]++,e.bl_tree[32]++):s<=10?e.bl_tree[34]++:e.bl_tree[36]++,s=0,o=i,0===a?(f=138,u=3):i===a?(f=6,u=3):(f=7,u=4))}function I(e,t,r){var n,i,o=-1,a=t[1],s=0,f=7,u=4;for(0===a&&(f=138,u=3),n=0;n<=r;n++)if(i=a,a=t[2*(n+1)+1],!(++s<f&&i===a)){if(s<u)do{S(e,i,e.bl_tree)}while(0!=--s);else 0!==i?(i!==o&&(S(e,i,e.bl_tree),s--),S(e,16,e.bl_tree),E(e,s-3,2)):s<=10?(S(e,17,e.bl_tree),E(e,s-3,3)):(S(e,18,e.bl_tree),E(e,s-11,7));s=0,o=i,0===a?(f=138,u=3):i===a?(f=6,u=3):(f=7,u=4)}}i(v);var P=!1;function L(e,t,r,i){E(e,0+(i?1:0),3),function(e,t,r,i){x(e),i&&(w(e,r),w(e,~r)),n.arraySet(e.pending_buf,e.window,t,r,e.pending),e.pending+=r}(e,t,r,!0)}t._tr_init=function(e){P||(!function(){var e,t,r,n,i,f=new Array(16);for(r=0,n=0;n<28;n++)for(d[n]=r,e=0;e<1<<o[n];e++)h[r++]=n;for(h[r-1]=n,i=0,n=0;n<16;n++)for(v[n]=i,e=0;e<1<<a[n];e++)l[i++]=n;for(i>>=7;n<30;n++)for(v[n]=i<<7,e=0;e<1<<a[n]-7;e++)l[256+i++]=n;for(t=0;t<=15;t++)f[t]=0;for(e=0;e<=143;)u[2*e+1]=8,e++,f[8]++;for(;e<=255;)u[2*e+1]=9,e++,f[9]++;for(;e<=279;)u[2*e+1]=7,e++,f[7]++;for(;e<=287;)u[2*e+1]=8,e++,f[8]++;for(R(u,287,f),e=0;e<30;e++)c[2*e+1]=5,c[2*e]=A(e,5);p=new m(u,o,257,286,15),g=new m(c,a,0,30,15),y=new m(new Array(0),s,0,19,7)}(),P=!0),e.l_desc=new b(e.dyn_ltree,p),e.d_desc=new b(e.dyn_dtree,g),e.bl_desc=new b(e.bl_tree,y),e.bi_buf=0,e.bi_valid=0,k(e)},t._tr_stored_block=L,t._tr_flush_block=function(e,t,r,n){var i,o,a=0;e.level>0?(2===e.strm.data_type&&(e.strm.data_type=function(e){var t,r=4093624447;for(t=0;t<=31;t++,r>>>=1)if(1&r&&0!==e.dyn_ltree[2*t])return 0;if(0!==e.dyn_ltree[18]||0!==e.dyn_ltree[20]||0!==e.dyn_ltree[26])return 1;for(t=32;t<256;t++)if(0!==e.dyn_ltree[2*t])return 1;return 0}(e)),M(e,e.l_desc),M(e,e.d_desc),a=function(e){var t;for(O(e,e.dyn_ltree,e.l_desc.max_code),O(e,e.dyn_dtree,e.d_desc.max_code),M(e,e.bl_desc),t=18;t>=3&&0===e.bl_tree[2*f[t]+1];t--);return e.opt_len+=3*(t+1)+5+5+4,t}(e),i=e.opt_len+3+7>>>3,(o=e.static_len+3+7>>>3)<=i&&(i=o)):i=o=r+5,r+4<=i&&-1!==t?L(e,t,r,n):4===e.strategy||o===i?(E(e,2+(n?1:0),3),T(e,u,c)):(E(e,4+(n?1:0),3),function(e,t,r,n){var i;for(E(e,t-257,5),E(e,r-1,5),E(e,n-4,4),i=0;i<n;i++)E(e,e.bl_tree[2*f[i]+1],3);I(e,e.dyn_ltree,t-1),I(e,e.dyn_dtree,r-1)}(e,e.l_desc.max_code+1,e.d_desc.max_code+1,a+1),T(e,e.dyn_ltree,e.dyn_dtree)),k(e),n&&x(e)},t._tr_tally=function(e,t,r){return e.pending_buf[e.d_buf+2*e.last_lit]=t>>>8&255,e.pending_buf[e.d_buf+2*e.last_lit+1]=255&t,e.pending_buf[e.l_buf+e.last_lit]=255&r,e.last_lit++,0===t?e.dyn_ltree[2*r]++:(e.matches++,t--,e.dyn_ltree[2*(h[r]+256+1)]++,e.dyn_dtree[2*_(t)]++),e.last_lit===e.lit_bufsize-1},t._tr_align=function(e){E(e,2,3),S(e,256,u),function(e){16===e.bi_valid?(w(e,e.bi_buf),e.bi_buf=0,e.bi_valid=0):e.bi_valid>=8&&(e.pending_buf[e.pending++]=255&e.bi_buf,e.bi_buf>>=8,e.bi_valid-=8)}(e)}},function(e,t,r){"use strict";e.exports={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"}},function(e,t,r){"use strict";var n=r(11),i=r(34),o=r(35),a=r(70),s=r(71);function f(e){return(e>>>24&255)+(e>>>8&65280)+((65280&e)<<8)+((255&e)<<24)}function u(){this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new n.Buf16(320),this.work=new n.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function c(e){var t;return e&&e.state?(t=e.state,e.total_in=e.total_out=t.total=0,e.msg="",t.wrap&&(e.adler=1&t.wrap),t.mode=1,t.last=0,t.havedict=0,t.dmax=32768,t.head=null,t.hold=0,t.bits=0,t.lencode=t.lendyn=new n.Buf32(852),t.distcode=t.distdyn=new n.Buf32(592),t.sane=1,t.back=-1,0):-2}function l(e){var t;return e&&e.state?((t=e.state).wsize=0,t.whave=0,t.wnext=0,c(e)):-2}function h(e,t){var r,n;return e&&e.state?(n=e.state,t<0?(r=0,t=-t):(r=1+(t>>4),t<48&&(t&=15)),t&&(t<8||t>15)?-2:(null!==n.window&&n.wbits!==t&&(n.window=null),n.wrap=r,n.wbits=t,l(e))):-2}function d(e,t){var r,n;return e?(n=new u,e.state=n,n.window=null,0!==(r=h(e,t))&&(e.state=null),r):-2}var p,g,y=!0;function v(e){if(y){var t;for(p=new n.Buf32(512),g=new n.Buf32(32),t=0;t<144;)e.lens[t++]=8;for(;t<256;)e.lens[t++]=9;for(;t<280;)e.lens[t++]=7;for(;t<288;)e.lens[t++]=8;for(s(1,e.lens,0,288,p,0,e.work,{bits:9}),t=0;t<32;)e.lens[t++]=5;s(2,e.lens,0,32,g,0,e.work,{bits:5}),y=!1}e.lencode=p,e.lenbits=9,e.distcode=g,e.distbits=5}function m(e,t,r,i){var o,a=e.state;return null===a.window&&(a.wsize=1<<a.wbits,a.wnext=0,a.whave=0,a.window=new n.Buf8(a.wsize)),i>=a.wsize?(n.arraySet(a.window,t,r-a.wsize,a.wsize,0),a.wnext=0,a.whave=a.wsize):((o=a.wsize-a.wnext)>i&&(o=i),n.arraySet(a.window,t,r-i,o,a.wnext),(i-=o)?(n.arraySet(a.window,t,r-i,i,0),a.wnext=i,a.whave=a.wsize):(a.wnext+=o,a.wnext===a.wsize&&(a.wnext=0),a.whave<a.wsize&&(a.whave+=o))),0}t.inflateReset=l,t.inflateReset2=h,t.inflateResetKeep=c,t.inflateInit=function(e){return d(e,15)},t.inflateInit2=d,t.inflate=function(e,t){var r,u,c,l,h,d,p,g,y,b,_,w,E,S,A,R,k,x,C,B,T,M,O,I,P=0,L=new n.Buf8(4),F=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15];if(!e||!e.state||!e.output||!e.input&&0!==e.avail_in)return-2;12===(r=e.state).mode&&(r.mode=13),h=e.next_out,c=e.output,p=e.avail_out,l=e.next_in,u=e.input,d=e.avail_in,g=r.hold,y=r.bits,b=d,_=p,M=0;e:for(;;)switch(r.mode){case 1:if(0===r.wrap){r.mode=13;break}for(;y<16;){if(0===d)break e;d--,g+=u[l++]<<y,y+=8}if(2&r.wrap&&35615===g){r.check=0,L[0]=255&g,L[1]=g>>>8&255,r.check=o(r.check,L,2,0),g=0,y=0,r.mode=2;break}if(r.flags=0,r.head&&(r.head.done=!1),!(1&r.wrap)||(((255&g)<<8)+(g>>8))%31){e.msg="incorrect header check",r.mode=30;break}if(8!=(15&g)){e.msg="unknown compression method",r.mode=30;break}if(y-=4,T=8+(15&(g>>>=4)),0===r.wbits)r.wbits=T;else if(T>r.wbits){e.msg="invalid window size",r.mode=30;break}r.dmax=1<<T,e.adler=r.check=1,r.mode=512&g?10:12,g=0,y=0;break;case 2:for(;y<16;){if(0===d)break e;d--,g+=u[l++]<<y,y+=8}if(r.flags=g,8!=(255&r.flags)){e.msg="unknown compression method",r.mode=30;break}if(57344&r.flags){e.msg="unknown header flags set",r.mode=30;break}r.head&&(r.head.text=g>>8&1),512&r.flags&&(L[0]=255&g,L[1]=g>>>8&255,r.check=o(r.check,L,2,0)),g=0,y=0,r.mode=3;case 3:for(;y<32;){if(0===d)break e;d--,g+=u[l++]<<y,y+=8}r.head&&(r.head.time=g),512&r.flags&&(L[0]=255&g,L[1]=g>>>8&255,L[2]=g>>>16&255,L[3]=g>>>24&255,r.check=o(r.check,L,4,0)),g=0,y=0,r.mode=4;case 4:for(;y<16;){if(0===d)break e;d--,g+=u[l++]<<y,y+=8}r.head&&(r.head.xflags=255&g,r.head.os=g>>8),512&r.flags&&(L[0]=255&g,L[1]=g>>>8&255,r.check=o(r.check,L,2,0)),g=0,y=0,r.mode=5;case 5:if(1024&r.flags){for(;y<16;){if(0===d)break e;d--,g+=u[l++]<<y,y+=8}r.length=g,r.head&&(r.head.extra_len=g),512&r.flags&&(L[0]=255&g,L[1]=g>>>8&255,r.check=o(r.check,L,2,0)),g=0,y=0}else r.head&&(r.head.extra=null);r.mode=6;case 6:if(1024&r.flags&&((w=r.length)>d&&(w=d),w&&(r.head&&(T=r.head.extra_len-r.length,r.head.extra||(r.head.extra=new Array(r.head.extra_len)),n.arraySet(r.head.extra,u,l,w,T)),512&r.flags&&(r.check=o(r.check,u,w,l)),d-=w,l+=w,r.length-=w),r.length))break e;r.length=0,r.mode=7;case 7:if(2048&r.flags){if(0===d)break e;w=0;do{T=u[l+w++],r.head&&T&&r.length<65536&&(r.head.name+=String.fromCharCode(T))}while(T&&w<d);if(512&r.flags&&(r.check=o(r.check,u,w,l)),d-=w,l+=w,T)break e}else r.head&&(r.head.name=null);r.length=0,r.mode=8;case 8:if(4096&r.flags){if(0===d)break e;w=0;do{T=u[l+w++],r.head&&T&&r.length<65536&&(r.head.comment+=String.fromCharCode(T))}while(T&&w<d);if(512&r.flags&&(r.check=o(r.check,u,w,l)),d-=w,l+=w,T)break e}else r.head&&(r.head.comment=null);r.mode=9;case 9:if(512&r.flags){for(;y<16;){if(0===d)break e;d--,g+=u[l++]<<y,y+=8}if(g!==(65535&r.check)){e.msg="header crc mismatch",r.mode=30;break}g=0,y=0}r.head&&(r.head.hcrc=r.flags>>9&1,r.head.done=!0),e.adler=r.check=0,r.mode=12;break;case 10:for(;y<32;){if(0===d)break e;d--,g+=u[l++]<<y,y+=8}e.adler=r.check=f(g),g=0,y=0,r.mode=11;case 11:if(0===r.havedict)return e.next_out=h,e.avail_out=p,e.next_in=l,e.avail_in=d,r.hold=g,r.bits=y,2;e.adler=r.check=1,r.mode=12;case 12:if(5===t||6===t)break e;case 13:if(r.last){g>>>=7&y,y-=7&y,r.mode=27;break}for(;y<3;){if(0===d)break e;d--,g+=u[l++]<<y,y+=8}switch(r.last=1&g,y-=1,3&(g>>>=1)){case 0:r.mode=14;break;case 1:if(v(r),r.mode=20,6===t){g>>>=2,y-=2;break e}break;case 2:r.mode=17;break;case 3:e.msg="invalid block type",r.mode=30}g>>>=2,y-=2;break;case 14:for(g>>>=7&y,y-=7&y;y<32;){if(0===d)break e;d--,g+=u[l++]<<y,y+=8}if((65535&g)!=(g>>>16^65535)){e.msg="invalid stored block lengths",r.mode=30;break}if(r.length=65535&g,g=0,y=0,r.mode=15,6===t)break e;case 15:r.mode=16;case 16:if(w=r.length){if(w>d&&(w=d),w>p&&(w=p),0===w)break e;n.arraySet(c,u,l,w,h),d-=w,l+=w,p-=w,h+=w,r.length-=w;break}r.mode=12;break;case 17:for(;y<14;){if(0===d)break e;d--,g+=u[l++]<<y,y+=8}if(r.nlen=257+(31&g),g>>>=5,y-=5,r.ndist=1+(31&g),g>>>=5,y-=5,r.ncode=4+(15&g),g>>>=4,y-=4,r.nlen>286||r.ndist>30){e.msg="too many length or distance symbols",r.mode=30;break}r.have=0,r.mode=18;case 18:for(;r.have<r.ncode;){for(;y<3;){if(0===d)break e;d--,g+=u[l++]<<y,y+=8}r.lens[F[r.have++]]=7&g,g>>>=3,y-=3}for(;r.have<19;)r.lens[F[r.have++]]=0;if(r.lencode=r.lendyn,r.lenbits=7,O={bits:r.lenbits},M=s(0,r.lens,0,19,r.lencode,0,r.work,O),r.lenbits=O.bits,M){e.msg="invalid code lengths set",r.mode=30;break}r.have=0,r.mode=19;case 19:for(;r.have<r.nlen+r.ndist;){for(;R=(P=r.lencode[g&(1<<r.lenbits)-1])>>>16&255,k=65535&P,!((A=P>>>24)<=y);){if(0===d)break e;d--,g+=u[l++]<<y,y+=8}if(k<16)g>>>=A,y-=A,r.lens[r.have++]=k;else{if(16===k){for(I=A+2;y<I;){if(0===d)break e;d--,g+=u[l++]<<y,y+=8}if(g>>>=A,y-=A,0===r.have){e.msg="invalid bit length repeat",r.mode=30;break}T=r.lens[r.have-1],w=3+(3&g),g>>>=2,y-=2}else if(17===k){for(I=A+3;y<I;){if(0===d)break e;d--,g+=u[l++]<<y,y+=8}y-=A,T=0,w=3+(7&(g>>>=A)),g>>>=3,y-=3}else{for(I=A+7;y<I;){if(0===d)break e;d--,g+=u[l++]<<y,y+=8}y-=A,T=0,w=11+(127&(g>>>=A)),g>>>=7,y-=7}if(r.have+w>r.nlen+r.ndist){e.msg="invalid bit length repeat",r.mode=30;break}for(;w--;)r.lens[r.have++]=T}}if(30===r.mode)break;if(0===r.lens[256]){e.msg="invalid code -- missing end-of-block",r.mode=30;break}if(r.lenbits=9,O={bits:r.lenbits},M=s(1,r.lens,0,r.nlen,r.lencode,0,r.work,O),r.lenbits=O.bits,M){e.msg="invalid literal/lengths set",r.mode=30;break}if(r.distbits=6,r.distcode=r.distdyn,O={bits:r.distbits},M=s(2,r.lens,r.nlen,r.ndist,r.distcode,0,r.work,O),r.distbits=O.bits,M){e.msg="invalid distances set",r.mode=30;break}if(r.mode=20,6===t)break e;case 20:r.mode=21;case 21:if(d>=6&&p>=258){e.next_out=h,e.avail_out=p,e.next_in=l,e.avail_in=d,r.hold=g,r.bits=y,a(e,_),h=e.next_out,c=e.output,p=e.avail_out,l=e.next_in,u=e.input,d=e.avail_in,g=r.hold,y=r.bits,12===r.mode&&(r.back=-1);break}for(r.back=0;R=(P=r.lencode[g&(1<<r.lenbits)-1])>>>16&255,k=65535&P,!((A=P>>>24)<=y);){if(0===d)break e;d--,g+=u[l++]<<y,y+=8}if(R&&0==(240&R)){for(x=A,C=R,B=k;R=(P=r.lencode[B+((g&(1<<x+C)-1)>>x)])>>>16&255,k=65535&P,!(x+(A=P>>>24)<=y);){if(0===d)break e;d--,g+=u[l++]<<y,y+=8}g>>>=x,y-=x,r.back+=x}if(g>>>=A,y-=A,r.back+=A,r.length=k,0===R){r.mode=26;break}if(32&R){r.back=-1,r.mode=12;break}if(64&R){e.msg="invalid literal/length code",r.mode=30;break}r.extra=15&R,r.mode=22;case 22:if(r.extra){for(I=r.extra;y<I;){if(0===d)break e;d--,g+=u[l++]<<y,y+=8}r.length+=g&(1<<r.extra)-1,g>>>=r.extra,y-=r.extra,r.back+=r.extra}r.was=r.length,r.mode=23;case 23:for(;R=(P=r.distcode[g&(1<<r.distbits)-1])>>>16&255,k=65535&P,!((A=P>>>24)<=y);){if(0===d)break e;d--,g+=u[l++]<<y,y+=8}if(0==(240&R)){for(x=A,C=R,B=k;R=(P=r.distcode[B+((g&(1<<x+C)-1)>>x)])>>>16&255,k=65535&P,!(x+(A=P>>>24)<=y);){if(0===d)break e;d--,g+=u[l++]<<y,y+=8}g>>>=x,y-=x,r.back+=x}if(g>>>=A,y-=A,r.back+=A,64&R){e.msg="invalid distance code",r.mode=30;break}r.offset=k,r.extra=15&R,r.mode=24;case 24:if(r.extra){for(I=r.extra;y<I;){if(0===d)break e;d--,g+=u[l++]<<y,y+=8}r.offset+=g&(1<<r.extra)-1,g>>>=r.extra,y-=r.extra,r.back+=r.extra}if(r.offset>r.dmax){e.msg="invalid distance too far back",r.mode=30;break}r.mode=25;case 25:if(0===p)break e;if(w=_-p,r.offset>w){if((w=r.offset-w)>r.whave&&r.sane){e.msg="invalid distance too far back",r.mode=30;break}w>r.wnext?(w-=r.wnext,E=r.wsize-w):E=r.wnext-w,w>r.length&&(w=r.length),S=r.window}else S=c,E=h-r.offset,w=r.length;w>p&&(w=p),p-=w,r.length-=w;do{c[h++]=S[E++]}while(--w);0===r.length&&(r.mode=21);break;case 26:if(0===p)break e;c[h++]=r.length,p--,r.mode=21;break;case 27:if(r.wrap){for(;y<32;){if(0===d)break e;d--,g|=u[l++]<<y,y+=8}if(_-=p,e.total_out+=_,r.total+=_,_&&(e.adler=r.check=r.flags?o(r.check,c,_,h-_):i(r.check,c,_,h-_)),_=p,(r.flags?g:f(g))!==r.check){e.msg="incorrect data check",r.mode=30;break}g=0,y=0}r.mode=28;case 28:if(r.wrap&&r.flags){for(;y<32;){if(0===d)break e;d--,g+=u[l++]<<y,y+=8}if(g!==(4294967295&r.total)){e.msg="incorrect length check",r.mode=30;break}g=0,y=0}r.mode=29;case 29:M=1;break e;case 30:M=-3;break e;case 31:return-4;case 32:default:return-2}return e.next_out=h,e.avail_out=p,e.next_in=l,e.avail_in=d,r.hold=g,r.bits=y,(r.wsize||_!==e.avail_out&&r.mode<30&&(r.mode<27||4!==t))&&m(e,e.output,e.next_out,_-e.avail_out)?(r.mode=31,-4):(b-=e.avail_in,_-=e.avail_out,e.total_in+=b,e.total_out+=_,r.total+=_,r.wrap&&_&&(e.adler=r.check=r.flags?o(r.check,c,_,e.next_out-_):i(r.check,c,_,e.next_out-_)),e.data_type=r.bits+(r.last?64:0)+(12===r.mode?128:0)+(20===r.mode||15===r.mode?256:0),(0===b&&0===_||4===t)&&0===M&&(M=-5),M)},t.inflateEnd=function(e){if(!e||!e.state)return-2;var t=e.state;return t.window&&(t.window=null),e.state=null,0},t.inflateGetHeader=function(e,t){var r;return e&&e.state?0==(2&(r=e.state).wrap)?-2:(r.head=t,t.done=!1,0):-2},t.inflateSetDictionary=function(e,t){var r,n=t.length;return e&&e.state?0!==(r=e.state).wrap&&11!==r.mode?-2:11===r.mode&&i(1,t,n,0)!==r.check?-3:m(e,t,n,n)?(r.mode=31,-4):(r.havedict=1,0):-2},t.inflateInfo="pako inflate (from Nodeca project)"},function(e,t,r){"use strict";e.exports=function(e,t){var r,n,i,o,a,s,f,u,c,l,h,d,p,g,y,v,m,b,_,w,E,S,A,R,k;r=e.state,n=e.next_in,R=e.input,i=n+(e.avail_in-5),o=e.next_out,k=e.output,a=o-(t-e.avail_out),s=o+(e.avail_out-257),f=r.dmax,u=r.wsize,c=r.whave,l=r.wnext,h=r.window,d=r.hold,p=r.bits,g=r.lencode,y=r.distcode,v=(1<<r.lenbits)-1,m=(1<<r.distbits)-1;e:do{p<15&&(d+=R[n++]<<p,p+=8,d+=R[n++]<<p,p+=8),b=g[d&v];t:for(;;){if(d>>>=_=b>>>24,p-=_,0===(_=b>>>16&255))k[o++]=65535&b;else{if(!(16&_)){if(0==(64&_)){b=g[(65535&b)+(d&(1<<_)-1)];continue t}if(32&_){r.mode=12;break e}e.msg="invalid literal/length code",r.mode=30;break e}w=65535&b,(_&=15)&&(p<_&&(d+=R[n++]<<p,p+=8),w+=d&(1<<_)-1,d>>>=_,p-=_),p<15&&(d+=R[n++]<<p,p+=8,d+=R[n++]<<p,p+=8),b=y[d&m];r:for(;;){if(d>>>=_=b>>>24,p-=_,!(16&(_=b>>>16&255))){if(0==(64&_)){b=y[(65535&b)+(d&(1<<_)-1)];continue r}e.msg="invalid distance code",r.mode=30;break e}if(E=65535&b,p<(_&=15)&&(d+=R[n++]<<p,(p+=8)<_&&(d+=R[n++]<<p,p+=8)),(E+=d&(1<<_)-1)>f){e.msg="invalid distance too far back",r.mode=30;break e}if(d>>>=_,p-=_,E>(_=o-a)){if((_=E-_)>c&&r.sane){e.msg="invalid distance too far back",r.mode=30;break e}if(S=0,A=h,0===l){if(S+=u-_,_<w){w-=_;do{k[o++]=h[S++]}while(--_);S=o-E,A=k}}else if(l<_){if(S+=u+l-_,(_-=l)<w){w-=_;do{k[o++]=h[S++]}while(--_);if(S=0,l<w){w-=_=l;do{k[o++]=h[S++]}while(--_);S=o-E,A=k}}}else if(S+=l-_,_<w){w-=_;do{k[o++]=h[S++]}while(--_);S=o-E,A=k}for(;w>2;)k[o++]=A[S++],k[o++]=A[S++],k[o++]=A[S++],w-=3;w&&(k[o++]=A[S++],w>1&&(k[o++]=A[S++]))}else{S=o-E;do{k[o++]=k[S++],k[o++]=k[S++],k[o++]=k[S++],w-=3}while(w>2);w&&(k[o++]=k[S++],w>1&&(k[o++]=k[S++]))}break}}break}}while(n<i&&o<s);n-=w=p>>3,d&=(1<<(p-=w<<3))-1,e.next_in=n,e.next_out=o,e.avail_in=n<i?i-n+5:5-(n-i),e.avail_out=o<s?s-o+257:257-(o-s),r.hold=d,r.bits=p}},function(e,t,r){"use strict";var n=r(11),i=[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],o=[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],a=[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],s=[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];e.exports=function(e,t,r,f,u,c,l,h){var d,p,g,y,v,m,b,_,w,E=h.bits,S=0,A=0,R=0,k=0,x=0,C=0,B=0,T=0,M=0,O=0,I=null,P=0,L=new n.Buf16(16),F=new n.Buf16(16),N=null,U=0;for(S=0;S<=15;S++)L[S]=0;for(A=0;A<f;A++)L[t[r+A]]++;for(x=E,k=15;k>=1&&0===L[k];k--);if(x>k&&(x=k),0===k)return u[c++]=20971520,u[c++]=20971520,h.bits=1,0;for(R=1;R<k&&0===L[R];R++);for(x<R&&(x=R),T=1,S=1;S<=15;S++)if(T<<=1,(T-=L[S])<0)return-1;if(T>0&&(0===e||1!==k))return-1;for(F[1]=0,S=1;S<15;S++)F[S+1]=F[S]+L[S];for(A=0;A<f;A++)0!==t[r+A]&&(l[F[t[r+A]]++]=A);if(0===e?(I=N=l,m=19):1===e?(I=i,P-=257,N=o,U-=257,m=256):(I=a,N=s,m=-1),O=0,A=0,S=R,v=c,C=x,B=0,g=-1,y=(M=1<<x)-1,1===e&&M>852||2===e&&M>592)return 1;for(;;){b=S-B,l[A]<m?(_=0,w=l[A]):l[A]>m?(_=N[U+l[A]],w=I[P+l[A]]):(_=96,w=0),d=1<<S-B,R=p=1<<C;do{u[v+(O>>B)+(p-=d)]=b<<24|_<<16|w|0}while(0!==p);for(d=1<<S-1;O&d;)d>>=1;if(0!==d?(O&=d-1,O+=d):O=0,A++,0==--L[S]){if(S===k)break;S=t[r+l[A]]}if(S>x&&(O&y)!==g){for(0===B&&(B=x),v+=R,T=1<<(C=S-B);C+B<k&&!((T-=L[C+B])<=0);)C++,T<<=1;if(M+=1<<C,1===e&&M>852||2===e&&M>592)return 1;u[g=O&y]=x<<24|C<<16|v-c|0}}return 0!==O&&(u[v+O]=S-B<<24|64<<16|0),h.bits=x,0}},function(e,t,r){"use strict";e.exports={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,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_BUF_ERROR:-5,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,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8}},function(e,t,r){var n=r(0).Buffer,i=[0,1996959894,3993919788,2567524794,124634137,1886057615,3915621685,2657392035,249268274,2044508324,3772115230,2547177864,162941995,2125561021,3887607047,2428444049,498536548,1789927666,4089016648,2227061214,450548861,1843258603,4107580753,2211677639,325883990,1684777152,4251122042,2321926636,335633487,1661365465,4195302755,2366115317,997073096,1281953886,3579855332,2724688242,1006888145,1258607687,3524101629,2768942443,901097722,1119000684,3686517206,2898065728,853044451,1172266101,3705015759,2882616665,651767980,1373503546,3369554304,3218104598,565507253,1454621731,3485111705,3099436303,671266974,1594198024,3322730930,2970347812,795835527,1483230225,3244367275,3060149565,1994146192,31158534,2563907772,4023717930,1907459465,112637215,2680153253,3904427059,2013776290,251722036,2517215374,3775830040,2137656763,141376813,2439277719,3865271297,1802195444,476864866,2238001368,4066508878,1812370925,453092731,2181625025,4111451223,1706088902,314042704,2344532202,4240017532,1658658271,366619977,2362670323,4224994405,1303535960,984961486,2747007092,3569037538,1256170817,1037604311,2765210733,3554079995,1131014506,879679996,2909243462,3663771856,1141124467,855842277,2852801631,3708648649,1342533948,654459306,3188396048,3373015174,1466479909,544179635,3110523913,3462522015,1591671054,702138776,2966460450,3352799412,1504918807,783551873,3082640443,3233442989,3988292384,2596254646,62317068,1957810842,3939845945,2647816111,81470997,1943803523,3814918930,2489596804,225274430,2053790376,3826175755,2466906013,167816743,2097651377,4027552580,2265490386,503444072,1762050814,4150417245,2154129355,426522225,1852507879,4275313526,2312317920,282753626,1742555852,4189708143,2394877945,397917763,1622183637,3604390888,2714866558,953729732,1340076626,3518719985,2797360999,1068828381,1219638859,3624741850,2936675148,906185462,1090812512,3747672003,2825379669,829329135,1181335161,3412177804,3160834842,628085408,1382605366,3423369109,3138078467,570562233,1426400815,3317316542,2998733608,733239954,1555261956,3268935591,3050360625,752459403,1541320221,2607071920,3965973030,1969922972,40735498,2617837225,3943577151,1913087877,83908371,2512341634,3803740692,2075208622,213261112,2463272603,3855990285,2094854071,198958881,2262029012,4057260610,1759359992,534414190,2176718541,4139329115,1873836001,414664567,2282248934,4279200368,1711684554,285281116,2405801727,4167216745,1634467795,376229701,2685067896,3608007406,1308918612,956543938,2808555105,3495958263,1231636301,1047427035,2932959818,3654703836,1088359270,936918e3,2847714899,3736837829,1202900863,817233897,3183342108,3401237130,1404277552,615818150,3134207493,3453421203,1423857449,601450431,3009837614,3294710456,1567103746,711928724,3020668471,3272380065,1510334235,755167117];function o(e){if(n.isBuffer(e))return e;var t="function"==typeof n.alloc&&"function"==typeof n.from;if("number"==typeof e)return t?n.alloc(e):new n(e);if("string"==typeof e)return t?n.from(e):new n(e);throw new Error("input must be buffer, number, or string, received "+typeof e)}function a(e){var t=o(4);return t.writeInt32BE(e,0),t}function s(e,t){e=o(e),n.isBuffer(t)&&(t=t.readUInt32BE(0));for(var r=-1^~~t,a=0;a<e.length;a++)r=i[255&(r^e[a])]^r>>>8;return-1^r}function f(){return a(s.apply(null,arguments))}"undefined"!=typeof Int32Array&&(i=new Int32Array(i)),f.signed=function(){return s.apply(null,arguments)},f.unsigned=function(){return s.apply(null,arguments)>>>0},e.exports=f},function(e,t,r){"use strict";(function(e){var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var i=r(1),o=n(r(12)),a=r(75),s=n(r(76)),f=n(r(77));var u=function(){function e(e,t){void 0===t&&(t=0),this._buffer=e,this._position=t,this.length=e.length}return e.prototype.get=function(){var e=this._buffer[this._position];return this._position+=1,e},e.prototype.getByte=function(){return this.get()},e.prototype.getByteAt=function(e){return this._buffer[e]},e.prototype.position=function(){return this._position},e.prototype.put=function(e){return this._buffer[this._position]=e,this._position+=1,e},e.prototype.putAt=function(e,t){return this._buffer[e]=t,t},e.prototype.setPosition=function(e){return this._position=e,e},e.prototype.getInt=function(){var e=this._buffer.readInt32LE(this._position);return this._position+=4,e},e.prototype.remaining=function(){return this._buffer.length-this._position},e}();t.default=function(t,r,n){if(void 0===n&&(n=0),0===t.length)return r.fill(0),r;var c=new u(t,n),l=c.get();if(0!==l&&1!==l)throw new i.CramMalformedError("Invalid rANS order ".concat(l));if(c.getInt()!==c.remaining()-4)throw new i.CramMalformedError("Incorrect input length.");var h=c.getInt(),d=new u(r||e.allocUnsafe(h));if(d.length<h)throw new i.CramMalformedError("Output buffer too small to fit ".concat(h," bytes."));switch(l){case 0:return function(e,t){for(var r=new o.default.AriDecoder,n=new Array(256),i=0;i<n.length;i+=1)n[i]=new o.default.Symbol;return(0,a.readStatsO0)(e,r,n),(0,s.default)(e,r,n,t),t}(c,d);case 1:return function(e,t){for(var r=new Array(256),n=0;n<r.length;n+=1)r[n]=new o.default.AriDecoder;var i=new Array(256);for(n=0;n<i.length;n+=1){i[n]=new Array(256);for(var s=0;s<i[n].length;s+=1)i[n][s]=new o.default.Symbol}return(0,a.readStatsO1)(e,r,i),(0,f.default)(e,t,r,i),t}(c,d);default:throw new i.CramMalformedError("Invalid rANS order: ".concat(l))}}}).call(this,r(0).Buffer)},function(e,t,r){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.readStatsO1=t.readStatsO0=void 0;var i=r(1),o=r(13),a=n(r(12));function s(e){if(!e)throw new i.CramMalformedError("assertion failed")}t.readStatsO0=function(e,t,r){var n=0,i=0,f=255&e.get();do{null==t.fc[f]&&(t.fc[f]=new a.default.FC),t.fc[f].F=255&e.get(),t.fc[f].F>=128&&(t.fc[f].F&=-129,t.fc[f].F=(127&t.fc[f].F)<<8|255&e.get()),t.fc[f].C=i,a.default.symbolInit(r[f],t.fc[f].C,t.fc[f].F),t.R||(t.R=new Array(o.TOTFREQ)),t.R.fill(f,i,i+t.fc[f].F),i+=t.fc[f].F,0===n&&f+1===(255&e.getByteAt(e.position()))?(f=255&e.get(),n=255&e.get()):0!==n?(n-=1,f+=1):f=255&e.get()}while(0!==f);s(i<o.TOTFREQ)},t.readStatsO1=function(e,t,r){var n=0,i=255&e.get();do{var f=0,u=0,c=255&e.get();null==t[i]&&(t[i]=new a.default.AriDecoder);do{null==t[i].fc[c]&&(t[i].fc[c]=new a.default.FC),t[i].fc[c].F=255&e.get(),t[i].fc[c].F>=128&&(t[i].fc[c].F&=-129,t[i].fc[c].F=(127&t[i].fc[c].F)<<8|255&e.get()),t[i].fc[c].C=u,0===t[i].fc[c].F&&(t[i].fc[c].F=o.TOTFREQ),null==r[i][c]&&(r[i][c]=new a.default.RansDecSymbol),a.default.symbolInit(r[i][c],t[i].fc[c].C,t[i].fc[c].F),null==t[i].R&&(t[i].R=new Array(o.TOTFREQ)),t[i].R.fill(c,u,u+t[i].fc[c].F),s((u+=t[i].fc[c].F)<=o.TOTFREQ),0===f&&c+1===(255&e.getByteAt(e.position()))?(c=255&e.get(),f=255&e.get()):0!==f?(f-=1,c+=1):c=255&e.get()}while(0!==c);0===n&&i+1===(255&e.getByteAt(e.position()))?(i=255&e.get(),n=255&e.get()):0!==n?(n-=1,i+=1):i=255&e.get()}while(0!==i)}},function(e,t,r){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var i=r(1),o=r(13),a=n(r(12));t.default=function(e,t,r,n){for(var s,f=e.getInt(),u=e.getInt(),c=e.getInt(),l=e.getInt(),h=n.remaining(),d=-4&h,p=0;p<d;p+=4){var g=t.R[a.default.get(f,o.TF_SHIFT)],y=t.R[a.default.get(u,o.TF_SHIFT)],v=t.R[a.default.get(c,o.TF_SHIFT)],m=t.R[a.default.get(l,o.TF_SHIFT)];n.putAt(p,g),n.putAt(p+1,y),n.putAt(p+2,v),n.putAt(p+3,m),f=a.default.advanceSymbolStep(f,r[255&g],o.TF_SHIFT),u=a.default.advanceSymbolStep(u,r[255&y],o.TF_SHIFT),c=a.default.advanceSymbolStep(c,r[255&v],o.TF_SHIFT),l=a.default.advanceSymbolStep(l,r[255&m],o.TF_SHIFT),f=a.default.renormalize(f,e),u=a.default.renormalize(u,e),c=a.default.renormalize(c,e),l=a.default.renormalize(l,e)}switch(n.setPosition(d),3&h){case 0:break;case 1:s=t.R[a.default.get(f,o.TF_SHIFT)],a.default.advanceSymbol(f,e,r[255&s],o.TF_SHIFT),n.put(s);break;case 2:s=t.R[a.default.get(f,o.TF_SHIFT)],a.default.advanceSymbol(f,e,r[255&s],o.TF_SHIFT),n.put(s),s=t.R[a.default.get(u,o.TF_SHIFT)],a.default.advanceSymbol(u,e,r[255&s],o.TF_SHIFT),n.put(s);break;case 3:s=t.R[a.default.get(f,o.TF_SHIFT)],a.default.advanceSymbol(f,e,r[255&s],o.TF_SHIFT),n.put(s),s=t.R[a.default.get(u,o.TF_SHIFT)],a.default.advanceSymbol(u,e,r[255&s],o.TF_SHIFT),n.put(s),s=t.R[a.default.get(c,o.TF_SHIFT)],a.default.advanceSymbol(c,e,r[255&s],o.TF_SHIFT),n.put(s);break;default:throw new i.CramMalformedError("invalid output size encountered during rANS decoding")}n.setPosition(0)}},function(e,t,r){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var i=r(13),o=n(r(12));t.default=function(e,t,r,n){for(var a=t.remaining(),s=e.getInt(),f=e.getInt(),u=e.getInt(),c=e.getInt(),l=a>>2,h=0,d=l,p=2*l,g=3*l,y=0,v=0,m=0,b=0;h<l;h+=1,d+=1,p+=1,g+=1){var _=255&r[y].R[o.default.get(s,i.TF_SHIFT)],w=255&r[v].R[o.default.get(f,i.TF_SHIFT)],E=255&r[m].R[o.default.get(u,i.TF_SHIFT)],S=255&r[b].R[o.default.get(c,i.TF_SHIFT)];t.putAt(h,_),t.putAt(d,w),t.putAt(p,E),t.putAt(g,S),s=o.default.advanceSymbolStep(s,n[y][_],i.TF_SHIFT),f=o.default.advanceSymbolStep(f,n[v][w],i.TF_SHIFT),u=o.default.advanceSymbolStep(u,n[m][E],i.TF_SHIFT),c=o.default.advanceSymbolStep(c,n[b][S],i.TF_SHIFT),s=o.default.renormalize(s,e),f=o.default.renormalize(f,e),u=o.default.renormalize(u,e),c=o.default.renormalize(c,e),y=_,v=w,m=E,b=S}for(;g<a;g+=1){S=255&r[b].R[o.default.get(c,i.TF_SHIFT)];t.putAt(g,S),c=o.default.advanceSymbol(c,e,n[b][S],i.TF_SHIFT),b=S}}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getSectionParsers=t.cramFileDefinition=void 0;var n=r(79),i=(new n.Parser).itf8(),o={parser:(new n.Parser).string("magic",{length:4}).uint8("majorVersion").uint8("minorVersion").string("fileId",{length:20,stripNull:!0}),maxLength:26};t.cramFileDefinition=o;var a={parser:(new n.Parser).uint8("compressionMethod",{formatter:function(e){var t=["raw","gzip","bzip2","lzma","rans","rans4x16","arith","fqzcomp","tok3"][e];if(!t)throw new Error("compression method number ".concat(e," not implemented"));return t}}).uint8("contentType",{formatter:function(e){var t=["FILE_HEADER","COMPRESSION_HEADER","MAPPED_SLICE_HEADER","UNMAPPED_SLICE_HEADER","EXTERNAL_DATA","CORE_DATA"][e];if(!t)throw new Error("invalid block content type id ".concat(e));return t}}).itf8("contentId").itf8("compressedSize").itf8("uncompressedSize"),maxLength:17},s={parser:(new n.Parser).uint32("crc32"),maxLength:4},f=(new n.Parser).itf8("size").buffer("ents",{length:"size",formatter:function(e){function t(t,r){for(var n=e.toString("utf8",t,r),i=[],o=0;o<n.length;o+=3)i.push(n.substr(o,3));return i}var r,n=[],i=0;for(r=0;r<e.length;r+=1)e[r]||(n.push(t(i,r)),i=r+1);return r>i&&n.push(t(i,r)),n}}),u=(new n.Parser).uint8(null,{formatter:function(e){return!!e}}),c=(new n.Parser).itf8("mapSize").itf8("mapCount").array("ents",{length:"mapCount",type:(new n.Parser).string("key",{length:2,stripNull:!1}).choice("value",{tag:"key",choices:{MI:u,UI:u,PI:u,RN:u,AP:u,RR:u,SM:(new n.Parser).array(null,{type:"uint8",length:5}),TD:(new n.Parser).nest(null,{type:f,formatter:function(e){return e.ents}})}})});function l(e){for(var t={},r=0;r<e.ents.length;r+=1){var n=e.ents[r],i=n.key,o=n.value;t[i]&&console.warn("duplicate key ".concat(i," in map")),t[i]=o}return t}var h={cramFileDefinition:o,cramBlockHeader:a,cramBlockCrc32:s},d={cramUnmappedSliceHeader:function(e){var t=0,r=(new n.Parser).itf8("numRecords");t+=5,e>=3?(r=r.ltf8("recordCounter"),t+=9):2===e&&(r=r.itf8("recordCounter"),t+=5),r=r.itf8("numBlocks").itf8("numContentIds").array("contentIds",{type:i,length:"numContentIds"}),t+=10,e>=2&&(r=r.array("md5",{type:"uint8",length:16}),t+=16);return{parser:r,maxLength:function(e){return t+5*e}}},cramMappedSliceHeader:function(e){var t=(new n.Parser).itf8("refSeqId").itf8("refSeqStart").itf8("refSeqSpan").itf8("numRecords"),r=20;e>=3?(t=t.ltf8("recordCounter"),r+=9):2===e&&(t=t.itf8("recordCounter"),r+=5),t=t.itf8("numBlocks").itf8("numContentIds").array("contentIds",{type:i,length:"numContentIds"}).itf8("refBaseBlockId"),r+=15,e>=2&&(t=t.array("md5",{type:"uint8",length:16}),r+=16);return{parser:t,maxLength:function(e){return r+5*e}}},cramEncoding:function(e){return{parser:(new n.Parser).namely("cramEncoding").itf8("codecId").itf8("parametersBytes").choice("parameters",{tag:"codecId",choices:{0:new n.Parser,1:(new n.Parser).itf8("blockContentId"),2:(new n.Parser).itf8("offset").itf8("M"),3:n.Parser.start().itf8("numCodes").array("symbols",{length:"numCodes",type:i}).itf8("numLengths").array("bitLengths",{length:"numLengths",type:i}),4:n.Parser.start().nest("lengthsEncoding",{type:"cramEncoding"}).nest("valuesEncoding",{type:"cramEncoding"}),5:(new n.Parser).uint8("stopByte")[e>1?"itf8":"int"]("blockContentId"),6:(new n.Parser).itf8("offset").itf8("length"),7:(new n.Parser).itf8("offset").itf8("K"),8:(new n.Parser).itf8("offset").itf8("log2m"),9:(new n.Parser).itf8("offset")}})}},cramDataSeriesEncodingMap:function(e){return(new n.Parser).itf8("mapSize").itf8("mapCount").array("ents",{length:"mapCount",type:(new n.Parser).string("key",{length:2,stripNull:!1}).nest("value",{type:this.cramEncoding(e).parser})})},cramTagEncodingMap:function(e){return(new n.Parser).itf8("mapSize").itf8("mapCount").array("ents",{length:"mapCount",type:(new n.Parser).itf8("key",{formatter:function(e){return String.fromCharCode(e>>16&255)+String.fromCharCode(e>>8&255)+String.fromCharCode(255&e)}}).nest("value",{type:this.cramEncoding(e).parser})})},cramCompressionHeader:function(e){var t=new n.Parser;return{parser:t=t.nest("preservation",{type:c,formatter:l}).nest("dataSeriesEncoding",{type:this.cramDataSeriesEncodingMap(e),formatter:l}).nest("tagEncoding",{type:this.cramTagEncodingMap(e),formatter:l})}},cramContainerHeader1:function(e){var t=(new n.Parser).int32("length").itf8("refSeqId").itf8("refSeqStart").itf8("alignmentSpan").itf8("numRecords"),r=24;return e>=3?(t=t.ltf8("recordCounter"),r+=9):2===e&&(t=t.itf8("recordCounter"),r+=5),e>1&&(t=t.ltf8("numBases"),r+=9),{parser:t=t.itf8("numBlocks").itf8("numLandmarks"),maxLength:r+=10}},cramContainerHeader2:function(e){var t=(new n.Parser).itf8("numLandmarks").array("landmarks",{type:(new n.Parser).itf8(),length:"numLandmarks"}),r=0;return e>=3&&(t=t.uint32("crc32"),r=4),{parser:t,maxLength:function(e){return 5+5*e+r}}}};t.getSectionParsers=function(e){var t=Object.assign({},h);return Object.keys(d).forEach((function(r){t[r]=d[r](e)})),t}},function(e,t,r){"use strict";function n(e){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}var i=r(0).Buffer,o=r(80),a=r(81).Context,s=r(36);"undefined"!=typeof window&&(window.Buffer=i),"undefined"!=typeof self&&(self.Buffer=i);var f={UInt8:1,UInt16LE:2,UInt16BE:2,UInt32LE:4,UInt32BE:4,Int8:1,Int16LE:2,Int16BE:2,Int32LE:4,Int32BE:4,FloatLE:4,FloatBE:4,DoubleLE:8,DoubleBE:8,UInt64:8,Int64:8},u={},c=[];!function(){var e;for(e=1;e<=32;e++)c.push(e)}();var l={};Object.keys(f).concat(Object.keys({String:null,Buffer:null,Array:null,Skip:null,Choice:null,Nest:null,Bit:null,Itf8:null,Ltf8:null})).forEach((function(e){l[e.toLowerCase()]=e}));var h=function(){this.varName="",this.type="",this.options={},this.next=null,this.head=null,this.compiled=null,this.endian="le",this.constructorFn=null,this.alias=null};h.start=function(){return new h},Object.keys(f).forEach((function(e){h.prototype[e.toLowerCase()]=function(t,r){return this.setNextParser(e.toLowerCase(),t,r)};var t=e.replace(/BE|LE/,"").toLowerCase();t in h.prototype||(h.prototype[t]=function(e,r){return this[t+this.endian](e,r)})})),c.forEach((function(e){h.prototype["bit".concat(e.toString())]=function(t,r){return r||(r={}),r.length=e,this.setNextParser("bit",t,r)}})),h.prototype.namely=function(e){return u[e]=this,this.alias=e,this},h.prototype.skip=function(e,t){if(t&&t.assert)throw new Error("assert option on skip is not allowed.");return this.setNextParser("skip","",{length:e})},h.prototype.string=function(e,t){if(!t.zeroTerminated&&!t.length&&!t.greedy)throw new Error("Neither length, zeroTerminated, nor greedy is defined for string.");if((t.zeroTerminated||t.length)&&t.greedy)throw new Error("greedy is mutually exclusive with length and zeroTerminated for string.");if(t.stripNull&&!t.length&&!t.greedy)throw new Error("Length or greedy must be defined if stripNull is defined.");return t.encoding=t.encoding||"utf8",this.setNextParser("string",e,t)},h.prototype.buffer=function(e,t){if(!t.length&&!t.readUntil)throw new Error("Length nor readUntil is defined in buffer parser");return this.setNextParser("buffer",e,t)},h.prototype.array=function(e,t){if(!t.readUntil&&!t.length&&!t.lengthInBytes)throw new Error("Length option of array is not defined.");if(!t.type)throw new Error("Type option of array is not defined.");if("string"==typeof t.type&&!u[t.type]&&Object.keys(f).indexOf(l[t.type])<0)throw new Error('Specified primitive type "'.concat(t.type,'" is not supported.'));return this.setNextParser("array",e,t)},h.prototype.choice=function(e,t){if(1===arguments.length&&"object"===n(e)&&(t=e,e=null),!t.tag)throw new Error("Tag option of array is not defined.");if(!t.choices)throw new Error("Choices option of array is not defined.");return Object.keys(t.choices).forEach((function(r){if(!t.choices[r])throw new Error("Choice Case ".concat(r," of ").concat(e," is not valid."));if("string"==typeof t.choices[r]&&!u[t.choices[r]]&&Object.keys(f).indexOf(l[t.choices[r]])<0)throw new Error('Specified primitive type "'.concat(t.choices[r],'" is not supported.'))}),this),this.setNextParser("choice",e,t)},h.prototype.nest=function(e,t){if(1===arguments.length&&"object"===n(e)&&(t=e,e=null),!t.type)throw new Error("Type option of nest is not defined.");if(!(t.type instanceof h||u[t.type]))throw new Error("Type option of nest must be a Parser object.");if(!(t.type instanceof h||e))throw new Error("options.type must be a object if variable name is omitted.");return this.setNextParser("nest",e,t)},h.prototype.endianess=function(e){switch(e.toLowerCase()){case"little":this.endian="le";break;case"big":this.endian="be";break;default:throw new Error("Invalid endianess: ".concat(e))}return this},h.prototype.create=function(e){if(!(e instanceof Function))throw new Error("Constructor must be a Function object.");return this.constructorFn=e,this},h.prototype.getCode=function(){var e=new a;return e.pushCode("if (!Buffer.isBuffer(buffer)) {"),e.generateError('"argument buffer is not a Buffer object"'),e.pushCode("}"),this.alias?this.addAliasedCode(e):this.addRawCode(e),this.alias?e.pushCode("return {0}(0)","___parser_"+this.alias):e.pushCode("return { offset: offset, result: vars };"),e.code},h.prototype.addRawCode=function(e){e.pushCode("var offset = 0;"),this.constructorFn?e.pushCode("var vars = new constructorFn();"):e.pushCode("var vars = {};"),this.generate(e),this.resolveReferences(e),e.pushCode("return { offset: offset, result: vars };")},h.prototype.addAliasedCode=function(e){return e.pushCode("function {0}(offset) {","___parser_"+this.alias),this.constructorFn?e.pushCode("var vars = new constructorFn();"):e.pushCode("var vars = {};"),this.generate(e),e.markResolved(this.alias),this.resolveReferences(e),e.pushCode("return { offset: offset, result: vars };"),e.pushCode("}"),e},h.prototype.resolveReferences=function(e){var t=e.getUnresolvedReferences();e.markRequested(t),t.forEach((function(t){u[t].addAliasedCode(e)}))},h.prototype.compile=function(){var e="(function(buffer, constructorFn, Long) { ".concat(this.getCode()," })");this.compiled=o.runInThisContext(e)},h.prototype.sizeOf=function(){var e=NaN;if(Object.keys(f).indexOf(this.type)>=0)e=f[this.type];else if("String"===this.type&&"number"==typeof this.options.length)e=this.options.length;else if("Buffer"===this.type&&"number"==typeof this.options.length)e=this.options.length;else if("Array"===this.type&&"number"==typeof this.options.length){var t=NaN;"string"==typeof this.options.type?t=f[l[this.options.type]]:this.options.type instanceof h&&(t=this.options.type.sizeOf()),e=this.options.length*t}else"Skip"===this.type?e=this.options.length:"Nest"===this.type?e=this.options.type.sizeOf():this.type||(e=0);return this.next&&(e+=this.next.sizeOf()),e},h.prototype.parse=function(e){return this.compiled||this.compile(),this.compiled(e,this.constructorFn,s)},h.prototype.setNextParser=function(e,t,r){var n=new h;return n.type=l[e],n.varName=t,n.options=r||n.options,n.endian=this.endian,this.head?this.head.next=n:this.next=n,this.head=n,this},h.prototype.generate=function(e){this.type&&(this["generate".concat(this.type)](e),this.generateAssert(e));var t=e.generateVariable(this.varName);return this.options.formatter&&this.generateFormatter(e,t,this.options.formatter),this.generateNext(e)},h.prototype.generateAssert=function(e){if(this.options.assert){var t=e.generateVariable(this.varName);switch(n(this.options.assert)){case"function":e.pushCode("if (!({0}).call(vars, {1})) {",this.options.assert,t);break;case"number":e.pushCode("if ({0} !== {1}) {",this.options.assert,t);break;case"string":e.pushCode('if ("{0}" !== {1}) {',this.options.assert,t);break;default:throw new Error("Assert option supports only strings, numbers and assert functions.")}e.generateError('"Assert error: {0} is " + {0}',t),e.pushCode("}")}},h.prototype.generateNext=function(e){return this.next&&(e=this.next.generate(e)),e},Object.keys(f).forEach((function(e){h.prototype["generate".concat(e)]=function(t){"UInt64"===e?t.pushCode("{0} = Long.fromBytes(buffer.slice(offset,offset+8), true, this.endian === 'le').toNumber();",t.generateVariable(this.varName),e):"Int64"===e?t.pushCode("{0} = Long.fromBytes(buffer.slice(offset,offset+8), false, this.endian === 'le').toNumber();",t.generateVariable(this.varName),e):t.pushCode("{0} = buffer.read{1}(offset);",t.generateVariable(this.varName),e),t.pushCode("offset += {0};",f[e])}})),h.prototype.generateBit=function(e){var t=JSON.parse(JSON.stringify(this));if(t.varName=e.generateVariable(t.varName),e.bitFields.push(t),!this.next||this.next&&["Bit","Nest"].indexOf(this.next.type)<0){var r=0;e.bitFields.forEach((function(e){r+=e.options.length}));var n=e.generateTmpVariable();if(r<=8)e.pushCode("var {0} = buffer.readUInt8(offset);",n),r=8;else if(r<=16)e.pushCode("var {0} = buffer.readUInt16BE(offset);",n),r=16;else if(r<=24){var i=e.generateTmpVariable(),o=e.generateTmpVariable();e.pushCode("var {0} = buffer.readUInt16BE(offset);",i),e.pushCode("var {0} = buffer.readUInt8(offset + 2);",o),e.pushCode("var {2} = ({0} << 8) | {1};",i,o,n),r=24}else{if(!(r<=32))throw new Error("Currently, bit field sequence longer than 4-bytes is not supported.");e.pushCode("var {0} = buffer.readUInt32BE(offset);",n),r=32}e.pushCode("offset += {0};",r/8);var a=0,s="be"===this.endian;e.bitFields.forEach((function(t){e.pushCode("{0} = {1} >> {2} & {3};",t.varName,n,s?r-a-t.options.length:a,(1<<t.options.length)-1),a+=t.options.length})),e.bitFields=[]}},h.prototype.generateSkip=function(e){var t=e.generateOption(this.options.length);e.pushCode("offset += {0};",t)},h.prototype.generateString=function(e){var t=e.generateVariable(this.varName),r=e.generateTmpVariable();this.options.length&&this.options.zeroTerminated?(e.pushCode("var {0} = offset;",r),e.pushCode("while(buffer.readUInt8(offset++) !== 0 && offset - {0} < {1});",r,this.options.length),e.pushCode("{0} = buffer.toString('{1}', {2}, offset - {2} < {3} ? offset - 1 : offset);",t,this.options.encoding,r,this.options.length)):this.options.length?(e.pushCode("{0} = buffer.toString('{1}', offset, offset + {2});",t,this.options.encoding,e.generateOption(this.options.length)),e.pushCode("offset += {0};",e.generateOption(this.options.length))):this.options.zeroTerminated?(e.pushCode("var {0} = offset;",r),e.pushCode("while(buffer.readUInt8(offset++) !== 0);"),e.pushCode("{0} = buffer.toString('{1}', {2}, offset - 1);",t,this.options.encoding,r)):this.options.greedy&&(e.pushCode("var {0} = offset;",r),e.pushCode("while(buffer.length > offset++);"),e.pushCode("{0} = buffer.toString('{1}', {2}, offset);",t,this.options.encoding,r)),this.options.stripNull&&e.pushCode("{0} = {0}.replace(/\\x00+$/g, '')",t)},h.prototype.generateBuffer=function(e){"eof"===this.options.readUntil?e.pushCode("{0} = buffer.slice(offset);",e.generateVariable(this.varName)):(e.pushCode("{0} = buffer.slice(offset, offset + {1});",e.generateVariable(this.varName),e.generateOption(this.options.length)),e.pushCode("offset += {0};",e.generateOption(this.options.length))),this.options.clone&&e.pushCode("{0} = Buffer.from({0});",e.generateVariable(this.varName))},h.prototype.generateArray=function(e){var t=e.generateOption(this.options.length),r=e.generateOption(this.options.lengthInBytes),n=this.options.type,i=e.generateTmpVariable(),o=e.generateVariable(this.varName),a=e.generateTmpVariable(),s=this.options.key,c="string"==typeof s;if(c?e.pushCode("{0} = {};",o):e.pushCode("{0} = [];",o),"function"==typeof this.options.readUntil?e.pushCode("do {"):"eof"===this.options.readUntil?e.pushCode("for (var {0} = 0; offset < buffer.length; {0}++) {",i):void 0!==r?e.pushCode("for (var {0} = offset; offset - {0} < {1}; ) {",i,r):e.pushCode("for (var {0} = 0; {0} < {1}; {0}++) {",i,t),"string"==typeof n)if(u[n]){var d=e.generateTmpVariable();e.pushCode("var {0} = {1}(offset);",d,"___parser_"+n),e.pushCode("var {0} = {1}.result; offset = {1}.offset;",a,d),n!==this.alias&&e.addReference(n)}else e.pushCode("var {0} = buffer.read{1}(offset);",a,l[n]),e.pushCode("offset += {0};",f[l[n]]);else n instanceof h&&(e.pushCode("var {0} = {};",a),e.pushScope(a),n.generate(e),e.popScope());c?e.pushCode("{0}[{2}.{1}] = {2};",o,s,a):e.pushCode("{0}.push({1});",o,a),e.pushCode("}"),"function"==typeof this.options.readUntil&&e.pushCode(" while (!({0}).call(this, {1}, buffer.slice(offset)));",this.options.readUntil,a)},h.prototype.generateChoiceCase=function(e,t,r){if("string"==typeof r)if(u[r]){var n=e.generateTmpVariable();e.pushCode("var {0} = {1}(offset);",n,"___parser_"+r),e.pushCode("{0} = {1}.result; offset = {1}.offset;",e.generateVariable(this.varName),n),r!==this.alias&&e.addReference(r)}else e.pushCode("{0} = buffer.read{1}(offset);",e.generateVariable(this.varName),l[r]),e.pushCode("offset += {0};",f[l[r]]);else r instanceof h&&(e.pushPath(t),r.generate(e),e.popPath(t))},h.prototype.generateChoice=function(e){var t=e.generateOption(this.options.tag);this.varName&&e.pushCode("{0} = {};",e.generateVariable(this.varName)),e.pushCode("switch({0}) {",t),Object.keys(this.options.choices).forEach((function(t){var r=this.options.choices[t];Number.isNaN(parseInt(t,10))?e.pushCode("case '{0}':",t):e.pushCode("case {0}:",t),this.generateChoiceCase(e,this.varName,r),e.pushCode("break;")}),this),e.pushCode("default:"),this.options.defaultChoice?this.generateChoiceCase(e,this.varName,this.options.defaultChoice):e.generateError('"Met undefined tag value " + {0} + " at choice"',t),e.pushCode("}")},h.prototype.generateNest=function(e){var t=e.generateVariable(this.varName);if(this.options.type instanceof h)this.varName&&e.pushCode("{0} = {};",t),e.pushPath(this.varName),this.options.type.generate(e),e.popPath(this.varName);else if(u[this.options.type]){var r=e.generateTmpVariable();e.pushCode("var {0} = {1}(offset);",r,"___parser_"+this.options.type),e.pushCode("{0} = {1}.result; offset = {1}.offset;",t,r),this.options.type!==this.alias&&e.addReference(this.options.type)}},h.prototype.generateFormatter=function(e,t,r){"function"==typeof r&&e.pushCode("{0} = ({1}).call(this, {0});",t,r)},h.prototype.isInteger=function(){return!!this.type.match(/U?Int[8|16|32][BE|LE]?|Bit\d+/)},h.prototype.itf8=function(e,t){return this.setNextParser("itf8",e,t)},h.prototype.itf8=function(e,t){return this.setNextParser("itf8",e,t)},h.prototype.generateItf8=function(e){var t=e.generateVariable(this.varName),r=e.generateTmpVariable();e.pushCode("\n var ".concat(r," = buffer[offset];\n if (").concat(r," < 0x80) {\n ").concat(t," = ").concat(r,";\n offset += 1;\n } else if (").concat(r," < 0xc0) {\n ").concat(t," = ((").concat(r,"<<8) | buffer[offset+1]) & 0x3fff;\n offset += 2;\n } else if (").concat(r," < 0xe0) {\n ").concat(t," = ((").concat(r,"<<16) | (buffer[offset+1]<< 8) | buffer[offset+2]) & 0x1fffff;\n offset += 3;\n } else if (").concat(r," < 0xf0) {\n ").concat(t," = ((").concat(r,"<<24) | (buffer[offset+1]<<16) | (buffer[offset+2]<<8) | buffer[offset+3]) & 0x0fffffff;\n offset += 4\n } else {\n ").concat(t," = ((").concat(r," & 0x0f)<<28) | (buffer[offset+1]<<20) | (buffer[offset+2]<<12) | (buffer[offset+3]<<4) | (buffer[offset+4] & 0x0f);\n // x=((0xff & 0x0f)<<28) | (0xff<<20) | (0xff<<12) | (0xff<<4) | (0x0f & 0x0f);\n // TODO *val_p = uv < 0x80000000UL ? uv : -((int32_t) (0xffffffffUL - uv)) - 1;\n offset += 5\n }\n "))},h.prototype.ltf8=function(e,t){return this.setNextParser("ltf8",e,t)},h.prototype.generateLtf8=function(e){var t=e.generateVariable(this.varName),r=e.generateTmpVariable();e.pushCode("\n var ".concat(r," = buffer[offset];\n if (").concat(r," < 0x80) {\n ").concat(t," = ").concat(r,";\n offset += 1;\n } else if (").concat(r," < 0xc0) {\n ").concat(t," = ((buffer[offset]<<8) | buffer[offset+1]) & 0x3fff;\n offset += 2;\n } else if (").concat(r," < 0xe0) {\n ").concat(t," = ((buffer[offset]<<16) | (buffer[offset+1]<<8) | buffer[offset+2]) & 0x1fffff;\n ").concat(t," = (((").concat(r," & 63) << 16) | buffer.readUInt16LE(offset + 1));\n offset += 3;\n } else if (").concat(r," < 0xf0) {\n ").concat(t," = ((buffer[offset]<<24) | (buffer[offset+1]<<16) | (buffer[offset+2]<<8) | buffer[offset+3]) & 0x0fffffff;\n offset += 4;\n } else if (").concat(r," < 0xf8) {\n ").concat(t," = (((buffer[offset] & 15) * Math.pow(2,32))) +\n (buffer[offset+1]<<24) | (buffer[offset+2]<<16 | buffer[offset+3]<<8 | buffer[offset+4])\n // TODO *val_p = uv < 0x80000000UL ? uv : -((int32_t) (0xffffffffUL - uv)) - 1;\n offset += 5;\n } else if (").concat(r," < 0xfc) {\n ").concat(t," = ((((buffer[offset] & 7) << 8) | buffer[offset+1] )) * Math.pow(2,32) +\n (buffer[offset+2]<<24) | (buffer[offset+3]<<16 | buffer[offset+4]<<8 | buffer[offset+5])\n offset += 6;\n } else if (").concat(r," < 0xfe) {\n ").concat(t," = ((((buffer[offset] & 3) << 16) | buffer[offset+1]<<8 | buffer[offset+2])) * Math.pow(2,32) +\n (buffer[offset+3]<<24) | (buffer[offset+4]<<16 | buffer[offset+5]<<8 | buffer[offset+6])\n offset += 7;\n } else if (").concat(r," < 0xff) {\n ").concat(t," = Long.fromBytesBE(buffer.slice(offset+1,offset+8));\n if (").concat(t,".greaterThan(Number.MAX_SAFE_INTEGER) || ").concat(t,".lessThan(Number.MIN_SAFE_INTEGER))\n throw new Error('integer overflow')\n ").concat(t," = ").concat(t,".toNumber()\n offset += 8;\n } else {\n ").concat(t," = Long.fromBytesBE(buffer.slice(offset+1,offset+9));\n if (").concat(t,".greaterThan(Number.MAX_SAFE_INTEGER) || ").concat(t,".lessThan(Number.MIN_SAFE_INTEGER))\n throw new Error('integer overflow')\n ").concat(t," = ").concat(t,".toNumber()\n offset += 9;\n }\n "))},t.Parser=h},function(e,t){e.exports.runInThisContext=function(e){return new Function("code","return eval(code);").call(globalThis,e)}},function(e,t,r){"use strict";function n(e){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}var i=function(){this.code="",this.scopes=[["vars"]],this.isAsync=!1,this.bitFields=[],this.tmpVariableCount=0,this.references={}};i.prototype.generateVariable=function(e){var t=[];for(Array.prototype.push.apply(t,this.scopes[this.scopes.length-1]);/^\$parent\./.test(e);)t.pop(),e=e.replace(/^\$parent\./,"");return e&&t.push(e),t.join(".")},i.prototype.generateOption=function(e){switch(n(e)){case"number":return e.toString();case"string":return this.generateVariable(e);case"function":return"(".concat(e,").call(").concat(this.generateVariable(),", vars)");default:return}},i.prototype.generateError=function(){var e=Array.prototype.slice.call(arguments),t=i.interpolate.apply(this,e);this.isAsync?this.pushCode("return process.nextTick(function() { callback(new Error(".concat(t,"), vars); });")):this.pushCode("throw new Error(".concat(t,");"))},i.prototype.generateTmpVariable=function(){return"$tmp".concat(this.tmpVariableCount++)},i.prototype.pushCode=function(){var e=Array.prototype.slice.call(arguments);this.code+="".concat(i.interpolate.apply(this,e),"\n")},i.prototype.pushPath=function(e){e&&this.scopes[this.scopes.length-1].push(e)},i.prototype.popPath=function(e){e&&this.scopes[this.scopes.length-1].pop()},i.prototype.pushScope=function(e){this.scopes.push([e])},i.prototype.popScope=function(){this.scopes.pop()},i.prototype.addReference=function(e){this.references[e]||(this.references[e]={resolved:!1,requested:!1})},i.prototype.markResolved=function(e){this.references[e].resolved=!0},i.prototype.markRequested=function(e){e.forEach(function(e){this.references[e].requested=!0}.bind(this))},i.prototype.getUnresolvedReferences=function(){var e=this.references;return Object.keys(this.references).filter((function(t){return!e[t].resolved&&!e[t].requested}))},i.interpolate=function(e){var t=/{\d+}/g,r=e.match(t),n=Array.prototype.slice.call(arguments,1);return r&&r.forEach((function(t){var r=parseInt(t.substr(1,t.length-2),10);e=e.replace(t,n[r].toString())})),e},t.Context=i},function(e,t,r){"use strict";(function(t){var n=r(83),i=r(37),o=r(38),a=r(85),s=r(86);e.exports={r4x8_uncompress:function(e,t){n.decode(e).copy(t,0,0)},r4x16_uncompress:function(e,t){i.decode(e).copy(t,0,0)},arith_uncompress:function(e,t){o.decode(e).copy(t,0,0)},fqzcomp_uncompress:function(e,t){var r=new Array;a.decode(e,r).copy(t,0,0)},tok3_uncompress:function(e,r){var n=s.decode(e,0,"\0");t.from(n,"binary").copy(r,0,0)}}}).call(this,r(0).Buffer)},function(e,t,r){(function(t){const n=r(8);function i(e){return 4095&e}function o(e,t){for(var r=0;t>=e[r+1];)r++;return r}function a(e){for(var t=new Array(4096),r=0,n=0;n<4096;n++){for(;n>=e[r+1];)r++;t[n]=r}return t}function s(e,t,r){return r*(e>>12)+(4095&e)-t}function f(e,t){for(;t<1<<23;)t=(t<<8)+e.ReadByte();return t}function u(e,t){t.WriteByteNeg(e>>24&255),t.WriteByteNeg(e>>16&255),t.WriteByteNeg(e>>8&255),t.WriteByteNeg(e>>0&255)}function c(e,t,r,n,i){return e=function(e,t,r,n){for(var i=(1<<23>>n<<8)*r;e>=i;)t.WriteByteNeg(255&e),e>>=8;return e}(e,t,n,i),e=(Math.floor(e/n)<<i)+e%n+r}function l(e,t,r){for(var n=0;n<256;n++)t[n]=0;var i=e.ReadByte(),o=i,a=0;do{var s=e.ReadITF8();t[i]=s,a>0?(a--,i++):(i=e.ReadByte())==o+1&&(a=e.ReadByte()),o=i}while(0!=i);r[0]=0;for(n=0;n<=255;n++)r[n+1]=r[n]+t[n]}function h(e){for(var t=0,r=0;r<256;r++)t+=e[r];var n=4096/t;do{var i=0,o=0,a=0;t=0;for(r=0;r<256;r++)0!=e[r]&&(i<e[r]&&(i=e[r],o=r),e[r]=Math.floor(e[r]*n),0==e[r]&&(e[r]=1),t+=e[r]);t<4096?e[o]+=4096-t:t-4096<e[o]/2&&e[o]>2?e[o]-=t-4096:4096!=t&&(n*=.99,a=1)}while(a)}function d(e,t){for(var r=0,n=0;n<256;n++)if(t[n]){if(r>0)r--;else if(e.WriteByte(n),n>0&&t[n-1]>0){for(r=n+1;r<256&&t[r];r++);r-=n+1,e.WriteByte(r)}e.WriteITF8(t[n])}e.WriteByte(0)}e.exports={decode:function(e){var r=new n(e),u=r.ReadByte(),c=(r.ReadUint32(),r.ReadUint32());return 0==u?function(e,r){var n=new Array(256),o=new Array(256);l(e,n,o);for(var u=a(o),c=new Array(4),h=0;h<4;h++)c[h]=e.ReadUint32();var d=new t.allocUnsafe(r);for(h=0;h<r;h++){var p=h%4,g=i(c[p]),y=u[g];d[h]=y,c[p]=s(c[p],o[y],n[y]),c[p]=f(e,c[p])}return d}(r,c):function(e,r){var n=new Array(256),u=new Array(256);!function(e,t,r){for(var n=0;n<256;n++){t[n]=new Array(256),r[n]=new Array(256);for(var i=0;i<256;i++)t[n][i]=0}var o=e.ReadByte(),a=o,s=0;do{l(e,t[o],r[o]),s>0?(s--,o++):(o=e.ReadByte())==a+1&&(s=e.ReadByte()),a=o}while(0!=o)}(e,n,u);for(var c=new Array(256),h=0;h<256;h++)c[h]=a(u[h]);for(var d=new Array(4),p=new Array(4),g=0;g<4;g++)d[g]=e.ReadUint32(),p[g]=0;var y=new t.allocUnsafe(r),v=Math.floor(r/4);for(h=0;h<v;h++)for(g=0;g<4;g++){var m=i(d[g]),b=c[p[g]][m];y[h+g*v]=b,d[g]=s(d[g],u[p[g]][b],n[p[g]][b]),d[g]=f(e,d[g]),p[g]=b}h*=4;for(;h<r;){m=i(d[3]),b=o(u[p[3]],m);y[h++]=b,d[3]=s(d[3],u[p[3]][b],n[p[3]][b]),d[3]=f(e,d[3]),p[3]=b}return y}(r,c)},encode:function(e,r){return 0==r?function(e){const r=e.length;var i=new n("",0,780);i.WriteByte(0),i.WriteUint32(0),i.WriteUint32(0);var o=new Array(256);(function(e,t){for(var r=0;r<256;r++)t[r]=0;for(r=0;r<e.length;r++)t[e[r]]++})(e,o),h(o),d(i,o);var a=new Array(256);a[0]=0;for(var s=1;s<256;s++)a[s]=a[s-1]+o[s-1];var f=new Array(4);for(s=0;s<4;s++)f[s]=1<<23;var l=Math.floor(1.05*r+100),p=new n("",l,l);for(s=r-1;s>=0;s--)f[s%4]=c(f[s%4],p,a[e[s]],o[e[s]],12);for(s=3;s>=0;s--)u(f[s],p);var g=i.pos;return i.buf.writeInt32LE(g-9+(p.length-p.pos),1),i.buf.writeInt32LE(r,5),t.concat([i.buf.slice(0,i.pos),p.buf.slice(p.pos,p.length)],i.pos+p.length-p.pos)}(e):function(e){const r=e.length;var i=new n("",0,198156);i.WriteByte(1),i.WriteUint32(0),i.WriteUint32(0);for(var o=new Array(256),a=new Array(256),s=new Array(256),f=0;f<256;f++)a[f]=new Array(256),s[f]=new Array(256);(function(e,t,r){for(var n=0;n<256;n++){r[n]=0;for(var i=0;i<256;i++)t[n][i]=0}var o=0;for(n=0;n<e.length;n++)r[e[n]]++,t[o][e[n]]++,o=e[n];t[0][e[1*(e.length>>2)]]++,t[0][e[2*(e.length>>2)]]++,t[0][e[3*(e.length>>2)]]++,r[0]+=3})(e,a,o),function(e,t){for(var r=0;r<256;r++)t[r]&&h(e[r])}(a,o),function(e,t,r){for(var n=0,i=0;i<256;i++)if(r[i]){if(n>0)n--;else if(e.WriteByte(i),i>0&&r[i-1]>0){for(n=i+1;n<256&&r[n];n++);n-=i+1,e.WriteByte(n)}d(e,t[i])}e.WriteByte(0)}(i,a,o);for(f=0;f<256;f++)if(o[f]){s[f][0]=0;for(var l=1;l<256;l++)s[f][l]=s[f][l-1]+a[f][l-1]}var p=new Array(4),g=new Array(4);for(l=0;l<4;l++)p[l]=1<<23,g[l]=0;var y=new n("",r,r),v=Math.floor(r/4),m=new Array(4),b=new Array(4);for(l=0;l<4;l++)m[l]=(l+1)*v-2,b[l]=e[m[l]+1];b[3]=e[r-1];for(f=r-2;f>4*v-2;f--)p[3]=c(p[3],y,s[e[f]][b[3]],a[e[f]][b[3]],12),b[3]=e[f];for(;m[0]>=0;)for(l=3;l>=0;l--){var _=e[m[l]];p[l]=c(p[l],y,s[_][b[l]],a[_][b[l]],12),b[l]=_,m[l]--}for(l=3;l>=0;l--)p[l]=c(p[l],y,s[0][b[l]],a[0][b[l]],12);for(f=3;f>=0;f--)u(p[f],y);var w=i.pos;return i.buf.writeInt32LE(w-9+(y.length-y.pos),1),i.buf.writeInt32LE(r,5),t.concat([i.buf.slice(0,i.pos),y.buf.slice(y.pos,y.length)],i.pos+y.length-y.pos)}(e)}}}).call(this,r(0).Buffer)},function(e,t){var r={array:function(e){var t=0,r=0,n=[0,1,3,7,15,31,63,127,255];return function(i){for(var o=0;i>0;){var a=8-t;i>=a?(o<<=a,o|=n[a]&e[r++],t=0,i-=a):(o<<=i,o|=(e[r]&n[i]<<8-i-t)>>8-i-t,t+=i,i=0)}return o}},simple:function(e){var t,n,i=r.header(e),o=[],a=0;do{-1!=(n=r.decompress(e,i))&&(o.push(n),a+=n.byteLength)}while(-1!=n);t=new Uint8Array(a),a=0;for(var s=0;s<o.length;++s)n=o[s],t.set(n,a),a+=n.byteLength;return t},header:function(e){if(4348520!=e(24))throw"No magic number found";var t=e(8)-48;if(t<1||t>9)throw"Not a BZIP archive";return t},decompress:function(e,t,r){for(var n="",i=0;i<6;i++)n+=e(8).toString(16);if("177245385090"==n)return-1;if("314159265359"!=n)throw"eek not valid bzip data";if(e(32),e(1))throw"unsupported obsolete version";var o=e(24);if(o>9e5)throw"Initial position larger than buffer size";var a=e(16),s=new Uint8Array(256),f=0;for(i=0;i<16;i++)if(a&1<<15-i){var u=e(16);for(p=0;p<16;p++)u&1<<15-p&&(s[f++]=16*i+p)}var c=e(3);if(c<2||c>6)throw"another error";var l=e(15);if(0==l)throw"meh";var h=[];for(i=0;i<c;i++)h[i]=i;var d=new Uint8Array(32768);for(i=0;i<l;i++){for(var p=0;e(1);p++)if(p>=c)throw"whoops another error";var g=h[p];h.splice(p,1),h.splice(0,0,g),d[i]=g}var y=f+2,v=[];for(p=0;p<c;p++){var m,b,_,w=new Uint8Array(258),E=new Uint8Array(21);a=e(5);for(i=0;i<y;i++){for(;;){if(a<1||a>20)throw"I gave up a while ago on writing error messages";if(!e(1))break;e(1)?a--:a++}w[i]=a}m=b=w[0];for(i=1;i<y;i++)w[i]>b?b=w[i]:w[i]<m&&(m=w[i]);(_=v[p]={}).permute=new Uint32Array(258),_.limit=new Uint32Array(21),_.base=new Uint32Array(21),_.minLen=m,_.maxLen=b;var S=_.base.subarray(1),A=_.limit.subarray(1),R=0;for(i=m;i<=b;i++)for(a=0;a<y;a++)w[a]==i&&(_.permute[R++]=a);for(i=m;i<=b;i++)E[i]=A[i]=0;for(i=0;i<y;i++)E[w[i]]++;for(R=a=0,i=m;i<b;i++)R+=E[i],A[i]=R-1,R<<=1,S[i+1]=R-(a+=E[i]);A[b]=R+E[b]-1,S[m]=0}var k,x,C,B=new Uint32Array(256);for(i=0;i<256;i++)h[i]=i;k=x=y=C=0;for(var T=new Uint32Array(9e5);;){if(!y--){if(y=49,C>=l)throw"meow i'm a kitty, that's an error";S=(_=v[d[C++]]).base.subarray(1),A=_.limit.subarray(1)}for(p=e(i=_.minLen);;){if(i>_.maxLen)throw"rawr i'm a dinosaur";if(p<=A[i])break;i++,p=p<<1|e(1)}if((p-=S[i])<0||p>=258)throw"moo i'm a cow";var M=_.permute[p];if(0!=M&&1!=M){if(k){if(k=0,x+a>=9e5)throw"Boom.";for(B[g=s[h[0]]]+=a;a--;)T[x++]=g}if(M>f)break;if(x>=9e5)throw"I can't think of anything. Error";g=h[i=M-1],h.splice(i,1),h.splice(0,0,g),B[g=s[g]]++,T[x++]=g}else k||(k=1,a=0),a+=0==M?k:2*k,k<<=1}if(o<0||o>=x)throw"I'm a monkey and I'm throwing something at someone, namely you";for(p=0,i=0;i<256;i++)u=p+B[i],B[i]=p,p=u;for(i=0;i<x;i++)T[B[g=255&T[i]]]|=i<<8,B[g]++;var O=0,I=0,P=0;x&&(I=255&(O=T[o]),O>>=8,P=-1),x=x;var L,F,N,U=new Uint8Array(9e5),D=0;for(r||(r=1/0);x;){for(x--,F=I,I=255&(O=T[O]),O>>=8,3==P++?(L=I,N=F,I=-1):(L=1,N=I);L--;)if(U[D++]=N,!--r)return U;I!=F&&(P=0)}return U.subarray(0,D)}};e.exports=r},function(e,t,r){(function(t,n){const i=r(8),o=r(40),a=r(39);function s(e,t,r){for(var n=0,i=0,o=-1,a=new Array(1024);i<r;){var s=e.ReadByte();if(a[n++]=s,i+=s,s==o){var f=e.ReadByte();for(i+=s*f;f--;)a[n++]=s}o=s}var u=0;for(n=0,i=0;i<r;){var c=0;do{var l=a[n++];c+=l}while(255==l);for(;c--;)t[i++]=u;u++}}function f(e,t,r){var n=e.context;return t.qctx=(t.qctx<<e.qshift)+e.qtab[r],n+=(t.qctx&(1<<e.qbits)-1)<<e.qloc,e.do_pos&&(n+=e.ptab[Math.min(t.p,1023)]<<e.ploc),e.do_delta&&(n+=e.dtab[Math.min(t.delta,255)]<<e.dloc,t.delta+=t.prevq!=r?1:0,t.prevq=r),e.do_sel&&(n+=t.s<<e.sloc),t.p--,65535&n}function u(e){var t={};t.context=e.ReadUint16(),t.pflags=e.ReadByte(),t.do_dedup=2&t.pflags,t.fixed_len=4&t.pflags,t.do_sel=8&t.pflags,t.do_qmap=16&t.pflags,t.do_pos=32&t.pflags,t.do_delta=64&t.pflags,t.do_qtab=128&t.pflags,t.max_sym=e.ReadByte();var r=e.ReadByte();if(t.qbits=r>>4,t.qshift=15&r,r=e.ReadByte(),t.qloc=r>>4,t.sloc=15&r,r=e.ReadByte(),t.ploc=r>>4,t.dloc=15&r,t.qmap=new Array(256),16&t.pflags)for(var n=0;n<t.max_sym;n++)t.qmap[n]=e.ReadByte();else for(n=0;n<256;n++)t.qmap[n]=n;if(t.qtab=new Array(1024),t.qbits>0&&128&t.pflags)s(e,t.qtab,256);else for(n=0;n<256;n++)t.qtab[n]=n;return t.ptab=new Array(1024),32&t.pflags&&s(e,t.ptab,1024),t.dtab=new Array(256),64&t.pflags&&s(e,t.dtab,256),t}function c(e,t,r,n,i,o){r.max_sel>0?i.s=n.sel.ModelDecode(e,t):i.s=0,i.x=r.stab[i.s];var a=r.params[i.x];if(a.fixed_len>=0){var s=n.len[0].ModelDecode(e,t);s|=n.len[1].ModelDecode(e,t)<<8,s|=n.len[2].ModelDecode(e,t)<<16,s|=n.len[3].ModelDecode(e,t)<<24,a.fixed_len>0&&(a.fixed_len=-s)}else s=-a.fixed_len;i.len=s,r.do_rev&&(o[i.rec]=n.rev.ModelDecode(e,t)),i.is_dup=0,2&a.pflags&&n.dup.ModelDecode(e,t)&&(i.is_dup=1),i.p=s,i.delta=0,i.qctx=0,i.prevq=0,i.rec++}function l(e,r){var n=e.ReadUint7(),i=function(e){var t={max_sym:0};if(5==e.ReadByte()){var r=e.ReadByte(),n=1&r?e.ReadByte():1,i=r.nparam>1?r.nparam-1:0,o=new Array(256);if(2&r)i=e.ReadByte(),s(e,o,256);else{for(var a=0;a<n;a++)o[a]=a;for(;a<256;a++)o[a]=n-1}t.do_rev=4&r,t.stab=o,t.max_sel=i,t.params=new Array(t.nparam);for(var f=0;f<n;f++)t.params[f]=u(e),t.max_sym<t.params[f].max_sym&&(t.max_sym=t.params[f].max_sym);return t}console.error("Invalid FQZComp version number")}(e);if(i){var l=i.params,h=new Array(r.length),d=function(e){var t={};t.qual=new Array(65536);for(var r=0;r<65536;r++)t.qual[r]=new o(e.max_sym+1);for(t.len=new Array(4),r=0;r<4;r++)t.len[r]=new o(256);return t.rev=new o(2),t.dup=new o(2),e.max_sel>0&&(t.sel=new o(e.max_sel+1)),t}(i),p=new a(e);p.RangeStartDecode(e);for(var g=new t.allocUnsafe(n),y={qctx:0,prevq:0,delta:0,p:0,s:0,x:0,len:0,is_dup:0,rec:0},v=0;v<n;){if(0==y.p){if(c(e,p,i,d,y,h),y.is_dup>0&&d.dup.ModelDecode(e,p)){for(var m=0;m<len;m++)g[v+m]=g[v+m-y.len];v+=y.len,y.p=0;continue}r.push(y.len);var b=(l=i.params[y.x]).context}var _=d.qual[b].ModelDecode(e,p);g[v++]=l.qmap[_],b=f(l,y,_)}return i.do_rev&&function(e,t,r,n){var i=0,o=0;for(;o<t;){if(r[i])for(var a=0,s=n[i]-1;a<s;){var f=e[o+a];e[o+a]=e[o+s],e[o+s]=f,a++,s--}o+=n[i++]}}(g,n,h,r),g}}function h(e,t,r){for(var n=0,i=0,o=new Array(2*r),a=0;n<r;){for(var s=n;n<r&&t[n]==i;)n++;var f=n-s;do{var u=Math.min(255,f);o[a++]=u,f-=u}while(255==u);i++}var c=-1,l=new Array(2*r),h=0;for(n=0;n<a;){var d=o[n++];if(l[h++]=d,d==c){for(s=n;n<a&&o[n]==c&&n-s<255;)n++;l[h++]=n-s}else c=d}e.WriteData(l,h)}e.exports={decode:function(e,t){return l(new i(e),t)},encode:function(e,t,r){for(var s=new Array(2),f=new Array(2),u=new Array(2),c=new Array(2),l=new Array(256),d=0;d<2;d++)s[d]=new Array(256),f[d]=new Array(256),u[d]=new Array(1024),c[d]=new Array(256);(p=new i("",0,1.1*e.length+100)).WriteUint7(e.length);var p,g=function(e,t,r,n){for(var i=r[0],o=0;o<r.length&&r[o]==i;o++);var a=o==r.length?1:0,s=0,f=0;for(o=0;o<256;o++)n[0][o]=0;var u=0,c=0;for(o=0;o<e.length;o++)0==c&&(c=t[u<t.length-1?u++:u]),n[0][e[o]]++,c--;for(o=0;o<256;o++)n[0][o]&&(f<o&&(f=o),s++);var l=5,h=0;return s<=16&&(h=1,l=s<=2?1:s<=4?2:s<=8?3:4),[{qbits:8+(l>4),qshift:l,qloc:7,pbits:7,pshift:t[0]>128?1:0,ploc:0,dbits:l>4?0:1,dshift:3,dloc:15,sbits:0,sloc:15,do_stab:0,context:0,max_sym:f,nsym:s,do_qmap:h,do_dedup:0,fixed_len:1==t.length?1:0,do_sel:0,do_rev:0,do_pos:1,do_delta:l<=4?1:0,do_qtab:0,qbits:8+(l>4)-(0==a),sbits:1,sloc:15-(l<=4),do_stab:1,do_sel:1}]}(e,t,r,s);return function(e,t,r,i,s,f,u,c,l,h){var d=1<<s[0].sbits;d>0&&d--;for(var p=t.length,g=0,y=0;y<s.length;y++)g<s[y].max_sym&&(g=s[y].max_sym);for(var v=new Array(65536),m=0;m<65536;m++)v[m]=new o(g+1);var b=new Array(4);for(m=0;m<4;m++)b[m]=new o(256);new o(2),new o(2);for(var _=new o(d+1),w=new a(t),E=(y=0,m=0,0);m<p;){if(0==y){var S=i[E];s[0].sbits>0&&_.ModelEncode(e,w,S);var A=h[S],R=r[Math.min(r.length-1,E++)];s[A].fixed_len?s[A].fixed_len>0&&(b[0].ModelEncode(e,w,255&R),b[1].ModelEncode(e,w,R>>8&255),b[2].ModelEncode(e,w,R>>16&255),b[3].ModelEncode(e,w,R>>24&255),s[A].fixed_len=-1):(b[0].ModelEncode(e,w,255&R),b[1].ModelEncode(e,w,R>>8&255),b[2].ModelEncode(e,w,R>>16&255),b[3].ModelEncode(e,w,R>>24&255)),s[A].do_dedup&&n.exit(1),y=R;var k=0,x=s[A].context,C=0,B=0}var T=t[m++],M=f[A][T];v[x].ModelEncode(e,w,M),C=(C<<s[A].qshift)+u[A][M],x=s[A].context,x+=(C&(1<<s[A].qbits)-1)<<s[A].qloc,s[A].pbits>0&&(x+=c[A][Math.min(y,1023)]<<s[A].ploc),s[A].dbits>0&&(x+=l[A][Math.min(k,255)]<<s[A].dloc,k+=B!=M?1:0,B=M),s[A].do_sel&&(x+=S<<s[A].sloc),x&=65535,y--}return w.RangeFinishEncode(e),e.buf.slice(0,e.pos)}(p=function(e,t,r,n,i,o,a){for(var s=[0,1,1,1,2,2,2,2,2,3,3,3,3,3,3,3,4,4,4,4,4,4,4,4,4,5,5,5,5,5,5,5,5,5,5,5,6,6,6,6,6,6,6,6,6,6,6,6,6,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7],f=0;f<t.length;f++)a[f]=f;for(;f<256;f++)a[f]=t.length-1;e.WriteByte(5);var u=(t.length>1?1:0)|(t[0].do_stab?2:0);if(e.WriteByte(u),1&u&&e.WriteByte(t.length),2&u){var c=1<<t[0].sbits;c>0&&c--,e.WriteByte(c),h(e,a,256)}for(var l=0;l<t.length;l++){if(e.WriteUint16(t[l].context),e.WriteByte((t[l].do_qtab?128:0)|(t[l].do_delta?64:0)|(t[l].do_pos?32:0)|(t[l].do_qmap?16:0)|(t[l].do_sel?8:0)|(t[l].fixed_len?4:0)|(t[l].do_dedup?2:0)),t[l].do_qmap?e.WriteByte(t[l].nsym):e.WriteByte(t[l].max_sym),e.WriteByte(t[l].qbits<<4|t[l].qshift),e.WriteByte(t[l].qloc<<4|t[l].sloc),e.WriteByte(t[l].ploc<<4|t[l].dloc),t[l].do_qmap){t[l].max_sym=t[l].nsym;var d=0;for(f=0;f<256;f++)r[l][f]&&(e.WriteByte(f),r[l][f]=d++);for(;d<t[l].nsym;d++)e.WriteByte(0)}else for(f=0;f<256;f++)r[l][f]=f;if(t[l].qbits>0){for(f=0;f<256;f++)n[l][f]=f;t[l].do_qtab&&h(e,n[l],256)}if(t[l].pbits>0){for(f=0;f<1024;f++)i[l][f]=Math.min((1<<t[l].pbits)-1,f>>t[l].pshift);h(e,i[l],1024)}if(t[l].dbits>0){for(f=0;f<256;f++)s[f]>(1<<t[l].dbits)-1&&(s[f]=(1<<t[l].dbits)-1);for(f=0;f<256;f++)o[l][f]=s[Math.min(s.length-1,f>>t[l].dshift)];h(e,o[l],256)}}return e}(p,g,s,f,u,c,l),e,t,r,g,s,f,u,c,l)}}}).call(this,r(0).Buffer,r(3))},function(e,t,r){(function(t){const n=r(8),i=r(37);var o=new(r(38));function a(e,t){for(var r=e+"";r.length<t;)r="0"+r;return r}function s(e,t,r,n){var i=e[0][0].ReadByte(),o=n-e[0][i].ReadUint32();if(5==i)return t[n]=t[o],r[n]=r[o],t[n];var s=1;t[n]="",r[n]=new Array(256);do{switch(i=e[s][0].ReadByte()){case 2:r[n][s]=e[s][2].ReadChar();break;case 1:r[n][s]=e[s][1].ReadString();break;case 7:r[n][s]=e[s][7].ReadUint32();break;case 3:var f=e[s][3].ReadUint32(),u=e[s][4].ReadByte();r[n][s]=a(f,u);break;case 8:r[n][s]=(r[o][s]>>0)+e[s][8].ReadByte();break;case 9:f=(r[o][s]>>0)+e[s][9].ReadByte(),u=r[o][s].length;r[n][s]=a(f,u);break;case 10:r[n][s]=r[o][s];break;default:r[n][s]=""}t[n]+=r[n][s++]}while(12!=i);return t[n]}function f(e,t,r,n,i,o){for(var a=0;a<n.length;a++)if(!(r>0&&5==t[a][0].type)&&t[a][r])switch(e[0].WriteByte(t[a][r].type),t[a][r].type){case 6:e[6].WriteUint32(t[a][r].val);break;case 5:e[5].WriteUint32(t[a][r].val);break;case 1:e[1].WriteString(t[a][r].val);break;case 2:e[2].WriteChar(t[a][r].val);break;case 7:e[7].WriteUint32(t[a][r].val);break;case 3:e[3].WriteUint32(t[a][r].val),e[4].WriteByte(t[a][r].val.length);break;case 8:case 9:e[t[a][r].type].WriteByte(t[a][r].val)}}function u(e,t,r,n){for(var i=0;i<=12;i++)if(!(e[i].pos<=0)){n.WriteByte(i+(0==i?128:0)),e[i]=e[i].buf.slice(0,e[i].pos);var o=c(e[i],r);n.WriteUint7(o.length),n.WriteData(o,o.length)}}function c(e,t){var r,n=1<<30,a=[0,1,64,65,128,129,201];for(var s in a){var f=a[s];if(!(1&f&&e.length<100)&&!(8&f&&e.length%4!=0)){try{var u=t?o.encode(e,f):i.encode(e,f)}catch(e){u=0}u&&n>u.length&&(n=u.length,r=u)}}return r}function l(e,t,r,n,i){var o=0,a=i-1;e[i]=new Array(256),t[n]?e[i][0]={type:5,val:i-t[n]}:e[i][0]={type:6,val:0==i?0:1},t[n]=i;for(var s=n.match(/([a-zA-Z0-9]{1,9})|([^a-zA-Z0-9]+)/g),f=0;f<s.length;f++){var u=f+1,c=1,l=s[f];if(s[f].match(/^0+[0-9]*$/g)?c=3:s[f].match(/^[0-9]+$/g)?c=7:1==s[f].length&&(c=2),a>=0&&e[a][u])if(e[a][u].str==s[f])c=10,l="";else if(7==e[a][u].type||8==e[a][u].type){var h=l-e[a][u].str;r[u]++,h>=0&&h<256&&r[u]>i/2&&(c=8,l=h)}else if((3==e[a][u].type||9==e[a][u].type)&&e[a][u].str.length==l.length){h=l-e[a][u].str;r[u]++,h>=0&&h<256&&r[u]>i/2&&(c=9,l=h)}e[i][u]={str:s[f],val:l,type:c},o<e[i][u].val.length+3&&(o=e[i][u].val.length+3)}return e[i][++u]={type:12},[u+1,o]}e.exports={encode:function(e,t){var r=e.toString();"\n"==r[r.length-1]&&(r=r.substring(0,r.length-1));var i=r.split("\n"),o=new n("",0,2*r.length+1e4);o.WriteUint32(r.length),o.WriteUint32(i.length),o.WriteByte(t);for(var a=new Array(i.length),s={},c=new Array(256).fill(0),h=0,d=0,p=0;p<i.length;p++){var[g,y]=l(a,s,c,i[p],p);h<g&&(h=g),d<y&&(d=y)}for(var v=0;v<h;v++){for(var m=new Array(13),b=0;b<=12;b++)m[b]=new n("",0,i.length*d);f(m,a,v,i,h,d),u(m,v,t,o)}return o.buf.slice(0,o.pos)},decode:function(e,r,a){(e=new n(e)).ReadUint32();var f=e.ReadUint32(),u=e.ReadByte(),c=function(e,r,a,s){for(var f=-1,u=new Array(256);!e.EOF();){var c=e.ReadByte(),l=128&c,h=64&c,d=63&c;if(l&&(u[++f]=new Array(13)),0!=d&&l){var p=new Array(s-1).fill(10);u[f][0]=new n(t.from([d].concat(p)))}if(h){var g=e.ReadByte(),y=e.ReadByte();u[f][d]=new n(u[g][y].buf)}else{var v=e.ReadUint7(),m=e.ReadData(v);u[f][d]=a?o.decode(m):i.decode(m),u[f][d]=new n(u[f][d])}}return u}(e,0,u,f),l=new Array(f),h=new Array(f),d="";void 0===a&&(a="\n");for(var p=0;p<f;p++)d+=s(c,l,h,p)+a;return d}}}).call(this,r(0).Buffer)},function(e,t,r){"use strict";(function(e){var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function a(e){try{f(n.next(e))}catch(e){o(e)}}function s(e){try{f(n.throw(e))}catch(e){o(e)}}function f(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}f((n=n.apply(e,t||[])).next())}))},i=this&&this.__generator||function(e,t){var r,n,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(r)throw new TypeError("Generator is already executing.");for(;a;)try{if(r=1,n&&(i=2&o[0]?n.return:o[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,o[1])).done)return i;switch(n=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,n=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!(i=a.trys,(i=i.length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){a.label=o[1];break}if(6===o[0]&&a.label<i[1]){a.label=i[1],i=o;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(o);break}i[2]&&a.ops.pop(),a.trys.pop();continue}o=t.call(e,a)}catch(e){o=[6,e],n=0}finally{r=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,s])}}},o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var a=r(1),s=r(9),f=o(r(91)),u=o(r(94)),c=function(){function t(e,t){this.file=e,this.filePosition=t}return t.prototype.getHeader=function(){return this._readContainerHeader(this.filePosition)},t.prototype.getCompressionHeaderBlock=function(){return n(this,void 0,void 0,(function(){var e,t,r;return i(this,(function(n){switch(n.label){case 0:return[4,this.getHeader()];case 1:return n.sent().numRecords?[4,this.file.getSectionParsers()]:[2,null];case 2:return e=n.sent(),[4,this.getFirstBlock()];case 3:if("COMPRESSION_HEADER"!==(t=n.sent()).contentType)throw new a.CramMalformedError("invalid content type ".concat(t.contentType," in what is supposed to be the compression header block"));return r=(0,s.parseItem)(t.content,e.cramCompressionHeader.parser,0,t.contentPosition),t.content=r,[2,t]}}))}))},t.prototype.getFirstBlock=function(){return n(this,void 0,void 0,(function(){var e;return i(this,(function(t){switch(t.label){case 0:return[4,this.getHeader()];case 1:return e=t.sent(),[2,this.file.readBlock(e._endPosition)]}}))}))},t.prototype.getCompressionScheme=function(){return n(this,void 0,void 0,(function(){var e;return i(this,(function(t){switch(t.label){case 0:return[4,this.getCompressionHeaderBlock()];case 1:return(e=t.sent())?[2,new u.default(e.content)]:[2,void 0]}}))}))},t.prototype.getSlice=function(e,t){return new f.default(this,e,t)},t.prototype._readContainerHeader=function(t){return n(this,void 0,void 0,(function(){var r,n,o,a,f,u,c,l,h;return i(this,(function(i){switch(i.label){case 0:return[4,this.file.getSectionParsers()];case 1:return r=i.sent(),n=r.cramContainerHeader1,o=r.cramContainerHeader2,[4,this.file.stat()];case 2:return a=i.sent().size,t>=a?[2,void 0]:(f=e.allocUnsafe(n.maxLength),[4,this.file.read(f,0,n.maxLength,t)]);case 3:return i.sent(),u=(0,s.parseItem)(f,n.parser),c=(0,s.itf8Size)(u.numLandmarks),t+u.length>=a?(console.warn("".concat(this.file,": container header at ").concat(t," indicates that the container has length ").concat(u.length,", which extends beyond the length of the file. Skipping this container.")),[2,void 0]):(l=e.allocUnsafe(o.maxLength(u.numLandmarks)),[4,this.file.read(l,0,o.maxLength(u.numLandmarks),t+u._size-c)]);case 4:return i.sent(),h=(0,s.parseItem)(l,o.parser),this.file.validateChecksums&&void 0!==h.crc32?[4,this.file.checkCrc32(t,u._size+h._size-c-4,h.crc32,"container header beginning at position ".concat(t))]:[3,6];case 5:i.sent(),i.label=6;case 6:return[2,Object.assign(u,h,{_size:u._size+h._size-c,_endPosition:u._size+h._size-c+t})]}}))}))},t}();t.default=c,"getHeader getCompressionHeaderBlock getCompressionScheme".split(" ").forEach((function(e){return(0,s.tinyMemoize)(c,e)}))}).call(this,r(0).Buffer)},function(e,t,r){var n,i,o,a,s;n=r(89),i=r(41).utf8,o=r(90),a=r(41).bin,(s=function(e,t){e.constructor==String?e=t&&"binary"===t.encoding?a.stringToBytes(e):i.stringToBytes(e):o(e)?e=Array.prototype.slice.call(e,0):Array.isArray(e)||e.constructor===Uint8Array||(e=e.toString());for(var r=n.bytesToWords(e),f=8*e.length,u=1732584193,c=-271733879,l=-1732584194,h=271733878,d=0;d<r.length;d++)r[d]=16711935&(r[d]<<8|r[d]>>>24)|4278255360&(r[d]<<24|r[d]>>>8);r[f>>>5]|=128<<f%32,r[14+(f+64>>>9<<4)]=f;var p=s._ff,g=s._gg,y=s._hh,v=s._ii;for(d=0;d<r.length;d+=16){var m=u,b=c,_=l,w=h;u=p(u,c,l,h,r[d+0],7,-680876936),h=p(h,u,c,l,r[d+1],12,-389564586),l=p(l,h,u,c,r[d+2],17,606105819),c=p(c,l,h,u,r[d+3],22,-1044525330),u=p(u,c,l,h,r[d+4],7,-176418897),h=p(h,u,c,l,r[d+5],12,1200080426),l=p(l,h,u,c,r[d+6],17,-1473231341),c=p(c,l,h,u,r[d+7],22,-45705983),u=p(u,c,l,h,r[d+8],7,1770035416),h=p(h,u,c,l,r[d+9],12,-1958414417),l=p(l,h,u,c,r[d+10],17,-42063),c=p(c,l,h,u,r[d+11],22,-1990404162),u=p(u,c,l,h,r[d+12],7,1804603682),h=p(h,u,c,l,r[d+13],12,-40341101),l=p(l,h,u,c,r[d+14],17,-1502002290),u=g(u,c=p(c,l,h,u,r[d+15],22,1236535329),l,h,r[d+1],5,-165796510),h=g(h,u,c,l,r[d+6],9,-1069501632),l=g(l,h,u,c,r[d+11],14,643717713),c=g(c,l,h,u,r[d+0],20,-373897302),u=g(u,c,l,h,r[d+5],5,-701558691),h=g(h,u,c,l,r[d+10],9,38016083),l=g(l,h,u,c,r[d+15],14,-660478335),c=g(c,l,h,u,r[d+4],20,-405537848),u=g(u,c,l,h,r[d+9],5,568446438),h=g(h,u,c,l,r[d+14],9,-1019803690),l=g(l,h,u,c,r[d+3],14,-187363961),c=g(c,l,h,u,r[d+8],20,1163531501),u=g(u,c,l,h,r[d+13],5,-1444681467),h=g(h,u,c,l,r[d+2],9,-51403784),l=g(l,h,u,c,r[d+7],14,1735328473),u=y(u,c=g(c,l,h,u,r[d+12],20,-1926607734),l,h,r[d+5],4,-378558),h=y(h,u,c,l,r[d+8],11,-2022574463),l=y(l,h,u,c,r[d+11],16,1839030562),c=y(c,l,h,u,r[d+14],23,-35309556),u=y(u,c,l,h,r[d+1],4,-1530992060),h=y(h,u,c,l,r[d+4],11,1272893353),l=y(l,h,u,c,r[d+7],16,-155497632),c=y(c,l,h,u,r[d+10],23,-1094730640),u=y(u,c,l,h,r[d+13],4,681279174),h=y(h,u,c,l,r[d+0],11,-358537222),l=y(l,h,u,c,r[d+3],16,-722521979),c=y(c,l,h,u,r[d+6],23,76029189),u=y(u,c,l,h,r[d+9],4,-640364487),h=y(h,u,c,l,r[d+12],11,-421815835),l=y(l,h,u,c,r[d+15],16,530742520),u=v(u,c=y(c,l,h,u,r[d+2],23,-995338651),l,h,r[d+0],6,-198630844),h=v(h,u,c,l,r[d+7],10,1126891415),l=v(l,h,u,c,r[d+14],15,-1416354905),c=v(c,l,h,u,r[d+5],21,-57434055),u=v(u,c,l,h,r[d+12],6,1700485571),h=v(h,u,c,l,r[d+3],10,-1894986606),l=v(l,h,u,c,r[d+10],15,-1051523),c=v(c,l,h,u,r[d+1],21,-2054922799),u=v(u,c,l,h,r[d+8],6,1873313359),h=v(h,u,c,l,r[d+15],10,-30611744),l=v(l,h,u,c,r[d+6],15,-1560198380),c=v(c,l,h,u,r[d+13],21,1309151649),u=v(u,c,l,h,r[d+4],6,-145523070),h=v(h,u,c,l,r[d+11],10,-1120210379),l=v(l,h,u,c,r[d+2],15,718787259),c=v(c,l,h,u,r[d+9],21,-343485551),u=u+m>>>0,c=c+b>>>0,l=l+_>>>0,h=h+w>>>0}return n.endian([u,c,l,h])})._ff=function(e,t,r,n,i,o,a){var s=e+(t&r|~t&n)+(i>>>0)+a;return(s<<o|s>>>32-o)+t},s._gg=function(e,t,r,n,i,o,a){var s=e+(t&n|r&~n)+(i>>>0)+a;return(s<<o|s>>>32-o)+t},s._hh=function(e,t,r,n,i,o,a){var s=e+(t^r^n)+(i>>>0)+a;return(s<<o|s>>>32-o)+t},s._ii=function(e,t,r,n,i,o,a){var s=e+(r^(t|~n))+(i>>>0)+a;return(s<<o|s>>>32-o)+t},s._blocksize=16,s._digestsize=16,e.exports=function(e,t){if(null==e)throw new Error("Illegal argument "+e);var r=n.wordsToBytes(s(e,t));return t&&t.asBytes?r:t&&t.asString?a.bytesToString(r):n.bytesToHex(r)}},function(e,t){var r,n;r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",n={rotl:function(e,t){return e<<t|e>>>32-t},rotr:function(e,t){return e<<32-t|e>>>t},endian:function(e){if(e.constructor==Number)return 16711935&n.rotl(e,8)|4278255360&n.rotl(e,24);for(var t=0;t<e.length;t++)e[t]=n.endian(e[t]);return e},randomBytes:function(e){for(var t=[];e>0;e--)t.push(Math.floor(256*Math.random()));return t},bytesToWords:function(e){for(var t=[],r=0,n=0;r<e.length;r++,n+=8)t[n>>>5]|=e[r]<<24-n%32;return t},wordsToBytes:function(e){for(var t=[],r=0;r<32*e.length;r+=8)t.push(e[r>>>5]>>>24-r%32&255);return t},bytesToHex:function(e){for(var t=[],r=0;r<e.length;r++)t.push((e[r]>>>4).toString(16)),t.push((15&e[r]).toString(16));return t.join("")},hexToBytes:function(e){for(var t=[],r=0;r<e.length;r+=2)t.push(parseInt(e.substr(r,2),16));return t},bytesToBase64:function(e){for(var t=[],n=0;n<e.length;n+=3)for(var i=e[n]<<16|e[n+1]<<8|e[n+2],o=0;o<4;o++)8*n+6*o<=8*e.length?t.push(r.charAt(i>>>6*(3-o)&63)):t.push("=");return t.join("")},base64ToBytes:function(e){e=e.replace(/[^A-Z0-9+\/]/gi,"");for(var t=[],n=0,i=0;n<e.length;i=++n%4)0!=i&&t.push((r.indexOf(e.charAt(n-1))&Math.pow(2,-2*i+8)-1)<<2*i|r.indexOf(e.charAt(n))>>>6-2*i);return t}},e.exports=n},function(e,t){function r(e){return!!e.constructor&&"function"==typeof e.constructor.isBuffer&&e.constructor.isBuffer(e)}
|
|
10
|
+
e.read=function(t,e,r,n,i){var o,a,s=8*i-n-1,f=(1<<s)-1,u=f>>1,c=-7,h=r?i-1:0,l=r?-1:1,d=t[e+h];for(h+=l,o=d&(1<<-c)-1,d>>=-c,c+=s;c>0;o=256*o+t[e+h],h+=l,c-=8);for(a=o&(1<<-c)-1,o>>=-c,c+=n;c>0;a=256*a+t[e+h],h+=l,c-=8);if(0===o)o=1-u;else{if(o===f)return a?NaN:1/0*(d?-1:1);a+=Math.pow(2,n),o-=u}return(d?-1:1)*a*Math.pow(2,o-n)},e.write=function(t,e,r,n,i,o){var a,s,f,u=8*o-i-1,c=(1<<u)-1,h=c>>1,l=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,d=n?0:o-1,p=n?1:-1,g=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(s=isNaN(e)?1:0,a=c):(a=Math.floor(Math.log(e)/Math.LN2),e*(f=Math.pow(2,-a))<1&&(a--,f*=2),(e+=a+h>=1?l/f:l*Math.pow(2,1-h))*f>=2&&(a++,f/=2),a+h>=c?(s=0,a=c):a+h>=1?(s=(e*f-1)*Math.pow(2,i),a+=h):(s=e*Math.pow(2,h-1)*Math.pow(2,i),a=0));i>=8;t[r+d]=255&s,d+=p,s/=256,i-=8);for(a=a<<i|s,u+=i;u>0;t[r+d]=255&a,d+=p,a/=256,u-=8);t[r+d-p]|=128*g}},function(t,e){var r={}.toString;t.exports=Array.isArray||function(t){return"[object Array]"==r.call(t)}},function(t,e,r){"use strict";var n={};(0,r(2).assign)(n,r(37),r(40),r(22)),t.exports=n},function(t,e,r){"use strict";var n=r(38),i=r(2),o=r(20),a=r(10),s=r(21),f=Object.prototype.toString;function u(t){if(!(this instanceof u))return new u(t);this.options=i.assign({level:-1,method:8,chunkSize:16384,windowBits:15,memLevel:8,strategy:0,to:""},t||{});var e=this.options;e.raw&&e.windowBits>0?e.windowBits=-e.windowBits:e.gzip&&e.windowBits>0&&e.windowBits<16&&(e.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new s,this.strm.avail_out=0;var r=n.deflateInit2(this.strm,e.level,e.method,e.windowBits,e.memLevel,e.strategy);if(0!==r)throw new Error(a[r]);if(e.header&&n.deflateSetHeader(this.strm,e.header),e.dictionary){var c;if(c="string"==typeof e.dictionary?o.string2buf(e.dictionary):"[object ArrayBuffer]"===f.call(e.dictionary)?new Uint8Array(e.dictionary):e.dictionary,0!==(r=n.deflateSetDictionary(this.strm,c)))throw new Error(a[r]);this._dict_set=!0}}function c(t,e){var r=new u(e);if(r.push(t,!0),r.err)throw r.msg||a[r.err];return r.result}u.prototype.push=function(t,e){var r,a,s=this.strm,u=this.options.chunkSize;if(this.ended)return!1;a=e===~~e?e:!0===e?4:0,"string"==typeof t?s.input=o.string2buf(t):"[object ArrayBuffer]"===f.call(t)?s.input=new Uint8Array(t):s.input=t,s.next_in=0,s.avail_in=s.input.length;do{if(0===s.avail_out&&(s.output=new i.Buf8(u),s.next_out=0,s.avail_out=u),1!==(r=n.deflate(s,a))&&0!==r)return this.onEnd(r),this.ended=!0,!1;0!==s.avail_out&&(0!==s.avail_in||4!==a&&2!==a)||("string"===this.options.to?this.onData(o.buf2binstring(i.shrinkBuf(s.output,s.next_out))):this.onData(i.shrinkBuf(s.output,s.next_out)))}while((s.avail_in>0||0===s.avail_out)&&1!==r);return 4===a?(r=n.deflateEnd(this.strm),this.onEnd(r),this.ended=!0,0===r):2!==a||(this.onEnd(0),s.avail_out=0,!0)},u.prototype.onData=function(t){this.chunks.push(t)},u.prototype.onEnd=function(t){0===t&&("string"===this.options.to?this.result=this.chunks.join(""):this.result=i.flattenChunks(this.chunks)),this.chunks=[],this.err=t,this.msg=this.strm.msg},e.Deflate=u,e.deflate=c,e.deflateRaw=function(t,e){return(e=e||{}).raw=!0,c(t,e)},e.gzip=function(t,e){return(e=e||{}).gzip=!0,c(t,e)}},function(t,e,r){"use strict";var n,i=r(2),o=r(39),a=r(18),s=r(19),f=r(10);function u(t,e){return t.msg=f[e],e}function c(t){return(t<<1)-(t>4?9:0)}function h(t){for(var e=t.length;--e>=0;)t[e]=0}function l(t){var e=t.state,r=e.pending;r>t.avail_out&&(r=t.avail_out),0!==r&&(i.arraySet(t.output,e.pending_buf,e.pending_out,r,t.next_out),t.next_out+=r,e.pending_out+=r,t.total_out+=r,t.avail_out-=r,e.pending-=r,0===e.pending&&(e.pending_out=0))}function d(t,e){o._tr_flush_block(t,t.block_start>=0?t.block_start:-1,t.strstart-t.block_start,e),t.block_start=t.strstart,l(t.strm)}function p(t,e){t.pending_buf[t.pending++]=e}function g(t,e){t.pending_buf[t.pending++]=e>>>8&255,t.pending_buf[t.pending++]=255&e}function y(t,e,r,n){var o=t.avail_in;return o>n&&(o=n),0===o?0:(t.avail_in-=o,i.arraySet(e,t.input,t.next_in,o,r),1===t.state.wrap?t.adler=a(t.adler,e,o,r):2===t.state.wrap&&(t.adler=s(t.adler,e,o,r)),t.next_in+=o,t.total_in+=o,o)}function v(t,e){var r,n,i=t.max_chain_length,o=t.strstart,a=t.prev_length,s=t.nice_match,f=t.strstart>t.w_size-262?t.strstart-(t.w_size-262):0,u=t.window,c=t.w_mask,h=t.prev,l=t.strstart+258,d=u[o+a-1],p=u[o+a];t.prev_length>=t.good_match&&(i>>=2),s>t.lookahead&&(s=t.lookahead);do{if(u[(r=e)+a]===p&&u[r+a-1]===d&&u[r]===u[o]&&u[++r]===u[o+1]){o+=2,r++;do{}while(u[++o]===u[++r]&&u[++o]===u[++r]&&u[++o]===u[++r]&&u[++o]===u[++r]&&u[++o]===u[++r]&&u[++o]===u[++r]&&u[++o]===u[++r]&&u[++o]===u[++r]&&o<l);if(n=258-(l-o),o=l-258,n>a){if(t.match_start=e,a=n,n>=s)break;d=u[o+a-1],p=u[o+a]}}}while((e=h[e&c])>f&&0!=--i);return a<=t.lookahead?a:t.lookahead}function m(t){var e,r,n,o,a,s=t.w_size;do{if(o=t.window_size-t.lookahead-t.strstart,t.strstart>=s+(s-262)){i.arraySet(t.window,t.window,s,s,0),t.match_start-=s,t.strstart-=s,t.block_start-=s,e=r=t.hash_size;do{n=t.head[--e],t.head[e]=n>=s?n-s:0}while(--r);e=r=s;do{n=t.prev[--e],t.prev[e]=n>=s?n-s:0}while(--r);o+=s}if(0===t.strm.avail_in)break;if(r=y(t.strm,t.window,t.strstart+t.lookahead,o),t.lookahead+=r,t.lookahead+t.insert>=3)for(a=t.strstart-t.insert,t.ins_h=t.window[a],t.ins_h=(t.ins_h<<t.hash_shift^t.window[a+1])&t.hash_mask;t.insert&&(t.ins_h=(t.ins_h<<t.hash_shift^t.window[a+3-1])&t.hash_mask,t.prev[a&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=a,a++,t.insert--,!(t.lookahead+t.insert<3)););}while(t.lookahead<262&&0!==t.strm.avail_in)}function b(t,e){for(var r,n;;){if(t.lookahead<262){if(m(t),t.lookahead<262&&0===e)return 1;if(0===t.lookahead)break}if(r=0,t.lookahead>=3&&(t.ins_h=(t.ins_h<<t.hash_shift^t.window[t.strstart+3-1])&t.hash_mask,r=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart),0!==r&&t.strstart-r<=t.w_size-262&&(t.match_length=v(t,r)),t.match_length>=3)if(n=o._tr_tally(t,t.strstart-t.match_start,t.match_length-3),t.lookahead-=t.match_length,t.match_length<=t.max_lazy_match&&t.lookahead>=3){t.match_length--;do{t.strstart++,t.ins_h=(t.ins_h<<t.hash_shift^t.window[t.strstart+3-1])&t.hash_mask,r=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart}while(0!=--t.match_length);t.strstart++}else t.strstart+=t.match_length,t.match_length=0,t.ins_h=t.window[t.strstart],t.ins_h=(t.ins_h<<t.hash_shift^t.window[t.strstart+1])&t.hash_mask;else n=o._tr_tally(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++;if(n&&(d(t,!1),0===t.strm.avail_out))return 1}return t.insert=t.strstart<2?t.strstart:2,4===e?(d(t,!0),0===t.strm.avail_out?3:4):t.last_lit&&(d(t,!1),0===t.strm.avail_out)?1:2}function _(t,e){for(var r,n,i;;){if(t.lookahead<262){if(m(t),t.lookahead<262&&0===e)return 1;if(0===t.lookahead)break}if(r=0,t.lookahead>=3&&(t.ins_h=(t.ins_h<<t.hash_shift^t.window[t.strstart+3-1])&t.hash_mask,r=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart),t.prev_length=t.match_length,t.prev_match=t.match_start,t.match_length=2,0!==r&&t.prev_length<t.max_lazy_match&&t.strstart-r<=t.w_size-262&&(t.match_length=v(t,r),t.match_length<=5&&(1===t.strategy||3===t.match_length&&t.strstart-t.match_start>4096)&&(t.match_length=2)),t.prev_length>=3&&t.match_length<=t.prev_length){i=t.strstart+t.lookahead-3,n=o._tr_tally(t,t.strstart-1-t.prev_match,t.prev_length-3),t.lookahead-=t.prev_length-1,t.prev_length-=2;do{++t.strstart<=i&&(t.ins_h=(t.ins_h<<t.hash_shift^t.window[t.strstart+3-1])&t.hash_mask,r=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart)}while(0!=--t.prev_length);if(t.match_available=0,t.match_length=2,t.strstart++,n&&(d(t,!1),0===t.strm.avail_out))return 1}else if(t.match_available){if((n=o._tr_tally(t,0,t.window[t.strstart-1]))&&d(t,!1),t.strstart++,t.lookahead--,0===t.strm.avail_out)return 1}else t.match_available=1,t.strstart++,t.lookahead--}return t.match_available&&(n=o._tr_tally(t,0,t.window[t.strstart-1]),t.match_available=0),t.insert=t.strstart<2?t.strstart:2,4===e?(d(t,!0),0===t.strm.avail_out?3:4):t.last_lit&&(d(t,!1),0===t.strm.avail_out)?1:2}function w(t,e,r,n,i){this.good_length=t,this.max_lazy=e,this.nice_length=r,this.max_chain=n,this.func=i}function A(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=8,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new i.Buf16(1146),this.dyn_dtree=new i.Buf16(122),this.bl_tree=new i.Buf16(78),h(this.dyn_ltree),h(this.dyn_dtree),h(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new i.Buf16(16),this.heap=new i.Buf16(573),h(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new i.Buf16(573),h(this.depth),this.l_buf=0,this.lit_bufsize=0,this.last_lit=0,this.d_buf=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}function S(t){var e;return t&&t.state?(t.total_in=t.total_out=0,t.data_type=2,(e=t.state).pending=0,e.pending_out=0,e.wrap<0&&(e.wrap=-e.wrap),e.status=e.wrap?42:113,t.adler=2===e.wrap?0:1,e.last_flush=0,o._tr_init(e),0):u(t,-2)}function E(t){var e,r=S(t);return 0===r&&((e=t.state).window_size=2*e.w_size,h(e.head),e.max_lazy_match=n[e.level].max_lazy,e.good_match=n[e.level].good_length,e.nice_match=n[e.level].nice_length,e.max_chain_length=n[e.level].max_chain,e.strstart=0,e.block_start=0,e.lookahead=0,e.insert=0,e.match_length=e.prev_length=2,e.match_available=0,e.ins_h=0),r}function C(t,e,r,n,o,a){if(!t)return-2;var s=1;if(-1===e&&(e=6),n<0?(s=0,n=-n):n>15&&(s=2,n-=16),o<1||o>9||8!==r||n<8||n>15||e<0||e>9||a<0||a>4)return u(t,-2);8===n&&(n=9);var f=new A;return t.state=f,f.strm=t,f.wrap=s,f.gzhead=null,f.w_bits=n,f.w_size=1<<f.w_bits,f.w_mask=f.w_size-1,f.hash_bits=o+7,f.hash_size=1<<f.hash_bits,f.hash_mask=f.hash_size-1,f.hash_shift=~~((f.hash_bits+3-1)/3),f.window=new i.Buf8(2*f.w_size),f.head=new i.Buf16(f.hash_size),f.prev=new i.Buf16(f.w_size),f.lit_bufsize=1<<o+6,f.pending_buf_size=4*f.lit_bufsize,f.pending_buf=new i.Buf8(f.pending_buf_size),f.d_buf=1*f.lit_bufsize,f.l_buf=3*f.lit_bufsize,f.level=e,f.strategy=a,f.method=r,E(t)}n=[new w(0,0,0,0,(function(t,e){var r=65535;for(r>t.pending_buf_size-5&&(r=t.pending_buf_size-5);;){if(t.lookahead<=1){if(m(t),0===t.lookahead&&0===e)return 1;if(0===t.lookahead)break}t.strstart+=t.lookahead,t.lookahead=0;var n=t.block_start+r;if((0===t.strstart||t.strstart>=n)&&(t.lookahead=t.strstart-n,t.strstart=n,d(t,!1),0===t.strm.avail_out))return 1;if(t.strstart-t.block_start>=t.w_size-262&&(d(t,!1),0===t.strm.avail_out))return 1}return t.insert=0,4===e?(d(t,!0),0===t.strm.avail_out?3:4):(t.strstart>t.block_start&&(d(t,!1),t.strm.avail_out),1)})),new w(4,4,8,4,b),new w(4,5,16,8,b),new w(4,6,32,32,b),new w(4,4,16,16,_),new w(8,16,32,32,_),new w(8,16,128,128,_),new w(8,32,128,256,_),new w(32,128,258,1024,_),new w(32,258,258,4096,_)],e.deflateInit=function(t,e){return C(t,e,8,15,8,0)},e.deflateInit2=C,e.deflateReset=E,e.deflateResetKeep=S,e.deflateSetHeader=function(t,e){return t&&t.state?2!==t.state.wrap?-2:(t.state.gzhead=e,0):-2},e.deflate=function(t,e){var r,i,a,f;if(!t||!t.state||e>5||e<0)return t?u(t,-2):-2;if(i=t.state,!t.output||!t.input&&0!==t.avail_in||666===i.status&&4!==e)return u(t,0===t.avail_out?-5:-2);if(i.strm=t,r=i.last_flush,i.last_flush=e,42===i.status)if(2===i.wrap)t.adler=0,p(i,31),p(i,139),p(i,8),i.gzhead?(p(i,(i.gzhead.text?1:0)+(i.gzhead.hcrc?2:0)+(i.gzhead.extra?4:0)+(i.gzhead.name?8:0)+(i.gzhead.comment?16:0)),p(i,255&i.gzhead.time),p(i,i.gzhead.time>>8&255),p(i,i.gzhead.time>>16&255),p(i,i.gzhead.time>>24&255),p(i,9===i.level?2:i.strategy>=2||i.level<2?4:0),p(i,255&i.gzhead.os),i.gzhead.extra&&i.gzhead.extra.length&&(p(i,255&i.gzhead.extra.length),p(i,i.gzhead.extra.length>>8&255)),i.gzhead.hcrc&&(t.adler=s(t.adler,i.pending_buf,i.pending,0)),i.gzindex=0,i.status=69):(p(i,0),p(i,0),p(i,0),p(i,0),p(i,0),p(i,9===i.level?2:i.strategy>=2||i.level<2?4:0),p(i,3),i.status=113);else{var y=8+(i.w_bits-8<<4)<<8;y|=(i.strategy>=2||i.level<2?0:i.level<6?1:6===i.level?2:3)<<6,0!==i.strstart&&(y|=32),y+=31-y%31,i.status=113,g(i,y),0!==i.strstart&&(g(i,t.adler>>>16),g(i,65535&t.adler)),t.adler=1}if(69===i.status)if(i.gzhead.extra){for(a=i.pending;i.gzindex<(65535&i.gzhead.extra.length)&&(i.pending!==i.pending_buf_size||(i.gzhead.hcrc&&i.pending>a&&(t.adler=s(t.adler,i.pending_buf,i.pending-a,a)),l(t),a=i.pending,i.pending!==i.pending_buf_size));)p(i,255&i.gzhead.extra[i.gzindex]),i.gzindex++;i.gzhead.hcrc&&i.pending>a&&(t.adler=s(t.adler,i.pending_buf,i.pending-a,a)),i.gzindex===i.gzhead.extra.length&&(i.gzindex=0,i.status=73)}else i.status=73;if(73===i.status)if(i.gzhead.name){a=i.pending;do{if(i.pending===i.pending_buf_size&&(i.gzhead.hcrc&&i.pending>a&&(t.adler=s(t.adler,i.pending_buf,i.pending-a,a)),l(t),a=i.pending,i.pending===i.pending_buf_size)){f=1;break}f=i.gzindex<i.gzhead.name.length?255&i.gzhead.name.charCodeAt(i.gzindex++):0,p(i,f)}while(0!==f);i.gzhead.hcrc&&i.pending>a&&(t.adler=s(t.adler,i.pending_buf,i.pending-a,a)),0===f&&(i.gzindex=0,i.status=91)}else i.status=91;if(91===i.status)if(i.gzhead.comment){a=i.pending;do{if(i.pending===i.pending_buf_size&&(i.gzhead.hcrc&&i.pending>a&&(t.adler=s(t.adler,i.pending_buf,i.pending-a,a)),l(t),a=i.pending,i.pending===i.pending_buf_size)){f=1;break}f=i.gzindex<i.gzhead.comment.length?255&i.gzhead.comment.charCodeAt(i.gzindex++):0,p(i,f)}while(0!==f);i.gzhead.hcrc&&i.pending>a&&(t.adler=s(t.adler,i.pending_buf,i.pending-a,a)),0===f&&(i.status=103)}else i.status=103;if(103===i.status&&(i.gzhead.hcrc?(i.pending+2>i.pending_buf_size&&l(t),i.pending+2<=i.pending_buf_size&&(p(i,255&t.adler),p(i,t.adler>>8&255),t.adler=0,i.status=113)):i.status=113),0!==i.pending){if(l(t),0===t.avail_out)return i.last_flush=-1,0}else if(0===t.avail_in&&c(e)<=c(r)&&4!==e)return u(t,-5);if(666===i.status&&0!==t.avail_in)return u(t,-5);if(0!==t.avail_in||0!==i.lookahead||0!==e&&666!==i.status){var v=2===i.strategy?function(t,e){for(var r;;){if(0===t.lookahead&&(m(t),0===t.lookahead)){if(0===e)return 1;break}if(t.match_length=0,r=o._tr_tally(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++,r&&(d(t,!1),0===t.strm.avail_out))return 1}return t.insert=0,4===e?(d(t,!0),0===t.strm.avail_out?3:4):t.last_lit&&(d(t,!1),0===t.strm.avail_out)?1:2}(i,e):3===i.strategy?function(t,e){for(var r,n,i,a,s=t.window;;){if(t.lookahead<=258){if(m(t),t.lookahead<=258&&0===e)return 1;if(0===t.lookahead)break}if(t.match_length=0,t.lookahead>=3&&t.strstart>0&&(n=s[i=t.strstart-1])===s[++i]&&n===s[++i]&&n===s[++i]){a=t.strstart+258;do{}while(n===s[++i]&&n===s[++i]&&n===s[++i]&&n===s[++i]&&n===s[++i]&&n===s[++i]&&n===s[++i]&&n===s[++i]&&i<a);t.match_length=258-(a-i),t.match_length>t.lookahead&&(t.match_length=t.lookahead)}if(t.match_length>=3?(r=o._tr_tally(t,1,t.match_length-3),t.lookahead-=t.match_length,t.strstart+=t.match_length,t.match_length=0):(r=o._tr_tally(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++),r&&(d(t,!1),0===t.strm.avail_out))return 1}return t.insert=0,4===e?(d(t,!0),0===t.strm.avail_out?3:4):t.last_lit&&(d(t,!1),0===t.strm.avail_out)?1:2}(i,e):n[i.level].func(i,e);if(3!==v&&4!==v||(i.status=666),1===v||3===v)return 0===t.avail_out&&(i.last_flush=-1),0;if(2===v&&(1===e?o._tr_align(i):5!==e&&(o._tr_stored_block(i,0,0,!1),3===e&&(h(i.head),0===i.lookahead&&(i.strstart=0,i.block_start=0,i.insert=0))),l(t),0===t.avail_out))return i.last_flush=-1,0}return 4!==e?0:i.wrap<=0?1:(2===i.wrap?(p(i,255&t.adler),p(i,t.adler>>8&255),p(i,t.adler>>16&255),p(i,t.adler>>24&255),p(i,255&t.total_in),p(i,t.total_in>>8&255),p(i,t.total_in>>16&255),p(i,t.total_in>>24&255)):(g(i,t.adler>>>16),g(i,65535&t.adler)),l(t),i.wrap>0&&(i.wrap=-i.wrap),0!==i.pending?0:1)},e.deflateEnd=function(t){var e;return t&&t.state?42!==(e=t.state.status)&&69!==e&&73!==e&&91!==e&&103!==e&&113!==e&&666!==e?u(t,-2):(t.state=null,113===e?u(t,-3):0):-2},e.deflateSetDictionary=function(t,e){var r,n,o,s,f,u,c,l,d=e.length;if(!t||!t.state)return-2;if(2===(s=(r=t.state).wrap)||1===s&&42!==r.status||r.lookahead)return-2;for(1===s&&(t.adler=a(t.adler,e,d,0)),r.wrap=0,d>=r.w_size&&(0===s&&(h(r.head),r.strstart=0,r.block_start=0,r.insert=0),l=new i.Buf8(r.w_size),i.arraySet(l,e,d-r.w_size,r.w_size,0),e=l,d=r.w_size),f=t.avail_in,u=t.next_in,c=t.input,t.avail_in=d,t.next_in=0,t.input=e,m(r);r.lookahead>=3;){n=r.strstart,o=r.lookahead-2;do{r.ins_h=(r.ins_h<<r.hash_shift^r.window[n+3-1])&r.hash_mask,r.prev[n&r.w_mask]=r.head[r.ins_h],r.head[r.ins_h]=n,n++}while(--o);r.strstart=n,r.lookahead=2,m(r)}return r.strstart+=r.lookahead,r.block_start=r.strstart,r.insert=r.lookahead,r.lookahead=0,r.match_length=r.prev_length=2,r.match_available=0,t.next_in=u,t.input=c,t.avail_in=f,r.wrap=s,0},e.deflateInfo="pako deflate (from Nodeca project)"},function(t,e,r){"use strict";var n=r(2);function i(t){for(var e=t.length;--e>=0;)t[e]=0}var o=[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],a=[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],s=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7],f=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],u=new Array(576);i(u);var c=new Array(60);i(c);var h=new Array(512);i(h);var l=new Array(256);i(l);var d=new Array(29);i(d);var p,g,y,v=new Array(30);function m(t,e,r,n,i){this.static_tree=t,this.extra_bits=e,this.extra_base=r,this.elems=n,this.max_length=i,this.has_stree=t&&t.length}function b(t,e){this.dyn_tree=t,this.max_code=0,this.stat_desc=e}function _(t){return t<256?h[t]:h[256+(t>>>7)]}function w(t,e){t.pending_buf[t.pending++]=255&e,t.pending_buf[t.pending++]=e>>>8&255}function A(t,e,r){t.bi_valid>16-r?(t.bi_buf|=e<<t.bi_valid&65535,w(t,t.bi_buf),t.bi_buf=e>>16-t.bi_valid,t.bi_valid+=r-16):(t.bi_buf|=e<<t.bi_valid&65535,t.bi_valid+=r)}function S(t,e,r){A(t,r[2*e],r[2*e+1])}function E(t,e){var r=0;do{r|=1&t,t>>>=1,r<<=1}while(--e>0);return r>>>1}function C(t,e,r){var n,i,o=new Array(16),a=0;for(n=1;n<=15;n++)o[n]=a=a+r[n-1]<<1;for(i=0;i<=e;i++){var s=t[2*i+1];0!==s&&(t[2*i]=E(o[s]++,s))}}function B(t){var e;for(e=0;e<286;e++)t.dyn_ltree[2*e]=0;for(e=0;e<30;e++)t.dyn_dtree[2*e]=0;for(e=0;e<19;e++)t.bl_tree[2*e]=0;t.dyn_ltree[512]=1,t.opt_len=t.static_len=0,t.last_lit=t.matches=0}function k(t){t.bi_valid>8?w(t,t.bi_buf):t.bi_valid>0&&(t.pending_buf[t.pending++]=t.bi_buf),t.bi_buf=0,t.bi_valid=0}function R(t,e,r,n){var i=2*e,o=2*r;return t[i]<t[o]||t[i]===t[o]&&n[e]<=n[r]}function x(t,e,r){for(var n=t.heap[r],i=r<<1;i<=t.heap_len&&(i<t.heap_len&&R(e,t.heap[i+1],t.heap[i],t.depth)&&i++,!R(e,n,t.heap[i],t.depth));)t.heap[r]=t.heap[i],r=i,i<<=1;t.heap[r]=n}function M(t,e,r){var n,i,s,f,u=0;if(0!==t.last_lit)do{n=t.pending_buf[t.d_buf+2*u]<<8|t.pending_buf[t.d_buf+2*u+1],i=t.pending_buf[t.l_buf+u],u++,0===n?S(t,i,e):(S(t,(s=l[i])+256+1,e),0!==(f=o[s])&&A(t,i-=d[s],f),S(t,s=_(--n),r),0!==(f=a[s])&&A(t,n-=v[s],f))}while(u<t.last_lit);S(t,256,e)}function T(t,e){var r,n,i,o=e.dyn_tree,a=e.stat_desc.static_tree,s=e.stat_desc.has_stree,f=e.stat_desc.elems,u=-1;for(t.heap_len=0,t.heap_max=573,r=0;r<f;r++)0!==o[2*r]?(t.heap[++t.heap_len]=u=r,t.depth[r]=0):o[2*r+1]=0;for(;t.heap_len<2;)o[2*(i=t.heap[++t.heap_len]=u<2?++u:0)]=1,t.depth[i]=0,t.opt_len--,s&&(t.static_len-=a[2*i+1]);for(e.max_code=u,r=t.heap_len>>1;r>=1;r--)x(t,o,r);i=f;do{r=t.heap[1],t.heap[1]=t.heap[t.heap_len--],x(t,o,1),n=t.heap[1],t.heap[--t.heap_max]=r,t.heap[--t.heap_max]=n,o[2*i]=o[2*r]+o[2*n],t.depth[i]=(t.depth[r]>=t.depth[n]?t.depth[r]:t.depth[n])+1,o[2*r+1]=o[2*n+1]=i,t.heap[1]=i++,x(t,o,1)}while(t.heap_len>=2);t.heap[--t.heap_max]=t.heap[1],function(t,e){var r,n,i,o,a,s,f=e.dyn_tree,u=e.max_code,c=e.stat_desc.static_tree,h=e.stat_desc.has_stree,l=e.stat_desc.extra_bits,d=e.stat_desc.extra_base,p=e.stat_desc.max_length,g=0;for(o=0;o<=15;o++)t.bl_count[o]=0;for(f[2*t.heap[t.heap_max]+1]=0,r=t.heap_max+1;r<573;r++)(o=f[2*f[2*(n=t.heap[r])+1]+1]+1)>p&&(o=p,g++),f[2*n+1]=o,n>u||(t.bl_count[o]++,a=0,n>=d&&(a=l[n-d]),s=f[2*n],t.opt_len+=s*(o+a),h&&(t.static_len+=s*(c[2*n+1]+a)));if(0!==g){do{for(o=p-1;0===t.bl_count[o];)o--;t.bl_count[o]--,t.bl_count[o+1]+=2,t.bl_count[p]--,g-=2}while(g>0);for(o=p;0!==o;o--)for(n=t.bl_count[o];0!==n;)(i=t.heap[--r])>u||(f[2*i+1]!==o&&(t.opt_len+=(o-f[2*i+1])*f[2*i],f[2*i+1]=o),n--)}}(t,e),C(o,u,t.bl_count)}function P(t,e,r){var n,i,o=-1,a=e[1],s=0,f=7,u=4;for(0===a&&(f=138,u=3),e[2*(r+1)+1]=65535,n=0;n<=r;n++)i=a,a=e[2*(n+1)+1],++s<f&&i===a||(s<u?t.bl_tree[2*i]+=s:0!==i?(i!==o&&t.bl_tree[2*i]++,t.bl_tree[32]++):s<=10?t.bl_tree[34]++:t.bl_tree[36]++,s=0,o=i,0===a?(f=138,u=3):i===a?(f=6,u=3):(f=7,u=4))}function I(t,e,r){var n,i,o=-1,a=e[1],s=0,f=7,u=4;for(0===a&&(f=138,u=3),n=0;n<=r;n++)if(i=a,a=e[2*(n+1)+1],!(++s<f&&i===a)){if(s<u)do{S(t,i,t.bl_tree)}while(0!=--s);else 0!==i?(i!==o&&(S(t,i,t.bl_tree),s--),S(t,16,t.bl_tree),A(t,s-3,2)):s<=10?(S(t,17,t.bl_tree),A(t,s-3,3)):(S(t,18,t.bl_tree),A(t,s-11,7));s=0,o=i,0===a?(f=138,u=3):i===a?(f=6,u=3):(f=7,u=4)}}i(v);var O=!1;function F(t,e,r,i){A(t,0+(i?1:0),3),function(t,e,r,i){k(t),i&&(w(t,r),w(t,~r)),n.arraySet(t.pending_buf,t.window,e,r,t.pending),t.pending+=r}(t,e,r,!0)}e._tr_init=function(t){O||(!function(){var t,e,r,n,i,f=new Array(16);for(r=0,n=0;n<28;n++)for(d[n]=r,t=0;t<1<<o[n];t++)l[r++]=n;for(l[r-1]=n,i=0,n=0;n<16;n++)for(v[n]=i,t=0;t<1<<a[n];t++)h[i++]=n;for(i>>=7;n<30;n++)for(v[n]=i<<7,t=0;t<1<<a[n]-7;t++)h[256+i++]=n;for(e=0;e<=15;e++)f[e]=0;for(t=0;t<=143;)u[2*t+1]=8,t++,f[8]++;for(;t<=255;)u[2*t+1]=9,t++,f[9]++;for(;t<=279;)u[2*t+1]=7,t++,f[7]++;for(;t<=287;)u[2*t+1]=8,t++,f[8]++;for(C(u,287,f),t=0;t<30;t++)c[2*t+1]=5,c[2*t]=E(t,5);p=new m(u,o,257,286,15),g=new m(c,a,0,30,15),y=new m(new Array(0),s,0,19,7)}(),O=!0),t.l_desc=new b(t.dyn_ltree,p),t.d_desc=new b(t.dyn_dtree,g),t.bl_desc=new b(t.bl_tree,y),t.bi_buf=0,t.bi_valid=0,B(t)},e._tr_stored_block=F,e._tr_flush_block=function(t,e,r,n){var i,o,a=0;t.level>0?(2===t.strm.data_type&&(t.strm.data_type=function(t){var e,r=4093624447;for(e=0;e<=31;e++,r>>>=1)if(1&r&&0!==t.dyn_ltree[2*e])return 0;if(0!==t.dyn_ltree[18]||0!==t.dyn_ltree[20]||0!==t.dyn_ltree[26])return 1;for(e=32;e<256;e++)if(0!==t.dyn_ltree[2*e])return 1;return 0}(t)),T(t,t.l_desc),T(t,t.d_desc),a=function(t){var e;for(P(t,t.dyn_ltree,t.l_desc.max_code),P(t,t.dyn_dtree,t.d_desc.max_code),T(t,t.bl_desc),e=18;e>=3&&0===t.bl_tree[2*f[e]+1];e--);return t.opt_len+=3*(e+1)+5+5+4,e}(t),i=t.opt_len+3+7>>>3,(o=t.static_len+3+7>>>3)<=i&&(i=o)):i=o=r+5,r+4<=i&&-1!==e?F(t,e,r,n):4===t.strategy||o===i?(A(t,2+(n?1:0),3),M(t,u,c)):(A(t,4+(n?1:0),3),function(t,e,r,n){var i;for(A(t,e-257,5),A(t,r-1,5),A(t,n-4,4),i=0;i<n;i++)A(t,t.bl_tree[2*f[i]+1],3);I(t,t.dyn_ltree,e-1),I(t,t.dyn_dtree,r-1)}(t,t.l_desc.max_code+1,t.d_desc.max_code+1,a+1),M(t,t.dyn_ltree,t.dyn_dtree)),B(t),n&&k(t)},e._tr_tally=function(t,e,r){return t.pending_buf[t.d_buf+2*t.last_lit]=e>>>8&255,t.pending_buf[t.d_buf+2*t.last_lit+1]=255&e,t.pending_buf[t.l_buf+t.last_lit]=255&r,t.last_lit++,0===e?t.dyn_ltree[2*r]++:(t.matches++,e--,t.dyn_ltree[2*(l[r]+256+1)]++,t.dyn_dtree[2*_(e)]++),t.last_lit===t.lit_bufsize-1},e._tr_align=function(t){A(t,2,3),S(t,256,u),function(t){16===t.bi_valid?(w(t,t.bi_buf),t.bi_buf=0,t.bi_valid=0):t.bi_valid>=8&&(t.pending_buf[t.pending++]=255&t.bi_buf,t.bi_buf>>=8,t.bi_valid-=8)}(t)}},function(t,e,r){"use strict";var n=r(41),i=r(2),o=r(20),a=r(22),s=r(10),f=r(21),u=r(44),c=Object.prototype.toString;function h(t){if(!(this instanceof h))return new h(t);this.options=i.assign({chunkSize:16384,windowBits:0,to:""},t||{});var e=this.options;e.raw&&e.windowBits>=0&&e.windowBits<16&&(e.windowBits=-e.windowBits,0===e.windowBits&&(e.windowBits=-15)),!(e.windowBits>=0&&e.windowBits<16)||t&&t.windowBits||(e.windowBits+=32),e.windowBits>15&&e.windowBits<48&&0==(15&e.windowBits)&&(e.windowBits|=15),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new f,this.strm.avail_out=0;var r=n.inflateInit2(this.strm,e.windowBits);if(r!==a.Z_OK)throw new Error(s[r]);if(this.header=new u,n.inflateGetHeader(this.strm,this.header),e.dictionary&&("string"==typeof e.dictionary?e.dictionary=o.string2buf(e.dictionary):"[object ArrayBuffer]"===c.call(e.dictionary)&&(e.dictionary=new Uint8Array(e.dictionary)),e.raw&&(r=n.inflateSetDictionary(this.strm,e.dictionary))!==a.Z_OK))throw new Error(s[r])}function l(t,e){var r=new h(e);if(r.push(t,!0),r.err)throw r.msg||s[r.err];return r.result}h.prototype.push=function(t,e){var r,s,f,u,h,l=this.strm,d=this.options.chunkSize,p=this.options.dictionary,g=!1;if(this.ended)return!1;s=e===~~e?e:!0===e?a.Z_FINISH:a.Z_NO_FLUSH,"string"==typeof t?l.input=o.binstring2buf(t):"[object ArrayBuffer]"===c.call(t)?l.input=new Uint8Array(t):l.input=t,l.next_in=0,l.avail_in=l.input.length;do{if(0===l.avail_out&&(l.output=new i.Buf8(d),l.next_out=0,l.avail_out=d),(r=n.inflate(l,a.Z_NO_FLUSH))===a.Z_NEED_DICT&&p&&(r=n.inflateSetDictionary(this.strm,p)),r===a.Z_BUF_ERROR&&!0===g&&(r=a.Z_OK,g=!1),r!==a.Z_STREAM_END&&r!==a.Z_OK)return this.onEnd(r),this.ended=!0,!1;l.next_out&&(0!==l.avail_out&&r!==a.Z_STREAM_END&&(0!==l.avail_in||s!==a.Z_FINISH&&s!==a.Z_SYNC_FLUSH)||("string"===this.options.to?(f=o.utf8border(l.output,l.next_out),u=l.next_out-f,h=o.buf2string(l.output,f),l.next_out=u,l.avail_out=d-u,u&&i.arraySet(l.output,l.output,f,u,0),this.onData(h)):this.onData(i.shrinkBuf(l.output,l.next_out)))),0===l.avail_in&&0===l.avail_out&&(g=!0)}while((l.avail_in>0||0===l.avail_out)&&r!==a.Z_STREAM_END);return r===a.Z_STREAM_END&&(s=a.Z_FINISH),s===a.Z_FINISH?(r=n.inflateEnd(this.strm),this.onEnd(r),this.ended=!0,r===a.Z_OK):s!==a.Z_SYNC_FLUSH||(this.onEnd(a.Z_OK),l.avail_out=0,!0)},h.prototype.onData=function(t){this.chunks.push(t)},h.prototype.onEnd=function(t){t===a.Z_OK&&("string"===this.options.to?this.result=this.chunks.join(""):this.result=i.flattenChunks(this.chunks)),this.chunks=[],this.err=t,this.msg=this.strm.msg},e.Inflate=h,e.inflate=l,e.inflateRaw=function(t,e){return(e=e||{}).raw=!0,l(t,e)},e.ungzip=l},function(t,e,r){"use strict";var n=r(2),i=r(18),o=r(19),a=r(42),s=r(43);function f(t){return(t>>>24&255)+(t>>>8&65280)+((65280&t)<<8)+((255&t)<<24)}function u(){this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new n.Buf16(320),this.work=new n.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function c(t){var e;return t&&t.state?(e=t.state,t.total_in=t.total_out=e.total=0,t.msg="",e.wrap&&(t.adler=1&e.wrap),e.mode=1,e.last=0,e.havedict=0,e.dmax=32768,e.head=null,e.hold=0,e.bits=0,e.lencode=e.lendyn=new n.Buf32(852),e.distcode=e.distdyn=new n.Buf32(592),e.sane=1,e.back=-1,0):-2}function h(t){var e;return t&&t.state?((e=t.state).wsize=0,e.whave=0,e.wnext=0,c(t)):-2}function l(t,e){var r,n;return t&&t.state?(n=t.state,e<0?(r=0,e=-e):(r=1+(e>>4),e<48&&(e&=15)),e&&(e<8||e>15)?-2:(null!==n.window&&n.wbits!==e&&(n.window=null),n.wrap=r,n.wbits=e,h(t))):-2}function d(t,e){var r,n;return t?(n=new u,t.state=n,n.window=null,0!==(r=l(t,e))&&(t.state=null),r):-2}var p,g,y=!0;function v(t){if(y){var e;for(p=new n.Buf32(512),g=new n.Buf32(32),e=0;e<144;)t.lens[e++]=8;for(;e<256;)t.lens[e++]=9;for(;e<280;)t.lens[e++]=7;for(;e<288;)t.lens[e++]=8;for(s(1,t.lens,0,288,p,0,t.work,{bits:9}),e=0;e<32;)t.lens[e++]=5;s(2,t.lens,0,32,g,0,t.work,{bits:5}),y=!1}t.lencode=p,t.lenbits=9,t.distcode=g,t.distbits=5}function m(t,e,r,i){var o,a=t.state;return null===a.window&&(a.wsize=1<<a.wbits,a.wnext=0,a.whave=0,a.window=new n.Buf8(a.wsize)),i>=a.wsize?(n.arraySet(a.window,e,r-a.wsize,a.wsize,0),a.wnext=0,a.whave=a.wsize):((o=a.wsize-a.wnext)>i&&(o=i),n.arraySet(a.window,e,r-i,o,a.wnext),(i-=o)?(n.arraySet(a.window,e,r-i,i,0),a.wnext=i,a.whave=a.wsize):(a.wnext+=o,a.wnext===a.wsize&&(a.wnext=0),a.whave<a.wsize&&(a.whave+=o))),0}e.inflateReset=h,e.inflateReset2=l,e.inflateResetKeep=c,e.inflateInit=function(t){return d(t,15)},e.inflateInit2=d,e.inflate=function(t,e){var r,u,c,h,l,d,p,g,y,b,_,w,A,S,E,C,B,k,R,x,M,T,P,I,O=0,F=new n.Buf8(4),U=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15];if(!t||!t.state||!t.output||!t.input&&0!==t.avail_in)return-2;12===(r=t.state).mode&&(r.mode=13),l=t.next_out,c=t.output,p=t.avail_out,h=t.next_in,u=t.input,d=t.avail_in,g=r.hold,y=r.bits,b=d,_=p,T=0;t:for(;;)switch(r.mode){case 1:if(0===r.wrap){r.mode=13;break}for(;y<16;){if(0===d)break t;d--,g+=u[h++]<<y,y+=8}if(2&r.wrap&&35615===g){r.check=0,F[0]=255&g,F[1]=g>>>8&255,r.check=o(r.check,F,2,0),g=0,y=0,r.mode=2;break}if(r.flags=0,r.head&&(r.head.done=!1),!(1&r.wrap)||(((255&g)<<8)+(g>>8))%31){t.msg="incorrect header check",r.mode=30;break}if(8!=(15&g)){t.msg="unknown compression method",r.mode=30;break}if(y-=4,M=8+(15&(g>>>=4)),0===r.wbits)r.wbits=M;else if(M>r.wbits){t.msg="invalid window size",r.mode=30;break}r.dmax=1<<M,t.adler=r.check=1,r.mode=512&g?10:12,g=0,y=0;break;case 2:for(;y<16;){if(0===d)break t;d--,g+=u[h++]<<y,y+=8}if(r.flags=g,8!=(255&r.flags)){t.msg="unknown compression method",r.mode=30;break}if(57344&r.flags){t.msg="unknown header flags set",r.mode=30;break}r.head&&(r.head.text=g>>8&1),512&r.flags&&(F[0]=255&g,F[1]=g>>>8&255,r.check=o(r.check,F,2,0)),g=0,y=0,r.mode=3;case 3:for(;y<32;){if(0===d)break t;d--,g+=u[h++]<<y,y+=8}r.head&&(r.head.time=g),512&r.flags&&(F[0]=255&g,F[1]=g>>>8&255,F[2]=g>>>16&255,F[3]=g>>>24&255,r.check=o(r.check,F,4,0)),g=0,y=0,r.mode=4;case 4:for(;y<16;){if(0===d)break t;d--,g+=u[h++]<<y,y+=8}r.head&&(r.head.xflags=255&g,r.head.os=g>>8),512&r.flags&&(F[0]=255&g,F[1]=g>>>8&255,r.check=o(r.check,F,2,0)),g=0,y=0,r.mode=5;case 5:if(1024&r.flags){for(;y<16;){if(0===d)break t;d--,g+=u[h++]<<y,y+=8}r.length=g,r.head&&(r.head.extra_len=g),512&r.flags&&(F[0]=255&g,F[1]=g>>>8&255,r.check=o(r.check,F,2,0)),g=0,y=0}else r.head&&(r.head.extra=null);r.mode=6;case 6:if(1024&r.flags&&((w=r.length)>d&&(w=d),w&&(r.head&&(M=r.head.extra_len-r.length,r.head.extra||(r.head.extra=new Array(r.head.extra_len)),n.arraySet(r.head.extra,u,h,w,M)),512&r.flags&&(r.check=o(r.check,u,w,h)),d-=w,h+=w,r.length-=w),r.length))break t;r.length=0,r.mode=7;case 7:if(2048&r.flags){if(0===d)break t;w=0;do{M=u[h+w++],r.head&&M&&r.length<65536&&(r.head.name+=String.fromCharCode(M))}while(M&&w<d);if(512&r.flags&&(r.check=o(r.check,u,w,h)),d-=w,h+=w,M)break t}else r.head&&(r.head.name=null);r.length=0,r.mode=8;case 8:if(4096&r.flags){if(0===d)break t;w=0;do{M=u[h+w++],r.head&&M&&r.length<65536&&(r.head.comment+=String.fromCharCode(M))}while(M&&w<d);if(512&r.flags&&(r.check=o(r.check,u,w,h)),d-=w,h+=w,M)break t}else r.head&&(r.head.comment=null);r.mode=9;case 9:if(512&r.flags){for(;y<16;){if(0===d)break t;d--,g+=u[h++]<<y,y+=8}if(g!==(65535&r.check)){t.msg="header crc mismatch",r.mode=30;break}g=0,y=0}r.head&&(r.head.hcrc=r.flags>>9&1,r.head.done=!0),t.adler=r.check=0,r.mode=12;break;case 10:for(;y<32;){if(0===d)break t;d--,g+=u[h++]<<y,y+=8}t.adler=r.check=f(g),g=0,y=0,r.mode=11;case 11:if(0===r.havedict)return t.next_out=l,t.avail_out=p,t.next_in=h,t.avail_in=d,r.hold=g,r.bits=y,2;t.adler=r.check=1,r.mode=12;case 12:if(5===e||6===e)break t;case 13:if(r.last){g>>>=7&y,y-=7&y,r.mode=27;break}for(;y<3;){if(0===d)break t;d--,g+=u[h++]<<y,y+=8}switch(r.last=1&g,y-=1,3&(g>>>=1)){case 0:r.mode=14;break;case 1:if(v(r),r.mode=20,6===e){g>>>=2,y-=2;break t}break;case 2:r.mode=17;break;case 3:t.msg="invalid block type",r.mode=30}g>>>=2,y-=2;break;case 14:for(g>>>=7&y,y-=7&y;y<32;){if(0===d)break t;d--,g+=u[h++]<<y,y+=8}if((65535&g)!=(g>>>16^65535)){t.msg="invalid stored block lengths",r.mode=30;break}if(r.length=65535&g,g=0,y=0,r.mode=15,6===e)break t;case 15:r.mode=16;case 16:if(w=r.length){if(w>d&&(w=d),w>p&&(w=p),0===w)break t;n.arraySet(c,u,h,w,l),d-=w,h+=w,p-=w,l+=w,r.length-=w;break}r.mode=12;break;case 17:for(;y<14;){if(0===d)break t;d--,g+=u[h++]<<y,y+=8}if(r.nlen=257+(31&g),g>>>=5,y-=5,r.ndist=1+(31&g),g>>>=5,y-=5,r.ncode=4+(15&g),g>>>=4,y-=4,r.nlen>286||r.ndist>30){t.msg="too many length or distance symbols",r.mode=30;break}r.have=0,r.mode=18;case 18:for(;r.have<r.ncode;){for(;y<3;){if(0===d)break t;d--,g+=u[h++]<<y,y+=8}r.lens[U[r.have++]]=7&g,g>>>=3,y-=3}for(;r.have<19;)r.lens[U[r.have++]]=0;if(r.lencode=r.lendyn,r.lenbits=7,P={bits:r.lenbits},T=s(0,r.lens,0,19,r.lencode,0,r.work,P),r.lenbits=P.bits,T){t.msg="invalid code lengths set",r.mode=30;break}r.have=0,r.mode=19;case 19:for(;r.have<r.nlen+r.ndist;){for(;C=(O=r.lencode[g&(1<<r.lenbits)-1])>>>16&255,B=65535&O,!((E=O>>>24)<=y);){if(0===d)break t;d--,g+=u[h++]<<y,y+=8}if(B<16)g>>>=E,y-=E,r.lens[r.have++]=B;else{if(16===B){for(I=E+2;y<I;){if(0===d)break t;d--,g+=u[h++]<<y,y+=8}if(g>>>=E,y-=E,0===r.have){t.msg="invalid bit length repeat",r.mode=30;break}M=r.lens[r.have-1],w=3+(3&g),g>>>=2,y-=2}else if(17===B){for(I=E+3;y<I;){if(0===d)break t;d--,g+=u[h++]<<y,y+=8}y-=E,M=0,w=3+(7&(g>>>=E)),g>>>=3,y-=3}else{for(I=E+7;y<I;){if(0===d)break t;d--,g+=u[h++]<<y,y+=8}y-=E,M=0,w=11+(127&(g>>>=E)),g>>>=7,y-=7}if(r.have+w>r.nlen+r.ndist){t.msg="invalid bit length repeat",r.mode=30;break}for(;w--;)r.lens[r.have++]=M}}if(30===r.mode)break;if(0===r.lens[256]){t.msg="invalid code -- missing end-of-block",r.mode=30;break}if(r.lenbits=9,P={bits:r.lenbits},T=s(1,r.lens,0,r.nlen,r.lencode,0,r.work,P),r.lenbits=P.bits,T){t.msg="invalid literal/lengths set",r.mode=30;break}if(r.distbits=6,r.distcode=r.distdyn,P={bits:r.distbits},T=s(2,r.lens,r.nlen,r.ndist,r.distcode,0,r.work,P),r.distbits=P.bits,T){t.msg="invalid distances set",r.mode=30;break}if(r.mode=20,6===e)break t;case 20:r.mode=21;case 21:if(d>=6&&p>=258){t.next_out=l,t.avail_out=p,t.next_in=h,t.avail_in=d,r.hold=g,r.bits=y,a(t,_),l=t.next_out,c=t.output,p=t.avail_out,h=t.next_in,u=t.input,d=t.avail_in,g=r.hold,y=r.bits,12===r.mode&&(r.back=-1);break}for(r.back=0;C=(O=r.lencode[g&(1<<r.lenbits)-1])>>>16&255,B=65535&O,!((E=O>>>24)<=y);){if(0===d)break t;d--,g+=u[h++]<<y,y+=8}if(C&&0==(240&C)){for(k=E,R=C,x=B;C=(O=r.lencode[x+((g&(1<<k+R)-1)>>k)])>>>16&255,B=65535&O,!(k+(E=O>>>24)<=y);){if(0===d)break t;d--,g+=u[h++]<<y,y+=8}g>>>=k,y-=k,r.back+=k}if(g>>>=E,y-=E,r.back+=E,r.length=B,0===C){r.mode=26;break}if(32&C){r.back=-1,r.mode=12;break}if(64&C){t.msg="invalid literal/length code",r.mode=30;break}r.extra=15&C,r.mode=22;case 22:if(r.extra){for(I=r.extra;y<I;){if(0===d)break t;d--,g+=u[h++]<<y,y+=8}r.length+=g&(1<<r.extra)-1,g>>>=r.extra,y-=r.extra,r.back+=r.extra}r.was=r.length,r.mode=23;case 23:for(;C=(O=r.distcode[g&(1<<r.distbits)-1])>>>16&255,B=65535&O,!((E=O>>>24)<=y);){if(0===d)break t;d--,g+=u[h++]<<y,y+=8}if(0==(240&C)){for(k=E,R=C,x=B;C=(O=r.distcode[x+((g&(1<<k+R)-1)>>k)])>>>16&255,B=65535&O,!(k+(E=O>>>24)<=y);){if(0===d)break t;d--,g+=u[h++]<<y,y+=8}g>>>=k,y-=k,r.back+=k}if(g>>>=E,y-=E,r.back+=E,64&C){t.msg="invalid distance code",r.mode=30;break}r.offset=B,r.extra=15&C,r.mode=24;case 24:if(r.extra){for(I=r.extra;y<I;){if(0===d)break t;d--,g+=u[h++]<<y,y+=8}r.offset+=g&(1<<r.extra)-1,g>>>=r.extra,y-=r.extra,r.back+=r.extra}if(r.offset>r.dmax){t.msg="invalid distance too far back",r.mode=30;break}r.mode=25;case 25:if(0===p)break t;if(w=_-p,r.offset>w){if((w=r.offset-w)>r.whave&&r.sane){t.msg="invalid distance too far back",r.mode=30;break}w>r.wnext?(w-=r.wnext,A=r.wsize-w):A=r.wnext-w,w>r.length&&(w=r.length),S=r.window}else S=c,A=l-r.offset,w=r.length;w>p&&(w=p),p-=w,r.length-=w;do{c[l++]=S[A++]}while(--w);0===r.length&&(r.mode=21);break;case 26:if(0===p)break t;c[l++]=r.length,p--,r.mode=21;break;case 27:if(r.wrap){for(;y<32;){if(0===d)break t;d--,g|=u[h++]<<y,y+=8}if(_-=p,t.total_out+=_,r.total+=_,_&&(t.adler=r.check=r.flags?o(r.check,c,_,l-_):i(r.check,c,_,l-_)),_=p,(r.flags?g:f(g))!==r.check){t.msg="incorrect data check",r.mode=30;break}g=0,y=0}r.mode=28;case 28:if(r.wrap&&r.flags){for(;y<32;){if(0===d)break t;d--,g+=u[h++]<<y,y+=8}if(g!==(4294967295&r.total)){t.msg="incorrect length check",r.mode=30;break}g=0,y=0}r.mode=29;case 29:T=1;break t;case 30:T=-3;break t;case 31:return-4;case 32:default:return-2}return t.next_out=l,t.avail_out=p,t.next_in=h,t.avail_in=d,r.hold=g,r.bits=y,(r.wsize||_!==t.avail_out&&r.mode<30&&(r.mode<27||4!==e))&&m(t,t.output,t.next_out,_-t.avail_out)?(r.mode=31,-4):(b-=t.avail_in,_-=t.avail_out,t.total_in+=b,t.total_out+=_,r.total+=_,r.wrap&&_&&(t.adler=r.check=r.flags?o(r.check,c,_,t.next_out-_):i(r.check,c,_,t.next_out-_)),t.data_type=r.bits+(r.last?64:0)+(12===r.mode?128:0)+(20===r.mode||15===r.mode?256:0),(0===b&&0===_||4===e)&&0===T&&(T=-5),T)},e.inflateEnd=function(t){if(!t||!t.state)return-2;var e=t.state;return e.window&&(e.window=null),t.state=null,0},e.inflateGetHeader=function(t,e){var r;return t&&t.state?0==(2&(r=t.state).wrap)?-2:(r.head=e,e.done=!1,0):-2},e.inflateSetDictionary=function(t,e){var r,n=e.length;return t&&t.state?0!==(r=t.state).wrap&&11!==r.mode?-2:11===r.mode&&i(1,e,n,0)!==r.check?-3:m(t,e,n,n)?(r.mode=31,-4):(r.havedict=1,0):-2},e.inflateInfo="pako inflate (from Nodeca project)"},function(t,e,r){"use strict";t.exports=function(t,e){var r,n,i,o,a,s,f,u,c,h,l,d,p,g,y,v,m,b,_,w,A,S,E,C,B;r=t.state,n=t.next_in,C=t.input,i=n+(t.avail_in-5),o=t.next_out,B=t.output,a=o-(e-t.avail_out),s=o+(t.avail_out-257),f=r.dmax,u=r.wsize,c=r.whave,h=r.wnext,l=r.window,d=r.hold,p=r.bits,g=r.lencode,y=r.distcode,v=(1<<r.lenbits)-1,m=(1<<r.distbits)-1;t:do{p<15&&(d+=C[n++]<<p,p+=8,d+=C[n++]<<p,p+=8),b=g[d&v];e:for(;;){if(d>>>=_=b>>>24,p-=_,0===(_=b>>>16&255))B[o++]=65535&b;else{if(!(16&_)){if(0==(64&_)){b=g[(65535&b)+(d&(1<<_)-1)];continue e}if(32&_){r.mode=12;break t}t.msg="invalid literal/length code",r.mode=30;break t}w=65535&b,(_&=15)&&(p<_&&(d+=C[n++]<<p,p+=8),w+=d&(1<<_)-1,d>>>=_,p-=_),p<15&&(d+=C[n++]<<p,p+=8,d+=C[n++]<<p,p+=8),b=y[d&m];r:for(;;){if(d>>>=_=b>>>24,p-=_,!(16&(_=b>>>16&255))){if(0==(64&_)){b=y[(65535&b)+(d&(1<<_)-1)];continue r}t.msg="invalid distance code",r.mode=30;break t}if(A=65535&b,p<(_&=15)&&(d+=C[n++]<<p,(p+=8)<_&&(d+=C[n++]<<p,p+=8)),(A+=d&(1<<_)-1)>f){t.msg="invalid distance too far back",r.mode=30;break t}if(d>>>=_,p-=_,A>(_=o-a)){if((_=A-_)>c&&r.sane){t.msg="invalid distance too far back",r.mode=30;break t}if(S=0,E=l,0===h){if(S+=u-_,_<w){w-=_;do{B[o++]=l[S++]}while(--_);S=o-A,E=B}}else if(h<_){if(S+=u+h-_,(_-=h)<w){w-=_;do{B[o++]=l[S++]}while(--_);if(S=0,h<w){w-=_=h;do{B[o++]=l[S++]}while(--_);S=o-A,E=B}}}else if(S+=h-_,_<w){w-=_;do{B[o++]=l[S++]}while(--_);S=o-A,E=B}for(;w>2;)B[o++]=E[S++],B[o++]=E[S++],B[o++]=E[S++],w-=3;w&&(B[o++]=E[S++],w>1&&(B[o++]=E[S++]))}else{S=o-A;do{B[o++]=B[S++],B[o++]=B[S++],B[o++]=B[S++],w-=3}while(w>2);w&&(B[o++]=B[S++],w>1&&(B[o++]=B[S++]))}break}}break}}while(n<i&&o<s);n-=w=p>>3,d&=(1<<(p-=w<<3))-1,t.next_in=n,t.next_out=o,t.avail_in=n<i?i-n+5:5-(n-i),t.avail_out=o<s?s-o+257:257-(o-s),r.hold=d,r.bits=p}},function(t,e,r){"use strict";var n=r(2),i=[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],o=[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],a=[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],s=[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];t.exports=function(t,e,r,f,u,c,h,l){var d,p,g,y,v,m,b,_,w,A=l.bits,S=0,E=0,C=0,B=0,k=0,R=0,x=0,M=0,T=0,P=0,I=null,O=0,F=new n.Buf16(16),U=new n.Buf16(16),L=null,N=0;for(S=0;S<=15;S++)F[S]=0;for(E=0;E<f;E++)F[e[r+E]]++;for(k=A,B=15;B>=1&&0===F[B];B--);if(k>B&&(k=B),0===B)return u[c++]=20971520,u[c++]=20971520,l.bits=1,0;for(C=1;C<B&&0===F[C];C++);for(k<C&&(k=C),M=1,S=1;S<=15;S++)if(M<<=1,(M-=F[S])<0)return-1;if(M>0&&(0===t||1!==B))return-1;for(U[1]=0,S=1;S<15;S++)U[S+1]=U[S]+F[S];for(E=0;E<f;E++)0!==e[r+E]&&(h[U[e[r+E]]++]=E);if(0===t?(I=L=h,m=19):1===t?(I=i,O-=257,L=o,N-=257,m=256):(I=a,L=s,m=-1),P=0,E=0,S=C,v=c,R=k,x=0,g=-1,y=(T=1<<k)-1,1===t&&T>852||2===t&&T>592)return 1;for(;;){b=S-x,h[E]<m?(_=0,w=h[E]):h[E]>m?(_=L[N+h[E]],w=I[O+h[E]]):(_=96,w=0),d=1<<S-x,C=p=1<<R;do{u[v+(P>>x)+(p-=d)]=b<<24|_<<16|w|0}while(0!==p);for(d=1<<S-1;P&d;)d>>=1;if(0!==d?(P&=d-1,P+=d):P=0,E++,0==--F[S]){if(S===B)break;S=e[r+h[E]]}if(S>k&&(P&y)!==g){for(0===x&&(x=k),v+=C,M=1<<(R=S-x);R+x<B&&!((M-=F[R+x])<=0);)R++,M<<=1;if(T+=1<<R,1===t&&T>852||2===t&&T>592)return 1;u[g=P&y]=k<<24|R<<16|v-c|0}}return 0!==P&&(u[v+P]=S-x<<24|64<<16|0),l.bits=k,0}},function(t,e,r){"use strict";t.exports=function(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name="",this.comment="",this.hcrc=0,this.done=!1}},function(t,e,r){var n=r(1).Buffer,i=[0,1996959894,3993919788,2567524794,124634137,1886057615,3915621685,2657392035,249268274,2044508324,3772115230,2547177864,162941995,2125561021,3887607047,2428444049,498536548,1789927666,4089016648,2227061214,450548861,1843258603,4107580753,2211677639,325883990,1684777152,4251122042,2321926636,335633487,1661365465,4195302755,2366115317,997073096,1281953886,3579855332,2724688242,1006888145,1258607687,3524101629,2768942443,901097722,1119000684,3686517206,2898065728,853044451,1172266101,3705015759,2882616665,651767980,1373503546,3369554304,3218104598,565507253,1454621731,3485111705,3099436303,671266974,1594198024,3322730930,2970347812,795835527,1483230225,3244367275,3060149565,1994146192,31158534,2563907772,4023717930,1907459465,112637215,2680153253,3904427059,2013776290,251722036,2517215374,3775830040,2137656763,141376813,2439277719,3865271297,1802195444,476864866,2238001368,4066508878,1812370925,453092731,2181625025,4111451223,1706088902,314042704,2344532202,4240017532,1658658271,366619977,2362670323,4224994405,1303535960,984961486,2747007092,3569037538,1256170817,1037604311,2765210733,3554079995,1131014506,879679996,2909243462,3663771856,1141124467,855842277,2852801631,3708648649,1342533948,654459306,3188396048,3373015174,1466479909,544179635,3110523913,3462522015,1591671054,702138776,2966460450,3352799412,1504918807,783551873,3082640443,3233442989,3988292384,2596254646,62317068,1957810842,3939845945,2647816111,81470997,1943803523,3814918930,2489596804,225274430,2053790376,3826175755,2466906013,167816743,2097651377,4027552580,2265490386,503444072,1762050814,4150417245,2154129355,426522225,1852507879,4275313526,2312317920,282753626,1742555852,4189708143,2394877945,397917763,1622183637,3604390888,2714866558,953729732,1340076626,3518719985,2797360999,1068828381,1219638859,3624741850,2936675148,906185462,1090812512,3747672003,2825379669,829329135,1181335161,3412177804,3160834842,628085408,1382605366,3423369109,3138078467,570562233,1426400815,3317316542,2998733608,733239954,1555261956,3268935591,3050360625,752459403,1541320221,2607071920,3965973030,1969922972,40735498,2617837225,3943577151,1913087877,83908371,2512341634,3803740692,2075208622,213261112,2463272603,3855990285,2094854071,198958881,2262029012,4057260610,1759359992,534414190,2176718541,4139329115,1873836001,414664567,2282248934,4279200368,1711684554,285281116,2405801727,4167216745,1634467795,376229701,2685067896,3608007406,1308918612,956543938,2808555105,3495958263,1231636301,1047427035,2932959818,3654703836,1088359270,936918e3,2847714899,3736837829,1202900863,817233897,3183342108,3401237130,1404277552,615818150,3134207493,3453421203,1423857449,601450431,3009837614,3294710456,1567103746,711928724,3020668471,3272380065,1510334235,755167117];function o(t){if(n.isBuffer(t))return t;var e="function"==typeof n.alloc&&"function"==typeof n.from;if("number"==typeof t)return e?n.alloc(t):new n(t);if("string"==typeof t)return e?n.from(t):new n(t);throw new Error("input must be buffer, number, or string, received "+typeof t)}function a(t){var e=o(4);return e.writeInt32BE(t,0),e}function s(t,e){t=o(t),n.isBuffer(e)&&(e=e.readUInt32BE(0));for(var r=-1^~~e,a=0;a<t.length;a++)r=i[255&(r^t[a])]^r>>>8;return-1^r}function f(){return a(s.apply(null,arguments))}"undefined"!=typeof Int32Array&&(i=new Int32Array(i)),f.signed=function(){return s.apply(null,arguments)},f.unsigned=function(){return s.apply(null,arguments)>>>0},t.exports=f},function(t,e,r){"use strict";(function(t){var n=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var i=r(0),o=n(r(6)),a=r(47),s=n(r(48)),f=n(r(49));var u=function(){function t(t,e){void 0===e&&(e=0),this._buffer=t,this._position=e,this.length=t.length}return t.prototype.get=function(){var t=this._buffer[this._position];return this._position+=1,t},t.prototype.getByte=function(){return this.get()},t.prototype.getByteAt=function(t){return this._buffer[t]},t.prototype.position=function(){return this._position},t.prototype.put=function(t){return this._buffer[this._position]=t,this._position+=1,t},t.prototype.putAt=function(t,e){return this._buffer[t]=e,e},t.prototype.setPosition=function(t){return this._position=t,t},t.prototype.getInt=function(){var t=this._buffer.readInt32LE(this._position);return this._position+=4,t},t.prototype.remaining=function(){return this._buffer.length-this._position},t}();e.default=function(e,r,n){if(void 0===n&&(n=0),0===e.length)return r.fill(0),r;var c=new u(e,n),h=c.get();if(0!==h&&1!==h)throw new i.CramMalformedError("Invalid rANS order ".concat(h));if(c.getInt()!==c.remaining()-4)throw new i.CramMalformedError("Incorrect input length.");var l=c.getInt(),d=new u(r||t.allocUnsafe(l));if(d.length<l)throw new i.CramMalformedError("Output buffer too small to fit ".concat(l," bytes."));switch(h){case 0:return function(t,e){for(var r=new o.default.AriDecoder,n=new Array(256),i=0;i<n.length;i+=1)n[i]=new o.default.Symbol;return(0,a.readStatsO0)(t,r,n),(0,s.default)(t,r,n,e),e}(c,d);case 1:return function(t,e){for(var r=new Array(256),n=0;n<r.length;n+=1)r[n]=new o.default.AriDecoder;var i=new Array(256);for(n=0;n<i.length;n+=1){i[n]=new Array(256);for(var s=0;s<i[n].length;s+=1)i[n][s]=new o.default.Symbol}return(0,a.readStatsO1)(t,r,i),(0,f.default)(t,e,r,i),e}(c,d);default:throw new i.CramMalformedError("Invalid rANS order: ".concat(h))}}}).call(this,r(1).Buffer)},function(t,e,r){"use strict";var n=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.readStatsO1=e.readStatsO0=void 0;var i=r(0),o=r(7),a=n(r(6));function s(t){if(!t)throw new i.CramMalformedError("assertion failed")}e.readStatsO0=function(t,e,r){var n=0,i=0,f=255&t.get();do{null==e.fc[f]&&(e.fc[f]=new a.default.FC),e.fc[f].F=255&t.get(),e.fc[f].F>=128&&(e.fc[f].F&=-129,e.fc[f].F=(127&e.fc[f].F)<<8|255&t.get()),e.fc[f].C=i,a.default.symbolInit(r[f],e.fc[f].C,e.fc[f].F),e.R||(e.R=new Array(o.TOTFREQ)),e.R.fill(f,i,i+e.fc[f].F),i+=e.fc[f].F,0===n&&f+1===(255&t.getByteAt(t.position()))?(f=255&t.get(),n=255&t.get()):0!==n?(n-=1,f+=1):f=255&t.get()}while(0!==f);s(i<o.TOTFREQ)},e.readStatsO1=function(t,e,r){var n=0,i=255&t.get();do{var f=0,u=0,c=255&t.get();null==e[i]&&(e[i]=new a.default.AriDecoder);do{null==e[i].fc[c]&&(e[i].fc[c]=new a.default.FC),e[i].fc[c].F=255&t.get(),e[i].fc[c].F>=128&&(e[i].fc[c].F&=-129,e[i].fc[c].F=(127&e[i].fc[c].F)<<8|255&t.get()),e[i].fc[c].C=u,0===e[i].fc[c].F&&(e[i].fc[c].F=o.TOTFREQ),null==r[i][c]&&(r[i][c]=new a.default.RansDecSymbol),a.default.symbolInit(r[i][c],e[i].fc[c].C,e[i].fc[c].F),null==e[i].R&&(e[i].R=new Array(o.TOTFREQ)),e[i].R.fill(c,u,u+e[i].fc[c].F),s((u+=e[i].fc[c].F)<=o.TOTFREQ),0===f&&c+1===(255&t.getByteAt(t.position()))?(c=255&t.get(),f=255&t.get()):0!==f?(f-=1,c+=1):c=255&t.get()}while(0!==c);0===n&&i+1===(255&t.getByteAt(t.position()))?(i=255&t.get(),n=255&t.get()):0!==n?(n-=1,i+=1):i=255&t.get()}while(0!==i)}},function(t,e,r){"use strict";var n=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var i=r(0),o=r(7),a=n(r(6));e.default=function(t,e,r,n){for(var s,f=t.getInt(),u=t.getInt(),c=t.getInt(),h=t.getInt(),l=n.remaining(),d=-4&l,p=0;p<d;p+=4){var g=e.R[a.default.get(f,o.TF_SHIFT)],y=e.R[a.default.get(u,o.TF_SHIFT)],v=e.R[a.default.get(c,o.TF_SHIFT)],m=e.R[a.default.get(h,o.TF_SHIFT)];n.putAt(p,g),n.putAt(p+1,y),n.putAt(p+2,v),n.putAt(p+3,m),f=a.default.advanceSymbolStep(f,r[255&g],o.TF_SHIFT),u=a.default.advanceSymbolStep(u,r[255&y],o.TF_SHIFT),c=a.default.advanceSymbolStep(c,r[255&v],o.TF_SHIFT),h=a.default.advanceSymbolStep(h,r[255&m],o.TF_SHIFT),f=a.default.renormalize(f,t),u=a.default.renormalize(u,t),c=a.default.renormalize(c,t),h=a.default.renormalize(h,t)}switch(n.setPosition(d),3&l){case 0:break;case 1:s=e.R[a.default.get(f,o.TF_SHIFT)],a.default.advanceSymbol(f,t,r[255&s],o.TF_SHIFT),n.put(s);break;case 2:s=e.R[a.default.get(f,o.TF_SHIFT)],a.default.advanceSymbol(f,t,r[255&s],o.TF_SHIFT),n.put(s),s=e.R[a.default.get(u,o.TF_SHIFT)],a.default.advanceSymbol(u,t,r[255&s],o.TF_SHIFT),n.put(s);break;case 3:s=e.R[a.default.get(f,o.TF_SHIFT)],a.default.advanceSymbol(f,t,r[255&s],o.TF_SHIFT),n.put(s),s=e.R[a.default.get(u,o.TF_SHIFT)],a.default.advanceSymbol(u,t,r[255&s],o.TF_SHIFT),n.put(s),s=e.R[a.default.get(c,o.TF_SHIFT)],a.default.advanceSymbol(c,t,r[255&s],o.TF_SHIFT),n.put(s);break;default:throw new i.CramMalformedError("invalid output size encountered during rANS decoding")}n.setPosition(0)}},function(t,e,r){"use strict";var n=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var i=r(7),o=n(r(6));e.default=function(t,e,r,n){for(var a=e.remaining(),s=t.getInt(),f=t.getInt(),u=t.getInt(),c=t.getInt(),h=a>>2,l=0,d=h,p=2*h,g=3*h,y=0,v=0,m=0,b=0;l<h;l+=1,d+=1,p+=1,g+=1){var _=255&r[y].R[o.default.get(s,i.TF_SHIFT)],w=255&r[v].R[o.default.get(f,i.TF_SHIFT)],A=255&r[m].R[o.default.get(u,i.TF_SHIFT)],S=255&r[b].R[o.default.get(c,i.TF_SHIFT)];e.putAt(l,_),e.putAt(d,w),e.putAt(p,A),e.putAt(g,S),s=o.default.advanceSymbolStep(s,n[y][_],i.TF_SHIFT),f=o.default.advanceSymbolStep(f,n[v][w],i.TF_SHIFT),u=o.default.advanceSymbolStep(u,n[m][A],i.TF_SHIFT),c=o.default.advanceSymbolStep(c,n[b][S],i.TF_SHIFT),s=o.default.renormalize(s,t),f=o.default.renormalize(f,t),u=o.default.renormalize(u,t),c=o.default.renormalize(c,t),y=_,v=w,m=A,b=S}for(;g<a;g+=1){S=255&r[b].R[o.default.get(c,i.TF_SHIFT)];e.putAt(g,S),c=o.default.advanceSymbol(c,t,n[b][S],i.TF_SHIFT),b=S}}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.getSectionParsers=e.cramFileDefinition=void 0;var n=r(51),i=(new n.Parser).itf8(),o={parser:(new n.Parser).string("magic",{length:4}).uint8("majorVersion").uint8("minorVersion").string("fileId",{length:20,stripNull:!0}),maxLength:26};e.cramFileDefinition=o;var a={parser:(new n.Parser).uint8("compressionMethod",{formatter:function(t){var e=["raw","gzip","bzip2","lzma","rans","rans4x16","arith","fqzcomp","tok3"][t];if(!e)throw new Error("compression method number ".concat(t," not implemented"));return e}}).uint8("contentType",{formatter:function(t){var e=["FILE_HEADER","COMPRESSION_HEADER","MAPPED_SLICE_HEADER","UNMAPPED_SLICE_HEADER","EXTERNAL_DATA","CORE_DATA"][t];if(!e)throw new Error("invalid block content type id ".concat(t));return e}}).itf8("contentId").itf8("compressedSize").itf8("uncompressedSize"),maxLength:17},s={parser:(new n.Parser).uint32("crc32"),maxLength:4},f=(new n.Parser).itf8("size").buffer("ents",{length:"size",formatter:function(t){function e(e,r){for(var n=t.toString("utf8",e,r),i=[],o=0;o<n.length;o+=3)i.push(n.substr(o,3));return i}var r,n=[],i=0;for(r=0;r<t.length;r+=1)t[r]||(n.push(e(i,r)),i=r+1);return r>i&&n.push(e(i,r)),n}}),u=(new n.Parser).uint8(null,{formatter:function(t){return!!t}}),c=(new n.Parser).itf8("mapSize").itf8("mapCount").array("ents",{length:"mapCount",type:(new n.Parser).string("key",{length:2,stripNull:!1}).choice("value",{tag:"key",choices:{MI:u,UI:u,PI:u,RN:u,AP:u,RR:u,SM:(new n.Parser).array(null,{type:"uint8",length:5}),TD:(new n.Parser).nest(null,{type:f,formatter:function(t){return t.ents}})}})});function h(t){for(var e={},r=0;r<t.ents.length;r+=1){var n=t.ents[r],i=n.key,o=n.value;e[i]&&console.warn("duplicate key ".concat(i," in map")),e[i]=o}return e}var l={cramFileDefinition:o,cramBlockHeader:a,cramBlockCrc32:s},d={cramUnmappedSliceHeader:function(t){var e=0,r=(new n.Parser).itf8("numRecords");e+=5,t>=3?(r=r.ltf8("recordCounter"),e+=9):2===t&&(r=r.itf8("recordCounter"),e+=5),r=r.itf8("numBlocks").itf8("numContentIds").array("contentIds",{type:i,length:"numContentIds"}),e+=10,t>=2&&(r=r.array("md5",{type:"uint8",length:16}),e+=16);return{parser:r,maxLength:function(t){return e+5*t}}},cramMappedSliceHeader:function(t){var e=(new n.Parser).itf8("refSeqId").itf8("refSeqStart").itf8("refSeqSpan").itf8("numRecords"),r=20;t>=3?(e=e.ltf8("recordCounter"),r+=9):2===t&&(e=e.itf8("recordCounter"),r+=5),e=e.itf8("numBlocks").itf8("numContentIds").array("contentIds",{type:i,length:"numContentIds"}).itf8("refBaseBlockId"),r+=15,t>=2&&(e=e.array("md5",{type:"uint8",length:16}),r+=16);return{parser:e,maxLength:function(t){return r+5*t}}},cramEncoding:function(t){return{parser:(new n.Parser).namely("cramEncoding").itf8("codecId").itf8("parametersBytes").choice("parameters",{tag:"codecId",choices:{0:new n.Parser,1:(new n.Parser).itf8("blockContentId"),2:(new n.Parser).itf8("offset").itf8("M"),3:n.Parser.start().itf8("numCodes").array("symbols",{length:"numCodes",type:i}).itf8("numLengths").array("bitLengths",{length:"numLengths",type:i}),4:n.Parser.start().nest("lengthsEncoding",{type:"cramEncoding"}).nest("valuesEncoding",{type:"cramEncoding"}),5:(new n.Parser).uint8("stopByte")[t>1?"itf8":"int"]("blockContentId"),6:(new n.Parser).itf8("offset").itf8("length"),7:(new n.Parser).itf8("offset").itf8("K"),8:(new n.Parser).itf8("offset").itf8("log2m"),9:(new n.Parser).itf8("offset")}})}},cramDataSeriesEncodingMap:function(t){return(new n.Parser).itf8("mapSize").itf8("mapCount").array("ents",{length:"mapCount",type:(new n.Parser).string("key",{length:2,stripNull:!1}).nest("value",{type:this.cramEncoding(t).parser})})},cramTagEncodingMap:function(t){return(new n.Parser).itf8("mapSize").itf8("mapCount").array("ents",{length:"mapCount",type:(new n.Parser).itf8("key",{formatter:function(t){return String.fromCharCode(t>>16&255)+String.fromCharCode(t>>8&255)+String.fromCharCode(255&t)}}).nest("value",{type:this.cramEncoding(t).parser})})},cramCompressionHeader:function(t){var e=new n.Parser;return{parser:e=e.nest("preservation",{type:c,formatter:h}).nest("dataSeriesEncoding",{type:this.cramDataSeriesEncodingMap(t),formatter:h}).nest("tagEncoding",{type:this.cramTagEncodingMap(t),formatter:h})}},cramContainerHeader1:function(t){var e=(new n.Parser).int32("length").itf8("refSeqId").itf8("refSeqStart").itf8("alignmentSpan").itf8("numRecords"),r=24;return t>=3?(e=e.ltf8("recordCounter"),r+=9):2===t&&(e=e.itf8("recordCounter"),r+=5),t>1&&(e=e.ltf8("numBases"),r+=9),{parser:e=e.itf8("numBlocks").itf8("numLandmarks"),maxLength:r+=10}},cramContainerHeader2:function(t){var e=(new n.Parser).itf8("numLandmarks").array("landmarks",{type:(new n.Parser).itf8(),length:"numLandmarks"}),r=0;return t>=3&&(e=e.uint32("crc32"),r=4),{parser:e,maxLength:function(t){return 5+5*t+r}}}};e.getSectionParsers=function(t){var e=Object.assign({},l);return Object.keys(d).forEach((function(r){e[r]=d[r](t)})),e}},function(t,e,r){"use strict";function n(t){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}var i=r(1).Buffer,o=r(52),a=r(53).Context,s=r(23);"undefined"!=typeof window&&(window.Buffer=i),"undefined"!=typeof self&&(self.Buffer=i);var f={UInt8:1,UInt16LE:2,UInt16BE:2,UInt32LE:4,UInt32BE:4,Int8:1,Int16LE:2,Int16BE:2,Int32LE:4,Int32BE:4,FloatLE:4,FloatBE:4,DoubleLE:8,DoubleBE:8,UInt64:8,Int64:8},u={},c=[];!function(){var t;for(t=1;t<=32;t++)c.push(t)}();var h={};Object.keys(f).concat(Object.keys({String:null,Buffer:null,Array:null,Skip:null,Choice:null,Nest:null,Bit:null,Itf8:null,Ltf8:null})).forEach((function(t){h[t.toLowerCase()]=t}));var l=function(){this.varName="",this.type="",this.options={},this.next=null,this.head=null,this.compiled=null,this.endian="le",this.constructorFn=null,this.alias=null};l.start=function(){return new l},Object.keys(f).forEach((function(t){l.prototype[t.toLowerCase()]=function(e,r){return this.setNextParser(t.toLowerCase(),e,r)};var e=t.replace(/BE|LE/,"").toLowerCase();e in l.prototype||(l.prototype[e]=function(t,r){return this[e+this.endian](t,r)})})),c.forEach((function(t){l.prototype["bit".concat(t.toString())]=function(e,r){return r||(r={}),r.length=t,this.setNextParser("bit",e,r)}})),l.prototype.namely=function(t){return u[t]=this,this.alias=t,this},l.prototype.skip=function(t,e){if(e&&e.assert)throw new Error("assert option on skip is not allowed.");return this.setNextParser("skip","",{length:t})},l.prototype.string=function(t,e){if(!e.zeroTerminated&&!e.length&&!e.greedy)throw new Error("Neither length, zeroTerminated, nor greedy is defined for string.");if((e.zeroTerminated||e.length)&&e.greedy)throw new Error("greedy is mutually exclusive with length and zeroTerminated for string.");if(e.stripNull&&!e.length&&!e.greedy)throw new Error("Length or greedy must be defined if stripNull is defined.");return e.encoding=e.encoding||"utf8",this.setNextParser("string",t,e)},l.prototype.buffer=function(t,e){if(!e.length&&!e.readUntil)throw new Error("Length nor readUntil is defined in buffer parser");return this.setNextParser("buffer",t,e)},l.prototype.array=function(t,e){if(!e.readUntil&&!e.length&&!e.lengthInBytes)throw new Error("Length option of array is not defined.");if(!e.type)throw new Error("Type option of array is not defined.");if("string"==typeof e.type&&!u[e.type]&&Object.keys(f).indexOf(h[e.type])<0)throw new Error('Specified primitive type "'.concat(e.type,'" is not supported.'));return this.setNextParser("array",t,e)},l.prototype.choice=function(t,e){if(1===arguments.length&&"object"===n(t)&&(e=t,t=null),!e.tag)throw new Error("Tag option of array is not defined.");if(!e.choices)throw new Error("Choices option of array is not defined.");return Object.keys(e.choices).forEach((function(r){if(!e.choices[r])throw new Error("Choice Case ".concat(r," of ").concat(t," is not valid."));if("string"==typeof e.choices[r]&&!u[e.choices[r]]&&Object.keys(f).indexOf(h[e.choices[r]])<0)throw new Error('Specified primitive type "'.concat(e.choices[r],'" is not supported.'))}),this),this.setNextParser("choice",t,e)},l.prototype.nest=function(t,e){if(1===arguments.length&&"object"===n(t)&&(e=t,t=null),!e.type)throw new Error("Type option of nest is not defined.");if(!(e.type instanceof l||u[e.type]))throw new Error("Type option of nest must be a Parser object.");if(!(e.type instanceof l||t))throw new Error("options.type must be a object if variable name is omitted.");return this.setNextParser("nest",t,e)},l.prototype.endianess=function(t){switch(t.toLowerCase()){case"little":this.endian="le";break;case"big":this.endian="be";break;default:throw new Error("Invalid endianess: ".concat(t))}return this},l.prototype.create=function(t){if(!(t instanceof Function))throw new Error("Constructor must be a Function object.");return this.constructorFn=t,this},l.prototype.getCode=function(){var t=new a;return t.pushCode("if (!Buffer.isBuffer(buffer)) {"),t.generateError('"argument buffer is not a Buffer object"'),t.pushCode("}"),this.alias?this.addAliasedCode(t):this.addRawCode(t),this.alias?t.pushCode("return {0}(0)","___parser_"+this.alias):t.pushCode("return { offset: offset, result: vars };"),t.code},l.prototype.addRawCode=function(t){t.pushCode("var offset = 0;"),this.constructorFn?t.pushCode("var vars = new constructorFn();"):t.pushCode("var vars = {};"),this.generate(t),this.resolveReferences(t),t.pushCode("return { offset: offset, result: vars };")},l.prototype.addAliasedCode=function(t){return t.pushCode("function {0}(offset) {","___parser_"+this.alias),this.constructorFn?t.pushCode("var vars = new constructorFn();"):t.pushCode("var vars = {};"),this.generate(t),t.markResolved(this.alias),this.resolveReferences(t),t.pushCode("return { offset: offset, result: vars };"),t.pushCode("}"),t},l.prototype.resolveReferences=function(t){var e=t.getUnresolvedReferences();t.markRequested(e),e.forEach((function(e){u[e].addAliasedCode(t)}))},l.prototype.compile=function(){var t="(function(buffer, constructorFn, Long) { ".concat(this.getCode()," })");this.compiled=o.runInThisContext(t)},l.prototype.sizeOf=function(){var t=NaN;if(Object.keys(f).indexOf(this.type)>=0)t=f[this.type];else if("String"===this.type&&"number"==typeof this.options.length)t=this.options.length;else if("Buffer"===this.type&&"number"==typeof this.options.length)t=this.options.length;else if("Array"===this.type&&"number"==typeof this.options.length){var e=NaN;"string"==typeof this.options.type?e=f[h[this.options.type]]:this.options.type instanceof l&&(e=this.options.type.sizeOf()),t=this.options.length*e}else"Skip"===this.type?t=this.options.length:"Nest"===this.type?t=this.options.type.sizeOf():this.type||(t=0);return this.next&&(t+=this.next.sizeOf()),t},l.prototype.parse=function(t){return this.compiled||this.compile(),this.compiled(t,this.constructorFn,s)},l.prototype.setNextParser=function(t,e,r){var n=new l;return n.type=h[t],n.varName=e,n.options=r||n.options,n.endian=this.endian,this.head?this.head.next=n:this.next=n,this.head=n,this},l.prototype.generate=function(t){this.type&&(this["generate".concat(this.type)](t),this.generateAssert(t));var e=t.generateVariable(this.varName);return this.options.formatter&&this.generateFormatter(t,e,this.options.formatter),this.generateNext(t)},l.prototype.generateAssert=function(t){if(this.options.assert){var e=t.generateVariable(this.varName);switch(n(this.options.assert)){case"function":t.pushCode("if (!({0}).call(vars, {1})) {",this.options.assert,e);break;case"number":t.pushCode("if ({0} !== {1}) {",this.options.assert,e);break;case"string":t.pushCode('if ("{0}" !== {1}) {',this.options.assert,e);break;default:throw new Error("Assert option supports only strings, numbers and assert functions.")}t.generateError('"Assert error: {0} is " + {0}',e),t.pushCode("}")}},l.prototype.generateNext=function(t){return this.next&&(t=this.next.generate(t)),t},Object.keys(f).forEach((function(t){l.prototype["generate".concat(t)]=function(e){"UInt64"===t?e.pushCode("{0} = Long.fromBytes(buffer.slice(offset,offset+8), true, this.endian === 'le').toNumber();",e.generateVariable(this.varName),t):"Int64"===t?e.pushCode("{0} = Long.fromBytes(buffer.slice(offset,offset+8), false, this.endian === 'le').toNumber();",e.generateVariable(this.varName),t):e.pushCode("{0} = buffer.read{1}(offset);",e.generateVariable(this.varName),t),e.pushCode("offset += {0};",f[t])}})),l.prototype.generateBit=function(t){var e=JSON.parse(JSON.stringify(this));if(e.varName=t.generateVariable(e.varName),t.bitFields.push(e),!this.next||this.next&&["Bit","Nest"].indexOf(this.next.type)<0){var r=0;t.bitFields.forEach((function(t){r+=t.options.length}));var n=t.generateTmpVariable();if(r<=8)t.pushCode("var {0} = buffer.readUInt8(offset);",n),r=8;else if(r<=16)t.pushCode("var {0} = buffer.readUInt16BE(offset);",n),r=16;else if(r<=24){var i=t.generateTmpVariable(),o=t.generateTmpVariable();t.pushCode("var {0} = buffer.readUInt16BE(offset);",i),t.pushCode("var {0} = buffer.readUInt8(offset + 2);",o),t.pushCode("var {2} = ({0} << 8) | {1};",i,o,n),r=24}else{if(!(r<=32))throw new Error("Currently, bit field sequence longer than 4-bytes is not supported.");t.pushCode("var {0} = buffer.readUInt32BE(offset);",n),r=32}t.pushCode("offset += {0};",r/8);var a=0,s="be"===this.endian;t.bitFields.forEach((function(e){t.pushCode("{0} = {1} >> {2} & {3};",e.varName,n,s?r-a-e.options.length:a,(1<<e.options.length)-1),a+=e.options.length})),t.bitFields=[]}},l.prototype.generateSkip=function(t){var e=t.generateOption(this.options.length);t.pushCode("offset += {0};",e)},l.prototype.generateString=function(t){var e=t.generateVariable(this.varName),r=t.generateTmpVariable();this.options.length&&this.options.zeroTerminated?(t.pushCode("var {0} = offset;",r),t.pushCode("while(buffer.readUInt8(offset++) !== 0 && offset - {0} < {1});",r,this.options.length),t.pushCode("{0} = buffer.toString('{1}', {2}, offset - {2} < {3} ? offset - 1 : offset);",e,this.options.encoding,r,this.options.length)):this.options.length?(t.pushCode("{0} = buffer.toString('{1}', offset, offset + {2});",e,this.options.encoding,t.generateOption(this.options.length)),t.pushCode("offset += {0};",t.generateOption(this.options.length))):this.options.zeroTerminated?(t.pushCode("var {0} = offset;",r),t.pushCode("while(buffer.readUInt8(offset++) !== 0);"),t.pushCode("{0} = buffer.toString('{1}', {2}, offset - 1);",e,this.options.encoding,r)):this.options.greedy&&(t.pushCode("var {0} = offset;",r),t.pushCode("while(buffer.length > offset++);"),t.pushCode("{0} = buffer.toString('{1}', {2}, offset);",e,this.options.encoding,r)),this.options.stripNull&&t.pushCode("{0} = {0}.replace(/\\x00+$/g, '')",e)},l.prototype.generateBuffer=function(t){"eof"===this.options.readUntil?t.pushCode("{0} = buffer.slice(offset);",t.generateVariable(this.varName)):(t.pushCode("{0} = buffer.slice(offset, offset + {1});",t.generateVariable(this.varName),t.generateOption(this.options.length)),t.pushCode("offset += {0};",t.generateOption(this.options.length))),this.options.clone&&t.pushCode("{0} = Buffer.from({0});",t.generateVariable(this.varName))},l.prototype.generateArray=function(t){var e=t.generateOption(this.options.length),r=t.generateOption(this.options.lengthInBytes),n=this.options.type,i=t.generateTmpVariable(),o=t.generateVariable(this.varName),a=t.generateTmpVariable(),s=this.options.key,c="string"==typeof s;if(c?t.pushCode("{0} = {};",o):t.pushCode("{0} = [];",o),"function"==typeof this.options.readUntil?t.pushCode("do {"):"eof"===this.options.readUntil?t.pushCode("for (var {0} = 0; offset < buffer.length; {0}++) {",i):void 0!==r?t.pushCode("for (var {0} = offset; offset - {0} < {1}; ) {",i,r):t.pushCode("for (var {0} = 0; {0} < {1}; {0}++) {",i,e),"string"==typeof n)if(u[n]){var d=t.generateTmpVariable();t.pushCode("var {0} = {1}(offset);",d,"___parser_"+n),t.pushCode("var {0} = {1}.result; offset = {1}.offset;",a,d),n!==this.alias&&t.addReference(n)}else t.pushCode("var {0} = buffer.read{1}(offset);",a,h[n]),t.pushCode("offset += {0};",f[h[n]]);else n instanceof l&&(t.pushCode("var {0} = {};",a),t.pushScope(a),n.generate(t),t.popScope());c?t.pushCode("{0}[{2}.{1}] = {2};",o,s,a):t.pushCode("{0}.push({1});",o,a),t.pushCode("}"),"function"==typeof this.options.readUntil&&t.pushCode(" while (!({0}).call(this, {1}, buffer.slice(offset)));",this.options.readUntil,a)},l.prototype.generateChoiceCase=function(t,e,r){if("string"==typeof r)if(u[r]){var n=t.generateTmpVariable();t.pushCode("var {0} = {1}(offset);",n,"___parser_"+r),t.pushCode("{0} = {1}.result; offset = {1}.offset;",t.generateVariable(this.varName),n),r!==this.alias&&t.addReference(r)}else t.pushCode("{0} = buffer.read{1}(offset);",t.generateVariable(this.varName),h[r]),t.pushCode("offset += {0};",f[h[r]]);else r instanceof l&&(t.pushPath(e),r.generate(t),t.popPath(e))},l.prototype.generateChoice=function(t){var e=t.generateOption(this.options.tag);this.varName&&t.pushCode("{0} = {};",t.generateVariable(this.varName)),t.pushCode("switch({0}) {",e),Object.keys(this.options.choices).forEach((function(e){var r=this.options.choices[e];Number.isNaN(parseInt(e,10))?t.pushCode("case '{0}':",e):t.pushCode("case {0}:",e),this.generateChoiceCase(t,this.varName,r),t.pushCode("break;")}),this),t.pushCode("default:"),this.options.defaultChoice?this.generateChoiceCase(t,this.varName,this.options.defaultChoice):t.generateError('"Met undefined tag value " + {0} + " at choice"',e),t.pushCode("}")},l.prototype.generateNest=function(t){var e=t.generateVariable(this.varName);if(this.options.type instanceof l)this.varName&&t.pushCode("{0} = {};",e),t.pushPath(this.varName),this.options.type.generate(t),t.popPath(this.varName);else if(u[this.options.type]){var r=t.generateTmpVariable();t.pushCode("var {0} = {1}(offset);",r,"___parser_"+this.options.type),t.pushCode("{0} = {1}.result; offset = {1}.offset;",e,r),this.options.type!==this.alias&&t.addReference(this.options.type)}},l.prototype.generateFormatter=function(t,e,r){"function"==typeof r&&t.pushCode("{0} = ({1}).call(this, {0});",e,r)},l.prototype.isInteger=function(){return!!this.type.match(/U?Int[8|16|32][BE|LE]?|Bit\d+/)},l.prototype.itf8=function(t,e){return this.setNextParser("itf8",t,e)},l.prototype.itf8=function(t,e){return this.setNextParser("itf8",t,e)},l.prototype.generateItf8=function(t){var e=t.generateVariable(this.varName),r=t.generateTmpVariable();t.pushCode("\n var ".concat(r," = buffer[offset];\n if (").concat(r," < 0x80) {\n ").concat(e," = ").concat(r,";\n offset += 1;\n } else if (").concat(r," < 0xc0) {\n ").concat(e," = ((").concat(r,"<<8) | buffer[offset+1]) & 0x3fff;\n offset += 2;\n } else if (").concat(r," < 0xe0) {\n ").concat(e," = ((").concat(r,"<<16) | (buffer[offset+1]<< 8) | buffer[offset+2]) & 0x1fffff;\n offset += 3;\n } else if (").concat(r," < 0xf0) {\n ").concat(e," = ((").concat(r,"<<24) | (buffer[offset+1]<<16) | (buffer[offset+2]<<8) | buffer[offset+3]) & 0x0fffffff;\n offset += 4\n } else {\n ").concat(e," = ((").concat(r," & 0x0f)<<28) | (buffer[offset+1]<<20) | (buffer[offset+2]<<12) | (buffer[offset+3]<<4) | (buffer[offset+4] & 0x0f);\n // x=((0xff & 0x0f)<<28) | (0xff<<20) | (0xff<<12) | (0xff<<4) | (0x0f & 0x0f);\n // TODO *val_p = uv < 0x80000000UL ? uv : -((int32_t) (0xffffffffUL - uv)) - 1;\n offset += 5\n }\n "))},l.prototype.ltf8=function(t,e){return this.setNextParser("ltf8",t,e)},l.prototype.generateLtf8=function(t){var e=t.generateVariable(this.varName),r=t.generateTmpVariable();t.pushCode("\n var ".concat(r," = buffer[offset];\n if (").concat(r," < 0x80) {\n ").concat(e," = ").concat(r,";\n offset += 1;\n } else if (").concat(r," < 0xc0) {\n ").concat(e," = ((buffer[offset]<<8) | buffer[offset+1]) & 0x3fff;\n offset += 2;\n } else if (").concat(r," < 0xe0) {\n ").concat(e," = ((buffer[offset]<<16) | (buffer[offset+1]<<8) | buffer[offset+2]) & 0x1fffff;\n ").concat(e," = (((").concat(r," & 63) << 16) | buffer.readUInt16LE(offset + 1));\n offset += 3;\n } else if (").concat(r," < 0xf0) {\n ").concat(e," = ((buffer[offset]<<24) | (buffer[offset+1]<<16) | (buffer[offset+2]<<8) | buffer[offset+3]) & 0x0fffffff;\n offset += 4;\n } else if (").concat(r," < 0xf8) {\n ").concat(e," = (((buffer[offset] & 15) * Math.pow(2,32))) +\n (buffer[offset+1]<<24) | (buffer[offset+2]<<16 | buffer[offset+3]<<8 | buffer[offset+4])\n // TODO *val_p = uv < 0x80000000UL ? uv : -((int32_t) (0xffffffffUL - uv)) - 1;\n offset += 5;\n } else if (").concat(r," < 0xfc) {\n ").concat(e," = ((((buffer[offset] & 7) << 8) | buffer[offset+1] )) * Math.pow(2,32) +\n (buffer[offset+2]<<24) | (buffer[offset+3]<<16 | buffer[offset+4]<<8 | buffer[offset+5])\n offset += 6;\n } else if (").concat(r," < 0xfe) {\n ").concat(e," = ((((buffer[offset] & 3) << 16) | buffer[offset+1]<<8 | buffer[offset+2])) * Math.pow(2,32) +\n (buffer[offset+3]<<24) | (buffer[offset+4]<<16 | buffer[offset+5]<<8 | buffer[offset+6])\n offset += 7;\n } else if (").concat(r," < 0xff) {\n ").concat(e," = Long.fromBytesBE(buffer.slice(offset+1,offset+8));\n if (").concat(e,".greaterThan(Number.MAX_SAFE_INTEGER) || ").concat(e,".lessThan(Number.MIN_SAFE_INTEGER))\n throw new Error('integer overflow')\n ").concat(e," = ").concat(e,".toNumber()\n offset += 8;\n } else {\n ").concat(e," = Long.fromBytesBE(buffer.slice(offset+1,offset+9));\n if (").concat(e,".greaterThan(Number.MAX_SAFE_INTEGER) || ").concat(e,".lessThan(Number.MIN_SAFE_INTEGER))\n throw new Error('integer overflow')\n ").concat(e," = ").concat(e,".toNumber()\n offset += 9;\n }\n "))},e.Parser=l},function(t,e){t.exports.runInThisContext=function(t){return new Function("code","return eval(code);").call(globalThis,t)}},function(t,e,r){"use strict";function n(t){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}var i=function(){this.code="",this.scopes=[["vars"]],this.isAsync=!1,this.bitFields=[],this.tmpVariableCount=0,this.references={}};i.prototype.generateVariable=function(t){var e=[];for(Array.prototype.push.apply(e,this.scopes[this.scopes.length-1]);/^\$parent\./.test(t);)e.pop(),t=t.replace(/^\$parent\./,"");return t&&e.push(t),e.join(".")},i.prototype.generateOption=function(t){switch(n(t)){case"number":return t.toString();case"string":return this.generateVariable(t);case"function":return"(".concat(t,").call(").concat(this.generateVariable(),", vars)");default:return}},i.prototype.generateError=function(){var t=Array.prototype.slice.call(arguments),e=i.interpolate.apply(this,t);this.isAsync?this.pushCode("return process.nextTick(function() { callback(new Error(".concat(e,"), vars); });")):this.pushCode("throw new Error(".concat(e,");"))},i.prototype.generateTmpVariable=function(){return"$tmp".concat(this.tmpVariableCount++)},i.prototype.pushCode=function(){var t=Array.prototype.slice.call(arguments);this.code+="".concat(i.interpolate.apply(this,t),"\n")},i.prototype.pushPath=function(t){t&&this.scopes[this.scopes.length-1].push(t)},i.prototype.popPath=function(t){t&&this.scopes[this.scopes.length-1].pop()},i.prototype.pushScope=function(t){this.scopes.push([t])},i.prototype.popScope=function(){this.scopes.pop()},i.prototype.addReference=function(t){this.references[t]||(this.references[t]={resolved:!1,requested:!1})},i.prototype.markResolved=function(t){this.references[t].resolved=!0},i.prototype.markRequested=function(t){t.forEach(function(t){this.references[t].requested=!0}.bind(this))},i.prototype.getUnresolvedReferences=function(){var t=this.references;return Object.keys(this.references).filter((function(e){return!t[e].resolved&&!t[e].requested}))},i.interpolate=function(t){var e=/{\d+}/g,r=t.match(e),n=Array.prototype.slice.call(arguments,1);return r&&r.forEach((function(e){var r=parseInt(e.substr(1,e.length-2),10);t=t.replace(e,n[r].toString())})),t},e.Context=i},function(t,e,r){"use strict";(function(e){var n=r(55),i=r(24),o=r(25),a=r(57),s=r(59);t.exports={r4x8_uncompress:function(t,e){n.decode(t).copy(e,0,0)},r4x16_uncompress:function(t,e){i.decode(t).copy(e,0,0)},arith_uncompress:function(t,e){o.decode(t).copy(e,0,0)},fqzcomp_uncompress:function(t,e){var r=new Array;a.decode(t,r).copy(e,0,0)},tok3_uncompress:function(t,r){var n=s.decode(t,0,"\0");e.from(n,"binary").copy(r,0,0)}}}).call(this,r(1).Buffer)},function(t,e,r){(function(e){const n=r(4);function i(t){return 4095&t}function o(t,e){for(var r=0;e>=t[r+1];)r++;return r}function a(t){for(var e=new Array(4096),r=0,n=0;n<4096;n++){for(;n>=t[r+1];)r++;e[n]=r}return e}function s(t,e,r){return r*(t>>12)+(4095&t)-e}function f(t,e){for(;e<1<<23;)e=(e<<8)+t.ReadByte();return e}function u(t,e){e.WriteByteNeg(t>>24&255),e.WriteByteNeg(t>>16&255),e.WriteByteNeg(t>>8&255),e.WriteByteNeg(t>>0&255)}function c(t,e,r,n,i){return t=function(t,e,r,n){for(var i=(1<<23>>n<<8)*r;t>=i;)e.WriteByteNeg(255&t),t>>=8;return t}(t,e,n,i),t=(Math.floor(t/n)<<i)+t%n+r}function h(t,e,r){for(var n=0;n<256;n++)e[n]=0;var i=t.ReadByte(),o=i,a=0;do{var s=t.ReadITF8();e[i]=s,a>0?(a--,i++):(i=t.ReadByte())==o+1&&(a=t.ReadByte()),o=i}while(0!=i);r[0]=0;for(n=0;n<=255;n++)r[n+1]=r[n]+e[n]}function l(t){for(var e=0,r=0;r<256;r++)e+=t[r];var n=4096/e;do{var i=0,o=0,a=0;e=0;for(r=0;r<256;r++)0!=t[r]&&(i<t[r]&&(i=t[r],o=r),t[r]=Math.floor(t[r]*n),0==t[r]&&(t[r]=1),e+=t[r]);e<4096?t[o]+=4096-e:e-4096<t[o]/2&&t[o]>2?t[o]-=e-4096:4096!=e&&(n*=.99,a=1)}while(a)}function d(t,e){for(var r=0,n=0;n<256;n++)if(e[n]){if(r>0)r--;else if(t.WriteByte(n),n>0&&e[n-1]>0){for(r=n+1;r<256&&e[r];r++);r-=n+1,t.WriteByte(r)}t.WriteITF8(e[n])}t.WriteByte(0)}t.exports={decode:function(t){var r=new n(t),u=r.ReadByte(),c=(r.ReadUint32(),r.ReadUint32());return 0==u?function(t,r){var n=new Array(256),o=new Array(256);h(t,n,o);for(var u=a(o),c=new Array(4),l=0;l<4;l++)c[l]=t.ReadUint32();var d=new e.allocUnsafe(r);for(l=0;l<r;l++){var p=l%4,g=i(c[p]),y=u[g];d[l]=y,c[p]=s(c[p],o[y],n[y]),c[p]=f(t,c[p])}return d}(r,c):function(t,r){var n=new Array(256),u=new Array(256);!function(t,e,r){for(var n=0;n<256;n++){e[n]=new Array(256),r[n]=new Array(256);for(var i=0;i<256;i++)e[n][i]=0}var o=t.ReadByte(),a=o,s=0;do{h(t,e[o],r[o]),s>0?(s--,o++):(o=t.ReadByte())==a+1&&(s=t.ReadByte()),a=o}while(0!=o)}(t,n,u);for(var c=new Array(256),l=0;l<256;l++)c[l]=a(u[l]);for(var d=new Array(4),p=new Array(4),g=0;g<4;g++)d[g]=t.ReadUint32(),p[g]=0;var y=new e.allocUnsafe(r),v=Math.floor(r/4);for(l=0;l<v;l++)for(g=0;g<4;g++){var m=i(d[g]),b=c[p[g]][m];y[l+g*v]=b,d[g]=s(d[g],u[p[g]][b],n[p[g]][b]),d[g]=f(t,d[g]),p[g]=b}l*=4;for(;l<r;){m=i(d[3]),b=o(u[p[3]],m);y[l++]=b,d[3]=s(d[3],u[p[3]][b],n[p[3]][b]),d[3]=f(t,d[3]),p[3]=b}return y}(r,c)},encode:function(t,r){return 0==r?function(t){const r=t.length;var i=new n("",0,780);i.WriteByte(0),i.WriteUint32(0),i.WriteUint32(0);var o=new Array(256);(function(t,e){for(var r=0;r<256;r++)e[r]=0;for(r=0;r<t.length;r++)e[t[r]]++})(t,o),l(o),d(i,o);var a=new Array(256);a[0]=0;for(var s=1;s<256;s++)a[s]=a[s-1]+o[s-1];var f=new Array(4);for(s=0;s<4;s++)f[s]=1<<23;var h=Math.floor(1.05*r+100),p=new n("",h,h);for(s=r-1;s>=0;s--)f[s%4]=c(f[s%4],p,a[t[s]],o[t[s]],12);for(s=3;s>=0;s--)u(f[s],p);var g=i.pos;return i.buf.writeInt32LE(g-9+(p.length-p.pos),1),i.buf.writeInt32LE(r,5),e.concat([i.buf.slice(0,i.pos),p.buf.slice(p.pos,p.length)],i.pos+p.length-p.pos)}(t):function(t){const r=t.length;var i=new n("",0,198156);i.WriteByte(1),i.WriteUint32(0),i.WriteUint32(0);for(var o=new Array(256),a=new Array(256),s=new Array(256),f=0;f<256;f++)a[f]=new Array(256),s[f]=new Array(256);(function(t,e,r){for(var n=0;n<256;n++){r[n]=0;for(var i=0;i<256;i++)e[n][i]=0}var o=0;for(n=0;n<t.length;n++)r[t[n]]++,e[o][t[n]]++,o=t[n];e[0][t[1*(t.length>>2)]]++,e[0][t[2*(t.length>>2)]]++,e[0][t[3*(t.length>>2)]]++,r[0]+=3})(t,a,o),function(t,e){for(var r=0;r<256;r++)e[r]&&l(t[r])}(a,o),function(t,e,r){for(var n=0,i=0;i<256;i++)if(r[i]){if(n>0)n--;else if(t.WriteByte(i),i>0&&r[i-1]>0){for(n=i+1;n<256&&r[n];n++);n-=i+1,t.WriteByte(n)}d(t,e[i])}t.WriteByte(0)}(i,a,o);for(f=0;f<256;f++)if(o[f]){s[f][0]=0;for(var h=1;h<256;h++)s[f][h]=s[f][h-1]+a[f][h-1]}var p=new Array(4),g=new Array(4);for(h=0;h<4;h++)p[h]=1<<23,g[h]=0;var y=new n("",r,r),v=Math.floor(r/4),m=new Array(4),b=new Array(4);for(h=0;h<4;h++)m[h]=(h+1)*v-2,b[h]=t[m[h]+1];b[3]=t[r-1];for(f=r-2;f>4*v-2;f--)p[3]=c(p[3],y,s[t[f]][b[3]],a[t[f]][b[3]],12),b[3]=t[f];for(;m[0]>=0;)for(h=3;h>=0;h--){var _=t[m[h]];p[h]=c(p[h],y,s[_][b[h]],a[_][b[h]],12),b[h]=_,m[h]--}for(h=3;h>=0;h--)p[h]=c(p[h],y,s[0][b[h]],a[0][b[h]],12);for(f=3;f>=0;f--)u(p[f],y);var w=i.pos;return i.buf.writeInt32LE(w-9+(y.length-y.pos),1),i.buf.writeInt32LE(r,5),e.concat([i.buf.slice(0,i.pos),y.buf.slice(y.pos,y.length)],i.pos+y.length-y.pos)}(t)}}}).call(this,r(1).Buffer)},function(t,e){var r={array:function(t){var e=0,r=0,n=[0,1,3,7,15,31,63,127,255];return function(i){for(var o=0;i>0;){var a=8-e;i>=a?(o<<=a,o|=n[a]&t[r++],e=0,i-=a):(o<<=i,o|=(t[r]&n[i]<<8-i-e)>>8-i-e,e+=i,i=0)}return o}},simple:function(t){var e,n,i=r.header(t),o=[],a=0;do{-1!=(n=r.decompress(t,i))&&(o.push(n),a+=n.byteLength)}while(-1!=n);e=new Uint8Array(a),a=0;for(var s=0;s<o.length;++s)n=o[s],e.set(n,a),a+=n.byteLength;return e},header:function(t){if(4348520!=t(24))throw"No magic number found";var e=t(8)-48;if(e<1||e>9)throw"Not a BZIP archive";return e},decompress:function(t,e,r){for(var n="",i=0;i<6;i++)n+=t(8).toString(16);if("177245385090"==n)return-1;if("314159265359"!=n)throw"eek not valid bzip data";if(t(32),t(1))throw"unsupported obsolete version";var o=t(24);if(o>9e5)throw"Initial position larger than buffer size";var a=t(16),s=new Uint8Array(256),f=0;for(i=0;i<16;i++)if(a&1<<15-i){var u=t(16);for(p=0;p<16;p++)u&1<<15-p&&(s[f++]=16*i+p)}var c=t(3);if(c<2||c>6)throw"another error";var h=t(15);if(0==h)throw"meh";var l=[];for(i=0;i<c;i++)l[i]=i;var d=new Uint8Array(32768);for(i=0;i<h;i++){for(var p=0;t(1);p++)if(p>=c)throw"whoops another error";var g=l[p];l.splice(p,1),l.splice(0,0,g),d[i]=g}var y=f+2,v=[];for(p=0;p<c;p++){var m,b,_,w=new Uint8Array(258),A=new Uint8Array(21);a=t(5);for(i=0;i<y;i++){for(;;){if(a<1||a>20)throw"I gave up a while ago on writing error messages";if(!t(1))break;t(1)?a--:a++}w[i]=a}m=b=w[0];for(i=1;i<y;i++)w[i]>b?b=w[i]:w[i]<m&&(m=w[i]);(_=v[p]={}).permute=new Uint32Array(258),_.limit=new Uint32Array(21),_.base=new Uint32Array(21),_.minLen=m,_.maxLen=b;var S=_.base.subarray(1),E=_.limit.subarray(1),C=0;for(i=m;i<=b;i++)for(a=0;a<y;a++)w[a]==i&&(_.permute[C++]=a);for(i=m;i<=b;i++)A[i]=E[i]=0;for(i=0;i<y;i++)A[w[i]]++;for(C=a=0,i=m;i<b;i++)C+=A[i],E[i]=C-1,C<<=1,S[i+1]=C-(a+=A[i]);E[b]=C+A[b]-1,S[m]=0}var B,k,R,x=new Uint32Array(256);for(i=0;i<256;i++)l[i]=i;B=k=y=R=0;for(var M=new Uint32Array(9e5);;){if(!y--){if(y=49,R>=h)throw"meow i'm a kitty, that's an error";S=(_=v[d[R++]]).base.subarray(1),E=_.limit.subarray(1)}for(p=t(i=_.minLen);;){if(i>_.maxLen)throw"rawr i'm a dinosaur";if(p<=E[i])break;i++,p=p<<1|t(1)}if((p-=S[i])<0||p>=258)throw"moo i'm a cow";var T=_.permute[p];if(0!=T&&1!=T){if(B){if(B=0,k+a>=9e5)throw"Boom.";for(x[g=s[l[0]]]+=a;a--;)M[k++]=g}if(T>f)break;if(k>=9e5)throw"I can't think of anything. Error";g=l[i=T-1],l.splice(i,1),l.splice(0,0,g),x[g=s[g]]++,M[k++]=g}else B||(B=1,a=0),a+=0==T?B:2*B,B<<=1}if(o<0||o>=k)throw"I'm a monkey and I'm throwing something at someone, namely you";for(p=0,i=0;i<256;i++)u=p+x[i],x[i]=p,p=u;for(i=0;i<k;i++)M[x[g=255&M[i]]]|=i<<8,x[g]++;var P=0,I=0,O=0;k&&(I=255&(P=M[o]),P>>=8,O=-1),k=k;var F,U,L,N=new Uint8Array(9e5),z=0;for(r||(r=1/0);k;){for(k--,U=I,I=255&(P=M[P]),P>>=8,3==O++?(F=I,L=U,I=-1):(F=1,L=I);F--;)if(N[z++]=L,!--r)return N;I!=U&&(O=0)}return N.subarray(0,z)}};t.exports=r},function(t,e,r){(function(e,n){const i=r(4),o=r(27),a=r(26);function s(t,e,r){for(var n=0,i=0,o=-1,a=new Array(1024);i<r;){var s=t.ReadByte();if(a[n++]=s,i+=s,s==o){var f=t.ReadByte();for(i+=s*f;f--;)a[n++]=s}o=s}var u=0;for(n=0,i=0;i<r;){var c=0;do{var h=a[n++];c+=h}while(255==h);for(;c--;)e[i++]=u;u++}}function f(t,e,r){var n=t.context;return e.qctx=(e.qctx<<t.qshift)+t.qtab[r],n+=(e.qctx&(1<<t.qbits)-1)<<t.qloc,t.do_pos&&(n+=t.ptab[Math.min(e.p,1023)]<<t.ploc),t.do_delta&&(n+=t.dtab[Math.min(e.delta,255)]<<t.dloc,e.delta+=e.prevq!=r?1:0,e.prevq=r),t.do_sel&&(n+=e.s<<t.sloc),e.p--,65535&n}function u(t){var e={};e.context=t.ReadUint16(),e.pflags=t.ReadByte(),e.do_dedup=2&e.pflags,e.fixed_len=4&e.pflags,e.do_sel=8&e.pflags,e.do_qmap=16&e.pflags,e.do_pos=32&e.pflags,e.do_delta=64&e.pflags,e.do_qtab=128&e.pflags,e.max_sym=t.ReadByte();var r=t.ReadByte();if(e.qbits=r>>4,e.qshift=15&r,r=t.ReadByte(),e.qloc=r>>4,e.sloc=15&r,r=t.ReadByte(),e.ploc=r>>4,e.dloc=15&r,e.qmap=new Array(256),16&e.pflags)for(var n=0;n<e.max_sym;n++)e.qmap[n]=t.ReadByte();else for(n=0;n<256;n++)e.qmap[n]=n;if(e.qtab=new Array(1024),e.qbits>0&&128&e.pflags)s(t,e.qtab,256);else for(n=0;n<256;n++)e.qtab[n]=n;return e.ptab=new Array(1024),32&e.pflags&&s(t,e.ptab,1024),e.dtab=new Array(256),64&e.pflags&&s(t,e.dtab,256),e}function c(t,e,r,n,i,o){r.max_sel>0?i.s=n.sel.ModelDecode(t,e):i.s=0,i.x=r.stab[i.s];var a=r.params[i.x];if(a.fixed_len>=0){var s=n.len[0].ModelDecode(t,e);s|=n.len[1].ModelDecode(t,e)<<8,s|=n.len[2].ModelDecode(t,e)<<16,s|=n.len[3].ModelDecode(t,e)<<24,a.fixed_len>0&&(a.fixed_len=-s)}else s=-a.fixed_len;i.len=s,r.do_rev&&(o[i.rec]=n.rev.ModelDecode(t,e)),i.is_dup=0,2&a.pflags&&n.dup.ModelDecode(t,e)&&(i.is_dup=1),i.p=s,i.delta=0,i.qctx=0,i.prevq=0,i.rec++}function h(t,r){var n=t.ReadUint7(),i=function(t){var e={max_sym:0};if(5==t.ReadByte()){var r=t.ReadByte(),n=1&r?t.ReadByte():1,i=r.nparam>1?r.nparam-1:0,o=new Array(256);if(2&r)i=t.ReadByte(),s(t,o,256);else{for(var a=0;a<n;a++)o[a]=a;for(;a<256;a++)o[a]=n-1}e.do_rev=4&r,e.stab=o,e.max_sel=i,e.params=new Array(e.nparam);for(var f=0;f<n;f++)e.params[f]=u(t),e.max_sym<e.params[f].max_sym&&(e.max_sym=e.params[f].max_sym);return e}console.error("Invalid FQZComp version number")}(t);if(i){var h=i.params,l=new Array(r.length),d=function(t){var e={};e.qual=new Array(65536);for(var r=0;r<65536;r++)e.qual[r]=new o(t.max_sym+1);for(e.len=new Array(4),r=0;r<4;r++)e.len[r]=new o(256);return e.rev=new o(2),e.dup=new o(2),t.max_sel>0&&(e.sel=new o(t.max_sel+1)),e}(i),p=new a(t);p.RangeStartDecode(t);for(var g=new e.allocUnsafe(n),y={qctx:0,prevq:0,delta:0,p:0,s:0,x:0,len:0,is_dup:0,rec:0},v=0;v<n;){if(0==y.p){if(c(t,p,i,d,y,l),y.is_dup>0&&d.dup.ModelDecode(t,p)){for(var m=0;m<len;m++)g[v+m]=g[v+m-y.len];v+=y.len,y.p=0;continue}r.push(y.len);var b=(h=i.params[y.x]).context}var _=d.qual[b].ModelDecode(t,p);g[v++]=h.qmap[_],b=f(h,y,_)}return i.do_rev&&function(t,e,r,n){var i=0,o=0;for(;o<e;){if(r[i])for(var a=0,s=n[i]-1;a<s;){var f=t[o+a];t[o+a]=t[o+s],t[o+s]=f,a++,s--}o+=n[i++]}}(g,n,l,r),g}}function l(t,e,r){for(var n=0,i=0,o=new Array(2*r),a=0;n<r;){for(var s=n;n<r&&e[n]==i;)n++;var f=n-s;do{var u=Math.min(255,f);o[a++]=u,f-=u}while(255==u);i++}var c=-1,h=new Array(2*r),l=0;for(n=0;n<a;){var d=o[n++];if(h[l++]=d,d==c){for(s=n;n<a&&o[n]==c&&n-s<255;)n++;h[l++]=n-s}else c=d}t.WriteData(h,l)}t.exports={decode:function(t,e){return h(new i(t),e)},encode:function(t,e,r){for(var s=new Array(2),f=new Array(2),u=new Array(2),c=new Array(2),h=new Array(256),d=0;d<2;d++)s[d]=new Array(256),f[d]=new Array(256),u[d]=new Array(1024),c[d]=new Array(256);(p=new i("",0,1.1*t.length+100)).WriteUint7(t.length);var p,g=function(t,e,r,n){for(var i=r[0],o=0;o<r.length&&r[o]==i;o++);var a=o==r.length?1:0,s=0,f=0;for(o=0;o<256;o++)n[0][o]=0;var u=0,c=0;for(o=0;o<t.length;o++)0==c&&(c=e[u<e.length-1?u++:u]),n[0][t[o]]++,c--;for(o=0;o<256;o++)n[0][o]&&(f<o&&(f=o),s++);var h=5,l=0;return s<=16&&(l=1,h=s<=2?1:s<=4?2:s<=8?3:4),[{qbits:8+(h>4),qshift:h,qloc:7,pbits:7,pshift:e[0]>128?1:0,ploc:0,dbits:h>4?0:1,dshift:3,dloc:15,sbits:0,sloc:15,do_stab:0,context:0,max_sym:f,nsym:s,do_qmap:l,do_dedup:0,fixed_len:1==e.length?1:0,do_sel:0,do_rev:0,do_pos:1,do_delta:h<=4?1:0,do_qtab:0,qbits:8+(h>4)-(0==a),sbits:1,sloc:15-(h<=4),do_stab:1,do_sel:1}]}(t,e,r,s);return function(t,e,r,i,s,f,u,c,h,l){var d=1<<s[0].sbits;d>0&&d--;for(var p=e.length,g=0,y=0;y<s.length;y++)g<s[y].max_sym&&(g=s[y].max_sym);for(var v=new Array(65536),m=0;m<65536;m++)v[m]=new o(g+1);var b=new Array(4);for(m=0;m<4;m++)b[m]=new o(256);new o(2),new o(2);for(var _=new o(d+1),w=new a(e),A=(y=0,m=0,0);m<p;){if(0==y){var S=i[A];s[0].sbits>0&&_.ModelEncode(t,w,S);var E=l[S],C=r[Math.min(r.length-1,A++)];s[E].fixed_len?s[E].fixed_len>0&&(b[0].ModelEncode(t,w,255&C),b[1].ModelEncode(t,w,C>>8&255),b[2].ModelEncode(t,w,C>>16&255),b[3].ModelEncode(t,w,C>>24&255),s[E].fixed_len=-1):(b[0].ModelEncode(t,w,255&C),b[1].ModelEncode(t,w,C>>8&255),b[2].ModelEncode(t,w,C>>16&255),b[3].ModelEncode(t,w,C>>24&255)),s[E].do_dedup&&n.exit(1),y=C;var B=0,k=s[E].context,R=0,x=0}var M=e[m++],T=f[E][M];v[k].ModelEncode(t,w,T),R=(R<<s[E].qshift)+u[E][T],k=s[E].context,k+=(R&(1<<s[E].qbits)-1)<<s[E].qloc,s[E].pbits>0&&(k+=c[E][Math.min(y,1023)]<<s[E].ploc),s[E].dbits>0&&(k+=h[E][Math.min(B,255)]<<s[E].dloc,B+=x!=T?1:0,x=T),s[E].do_sel&&(k+=S<<s[E].sloc),k&=65535,y--}return w.RangeFinishEncode(t),t.buf.slice(0,t.pos)}(p=function(t,e,r,n,i,o,a){for(var s=[0,1,1,1,2,2,2,2,2,3,3,3,3,3,3,3,4,4,4,4,4,4,4,4,4,5,5,5,5,5,5,5,5,5,5,5,6,6,6,6,6,6,6,6,6,6,6,6,6,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7],f=0;f<e.length;f++)a[f]=f;for(;f<256;f++)a[f]=e.length-1;t.WriteByte(5);var u=(e.length>1?1:0)|(e[0].do_stab?2:0);if(t.WriteByte(u),1&u&&t.WriteByte(e.length),2&u){var c=1<<e[0].sbits;c>0&&c--,t.WriteByte(c),l(t,a,256)}for(var h=0;h<e.length;h++){if(t.WriteUint16(e[h].context),t.WriteByte((e[h].do_qtab?128:0)|(e[h].do_delta?64:0)|(e[h].do_pos?32:0)|(e[h].do_qmap?16:0)|(e[h].do_sel?8:0)|(e[h].fixed_len?4:0)|(e[h].do_dedup?2:0)),e[h].do_qmap?t.WriteByte(e[h].nsym):t.WriteByte(e[h].max_sym),t.WriteByte(e[h].qbits<<4|e[h].qshift),t.WriteByte(e[h].qloc<<4|e[h].sloc),t.WriteByte(e[h].ploc<<4|e[h].dloc),e[h].do_qmap){e[h].max_sym=e[h].nsym;var d=0;for(f=0;f<256;f++)r[h][f]&&(t.WriteByte(f),r[h][f]=d++);for(;d<e[h].nsym;d++)t.WriteByte(0)}else for(f=0;f<256;f++)r[h][f]=f;if(e[h].qbits>0){for(f=0;f<256;f++)n[h][f]=f;e[h].do_qtab&&l(t,n[h],256)}if(e[h].pbits>0){for(f=0;f<1024;f++)i[h][f]=Math.min((1<<e[h].pbits)-1,f>>e[h].pshift);l(t,i[h],1024)}if(e[h].dbits>0){for(f=0;f<256;f++)s[f]>(1<<e[h].dbits)-1&&(s[f]=(1<<e[h].dbits)-1);for(f=0;f<256;f++)o[h][f]=s[Math.min(s.length-1,f>>e[h].dshift)];l(t,o[h],256)}}return t}(p,g,s,f,u,c,h),t,e,r,g,s,f,u,c,h)}}}).call(this,r(1).Buffer,r(58))},function(t,e){var r,n,i=t.exports={};function o(){throw new Error("setTimeout has not been defined")}function a(){throw new Error("clearTimeout has not been defined")}function s(t){if(r===setTimeout)return setTimeout(t,0);if((r===o||!r)&&setTimeout)return r=setTimeout,setTimeout(t,0);try{return r(t,0)}catch(e){try{return r.call(null,t,0)}catch(e){return r.call(this,t,0)}}}!function(){try{r="function"==typeof setTimeout?setTimeout:o}catch(t){r=o}try{n="function"==typeof clearTimeout?clearTimeout:a}catch(t){n=a}}();var f,u=[],c=!1,h=-1;function l(){c&&f&&(c=!1,f.length?u=f.concat(u):h=-1,u.length&&d())}function d(){if(!c){var t=s(l);c=!0;for(var e=u.length;e;){for(f=u,u=[];++h<e;)f&&f[h].run();h=-1,e=u.length}f=null,c=!1,function(t){if(n===clearTimeout)return clearTimeout(t);if((n===a||!n)&&clearTimeout)return n=clearTimeout,clearTimeout(t);try{n(t)}catch(e){try{return n.call(null,t)}catch(e){return n.call(this,t)}}}(t)}}function p(t,e){this.fun=t,this.array=e}function g(){}i.nextTick=function(t){var e=new Array(arguments.length-1);if(arguments.length>1)for(var r=1;r<arguments.length;r++)e[r-1]=arguments[r];u.push(new p(t,e)),1!==u.length||c||s(d)},p.prototype.run=function(){this.fun.apply(null,this.array)},i.title="browser",i.browser=!0,i.env={},i.argv=[],i.version="",i.versions={},i.on=g,i.addListener=g,i.once=g,i.off=g,i.removeListener=g,i.removeAllListeners=g,i.emit=g,i.prependListener=g,i.prependOnceListener=g,i.listeners=function(t){return[]},i.binding=function(t){throw new Error("process.binding is not supported")},i.cwd=function(){return"/"},i.chdir=function(t){throw new Error("process.chdir is not supported")},i.umask=function(){return 0}},function(t,e,r){(function(e){const n=r(4),i=r(24);var o=new(r(25));function a(t,e){for(var r=t+"";r.length<e;)r="0"+r;return r}function s(t,e,r,n){var i=t[0][0].ReadByte(),o=n-t[0][i].ReadUint32();if(5==i)return e[n]=e[o],r[n]=r[o],e[n];var s=1;e[n]="",r[n]=new Array(256);do{switch(i=t[s][0].ReadByte()){case 2:r[n][s]=t[s][2].ReadChar();break;case 1:r[n][s]=t[s][1].ReadString();break;case 7:r[n][s]=t[s][7].ReadUint32();break;case 3:var f=t[s][3].ReadUint32(),u=t[s][4].ReadByte();r[n][s]=a(f,u);break;case 8:r[n][s]=(r[o][s]>>0)+t[s][8].ReadByte();break;case 9:f=(r[o][s]>>0)+t[s][9].ReadByte(),u=r[o][s].length;r[n][s]=a(f,u);break;case 10:r[n][s]=r[o][s];break;default:r[n][s]=""}e[n]+=r[n][s++]}while(12!=i);return e[n]}function f(t,e,r,n,i,o){for(var a=0;a<n.length;a++)if(!(r>0&&5==e[a][0].type)&&e[a][r])switch(t[0].WriteByte(e[a][r].type),e[a][r].type){case 6:t[6].WriteUint32(e[a][r].val);break;case 5:t[5].WriteUint32(e[a][r].val);break;case 1:t[1].WriteString(e[a][r].val);break;case 2:t[2].WriteChar(e[a][r].val);break;case 7:t[7].WriteUint32(e[a][r].val);break;case 3:t[3].WriteUint32(e[a][r].val),t[4].WriteByte(e[a][r].val.length);break;case 8:case 9:t[e[a][r].type].WriteByte(e[a][r].val)}}function u(t,e,r,n){for(var i=0;i<=12;i++)if(!(t[i].pos<=0)){n.WriteByte(i+(0==i?128:0)),t[i]=t[i].buf.slice(0,t[i].pos);var o=c(t[i],r);n.WriteUint7(o.length),n.WriteData(o,o.length)}}function c(t,e){var r,n=1<<30,a=[0,1,64,65,128,129,201];for(var s in a){var f=a[s];if(!(1&f&&t.length<100)&&!(8&f&&t.length%4!=0)){try{var u=e?o.encode(t,f):i.encode(t,f)}catch(t){u=0}u&&n>u.length&&(n=u.length,r=u)}}return r}function h(t,e,r,n,i){var o=0,a=i-1;t[i]=new Array(256),e[n]?t[i][0]={type:5,val:i-e[n]}:t[i][0]={type:6,val:0==i?0:1},e[n]=i;for(var s=n.match(/([a-zA-Z0-9]{1,9})|([^a-zA-Z0-9]+)/g),f=0;f<s.length;f++){var u=f+1,c=1,h=s[f];if(s[f].match(/^0+[0-9]*$/g)?c=3:s[f].match(/^[0-9]+$/g)?c=7:1==s[f].length&&(c=2),a>=0&&t[a][u])if(t[a][u].str==s[f])c=10,h="";else if(7==t[a][u].type||8==t[a][u].type){var l=h-t[a][u].str;r[u]++,l>=0&&l<256&&r[u]>i/2&&(c=8,h=l)}else if((3==t[a][u].type||9==t[a][u].type)&&t[a][u].str.length==h.length){l=h-t[a][u].str;r[u]++,l>=0&&l<256&&r[u]>i/2&&(c=9,h=l)}t[i][u]={str:s[f],val:h,type:c},o<t[i][u].val.length+3&&(o=t[i][u].val.length+3)}return t[i][++u]={type:12},[u+1,o]}t.exports={encode:function(t,e){var r=t.toString();"\n"==r[r.length-1]&&(r=r.substring(0,r.length-1));var i=r.split("\n"),o=new n("",0,2*r.length+1e4);o.WriteUint32(r.length),o.WriteUint32(i.length),o.WriteByte(e);for(var a=new Array(i.length),s={},c=new Array(256).fill(0),l=0,d=0,p=0;p<i.length;p++){var[g,y]=h(a,s,c,i[p],p);l<g&&(l=g),d<y&&(d=y)}for(var v=0;v<l;v++){for(var m=new Array(13),b=0;b<=12;b++)m[b]=new n("",0,i.length*d);f(m,a,v,i,l,d),u(m,v,e,o)}return o.buf.slice(0,o.pos)},decode:function(t,r,a){(t=new n(t)).ReadUint32();var f=t.ReadUint32(),u=t.ReadByte(),c=function(t,r,a,s){for(var f=-1,u=new Array(256);!t.EOF();){var c=t.ReadByte(),h=128&c,l=64&c,d=63&c;if(h&&(u[++f]=new Array(13)),0!=d&&h){var p=new Array(s-1).fill(10);u[f][0]=new n(e.from([d].concat(p)))}if(l){var g=t.ReadByte(),y=t.ReadByte();u[f][d]=new n(u[g][y].buf)}else{var v=t.ReadUint7(),m=t.ReadData(v);u[f][d]=a?o.decode(m):i.decode(m),u[f][d]=new n(u[f][d])}}return u}(t,0,u,f),h=new Array(f),l=new Array(f),d="";void 0===a&&(a="\n");for(var p=0;p<f;p++)d+=s(c,h,l,p)+a;return d}}}).call(this,r(1).Buffer)},function(t,e,r){"use strict";(function(t){var n=this&&this.__awaiter||function(t,e,r,n){return new(r||(r=Promise))((function(i,o){function a(t){try{f(n.next(t))}catch(t){o(t)}}function s(t){try{f(n.throw(t))}catch(t){o(t)}}function f(t){var e;t.done?i(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(a,s)}f((n=n.apply(t,e||[])).next())}))},i=this&&this.__generator||function(t,e){var r,n,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(r)throw new TypeError("Generator is already executing.");for(;a;)try{if(r=1,n&&(i=2&o[0]?n.return:o[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,o[1])).done)return i;switch(n=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,n=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!(i=a.trys,(i=i.length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){a.label=o[1];break}if(6===o[0]&&a.label<i[1]){a.label=i[1],i=o;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(o);break}i[2]&&a.ops.pop(),a.trys.pop();continue}o=e.call(t,a)}catch(t){o=[6,t],n=0}finally{r=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,s])}}},o=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var a=r(0),s=r(5),f=o(r(64)),u=o(r(67)),c=function(){function e(t,e){this.file=t,this.filePosition=e}return e.prototype.getHeader=function(){return this._readContainerHeader(this.filePosition)},e.prototype.getCompressionHeaderBlock=function(){return n(this,void 0,void 0,(function(){var t,e,r;return i(this,(function(n){switch(n.label){case 0:return[4,this.getHeader()];case 1:return n.sent().numRecords?[4,this.file.getSectionParsers()]:[2,null];case 2:return t=n.sent(),[4,this.getFirstBlock()];case 3:if("COMPRESSION_HEADER"!==(e=n.sent()).contentType)throw new a.CramMalformedError("invalid content type ".concat(e.contentType," in what is supposed to be the compression header block"));return r=(0,s.parseItem)(e.content,t.cramCompressionHeader.parser,0,e.contentPosition),e.content=r,[2,e]}}))}))},e.prototype.getFirstBlock=function(){return n(this,void 0,void 0,(function(){var t;return i(this,(function(e){switch(e.label){case 0:return[4,this.getHeader()];case 1:return t=e.sent(),[2,this.file.readBlock(t._endPosition)]}}))}))},e.prototype.getCompressionScheme=function(){return n(this,void 0,void 0,(function(){var t;return i(this,(function(e){switch(e.label){case 0:return[4,this.getCompressionHeaderBlock()];case 1:return(t=e.sent())?[2,new u.default(t.content)]:[2,void 0]}}))}))},e.prototype.getSlice=function(t,e){return new f.default(this,t,e)},e.prototype._readContainerHeader=function(e){return n(this,void 0,void 0,(function(){var r,n,o,a,f,u,c,h,l;return i(this,(function(i){switch(i.label){case 0:return[4,this.file.getSectionParsers()];case 1:return r=i.sent(),n=r.cramContainerHeader1,o=r.cramContainerHeader2,[4,this.file.stat()];case 2:return a=i.sent().size,e>=a?[2,void 0]:(f=t.allocUnsafe(n.maxLength),[4,this.file.read(f,0,n.maxLength,e)]);case 3:return i.sent(),u=(0,s.parseItem)(f,n.parser),c=(0,s.itf8Size)(u.numLandmarks),e+u.length>=a?(console.warn("".concat(this.file,": container header at ").concat(e," indicates that the container has length ").concat(u.length,", which extends beyond the length of the file. Skipping this container.")),[2,void 0]):(h=t.allocUnsafe(o.maxLength(u.numLandmarks)),[4,this.file.read(h,0,o.maxLength(u.numLandmarks),e+u._size-c)]);case 4:return i.sent(),l=(0,s.parseItem)(h,o.parser),this.file.validateChecksums&&void 0!==l.crc32?[4,this.file.checkCrc32(e,u._size+l._size-c-4,l.crc32,"container header beginning at position ".concat(e))]:[3,6];case 5:i.sent(),i.label=6;case 6:return[2,Object.assign(u,l,{_size:u._size+l._size-c,_endPosition:u._size+l._size-c+e})]}}))}))},e}();e.default=c,"getHeader getCompressionHeaderBlock getCompressionScheme".split(" ").forEach((function(t){return(0,s.tinyMemoize)(c,t)}))}).call(this,r(1).Buffer)},function(t,e,r){var n,i,o,a,s;n=r(62),i=r(28).utf8,o=r(63),a=r(28).bin,(s=function(t,e){t.constructor==String?t=e&&"binary"===e.encoding?a.stringToBytes(t):i.stringToBytes(t):o(t)?t=Array.prototype.slice.call(t,0):Array.isArray(t)||t.constructor===Uint8Array||(t=t.toString());for(var r=n.bytesToWords(t),f=8*t.length,u=1732584193,c=-271733879,h=-1732584194,l=271733878,d=0;d<r.length;d++)r[d]=16711935&(r[d]<<8|r[d]>>>24)|4278255360&(r[d]<<24|r[d]>>>8);r[f>>>5]|=128<<f%32,r[14+(f+64>>>9<<4)]=f;var p=s._ff,g=s._gg,y=s._hh,v=s._ii;for(d=0;d<r.length;d+=16){var m=u,b=c,_=h,w=l;u=p(u,c,h,l,r[d+0],7,-680876936),l=p(l,u,c,h,r[d+1],12,-389564586),h=p(h,l,u,c,r[d+2],17,606105819),c=p(c,h,l,u,r[d+3],22,-1044525330),u=p(u,c,h,l,r[d+4],7,-176418897),l=p(l,u,c,h,r[d+5],12,1200080426),h=p(h,l,u,c,r[d+6],17,-1473231341),c=p(c,h,l,u,r[d+7],22,-45705983),u=p(u,c,h,l,r[d+8],7,1770035416),l=p(l,u,c,h,r[d+9],12,-1958414417),h=p(h,l,u,c,r[d+10],17,-42063),c=p(c,h,l,u,r[d+11],22,-1990404162),u=p(u,c,h,l,r[d+12],7,1804603682),l=p(l,u,c,h,r[d+13],12,-40341101),h=p(h,l,u,c,r[d+14],17,-1502002290),u=g(u,c=p(c,h,l,u,r[d+15],22,1236535329),h,l,r[d+1],5,-165796510),l=g(l,u,c,h,r[d+6],9,-1069501632),h=g(h,l,u,c,r[d+11],14,643717713),c=g(c,h,l,u,r[d+0],20,-373897302),u=g(u,c,h,l,r[d+5],5,-701558691),l=g(l,u,c,h,r[d+10],9,38016083),h=g(h,l,u,c,r[d+15],14,-660478335),c=g(c,h,l,u,r[d+4],20,-405537848),u=g(u,c,h,l,r[d+9],5,568446438),l=g(l,u,c,h,r[d+14],9,-1019803690),h=g(h,l,u,c,r[d+3],14,-187363961),c=g(c,h,l,u,r[d+8],20,1163531501),u=g(u,c,h,l,r[d+13],5,-1444681467),l=g(l,u,c,h,r[d+2],9,-51403784),h=g(h,l,u,c,r[d+7],14,1735328473),u=y(u,c=g(c,h,l,u,r[d+12],20,-1926607734),h,l,r[d+5],4,-378558),l=y(l,u,c,h,r[d+8],11,-2022574463),h=y(h,l,u,c,r[d+11],16,1839030562),c=y(c,h,l,u,r[d+14],23,-35309556),u=y(u,c,h,l,r[d+1],4,-1530992060),l=y(l,u,c,h,r[d+4],11,1272893353),h=y(h,l,u,c,r[d+7],16,-155497632),c=y(c,h,l,u,r[d+10],23,-1094730640),u=y(u,c,h,l,r[d+13],4,681279174),l=y(l,u,c,h,r[d+0],11,-358537222),h=y(h,l,u,c,r[d+3],16,-722521979),c=y(c,h,l,u,r[d+6],23,76029189),u=y(u,c,h,l,r[d+9],4,-640364487),l=y(l,u,c,h,r[d+12],11,-421815835),h=y(h,l,u,c,r[d+15],16,530742520),u=v(u,c=y(c,h,l,u,r[d+2],23,-995338651),h,l,r[d+0],6,-198630844),l=v(l,u,c,h,r[d+7],10,1126891415),h=v(h,l,u,c,r[d+14],15,-1416354905),c=v(c,h,l,u,r[d+5],21,-57434055),u=v(u,c,h,l,r[d+12],6,1700485571),l=v(l,u,c,h,r[d+3],10,-1894986606),h=v(h,l,u,c,r[d+10],15,-1051523),c=v(c,h,l,u,r[d+1],21,-2054922799),u=v(u,c,h,l,r[d+8],6,1873313359),l=v(l,u,c,h,r[d+15],10,-30611744),h=v(h,l,u,c,r[d+6],15,-1560198380),c=v(c,h,l,u,r[d+13],21,1309151649),u=v(u,c,h,l,r[d+4],6,-145523070),l=v(l,u,c,h,r[d+11],10,-1120210379),h=v(h,l,u,c,r[d+2],15,718787259),c=v(c,h,l,u,r[d+9],21,-343485551),u=u+m>>>0,c=c+b>>>0,h=h+_>>>0,l=l+w>>>0}return n.endian([u,c,h,l])})._ff=function(t,e,r,n,i,o,a){var s=t+(e&r|~e&n)+(i>>>0)+a;return(s<<o|s>>>32-o)+e},s._gg=function(t,e,r,n,i,o,a){var s=t+(e&n|r&~n)+(i>>>0)+a;return(s<<o|s>>>32-o)+e},s._hh=function(t,e,r,n,i,o,a){var s=t+(e^r^n)+(i>>>0)+a;return(s<<o|s>>>32-o)+e},s._ii=function(t,e,r,n,i,o,a){var s=t+(r^(e|~n))+(i>>>0)+a;return(s<<o|s>>>32-o)+e},s._blocksize=16,s._digestsize=16,t.exports=function(t,e){if(null==t)throw new Error("Illegal argument "+t);var r=n.wordsToBytes(s(t,e));return e&&e.asBytes?r:e&&e.asString?a.bytesToString(r):n.bytesToHex(r)}},function(t,e){var r,n;r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",n={rotl:function(t,e){return t<<e|t>>>32-e},rotr:function(t,e){return t<<32-e|t>>>e},endian:function(t){if(t.constructor==Number)return 16711935&n.rotl(t,8)|4278255360&n.rotl(t,24);for(var e=0;e<t.length;e++)t[e]=n.endian(t[e]);return t},randomBytes:function(t){for(var e=[];t>0;t--)e.push(Math.floor(256*Math.random()));return e},bytesToWords:function(t){for(var e=[],r=0,n=0;r<t.length;r++,n+=8)e[n>>>5]|=t[r]<<24-n%32;return e},wordsToBytes:function(t){for(var e=[],r=0;r<32*t.length;r+=8)e.push(t[r>>>5]>>>24-r%32&255);return e},bytesToHex:function(t){for(var e=[],r=0;r<t.length;r++)e.push((t[r]>>>4).toString(16)),e.push((15&t[r]).toString(16));return e.join("")},hexToBytes:function(t){for(var e=[],r=0;r<t.length;r+=2)e.push(parseInt(t.substr(r,2),16));return e},bytesToBase64:function(t){for(var e=[],n=0;n<t.length;n+=3)for(var i=t[n]<<16|t[n+1]<<8|t[n+2],o=0;o<4;o++)8*n+6*o<=8*t.length?e.push(r.charAt(i>>>6*(3-o)&63)):e.push("=");return e.join("")},base64ToBytes:function(t){t=t.replace(/[^A-Z0-9+\/]/gi,"");for(var e=[],n=0,i=0;n<t.length;i=++n%4)0!=i&&e.push((r.indexOf(t.charAt(n-1))&Math.pow(2,-2*i+8)-1)<<2*i|r.indexOf(t.charAt(n))>>>6-2*i);return e}},t.exports=n},function(t,e){function r(t){return!!t.constructor&&"function"==typeof t.constructor.isBuffer&&t.constructor.isBuffer(t)}
|
|
22
11
|
/*!
|
|
23
12
|
* Determine if an object is a Buffer
|
|
24
13
|
*
|
|
25
14
|
* @author Feross Aboukhadijeh <https://feross.org>
|
|
26
15
|
* @license MIT
|
|
27
16
|
*/
|
|
28
|
-
e.exports=function(e){return null!=e&&(r(e)||function(e){return"function"==typeof e.readFloatLE&&"function"==typeof e.slice&&r(e.slice(0,0))}(e)||!!e._isBuffer)}},function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function a(e){try{f(n.next(e))}catch(e){o(e)}}function s(e){try{f(n.throw(e))}catch(e){o(e)}}function f(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}f((n=n.apply(e,t||[])).next())}))},i=this&&this.__generator||function(e,t){var r,n,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(r)throw new TypeError("Generator is already executing.");for(;a;)try{if(r=1,n&&(i=2&o[0]?n.return:o[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,o[1])).done)return i;switch(n=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,n=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!(i=a.trys,(i=i.length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){a.label=o[1];break}if(6===o[0]&&a.label<i[1]){a.label=i[1],i=o;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(o);break}i[2]&&a.ops.pop(),a.trys.pop();continue}o=t.call(e,a)}catch(e){o=[6,e],n=0}finally{r=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,s])}}},o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var a=r(1),s=r(9),f=o(r(20)),u=o(r(92));function c(e,t,r,n){if(!n)throw new a.CramMalformedError("could not resolve intra-slice mate pairs, file seems truncated or malformed");var i=!!(n.mate||void 0!==n.mateRecordNumber&&n.mateRecordNumber!==t);r.readName||(r.readName=String(r.uniqueId),n.readName=r.readName),r.mate={sequenceId:n.sequenceId,alignmentStart:n.alignmentStart,uniqueId:n.uniqueId},n.readName&&(r.mate.readName=n.readName),n.mate||void 0!==n.mateRecordNumber||(n.mate={sequenceId:r.sequenceId,alignmentStart:r.alignmentStart,uniqueId:r.uniqueId},r.readName&&(n.mate.readName=r.readName)),r.flags|=f.default.BAM_FPAIRED,n.flags&f.default.BAM_FUNMAP&&(r.flags|=f.default.BAM_FMUNMAP),r.flags&f.default.BAM_FUNMAP&&(n.flags|=f.default.BAM_FMUNMAP),n.flags&f.default.BAM_FREVERSE&&(r.flags|=f.default.BAM_FMREVERSE),r.flags&f.default.BAM_FREVERSE&&(n.flags|=f.default.BAM_FMREVERSE),void 0===r.templateLength&&(i?function(e,t,r){var n=function t(r){var n=[r];if(r.mateRecordNumber>=0){var i=e[r.mateRecordNumber];if(!i)throw new a.CramMalformedError("intra-slice mate record not found, this file seems malformed");n.push.apply(n,t(i))}return n}(r),i=n.map((function(e){return e.alignmentStart})),o=n.map((function(e){return e.alignmentStart+e.readLength-1})),s=Math.max.apply(Math,o)-Math.min.apply(Math,i)+1;s>=0&&n.forEach((function(e){if(void 0!==e.templateLength)throw new a.CramMalformedError("mate pair group has some members that have template lengths already, this file seems malformed");e.templateLength=s}))}(e,0,r):function(e,t){var r=Math.min(e.alignmentStart,t.alignmentStart),n=Math.max(e.alignmentStart+e.readLength-1,t.alignmentStart+t.readLength-1)-r+1;e.templateLength=n,t.templateLength=n}(r,n)),delete r.mateRecordNumber}var l=function(){function e(e,t){this.container=e,this.file=e.file,this.containerPosition=t}return e.prototype.getHeader=function(){return n(this,void 0,void 0,(function(){var e,t,r;return i(this,(function(n){switch(n.label){case 0:return[4,this.file.getSectionParsers()];case 1:return e=n.sent(),[4,this.container.getHeader()];case 2:return t=n.sent(),[4,this.file.readBlock(t._endPosition+this.containerPosition)];case 3:if("MAPPED_SLICE_HEADER"===(r=n.sent()).contentType)r.content=(0,s.parseItem)(r.content,e.cramMappedSliceHeader.parser,0,t._endPosition);else{if("UNMAPPED_SLICE_HEADER"!==r.contentType)throw new a.CramMalformedError("error reading slice header block, invalid content type ".concat(r._contentType));r.content=(0,s.parseItem)(r.content,e.cramUnmappedSliceHeader.parser,0,t._endPosition)}return[2,r]}}))}))},e.prototype.getBlocks=function(){return n(this,void 0,void 0,(function(){var e,t,r,n,o,a;return i(this,(function(i){switch(i.label){case 0:return[4,this.getHeader()];case 1:e=i.sent(),t=e._endPosition,r=new Array(e.content.numBlocks),n=0,i.label=2;case 2:return n<r.length?(o=r,a=n,[4,this.file.readBlock(t)]):[3,5];case 3:o[a]=i.sent(),t=r[n]._endPosition,i.label=4;case 4:return n+=1,[3,2];case 5:return[2,r]}}))}))},e.prototype.getCoreDataBlock=function(){return n(this,void 0,void 0,(function(){return i(this,(function(e){switch(e.label){case 0:return[4,this.getBlocks()];case 1:return[2,e.sent()[0]]}}))}))},e.prototype._getBlocksContentIdIndex=function(){return n(this,void 0,void 0,(function(){var e,t;return i(this,(function(r){switch(r.label){case 0:return[4,this.getBlocks()];case 1:return e=r.sent(),t={},e.forEach((function(e){"EXTERNAL_DATA"===e.contentType&&(t[e.contentId]=e)})),[2,t]}}))}))},e.prototype.getBlockByContentId=function(e){return n(this,void 0,void 0,(function(){return i(this,(function(t){switch(t.label){case 0:return[4,this._getBlocksContentIdIndex()];case 1:return[2,t.sent()[e]]}}))}))},e.prototype.getReferenceRegion=function(){return n(this,void 0,void 0,(function(){var e,t,r,n;return i(this,(function(i){switch(i.label){case 0:return[4,this.getHeader()];case 1:return(e=i.sent().content).refSeqId<0?[2,void 0]:[4,this.container.getCompressionScheme()];case 2:if(t=i.sent(),e.refBaseBlockId>=0){if(!(r=this.getBlockByContentId(e.refBaseBlockId)))throw new a.CramMalformedError("embedded reference specified, but reference block does not exist");if(e.span>r.uncompressedSize)throw new a.CramMalformedError("Embedded reference is too small");return[2,{seq:r.data.toString("utf8"),start:e.refSeqStart,end:e.refSeqStart+e.refSeqSpan-1,span:e.refSeqSpan}]}if(!t.referenceRequired&&!this.file.fetchReferenceSequenceCallback)return[3,4];if(!this.file.fetchReferenceSequenceCallback)throw new Error("reference sequence not embedded, and seqFetch callback not provided, cannot fetch reference sequence");return[4,this.file.fetchReferenceSequenceCallback(e.refSeqId,e.refSeqStart,e.refSeqStart+e.refSeqSpan-1)];case 3:if((n=i.sent()).length!==e.refSeqSpan)throw new a.CramArgumentError("seqFetch callback returned a reference sequence of the wrong length");return[2,{seq:n,start:e.refSeqStart,end:e.refSeqStart+e.refSeqSpan-1,span:e.refSeqSpan}];case 4:return[2,void 0]}}))}))},e.prototype.getAllRecords=function(){return this.getRecords((function(){return!0}))},e.prototype._fetchRecords=function(){return n(this,void 0,void 0,(function(){var e,t,r,n,o,f,l,h,d,p,g,y,v,m,b,_,w=this;return i(this,(function(i){switch(i.label){case 0:return[4,this.file.getDefinition()];case 1:return e=i.sent().majorVersion,[4,this.container.getCompressionScheme()];case 2:return t=i.sent(),[4,this.getHeader()];case 3:return r=i.sent(),[4,this._getBlocksContentIdIndex()];case 4:return n=i.sent(),e>1&&this.file.options.checkSequenceMD5&&r.content.refSeqId>=0&&"0000000000000000"!==r.content.md5.join("")?[4,this.getReferenceRegion()]:[3,6];case 5:if((o=i.sent())&&(f=o.seq,l=o.start,h=o.end,d=(0,s.sequenceMD5)(f),p=r.content.md5.map((function(e){return(e<16?"0":"")+e.toString(16)})).join(""),d!==p))throw new a.CramMalformedError("MD5 checksum reference mismatch for ref ".concat(r.content.refSeqId," pos ").concat(l,"..").concat(h,". recorded MD5: ").concat(p,", calculated MD5: ").concat(d));i.label=6;case 6:return[4,this.getCoreDataBlock()];case 7:for(g=i.sent(),y={lastAlignmentStart:r.content.refSeqStart||0,coreBlock:{bitPosition:7,bytePosition:0},externalBlocks:{getCursor:function(e){return this[e]||(this[e]={bitPosition:7,bytePosition:0}),this[e]}}},v=function(e){var r=t.getCodecForDataSeries(e);if(!r)throw new a.CramMalformedError("no codec defined for ".concat(e," data series"));return r.decode(w,g,n,y)},m=new Array(r.content.numRecords),b=0;b<m.length;b+=1)try{m[b]=(0,u.default)(this,v,t,r,g,n,y,e,b),m[b].uniqueId=r.contentPosition+r.content.recordCounter+b+1}catch(e){if(e instanceof a.CramBufferOverrunError){console.warn("read attempted beyond end of buffer, file seems truncated."),m=m.filter((function(e){return!!e}));break}throw e}for(b=0;b<m.length;b+=1)(_=m[b].mateRecordNumber)>=0&&c(m,b,m[b],m[_]);return[2,m]}}))}))},e.prototype.getRecords=function(e){return n(this,void 0,void 0,(function(){var t,r,o,a,s,f,u,c,l,h,d,p=this;return i(this,(function(g){switch(g.label){case 0:return t=this.container.filePosition+this.containerPosition,(r=this.file.featureCache.get(t))||(r=this._fetchRecords(),this.file.featureCache.set(t,r)),[4,r];case 1:return(o=g.sent().filter(e)).length&&this.file.fetchReferenceSequenceCallback?[4,this.getHeader()]:[3,5];case 2:return(a=g.sent()).content.refSeqId>=0||-2===a.content.refSeqId?(s=a.content.refSeqId>=0?a.content.refSeqId:void 0,[4,this.container.getCompressionScheme()]):[3,5];case 3:for(f=g.sent(),u={},l=0;l<o.length;l+=1)h=void 0!==s?s:o[l].sequenceId,(d=u[h])||(d={id:h,start:o[l].alignmentStart,end:-1/0},u[h]=d),(c=o[l].alignmentStart+(o[l].lengthOnRef||o[l].readLength)-1)>d.end&&(d.end=c),o[l].alignmentStart<d.start&&(d.start=o[l].alignmentStart);return[4,Promise.all(Object.values(u).map((function(e){return n(p,void 0,void 0,(function(){var t;return i(this,(function(r){switch(r.label){case 0:return-1!==e.id&&e.start<=e.end?(t=e,[4,this.file.fetchReferenceSequenceCallback(e.id,e.start,e.end)]):[3,2];case 1:t.seq=r.sent(),r.label=2;case 2:return[2]}}))}))})))];case 4:for(g.sent(),l=0;l<o.length;l+=1)h=void 0!==s?s:o[l].sequenceId,(d=u[h])&&d.seq&&o[l].addReferenceSequence(d,f);g.label=5;case 5:return[2,o]}}))}))},e}();t.default=l,"getHeader getBlocks _getBlocksContentIdIndex".split(" ").forEach((function(e){return(0,s.tinyMemoize)(l,e)}))},function(e,t,r){"use strict";(function(e){var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var i=n(r(36)),o=r(1),a=n(r(93)),s=n(r(20));function f(e){var t=e.indexOf(0);return-1===t?e.toString("utf8"):e.toString("utf8",0,t)}function u(t,r){if(r.readInt32LE||(r=e.from(r)),"Z"===t)return f(r);if("A"===t)return String.fromCharCode(r[0]);if("I"===t){var n=i.default.fromBytesLE(r);if(n.greaterThan(Number.MAX_SAFE_INTEGER)||n.lessThan(Number.MIN_SAFE_INTEGER))throw new o.CramUnimplementedError("integer overflow");return n.toNumber()}if("i"===t)return r.readInt32LE(0);if("s"===t)return r.readInt16LE(0);if("S"===t)return r.readUInt16LE(0);if("c"===t)return r.readInt8(0);if("C"===t)return r.readUInt8(0);if("f"===t)return r.readFloatLE(0);if("H"===t){var a=f(r);return Number.parseInt(a.replace(/^0x/,""),16)}if("B"===t)return function(e){var t=String.fromCharCode(e[0]),r=e.readInt32LE(1),n={c:["readInt8",1],C:["readUInt8",1],s:["readInt16LE",2],S:["readUInt16LE",2],i:["readInt32LE",4],I:["readUInt32LE",4],f:["readFloatLE",4]}[t];if(!n)throw new o.CramMalformedError("invalid tag value array type '".concat(t,"'"));for(var i=n[0],a=n[1],s=new Array(r),f=5,u=0;u<r;u+=1)s[u]=e[i](f),f+=a;return s}(r);throw new o.CramMalformedError("Unrecognized tag type ".concat(t))}function c(t){if(t instanceof e)return f(t);if(t.length&&t.indexOf){if(!t[t.length-1]){var r=t.indexOf(0);return String.fromCharCode.apply(String,t.slice(0,r))}return String.fromCharCode.apply(String,t)}return String(t)}t.default=function(e,t,r,n,i,f,l,h,d){var p=new a.default;if(p.flags=t("BF"),p.cramFlags=t("CF"),h>1&&-2===n.content.refSeqId?p.sequenceId=t("RI"):p.sequenceId=n.content.refSeqId,p.readLength=t("RL"),p.alignmentStart=t("AP"),r.APdelta&&(p.alignmentStart+=l.lastAlignmentStart),l.lastAlignmentStart=p.alignmentStart,p.readGroupId=t("RG"),r.readNamesIncluded&&(p.readName=c(t("RN"))),p.isDetached()){var g={};g.flags=t("MF"),r.readNamesIncluded||(g.readName=c(t("RN")),p.readName=g.readName),g.sequenceId=t("NS"),g.alignmentStart=t("NP"),(g.flags||g.sequenceId>-1)&&(p.mate=g),p.templateSize=t("TS"),g.flags&s.default.CRAM_M_UNMAP&&(p.flags|=s.default.BAM_FMUNMAP),g.flags&s.default.CRAM_M_REVERSE&&(p.flags|=s.default.BAM_FMREVERSE)}else p.hasMateDownStream()&&(p.mateRecordNumber=t("NF")+d+1);var y=t("TL");if(y<0)throw new o.CramMalformedError("invalid TL index");for(var v=r.getTagNames(y),m=v.length,b=0;b<m;b+=1){var _=v[b],w=_.substr(0,2),E=_.substr(2,1),S=r.getCodecForTag(_);if(!S)throw new o.CramMalformedError("no codec defined for auxiliary tag ".concat(_));var A=S.decode(e,i,f,l);p.tags[w]=u(E,A)}if(p.isSegmentUnmapped())if(p.isUnknownBases())p.readBases=null,p.qualityScores=null;else{for(x=new Array(p.readLength),b=0;b<x.length;b+=1)x[b]=t("BA");if(p.readBases=String.fromCharCode.apply(String,x),p.isPreservingQualityScores()){for(b=0;b<x.length;b+=1)x[b]=t("QS");p.qualityScores=x}}else{var R=t("FN");R&&(p.readFeatures=function(e,t,r,n,i){var a=0,s=e.alignmentStart-1,f=new Array(t);function u(e){var t=e[0],n=e[1],i=r(n);return"character"===t?String.fromCharCode(i):"string"===t?i.toString("utf8"):"numArray"===t?i.toArray():i}for(var c=0;c<t;c+=1){var l=String.fromCharCode(r("FC")),h=r("FP"),d={code:l},p={B:["character","BA"],S:["string",i>1?"SC":"IN"],X:["number","BS"],D:["number","DL"],I:["string","IN"],i:["character","BA"],b:["string","BB"],q:["numArray","QQ"],Q:["number","QS"],H:["number","HC"],P:["number","PD"],N:["number","RS"]}[l];if(!p)throw new o.CramMalformedError('invalid read feature code "'.concat(l,'"'));d.data=u(p);var g={B:["number","QS"]}[l];g&&(d.data=[d.data,u(g)]),a+=h,d.pos=a,s+=h,d.refPos=s,"D"===l||"N"===l?s+=d.data:"I"===l||"S"===l?s-=d.data.length:"i"===l&&(s-=1),f[c]=d}return f}(p,R,t,0,h));var k=p.readLength;if(p.readFeatures&&p.readFeatures.forEach((function(e){var t=e.code,r=e.data;"D"===t||"N"===t?k+=r:"I"===t||"S"===t?k-=r.length:"i"===t&&(k-=1)})),Number.isNaN(k)&&(console.warn("".concat(p.readName||"".concat(p.sequenceId,":").concat(p.alignmentStart)," record has invalid read features")),k=p.readLength),p.lengthOnRef=k,p.mappingQuality=t("MQ"),p.isPreservingQualityScores()){for(var x=new Array(p.readLength),b=0;b<x.length;b+=1)x[b]=t("QS");p.qualityScores=x}}return p}}).call(this,r(0).Buffer)},function(e,t,r){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var i=n(r(20));var o={a:0,A:0,c:1,C:1,g:2,G:2,t:3,T:3,n:4,N:4};var a=function(){function e(){this.tags={}}return e.prototype.isPaired=function(){return!!(this.flags&i.default.BAM_FPAIRED)},e.prototype.isProperlyPaired=function(){return!!(this.flags&i.default.BAM_FPROPER_PAIR)},e.prototype.isSegmentUnmapped=function(){return!!(this.flags&i.default.BAM_FUNMAP)},e.prototype.isMateUnmapped=function(){return!!(this.flags&i.default.BAM_FMUNMAP)},e.prototype.isReverseComplemented=function(){return!!(this.flags&i.default.BAM_FREVERSE)},e.prototype.isMateReverseComplemented=function(){return!!(this.flags&i.default.BAM_FMREVERSE)},e.prototype.isRead1=function(){return!!(this.flags&i.default.BAM_FREAD1)},e.prototype.isRead2=function(){return!!(this.flags&i.default.BAM_FREAD2)},e.prototype.isSecondary=function(){return!!(this.flags&i.default.BAM_FSECONDARY)},e.prototype.isFailedQc=function(){return!!(this.flags&i.default.BAM_FQCFAIL)},e.prototype.isDuplicate=function(){return!!(this.flags&i.default.BAM_FDUP)},e.prototype.isSupplementary=function(){return!!(this.flags&i.default.BAM_FSUPPLEMENTARY)},e.prototype.isDetached=function(){return!!(this.cramFlags&i.default.CRAM_FLAG_DETACHED)},e.prototype.hasMateDownStream=function(){return!!(this.cramFlags&i.default.CRAM_FLAG_MATE_DOWNSTREAM)},e.prototype.isPreservingQualityScores=function(){return!!(this.cramFlags&i.default.CRAM_FLAG_PRESERVE_QUAL_SCORES)},e.prototype.isUnknownBases=function(){return!!(this.cramFlags&i.default.CRAM_FLAG_NO_SEQ)},e.prototype.getReadBases=function(){return!this.readBases&&this._refRegion&&(this.readBases=function(e,t){if((e.lengthOnRef||e.readLength)&&!e.isUnknownBases()){var r=e.alignmentStart-t.start;if(!e.readFeatures)return t.seq.substr(r,e.lengthOnRef).toUpperCase();for(var n="",i=r,o=0;n.length<e.readLength;)if(o<e.readFeatures.length){var a=e.readFeatures[o];if("Q"===a.code||"q"===a.code)o+=1;else if(a.pos===n.length+1)if(o+=1,"b"===a.code){var s=a.data.split(","),f=String.fromCharCode.apply(String,s);n+=f,i+=f.length}else"B"===a.code?(n+=a.data[0],i+=1):"X"===a.code?(n+=a.sub,i+=1):"I"===a.code?n+=a.data:"D"===a.code?i+=a.data:"i"===a.code?n+=a.data:"N"===a.code?i+=a.data:"S"===a.code?n+=a.data:"P"===a.code||a.code;else if(o<e.readFeatures.length){n+=u=t.seq.substr(i,e.readFeatures[o].pos-n.length-1),i+=u.length}}else{var u;n+=u=t.seq.substr(i,e.readLength-n.length),i+=u.length}return n.toUpperCase()}}(this,this._refRegion)),this.readBases},e.prototype.getPairOrientation=function(){if(!this.isSegmentUnmapped()&&this.isPaired()&&!this.isMateUnmapped()&&this.mate&&this.sequenceId===this.mate.sequenceId){var e=this.isReverseComplemented()?"R":"F",t=this.isMateReverseComplemented()?"R":"F",r=" ",n=" ";this.isRead1()?(r="1",n="2"):this.isRead2()&&(r="2",n="1");var i=[],o=this.templateLength||this.templateSize;return this.alignmentStart>this.mate.alignmentStart&&o>0&&(o=-o),o>0?(i[0]=e,i[1]=r,i[2]=t,i[3]=n):(i[2]=e,i[3]=r,i[0]=t,i[1]=n),i.join("")}return null},e.prototype.addReferenceSequence=function(e,t){this.readFeatures&&this.readFeatures.forEach((function(r){"X"===r.code&&function(e,t,r,n){if(t){var i=n.refPos-t.start,a=t.seq.charAt(i);a&&(n.ref=a);var s=o[a];void 0===s&&(s=4);var f=r.substitutionMatrix[s][n.data];f&&(n.sub=f)}}(0,e,t,r)})),!this.readBases&&e.start<=this.alignmentStart&&e.end>=this.alignmentStart+(this.lengthOnRef||this.readLength)-1&&(this._refRegion=e)},e.prototype.toJSON=function(){var e=this,t={};return Object.keys(this).forEach((function(r){"_"!==r.charAt(0)&&(t[r]=e[r])})),t.readBases=this.getReadBases(),t},e}();t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(1),i=r(95),o={BF:"int",CF:"int",RI:"int",RL:"int",AP:"int",RG:"int",MF:"int",NS:"int",NP:"int",TS:"int",NF:"int",TC:"byte",TN:"int",FN:"int",FC:"byte",FP:"int",BS:"byte",IN:"byteArray",SC:"byteArray",DL:"int",BA:"byte",BB:"byteArray",RS:"int",PD:"int",HC:"int",MQ:"int",RN:"byteArray",QS:"byte",QQ:"byteArray",TL:"int",TM:"ignore",TV:"ignore"};var a=function(){function e(e){Object.assign(this,e),this.readNamesIncluded=e.preservation.RN,this.APdelta=e.preservation.AP,this.referenceRequired=!!e.preservation.RR,this.tagIdsDictionary=e.preservation.TD,this.substitutionMatrix=function(e){for(var t=new Array(5),r=0;r<5;r+=1)t[r]=new Array(4);return t[0][e[0]>>6&3]="C",t[0][e[0]>>4&3]="G",t[0][e[0]>>2&3]="T",t[0][e[0]>>0&3]="N",t[1][e[1]>>6&3]="A",t[1][e[1]>>4&3]="G",t[1][e[1]>>2&3]="T",t[1][e[1]>>0&3]="N",t[2][e[2]>>6&3]="A",t[2][e[2]>>4&3]="C",t[2][e[2]>>2&3]="T",t[2][e[2]>>0&3]="N",t[3][e[3]>>6&3]="A",t[3][e[3]>>4&3]="C",t[3][e[3]>>2&3]="G",t[3][e[3]>>0&3]="N",t[4][e[4]>>6&3]="A",t[4][e[4]>>4&3]="C",t[4][e[4]>>2&3]="G",t[4][e[4]>>0&3]="T",t}(e.preservation.SM),this.dataSeriesCodecCache={},this.tagCodecCache={}}return e.prototype.getCodecForTag=function(e){if(!this.tagCodecCache[e]){var t=this.tagEncoding[e];t&&(this.tagCodecCache[e]=(0,i.instantiateCodec)(t,"byteArray"))}return this.tagCodecCache[e]},e.prototype.getTagNames=function(e){return this.tagIdsDictionary[e]},e.prototype.getCodecForDataSeries=function(e){if(!this.dataSeriesCodecCache[e]){var t=this.dataSeriesEncoding[e];if(t){var r=o[e];if(!r)throw new n.CramMalformedError("data series name ".concat(e," not defined in file compression header"));this.dataSeriesCodecCache[e]=(0,i.instantiateCodec)(t,r)}}return this.dataSeriesCodecCache[e]},e.prototype.toJSON=function(){var e=this,t={};return Object.keys(this).forEach((function(r){/Cache$/.test(r)||(t[r]=e[r])})),t},e}();t.default=a},function(e,t,r){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.instantiateCodec=t.getCodecClassWithId=void 0;var i=r(1),o=n(r(96)),a=n(r(97)),s=n(r(98)),f=n(r(99)),u=n(r(100)),c=n(r(101)),l=n(r(102)),h={1:a.default,3:o.default,4:f.default,5:s.default,6:u.default,7:l.default,9:c.default};function d(e){return h[e]}t.getCodecClassWithId=d,t.instantiateCodec=function e(t,r){var n=d("ignore"===r?0:t.codecId);if(!n)throw new i.CramUnimplementedError("no codec implemented for codec ID ".concat(t.codecId));return new n(t.parameters,r,e)}},function(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var a=r(1);var s=function(e){function t(t,r){void 0===t&&(t={});var n=e.call(this,t,r)||this;if(!["byte","int"].includes(n.dataType))throw new TypeError("".concat(n.dataType," decoding not yet implemented by HUFFMAN_INT codec"));return n.buildCodeBook(),n.buildCodes(),n.buildCaches(),0===n.sortedCodes[0].bitLength&&(n._decode=n._decodeZeroLengthCode),n}return i(t,e),t.prototype.buildCodeBook=function(){for(var e=this,t=new Array(this.parameters.numCodes),r=0;r<this.parameters.numCodes;r+=1)t[r]={symbol:this.parameters.symbols[r],bitLength:this.parameters.bitLengths[r]};t=t.sort((function(e,t){return e.bitLength-t.bitLength||e.symbol-t.symbol})),this.codeBook={},t.forEach((function(t){e.codeBook[t.bitLength]||(e.codeBook[t.bitLength]=[]),e.codeBook[t.bitLength].push(t.symbol)}))},t.prototype.buildCodes=function(){var e=this;this.codes={};var t=0,r=-1;Object.entries(this.codeBook).forEach((function(n){var i=n[0],o=n[1];i=parseInt(i,10),o.forEach((function(n){var o={bitLength:i,value:n};r+=1;var s,f,u=i-t;if(r<<=u,o.bitCode=r,t+=u,16843009*((f=(858993459&(f=(s=r)-(s>>1)&1431655765))+(f>>2&858993459))+(f>>4)&252645135)>>24>i)throw new a.CramMalformedError("Symbol out of range");e.codes[n]=o}))}))},t.prototype.buildCaches=function(){this.sortedCodes=Object.values(this.codes).sort((function(e,t){return e.bitLength-t.bitLength||e.bitCode-t.bitCode})),this.sortedByValue=Object.values(this.codes).sort((function(e,t){return e.value-t.value})),this.sortedValuesByBitCode=this.sortedCodes.map((function(e){return e.value})),this.sortedBitCodes=this.sortedCodes.map((function(e){return e.bitCode})),this.sortedBitLengthsByBitCode=this.sortedCodes.map((function(e){return e.bitLength}));var e=Math.max.apply(Math,this.sortedBitCodes);this.bitCodeToValue=new Array(e+1).fill(-1);for(var t=0;t<this.sortedBitCodes.length;t+=1)this.bitCodeToValue[this.sortedCodes[t].bitCode]=t},t.prototype.decode=function(e,t,r,n){return this._decode(e,t,n.coreBlock)},t.prototype._decodeZeroLengthCode=function(){return this.sortedCodes[0].value},t.prototype._decode=function(e,t,r){for(var n=t.content,i=0,o=0,s=0;s<this.sortedCodes.length;s+=1){var f=this.sortedCodes[s].bitLength;o<<=f-i,o|=this._getBits(n,r,f-i),i=f;var u=this.bitCodeToValue[o];if(u>-1&&this.sortedBitLengthsByBitCode[u]===f)return this.sortedValuesByBitCode[u];for(var c=s;this.sortedCodes[c+1].bitLength===f&&c<this.sortedCodes.length;c+=1)s+=1}throw new a.CramMalformedError("Huffman symbol not found.")},t}(o(r(5)).default);t.default=s},function(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var a=r(1),s=o(r(5)),f=r(9),u=function(e){function t(t,r){void 0===t&&(t={});var n=e.call(this,t,r)||this;if("int"===n.dataType)n._decodeData=n._decodeInt;else{if("byte"!==n.dataType)throw new a.CramUnimplementedError("".concat(n.dataType," decoding not yet implemented by EXTERNAL codec"));n._decodeData=n._decodeByte}return n}return i(t,e),t.prototype.decode=function(e,t,r,n){var i=this.parameters.blockContentId,o=r[i];if(!o)throw new a.CramMalformedError("no block found with content ID ".concat(i));var s=n.externalBlocks.getCursor(i);return this._decodeData(o,s)},t.prototype._decodeInt=function(e,t){var r=(0,f.parseItf8)(e.content,t.bytePosition),n=r[0],i=r[1];return t.bytePosition+=i,n},t.prototype._decodeByte=function(e,t){if(t.bytePosition>=e.content.length)throw new a.CramBufferOverrunError("attempted to read beyond end of block. this file seems truncated.");var r=e.content[t.bytePosition];return t.bytePosition+=1,r},t}(s.default);t.default=u},function(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var a=r(1),s=function(e){function t(t,r){void 0===t&&(t={});var n=e.call(this,t,r)||this;if("byteArray"!==r)throw new TypeError("byteArrayStop codec does not support data type ".concat(r));return n._decode=n._decodeByteArray,n}return i(t,e),t.prototype.decode=function(e,t,r,n){var i=this.parameters.blockContentId,o=r[i];if(!o)throw new a.CramMalformedError("no block found with content ID ".concat(i));var s=n.externalBlocks.getCursor(i);return this._decode(o,s)},t.prototype._decodeByteArray=function(e,t){for(var r=e.content,n=this.parameters.stopByte,i=t.bytePosition,o=t.bytePosition;r[o]!==n&&o<r.length;){if(o===r.length)throw new a.CramBufferOverrunError("byteArrayStop reading beyond length of data buffer?");o+=1}return t.bytePosition=o+1,r.slice(i,o)},t}(o(r(5)).default);t.default=s},function(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var a=r(9),s=function(e){function t(t,r,n){void 0===t&&(t={});var i=e.call(this,t,r)||this;if(i.instantiateCodec=n,"byteArray"!==r)throw new TypeError("byteArrayLength does not support data type ".concat(r));return i}return i(t,e),t.prototype.decode=function(e,t,r,n){for(var i=this._getLengthCodec().decode(e,t,r,n),o=this._getDataCodec(),a=new Array(i),s=0;s<i;s+=1)a[s]=o.decode(e,t,r,n);return a},t.prototype._getLengthCodec=function(){var e=this.parameters.lengthsEncoding;return this.instantiateCodec(e,"int")},t.prototype._getDataCodec=function(){var e=this.parameters.valuesEncoding;return this.instantiateCodec(e,"byte")},t}(o(r(5)).default);t.default=s,"_getLengthCodec _getDataCodec".split(" ").forEach((function(e){return(0,a.tinyMemoize)(s,e)}))},function(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var a=r(1),s=function(e){function t(t,r){void 0===t&&(t={});var n=e.call(this,t,r)||this;if("int"!==n.dataType)throw new a.CramUnimplementedError("".concat(n.dataType," decoding not yet implemented by BETA codec"));return n}return i(t,e),t.prototype.decode=function(e,t,r,n){return this._getBits(t.content,n.coreBlock,this.parameters.length)-this.parameters.offset},t}(o(r(5)).default);t.default=s},function(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var a=r(1),s=function(e){function t(t,r){void 0===t&&(t={});var n=e.call(this,t,r)||this;if("int"!==n.dataType)throw new a.CramUnimplementedError("".concat(n.dataType," decoding not yet implemented by GAMMA codec"));return n}return i(t,e),t.prototype.decode=function(e,t,r,n){for(var i=1;0===this._getBits(t.content,n.coreBlock,1);)i+=1;return(this._getBits(t.content,n.coreBlock,i-1)|1<<i-1)-this.parameters.offset},t}(o(r(5)).default);t.default=s},function(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var a=r(1),s=function(e){function t(t,r){void 0===t&&(t={});var n=e.call(this,t,r)||this;if("int"!==n.dataType)throw new a.CramUnimplementedError("".concat(n.dataType," decoding not yet implemented by SUBEXP codec"));return n}return i(t,e),t.prototype.decode=function(e,t,r,n){for(var i,o,a=0;this._getBits(t.content,n.coreBlock,1);)a+=1;return 0===a?(i=this.parameters.K,o=this._getBits(t.content,n.coreBlock,i)):o=1<<(i=a+this.parameters.K-1)|this._getBits(t.content,n.coreBlock,i),o-this.parameters.offset},t}(o(r(5)).default);t.default=s},function(e,t,r){"use strict";var n=r(104),i=r(106);function o(){this.protocol=null,this.slashes=null,this.auth=null,this.host=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.query=null,this.pathname=null,this.path=null,this.href=null}t.parse=b,t.resolve=function(e,t){return b(e,!1,!0).resolve(t)},t.resolveObject=function(e,t){return e?b(e,!1,!0).resolveObject(t):t},t.format=function(e){i.isString(e)&&(e=b(e));return e instanceof o?e.format():o.prototype.format.call(e)},t.Url=o;var a=/^([a-z0-9.+-]+:)/i,s=/:[0-9]*$/,f=/^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,u=["{","}","|","\\","^","`"].concat(["<",">",'"',"`"," ","\r","\n","\t"]),c=["'"].concat(u),l=["%","/","?",";","#"].concat(c),h=["/","?","#"],d=/^[+a-z0-9A-Z_-]{0,63}$/,p=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,g={javascript:!0,"javascript:":!0},y={javascript:!0,"javascript:":!0},v={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0},m=r(107);function b(e,t,r){if(e&&i.isObject(e)&&e instanceof o)return e;var n=new o;return n.parse(e,t,r),n}o.prototype.parse=function(e,t,r){if(!i.isString(e))throw new TypeError("Parameter 'url' must be a string, not "+typeof e);var o=e.indexOf("?"),s=-1!==o&&o<e.indexOf("#")?"?":"#",u=e.split(s);u[0]=u[0].replace(/\\/g,"/");var b=e=u.join(s);if(b=b.trim(),!r&&1===e.split("#").length){var _=f.exec(b);if(_)return this.path=b,this.href=b,this.pathname=_[1],_[2]?(this.search=_[2],this.query=t?m.parse(this.search.substr(1)):this.search.substr(1)):t&&(this.search="",this.query={}),this}var w=a.exec(b);if(w){var E=(w=w[0]).toLowerCase();this.protocol=E,b=b.substr(w.length)}if(r||w||b.match(/^\/\/[^@\/]+@[^@\/]+/)){var S="//"===b.substr(0,2);!S||w&&y[w]||(b=b.substr(2),this.slashes=!0)}if(!y[w]&&(S||w&&!v[w])){for(var A,R,k=-1,x=0;x<h.length;x++){-1!==(C=b.indexOf(h[x]))&&(-1===k||C<k)&&(k=C)}-1!==(R=-1===k?b.lastIndexOf("@"):b.lastIndexOf("@",k))&&(A=b.slice(0,R),b=b.slice(R+1),this.auth=decodeURIComponent(A)),k=-1;for(x=0;x<l.length;x++){var C;-1!==(C=b.indexOf(l[x]))&&(-1===k||C<k)&&(k=C)}-1===k&&(k=b.length),this.host=b.slice(0,k),b=b.slice(k),this.parseHost(),this.hostname=this.hostname||"";var B="["===this.hostname[0]&&"]"===this.hostname[this.hostname.length-1];if(!B)for(var T=this.hostname.split(/\./),M=(x=0,T.length);x<M;x++){var O=T[x];if(O&&!O.match(d)){for(var I="",P=0,L=O.length;P<L;P++)O.charCodeAt(P)>127?I+="x":I+=O[P];if(!I.match(d)){var F=T.slice(0,x),N=T.slice(x+1),U=O.match(p);U&&(F.push(U[1]),N.unshift(U[2])),N.length&&(b="/"+N.join(".")+b),this.hostname=F.join(".");break}}}this.hostname.length>255?this.hostname="":this.hostname=this.hostname.toLowerCase(),B||(this.hostname=n.toASCII(this.hostname));var D=this.port?":"+this.port:"",j=this.hostname||"";this.host=j+D,this.href+=this.host,B&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),"/"!==b[0]&&(b="/"+b))}if(!g[E])for(x=0,M=c.length;x<M;x++){var z=c[x];if(-1!==b.indexOf(z)){var q=encodeURIComponent(z);q===z&&(q=escape(z)),b=b.split(z).join(q)}}var W=b.indexOf("#");-1!==W&&(this.hash=b.substr(W),b=b.slice(0,W));var Z=b.indexOf("?");if(-1!==Z?(this.search=b.substr(Z),this.query=b.substr(Z+1),t&&(this.query=m.parse(this.query)),b=b.slice(0,Z)):t&&(this.search="",this.query={}),b&&(this.pathname=b),v[E]&&this.hostname&&!this.pathname&&(this.pathname="/"),this.pathname||this.search){D=this.pathname||"";var H=this.search||"";this.path=D+H}return this.href=this.format(),this},o.prototype.format=function(){var e=this.auth||"";e&&(e=(e=encodeURIComponent(e)).replace(/%3A/i,":"),e+="@");var t=this.protocol||"",r=this.pathname||"",n=this.hash||"",o=!1,a="";this.host?o=e+this.host:this.hostname&&(o=e+(-1===this.hostname.indexOf(":")?this.hostname:"["+this.hostname+"]"),this.port&&(o+=":"+this.port)),this.query&&i.isObject(this.query)&&Object.keys(this.query).length&&(a=m.stringify(this.query));var s=this.search||a&&"?"+a||"";return t&&":"!==t.substr(-1)&&(t+=":"),this.slashes||(!t||v[t])&&!1!==o?(o="//"+(o||""),r&&"/"!==r.charAt(0)&&(r="/"+r)):o||(o=""),n&&"#"!==n.charAt(0)&&(n="#"+n),s&&"?"!==s.charAt(0)&&(s="?"+s),t+o+(r=r.replace(/[?#]/g,(function(e){return encodeURIComponent(e)})))+(s=s.replace("#","%23"))+n},o.prototype.resolve=function(e){return this.resolveObject(b(e,!1,!0)).format()},o.prototype.resolveObject=function(e){if(i.isString(e)){var t=new o;t.parse(e,!1,!0),e=t}for(var r=new o,n=Object.keys(this),a=0;a<n.length;a++){var s=n[a];r[s]=this[s]}if(r.hash=e.hash,""===e.href)return r.href=r.format(),r;if(e.slashes&&!e.protocol){for(var f=Object.keys(e),u=0;u<f.length;u++){var c=f[u];"protocol"!==c&&(r[c]=e[c])}return v[r.protocol]&&r.hostname&&!r.pathname&&(r.path=r.pathname="/"),r.href=r.format(),r}if(e.protocol&&e.protocol!==r.protocol){if(!v[e.protocol]){for(var l=Object.keys(e),h=0;h<l.length;h++){var d=l[h];r[d]=e[d]}return r.href=r.format(),r}if(r.protocol=e.protocol,e.host||y[e.protocol])r.pathname=e.pathname;else{for(var p=(e.pathname||"").split("/");p.length&&!(e.host=p.shift()););e.host||(e.host=""),e.hostname||(e.hostname=""),""!==p[0]&&p.unshift(""),p.length<2&&p.unshift(""),r.pathname=p.join("/")}if(r.search=e.search,r.query=e.query,r.host=e.host||"",r.auth=e.auth,r.hostname=e.hostname||e.host,r.port=e.port,r.pathname||r.search){var g=r.pathname||"",m=r.search||"";r.path=g+m}return r.slashes=r.slashes||e.slashes,r.href=r.format(),r}var b=r.pathname&&"/"===r.pathname.charAt(0),_=e.host||e.pathname&&"/"===e.pathname.charAt(0),w=_||b||r.host&&e.pathname,E=w,S=r.pathname&&r.pathname.split("/")||[],A=(p=e.pathname&&e.pathname.split("/")||[],r.protocol&&!v[r.protocol]);if(A&&(r.hostname="",r.port=null,r.host&&(""===S[0]?S[0]=r.host:S.unshift(r.host)),r.host="",e.protocol&&(e.hostname=null,e.port=null,e.host&&(""===p[0]?p[0]=e.host:p.unshift(e.host)),e.host=null),w=w&&(""===p[0]||""===S[0])),_)r.host=e.host||""===e.host?e.host:r.host,r.hostname=e.hostname||""===e.hostname?e.hostname:r.hostname,r.search=e.search,r.query=e.query,S=p;else if(p.length)S||(S=[]),S.pop(),S=S.concat(p),r.search=e.search,r.query=e.query;else if(!i.isNullOrUndefined(e.search)){if(A)r.hostname=r.host=S.shift(),(B=!!(r.host&&r.host.indexOf("@")>0)&&r.host.split("@"))&&(r.auth=B.shift(),r.host=r.hostname=B.shift());return r.search=e.search,r.query=e.query,i.isNull(r.pathname)&&i.isNull(r.search)||(r.path=(r.pathname?r.pathname:"")+(r.search?r.search:"")),r.href=r.format(),r}if(!S.length)return r.pathname=null,r.search?r.path="/"+r.search:r.path=null,r.href=r.format(),r;for(var R=S.slice(-1)[0],k=(r.host||e.host||S.length>1)&&("."===R||".."===R)||""===R,x=0,C=S.length;C>=0;C--)"."===(R=S[C])?S.splice(C,1):".."===R?(S.splice(C,1),x++):x&&(S.splice(C,1),x--);if(!w&&!E)for(;x--;x)S.unshift("..");!w||""===S[0]||S[0]&&"/"===S[0].charAt(0)||S.unshift(""),k&&"/"!==S.join("/").substr(-1)&&S.push("");var B,T=""===S[0]||S[0]&&"/"===S[0].charAt(0);A&&(r.hostname=r.host=T?"":S.length?S.shift():"",(B=!!(r.host&&r.host.indexOf("@")>0)&&r.host.split("@"))&&(r.auth=B.shift(),r.host=r.hostname=B.shift()));return(w=w||r.host&&S.length)&&!T&&S.unshift(""),S.length?r.pathname=S.join("/"):(r.pathname=null,r.path=null),i.isNull(r.pathname)&&i.isNull(r.search)||(r.path=(r.pathname?r.pathname:"")+(r.search?r.search:"")),r.auth=e.auth||r.auth,r.slashes=r.slashes||e.slashes,r.href=r.format(),r},o.prototype.parseHost=function(){var e=this.host,t=s.exec(e);t&&(":"!==(t=t[0])&&(this.port=t.substr(1)),e=e.substr(0,e.length-t.length)),e&&(this.hostname=e)}},function(e,t,r){(function(e,n){var i;/*! https://mths.be/punycode v1.3.2 by @mathias */!function(o){t&&t.nodeType,e&&e.nodeType;var a="object"==typeof n&&n;a.global!==a&&a.window!==a&&a.self;var s,f=2147483647,u=/^xn--/,c=/[^\x20-\x7E]/,l=/[\x2E\u3002\uFF0E\uFF61]/g,h={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},d=Math.floor,p=String.fromCharCode;function g(e){throw RangeError(h[e])}function y(e,t){for(var r=e.length,n=[];r--;)n[r]=t(e[r]);return n}function v(e,t){var r=e.split("@"),n="";return r.length>1&&(n=r[0]+"@",e=r[1]),n+y((e=e.replace(l,".")).split("."),t).join(".")}function m(e){for(var t,r,n=[],i=0,o=e.length;i<o;)(t=e.charCodeAt(i++))>=55296&&t<=56319&&i<o?56320==(64512&(r=e.charCodeAt(i++)))?n.push(((1023&t)<<10)+(1023&r)+65536):(n.push(t),i--):n.push(t);return n}function b(e){return y(e,(function(e){var t="";return e>65535&&(t+=p((e-=65536)>>>10&1023|55296),e=56320|1023&e),t+=p(e)})).join("")}function _(e,t){return e+22+75*(e<26)-((0!=t)<<5)}function w(e,t,r){var n=0;for(e=r?d(e/700):e>>1,e+=d(e/t);e>455;n+=36)e=d(e/35);return d(n+36*e/(e+38))}function E(e){var t,r,n,i,o,a,s,u,c,l,h,p=[],y=e.length,v=0,m=128,_=72;for((r=e.lastIndexOf("-"))<0&&(r=0),n=0;n<r;++n)e.charCodeAt(n)>=128&&g("not-basic"),p.push(e.charCodeAt(n));for(i=r>0?r+1:0;i<y;){for(o=v,a=1,s=36;i>=y&&g("invalid-input"),((u=(h=e.charCodeAt(i++))-48<10?h-22:h-65<26?h-65:h-97<26?h-97:36)>=36||u>d((f-v)/a))&&g("overflow"),v+=u*a,!(u<(c=s<=_?1:s>=_+26?26:s-_));s+=36)a>d(f/(l=36-c))&&g("overflow"),a*=l;_=w(v-o,t=p.length+1,0==o),d(v/t)>f-m&&g("overflow"),m+=d(v/t),v%=t,p.splice(v++,0,m)}return b(p)}function S(e){var t,r,n,i,o,a,s,u,c,l,h,y,v,b,E,S=[];for(y=(e=m(e)).length,t=128,r=0,o=72,a=0;a<y;++a)(h=e[a])<128&&S.push(p(h));for(n=i=S.length,i&&S.push("-");n<y;){for(s=f,a=0;a<y;++a)(h=e[a])>=t&&h<s&&(s=h);for(s-t>d((f-r)/(v=n+1))&&g("overflow"),r+=(s-t)*v,t=s,a=0;a<y;++a)if((h=e[a])<t&&++r>f&&g("overflow"),h==t){for(u=r,c=36;!(u<(l=c<=o?1:c>=o+26?26:c-o));c+=36)E=u-l,b=36-l,S.push(p(_(l+E%b,0))),u=d(E/b);S.push(p(_(u,0))),o=w(r,v,n==i),r=0,++n}++r,++t}return S.join("")}s={version:"1.3.2",ucs2:{decode:m,encode:b},decode:E,encode:S,toASCII:function(e){return v(e,(function(e){return c.test(e)?"xn--"+S(e):e}))},toUnicode:function(e){return v(e,(function(e){return u.test(e)?E(e.slice(4).toLowerCase()):e}))}},void 0===(i=function(){return s}.call(t,r,t,e))||(e.exports=i)}()}).call(this,r(105)(e),r(2))},function(e,t){e.exports=function(e){return e.webpackPolyfill||(e.deprecate=function(){},e.paths=[],e.children||(e.children=[]),Object.defineProperty(e,"loaded",{enumerable:!0,get:function(){return e.l}}),Object.defineProperty(e,"id",{enumerable:!0,get:function(){return e.i}}),e.webpackPolyfill=1),e}},function(e,t,r){"use strict";e.exports={isString:function(e){return"string"==typeof e},isObject:function(e){return"object"==typeof e&&null!==e},isNull:function(e){return null===e},isNullOrUndefined:function(e){return null==e}}},function(e,t,r){"use strict";t.decode=t.parse=r(108),t.encode=t.stringify=r(109)},function(e,t,r){"use strict";function n(e,t){return Object.prototype.hasOwnProperty.call(e,t)}e.exports=function(e,t,r,o){t=t||"&",r=r||"=";var a={};if("string"!=typeof e||0===e.length)return a;var s=/\+/g;e=e.split(t);var f=1e3;o&&"number"==typeof o.maxKeys&&(f=o.maxKeys);var u=e.length;f>0&&u>f&&(u=f);for(var c=0;c<u;++c){var l,h,d,p,g=e[c].replace(s,"%20"),y=g.indexOf(r);y>=0?(l=g.substr(0,y),h=g.substr(y+1)):(l=g,h=""),d=decodeURIComponent(l),p=decodeURIComponent(h),n(a,d)?i(a[d])?a[d].push(p):a[d]=[a[d],p]:a[d]=p}return a};var i=Array.isArray||function(e){return"[object Array]"===Object.prototype.toString.call(e)}},function(e,t,r){"use strict";var n=function(e){switch(typeof e){case"string":return e;case"boolean":return e?"true":"false";case"number":return isFinite(e)?e:"";default:return""}};e.exports=function(e,t,r,s){return t=t||"&",r=r||"=",null===e&&(e=void 0),"object"==typeof e?o(a(e),(function(a){var s=encodeURIComponent(n(a))+r;return i(e[a])?o(e[a],(function(e){return s+encodeURIComponent(n(e))})).join(t):s+encodeURIComponent(n(e[a]))})).join(t):s?encodeURIComponent(n(s))+r+encodeURIComponent(n(e)):""};var i=Array.isArray||function(e){return"[object Array]"===Object.prototype.toString.call(e)};function o(e,t){if(e.map)return e.map(t);for(var r=[],n=0;n<e.length;n++)r.push(t(e[n],n));return r}var a=Object.keys||function(e){var t=[];for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.push(r);return t}},function(e,t,r){"use strict";(function(e){var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function a(e){try{f(n.next(e))}catch(e){o(e)}}function s(e){try{f(n.throw(e))}catch(e){o(e)}}function f(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}f((n=n.apply(e,t||[])).next())}))},i=this&&this.__generator||function(e,t){var r,n,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(r)throw new TypeError("Generator is already executing.");for(;a;)try{if(r=1,n&&(i=2&o[0]?n.return:o[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,o[1])).done)return i;switch(n=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,n=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!(i=a.trys,(i=i.length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){a.label=o[1];break}if(6===o[0]&&a.label<i[1]){a.label=i[1],i=o;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(o);break}i[2]&&a.ops.pop(),a.trys.pop();continue}o=t.call(e,a)}catch(e){o=[6,e],n=0}finally{r=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,s])}}},o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var a=o(r(111)),s=o(r(112)),f=function(){function t(e){var t=this;this.position=0,this.url=e,this.cache=new s.default({fetch:function(e,r){return t._fetch(e,r)}})}return t.prototype._fetch=function(t,r){return n(this,void 0,void 0,(function(){var n,o,s,f,u,c;return i(this,(function(i){switch(i.label){case 0:return n={},r<1/0?n.range="bytes=".concat(t,"-").concat(t+r):r===1/0&&0!==t&&(n.range="bytes=".concat(t,"-")),[4,(0,a.default)(this.url,{method:"GET",headers:n,redirect:"follow",mode:"cors"})];case 1:return 200===(o=i.sent()).status&&0===t||206===o.status?(u=(f=e).from,[4,o.arrayBuffer()]):[3,3];case 2:return s=u.apply(f,[i.sent()]),(c=/\/(\d+)$/.exec(o.headers.get("content-range")))[1]&&(this._stat={size:parseInt(c[1],10)}),[2,s];case 3:throw new Error("HTTP ".concat(o.status," fetching ").concat(this.url))}}))}))},t.prototype.read=function(e,t,r,n){void 0===t&&(t=0),void 0===r&&(r=1/0),void 0===n&&(n=0);return null===n&&(this.position,this.position+=r),this.cache.get(e,t,r,n)},t.prototype.readFile=function(){return n(this,void 0,void 0,(function(){var t,r,n;return i(this,(function(i){switch(i.label){case 0:return[4,(0,a.default)(this.url,{method:"GET",redirect:"follow",mode:"cors"})];case 1:return t=i.sent(),n=(r=e).from,[4,t.arrayBuffer()];case 2:return[2,n.apply(r,[i.sent()])]}}))}))},t.prototype.stat=function(){return n(this,void 0,void 0,(function(){var t;return i(this,(function(r){switch(r.label){case 0:return this._stat?[3,2]:(t=e.allocUnsafe(10),[4,this.read(t,0,10,0)]);case 1:if(r.sent(),!this._stat)throw new Error("unable to determine size of file at ".concat(this.url));r.label=2;case 2:return[2,this._stat]}}))}))},t}();t.default=f}).call(this,r(0).Buffer)},function(e,t){var r="undefined"!=typeof self?self:this,n=function(){function e(){this.fetch=!1,this.DOMException=r.DOMException}return e.prototype=r,new e}();!function(e){!function(t){var r="URLSearchParams"in e,n="Symbol"in e&&"iterator"in Symbol,i="FileReader"in e&&"Blob"in e&&function(){try{return new Blob,!0}catch(e){return!1}}(),o="FormData"in e,a="ArrayBuffer"in e;if(a)var s=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],f=ArrayBuffer.isView||function(e){return e&&s.indexOf(Object.prototype.toString.call(e))>-1};function u(e){if("string"!=typeof e&&(e=String(e)),/[^a-z0-9\-#$%&'*+.^_`|~]/i.test(e))throw new TypeError("Invalid character in header field name");return e.toLowerCase()}function c(e){return"string"!=typeof e&&(e=String(e)),e}function l(e){var t={next:function(){var t=e.shift();return{done:void 0===t,value:t}}};return n&&(t[Symbol.iterator]=function(){return t}),t}function h(e){this.map={},e instanceof h?e.forEach((function(e,t){this.append(t,e)}),this):Array.isArray(e)?e.forEach((function(e){this.append(e[0],e[1])}),this):e&&Object.getOwnPropertyNames(e).forEach((function(t){this.append(t,e[t])}),this)}function d(e){if(e.bodyUsed)return Promise.reject(new TypeError("Already read"));e.bodyUsed=!0}function p(e){return new Promise((function(t,r){e.onload=function(){t(e.result)},e.onerror=function(){r(e.error)}}))}function g(e){var t=new FileReader,r=p(t);return t.readAsArrayBuffer(e),r}function y(e){if(e.slice)return e.slice(0);var t=new Uint8Array(e.byteLength);return t.set(new Uint8Array(e)),t.buffer}function v(){return this.bodyUsed=!1,this._initBody=function(e){var t;this._bodyInit=e,e?"string"==typeof e?this._bodyText=e:i&&Blob.prototype.isPrototypeOf(e)?this._bodyBlob=e:o&&FormData.prototype.isPrototypeOf(e)?this._bodyFormData=e:r&&URLSearchParams.prototype.isPrototypeOf(e)?this._bodyText=e.toString():a&&i&&((t=e)&&DataView.prototype.isPrototypeOf(t))?(this._bodyArrayBuffer=y(e.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):a&&(ArrayBuffer.prototype.isPrototypeOf(e)||f(e))?this._bodyArrayBuffer=y(e):this._bodyText=e=Object.prototype.toString.call(e):this._bodyText="",this.headers.get("content-type")||("string"==typeof e?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):r&&URLSearchParams.prototype.isPrototypeOf(e)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},i&&(this.blob=function(){var e=d(this);if(e)return e;if(this._bodyBlob)return Promise.resolve(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(new Blob([this._bodyArrayBuffer]));if(this._bodyFormData)throw new Error("could not read FormData body as blob");return Promise.resolve(new Blob([this._bodyText]))},this.arrayBuffer=function(){return this._bodyArrayBuffer?d(this)||Promise.resolve(this._bodyArrayBuffer):this.blob().then(g)}),this.text=function(){var e,t,r,n=d(this);if(n)return n;if(this._bodyBlob)return e=this._bodyBlob,t=new FileReader,r=p(t),t.readAsText(e),r;if(this._bodyArrayBuffer)return Promise.resolve(function(e){for(var t=new Uint8Array(e),r=new Array(t.length),n=0;n<t.length;n++)r[n]=String.fromCharCode(t[n]);return r.join("")}(this._bodyArrayBuffer));if(this._bodyFormData)throw new Error("could not read FormData body as text");return Promise.resolve(this._bodyText)},o&&(this.formData=function(){return this.text().then(_)}),this.json=function(){return this.text().then(JSON.parse)},this}h.prototype.append=function(e,t){e=u(e),t=c(t);var r=this.map[e];this.map[e]=r?r+", "+t:t},h.prototype.delete=function(e){delete this.map[u(e)]},h.prototype.get=function(e){return e=u(e),this.has(e)?this.map[e]:null},h.prototype.has=function(e){return this.map.hasOwnProperty(u(e))},h.prototype.set=function(e,t){this.map[u(e)]=c(t)},h.prototype.forEach=function(e,t){for(var r in this.map)this.map.hasOwnProperty(r)&&e.call(t,this.map[r],r,this)},h.prototype.keys=function(){var e=[];return this.forEach((function(t,r){e.push(r)})),l(e)},h.prototype.values=function(){var e=[];return this.forEach((function(t){e.push(t)})),l(e)},h.prototype.entries=function(){var e=[];return this.forEach((function(t,r){e.push([r,t])})),l(e)},n&&(h.prototype[Symbol.iterator]=h.prototype.entries);var m=["DELETE","GET","HEAD","OPTIONS","POST","PUT"];function b(e,t){var r,n,i=(t=t||{}).body;if(e instanceof b){if(e.bodyUsed)throw new TypeError("Already read");this.url=e.url,this.credentials=e.credentials,t.headers||(this.headers=new h(e.headers)),this.method=e.method,this.mode=e.mode,this.signal=e.signal,i||null==e._bodyInit||(i=e._bodyInit,e.bodyUsed=!0)}else this.url=String(e);if(this.credentials=t.credentials||this.credentials||"same-origin",!t.headers&&this.headers||(this.headers=new h(t.headers)),this.method=(r=t.method||this.method||"GET",n=r.toUpperCase(),m.indexOf(n)>-1?n:r),this.mode=t.mode||this.mode||null,this.signal=t.signal||this.signal,this.referrer=null,("GET"===this.method||"HEAD"===this.method)&&i)throw new TypeError("Body not allowed for GET or HEAD requests");this._initBody(i)}function _(e){var t=new FormData;return e.trim().split("&").forEach((function(e){if(e){var r=e.split("="),n=r.shift().replace(/\+/g," "),i=r.join("=").replace(/\+/g," ");t.append(decodeURIComponent(n),decodeURIComponent(i))}})),t}function w(e,t){t||(t={}),this.type="default",this.status=void 0===t.status?200:t.status,this.ok=this.status>=200&&this.status<300,this.statusText="statusText"in t?t.statusText:"OK",this.headers=new h(t.headers),this.url=t.url||"",this._initBody(e)}b.prototype.clone=function(){return new b(this,{body:this._bodyInit})},v.call(b.prototype),v.call(w.prototype),w.prototype.clone=function(){return new w(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new h(this.headers),url:this.url})},w.error=function(){var e=new w(null,{status:0,statusText:""});return e.type="error",e};var E=[301,302,303,307,308];w.redirect=function(e,t){if(-1===E.indexOf(t))throw new RangeError("Invalid status code");return new w(null,{status:t,headers:{location:e}})},t.DOMException=e.DOMException;try{new t.DOMException}catch(e){t.DOMException=function(e,t){this.message=e,this.name=t;var r=Error(e);this.stack=r.stack},t.DOMException.prototype=Object.create(Error.prototype),t.DOMException.prototype.constructor=t.DOMException}function S(e,r){return new Promise((function(n,o){var a=new b(e,r);if(a.signal&&a.signal.aborted)return o(new t.DOMException("Aborted","AbortError"));var s=new XMLHttpRequest;function f(){s.abort()}s.onload=function(){var e,t,r={status:s.status,statusText:s.statusText,headers:(e=s.getAllResponseHeaders()||"",t=new h,e.replace(/\r?\n[\t ]+/g," ").split(/\r?\n/).forEach((function(e){var r=e.split(":"),n=r.shift().trim();if(n){var i=r.join(":").trim();t.append(n,i)}})),t)};r.url="responseURL"in s?s.responseURL:r.headers.get("X-Request-URL");var i="response"in s?s.response:s.responseText;n(new w(i,r))},s.onerror=function(){o(new TypeError("Network request failed"))},s.ontimeout=function(){o(new TypeError("Network request failed"))},s.onabort=function(){o(new t.DOMException("Aborted","AbortError"))},s.open(a.method,a.url,!0),"include"===a.credentials?s.withCredentials=!0:"omit"===a.credentials&&(s.withCredentials=!1),"responseType"in s&&i&&(s.responseType="blob"),a.headers.forEach((function(e,t){s.setRequestHeader(t,e)})),a.signal&&(a.signal.addEventListener("abort",f),s.onreadystatechange=function(){4===s.readyState&&a.signal.removeEventListener("abort",f)}),s.send(void 0===a._bodyInit?null:a._bodyInit)}))}S.polyfill=!0,e.fetch||(e.fetch=S,e.Headers=h,e.Request=b,e.Response=w),t.Headers=h,t.Request=b,t.Response=w,t.fetch=S,Object.defineProperty(t,"__esModule",{value:!0})}({})}(n),n.fetch.ponyfill=!0,delete n.fetch.polyfill;var i=n;(t=i.fetch).default=i.fetch,t.fetch=i.fetch,t.Headers=i.Headers,t.Request=i.Request,t.Response=i.Response,e.exports=t},function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function a(e){try{f(n.next(e))}catch(e){o(e)}}function s(e){try{f(n.throw(e))}catch(e){o(e)}}function f(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}f((n=n.apply(e,t||[])).next())}))},i=this&&this.__generator||function(e,t){var r,n,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(r)throw new TypeError("Generator is already executing.");for(;a;)try{if(r=1,n&&(i=2&o[0]?n.return:o[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,o[1])).done)return i;switch(n=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,n=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!(i=a.trys,(i=i.length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){a.label=o[1];break}if(6===o[0]&&a.label<i[1]){a.label=i[1],i=o;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(o);break}i[2]&&a.ops.pop(),a.trys.pop();continue}o=t.call(e,a)}catch(e){o=[6,e],n=0}finally{r=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,s])}}},o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var a=o(r(19)),s=function(){function e(e){var t=e.fetch,r=e.size,n=void 0===r?1e7:r,i=e.chunkSize,o=void 0===i?32768:i;if(!t)throw new Error("fetch function required");this.fetch=t,this.chunkSize=o,this.lruCache=new a.default({maxSize:Math.floor(n/o)})}return e.prototype.get=function(e,t,r,o){return n(this,void 0,void 0,(function(){var n,a,s,f,u,c,l,h,d=this;return i(this,(function(i){switch(i.label){case 0:if(e.length<t+r)throw new Error("output buffer not big enough for request");for(n=Math.floor(o/this.chunkSize),a=Math.floor((o+r)/this.chunkSize),s=new Array(a-n+1),f=function(e){s[e-n]=u._getChunk(e).then((function(t){return{data:t,chunkNumber:e}}))},u=this,c=n;c<=a;c+=1)f(c);return[4,Promise.all(s)];case 1:return l=i.sent(),h=o-l[0].chunkNumber*this.chunkSize,l.forEach((function(i){var s=i.data,f=i.chunkNumber,u=f*d.chunkSize,c=0,l=d.chunkSize,p=t+(f-n)*d.chunkSize-h;f===n&&(p=t,c=h),f===a&&(l=o+r-u),s.copy(e,p,c,l)})),[2]}}))}))},e.prototype._getChunk=function(e){var t=this.lruCache.get(e);if(t)return t;var r=this.fetch(e*this.chunkSize,this.chunkSize);return this.lruCache.set(e,r),r},e}();t.default=s},function(e,t){},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.parseHeaderText=void 0,t.parseHeaderText=function(e){var t=e.split(/\r?\n/),r=[];return t.forEach((function(e){var t=e.split(/\t/),n=t[0],i=t.slice(1).map((function(e){var t=e.split(":",2);return{tag:t[0],value:t[1]}}));n&&r.push({tag:n.substr(1),data:i})})),r}},function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function a(e){try{f(n.next(e))}catch(e){o(e)}}function s(e){try{f(n.throw(e))}catch(e){o(e)}}function f(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}f((n=n.apply(e,t||[])).next())}))},i=this&&this.__generator||function(e,t){var r,n,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(r)throw new TypeError("Generator is already executing.");for(;a;)try{if(r=1,n&&(i=2&o[0]?n.return:o[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,o[1])).done)return i;switch(n=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,n=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!(i=a.trys,(i=i.length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){a.label=o[1];break}if(6===o[0]&&a.label<i[1]){a.label=i[1],i=o;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(o);break}i[2]&&a.ops.pop(),a.trys.pop();continue}o=t.call(e,a)}catch(e){o=[6,e],n=0}finally{r=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,s])}}},o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var a=r(1),s=o(r(24)),f=function(){function e(e){if(e.cram?this.cram=e.cram:this.cram=new s.default({url:e.cramUrl,path:e.cramPath,filehandle:e.cramFilehandle,seqFetch:e.seqFetch,checkSequenceMD5:e.checkSequenceMD5,cacheSize:e.cacheSize}),!(this.cram instanceof s.default))throw new Error("invalid arguments: no cramfile");if(this.index=e.index,!this.index.getEntriesForRange)throw new Error("invalid arguments: not an index");this.fetchSizeLimit=e.fetchSizeLimit||3e6}return e.prototype.getRecordsForRange=function(e,t,r,o){return void 0===o&&(o={}),n(this,void 0,void 0,(function(){var n,s,f,u,c,l,h,d,p,g,y,v,m,b,_,w,E,S,A,R,k,x,C,B=this;return i(this,(function(i){switch(i.label){case 0:if(o.viewAsPairs=o.viewAsPairs||!1,o.pairAcrossChr=o.pairAcrossChr||!1,o.maxInsertSize=o.maxInsertSize||2e5,"string"==typeof e)throw new a.CramUnimplementedError("string sequence names not yet supported");return n=e,[4,this.index.getEntriesForRange(n,t,r)];case 1:if(s=i.sent(),(f=s.map((function(e){return e.sliceBytes})).reduce((function(e,t){return e+t}),0))>this.fetchSizeLimit)throw new a.CramSizeLimitError("data size of ".concat(f.toLocaleString()," bytes exceeded fetch size limit of ").concat(this.fetchSizeLimit.toLocaleString()," bytes"));return u=function(n){return n.sequenceId===e&&n.alignmentStart<=r&&n.alignmentStart+n.lengthOnRef-1>=t},[4,Promise.all(s.map((function(e){return B.getRecordsInSlice(e,u)})))];case 2:if(c=i.sent(),l=(C=Array.prototype).concat.apply(C,c),!o.viewAsPairs)return[3,5];for(h={},d={},E=0;E<l.length;E+=1)p=l[E].readName,g=l[E].uniqueId,h[p]||(h[p]=0),h[p]+=1,d[g]=1;for(y={},Object.entries(h).forEach((function(e){var t=e[0];1===e[1]&&(y[t]=!0)})),v=[],E=0;E<l.length;E+=1)m=l[E].readName,y[m]&&l[E].mate&&(l[E].mate.sequenceId===n||o.pairAcrossChr)&&Math.abs(l[E].alignmentStart-l[E].mate.alignmentStart)<o.maxInsertSize&&(b=this.index.getEntriesForRange(l[E].mate.sequenceId,l[E].mate.alignmentStart,l[E].mate.alignmentStart+1),v.push(b));return[4,Promise.all(v)];case 3:for(_=i.sent(),w=[],E=0;E<_.length;E+=1)w.push.apply(w,_[E]);if(w=w.sort((function(e,t){return e.toString().localeCompare(t.toString())})).filter((function(e,t,r){return!t||e.toString()!==r[t-1].toString()})),S=[],A=[],(R=w.map((function(e){return e.sliceBytes})).reduce((function(e,t){return e+t}),0))>this.fetchSizeLimit)throw new Error("mate data size of ".concat(R.toLocaleString()," bytes exceeded fetch size limit of ").concat(this.fetchSizeLimit.toLocaleString()," bytes"));return w.forEach((function(e){var t=B.cram.featureCache.get(e.toString());t||(t=B.getRecordsInSlice(e,(function(){return!0})),B.cram.featureCache.set(e.toString(),t)),S.push(t);var r=t.then((function(e){for(var t=[],r=0;r<e.length;r+=1){var n=e[r];y[n.readName]&&!d[n.uniqueId]&&t.push(n)}return t}));A.push(r)})),[4,Promise.all(A)];case 4:(k=i.sent()).length&&(x=k.reduce((function(e,t){return e.concat(t)})),l=l.concat(x)),i.label=5;case 5:return[2,l]}}))}))},e.prototype.getRecordsInSlice=function(e,t){var r=e.containerStart,n=e.sliceStart,i=e.sliceBytes;return this.cram.getContainerAtPosition(r).getSlice(n,i).getRecords(t)},e.prototype.hasDataForReferenceSequence=function(e){return this.index.hasDataForReferenceSequence(e)},e}();t.default=f},function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function a(e){try{f(n.next(e))}catch(e){o(e)}}function s(e){try{f(n.throw(e))}catch(e){o(e)}}function f(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}f((n=n.apply(e,t||[])).next())}))},i=this&&this.__generator||function(e,t){var r,n,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(r)throw new TypeError("Generator is already executing.");for(;a;)try{if(r=1,n&&(i=2&o[0]?n.return:o[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,o[1])).done)return i;switch(n=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,n=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!(i=a.trys,(i=i.length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){a.label=o[1];break}if(6===o[0]&&a.label<i[1]){a.label=i[1],i=o;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(o);break}i[2]&&a.ops.pop(),a.trys.pop();continue}o=t.call(e,a)}catch(e){o=[6,e],n=0}finally{r=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,s])}}},o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var a=o(r(117)),s=o(r(19)),f=r(123),u=o(r(26)),c=r(42),l=r(1),h=(0,f.promisify)(u.default.gunzip),d=function(){function e(e){Object.assign(this,e)}return e.prototype.toString=function(){return"".concat(this.start,":").concat(this.span,":").concat(this.containerStart,":").concat(this.sliceStart,":").concat(this.sliceBytes)},e}();function p(e,t){if(t.some((function(e){return void 0===e})))throw new l.CramMalformedError("invalid .crai index file");var r=t[0],n=t[1],i=t[2],o=t[3],a=t[4],s=t[5];e[r]||(e[r]=[]),e[r].push(new d({start:n,span:i,containerStart:o,sliceStart:a,sliceBytes:s}))}var g=function(){function e(e){var t=this,r=(0,c.open)(e.url,e.path,e.filehandle);this._parseCache=new a.default({cache:new s.default({maxSize:1}),fill:function(e,r){return t.parseIndex({signal:r})}}),this.readFile=r.readFile.bind(r)}return e.prototype.parseIndex=function(){var e={};return this.readFile().then((function(e){return 31===e[0]&&139===e[1]?h(e):e})).then((function(t){if(t.length>4&&21578050===t.readUInt32LE(0))throw new l.CramMalformedError("invalid .crai index file. note: file appears to be a .bai index. this is technically legal but please open a github issue if you need support");for(var r=[],n="",i=0;i<t.length;i+=1){var o=t[i];if(o>=48&&o<=57||!n&&45===o)n+=String.fromCharCode(o);else if(9===o)r.push(Number.parseInt(n,10)),n="";else if(10===o)r.push(Number.parseInt(n,10)),n="",p(e,r),r=[];else if(13!==o&&32!==o)throw new l.CramMalformedError("invalid .crai index file")}return n&&r.push(Number.parseInt(n,10)),6===r.length&&p(e,r),Object.entries(e).forEach((function(t){var r=t[0],n=t[1];e[r]=n.sort((function(e,t){return e.start-t.start||e.span-t.span}))})),e}))},e.prototype.getIndex=function(e){return void 0===e&&(e={}),this._parseCache.get("index",null,e.signal)},e.prototype.hasDataForReferenceSequence=function(e){return n(this,void 0,void 0,(function(){return i(this,(function(t){switch(t.label){case 0:return[4,this.getIndex()];case 1:return[2,!!t.sent()[e]]}}))}))},e.prototype.getEntriesForRange=function(e,t,r){return n(this,void 0,void 0,(function(){var n,o,a,s;return i(this,(function(i){switch(i.label){case 0:return[4,this.getIndex()];case 1:if(!(n=i.sent()[e]))return[2,[]];for(o=function(e){var n=e.start,i=e.start+e.span;return n>=r?-1:i<=t?1:0},a=[],s=0;s<n.length;s+=1)0===o(n[s])&&a.push(n[s]);return[2,a]}}))}))},e}();t.default=g},function(e,t,r){"use strict";var n=r(14);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=n(r(118)).default;t.default=i},function(e,t,r){"use strict";var n=r(14);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=n(r(119)),o=n(r(21)),a=n(r(22)),s=n(r(23)),f=r(43),u=n(r(121)),c=n(r(122)),l=function(){function e(t){var r=t.fill,n=t.cache;if((0,o.default)(this,e),(0,s.default)(this,"cache",void 0),(0,s.default)(this,"fillCallback",void 0),"function"!=typeof r)throw new TypeError("must pass a fill function");if("object"!==(0,i.default)(n))throw new TypeError("must pass a cache object");if("function"!=typeof n.get||"function"!=typeof n.set||"function"!=typeof n.delete)throw new TypeError("cache must implement get(key), set(key, val), and and delete(key)");this.cache=n,this.fillCallback=r}return(0,a.default)(e,[{key:"evict",value:function(e,t){this.cache.get(e)===t&&this.cache.delete(e)}},{key:"fill",value:function(e,t,r,n){var i=this,o=new u.default,a=new c.default;a.addCallback(n);var s={aborter:o,promise:this.fillCallback(t,o.signal,(function(e){a.callback(e)})),settled:!1,statusReporter:a,get aborted(){return this.aborter.signal.aborted}};s.aborter.addSignal(r),s.aborter.signal.addEventListener("abort",(function(){s.settled||i.evict(e,s)})),s.promise.then((function(){s.settled=!0}),(function(t){s.settled=!0,i.evict(e,s)})).catch((function(e){throw console.error(e),e})),this.cache.set(e,s)}},{key:"has",value:function(e){return this.cache.has(e)}},{key:"get",value:function(t,r,n,i){if(!n&&r instanceof f.AbortSignal)throw new TypeError("second get argument appears to be an AbortSignal, perhaps you meant to pass `null` for the fill data?");var o=this.cache.get(t);return o?o.aborted&&!o.settled?(this.evict(t,o),this.get(t,r,n,i)):o.settled?o.promise:(o.aborter.addSignal(n),o.statusReporter.addCallback(i),e.checkSinglePromise(o.promise,n)):(this.fill(t,r,n,i),e.checkSinglePromise(this.cache.get(t).promise,n))}},{key:"delete",value:function(e){var t=this.cache.get(e);t&&(t.settled||t.aborter.abort(),this.cache.delete(e))}},{key:"clear",value:function(){for(var e=this.cache.keys(),t=0,r=e.next();!r.done;r=e.next())this.delete(r.value),t+=1;return t}}],[{key:"isAbortException",value:function(e){return"AbortError"===e.name||"ERR_ABORTED"===e.code||"AbortError: aborted"===e.message||"Error: aborted"===e.message}},{key:"checkSinglePromise",value:function(e,t){function r(){if(t&&t.aborted)throw Object.assign(new Error("aborted"),{code:"ERR_ABORTED"})}return e.then((function(e){return r(),e}),(function(e){throw r(),e}))}}]),e}();t.default=l},function(e,t){function r(t){return e.exports=r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},e.exports.__esModule=!0,e.exports.default=e.exports,r(t)}e.exports=r,e.exports.__esModule=!0,e.exports.default=e.exports},function(e,t,r){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function o(e,t,r){return t&&i(e.prototype,t),r&&i(e,r),e}function a(e){return(a=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function s(e,t){return(s=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function f(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function u(e,t){return!t||"object"!=typeof t&&"function"!=typeof t?f(e):t}function c(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=a(e);if(t){var i=a(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return u(this,r)}}function l(e,t,r){return(l="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(e,t,r){var n=function(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=a(e)););return e}(e,t);if(n){var i=Object.getOwnPropertyDescriptor(n,t);return i.get?i.get.call(r):i.value}})(e,t,r||e)}Object.defineProperty(t,"__esModule",{value:!0});var h=function(){function e(){n(this,e),Object.defineProperty(this,"listeners",{value:{},writable:!0,configurable:!0})}return o(e,[{key:"addEventListener",value:function(e,t,r){e in this.listeners||(this.listeners[e]=[]),this.listeners[e].push({callback:t,options:r})}},{key:"removeEventListener",value:function(e,t){if(e in this.listeners)for(var r=this.listeners[e],n=0,i=r.length;n<i;n++)if(r[n].callback===t)return void r.splice(n,1)}},{key:"dispatchEvent",value:function(e){if(e.type in this.listeners){for(var t=this.listeners[e.type].slice(),r=0,n=t.length;r<n;r++){var i=t[r];try{i.callback.call(this,e)}catch(e){Promise.resolve().then((function(){throw e}))}i.options&&i.options.once&&this.removeEventListener(e.type,i.callback)}return!e.defaultPrevented}}}]),e}(),d=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&s(e,t)}(r,e);var t=c(r);function r(){var e;return n(this,r),(e=t.call(this)).listeners||h.call(f(e)),Object.defineProperty(f(e),"aborted",{value:!1,writable:!0,configurable:!0}),Object.defineProperty(f(e),"onabort",{value:null,writable:!0,configurable:!0}),e}return o(r,[{key:"toString",value:function(){return"[object AbortSignal]"}},{key:"dispatchEvent",value:function(e){"abort"===e.type&&(this.aborted=!0,"function"==typeof this.onabort&&this.onabort.call(this,e)),l(a(r.prototype),"dispatchEvent",this).call(this,e)}}]),r}(h),p=function(){function e(){n(this,e),Object.defineProperty(this,"signal",{value:new d,writable:!0,configurable:!0})}return o(e,[{key:"abort",value:function(){var e;try{e=new Event("abort")}catch(t){"undefined"!=typeof document?document.createEvent?(e=document.createEvent("Event")).initEvent("abort",!1,!1):(e=document.createEventObject()).type="abort":e={type:"abort",bubbles:!1,cancelable:!1}}this.signal.dispatchEvent(e)}},{key:"toString",value:function(){return"[object AbortController]"}}]),e}();"undefined"!=typeof Symbol&&Symbol.toStringTag&&(p.prototype[Symbol.toStringTag]="AbortController",d.prototype[Symbol.toStringTag]="AbortSignal"),t.AbortController=p,t.AbortSignal=d,t.abortableFetch=function(e){"function"==typeof e&&(e={fetch:e});var t=e,r=t.fetch,n=t.Request,i=void 0===n?r.Request:n,o=t.AbortController,a=t.__FORCE_INSTALL_ABORTCONTROLLER_POLYFILL,s=void 0!==a&&a;if(!function(e){return e.__FORCE_INSTALL_ABORTCONTROLLER_POLYFILL?(console.log("__FORCE_INSTALL_ABORTCONTROLLER_POLYFILL=true is set, will force install polyfill"),!0):"function"==typeof e.Request&&!e.Request.prototype.hasOwnProperty("signal")||!e.AbortController}({fetch:r,Request:i,AbortController:o,__FORCE_INSTALL_ABORTCONTROLLER_POLYFILL:s}))return{fetch:r,Request:f};var f=i;(f&&!f.prototype.hasOwnProperty("signal")||s)&&((f=function(e,t){var r;t&&t.signal&&(r=t.signal,delete t.signal);var n=new i(e,t);return r&&Object.defineProperty(n,"signal",{writable:!1,enumerable:!1,configurable:!0,value:r}),n}).prototype=i.prototype);var u=r;return{fetch:function(e,t){var r=f&&f.prototype.isPrototypeOf(e)?e.signal:t?t.signal:void 0;if(r){var n;try{n=new DOMException("Aborted","AbortError")}catch(e){(n=new Error("Aborted")).name="AbortError"}if(r.aborted)return Promise.reject(n);var i=new Promise((function(e,t){r.addEventListener("abort",(function(){return t(n)}),{once:!0})}));return t&&t.signal&&delete t.signal,Promise.race([i,u(e,t)])}return u(e,t)},Request:f}}},function(e,t,r){"use strict";var n=r(14);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=n(r(22)),o=n(r(23)),a=n(r(21)),s=r(43),f=function e(){(0,a.default)(this,e)},u=function(){function e(){(0,a.default)(this,e),(0,o.default)(this,"signals",new Set),(0,o.default)(this,"abortController",new s.AbortController)}return(0,i.default)(e,[{key:"addSignal",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new f;if(this.signal.aborted)throw new Error("cannot add a signal, already aborted!");this.signals.add(t),t.aborted?this.handleAborted(t):"function"==typeof t.addEventListener&&t.addEventListener("abort",(function(){e.handleAborted(t)}))}},{key:"handleAborted",value:function(e){this.signals.delete(e),0===this.signals.size&&this.abortController.abort()}},{key:"abort",value:function(){this.abortController.abort()}},{key:"signal",get:function(){return this.abortController.signal}}]),e}();t.default=u},function(e,t,r){"use strict";var n=r(14);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=n(r(21)),o=n(r(22)),a=n(r(23)),s=function(){function e(){(0,i.default)(this,e),(0,a.default)(this,"callbacks",new Set),(0,a.default)(this,"currentMessage",void 0)}return(0,o.default)(e,[{key:"addCallback",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:function(){};this.callbacks.add(e),e(this.currentMessage)}},{key:"callback",value:function(e){this.currentMessage=e,this.callbacks.forEach((function(t){t(e)}))}}]),e}();t.default=s},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.promisify=n;function n(e){if("function"!=typeof e)throw new TypeError("Argument to promisify must be a function");var t=e["__ES6-PROMISIFY--CUSTOM-ARGUMENTS__"],r=n.Promise||Promise;if("function"!=typeof r)throw new Error("No Promise implementation found; do you need a polyfill?");return function(){for(var n=this,i=arguments.length,o=new Array(i),a=0;a<i;a++)o[a]=arguments[a];return new r((function(r,i){o.push((function(e){if(e)return i(e);for(var n=arguments.length,o=new Array(n>1?n-1:0),a=1;a<n;a++)o[a-1]=arguments[a];if(1===o.length||!t)return r(o[0]);var s={};o.forEach((function(e,r){var n=t[r];n&&(s[n]=e)})),r(s)})),e.apply(n,o)}))}}n.argumentNames="__ES6-PROMISIFY--CUSTOM-ARGUMENTS__",n.Promise=void 0}]);
|
|
17
|
+
t.exports=function(t){return null!=t&&(r(t)||function(t){return"function"==typeof t.readFloatLE&&"function"==typeof t.slice&&r(t.slice(0,0))}(t)||!!t._isBuffer)}},function(t,e,r){"use strict";var n=this&&this.__awaiter||function(t,e,r,n){return new(r||(r=Promise))((function(i,o){function a(t){try{f(n.next(t))}catch(t){o(t)}}function s(t){try{f(n.throw(t))}catch(t){o(t)}}function f(t){var e;t.done?i(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(a,s)}f((n=n.apply(t,e||[])).next())}))},i=this&&this.__generator||function(t,e){var r,n,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(r)throw new TypeError("Generator is already executing.");for(;a;)try{if(r=1,n&&(i=2&o[0]?n.return:o[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,o[1])).done)return i;switch(n=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,n=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!(i=a.trys,(i=i.length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){a.label=o[1];break}if(6===o[0]&&a.label<i[1]){a.label=i[1],i=o;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(o);break}i[2]&&a.ops.pop(),a.trys.pop();continue}o=e.call(t,a)}catch(t){o=[6,t],n=0}finally{r=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,s])}}},o=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var a=r(0),s=r(5),f=o(r(12)),u=o(r(65));function c(t,e,r,n){if(!n)throw new a.CramMalformedError("could not resolve intra-slice mate pairs, file seems truncated or malformed");var i=!!(n.mate||void 0!==n.mateRecordNumber&&n.mateRecordNumber!==e);r.readName||(r.readName=String(r.uniqueId),n.readName=r.readName),r.mate={sequenceId:n.sequenceId,alignmentStart:n.alignmentStart,uniqueId:n.uniqueId},n.readName&&(r.mate.readName=n.readName),n.mate||void 0!==n.mateRecordNumber||(n.mate={sequenceId:r.sequenceId,alignmentStart:r.alignmentStart,uniqueId:r.uniqueId},r.readName&&(n.mate.readName=r.readName)),r.flags|=f.default.BAM_FPAIRED,n.flags&f.default.BAM_FUNMAP&&(r.flags|=f.default.BAM_FMUNMAP),r.flags&f.default.BAM_FUNMAP&&(n.flags|=f.default.BAM_FMUNMAP),n.flags&f.default.BAM_FREVERSE&&(r.flags|=f.default.BAM_FMREVERSE),r.flags&f.default.BAM_FREVERSE&&(n.flags|=f.default.BAM_FMREVERSE),void 0===r.templateLength&&(i?function(t,e,r){var n=function e(r){var n=[r];if(r.mateRecordNumber>=0){var i=t[r.mateRecordNumber];if(!i)throw new a.CramMalformedError("intra-slice mate record not found, this file seems malformed");n.push.apply(n,e(i))}return n}(r),i=n.map((function(t){return t.alignmentStart})),o=n.map((function(t){return t.alignmentStart+t.readLength-1})),s=Math.max.apply(Math,o)-Math.min.apply(Math,i)+1;s>=0&&n.forEach((function(t){if(void 0!==t.templateLength)throw new a.CramMalformedError("mate pair group has some members that have template lengths already, this file seems malformed");t.templateLength=s}))}(t,0,r):function(t,e){var r=Math.min(t.alignmentStart,e.alignmentStart),n=Math.max(t.alignmentStart+t.readLength-1,e.alignmentStart+e.readLength-1)-r+1;t.templateLength=n,e.templateLength=n}(r,n)),delete r.mateRecordNumber}var h=function(){function t(t,e){this.container=t,this.file=t.file,this.containerPosition=e}return t.prototype.getHeader=function(){return n(this,void 0,void 0,(function(){var t,e,r;return i(this,(function(n){switch(n.label){case 0:return[4,this.file.getSectionParsers()];case 1:return t=n.sent(),[4,this.container.getHeader()];case 2:return e=n.sent(),[4,this.file.readBlock(e._endPosition+this.containerPosition)];case 3:if("MAPPED_SLICE_HEADER"===(r=n.sent()).contentType)r.content=(0,s.parseItem)(r.content,t.cramMappedSliceHeader.parser,0,e._endPosition);else{if("UNMAPPED_SLICE_HEADER"!==r.contentType)throw new a.CramMalformedError("error reading slice header block, invalid content type ".concat(r._contentType));r.content=(0,s.parseItem)(r.content,t.cramUnmappedSliceHeader.parser,0,e._endPosition)}return[2,r]}}))}))},t.prototype.getBlocks=function(){return n(this,void 0,void 0,(function(){var t,e,r,n,o,a;return i(this,(function(i){switch(i.label){case 0:return[4,this.getHeader()];case 1:t=i.sent(),e=t._endPosition,r=new Array(t.content.numBlocks),n=0,i.label=2;case 2:return n<r.length?(o=r,a=n,[4,this.file.readBlock(e)]):[3,5];case 3:o[a]=i.sent(),e=r[n]._endPosition,i.label=4;case 4:return n+=1,[3,2];case 5:return[2,r]}}))}))},t.prototype.getCoreDataBlock=function(){return n(this,void 0,void 0,(function(){return i(this,(function(t){switch(t.label){case 0:return[4,this.getBlocks()];case 1:return[2,t.sent()[0]]}}))}))},t.prototype._getBlocksContentIdIndex=function(){return n(this,void 0,void 0,(function(){var t,e;return i(this,(function(r){switch(r.label){case 0:return[4,this.getBlocks()];case 1:return t=r.sent(),e={},t.forEach((function(t){"EXTERNAL_DATA"===t.contentType&&(e[t.contentId]=t)})),[2,e]}}))}))},t.prototype.getBlockByContentId=function(t){return n(this,void 0,void 0,(function(){return i(this,(function(e){switch(e.label){case 0:return[4,this._getBlocksContentIdIndex()];case 1:return[2,e.sent()[t]]}}))}))},t.prototype.getReferenceRegion=function(){return n(this,void 0,void 0,(function(){var t,e,r,n;return i(this,(function(i){switch(i.label){case 0:return[4,this.getHeader()];case 1:return(t=i.sent().content).refSeqId<0?[2,void 0]:[4,this.container.getCompressionScheme()];case 2:if(e=i.sent(),t.refBaseBlockId>=0){if(!(r=this.getBlockByContentId(t.refBaseBlockId)))throw new a.CramMalformedError("embedded reference specified, but reference block does not exist");if(t.span>r.uncompressedSize)throw new a.CramMalformedError("Embedded reference is too small");return[2,{seq:r.data.toString("utf8"),start:t.refSeqStart,end:t.refSeqStart+t.refSeqSpan-1,span:t.refSeqSpan}]}if(!e.referenceRequired&&!this.file.fetchReferenceSequenceCallback)return[3,4];if(!this.file.fetchReferenceSequenceCallback)throw new Error("reference sequence not embedded, and seqFetch callback not provided, cannot fetch reference sequence");return[4,this.file.fetchReferenceSequenceCallback(t.refSeqId,t.refSeqStart,t.refSeqStart+t.refSeqSpan-1)];case 3:if((n=i.sent()).length!==t.refSeqSpan)throw new a.CramArgumentError("seqFetch callback returned a reference sequence of the wrong length");return[2,{seq:n,start:t.refSeqStart,end:t.refSeqStart+t.refSeqSpan-1,span:t.refSeqSpan}];case 4:return[2,void 0]}}))}))},t.prototype.getAllRecords=function(){return this.getRecords((function(){return!0}))},t.prototype._fetchRecords=function(){return n(this,void 0,void 0,(function(){var t,e,r,n,o,f,h,l,d,p,g,y,v,m,b,_,w=this;return i(this,(function(i){switch(i.label){case 0:return[4,this.file.getDefinition()];case 1:return t=i.sent().majorVersion,[4,this.container.getCompressionScheme()];case 2:return e=i.sent(),[4,this.getHeader()];case 3:return r=i.sent(),[4,this._getBlocksContentIdIndex()];case 4:return n=i.sent(),t>1&&this.file.options.checkSequenceMD5&&r.content.refSeqId>=0&&"0000000000000000"!==r.content.md5.join("")?[4,this.getReferenceRegion()]:[3,6];case 5:if((o=i.sent())&&(f=o.seq,h=o.start,l=o.end,d=(0,s.sequenceMD5)(f),p=r.content.md5.map((function(t){return(t<16?"0":"")+t.toString(16)})).join(""),d!==p))throw new a.CramMalformedError("MD5 checksum reference mismatch for ref ".concat(r.content.refSeqId," pos ").concat(h,"..").concat(l,". recorded MD5: ").concat(p,", calculated MD5: ").concat(d));i.label=6;case 6:return[4,this.getCoreDataBlock()];case 7:for(g=i.sent(),y={lastAlignmentStart:r.content.refSeqStart||0,coreBlock:{bitPosition:7,bytePosition:0},externalBlocks:{map:new Map,getCursor:function(t){var e=this.map.get(t);return void 0===e&&(e={bitPosition:7,bytePosition:0},this.map.set(t,e)),e}}},v=function(t){var r=e.getCodecForDataSeries(t);if(!r)throw new a.CramMalformedError("no codec defined for ".concat(t," data series"));return r.decode(w,g,n,y)},m=new Array(r.content.numRecords),b=0;b<m.length;b+=1)try{m[b]=(0,u.default)(this,v,e,r,g,n,y,t,b),m[b].uniqueId=r.contentPosition+r.content.recordCounter+b+1}catch(t){if(t instanceof a.CramBufferOverrunError){console.warn("read attempted beyond end of buffer, file seems truncated."),m=m.filter((function(t){return!!t}));break}throw t}for(b=0;b<m.length;b+=1)(_=m[b].mateRecordNumber)>=0&&c(m,b,m[b],m[_]);return[2,m]}}))}))},t.prototype.getRecords=function(t){return n(this,void 0,void 0,(function(){var e,r,o,a,s,f,u,c,h,l,d,p=this;return i(this,(function(g){switch(g.label){case 0:return e=this.container.filePosition+this.containerPosition,(r=this.file.featureCache.get(e))||(r=this._fetchRecords(),this.file.featureCache.set(e,r)),[4,r];case 1:return(o=g.sent().filter(t)).length&&this.file.fetchReferenceSequenceCallback?[4,this.getHeader()]:[3,5];case 2:return(a=g.sent()).content.refSeqId>=0||-2===a.content.refSeqId?(s=a.content.refSeqId>=0?a.content.refSeqId:void 0,[4,this.container.getCompressionScheme()]):[3,5];case 3:for(f=g.sent(),u={},h=0;h<o.length;h+=1)l=void 0!==s?s:o[h].sequenceId,(d=u[l])||(d={id:l,start:o[h].alignmentStart,end:-1/0},u[l]=d),(c=o[h].alignmentStart+(o[h].lengthOnRef||o[h].readLength)-1)>d.end&&(d.end=c),o[h].alignmentStart<d.start&&(d.start=o[h].alignmentStart);return[4,Promise.all(Object.values(u).map((function(t){return n(p,void 0,void 0,(function(){var e;return i(this,(function(r){switch(r.label){case 0:return-1!==t.id&&t.start<=t.end?(e=t,[4,this.file.fetchReferenceSequenceCallback(t.id,t.start,t.end)]):[3,2];case 1:e.seq=r.sent(),r.label=2;case 2:return[2]}}))}))})))];case 4:for(g.sent(),h=0;h<o.length;h+=1)l=void 0!==s?s:o[h].sequenceId,(d=u[l])&&d.seq&&o[h].addReferenceSequence(d,f);g.label=5;case 5:return[2,o]}}))}))},t}();e.default=h,"getHeader getBlocks _getBlocksContentIdIndex".split(" ").forEach((function(t){return(0,s.tinyMemoize)(h,t)}))},function(t,e,r){"use strict";var n=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var i=n(r(23)),o=r(0),a=n(r(66)),s=n(r(12));function f(t){for(var e="",r=0;r<t.length&&0!==t[r];r++)e+=String.fromCharCode(t[r]);return e}function u(t,e){if("Z"===t)return f(e);if("A"===t)return String.fromCharCode(e[0]);if("I"===t)return i.default.fromBytesLE(e).toNumber();if("i"===t)return new Int32Array(e.buffer)[0];if("s"===t)return new Int16Array(e.buffer)[0];if("S"===t)return new Uint16Array(e.buffer)[0];if("c"===t)return new Int8Array(e.buffer)[0];if("C"===t)return e[0];if("f"===t)return new Float32Array(e.buffer)[0];if("H"===t)return Number.parseInt(f(e).replace(/^0x/,""),16);if("B"===t)return function(t){var e=String.fromCharCode(t[0]),r=Int32Array.from(t.slice(1))[0],n=new Array(r);if(t=t.slice(5),"c"===e)for(var i=new Int8Array(t.buffer),o=0;o<r;o+=1)n[o]=i[o];else if("C"===e)for(i=new Uint8Array(t.buffer),o=0;o<r;o+=1)n[o]=i[o];else if("s"===e)for(i=new Int16Array(t.buffer),o=0;o<r;o+=1)n[o]=i[o];else if("S"===e)for(i=new Uint16Array(t.buffer),o=0;o<r;o+=1)n[o]=i[o];else if("i"===e)for(i=new Int32Array(t.buffer),o=0;o<r;o+=1)n[o]=i[o];else if("I"===e)for(i=new Uint32Array(t.buffer),o=0;o<r;o+=1)n[o]=i[o];else{if("f"!==e)throw new Error("unknown type: "+e);for(i=new Float32Array(t.buffer),o=0;o<r;o+=1)n[o]=i[o]}return n}(e);throw new o.CramMalformedError("Unrecognized tag type ".concat(t))}e.default=function(t,e,r,n,i,c,h,l,d){var p=new a.default;if(p.flags=e("BF"),p.cramFlags=e("CF"),l>1&&-2===n.content.refSeqId?p.sequenceId=e("RI"):p.sequenceId=n.content.refSeqId,p.readLength=e("RL"),p.alignmentStart=e("AP"),r.APdelta&&(p.alignmentStart+=h.lastAlignmentStart),h.lastAlignmentStart=p.alignmentStart,p.readGroupId=e("RG"),r.readNamesIncluded&&(p.readName=f(e("RN"))),p.isDetached()){var g={};g.flags=e("MF"),r.readNamesIncluded||(g.readName=f(e("RN")),p.readName=g.readName),g.sequenceId=e("NS"),g.alignmentStart=e("NP"),(g.flags||g.sequenceId>-1)&&(p.mate=g),p.templateSize=e("TS"),g.flags&s.default.CRAM_M_UNMAP&&(p.flags|=s.default.BAM_FMUNMAP),g.flags&s.default.CRAM_M_REVERSE&&(p.flags|=s.default.BAM_FMREVERSE)}else p.hasMateDownStream()&&(p.mateRecordNumber=e("NF")+d+1);var y=e("TL");if(y<0)throw new o.CramMalformedError("invalid TL index");for(var v=r.getTagNames(y),m=v.length,b=0;b<m;b+=1){var _=v[b],w=_.substr(0,2),A=_.substr(2,1),S=r.getCodecForTag(_);if(!S)throw new o.CramMalformedError("no codec defined for auxiliary tag ".concat(_));var E=S.decode(t,i,c,h);p.tags[w]=u(A,E)}if(p.isSegmentUnmapped())if(p.isUnknownBases())p.readBases=null,p.qualityScores=null;else{for(k=new Array(p.readLength),b=0;b<k.length;b+=1)k[b]=e("BA");if(p.readBases=String.fromCharCode.apply(String,k),p.isPreservingQualityScores()){for(b=0;b<k.length;b+=1)k[b]=e("QS");p.qualityScores=k}}else{var C=e("FN");C&&(p.readFeatures=function(t,e,r,n,i){var a=0,s=t.alignmentStart-1,f=new Array(e);function u(t){var e=t[0],n=t[1],i=r(n);return"character"===e?String.fromCharCode(i):"string"===e?i.toString("utf8"):"numArray"===e?i.toArray():i}for(var c=0;c<e;c+=1){var h=String.fromCharCode(r("FC")),l=r("FP"),d={code:h},p={B:["character","BA"],S:["string",i>1?"SC":"IN"],X:["number","BS"],D:["number","DL"],I:["string","IN"],i:["character","BA"],b:["string","BB"],q:["numArray","QQ"],Q:["number","QS"],H:["number","HC"],P:["number","PD"],N:["number","RS"]}[h];if(!p)throw new o.CramMalformedError('invalid read feature code "'.concat(h,'"'));d.data=u(p);var g={B:["number","QS"]}[h];g&&(d.data=[d.data,u(g)]),a+=l,d.pos=a,s+=l,d.refPos=s,"D"===h||"N"===h?s+=d.data:"I"===h||"S"===h?s-=d.data.length:"i"===h&&(s-=1),f[c]=d}return f}(p,C,e,0,l));var B=p.readLength;if(p.readFeatures&&p.readFeatures.forEach((function(t){var e=t.code,r=t.data;"D"===e||"N"===e?B+=r:"I"===e||"S"===e?B-=r.length:"i"===e&&(B-=1)})),Number.isNaN(B)&&(console.warn("".concat(p.readName||"".concat(p.sequenceId,":").concat(p.alignmentStart)," record has invalid read features")),B=p.readLength),p.lengthOnRef=B,p.mappingQuality=e("MQ"),p.isPreservingQualityScores()){for(var k=new Array(p.readLength),b=0;b<k.length;b+=1)k[b]=e("QS");p.qualityScores=k}}return p}},function(t,e,r){"use strict";var n=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var i=n(r(12));var o={a:0,A:0,c:1,C:1,g:2,G:2,t:3,T:3,n:4,N:4};var a=function(){function t(){this.tags={}}return t.prototype.isPaired=function(){return!!(this.flags&i.default.BAM_FPAIRED)},t.prototype.isProperlyPaired=function(){return!!(this.flags&i.default.BAM_FPROPER_PAIR)},t.prototype.isSegmentUnmapped=function(){return!!(this.flags&i.default.BAM_FUNMAP)},t.prototype.isMateUnmapped=function(){return!!(this.flags&i.default.BAM_FMUNMAP)},t.prototype.isReverseComplemented=function(){return!!(this.flags&i.default.BAM_FREVERSE)},t.prototype.isMateReverseComplemented=function(){return!!(this.flags&i.default.BAM_FMREVERSE)},t.prototype.isRead1=function(){return!!(this.flags&i.default.BAM_FREAD1)},t.prototype.isRead2=function(){return!!(this.flags&i.default.BAM_FREAD2)},t.prototype.isSecondary=function(){return!!(this.flags&i.default.BAM_FSECONDARY)},t.prototype.isFailedQc=function(){return!!(this.flags&i.default.BAM_FQCFAIL)},t.prototype.isDuplicate=function(){return!!(this.flags&i.default.BAM_FDUP)},t.prototype.isSupplementary=function(){return!!(this.flags&i.default.BAM_FSUPPLEMENTARY)},t.prototype.isDetached=function(){return!!(this.cramFlags&i.default.CRAM_FLAG_DETACHED)},t.prototype.hasMateDownStream=function(){return!!(this.cramFlags&i.default.CRAM_FLAG_MATE_DOWNSTREAM)},t.prototype.isPreservingQualityScores=function(){return!!(this.cramFlags&i.default.CRAM_FLAG_PRESERVE_QUAL_SCORES)},t.prototype.isUnknownBases=function(){return!!(this.cramFlags&i.default.CRAM_FLAG_NO_SEQ)},t.prototype.getReadBases=function(){return!this.readBases&&this._refRegion&&(this.readBases=function(t,e){if((t.lengthOnRef||t.readLength)&&!t.isUnknownBases()){var r=t.alignmentStart-e.start;if(!t.readFeatures)return e.seq.substr(r,t.lengthOnRef).toUpperCase();for(var n="",i=r,o=0;n.length<t.readLength;)if(o<t.readFeatures.length){var a=t.readFeatures[o];if("Q"===a.code||"q"===a.code)o+=1;else if(a.pos===n.length+1)if(o+=1,"b"===a.code){var s=a.data.split(","),f=String.fromCharCode.apply(String,s);n+=f,i+=f.length}else"B"===a.code?(n+=a.data[0],i+=1):"X"===a.code?(n+=a.sub,i+=1):"I"===a.code?n+=a.data:"D"===a.code?i+=a.data:"i"===a.code?n+=a.data:"N"===a.code?i+=a.data:"S"===a.code?n+=a.data:"P"===a.code||a.code;else if(o<t.readFeatures.length){n+=u=e.seq.substr(i,t.readFeatures[o].pos-n.length-1),i+=u.length}}else{var u;n+=u=e.seq.substr(i,t.readLength-n.length),i+=u.length}return n.toUpperCase()}}(this,this._refRegion)),this.readBases},t.prototype.getPairOrientation=function(){if(!this.isSegmentUnmapped()&&this.isPaired()&&!this.isMateUnmapped()&&this.mate&&this.sequenceId===this.mate.sequenceId){var t=this.isReverseComplemented()?"R":"F",e=this.isMateReverseComplemented()?"R":"F",r=" ",n=" ";this.isRead1()?(r="1",n="2"):this.isRead2()&&(r="2",n="1");var i=[],o=this.templateLength||this.templateSize;return this.alignmentStart>this.mate.alignmentStart&&o>0&&(o=-o),o>0?(i[0]=t,i[1]=r,i[2]=e,i[3]=n):(i[2]=t,i[3]=r,i[0]=e,i[1]=n),i.join("")}return null},t.prototype.addReferenceSequence=function(t,e){this.readFeatures&&this.readFeatures.forEach((function(r){"X"===r.code&&function(t,e,r,n){if(e){var i=n.refPos-e.start,a=e.seq.charAt(i);a&&(n.ref=a);var s=o[a];void 0===s&&(s=4);var f=r.substitutionMatrix[s][n.data];f&&(n.sub=f)}}(0,t,e,r)})),!this.readBases&&t.start<=this.alignmentStart&&t.end>=this.alignmentStart+(this.lengthOnRef||this.readLength)-1&&(this._refRegion=t)},t.prototype.toJSON=function(){var t=this,e={};return Object.keys(this).forEach((function(r){"_"!==r.charAt(0)&&(e[r]=t[r])})),e.readBases=this.getReadBases(),e},t}();e.default=a},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=r(0),i=r(68),o={BF:"int",CF:"int",RI:"int",RL:"int",AP:"int",RG:"int",MF:"int",NS:"int",NP:"int",TS:"int",NF:"int",TC:"byte",TN:"int",FN:"int",FC:"byte",FP:"int",BS:"byte",IN:"byteArray",SC:"byteArray",DL:"int",BA:"byte",BB:"byteArray",RS:"int",PD:"int",HC:"int",MQ:"int",RN:"byteArray",QS:"byte",QQ:"byteArray",TL:"int",TM:"ignore",TV:"ignore"};var a=function(){function t(t){Object.assign(this,t),this.readNamesIncluded=t.preservation.RN,this.APdelta=t.preservation.AP,this.referenceRequired=!!t.preservation.RR,this.tagIdsDictionary=t.preservation.TD,this.substitutionMatrix=function(t){for(var e=new Array(5),r=0;r<5;r+=1)e[r]=new Array(4);return e[0][t[0]>>6&3]="C",e[0][t[0]>>4&3]="G",e[0][t[0]>>2&3]="T",e[0][t[0]>>0&3]="N",e[1][t[1]>>6&3]="A",e[1][t[1]>>4&3]="G",e[1][t[1]>>2&3]="T",e[1][t[1]>>0&3]="N",e[2][t[2]>>6&3]="A",e[2][t[2]>>4&3]="C",e[2][t[2]>>2&3]="T",e[2][t[2]>>0&3]="N",e[3][t[3]>>6&3]="A",e[3][t[3]>>4&3]="C",e[3][t[3]>>2&3]="G",e[3][t[3]>>0&3]="N",e[4][t[4]>>6&3]="A",e[4][t[4]>>4&3]="C",e[4][t[4]>>2&3]="G",e[4][t[4]>>0&3]="T",e}(t.preservation.SM),this.dataSeriesCodecCache=new Map,this.tagCodecCache={}}return t.prototype.getCodecForTag=function(t){if(!this.tagCodecCache[t]){var e=this.tagEncoding[t];e&&(this.tagCodecCache[t]=(0,i.instantiateCodec)(e,"byteArray"))}return this.tagCodecCache[t]},t.prototype.getTagNames=function(t){return this.tagIdsDictionary[t]},t.prototype.getCodecForDataSeries=function(t){var e=this.dataSeriesCodecCache.get(t);if(void 0===e){var r=this.dataSeriesEncoding[t];if(r){var a=o[t];if(!a)throw new n.CramMalformedError("data series name ".concat(t," not defined in file compression header"));e=(0,i.instantiateCodec)(r,a),this.dataSeriesCodecCache.set(t,e)}}return e},t.prototype.toJSON=function(){var t=this,e={};return Object.keys(this).forEach((function(r){/Cache$/.test(r)||(e[r]=t[r])})),e},t}();e.default=a},function(t,e,r){"use strict";var n=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.instantiateCodec=e.getCodecClassWithId=void 0;var i=r(0),o=n(r(69)),a=n(r(70)),s=n(r(71)),f=n(r(72)),u=n(r(73)),c=n(r(74)),h=n(r(75)),l={1:a.default,3:o.default,4:f.default,5:s.default,6:u.default,7:h.default,9:c.default};function d(t){return l[t]}e.getCodecClassWithId=d,e.instantiateCodec=function t(e,r){var n=d("ignore"===r?0:e.codecId);if(!n)throw new i.CramUnimplementedError("no codec implemented for codec ID ".concat(e.codecId));return new n(e.parameters,r,t)}},function(t,e,r){"use strict";var n,i=this&&this.__extends||(n=function(t,e){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function r(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}),o=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var a=r(0);var s=function(t){function e(e,r){void 0===e&&(e={});var n=t.call(this,e,r)||this;if(!["byte","int"].includes(n.dataType))throw new TypeError("".concat(n.dataType," decoding not yet implemented by HUFFMAN_INT codec"));return n.buildCodeBook(),n.buildCodes(),n.buildCaches(),0===n.sortedCodes[0].bitLength&&(n._decode=n._decodeZeroLengthCode),n}return i(e,t),e.prototype.buildCodeBook=function(){for(var t=this,e=new Array(this.parameters.numCodes),r=0;r<this.parameters.numCodes;r+=1)e[r]={symbol:this.parameters.symbols[r],bitLength:this.parameters.bitLengths[r]};e=e.sort((function(t,e){return t.bitLength-e.bitLength||t.symbol-e.symbol})),this.codeBook={},e.forEach((function(e){t.codeBook[e.bitLength]||(t.codeBook[e.bitLength]=[]),t.codeBook[e.bitLength].push(e.symbol)}))},e.prototype.buildCodes=function(){var t=this;this.codes={};var e=0,r=-1;Object.entries(this.codeBook).forEach((function(n){var i=n[0],o=n[1];i=parseInt(i,10),o.forEach((function(n){var o={bitLength:i,value:n};r+=1;var s,f,u=i-e;if(r<<=u,o.bitCode=r,e+=u,16843009*((f=(858993459&(f=(s=r)-(s>>1)&1431655765))+(f>>2&858993459))+(f>>4)&252645135)>>24>i)throw new a.CramMalformedError("Symbol out of range");t.codes[n]=o}))}))},e.prototype.buildCaches=function(){this.sortedCodes=Object.values(this.codes).sort((function(t,e){return t.bitLength-e.bitLength||t.bitCode-e.bitCode})),this.sortedByValue=Object.values(this.codes).sort((function(t,e){return t.value-e.value})),this.sortedValuesByBitCode=this.sortedCodes.map((function(t){return t.value})),this.sortedBitCodes=this.sortedCodes.map((function(t){return t.bitCode})),this.sortedBitLengthsByBitCode=this.sortedCodes.map((function(t){return t.bitLength}));var t=Math.max.apply(Math,this.sortedBitCodes);this.bitCodeToValue=new Array(t+1).fill(-1);for(var e=0;e<this.sortedBitCodes.length;e+=1)this.bitCodeToValue[this.sortedCodes[e].bitCode]=e},e.prototype.decode=function(t,e,r,n){return this._decode(t,e,n.coreBlock)},e.prototype._decodeZeroLengthCode=function(){return this.sortedCodes[0].value},e.prototype._decode=function(t,e,r){for(var n=e.content,i=0,o=0,s=0;s<this.sortedCodes.length;s+=1){var f=this.sortedCodes[s].bitLength;o<<=f-i,o|=this._getBits(n,r,f-i),i=f;var u=this.bitCodeToValue[o];if(u>-1&&this.sortedBitLengthsByBitCode[u]===f)return this.sortedValuesByBitCode[u];for(var c=s;this.sortedCodes[c+1].bitLength===f&&c<this.sortedCodes.length;c+=1)s+=1}throw new a.CramMalformedError("Huffman symbol not found.")},e}(o(r(3)).default);e.default=s},function(t,e,r){"use strict";var n,i=this&&this.__extends||(n=function(t,e){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function r(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}),o=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var a=r(0),s=o(r(3)),f=r(5),u=function(t){function e(e,r){void 0===e&&(e={});var n=t.call(this,e,r)||this;if("int"===n.dataType)n._decodeData=n._decodeInt;else{if("byte"!==n.dataType)throw new a.CramUnimplementedError("".concat(n.dataType," decoding not yet implemented by EXTERNAL codec"));n._decodeData=n._decodeByte}return n}return i(e,t),e.prototype.decode=function(t,e,r,n){var i=this.parameters.blockContentId,o=r[i];if(!o)throw new a.CramMalformedError("no block found with content ID ".concat(i));var s=n.externalBlocks.getCursor(i);return this._decodeData(o,s)},e.prototype._decodeInt=function(t,e){var r=(0,f.parseItf8)(t.content,e.bytePosition),n=r[0],i=r[1];return e.bytePosition+=i,n},e.prototype._decodeByte=function(t,e){if(e.bytePosition>=t.content.length)throw new a.CramBufferOverrunError("attempted to read beyond end of block. this file seems truncated.");return t.content[e.bytePosition++]},e}(s.default);e.default=u},function(t,e,r){"use strict";var n,i=this&&this.__extends||(n=function(t,e){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function r(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}),o=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var a=r(0),s=function(t){function e(e,r){void 0===e&&(e={});var n=t.call(this,e,r)||this;if("byteArray"!==r)throw new TypeError("byteArrayStop codec does not support data type ".concat(r));return n._decode=n._decodeByteArray,n}return i(e,t),e.prototype.decode=function(t,e,r,n){var i=this.parameters.blockContentId,o=r[i];if(!o)throw new a.CramMalformedError("no block found with content ID ".concat(i));var s=n.externalBlocks.getCursor(i);return this._decode(o,s)},e.prototype._decodeByteArray=function(t,e){for(var r=t.content,n=this.parameters.stopByte,i=e.bytePosition,o=e.bytePosition;r[o]!==n&&o<r.length;){if(o===r.length)throw new a.CramBufferOverrunError("byteArrayStop reading beyond length of data buffer?");o+=1}return e.bytePosition=o+1,r.slice(i,o)},e}(o(r(3)).default);e.default=s},function(t,e,r){"use strict";var n,i=this&&this.__extends||(n=function(t,e){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function r(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}),o=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var a=r(5),s=function(t){function e(e,r,n){void 0===e&&(e={});var i=t.call(this,e,r)||this;if(i.instantiateCodec=n,"byteArray"!==r)throw new TypeError("byteArrayLength does not support data type ".concat(r));return i}return i(e,t),e.prototype.decode=function(t,e,r,n){for(var i=this._getLengthCodec().decode(t,e,r,n),o=this._getDataCodec(),a=new Uint8Array(i),s=0;s<i;s+=1)a[s]=o.decode(t,e,r,n);return a},e.prototype._getLengthCodec=function(){var t=this.parameters.lengthsEncoding;return this.instantiateCodec(t,"int")},e.prototype._getDataCodec=function(){var t=this.parameters.valuesEncoding;return this.instantiateCodec(t,"byte")},e}(o(r(3)).default);e.default=s,"_getLengthCodec _getDataCodec".split(" ").forEach((function(t){return(0,a.tinyMemoize)(s,t)}))},function(t,e,r){"use strict";var n,i=this&&this.__extends||(n=function(t,e){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function r(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}),o=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var a=r(0),s=function(t){function e(e,r){void 0===e&&(e={});var n=t.call(this,e,r)||this;if("int"!==n.dataType)throw new a.CramUnimplementedError("".concat(n.dataType," decoding not yet implemented by BETA codec"));return n}return i(e,t),e.prototype.decode=function(t,e,r,n){return this._getBits(e.content,n.coreBlock,this.parameters.length)-this.parameters.offset},e}(o(r(3)).default);e.default=s},function(t,e,r){"use strict";var n,i=this&&this.__extends||(n=function(t,e){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function r(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}),o=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var a=r(0),s=function(t){function e(e,r){void 0===e&&(e={});var n=t.call(this,e,r)||this;if("int"!==n.dataType)throw new a.CramUnimplementedError("".concat(n.dataType," decoding not yet implemented by GAMMA codec"));return n}return i(e,t),e.prototype.decode=function(t,e,r,n){for(var i=1;0===this._getBits(e.content,n.coreBlock,1);)i+=1;return(this._getBits(e.content,n.coreBlock,i-1)|1<<i-1)-this.parameters.offset},e}(o(r(3)).default);e.default=s},function(t,e,r){"use strict";var n,i=this&&this.__extends||(n=function(t,e){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function r(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}),o=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var a=r(0),s=function(t){function e(e,r){void 0===e&&(e={});var n=t.call(this,e,r)||this;if("int"!==n.dataType)throw new a.CramUnimplementedError("".concat(n.dataType," decoding not yet implemented by SUBEXP codec"));return n}return i(e,t),e.prototype.decode=function(t,e,r,n){for(var i,o,a=0;this._getBits(e.content,n.coreBlock,1);)a+=1;return 0===a?(i=this.parameters.K,o=this._getBits(e.content,n.coreBlock,i)):o=1<<(i=a+this.parameters.K-1)|this._getBits(e.content,n.coreBlock,i),o-this.parameters.offset},e}(o(r(3)).default);e.default=s},function(t,e,r){"use strict";var n=r(77),i=r(79);function o(){this.protocol=null,this.slashes=null,this.auth=null,this.host=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.query=null,this.pathname=null,this.path=null,this.href=null}e.parse=b,e.resolve=function(t,e){return b(t,!1,!0).resolve(e)},e.resolveObject=function(t,e){return t?b(t,!1,!0).resolveObject(e):e},e.format=function(t){i.isString(t)&&(t=b(t));return t instanceof o?t.format():o.prototype.format.call(t)},e.Url=o;var a=/^([a-z0-9.+-]+:)/i,s=/:[0-9]*$/,f=/^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,u=["{","}","|","\\","^","`"].concat(["<",">",'"',"`"," ","\r","\n","\t"]),c=["'"].concat(u),h=["%","/","?",";","#"].concat(c),l=["/","?","#"],d=/^[+a-z0-9A-Z_-]{0,63}$/,p=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,g={javascript:!0,"javascript:":!0},y={javascript:!0,"javascript:":!0},v={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0},m=r(80);function b(t,e,r){if(t&&i.isObject(t)&&t instanceof o)return t;var n=new o;return n.parse(t,e,r),n}o.prototype.parse=function(t,e,r){if(!i.isString(t))throw new TypeError("Parameter 'url' must be a string, not "+typeof t);var o=t.indexOf("?"),s=-1!==o&&o<t.indexOf("#")?"?":"#",u=t.split(s);u[0]=u[0].replace(/\\/g,"/");var b=t=u.join(s);if(b=b.trim(),!r&&1===t.split("#").length){var _=f.exec(b);if(_)return this.path=b,this.href=b,this.pathname=_[1],_[2]?(this.search=_[2],this.query=e?m.parse(this.search.substr(1)):this.search.substr(1)):e&&(this.search="",this.query={}),this}var w=a.exec(b);if(w){var A=(w=w[0]).toLowerCase();this.protocol=A,b=b.substr(w.length)}if(r||w||b.match(/^\/\/[^@\/]+@[^@\/]+/)){var S="//"===b.substr(0,2);!S||w&&y[w]||(b=b.substr(2),this.slashes=!0)}if(!y[w]&&(S||w&&!v[w])){for(var E,C,B=-1,k=0;k<l.length;k++){-1!==(R=b.indexOf(l[k]))&&(-1===B||R<B)&&(B=R)}-1!==(C=-1===B?b.lastIndexOf("@"):b.lastIndexOf("@",B))&&(E=b.slice(0,C),b=b.slice(C+1),this.auth=decodeURIComponent(E)),B=-1;for(k=0;k<h.length;k++){var R;-1!==(R=b.indexOf(h[k]))&&(-1===B||R<B)&&(B=R)}-1===B&&(B=b.length),this.host=b.slice(0,B),b=b.slice(B),this.parseHost(),this.hostname=this.hostname||"";var x="["===this.hostname[0]&&"]"===this.hostname[this.hostname.length-1];if(!x)for(var M=this.hostname.split(/\./),T=(k=0,M.length);k<T;k++){var P=M[k];if(P&&!P.match(d)){for(var I="",O=0,F=P.length;O<F;O++)P.charCodeAt(O)>127?I+="x":I+=P[O];if(!I.match(d)){var U=M.slice(0,k),L=M.slice(k+1),N=P.match(p);N&&(U.push(N[1]),L.unshift(N[2])),L.length&&(b="/"+L.join(".")+b),this.hostname=U.join(".");break}}}this.hostname.length>255?this.hostname="":this.hostname=this.hostname.toLowerCase(),x||(this.hostname=n.toASCII(this.hostname));var z=this.port?":"+this.port:"",D=this.hostname||"";this.host=D+z,this.href+=this.host,x&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),"/"!==b[0]&&(b="/"+b))}if(!g[A])for(k=0,T=c.length;k<T;k++){var q=c[k];if(-1!==b.indexOf(q)){var j=encodeURIComponent(q);j===q&&(j=escape(q)),b=b.split(q).join(j)}}var H=b.indexOf("#");-1!==H&&(this.hash=b.substr(H),b=b.slice(0,H));var W=b.indexOf("?");if(-1!==W?(this.search=b.substr(W),this.query=b.substr(W+1),e&&(this.query=m.parse(this.query)),b=b.slice(0,W)):e&&(this.search="",this.query={}),b&&(this.pathname=b),v[A]&&this.hostname&&!this.pathname&&(this.pathname="/"),this.pathname||this.search){z=this.pathname||"";var V=this.search||"";this.path=z+V}return this.href=this.format(),this},o.prototype.format=function(){var t=this.auth||"";t&&(t=(t=encodeURIComponent(t)).replace(/%3A/i,":"),t+="@");var e=this.protocol||"",r=this.pathname||"",n=this.hash||"",o=!1,a="";this.host?o=t+this.host:this.hostname&&(o=t+(-1===this.hostname.indexOf(":")?this.hostname:"["+this.hostname+"]"),this.port&&(o+=":"+this.port)),this.query&&i.isObject(this.query)&&Object.keys(this.query).length&&(a=m.stringify(this.query));var s=this.search||a&&"?"+a||"";return e&&":"!==e.substr(-1)&&(e+=":"),this.slashes||(!e||v[e])&&!1!==o?(o="//"+(o||""),r&&"/"!==r.charAt(0)&&(r="/"+r)):o||(o=""),n&&"#"!==n.charAt(0)&&(n="#"+n),s&&"?"!==s.charAt(0)&&(s="?"+s),e+o+(r=r.replace(/[?#]/g,(function(t){return encodeURIComponent(t)})))+(s=s.replace("#","%23"))+n},o.prototype.resolve=function(t){return this.resolveObject(b(t,!1,!0)).format()},o.prototype.resolveObject=function(t){if(i.isString(t)){var e=new o;e.parse(t,!1,!0),t=e}for(var r=new o,n=Object.keys(this),a=0;a<n.length;a++){var s=n[a];r[s]=this[s]}if(r.hash=t.hash,""===t.href)return r.href=r.format(),r;if(t.slashes&&!t.protocol){for(var f=Object.keys(t),u=0;u<f.length;u++){var c=f[u];"protocol"!==c&&(r[c]=t[c])}return v[r.protocol]&&r.hostname&&!r.pathname&&(r.path=r.pathname="/"),r.href=r.format(),r}if(t.protocol&&t.protocol!==r.protocol){if(!v[t.protocol]){for(var h=Object.keys(t),l=0;l<h.length;l++){var d=h[l];r[d]=t[d]}return r.href=r.format(),r}if(r.protocol=t.protocol,t.host||y[t.protocol])r.pathname=t.pathname;else{for(var p=(t.pathname||"").split("/");p.length&&!(t.host=p.shift()););t.host||(t.host=""),t.hostname||(t.hostname=""),""!==p[0]&&p.unshift(""),p.length<2&&p.unshift(""),r.pathname=p.join("/")}if(r.search=t.search,r.query=t.query,r.host=t.host||"",r.auth=t.auth,r.hostname=t.hostname||t.host,r.port=t.port,r.pathname||r.search){var g=r.pathname||"",m=r.search||"";r.path=g+m}return r.slashes=r.slashes||t.slashes,r.href=r.format(),r}var b=r.pathname&&"/"===r.pathname.charAt(0),_=t.host||t.pathname&&"/"===t.pathname.charAt(0),w=_||b||r.host&&t.pathname,A=w,S=r.pathname&&r.pathname.split("/")||[],E=(p=t.pathname&&t.pathname.split("/")||[],r.protocol&&!v[r.protocol]);if(E&&(r.hostname="",r.port=null,r.host&&(""===S[0]?S[0]=r.host:S.unshift(r.host)),r.host="",t.protocol&&(t.hostname=null,t.port=null,t.host&&(""===p[0]?p[0]=t.host:p.unshift(t.host)),t.host=null),w=w&&(""===p[0]||""===S[0])),_)r.host=t.host||""===t.host?t.host:r.host,r.hostname=t.hostname||""===t.hostname?t.hostname:r.hostname,r.search=t.search,r.query=t.query,S=p;else if(p.length)S||(S=[]),S.pop(),S=S.concat(p),r.search=t.search,r.query=t.query;else if(!i.isNullOrUndefined(t.search)){if(E)r.hostname=r.host=S.shift(),(x=!!(r.host&&r.host.indexOf("@")>0)&&r.host.split("@"))&&(r.auth=x.shift(),r.host=r.hostname=x.shift());return r.search=t.search,r.query=t.query,i.isNull(r.pathname)&&i.isNull(r.search)||(r.path=(r.pathname?r.pathname:"")+(r.search?r.search:"")),r.href=r.format(),r}if(!S.length)return r.pathname=null,r.search?r.path="/"+r.search:r.path=null,r.href=r.format(),r;for(var C=S.slice(-1)[0],B=(r.host||t.host||S.length>1)&&("."===C||".."===C)||""===C,k=0,R=S.length;R>=0;R--)"."===(C=S[R])?S.splice(R,1):".."===C?(S.splice(R,1),k++):k&&(S.splice(R,1),k--);if(!w&&!A)for(;k--;k)S.unshift("..");!w||""===S[0]||S[0]&&"/"===S[0].charAt(0)||S.unshift(""),B&&"/"!==S.join("/").substr(-1)&&S.push("");var x,M=""===S[0]||S[0]&&"/"===S[0].charAt(0);E&&(r.hostname=r.host=M?"":S.length?S.shift():"",(x=!!(r.host&&r.host.indexOf("@")>0)&&r.host.split("@"))&&(r.auth=x.shift(),r.host=r.hostname=x.shift()));return(w=w||r.host&&S.length)&&!M&&S.unshift(""),S.length?r.pathname=S.join("/"):(r.pathname=null,r.path=null),i.isNull(r.pathname)&&i.isNull(r.search)||(r.path=(r.pathname?r.pathname:"")+(r.search?r.search:"")),r.auth=t.auth||r.auth,r.slashes=r.slashes||t.slashes,r.href=r.format(),r},o.prototype.parseHost=function(){var t=this.host,e=s.exec(t);e&&(":"!==(e=e[0])&&(this.port=e.substr(1)),t=t.substr(0,t.length-e.length)),t&&(this.hostname=t)}},function(t,e,r){(function(t,n){var i;/*! https://mths.be/punycode v1.3.2 by @mathias */!function(o){e&&e.nodeType,t&&t.nodeType;var a="object"==typeof n&&n;a.global!==a&&a.window!==a&&a.self;var s,f=2147483647,u=/^xn--/,c=/[^\x20-\x7E]/,h=/[\x2E\u3002\uFF0E\uFF61]/g,l={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},d=Math.floor,p=String.fromCharCode;function g(t){throw RangeError(l[t])}function y(t,e){for(var r=t.length,n=[];r--;)n[r]=e(t[r]);return n}function v(t,e){var r=t.split("@"),n="";return r.length>1&&(n=r[0]+"@",t=r[1]),n+y((t=t.replace(h,".")).split("."),e).join(".")}function m(t){for(var e,r,n=[],i=0,o=t.length;i<o;)(e=t.charCodeAt(i++))>=55296&&e<=56319&&i<o?56320==(64512&(r=t.charCodeAt(i++)))?n.push(((1023&e)<<10)+(1023&r)+65536):(n.push(e),i--):n.push(e);return n}function b(t){return y(t,(function(t){var e="";return t>65535&&(e+=p((t-=65536)>>>10&1023|55296),t=56320|1023&t),e+=p(t)})).join("")}function _(t,e){return t+22+75*(t<26)-((0!=e)<<5)}function w(t,e,r){var n=0;for(t=r?d(t/700):t>>1,t+=d(t/e);t>455;n+=36)t=d(t/35);return d(n+36*t/(t+38))}function A(t){var e,r,n,i,o,a,s,u,c,h,l,p=[],y=t.length,v=0,m=128,_=72;for((r=t.lastIndexOf("-"))<0&&(r=0),n=0;n<r;++n)t.charCodeAt(n)>=128&&g("not-basic"),p.push(t.charCodeAt(n));for(i=r>0?r+1:0;i<y;){for(o=v,a=1,s=36;i>=y&&g("invalid-input"),((u=(l=t.charCodeAt(i++))-48<10?l-22:l-65<26?l-65:l-97<26?l-97:36)>=36||u>d((f-v)/a))&&g("overflow"),v+=u*a,!(u<(c=s<=_?1:s>=_+26?26:s-_));s+=36)a>d(f/(h=36-c))&&g("overflow"),a*=h;_=w(v-o,e=p.length+1,0==o),d(v/e)>f-m&&g("overflow"),m+=d(v/e),v%=e,p.splice(v++,0,m)}return b(p)}function S(t){var e,r,n,i,o,a,s,u,c,h,l,y,v,b,A,S=[];for(y=(t=m(t)).length,e=128,r=0,o=72,a=0;a<y;++a)(l=t[a])<128&&S.push(p(l));for(n=i=S.length,i&&S.push("-");n<y;){for(s=f,a=0;a<y;++a)(l=t[a])>=e&&l<s&&(s=l);for(s-e>d((f-r)/(v=n+1))&&g("overflow"),r+=(s-e)*v,e=s,a=0;a<y;++a)if((l=t[a])<e&&++r>f&&g("overflow"),l==e){for(u=r,c=36;!(u<(h=c<=o?1:c>=o+26?26:c-o));c+=36)A=u-h,b=36-h,S.push(p(_(h+A%b,0))),u=d(A/b);S.push(p(_(u,0))),o=w(r,v,n==i),r=0,++n}++r,++e}return S.join("")}s={version:"1.3.2",ucs2:{decode:m,encode:b},decode:A,encode:S,toASCII:function(t){return v(t,(function(t){return c.test(t)?"xn--"+S(t):t}))},toUnicode:function(t){return v(t,(function(t){return u.test(t)?A(t.slice(4).toLowerCase()):t}))}},void 0===(i=function(){return s}.call(e,r,e,t))||(t.exports=i)}()}).call(this,r(78)(t),r(9))},function(t,e){t.exports=function(t){return t.webpackPolyfill||(t.deprecate=function(){},t.paths=[],t.children||(t.children=[]),Object.defineProperty(t,"loaded",{enumerable:!0,get:function(){return t.l}}),Object.defineProperty(t,"id",{enumerable:!0,get:function(){return t.i}}),t.webpackPolyfill=1),t}},function(t,e,r){"use strict";t.exports={isString:function(t){return"string"==typeof t},isObject:function(t){return"object"==typeof t&&null!==t},isNull:function(t){return null===t},isNullOrUndefined:function(t){return null==t}}},function(t,e,r){"use strict";e.decode=e.parse=r(81),e.encode=e.stringify=r(82)},function(t,e,r){"use strict";function n(t,e){return Object.prototype.hasOwnProperty.call(t,e)}t.exports=function(t,e,r,o){e=e||"&",r=r||"=";var a={};if("string"!=typeof t||0===t.length)return a;var s=/\+/g;t=t.split(e);var f=1e3;o&&"number"==typeof o.maxKeys&&(f=o.maxKeys);var u=t.length;f>0&&u>f&&(u=f);for(var c=0;c<u;++c){var h,l,d,p,g=t[c].replace(s,"%20"),y=g.indexOf(r);y>=0?(h=g.substr(0,y),l=g.substr(y+1)):(h=g,l=""),d=decodeURIComponent(h),p=decodeURIComponent(l),n(a,d)?i(a[d])?a[d].push(p):a[d]=[a[d],p]:a[d]=p}return a};var i=Array.isArray||function(t){return"[object Array]"===Object.prototype.toString.call(t)}},function(t,e,r){"use strict";var n=function(t){switch(typeof t){case"string":return t;case"boolean":return t?"true":"false";case"number":return isFinite(t)?t:"";default:return""}};t.exports=function(t,e,r,s){return e=e||"&",r=r||"=",null===t&&(t=void 0),"object"==typeof t?o(a(t),(function(a){var s=encodeURIComponent(n(a))+r;return i(t[a])?o(t[a],(function(t){return s+encodeURIComponent(n(t))})).join(e):s+encodeURIComponent(n(t[a]))})).join(e):s?encodeURIComponent(n(s))+r+encodeURIComponent(n(t)):""};var i=Array.isArray||function(t){return"[object Array]"===Object.prototype.toString.call(t)};function o(t,e){if(t.map)return t.map(e);for(var r=[],n=0;n<t.length;n++)r.push(e(t[n],n));return r}var a=Object.keys||function(t){var e=[];for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.push(r);return e}},function(t,e,r){"use strict";(function(t){var n=this&&this.__awaiter||function(t,e,r,n){return new(r||(r=Promise))((function(i,o){function a(t){try{f(n.next(t))}catch(t){o(t)}}function s(t){try{f(n.throw(t))}catch(t){o(t)}}function f(t){var e;t.done?i(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(a,s)}f((n=n.apply(t,e||[])).next())}))},i=this&&this.__generator||function(t,e){var r,n,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(r)throw new TypeError("Generator is already executing.");for(;a;)try{if(r=1,n&&(i=2&o[0]?n.return:o[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,o[1])).done)return i;switch(n=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,n=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!(i=a.trys,(i=i.length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){a.label=o[1];break}if(6===o[0]&&a.label<i[1]){a.label=i[1],i=o;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(o);break}i[2]&&a.ops.pop(),a.trys.pop();continue}o=e.call(t,a)}catch(t){o=[6,t],n=0}finally{r=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,s])}}},o=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var a=o(r(84)),s=o(r(85)),f=function(){function e(t){var e=this;this.position=0,this.url=t,this.cache=new s.default({fetch:function(t,r){return e._fetch(t,r)}})}return e.prototype._fetch=function(e,r){return n(this,void 0,void 0,(function(){var n,o,s,f,u,c;return i(this,(function(i){switch(i.label){case 0:return n={},r<1/0?n.range="bytes=".concat(e,"-").concat(e+r):r===1/0&&0!==e&&(n.range="bytes=".concat(e,"-")),[4,(0,a.default)(this.url,{method:"GET",headers:n,redirect:"follow",mode:"cors"})];case 1:return 200===(o=i.sent()).status&&0===e||206===o.status?(u=(f=t).from,[4,o.arrayBuffer()]):[3,3];case 2:return s=u.apply(f,[i.sent()]),(c=/\/(\d+)$/.exec(o.headers.get("content-range")))[1]&&(this._stat={size:parseInt(c[1],10)}),[2,s];case 3:throw new Error("HTTP ".concat(o.status," fetching ").concat(this.url))}}))}))},e.prototype.read=function(t,e,r,n){void 0===e&&(e=0),void 0===r&&(r=1/0),void 0===n&&(n=0);return null===n&&(this.position,this.position+=r),this.cache.get(t,e,r,n)},e.prototype.readFile=function(){return n(this,void 0,void 0,(function(){var e,r,n;return i(this,(function(i){switch(i.label){case 0:return[4,(0,a.default)(this.url,{method:"GET",redirect:"follow",mode:"cors"})];case 1:return e=i.sent(),n=(r=t).from,[4,e.arrayBuffer()];case 2:return[2,n.apply(r,[i.sent()])]}}))}))},e.prototype.stat=function(){return n(this,void 0,void 0,(function(){var e;return i(this,(function(r){switch(r.label){case 0:return this._stat?[3,2]:(e=t.allocUnsafe(10),[4,this.read(e,0,10,0)]);case 1:if(r.sent(),!this._stat)throw new Error("unable to determine size of file at ".concat(this.url));r.label=2;case 2:return[2,this._stat]}}))}))},e}();e.default=f}).call(this,r(1).Buffer)},function(t,e){var r="undefined"!=typeof self?self:this,n=function(){function t(){this.fetch=!1,this.DOMException=r.DOMException}return t.prototype=r,new t}();!function(t){!function(e){var r="URLSearchParams"in t,n="Symbol"in t&&"iterator"in Symbol,i="FileReader"in t&&"Blob"in t&&function(){try{return new Blob,!0}catch(t){return!1}}(),o="FormData"in t,a="ArrayBuffer"in t;if(a)var s=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],f=ArrayBuffer.isView||function(t){return t&&s.indexOf(Object.prototype.toString.call(t))>-1};function u(t){if("string"!=typeof t&&(t=String(t)),/[^a-z0-9\-#$%&'*+.^_`|~]/i.test(t))throw new TypeError("Invalid character in header field name");return t.toLowerCase()}function c(t){return"string"!=typeof t&&(t=String(t)),t}function h(t){var e={next:function(){var e=t.shift();return{done:void 0===e,value:e}}};return n&&(e[Symbol.iterator]=function(){return e}),e}function l(t){this.map={},t instanceof l?t.forEach((function(t,e){this.append(e,t)}),this):Array.isArray(t)?t.forEach((function(t){this.append(t[0],t[1])}),this):t&&Object.getOwnPropertyNames(t).forEach((function(e){this.append(e,t[e])}),this)}function d(t){if(t.bodyUsed)return Promise.reject(new TypeError("Already read"));t.bodyUsed=!0}function p(t){return new Promise((function(e,r){t.onload=function(){e(t.result)},t.onerror=function(){r(t.error)}}))}function g(t){var e=new FileReader,r=p(e);return e.readAsArrayBuffer(t),r}function y(t){if(t.slice)return t.slice(0);var e=new Uint8Array(t.byteLength);return e.set(new Uint8Array(t)),e.buffer}function v(){return this.bodyUsed=!1,this._initBody=function(t){var e;this._bodyInit=t,t?"string"==typeof t?this._bodyText=t:i&&Blob.prototype.isPrototypeOf(t)?this._bodyBlob=t:o&&FormData.prototype.isPrototypeOf(t)?this._bodyFormData=t:r&&URLSearchParams.prototype.isPrototypeOf(t)?this._bodyText=t.toString():a&&i&&((e=t)&&DataView.prototype.isPrototypeOf(e))?(this._bodyArrayBuffer=y(t.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):a&&(ArrayBuffer.prototype.isPrototypeOf(t)||f(t))?this._bodyArrayBuffer=y(t):this._bodyText=t=Object.prototype.toString.call(t):this._bodyText="",this.headers.get("content-type")||("string"==typeof t?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):r&&URLSearchParams.prototype.isPrototypeOf(t)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},i&&(this.blob=function(){var t=d(this);if(t)return t;if(this._bodyBlob)return Promise.resolve(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(new Blob([this._bodyArrayBuffer]));if(this._bodyFormData)throw new Error("could not read FormData body as blob");return Promise.resolve(new Blob([this._bodyText]))},this.arrayBuffer=function(){return this._bodyArrayBuffer?d(this)||Promise.resolve(this._bodyArrayBuffer):this.blob().then(g)}),this.text=function(){var t,e,r,n=d(this);if(n)return n;if(this._bodyBlob)return t=this._bodyBlob,e=new FileReader,r=p(e),e.readAsText(t),r;if(this._bodyArrayBuffer)return Promise.resolve(function(t){for(var e=new Uint8Array(t),r=new Array(e.length),n=0;n<e.length;n++)r[n]=String.fromCharCode(e[n]);return r.join("")}(this._bodyArrayBuffer));if(this._bodyFormData)throw new Error("could not read FormData body as text");return Promise.resolve(this._bodyText)},o&&(this.formData=function(){return this.text().then(_)}),this.json=function(){return this.text().then(JSON.parse)},this}l.prototype.append=function(t,e){t=u(t),e=c(e);var r=this.map[t];this.map[t]=r?r+", "+e:e},l.prototype.delete=function(t){delete this.map[u(t)]},l.prototype.get=function(t){return t=u(t),this.has(t)?this.map[t]:null},l.prototype.has=function(t){return this.map.hasOwnProperty(u(t))},l.prototype.set=function(t,e){this.map[u(t)]=c(e)},l.prototype.forEach=function(t,e){for(var r in this.map)this.map.hasOwnProperty(r)&&t.call(e,this.map[r],r,this)},l.prototype.keys=function(){var t=[];return this.forEach((function(e,r){t.push(r)})),h(t)},l.prototype.values=function(){var t=[];return this.forEach((function(e){t.push(e)})),h(t)},l.prototype.entries=function(){var t=[];return this.forEach((function(e,r){t.push([r,e])})),h(t)},n&&(l.prototype[Symbol.iterator]=l.prototype.entries);var m=["DELETE","GET","HEAD","OPTIONS","POST","PUT"];function b(t,e){var r,n,i=(e=e||{}).body;if(t instanceof b){if(t.bodyUsed)throw new TypeError("Already read");this.url=t.url,this.credentials=t.credentials,e.headers||(this.headers=new l(t.headers)),this.method=t.method,this.mode=t.mode,this.signal=t.signal,i||null==t._bodyInit||(i=t._bodyInit,t.bodyUsed=!0)}else this.url=String(t);if(this.credentials=e.credentials||this.credentials||"same-origin",!e.headers&&this.headers||(this.headers=new l(e.headers)),this.method=(r=e.method||this.method||"GET",n=r.toUpperCase(),m.indexOf(n)>-1?n:r),this.mode=e.mode||this.mode||null,this.signal=e.signal||this.signal,this.referrer=null,("GET"===this.method||"HEAD"===this.method)&&i)throw new TypeError("Body not allowed for GET or HEAD requests");this._initBody(i)}function _(t){var e=new FormData;return t.trim().split("&").forEach((function(t){if(t){var r=t.split("="),n=r.shift().replace(/\+/g," "),i=r.join("=").replace(/\+/g," ");e.append(decodeURIComponent(n),decodeURIComponent(i))}})),e}function w(t,e){e||(e={}),this.type="default",this.status=void 0===e.status?200:e.status,this.ok=this.status>=200&&this.status<300,this.statusText="statusText"in e?e.statusText:"OK",this.headers=new l(e.headers),this.url=e.url||"",this._initBody(t)}b.prototype.clone=function(){return new b(this,{body:this._bodyInit})},v.call(b.prototype),v.call(w.prototype),w.prototype.clone=function(){return new w(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new l(this.headers),url:this.url})},w.error=function(){var t=new w(null,{status:0,statusText:""});return t.type="error",t};var A=[301,302,303,307,308];w.redirect=function(t,e){if(-1===A.indexOf(e))throw new RangeError("Invalid status code");return new w(null,{status:e,headers:{location:t}})},e.DOMException=t.DOMException;try{new e.DOMException}catch(t){e.DOMException=function(t,e){this.message=t,this.name=e;var r=Error(t);this.stack=r.stack},e.DOMException.prototype=Object.create(Error.prototype),e.DOMException.prototype.constructor=e.DOMException}function S(t,r){return new Promise((function(n,o){var a=new b(t,r);if(a.signal&&a.signal.aborted)return o(new e.DOMException("Aborted","AbortError"));var s=new XMLHttpRequest;function f(){s.abort()}s.onload=function(){var t,e,r={status:s.status,statusText:s.statusText,headers:(t=s.getAllResponseHeaders()||"",e=new l,t.replace(/\r?\n[\t ]+/g," ").split(/\r?\n/).forEach((function(t){var r=t.split(":"),n=r.shift().trim();if(n){var i=r.join(":").trim();e.append(n,i)}})),e)};r.url="responseURL"in s?s.responseURL:r.headers.get("X-Request-URL");var i="response"in s?s.response:s.responseText;n(new w(i,r))},s.onerror=function(){o(new TypeError("Network request failed"))},s.ontimeout=function(){o(new TypeError("Network request failed"))},s.onabort=function(){o(new e.DOMException("Aborted","AbortError"))},s.open(a.method,a.url,!0),"include"===a.credentials?s.withCredentials=!0:"omit"===a.credentials&&(s.withCredentials=!1),"responseType"in s&&i&&(s.responseType="blob"),a.headers.forEach((function(t,e){s.setRequestHeader(e,t)})),a.signal&&(a.signal.addEventListener("abort",f),s.onreadystatechange=function(){4===s.readyState&&a.signal.removeEventListener("abort",f)}),s.send(void 0===a._bodyInit?null:a._bodyInit)}))}S.polyfill=!0,t.fetch||(t.fetch=S,t.Headers=l,t.Request=b,t.Response=w),e.Headers=l,e.Request=b,e.Response=w,e.fetch=S,Object.defineProperty(e,"__esModule",{value:!0})}({})}(n),n.fetch.ponyfill=!0,delete n.fetch.polyfill;var i=n;(e=i.fetch).default=i.fetch,e.fetch=i.fetch,e.Headers=i.Headers,e.Request=i.Request,e.Response=i.Response,t.exports=e},function(t,e,r){"use strict";var n=this&&this.__awaiter||function(t,e,r,n){return new(r||(r=Promise))((function(i,o){function a(t){try{f(n.next(t))}catch(t){o(t)}}function s(t){try{f(n.throw(t))}catch(t){o(t)}}function f(t){var e;t.done?i(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(a,s)}f((n=n.apply(t,e||[])).next())}))},i=this&&this.__generator||function(t,e){var r,n,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(r)throw new TypeError("Generator is already executing.");for(;a;)try{if(r=1,n&&(i=2&o[0]?n.return:o[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,o[1])).done)return i;switch(n=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,n=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!(i=a.trys,(i=i.length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){a.label=o[1];break}if(6===o[0]&&a.label<i[1]){a.label=i[1],i=o;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(o);break}i[2]&&a.ops.pop(),a.trys.pop();continue}o=e.call(t,a)}catch(t){o=[6,t],n=0}finally{r=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,s])}}},o=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var a=o(r(11)),s=function(){function t(t){var e=t.fetch,r=t.size,n=void 0===r?1e7:r,i=t.chunkSize,o=void 0===i?32768:i;if(!e)throw new Error("fetch function required");this.fetch=e,this.chunkSize=o,this.lruCache=new a.default({maxSize:Math.floor(n/o)})}return t.prototype.get=function(t,e,r,o){return n(this,void 0,void 0,(function(){var n,a,s,f,u,c,h,l,d=this;return i(this,(function(i){switch(i.label){case 0:if(t.length<e+r)throw new Error("output buffer not big enough for request");for(n=Math.floor(o/this.chunkSize),a=Math.floor((o+r)/this.chunkSize),s=new Array(a-n+1),f=function(t){s[t-n]=u._getChunk(t).then((function(e){return{data:e,chunkNumber:t}}))},u=this,c=n;c<=a;c+=1)f(c);return[4,Promise.all(s)];case 1:return h=i.sent(),l=o-h[0].chunkNumber*this.chunkSize,h.forEach((function(i){var s=i.data,f=i.chunkNumber,u=f*d.chunkSize,c=0,h=d.chunkSize,p=e+(f-n)*d.chunkSize-l;f===n&&(p=e,c=l),f===a&&(h=o+r-u),s.copy(t,p,c,h)})),[2]}}))}))},t.prototype._getChunk=function(t){var e=this.lruCache.get(t);if(e)return e;var r=this.fetch(t*this.chunkSize,this.chunkSize);return this.lruCache.set(t,r),r},t}();e.default=s},function(t,e){},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.parseHeaderText=void 0,e.parseHeaderText=function(t){var e=t.split(/\r?\n/),r=[];return e.forEach((function(t){var e=t.split(/\t/),n=e[0],i=e.slice(1).map((function(t){var e=t.split(":",2);return{tag:e[0],value:e[1]}}));n&&r.push({tag:n.substr(1),data:i})})),r}},function(t,e,r){"use strict";var n=this&&this.__awaiter||function(t,e,r,n){return new(r||(r=Promise))((function(i,o){function a(t){try{f(n.next(t))}catch(t){o(t)}}function s(t){try{f(n.throw(t))}catch(t){o(t)}}function f(t){var e;t.done?i(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(a,s)}f((n=n.apply(t,e||[])).next())}))},i=this&&this.__generator||function(t,e){var r,n,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(r)throw new TypeError("Generator is already executing.");for(;a;)try{if(r=1,n&&(i=2&o[0]?n.return:o[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,o[1])).done)return i;switch(n=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,n=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!(i=a.trys,(i=i.length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){a.label=o[1];break}if(6===o[0]&&a.label<i[1]){a.label=i[1],i=o;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(o);break}i[2]&&a.ops.pop(),a.trys.pop();continue}o=e.call(t,a)}catch(t){o=[6,t],n=0}finally{r=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,s])}}},o=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var a=r(0),s=o(r(16)),f=function(){function t(t){if(t.cram?this.cram=t.cram:this.cram=new s.default({url:t.cramUrl,path:t.cramPath,filehandle:t.cramFilehandle,seqFetch:t.seqFetch,checkSequenceMD5:t.checkSequenceMD5,cacheSize:t.cacheSize}),!(this.cram instanceof s.default))throw new Error("invalid arguments: no cramfile");if(this.index=t.index,!this.index.getEntriesForRange)throw new Error("invalid arguments: not an index");this.fetchSizeLimit=t.fetchSizeLimit||3e6}return t.prototype.getRecordsForRange=function(t,e,r,o){return void 0===o&&(o={}),n(this,void 0,void 0,(function(){var n,s,f,u,c,h,l,d,p,g,y,v,m,b,_,w,A,S,E,C,B,k,R,x=this;return i(this,(function(i){switch(i.label){case 0:if(o.viewAsPairs=o.viewAsPairs||!1,o.pairAcrossChr=o.pairAcrossChr||!1,o.maxInsertSize=o.maxInsertSize||2e5,"string"==typeof t)throw new a.CramUnimplementedError("string sequence names not yet supported");return n=t,[4,this.index.getEntriesForRange(n,e,r)];case 1:if(s=i.sent(),(f=s.map((function(t){return t.sliceBytes})).reduce((function(t,e){return t+e}),0))>this.fetchSizeLimit)throw new a.CramSizeLimitError("data size of ".concat(f.toLocaleString()," bytes exceeded fetch size limit of ").concat(this.fetchSizeLimit.toLocaleString()," bytes"));return u=function(n){return n.sequenceId===t&&n.alignmentStart<=r&&n.alignmentStart+n.lengthOnRef-1>=e},[4,Promise.all(s.map((function(t){return x.getRecordsInSlice(t,u)})))];case 2:if(c=i.sent(),h=(R=Array.prototype).concat.apply(R,c),!o.viewAsPairs)return[3,5];for(l={},d={},A=0;A<h.length;A+=1)p=h[A].readName,g=h[A].uniqueId,l[p]||(l[p]=0),l[p]+=1,d[g]=1;for(y={},Object.entries(l).forEach((function(t){var e=t[0];1===t[1]&&(y[e]=!0)})),v=[],A=0;A<h.length;A+=1)m=h[A].readName,y[m]&&h[A].mate&&(h[A].mate.sequenceId===n||o.pairAcrossChr)&&Math.abs(h[A].alignmentStart-h[A].mate.alignmentStart)<o.maxInsertSize&&(b=this.index.getEntriesForRange(h[A].mate.sequenceId,h[A].mate.alignmentStart,h[A].mate.alignmentStart+1),v.push(b));return[4,Promise.all(v)];case 3:for(_=i.sent(),w=[],A=0;A<_.length;A+=1)w.push.apply(w,_[A]);if(w=w.sort((function(t,e){return t.toString().localeCompare(e.toString())})).filter((function(t,e,r){return!e||t.toString()!==r[e-1].toString()})),S=[],E=[],(C=w.map((function(t){return t.sliceBytes})).reduce((function(t,e){return t+e}),0))>this.fetchSizeLimit)throw new Error("mate data size of ".concat(C.toLocaleString()," bytes exceeded fetch size limit of ").concat(this.fetchSizeLimit.toLocaleString()," bytes"));return w.forEach((function(t){var e=x.cram.featureCache.get(t.toString());e||(e=x.getRecordsInSlice(t,(function(){return!0})),x.cram.featureCache.set(t.toString(),e)),S.push(e);var r=e.then((function(t){for(var e=[],r=0;r<t.length;r+=1){var n=t[r];y[n.readName]&&!d[n.uniqueId]&&e.push(n)}return e}));E.push(r)})),[4,Promise.all(E)];case 4:(B=i.sent()).length&&(k=B.reduce((function(t,e){return t.concat(e)})),h=h.concat(k)),i.label=5;case 5:return[2,h]}}))}))},t.prototype.getRecordsInSlice=function(t,e){var r=t.containerStart,n=t.sliceStart,i=t.sliceBytes;return this.cram.getContainerAtPosition(r).getSlice(n,i).getRecords(e)},t.prototype.hasDataForReferenceSequence=function(t){return this.index.hasDataForReferenceSequence(t)},t}();e.default=f},function(t,e,r){"use strict";var n=this&&this.__awaiter||function(t,e,r,n){return new(r||(r=Promise))((function(i,o){function a(t){try{f(n.next(t))}catch(t){o(t)}}function s(t){try{f(n.throw(t))}catch(t){o(t)}}function f(t){var e;t.done?i(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(a,s)}f((n=n.apply(t,e||[])).next())}))},i=this&&this.__generator||function(t,e){var r,n,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(r)throw new TypeError("Generator is already executing.");for(;a;)try{if(r=1,n&&(i=2&o[0]?n.return:o[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,o[1])).done)return i;switch(n=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,n=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!(i=a.trys,(i=i.length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){a.label=o[1];break}if(6===o[0]&&a.label<i[1]){a.label=i[1],i=o;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(o);break}i[2]&&a.ops.pop(),a.trys.pop();continue}o=e.call(t,a)}catch(t){o=[6,t],n=0}finally{r=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,s])}}},o=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var a=o(r(90)),s=o(r(11)),f=r(17),u=r(29),c=r(0),h=function(){function t(t){Object.assign(this,t)}return t.prototype.toString=function(){return"".concat(this.start,":").concat(this.span,":").concat(this.containerStart,":").concat(this.sliceStart,":").concat(this.sliceBytes)},t}();function l(t,e){if(e.some((function(t){return void 0===t})))throw new c.CramMalformedError("invalid .crai index file");var r=e[0],n=e[1],i=e[2],o=e[3],a=e[4],s=e[5];t[r]||(t[r]=[]),t[r].push(new h({start:n,span:i,containerStart:o,sliceStart:a,sliceBytes:s}))}var d=function(){function t(t){var e=this,r=(0,u.open)(t.url,t.path,t.filehandle);this._parseCache=new a.default({cache:new s.default({maxSize:1}),fill:function(t,r){return e.parseIndex({signal:r})}}),this.readFile=r.readFile.bind(r)}return t.prototype.parseIndex=function(){var t={};return this.readFile().then((function(t){return 31===t[0]&&139===t[1]?(0,f.unzip)(t):t})).then((function(e){if(e.length>4&&21578050===e.readUInt32LE(0))throw new c.CramMalformedError("invalid .crai index file. note: file appears to be a .bai index. this is technically legal but please open a github issue if you need support");for(var r=[],n="",i=0;i<e.length;i+=1){var o=e[i];if(o>=48&&o<=57||!n&&45===o)n+=String.fromCharCode(o);else if(9===o)r.push(Number.parseInt(n,10)),n="";else if(10===o)r.push(Number.parseInt(n,10)),n="",l(t,r),r=[];else if(13!==o&&32!==o)throw new c.CramMalformedError("invalid .crai index file")}return n&&r.push(Number.parseInt(n,10)),6===r.length&&l(t,r),Object.entries(t).forEach((function(e){var r=e[0],n=e[1];t[r]=n.sort((function(t,e){return t.start-e.start||t.span-e.span}))})),t}))},t.prototype.getIndex=function(t){return void 0===t&&(t={}),this._parseCache.get("index",null,t.signal)},t.prototype.hasDataForReferenceSequence=function(t){return n(this,void 0,void 0,(function(){return i(this,(function(e){switch(e.label){case 0:return[4,this.getIndex()];case 1:return[2,!!e.sent()[t]]}}))}))},t.prototype.getEntriesForRange=function(t,e,r){return n(this,void 0,void 0,(function(){var n,o,a,s;return i(this,(function(i){switch(i.label){case 0:return[4,this.getIndex()];case 1:if(!(n=i.sent()[t]))return[2,[]];for(o=function(t){var n=t.start,i=t.start+t.span;return n>=r?-1:i<=e?1:0},a=[],s=0;s<n.length;s+=1)0===o(n[s])&&a.push(n[s]);return[2,a]}}))}))},t}();e.default=d},function(t,e,r){"use strict";var n=r(8);Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var i=n(r(91)).default;e.default=i},function(t,e,r){"use strict";var n=r(8);Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var i=n(r(92)),o=n(r(13)),a=n(r(14)),s=n(r(15)),f=r(30),u=n(r(94)),c=n(r(95)),h=function(){function t(e){var r=e.fill,n=e.cache;if((0,o.default)(this,t),(0,s.default)(this,"cache",void 0),(0,s.default)(this,"fillCallback",void 0),"function"!=typeof r)throw new TypeError("must pass a fill function");if("object"!==(0,i.default)(n))throw new TypeError("must pass a cache object");if("function"!=typeof n.get||"function"!=typeof n.set||"function"!=typeof n.delete)throw new TypeError("cache must implement get(key), set(key, val), and and delete(key)");this.cache=n,this.fillCallback=r}return(0,a.default)(t,[{key:"evict",value:function(t,e){this.cache.get(t)===e&&this.cache.delete(t)}},{key:"fill",value:function(t,e,r,n){var i=this,o=new u.default,a=new c.default;a.addCallback(n);var s={aborter:o,promise:this.fillCallback(e,o.signal,(function(t){a.callback(t)})),settled:!1,statusReporter:a,get aborted(){return this.aborter.signal.aborted}};s.aborter.addSignal(r),s.aborter.signal.addEventListener("abort",(function(){s.settled||i.evict(t,s)})),s.promise.then((function(){s.settled=!0}),(function(e){s.settled=!0,i.evict(t,s)})).catch((function(t){throw console.error(t),t})),this.cache.set(t,s)}},{key:"has",value:function(t){return this.cache.has(t)}},{key:"get",value:function(e,r,n,i){if(!n&&r instanceof f.AbortSignal)throw new TypeError("second get argument appears to be an AbortSignal, perhaps you meant to pass `null` for the fill data?");var o=this.cache.get(e);return o?o.aborted&&!o.settled?(this.evict(e,o),this.get(e,r,n,i)):o.settled?o.promise:(o.aborter.addSignal(n),o.statusReporter.addCallback(i),t.checkSinglePromise(o.promise,n)):(this.fill(e,r,n,i),t.checkSinglePromise(this.cache.get(e).promise,n))}},{key:"delete",value:function(t){var e=this.cache.get(t);e&&(e.settled||e.aborter.abort(),this.cache.delete(t))}},{key:"clear",value:function(){for(var t=this.cache.keys(),e=0,r=t.next();!r.done;r=t.next())this.delete(r.value),e+=1;return e}}],[{key:"isAbortException",value:function(t){return"AbortError"===t.name||"ERR_ABORTED"===t.code||"AbortError: aborted"===t.message||"Error: aborted"===t.message}},{key:"checkSinglePromise",value:function(t,e){function r(){if(e&&e.aborted)throw Object.assign(new Error("aborted"),{code:"ERR_ABORTED"})}return t.then((function(t){return r(),t}),(function(t){throw r(),t}))}}]),t}();e.default=h},function(t,e){function r(e){return t.exports=r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},t.exports.__esModule=!0,t.exports.default=t.exports,r(e)}t.exports=r,t.exports.__esModule=!0,t.exports.default=t.exports},function(t,e,r){"use strict";function n(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function i(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function o(t,e,r){return e&&i(t.prototype,e),r&&i(t,r),t}function a(t){return(a=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function s(t,e){return(s=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function f(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function u(t,e){return!e||"object"!=typeof e&&"function"!=typeof e?f(t):e}function c(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=a(t);if(e){var i=a(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return u(this,r)}}function h(t,e,r){return(h="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(t,e,r){var n=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=a(t)););return t}(t,e);if(n){var i=Object.getOwnPropertyDescriptor(n,e);return i.get?i.get.call(r):i.value}})(t,e,r||t)}Object.defineProperty(e,"__esModule",{value:!0});var l=function(){function t(){n(this,t),Object.defineProperty(this,"listeners",{value:{},writable:!0,configurable:!0})}return o(t,[{key:"addEventListener",value:function(t,e,r){t in this.listeners||(this.listeners[t]=[]),this.listeners[t].push({callback:e,options:r})}},{key:"removeEventListener",value:function(t,e){if(t in this.listeners)for(var r=this.listeners[t],n=0,i=r.length;n<i;n++)if(r[n].callback===e)return void r.splice(n,1)}},{key:"dispatchEvent",value:function(t){if(t.type in this.listeners){for(var e=this.listeners[t.type].slice(),r=0,n=e.length;r<n;r++){var i=e[r];try{i.callback.call(this,t)}catch(t){Promise.resolve().then((function(){throw t}))}i.options&&i.options.once&&this.removeEventListener(t.type,i.callback)}return!t.defaultPrevented}}}]),t}(),d=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&s(t,e)}(r,t);var e=c(r);function r(){var t;return n(this,r),(t=e.call(this)).listeners||l.call(f(t)),Object.defineProperty(f(t),"aborted",{value:!1,writable:!0,configurable:!0}),Object.defineProperty(f(t),"onabort",{value:null,writable:!0,configurable:!0}),t}return o(r,[{key:"toString",value:function(){return"[object AbortSignal]"}},{key:"dispatchEvent",value:function(t){"abort"===t.type&&(this.aborted=!0,"function"==typeof this.onabort&&this.onabort.call(this,t)),h(a(r.prototype),"dispatchEvent",this).call(this,t)}}]),r}(l),p=function(){function t(){n(this,t),Object.defineProperty(this,"signal",{value:new d,writable:!0,configurable:!0})}return o(t,[{key:"abort",value:function(){var t;try{t=new Event("abort")}catch(e){"undefined"!=typeof document?document.createEvent?(t=document.createEvent("Event")).initEvent("abort",!1,!1):(t=document.createEventObject()).type="abort":t={type:"abort",bubbles:!1,cancelable:!1}}this.signal.dispatchEvent(t)}},{key:"toString",value:function(){return"[object AbortController]"}}]),t}();"undefined"!=typeof Symbol&&Symbol.toStringTag&&(p.prototype[Symbol.toStringTag]="AbortController",d.prototype[Symbol.toStringTag]="AbortSignal"),e.AbortController=p,e.AbortSignal=d,e.abortableFetch=function(t){"function"==typeof t&&(t={fetch:t});var e=t,r=e.fetch,n=e.Request,i=void 0===n?r.Request:n,o=e.AbortController,a=e.__FORCE_INSTALL_ABORTCONTROLLER_POLYFILL,s=void 0!==a&&a;if(!function(t){return t.__FORCE_INSTALL_ABORTCONTROLLER_POLYFILL?(console.log("__FORCE_INSTALL_ABORTCONTROLLER_POLYFILL=true is set, will force install polyfill"),!0):"function"==typeof t.Request&&!t.Request.prototype.hasOwnProperty("signal")||!t.AbortController}({fetch:r,Request:i,AbortController:o,__FORCE_INSTALL_ABORTCONTROLLER_POLYFILL:s}))return{fetch:r,Request:f};var f=i;(f&&!f.prototype.hasOwnProperty("signal")||s)&&((f=function(t,e){var r;e&&e.signal&&(r=e.signal,delete e.signal);var n=new i(t,e);return r&&Object.defineProperty(n,"signal",{writable:!1,enumerable:!1,configurable:!0,value:r}),n}).prototype=i.prototype);var u=r;return{fetch:function(t,e){var r=f&&f.prototype.isPrototypeOf(t)?t.signal:e?e.signal:void 0;if(r){var n;try{n=new DOMException("Aborted","AbortError")}catch(t){(n=new Error("Aborted")).name="AbortError"}if(r.aborted)return Promise.reject(n);var i=new Promise((function(t,e){r.addEventListener("abort",(function(){return e(n)}),{once:!0})}));return e&&e.signal&&delete e.signal,Promise.race([i,u(t,e)])}return u(t,e)},Request:f}}},function(t,e,r){"use strict";var n=r(8);Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var i=n(r(14)),o=n(r(15)),a=n(r(13)),s=r(30),f=function t(){(0,a.default)(this,t)},u=function(){function t(){(0,a.default)(this,t),(0,o.default)(this,"signals",new Set),(0,o.default)(this,"abortController",new s.AbortController)}return(0,i.default)(t,[{key:"addSignal",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new f;if(this.signal.aborted)throw new Error("cannot add a signal, already aborted!");this.signals.add(e),e.aborted?this.handleAborted(e):"function"==typeof e.addEventListener&&e.addEventListener("abort",(function(){t.handleAborted(e)}))}},{key:"handleAborted",value:function(t){this.signals.delete(t),0===this.signals.size&&this.abortController.abort()}},{key:"abort",value:function(){this.abortController.abort()}},{key:"signal",get:function(){return this.abortController.signal}}]),t}();e.default=u},function(t,e,r){"use strict";var n=r(8);Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var i=n(r(13)),o=n(r(14)),a=n(r(15)),s=function(){function t(){(0,i.default)(this,t),(0,a.default)(this,"callbacks",new Set),(0,a.default)(this,"currentMessage",void 0)}return(0,o.default)(t,[{key:"addCallback",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:function(){};this.callbacks.add(t),t(this.currentMessage)}},{key:"callback",value:function(t){this.currentMessage=t,this.callbacks.forEach((function(e){e(t)}))}}]),t}();e.default=s}]);
|