-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathhiglass-transcripts.js
More file actions
2 lines (2 loc) · 147 KB
/
higlass-transcripts.js
File metadata and controls
2 lines (2 loc) · 147 KB
1
2
/*! For license information please see higlass-transcripts.js.LICENSE.txt */
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports["higlass-transcripts"]=e():t["higlass-transcripts"]=e()}(window,(function(){return function(t){var e={};function n(r){if(e[r])return e[r].exports;var i=e[r]={i:r,l:!1,exports:{}};return t[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=t,n.c=e,n.d=function(t,e,r){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:r})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var i in t)n.d(r,i,function(e){return t[e]}.bind(null,i));return r},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="/",n(n.s=34)}([function(t,e,n){"use strict";n.d(e,"b",(function(){return o})),n.d(e,"a",(function(){return i.a}));var r=n(7),i=n.n(r),a=n(1);const s="undefined"!=typeof window?window:"undefined"!=typeof self?self:{fetch:void 0};class o{async getBufferFromResponse(t){if("function"==typeof t.buffer)return t.buffer();if("function"==typeof t.arrayBuffer){const e=await t.arrayBuffer();return a.Buffer.from(e)}throw new TypeError("invalid HTTP response object, has no buffer method, and no arrayBuffer method")}constructor(t,e={}){this.baseOverrides={},this.url=t;const n=e.fetch||s.fetch&&s.fetch.bind(s);if(!n)throw new TypeError("no fetch function supplied, and none found in global environment");e.overrides&&(this.baseOverrides=e.overrides),this.fetchImplementation=n}async fetch(t,e){let n;try{n=await this.fetchImplementation(t,e)}catch(r){if(!(""+r).includes("Failed to fetch"))throw r;console.warn(`generic-filehandle: refetching ${t} to attempt to work around chrome CORS header caching bug`),n=await this.fetchImplementation(t,{...e,cache:"reload"})}return n}async read(t,e=0,n,r=0,i={}){const{headers:a={},signal:s,overrides:o={}}=i;n<1/0?a.range=`bytes=${r}-${r+n}`:n===1/0&&0!==r&&(a.range=`bytes=${r}-`);const h={...this.baseOverrides,...o,headers:{...a,...o.headers,...this.baseOverrides.headers},method:"GET",redirect:"follow",mode:"cors",signal:s},l=await this.fetch(this.url,h);if(!l.ok)throw new Error(`HTTP ${l.status} ${l.statusText} ${this.url}`);if(200===l.status&&0===r||206===l.status){const r=await this.getBufferFromResponse(l),i=r.copy(t,e,0,Math.min(n,r.length)),a=l.headers.get("content-range"),s=/\/(\d+)$/.exec(a||"");return s&&s[1]&&(this._stat={size:parseInt(s[1],10)}),{bytesRead:i,buffer:t}}if(200===l.status)throw new Error("${this.url} fetch returned status 200, expected 206");throw new Error(`HTTP ${l.status} fetching ${this.url}`)}async readFile(t={}){let e,n;"string"==typeof t?(e=t,n={}):(e=t.encoding,n=t,delete n.encoding);const{headers:r={},signal:i,overrides:a={}}=n,s={headers:r,method:"GET",redirect:"follow",mode:"cors",signal:i,...this.baseOverrides,...a},o=await this.fetch(this.url,s);if(!o)throw new Error("generic-filehandle failed to fetch");if(200!==o.status)throw Object.assign(new Error(`HTTP ${o.status} fetching ${this.url}`),{status:o.status});if("utf8"===e)return o.text();if(e)throw new Error("unsupported encoding: "+e);return this.getBufferFromResponse(o)}async stat(){if(!this._stat){const t=a.Buffer.allocUnsafe(10);if(await this.read(t,0,10,0),!this._stat)throw new Error("unable to determine size of file at "+this.url)}return this._stat}async close(){}}},function(t,e,n){"use strict";(function(t){var r=n(21),i=n(22),a=n(23);function s(){return h.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function o(t,e){if(s()<e)throw new RangeError("Invalid typed array length");return h.TYPED_ARRAY_SUPPORT?(t=new Uint8Array(e)).__proto__=h.prototype:(null===t&&(t=new h(e)),t.length=e),t}function h(t,e,n){if(!(h.TYPED_ARRAY_SUPPORT||this instanceof h))return new h(t,e,n);if("number"==typeof t){if("string"==typeof e)throw new Error("If encoding is specified then the first argument must be a string");return c(this,t)}return l(this,t,e,n)}function l(t,e,n,r){if("number"==typeof e)throw new TypeError('"value" argument must not be a number');return"undefined"!=typeof ArrayBuffer&&e instanceof ArrayBuffer?function(t,e,n,r){if(e.byteLength,n<0||e.byteLength<n)throw new RangeError("'offset' is out of bounds");if(e.byteLength<n+(r||0))throw new RangeError("'length' is out of bounds");e=void 0===n&&void 0===r?new Uint8Array(e):void 0===r?new Uint8Array(e,n):new Uint8Array(e,n,r);h.TYPED_ARRAY_SUPPORT?(t=e).__proto__=h.prototype:t=f(t,e);return t}(t,e,n,r):"string"==typeof e?function(t,e,n){"string"==typeof n&&""!==n||(n="utf8");if(!h.isEncoding(n))throw new TypeError('"encoding" must be a valid string encoding');var r=0|p(e,n),i=(t=o(t,r)).write(e,n);i!==r&&(t=t.slice(0,i));return t}(t,e,n):function(t,e){if(h.isBuffer(e)){var n=0|d(e.length);return 0===(t=o(t,n)).length||e.copy(t,0,0,n),t}if(e){if("undefined"!=typeof ArrayBuffer&&e.buffer instanceof ArrayBuffer||"length"in e)return"number"!=typeof e.length||(r=e.length)!=r?o(t,0):f(t,e);if("Buffer"===e.type&&a(e.data))return f(t,e.data)}var r;throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}(t,e)}function u(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 c(t,e){if(u(e),t=o(t,e<0?0:0|d(e)),!h.TYPED_ARRAY_SUPPORT)for(var n=0;n<e;++n)t[n]=0;return t}function f(t,e){var n=e.length<0?0:0|d(e.length);t=o(t,n);for(var r=0;r<n;r+=1)t[r]=255&e[r];return t}function d(t){if(t>=s())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+s().toString(16)+" bytes");return 0|t}function p(t,e){if(h.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 n=t.length;if(0===n)return 0;for(var r=!1;;)switch(e){case"ascii":case"latin1":case"binary":return n;case"utf8":case"utf-8":case void 0:return U(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*n;case"hex":return n>>>1;case"base64":return H(t).length;default:if(r)return U(t).length;e=(""+e).toLowerCase(),r=!0}}function g(t,e,n){var r=!1;if((void 0===e||e<0)&&(e=0),e>this.length)return"";if((void 0===n||n>this.length)&&(n=this.length),n<=0)return"";if((n>>>=0)<=(e>>>=0))return"";for(t||(t="utf8");;)switch(t){case"hex":return I(this,e,n);case"utf8":case"utf-8":return S(this,e,n);case"ascii":return E(this,e,n);case"latin1":case"binary":return C(this,e,n);case"base64":return T(this,e,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return B(this,e,n);default:if(r)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),r=!0}}function m(t,e,n){var r=t[e];t[e]=t[n],t[n]=r}function v(t,e,n,r,i){if(0===t.length)return-1;if("string"==typeof n?(r=n,n=0):n>2147483647?n=2147483647:n<-2147483648&&(n=-2147483648),n=+n,isNaN(n)&&(n=i?0:t.length-1),n<0&&(n=t.length+n),n>=t.length){if(i)return-1;n=t.length-1}else if(n<0){if(!i)return-1;n=0}if("string"==typeof e&&(e=h.from(e,r)),h.isBuffer(e))return 0===e.length?-1:w(t,e,n,r,i);if("number"==typeof e)return e&=255,h.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(t,e,n):Uint8Array.prototype.lastIndexOf.call(t,e,n):w(t,[e],n,r,i);throw new TypeError("val must be string, number or Buffer")}function w(t,e,n,r,i){var a,s=1,o=t.length,h=e.length;if(void 0!==r&&("ucs2"===(r=String(r).toLowerCase())||"ucs-2"===r||"utf16le"===r||"utf-16le"===r)){if(t.length<2||e.length<2)return-1;s=2,o/=2,h/=2,n/=2}function l(t,e){return 1===s?t[e]:t.readUInt16BE(e*s)}if(i){var u=-1;for(a=n;a<o;a++)if(l(t,a)===l(e,-1===u?0:a-u)){if(-1===u&&(u=a),a-u+1===h)return u*s}else-1!==u&&(a-=a-u),u=-1}else for(n+h>o&&(n=o-h),a=n;a>=0;a--){for(var c=!0,f=0;f<h;f++)if(l(t,a+f)!==l(e,f)){c=!1;break}if(c)return a}return-1}function b(t,e,n,r){n=Number(n)||0;var i=t.length-n;r?(r=Number(r))>i&&(r=i):r=i;var a=e.length;if(a%2!=0)throw new TypeError("Invalid hex string");r>a/2&&(r=a/2);for(var s=0;s<r;++s){var o=parseInt(e.substr(2*s,2),16);if(isNaN(o))return s;t[n+s]=o}return s}function _(t,e,n,r){return D(U(e,t.length-n),t,n,r)}function y(t,e,n,r){return D(function(t){for(var e=[],n=0;n<t.length;++n)e.push(255&t.charCodeAt(n));return e}(e),t,n,r)}function k(t,e,n,r){return y(t,e,n,r)}function x(t,e,n,r){return D(H(e),t,n,r)}function A(t,e,n,r){return D(function(t,e){for(var n,r,i,a=[],s=0;s<t.length&&!((e-=2)<0);++s)n=t.charCodeAt(s),r=n>>8,i=n%256,a.push(i),a.push(r);return a}(e,t.length-n),t,n,r)}function T(t,e,n){return 0===e&&n===t.length?r.fromByteArray(t):r.fromByteArray(t.slice(e,n))}function S(t,e,n){n=Math.min(t.length,n);for(var r=[],i=e;i<n;){var a,s,o,h,l=t[i],u=null,c=l>239?4:l>223?3:l>191?2:1;if(i+c<=n)switch(c){case 1:l<128&&(u=l);break;case 2:128==(192&(a=t[i+1]))&&(h=(31&l)<<6|63&a)>127&&(u=h);break;case 3:a=t[i+1],s=t[i+2],128==(192&a)&&128==(192&s)&&(h=(15&l)<<12|(63&a)<<6|63&s)>2047&&(h<55296||h>57343)&&(u=h);break;case 4:a=t[i+1],s=t[i+2],o=t[i+3],128==(192&a)&&128==(192&s)&&128==(192&o)&&(h=(15&l)<<18|(63&a)<<12|(63&s)<<6|63&o)>65535&&h<1114112&&(u=h)}null===u?(u=65533,c=1):u>65535&&(u-=65536,r.push(u>>>10&1023|55296),u=56320|1023&u),r.push(u),i+=c}return function(t){var e=t.length;if(e<=4096)return String.fromCharCode.apply(String,t);var n="",r=0;for(;r<e;)n+=String.fromCharCode.apply(String,t.slice(r,r+=4096));return n}(r)}e.Buffer=h,e.SlowBuffer=function(t){+t!=t&&(t=0);return h.alloc(+t)},e.INSPECT_MAX_BYTES=50,h.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=s(),h.poolSize=8192,h._augment=function(t){return t.__proto__=h.prototype,t},h.from=function(t,e,n){return l(null,t,e,n)},h.TYPED_ARRAY_SUPPORT&&(h.prototype.__proto__=Uint8Array.prototype,h.__proto__=Uint8Array,"undefined"!=typeof Symbol&&Symbol.species&&h[Symbol.species]===h&&Object.defineProperty(h,Symbol.species,{value:null,configurable:!0})),h.alloc=function(t,e,n){return function(t,e,n,r){return u(e),e<=0?o(t,e):void 0!==n?"string"==typeof r?o(t,e).fill(n,r):o(t,e).fill(n):o(t,e)}(null,t,e,n)},h.allocUnsafe=function(t){return c(null,t)},h.allocUnsafeSlow=function(t){return c(null,t)},h.isBuffer=function(t){return!(null==t||!t._isBuffer)},h.compare=function(t,e){if(!h.isBuffer(t)||!h.isBuffer(e))throw new TypeError("Arguments must be Buffers");if(t===e)return 0;for(var n=t.length,r=e.length,i=0,a=Math.min(n,r);i<a;++i)if(t[i]!==e[i]){n=t[i],r=e[i];break}return n<r?-1:r<n?1:0},h.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}},h.concat=function(t,e){if(!a(t))throw new TypeError('"list" argument must be an Array of Buffers');if(0===t.length)return h.alloc(0);var n;if(void 0===e)for(e=0,n=0;n<t.length;++n)e+=t[n].length;var r=h.allocUnsafe(e),i=0;for(n=0;n<t.length;++n){var s=t[n];if(!h.isBuffer(s))throw new TypeError('"list" argument must be an Array of Buffers');s.copy(r,i),i+=s.length}return r},h.byteLength=p,h.prototype._isBuffer=!0,h.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)m(this,e,e+1);return this},h.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)m(this,e,e+3),m(this,e+1,e+2);return this},h.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)m(this,e,e+7),m(this,e+1,e+6),m(this,e+2,e+5),m(this,e+3,e+4);return this},h.prototype.toString=function(){var t=0|this.length;return 0===t?"":0===arguments.length?S(this,0,t):g.apply(this,arguments)},h.prototype.equals=function(t){if(!h.isBuffer(t))throw new TypeError("Argument must be a Buffer");return this===t||0===h.compare(this,t)},h.prototype.inspect=function(){var t="",n=e.INSPECT_MAX_BYTES;return this.length>0&&(t=this.toString("hex",0,n).match(/.{2}/g).join(" "),this.length>n&&(t+=" ... ")),"<Buffer "+t+">"},h.prototype.compare=function(t,e,n,r,i){if(!h.isBuffer(t))throw new TypeError("Argument must be a Buffer");if(void 0===e&&(e=0),void 0===n&&(n=t?t.length:0),void 0===r&&(r=0),void 0===i&&(i=this.length),e<0||n>t.length||r<0||i>this.length)throw new RangeError("out of range index");if(r>=i&&e>=n)return 0;if(r>=i)return-1;if(e>=n)return 1;if(this===t)return 0;for(var a=(i>>>=0)-(r>>>=0),s=(n>>>=0)-(e>>>=0),o=Math.min(a,s),l=this.slice(r,i),u=t.slice(e,n),c=0;c<o;++c)if(l[c]!==u[c]){a=l[c],s=u[c];break}return a<s?-1:s<a?1:0},h.prototype.includes=function(t,e,n){return-1!==this.indexOf(t,e,n)},h.prototype.indexOf=function(t,e,n){return v(this,t,e,n,!0)},h.prototype.lastIndexOf=function(t,e,n){return v(this,t,e,n,!1)},h.prototype.write=function(t,e,n,r){if(void 0===e)r="utf8",n=this.length,e=0;else if(void 0===n&&"string"==typeof e)r=e,n=this.length,e=0;else{if(!isFinite(e))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");e|=0,isFinite(n)?(n|=0,void 0===r&&(r="utf8")):(r=n,n=void 0)}var i=this.length-e;if((void 0===n||n>i)&&(n=i),t.length>0&&(n<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");r||(r="utf8");for(var a=!1;;)switch(r){case"hex":return b(this,t,e,n);case"utf8":case"utf-8":return _(this,t,e,n);case"ascii":return y(this,t,e,n);case"latin1":case"binary":return k(this,t,e,n);case"base64":return x(this,t,e,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return A(this,t,e,n);default:if(a)throw new TypeError("Unknown encoding: "+r);r=(""+r).toLowerCase(),a=!0}},h.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function E(t,e,n){var r="";n=Math.min(t.length,n);for(var i=e;i<n;++i)r+=String.fromCharCode(127&t[i]);return r}function C(t,e,n){var r="";n=Math.min(t.length,n);for(var i=e;i<n;++i)r+=String.fromCharCode(t[i]);return r}function I(t,e,n){var r=t.length;(!e||e<0)&&(e=0),(!n||n<0||n>r)&&(n=r);for(var i="",a=e;a<n;++a)i+=L(t[a]);return i}function B(t,e,n){for(var r=t.slice(e,n),i="",a=0;a<r.length;a+=2)i+=String.fromCharCode(r[a]+256*r[a+1]);return i}function M(t,e,n){if(t%1!=0||t<0)throw new RangeError("offset is not uint");if(t+e>n)throw new RangeError("Trying to access beyond buffer length")}function z(t,e,n,r,i,a){if(!h.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>i||e<a)throw new RangeError('"value" argument is out of bounds');if(n+r>t.length)throw new RangeError("Index out of range")}function P(t,e,n,r){e<0&&(e=65535+e+1);for(var i=0,a=Math.min(t.length-n,2);i<a;++i)t[n+i]=(e&255<<8*(r?i:1-i))>>>8*(r?i:1-i)}function R(t,e,n,r){e<0&&(e=4294967295+e+1);for(var i=0,a=Math.min(t.length-n,4);i<a;++i)t[n+i]=e>>>8*(r?i:3-i)&255}function O(t,e,n,r,i,a){if(n+r>t.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("Index out of range")}function N(t,e,n,r,a){return a||O(t,0,n,4),i.write(t,e,n,r,23,4),n+4}function G(t,e,n,r,a){return a||O(t,0,n,8),i.write(t,e,n,r,52,8),n+8}h.prototype.slice=function(t,e){var n,r=this.length;if((t=~~t)<0?(t+=r)<0&&(t=0):t>r&&(t=r),(e=void 0===e?r:~~e)<0?(e+=r)<0&&(e=0):e>r&&(e=r),e<t&&(e=t),h.TYPED_ARRAY_SUPPORT)(n=this.subarray(t,e)).__proto__=h.prototype;else{var i=e-t;n=new h(i,void 0);for(var a=0;a<i;++a)n[a]=this[a+t]}return n},h.prototype.readUIntLE=function(t,e,n){t|=0,e|=0,n||M(t,e,this.length);for(var r=this[t],i=1,a=0;++a<e&&(i*=256);)r+=this[t+a]*i;return r},h.prototype.readUIntBE=function(t,e,n){t|=0,e|=0,n||M(t,e,this.length);for(var r=this[t+--e],i=1;e>0&&(i*=256);)r+=this[t+--e]*i;return r},h.prototype.readUInt8=function(t,e){return e||M(t,1,this.length),this[t]},h.prototype.readUInt16LE=function(t,e){return e||M(t,2,this.length),this[t]|this[t+1]<<8},h.prototype.readUInt16BE=function(t,e){return e||M(t,2,this.length),this[t]<<8|this[t+1]},h.prototype.readUInt32LE=function(t,e){return e||M(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},h.prototype.readUInt32BE=function(t,e){return e||M(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},h.prototype.readIntLE=function(t,e,n){t|=0,e|=0,n||M(t,e,this.length);for(var r=this[t],i=1,a=0;++a<e&&(i*=256);)r+=this[t+a]*i;return r>=(i*=128)&&(r-=Math.pow(2,8*e)),r},h.prototype.readIntBE=function(t,e,n){t|=0,e|=0,n||M(t,e,this.length);for(var r=e,i=1,a=this[t+--r];r>0&&(i*=256);)a+=this[t+--r]*i;return a>=(i*=128)&&(a-=Math.pow(2,8*e)),a},h.prototype.readInt8=function(t,e){return e||M(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},h.prototype.readInt16LE=function(t,e){e||M(t,2,this.length);var n=this[t]|this[t+1]<<8;return 32768&n?4294901760|n:n},h.prototype.readInt16BE=function(t,e){e||M(t,2,this.length);var n=this[t+1]|this[t]<<8;return 32768&n?4294901760|n:n},h.prototype.readInt32LE=function(t,e){return e||M(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},h.prototype.readInt32BE=function(t,e){return e||M(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},h.prototype.readFloatLE=function(t,e){return e||M(t,4,this.length),i.read(this,t,!0,23,4)},h.prototype.readFloatBE=function(t,e){return e||M(t,4,this.length),i.read(this,t,!1,23,4)},h.prototype.readDoubleLE=function(t,e){return e||M(t,8,this.length),i.read(this,t,!0,52,8)},h.prototype.readDoubleBE=function(t,e){return e||M(t,8,this.length),i.read(this,t,!1,52,8)},h.prototype.writeUIntLE=function(t,e,n,r){(t=+t,e|=0,n|=0,r)||z(this,t,e,n,Math.pow(2,8*n)-1,0);var i=1,a=0;for(this[e]=255&t;++a<n&&(i*=256);)this[e+a]=t/i&255;return e+n},h.prototype.writeUIntBE=function(t,e,n,r){(t=+t,e|=0,n|=0,r)||z(this,t,e,n,Math.pow(2,8*n)-1,0);var i=n-1,a=1;for(this[e+i]=255&t;--i>=0&&(a*=256);)this[e+i]=t/a&255;return e+n},h.prototype.writeUInt8=function(t,e,n){return t=+t,e|=0,n||z(this,t,e,1,255,0),h.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),this[e]=255&t,e+1},h.prototype.writeUInt16LE=function(t,e,n){return t=+t,e|=0,n||z(this,t,e,2,65535,0),h.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8):P(this,t,e,!0),e+2},h.prototype.writeUInt16BE=function(t,e,n){return t=+t,e|=0,n||z(this,t,e,2,65535,0),h.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=255&t):P(this,t,e,!1),e+2},h.prototype.writeUInt32LE=function(t,e,n){return t=+t,e|=0,n||z(this,t,e,4,4294967295,0),h.TYPED_ARRAY_SUPPORT?(this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=255&t):R(this,t,e,!0),e+4},h.prototype.writeUInt32BE=function(t,e,n){return t=+t,e|=0,n||z(this,t,e,4,4294967295,0),h.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t):R(this,t,e,!1),e+4},h.prototype.writeIntLE=function(t,e,n,r){if(t=+t,e|=0,!r){var i=Math.pow(2,8*n-1);z(this,t,e,n,i-1,-i)}var a=0,s=1,o=0;for(this[e]=255&t;++a<n&&(s*=256);)t<0&&0===o&&0!==this[e+a-1]&&(o=1),this[e+a]=(t/s>>0)-o&255;return e+n},h.prototype.writeIntBE=function(t,e,n,r){if(t=+t,e|=0,!r){var i=Math.pow(2,8*n-1);z(this,t,e,n,i-1,-i)}var a=n-1,s=1,o=0;for(this[e+a]=255&t;--a>=0&&(s*=256);)t<0&&0===o&&0!==this[e+a+1]&&(o=1),this[e+a]=(t/s>>0)-o&255;return e+n},h.prototype.writeInt8=function(t,e,n){return t=+t,e|=0,n||z(this,t,e,1,127,-128),h.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),t<0&&(t=255+t+1),this[e]=255&t,e+1},h.prototype.writeInt16LE=function(t,e,n){return t=+t,e|=0,n||z(this,t,e,2,32767,-32768),h.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8):P(this,t,e,!0),e+2},h.prototype.writeInt16BE=function(t,e,n){return t=+t,e|=0,n||z(this,t,e,2,32767,-32768),h.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=255&t):P(this,t,e,!1),e+2},h.prototype.writeInt32LE=function(t,e,n){return t=+t,e|=0,n||z(this,t,e,4,2147483647,-2147483648),h.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24):R(this,t,e,!0),e+4},h.prototype.writeInt32BE=function(t,e,n){return t=+t,e|=0,n||z(this,t,e,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),h.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t):R(this,t,e,!1),e+4},h.prototype.writeFloatLE=function(t,e,n){return N(this,t,e,!0,n)},h.prototype.writeFloatBE=function(t,e,n){return N(this,t,e,!1,n)},h.prototype.writeDoubleLE=function(t,e,n){return G(this,t,e,!0,n)},h.prototype.writeDoubleBE=function(t,e,n){return G(this,t,e,!1,n)},h.prototype.copy=function(t,e,n,r){if(n||(n=0),r||0===r||(r=this.length),e>=t.length&&(e=t.length),e||(e=0),r>0&&r<n&&(r=n),r===n)return 0;if(0===t.length||0===this.length)return 0;if(e<0)throw new RangeError("targetStart out of bounds");if(n<0||n>=this.length)throw new RangeError("sourceStart out of bounds");if(r<0)throw new RangeError("sourceEnd out of bounds");r>this.length&&(r=this.length),t.length-e<r-n&&(r=t.length-e+n);var i,a=r-n;if(this===t&&n<e&&e<r)for(i=a-1;i>=0;--i)t[i+e]=this[i+n];else if(a<1e3||!h.TYPED_ARRAY_SUPPORT)for(i=0;i<a;++i)t[i+e]=this[i+n];else Uint8Array.prototype.set.call(t,this.subarray(n,n+a),e);return a},h.prototype.fill=function(t,e,n,r){if("string"==typeof t){if("string"==typeof e?(r=e,e=0,n=this.length):"string"==typeof n&&(r=n,n=this.length),1===t.length){var i=t.charCodeAt(0);i<256&&(t=i)}if(void 0!==r&&"string"!=typeof r)throw new TypeError("encoding must be a string");if("string"==typeof r&&!h.isEncoding(r))throw new TypeError("Unknown encoding: "+r)}else"number"==typeof t&&(t&=255);if(e<0||this.length<e||this.length<n)throw new RangeError("Out of range index");if(n<=e)return this;var a;if(e>>>=0,n=void 0===n?this.length:n>>>0,t||(t=0),"number"==typeof t)for(a=e;a<n;++a)this[a]=t;else{var s=h.isBuffer(t)?t:U(new h(t,r).toString()),o=s.length;for(a=0;a<n-e;++a)this[a+e]=s[a%o]}return this};var F=/[^+\/0-9A-Za-z-_]/g;function L(t){return t<16?"0"+t.toString(16):t.toString(16)}function U(t,e){var n;e=e||1/0;for(var r=t.length,i=null,a=[],s=0;s<r;++s){if((n=t.charCodeAt(s))>55295&&n<57344){if(!i){if(n>56319){(e-=3)>-1&&a.push(239,191,189);continue}if(s+1===r){(e-=3)>-1&&a.push(239,191,189);continue}i=n;continue}if(n<56320){(e-=3)>-1&&a.push(239,191,189),i=n;continue}n=65536+(i-55296<<10|n-56320)}else i&&(e-=3)>-1&&a.push(239,191,189);if(i=null,n<128){if((e-=1)<0)break;a.push(n)}else if(n<2048){if((e-=2)<0)break;a.push(n>>6|192,63&n|128)}else if(n<65536){if((e-=3)<0)break;a.push(n>>12|224,n>>6&63|128,63&n|128)}else{if(!(n<1114112))throw new Error("Invalid code point");if((e-=4)<0)break;a.push(n>>18|240,n>>12&63|128,n>>6&63|128,63&n|128)}}return a}function H(t){return r.toByteArray(function(t){if((t=function(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")}(t).replace(F,"")).length<2)return"";for(;t.length%4!=0;)t+="=";return t}(t))}function D(t,e,n,r){for(var i=0;i<r&&!(i+n>=e.length||i>=t.length);++i)e[i+n]=t[i];return i}}).call(this,n(9))},function(t,e,n){"use strict";var r="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 n=e.shift();if(n){if("object"!=typeof n)throw new TypeError(n+"must be non-object");for(var r in n)i(n,r)&&(t[r]=n[r])}}return t},e.shrinkBuf=function(t,e){return t.length===e?t:t.subarray?t.subarray(0,e):(t.length=e,t)};var a={arraySet:function(t,e,n,r,i){if(e.subarray&&t.subarray)t.set(e.subarray(n,n+r),i);else for(var a=0;a<r;a++)t[i+a]=e[n+a]},flattenChunks:function(t){var e,n,r,i,a,s;for(r=0,e=0,n=t.length;e<n;e++)r+=t[e].length;for(s=new Uint8Array(r),i=0,e=0,n=t.length;e<n;e++)a=t[e],s.set(a,i),i+=a.length;return s}},s={arraySet:function(t,e,n,r,i){for(var a=0;a<r;a++)t[i+a]=e[n+a]},flattenChunks:function(t){return[].concat.apply([],t)}};e.setTyped=function(t){t?(e.Buf8=Uint8Array,e.Buf16=Uint16Array,e.Buf32=Int32Array,e.assign(e,a)):(e.Buf8=Array,e.Buf16=Array,e.Buf32=Array,e.assign(e,s))},e.setTyped(r)},function(t,e,n){"use strict";var r={};(0,n(2).assign)(r,n(26),n(29),n(15)),t.exports=r},function(t,e,n){"use strict";(function(t){n.d(e,"a",(function(){return i}));var r=n(3);async function i(e){try{let n,i=0,a=0;const s=[];let o,h=0;do{const t=e.subarray(i);if(o=new r.Inflate,({strm:n}=o),o.push(t,r.Z_SYNC_FLUSH),o.err)throw new Error(o.msg);i+=n.next_in,s[a]=o.result,h+=s[a].length,a+=1}while(n.avail_in);const l=new Uint8Array(h);for(let t=0,e=0;t<s.length;t++)l.set(s[t],e),e+=s[t].length;return t.from(l)}catch(t){if((""+t).match(/incorrect header check/))throw new Error("problem decompressing block: incorrect gzip header check");throw t}}}).call(this,n(1).Buffer)},function(t,e,n){"use strict";(function(t){n.d(e,"a",(function(){return a}));var r=n(0);function i(t,e){return t.offset+t.lineBytes*Math.floor(e/t.lineLength)+e%t.lineLength}class a{constructor({fasta:t,fai:e,path:n,faiPath:i,chunkSizeLimit:a=1e6}){if(t)this.fasta=t;else{if(!n)throw new Error("Need to pass filehandle for fasta or path to localfile");this.fasta=new r.a(n)}if(e)this.fai=e;else if(i)this.fai=new r.a(i);else{if(!n)throw new Error("Need to pass filehandle for or path to localfile");this.fai=new r.a(n+".fai")}this.chunkSizeLimit=a}async _getIndexes(t){return this.indexes||(this.indexes=async function(t,e){const n=await t.readFile(e);if(!n||!n.length)throw new Error("No data read from FASTA index (FAI) file");let r,i=0;const a=n.toString("utf8").split(/\r?\n/).filter(t=>/\S/.test(t)).map(t=>t.split("\t")).filter(t=>""!==t[0]).map(t=>(r&&r.name===t[0]||(r={name:t[0],id:i},i+=1),{id:r.id,name:t[0],length:+t[1],start:0,end:+t[1],offset:+t[2],lineLength:+t[3],lineBytes:+t[4]}));return{name:Object.fromEntries(a.map(t=>[t.name,t])),id:Object.fromEntries(a.map(t=>[t.id,t]))}}(this.fai,t)),this.indexes}async getSequenceNames(t){return Object.keys((await this._getIndexes(t)).name)}async getSequenceSizes(t){const e={},n=await this._getIndexes(t),r=Object.values(n.id);for(let t=0;t<r.length;t+=1)e[r[t].name]=r[t].length;return e}async getSequenceSize(t,e){var n;return null===(n=(await this._getIndexes(e)).name[t])||void 0===n?void 0:n.length}async hasReferenceSequence(t,e){return!!(await this._getIndexes(e)).name[t]}async getResiduesById(t,e,n,r){const i=(await this._getIndexes(r)).id[t];if(i)return this._fetchFromIndexEntry(i,e,n,r)}async getResiduesByName(t,e,n,r){const i=(await this._getIndexes(r)).name[t];if(i)return this._fetchFromIndexEntry(i,e,n,r)}async getSequence(t,e,n,r){return this.getResiduesByName(t,e,n,r)}async _fetchFromIndexEntry(e,n=0,r,a){let s=r;if(n<0)throw new TypeError("regionStart cannot be less than 0");if((void 0===s||s>e.length)&&(s=e.length),n>=s)return"";const o=i(e,n),h=i(e,s)-o;if(h>this.chunkSizeLimit)throw new Error(`data size of ${h.toLocaleString()} bytes exceeded chunk size limit of ${this.chunkSizeLimit.toLocaleString()} bytes`);const l=t.allocUnsafe(h);return await this.fasta.read(l,0,h,o,a),l.toString("utf8").replace(/\s+/g,"")}}}).call(this,n(1).Buffer)},function(t,e,n){"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){},,function(t,e){var n;n=function(){return this}();try{n=n||new Function("return this")()}catch(t){"object"==typeof window&&(n=window)}t.exports=n},function(t,e,n){"use strict";(function(t){n.d(e,"a",(function(){return s}));var r=n(4),i=n(17),a=n(0);class s{constructor({filehandle:t,path:e,gziFilehandle:n,gziPath:r}){if(t)this.filehandle=t;else{if(!e)throw new TypeError("either filehandle or path must be defined");this.filehandle=new a.a(e)}if(!n&&!r&&!e)throw new TypeError("either gziFilehandle or gziPath must be defined");this.gzi=new i.a({filehandle:n,path:n||r||!e?e+".gzi":r})}async stat(){const t=await this.filehandle.stat();return Object.assign(t,{size:await this.getUncompressedFileSize(),blocks:void 0,blksize:void 0})}async getUncompressedFileSize(){const[,e]=await this.gzi.getLastBlock(),{size:n}=await this.filehandle.stat(),r=t.allocUnsafe(4),{bytesRead:i}=await this.filehandle.read(r,0,4,n-28-4);if(4!==i)throw new Error("read error");return e+r.readUInt32LE(0)}async _readAndUncompressBlock(t,[e],[n]){let i=n;i||(i=(await this.filehandle.stat()).size);const a=i-e;await this.filehandle.read(t,0,a,e);return await Object(r.a)(t.slice(0,a))}async read(e,n,r,i){const a=await this.gzi.getRelevantBlocksForRead(r,i),s=t.allocUnsafe(65536);let o=n,h=0;for(let t=0;t<a.length-1;t+=1){const n=await this._readAndUncompressBlock(s,a[t],a[t+1]),[,l]=a[t],u=l>=i?0:i-l,c=Math.min(i+r,l+n.length)-l;u>=0&&u<n.length&&(n.copy(e,o,u,c),o+=c-u,h+=c-u)}return{bytesRead:h,buffer:e}}}}).call(this,n(1).Buffer)},function(t,e,n){"use strict";t.exports=function(t,e,n,r){for(var i=65535&t|0,a=t>>>16&65535|0,s=0;0!==n;){n-=s=n>2e3?2e3:n;do{a=a+(i=i+e[r++]|0)|0}while(--s);i%=65521,a%=65521}return i|a<<16|0}},function(t,e,n){"use strict";var r=function(){for(var t,e=[],n=0;n<256;n++){t=n;for(var r=0;r<8;r++)t=1&t?3988292384^t>>>1:t>>>1;e[n]=t}return e}();t.exports=function(t,e,n,i){var a=r,s=i+n;t^=-1;for(var o=i;o<s;o++)t=t>>>8^a[255&(t^e[o])];return-1^t}},function(t,e,n){"use strict";var r=n(2),i=!0,a=!0;try{String.fromCharCode.apply(null,[0])}catch(t){i=!1}try{String.fromCharCode.apply(null,new Uint8Array(1))}catch(t){a=!1}for(var s=new r.Buf8(256),o=0;o<256;o++)s[o]=o>=252?6:o>=248?5:o>=240?4:o>=224?3:o>=192?2:1;function h(t,e){if(e<65534&&(t.subarray&&a||!t.subarray&&i))return String.fromCharCode.apply(null,r.shrinkBuf(t,e));for(var n="",s=0;s<e;s++)n+=String.fromCharCode(t[s]);return n}s[254]=s[254]=1,e.string2buf=function(t){var e,n,i,a,s,o=t.length,h=0;for(a=0;a<o;a++)55296==(64512&(n=t.charCodeAt(a)))&&a+1<o&&56320==(64512&(i=t.charCodeAt(a+1)))&&(n=65536+(n-55296<<10)+(i-56320),a++),h+=n<128?1:n<2048?2:n<65536?3:4;for(e=new r.Buf8(h),s=0,a=0;s<h;a++)55296==(64512&(n=t.charCodeAt(a)))&&a+1<o&&56320==(64512&(i=t.charCodeAt(a+1)))&&(n=65536+(n-55296<<10)+(i-56320),a++),n<128?e[s++]=n:n<2048?(e[s++]=192|n>>>6,e[s++]=128|63&n):n<65536?(e[s++]=224|n>>>12,e[s++]=128|n>>>6&63,e[s++]=128|63&n):(e[s++]=240|n>>>18,e[s++]=128|n>>>12&63,e[s++]=128|n>>>6&63,e[s++]=128|63&n);return e},e.buf2binstring=function(t){return h(t,t.length)},e.binstring2buf=function(t){for(var e=new r.Buf8(t.length),n=0,i=e.length;n<i;n++)e[n]=t.charCodeAt(n);return e},e.buf2string=function(t,e){var n,r,i,a,o=e||t.length,l=new Array(2*o);for(r=0,n=0;n<o;)if((i=t[n++])<128)l[r++]=i;else if((a=s[i])>4)l[r++]=65533,n+=a-1;else{for(i&=2===a?31:3===a?15:7;a>1&&n<o;)i=i<<6|63&t[n++],a--;a>1?l[r++]=65533:i<65536?l[r++]=i:(i-=65536,l[r++]=55296|i>>10&1023,l[r++]=56320|1023&i)}return h(l,r)},e.utf8border=function(t,e){var n;for((e=e||t.length)>t.length&&(e=t.length),n=e-1;n>=0&&128==(192&t[n]);)n--;return n<0||0===n?e:n+s[t[n]]>e?n:e}},function(t,e,n){"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,n){"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,n){t.exports=n(20)},function(t,e,n){"use strict";(function(t){n.d(e,"a",(function(){return s}));var r=n(18),i=n.n(r),a=n(0);class s{constructor({filehandle:t,path:e}){if(t)this.filehandle=t;else{if(!e)throw new TypeError("either filehandle or path must be defined");this.filehandle=new a.a(e)}}_readLongWithOverflow(t,e=0,n=!0){const r=i.a.fromBytesLE(t.slice(e,e+8),n);if(r.greaterThan(Number.MAX_SAFE_INTEGER)||r.lessThan(Number.MIN_SAFE_INTEGER))throw new TypeError("integer overflow");return r.toNumber()}_getIndex(){return this.index||(this.index=this._readIndex()),this.index}async _readIndex(){let e=t.allocUnsafe(8);await this.filehandle.read(e,0,8,0);const n=this._readLongWithOverflow(e,0,!0);if(!n)return[[0,0]];const r=new Array(n+1);r[0]=[0,0];const i=16*n;if(i>Number.MAX_SAFE_INTEGER)throw new TypeError("integer overflow");e=t.allocUnsafe(i),await this.filehandle.read(e,0,i,8);for(let t=0;t<n;t+=1){const n=this._readLongWithOverflow(e,16*t),i=this._readLongWithOverflow(e,16*t+8);r[t+1]=[n,i]}return r}async getLastBlock(){const t=await this._getIndex();if(t.length)return t[t.length-1]}async getRelevantBlocksForRead(t,e){const n=e+t;if(0===t)return[];const r=await this._getIndex(),i=[],a=(t,n)=>{const r=t[1],i=n?n[1]:1/0;return r<=e&&i>e?0:r<e?-1:1};let s=0,o=r.length-1,h=Math.floor(r.length/2),l=a(r[h],r[h+1]);for(;0!==l;)l>0?o=h-1:l<0&&(s=h+1),h=Math.ceil((o-s)/2)+s,l=a(r[h],r[h+1]);i.push(r[h]);let u=h+1;for(;u<r.length&&(i.push(r[u]),!(r[u][1]>=n));u+=1);return i[i.length-1][1]<n&&i.push([]),i}}}).call(this,n(1).Buffer)},function(t,e,n){var r,i=function(t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e=null;try{e=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,n){this.low=0|t,this.high=0|e,this.unsigned=!!n}function r(t){return!0===(t&&t.__isLong__)}function i(t){var e=Math.clz32(t&-t);return t?31-e:e}n.prototype.__isLong__,Object.defineProperty(n.prototype,"__isLong__",{value:!0}),n.isLong=r;var a={},s={};function o(t,e){var n,r,i;return e?(i=0<=(t>>>=0)&&t<256)&&(r=s[t])?r:(n=l(t,0,!0),i&&(s[t]=n),n):(i=-128<=(t|=0)&&t<128)&&(r=a[t])?r:(n=l(t,t<0?-1:0,!1),i&&(a[t]=n),n)}function h(t,e){if(isNaN(t))return e?w:v;if(e){if(t<0)return w;if(t>=p)return x}else{if(t<=-g)return A;if(t+1>=g)return k}return t<0?h(-t,e).neg():l(t%d|0,t/d|0,e)}function l(t,e,r){return new n(t,e,r)}n.fromInt=o,n.fromNumber=h,n.fromBits=l;var u=Math.pow;function c(t,e,n){if(0===t.length)throw Error("empty string");if("number"==typeof e?(n=e,e=!1):e=!!e,"NaN"===t||"Infinity"===t||"+Infinity"===t||"-Infinity"===t)return e?w:v;if((n=n||10)<2||36<n)throw RangeError("radix");var r;if((r=t.indexOf("-"))>0)throw Error("interior hyphen");if(0===r)return c(t.substring(1),e,n).neg();for(var i=h(u(n,8)),a=v,s=0;s<t.length;s+=8){var o=Math.min(8,t.length-s),l=parseInt(t.substring(s,s+o),n);if(o<8){var f=h(u(n,o));a=a.mul(f).add(h(l))}else a=(a=a.mul(i)).add(h(l))}return a.unsigned=e,a}function f(t,e){return"number"==typeof t?h(t,e):"string"==typeof t?c(t,e):l(t.low,t.high,"boolean"==typeof e?e:t.unsigned)}n.fromString=c,n.fromValue=f;var d=4294967296,p=d*d,g=p/2,m=o(1<<24),v=o(0);n.ZERO=v;var w=o(0,!0);n.UZERO=w;var b=o(1);n.ONE=b;var _=o(1,!0);n.UONE=_;var y=o(-1);n.NEG_ONE=y;var k=l(-1,2147483647,!1);n.MAX_VALUE=k;var x=l(-1,-1,!0);n.MAX_UNSIGNED_VALUE=x;var A=l(0,-2147483648,!1);n.MIN_VALUE=A;var T=n.prototype;T.toInt=function(){return this.unsigned?this.low>>>0:this.low},T.toNumber=function(){return this.unsigned?(this.high>>>0)*d+(this.low>>>0):this.high*d+(this.low>>>0)},T.toString=function(t){if((t=t||10)<2||36<t)throw RangeError("radix");if(this.isZero())return"0";if(this.isNegative()){if(this.eq(A)){var e=h(t),n=this.div(e),r=n.mul(e).sub(this);return n.toString(t)+r.toInt().toString(t)}return"-"+this.neg().toString(t)}for(var i=h(u(t,6),this.unsigned),a=this,s="";;){var o=a.div(i),l=(a.sub(o.mul(i)).toInt()>>>0).toString(t);if((a=o).isZero())return l+s;for(;l.length<6;)l="0"+l;s=""+l+s}},T.getHighBits=function(){return this.high},T.getHighBitsUnsigned=function(){return this.high>>>0},T.getLowBits=function(){return this.low},T.getLowBitsUnsigned=function(){return this.low>>>0},T.getNumBitsAbs=function(){if(this.isNegative())return this.eq(A)?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},T.isZero=function(){return 0===this.high&&0===this.low},T.eqz=T.isZero,T.isNegative=function(){return!this.unsigned&&this.high<0},T.isPositive=function(){return this.unsigned||this.high>=0},T.isOdd=function(){return 1==(1&this.low)},T.isEven=function(){return 0==(1&this.low)},T.equals=function(t){return r(t)||(t=f(t)),(this.unsigned===t.unsigned||this.high>>>31!=1||t.high>>>31!=1)&&(this.high===t.high&&this.low===t.low)},T.eq=T.equals,T.notEquals=function(t){return!this.eq(t)},T.neq=T.notEquals,T.ne=T.notEquals,T.lessThan=function(t){return this.comp(t)<0},T.lt=T.lessThan,T.lessThanOrEqual=function(t){return this.comp(t)<=0},T.lte=T.lessThanOrEqual,T.le=T.lessThanOrEqual,T.greaterThan=function(t){return this.comp(t)>0},T.gt=T.greaterThan,T.greaterThanOrEqual=function(t){return this.comp(t)>=0},T.gte=T.greaterThanOrEqual,T.ge=T.greaterThanOrEqual,T.compare=function(t){if(r(t)||(t=f(t)),this.eq(t))return 0;var e=this.isNegative(),n=t.isNegative();return e&&!n?-1:!e&&n?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},T.comp=T.compare,T.negate=function(){return!this.unsigned&&this.eq(A)?A:this.not().add(b)},T.neg=T.negate,T.add=function(t){r(t)||(t=f(t));var e=this.high>>>16,n=65535&this.high,i=this.low>>>16,a=65535&this.low,s=t.high>>>16,o=65535&t.high,h=t.low>>>16,u=0,c=0,d=0,p=0;return d+=(p+=a+(65535&t.low))>>>16,c+=(d+=i+h)>>>16,u+=(c+=n+o)>>>16,u+=e+s,l((d&=65535)<<16|(p&=65535),(u&=65535)<<16|(c&=65535),this.unsigned)},T.subtract=function(t){return r(t)||(t=f(t)),this.add(t.neg())},T.sub=T.subtract,T.multiply=function(t){if(this.isZero())return this;if(r(t)||(t=f(t)),e)return l(e.mul(this.low,this.high,t.low,t.high),e.get_high(),this.unsigned);if(t.isZero())return this.unsigned?w:v;if(this.eq(A))return t.isOdd()?A:v;if(t.eq(A))return this.isOdd()?A: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(m)&&t.lt(m))return h(this.toNumber()*t.toNumber(),this.unsigned);var n=this.high>>>16,i=65535&this.high,a=this.low>>>16,s=65535&this.low,o=t.high>>>16,u=65535&t.high,c=t.low>>>16,d=65535&t.low,p=0,g=0,b=0,_=0;return b+=(_+=s*d)>>>16,g+=(b+=a*d)>>>16,b&=65535,g+=(b+=s*c)>>>16,p+=(g+=i*d)>>>16,g&=65535,p+=(g+=a*c)>>>16,g&=65535,p+=(g+=s*u)>>>16,p+=n*d+i*c+a*u+s*o,l((b&=65535)<<16|(_&=65535),(p&=65535)<<16|(g&=65535),this.unsigned)},T.mul=T.multiply,T.divide=function(t){if(r(t)||(t=f(t)),t.isZero())throw Error("division by zero");var n,i,a;if(e)return this.unsigned||-2147483648!==this.high||-1!==t.low||-1!==t.high?l((this.unsigned?e.div_u:e.div_s)(this.low,this.high,t.low,t.high),e.get_high(),this.unsigned):this;if(this.isZero())return this.unsigned?w:v;if(this.unsigned){if(t.unsigned||(t=t.toUnsigned()),t.gt(this))return w;if(t.gt(this.shru(1)))return _;a=w}else{if(this.eq(A))return t.eq(b)||t.eq(y)?A:t.eq(A)?b:(n=this.shr(1).div(t).shl(1)).eq(v)?t.isNegative()?b:y:(i=this.sub(t.mul(n)),a=n.add(i.div(t)));if(t.eq(A))return this.unsigned?w: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();a=v}for(i=this;i.gte(t);){n=Math.max(1,Math.floor(i.toNumber()/t.toNumber()));for(var s=Math.ceil(Math.log(n)/Math.LN2),o=s<=48?1:u(2,s-48),c=h(n),d=c.mul(t);d.isNegative()||d.gt(i);)d=(c=h(n-=o,this.unsigned)).mul(t);c.isZero()&&(c=b),a=a.add(c),i=i.sub(d)}return a},T.div=T.divide,T.modulo=function(t){return r(t)||(t=f(t)),e?l((this.unsigned?e.rem_u:e.rem_s)(this.low,this.high,t.low,t.high),e.get_high(),this.unsigned):this.sub(this.div(t).mul(t))},T.mod=T.modulo,T.rem=T.modulo,T.not=function(){return l(~this.low,~this.high,this.unsigned)},T.countLeadingZeros=function(){return this.high?Math.clz32(this.high):Math.clz32(this.low)+32},T.clz=T.countLeadingZeros,T.countTrailingZeros=function(){return this.low?i(this.low):i(this.high)+32},T.ctz=T.countTrailingZeros,T.and=function(t){return r(t)||(t=f(t)),l(this.low&t.low,this.high&t.high,this.unsigned)},T.or=function(t){return r(t)||(t=f(t)),l(this.low|t.low,this.high|t.high,this.unsigned)},T.xor=function(t){return r(t)||(t=f(t)),l(this.low^t.low,this.high^t.high,this.unsigned)},T.shiftLeft=function(t){return r(t)&&(t=t.toInt()),0==(t&=63)?this:t<32?l(this.low<<t,this.high<<t|this.low>>>32-t,this.unsigned):l(0,this.low<<t-32,this.unsigned)},T.shl=T.shiftLeft,T.shiftRight=function(t){return r(t)&&(t=t.toInt()),0==(t&=63)?this:t<32?l(this.low>>>t|this.high<<32-t,this.high>>t,this.unsigned):l(this.high>>t-32,this.high>=0?0:-1,this.unsigned)},T.shr=T.shiftRight,T.shiftRightUnsigned=function(t){return r(t)&&(t=t.toInt()),0==(t&=63)?this:t<32?l(this.low>>>t|this.high<<32-t,this.high>>>t,this.unsigned):l(32===t?this.high:this.high>>>t-32,0,this.unsigned)},T.shru=T.shiftRightUnsigned,T.shr_u=T.shiftRightUnsigned,T.rotateLeft=function(t){var e;return r(t)&&(t=t.toInt()),0==(t&=63)?this:32===t?l(this.high,this.low,this.unsigned):t<32?(e=32-t,l(this.low<<t|this.high>>>e,this.high<<t|this.low>>>e,this.unsigned)):(e=32-(t-=32),l(this.high<<t|this.low>>>e,this.low<<t|this.high>>>e,this.unsigned))},T.rotl=T.rotateLeft,T.rotateRight=function(t){var e;return r(t)&&(t=t.toInt()),0==(t&=63)?this:32===t?l(this.high,this.low,this.unsigned):t<32?(e=32-t,l(this.high<<e|this.low>>>t,this.low<<e|this.high>>>t,this.unsigned)):(e=32-(t-=32),l(this.low<<e|this.high>>>t,this.high<<e|this.low>>>t,this.unsigned))},T.rotr=T.rotateRight,T.toSigned=function(){return this.unsigned?l(this.low,this.high,!1):this},T.toUnsigned=function(){return this.unsigned?this:l(this.low,this.high,!0)},T.toBytes=function(t){return t?this.toBytesLE():this.toBytesBE()},T.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]},T.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)};var S=n;return t.default=S,"default"in t?t.default:t}({});void 0===(r=function(){return i}.apply(e,[]))||(t.exports=r)},,function(t,e,n){(function(t){var r=n(24);e.encode=function(e){var n=r.parse(e);return new t(n).toString("base64").replace(/\+/g,"-").replace(/\//g,"_").substring(0,22)},e.decode=function(e){var n=e.replace(/-/g,"+").replace(/_/g,"/")+"==";return r.unparse(new t(n,"base64"))},e.v4=function(){return r.v4(null,new t(16)).toString("base64").replace(/\+/g,"-").replace(/\//g,"_").substring(0,22)},e.nice=function(){var e=r.v4(null,new t(16));return e[0]=127&e[0],e.toString("base64").replace(/\+/g,"-").replace(/\//g,"_").substring(0,22)}}).call(this,n(1).Buffer)},function(t,e,n){"use strict";e.byteLength=function(t){var e=l(t),n=e[0],r=e[1];return 3*(n+r)/4-r},e.toByteArray=function(t){var e,n,r=l(t),s=r[0],o=r[1],h=new a(function(t,e,n){return 3*(e+n)/4-n}(0,s,o)),u=0,c=o>0?s-4:s;for(n=0;n<c;n+=4)e=i[t.charCodeAt(n)]<<18|i[t.charCodeAt(n+1)]<<12|i[t.charCodeAt(n+2)]<<6|i[t.charCodeAt(n+3)],h[u++]=e>>16&255,h[u++]=e>>8&255,h[u++]=255&e;2===o&&(e=i[t.charCodeAt(n)]<<2|i[t.charCodeAt(n+1)]>>4,h[u++]=255&e);1===o&&(e=i[t.charCodeAt(n)]<<10|i[t.charCodeAt(n+1)]<<4|i[t.charCodeAt(n+2)]>>2,h[u++]=e>>8&255,h[u++]=255&e);return h},e.fromByteArray=function(t){for(var e,n=t.length,i=n%3,a=[],s=0,o=n-i;s<o;s+=16383)a.push(u(t,s,s+16383>o?o:s+16383));1===i?(e=t[n-1],a.push(r[e>>2]+r[e<<4&63]+"==")):2===i&&(e=(t[n-2]<<8)+t[n-1],a.push(r[e>>10]+r[e>>4&63]+r[e<<2&63]+"="));return a.join("")};for(var r=[],i=[],a="undefined"!=typeof Uint8Array?Uint8Array:Array,s="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",o=0,h=s.length;o<h;++o)r[o]=s[o],i[s.charCodeAt(o)]=o;function l(t){var e=t.length;if(e%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var n=t.indexOf("=");return-1===n&&(n=e),[n,n===e?0:4-n%4]}function u(t,e,n){for(var i,a,s=[],o=e;o<n;o+=3)i=(t[o]<<16&16711680)+(t[o+1]<<8&65280)+(255&t[o+2]),s.push(r[(a=i)>>18&63]+r[a>>12&63]+r[a>>6&63]+r[63&a]);return s.join("")}i["-".charCodeAt(0)]=62,i["_".charCodeAt(0)]=63},function(t,e){e.read=function(t,e,n,r,i){var a,s,o=8*i-r-1,h=(1<<o)-1,l=h>>1,u=-7,c=n?i-1:0,f=n?-1:1,d=t[e+c];for(c+=f,a=d&(1<<-u)-1,d>>=-u,u+=o;u>0;a=256*a+t[e+c],c+=f,u-=8);for(s=a&(1<<-u)-1,a>>=-u,u+=r;u>0;s=256*s+t[e+c],c+=f,u-=8);if(0===a)a=1-l;else{if(a===h)return s?NaN:1/0*(d?-1:1);s+=Math.pow(2,r),a-=l}return(d?-1:1)*s*Math.pow(2,a-r)},e.write=function(t,e,n,r,i,a){var s,o,h,l=8*a-i-1,u=(1<<l)-1,c=u>>1,f=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,d=r?0:a-1,p=r?1:-1,g=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(o=isNaN(e)?1:0,s=u):(s=Math.floor(Math.log(e)/Math.LN2),e*(h=Math.pow(2,-s))<1&&(s--,h*=2),(e+=s+c>=1?f/h:f*Math.pow(2,1-c))*h>=2&&(s++,h/=2),s+c>=u?(o=0,s=u):s+c>=1?(o=(e*h-1)*Math.pow(2,i),s+=c):(o=e*Math.pow(2,c-1)*Math.pow(2,i),s=0));i>=8;t[n+d]=255&o,d+=p,o/=256,i-=8);for(s=s<<i|o,l+=i;l>0;t[n+d]=255&s,d+=p,s/=256,l-=8);t[n+d-p]|=128*g}},function(t,e){var n={}.toString;t.exports=Array.isArray||function(t){return"[object Array]"==n.call(t)}},function(t,e,n){for(var r=n(25),i=[],a={},s=0;s<256;s++)i[s]=(s+256).toString(16).substr(1),a[i[s]]=s;function o(t,e){var n=e||0,r=i;return r[t[n++]]+r[t[n++]]+r[t[n++]]+r[t[n++]]+"-"+r[t[n++]]+r[t[n++]]+"-"+r[t[n++]]+r[t[n++]]+"-"+r[t[n++]]+r[t[n++]]+"-"+r[t[n++]]+r[t[n++]]+r[t[n++]]+r[t[n++]]+r[t[n++]]+r[t[n++]]}var h=r(),l=[1|h[0],h[1],h[2],h[3],h[4],h[5]],u=16383&(h[6]<<8|h[7]),c=0,f=0;function d(t,e,n){var i=e&&n||0;"string"==typeof t&&(e="binary"==t?new Array(16):null,t=null);var a=(t=t||{}).random||(t.rng||r)();if(a[6]=15&a[6]|64,a[8]=63&a[8]|128,e)for(var s=0;s<16;s++)e[i+s]=a[s];return e||o(a)}var p=d;p.v1=function(t,e,n){var r=e&&n||0,i=e||[],a=void 0!==(t=t||{}).clockseq?t.clockseq:u,s=void 0!==t.msecs?t.msecs:(new Date).getTime(),h=void 0!==t.nsecs?t.nsecs:f+1,d=s-c+(h-f)/1e4;if(d<0&&void 0===t.clockseq&&(a=a+1&16383),(d<0||s>c)&&void 0===t.nsecs&&(h=0),h>=1e4)throw new Error("uuid.v1(): Can't create more than 10M uuids/sec");c=s,f=h,u=a;var p=(1e4*(268435455&(s+=122192928e5))+h)%4294967296;i[r++]=p>>>24&255,i[r++]=p>>>16&255,i[r++]=p>>>8&255,i[r++]=255&p;var g=s/4294967296*1e4&268435455;i[r++]=g>>>8&255,i[r++]=255&g,i[r++]=g>>>24&15|16,i[r++]=g>>>16&255,i[r++]=a>>>8|128,i[r++]=255&a;for(var m=t.node||l,v=0;v<6;v++)i[r+v]=m[v];return e||o(i)},p.v4=d,p.parse=function(t,e,n){var r=e&&n||0,i=0;for(e=e||[],t.toLowerCase().replace(/[0-9a-f]{2}/g,(function(t){i<16&&(e[r+i++]=a[t])}));i<16;)e[r+i++]=0;return e},p.unparse=o,t.exports=p},function(t,e,n){(function(e){var n,r=e.crypto||e.msCrypto;if(r&&r.getRandomValues){var i=new Uint8Array(16);n=function(){return r.getRandomValues(i),i}}if(!n){var a=new Array(16);n=function(){for(var t,e=0;e<16;e++)0==(3&e)&&(t=4294967296*Math.random()),a[e]=t>>>((3&e)<<3)&255;return a}}t.exports=n}).call(this,n(9))},function(t,e,n){"use strict";var r=n(27),i=n(2),a=n(13),s=n(6),o=n(14),h=Object.prototype.toString;function l(t){if(!(this instanceof l))return new l(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 o,this.strm.avail_out=0;var n=r.deflateInit2(this.strm,e.level,e.method,e.windowBits,e.memLevel,e.strategy);if(0!==n)throw new Error(s[n]);if(e.header&&r.deflateSetHeader(this.strm,e.header),e.dictionary){var u;if(u="string"==typeof e.dictionary?a.string2buf(e.dictionary):"[object ArrayBuffer]"===h.call(e.dictionary)?new Uint8Array(e.dictionary):e.dictionary,0!==(n=r.deflateSetDictionary(this.strm,u)))throw new Error(s[n]);this._dict_set=!0}}function u(t,e){var n=new l(e);if(n.push(t,!0),n.err)throw n.msg||s[n.err];return n.result}l.prototype.push=function(t,e){var n,s,o=this.strm,l=this.options.chunkSize;if(this.ended)return!1;s=e===~~e?e:!0===e?4:0,"string"==typeof t?o.input=a.string2buf(t):"[object ArrayBuffer]"===h.call(t)?o.input=new Uint8Array(t):o.input=t,o.next_in=0,o.avail_in=o.input.length;do{if(0===o.avail_out&&(o.output=new i.Buf8(l),o.next_out=0,o.avail_out=l),1!==(n=r.deflate(o,s))&&0!==n)return this.onEnd(n),this.ended=!0,!1;0!==o.avail_out&&(0!==o.avail_in||4!==s&&2!==s)||("string"===this.options.to?this.onData(a.buf2binstring(i.shrinkBuf(o.output,o.next_out))):this.onData(i.shrinkBuf(o.output,o.next_out)))}while((o.avail_in>0||0===o.avail_out)&&1!==n);return 4===s?(n=r.deflateEnd(this.strm),this.onEnd(n),this.ended=!0,0===n):2!==s||(this.onEnd(0),o.avail_out=0,!0)},l.prototype.onData=function(t){this.chunks.push(t)},l.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=l,e.deflate=u,e.deflateRaw=function(t,e){return(e=e||{}).raw=!0,u(t,e)},e.gzip=function(t,e){return(e=e||{}).gzip=!0,u(t,e)}},function(t,e,n){"use strict";var r,i=n(2),a=n(28),s=n(11),o=n(12),h=n(6);function l(t,e){return t.msg=h[e],e}function u(t){return(t<<1)-(t>4?9:0)}function c(t){for(var e=t.length;--e>=0;)t[e]=0}function f(t){var e=t.state,n=e.pending;n>t.avail_out&&(n=t.avail_out),0!==n&&(i.arraySet(t.output,e.pending_buf,e.pending_out,n,t.next_out),t.next_out+=n,e.pending_out+=n,t.total_out+=n,t.avail_out-=n,e.pending-=n,0===e.pending&&(e.pending_out=0))}function d(t,e){a._tr_flush_block(t,t.block_start>=0?t.block_start:-1,t.strstart-t.block_start,e),t.block_start=t.strstart,f(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 m(t,e){var n,r,i=t.max_chain_length,a=t.strstart,s=t.prev_length,o=t.nice_match,h=t.strstart>t.w_size-262?t.strstart-(t.w_size-262):0,l=t.window,u=t.w_mask,c=t.prev,f=t.strstart+258,d=l[a+s-1],p=l[a+s];t.prev_length>=t.good_match&&(i>>=2),o>t.lookahead&&(o=t.lookahead);do{if(l[(n=e)+s]===p&&l[n+s-1]===d&&l[n]===l[a]&&l[++n]===l[a+1]){a+=2,n++;do{}while(l[++a]===l[++n]&&l[++a]===l[++n]&&l[++a]===l[++n]&&l[++a]===l[++n]&&l[++a]===l[++n]&&l[++a]===l[++n]&&l[++a]===l[++n]&&l[++a]===l[++n]&&a<f);if(r=258-(f-a),a=f-258,r>s){if(t.match_start=e,s=r,r>=o)break;d=l[a+s-1],p=l[a+s]}}}while((e=c[e&u])>h&&0!=--i);return s<=t.lookahead?s:t.lookahead}function v(t){var e,n,r,a,h,l,u,c,f,d,p=t.w_size;do{if(a=t.window_size-t.lookahead-t.strstart,t.strstart>=p+(p-262)){i.arraySet(t.window,t.window,p,p,0),t.match_start-=p,t.strstart-=p,t.block_start-=p,e=n=t.hash_size;do{r=t.head[--e],t.head[e]=r>=p?r-p:0}while(--n);e=n=p;do{r=t.prev[--e],t.prev[e]=r>=p?r-p:0}while(--n);a+=p}if(0===t.strm.avail_in)break;if(l=t.strm,u=t.window,c=t.strstart+t.lookahead,f=a,d=void 0,(d=l.avail_in)>f&&(d=f),n=0===d?0:(l.avail_in-=d,i.arraySet(u,l.input,l.next_in,d,c),1===l.state.wrap?l.adler=s(l.adler,u,d,c):2===l.state.wrap&&(l.adler=o(l.adler,u,d,c)),l.next_in+=d,l.total_in+=d,d),t.lookahead+=n,t.lookahead+t.insert>=3)for(h=t.strstart-t.insert,t.ins_h=t.window[h],t.ins_h=(t.ins_h<<t.hash_shift^t.window[h+1])&t.hash_mask;t.insert&&(t.ins_h=(t.ins_h<<t.hash_shift^t.window[h+3-1])&t.hash_mask,t.prev[h&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=h,h++,t.insert--,!(t.lookahead+t.insert<3)););}while(t.lookahead<262&&0!==t.strm.avail_in)}function w(t,e){for(var n,r;;){if(t.lookahead<262){if(v(t),t.lookahead<262&&0===e)return 1;if(0===t.lookahead)break}if(n=0,t.lookahead>=3&&(t.ins_h=(t.ins_h<<t.hash_shift^t.window[t.strstart+3-1])&t.hash_mask,n=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart),0!==n&&t.strstart-n<=t.w_size-262&&(t.match_length=m(t,n)),t.match_length>=3)if(r=a._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,n=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 r=a._tr_tally(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++;if(r&&(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 b(t,e){for(var n,r,i;;){if(t.lookahead<262){if(v(t),t.lookahead<262&&0===e)return 1;if(0===t.lookahead)break}if(n=0,t.lookahead>=3&&(t.ins_h=(t.ins_h<<t.hash_shift^t.window[t.strstart+3-1])&t.hash_mask,n=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!==n&&t.prev_length<t.max_lazy_match&&t.strstart-n<=t.w_size-262&&(t.match_length=m(t,n),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,r=a._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,n=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++,r&&(d(t,!1),0===t.strm.avail_out))return 1}else if(t.match_available){if((r=a._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&&(r=a._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 _(t,e,n,r,i){this.good_length=t,this.max_lazy=e,this.nice_length=n,this.max_chain=r,this.func=i}function y(){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),c(this.dyn_ltree),c(this.dyn_dtree),c(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),c(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new i.Buf16(573),c(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 k(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,a._tr_init(e),0):l(t,-2)}function x(t){var e,n=k(t);return 0===n&&((e=t.state).window_size=2*e.w_size,c(e.head),e.max_lazy_match=r[e.level].max_lazy,e.good_match=r[e.level].good_length,e.nice_match=r[e.level].nice_length,e.max_chain_length=r[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),n}function A(t,e,n,r,a,s){if(!t)return-2;var o=1;if(-1===e&&(e=6),r<0?(o=0,r=-r):r>15&&(o=2,r-=16),a<1||a>9||8!==n||r<8||r>15||e<0||e>9||s<0||s>4)return l(t,-2);8===r&&(r=9);var h=new y;return t.state=h,h.strm=t,h.wrap=o,h.gzhead=null,h.w_bits=r,h.w_size=1<<h.w_bits,h.w_mask=h.w_size-1,h.hash_bits=a+7,h.hash_size=1<<h.hash_bits,h.hash_mask=h.hash_size-1,h.hash_shift=~~((h.hash_bits+3-1)/3),h.window=new i.Buf8(2*h.w_size),h.head=new i.Buf16(h.hash_size),h.prev=new i.Buf16(h.w_size),h.lit_bufsize=1<<a+6,h.pending_buf_size=4*h.lit_bufsize,h.pending_buf=new i.Buf8(h.pending_buf_size),h.d_buf=1*h.lit_bufsize,h.l_buf=3*h.lit_bufsize,h.level=e,h.strategy=s,h.method=n,x(t)}r=[new _(0,0,0,0,(function(t,e){var n=65535;for(n>t.pending_buf_size-5&&(n=t.pending_buf_size-5);;){if(t.lookahead<=1){if(v(t),0===t.lookahead&&0===e)return 1;if(0===t.lookahead)break}t.strstart+=t.lookahead,t.lookahead=0;var r=t.block_start+n;if((0===t.strstart||t.strstart>=r)&&(t.lookahead=t.strstart-r,t.strstart=r,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 _(4,4,8,4,w),new _(4,5,16,8,w),new _(4,6,32,32,w),new _(4,4,16,16,b),new _(8,16,32,32,b),new _(8,16,128,128,b),new _(8,32,128,256,b),new _(32,128,258,1024,b),new _(32,258,258,4096,b)],e.deflateInit=function(t,e){return A(t,e,8,15,8,0)},e.deflateInit2=A,e.deflateReset=x,e.deflateResetKeep=k,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 n,i,s,h;if(!t||!t.state||e>5||e<0)return t?l(t,-2):-2;if(i=t.state,!t.output||!t.input&&0!==t.avail_in||666===i.status&&4!==e)return l(t,0===t.avail_out?-5:-2);if(i.strm=t,n=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=o(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 m=8+(i.w_bits-8<<4)<<8;m|=(i.strategy>=2||i.level<2?0:i.level<6?1:6===i.level?2:3)<<6,0!==i.strstart&&(m|=32),m+=31-m%31,i.status=113,g(i,m),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(s=i.pending;i.gzindex<(65535&i.gzhead.extra.length)&&(i.pending!==i.pending_buf_size||(i.gzhead.hcrc&&i.pending>s&&(t.adler=o(t.adler,i.pending_buf,i.pending-s,s)),f(t),s=i.pending,i.pending!==i.pending_buf_size));)p(i,255&i.gzhead.extra[i.gzindex]),i.gzindex++;i.gzhead.hcrc&&i.pending>s&&(t.adler=o(t.adler,i.pending_buf,i.pending-s,s)),i.gzindex===i.gzhead.extra.length&&(i.gzindex=0,i.status=73)}else i.status=73;if(73===i.status)if(i.gzhead.name){s=i.pending;do{if(i.pending===i.pending_buf_size&&(i.gzhead.hcrc&&i.pending>s&&(t.adler=o(t.adler,i.pending_buf,i.pending-s,s)),f(t),s=i.pending,i.pending===i.pending_buf_size)){h=1;break}h=i.gzindex<i.gzhead.name.length?255&i.gzhead.name.charCodeAt(i.gzindex++):0,p(i,h)}while(0!==h);i.gzhead.hcrc&&i.pending>s&&(t.adler=o(t.adler,i.pending_buf,i.pending-s,s)),0===h&&(i.gzindex=0,i.status=91)}else i.status=91;if(91===i.status)if(i.gzhead.comment){s=i.pending;do{if(i.pending===i.pending_buf_size&&(i.gzhead.hcrc&&i.pending>s&&(t.adler=o(t.adler,i.pending_buf,i.pending-s,s)),f(t),s=i.pending,i.pending===i.pending_buf_size)){h=1;break}h=i.gzindex<i.gzhead.comment.length?255&i.gzhead.comment.charCodeAt(i.gzindex++):0,p(i,h)}while(0!==h);i.gzhead.hcrc&&i.pending>s&&(t.adler=o(t.adler,i.pending_buf,i.pending-s,s)),0===h&&(i.status=103)}else i.status=103;if(103===i.status&&(i.gzhead.hcrc?(i.pending+2>i.pending_buf_size&&f(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(f(t),0===t.avail_out)return i.last_flush=-1,0}else if(0===t.avail_in&&u(e)<=u(n)&&4!==e)return l(t,-5);if(666===i.status&&0!==t.avail_in)return l(t,-5);if(0!==t.avail_in||0!==i.lookahead||0!==e&&666!==i.status){var w=2===i.strategy?function(t,e){for(var n;;){if(0===t.lookahead&&(v(t),0===t.lookahead)){if(0===e)return 1;break}if(t.match_length=0,n=a._tr_tally(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++,n&&(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 n,r,i,s,o=t.window;;){if(t.lookahead<=258){if(v(t),t.lookahead<=258&&0===e)return 1;if(0===t.lookahead)break}if(t.match_length=0,t.lookahead>=3&&t.strstart>0&&(r=o[i=t.strstart-1])===o[++i]&&r===o[++i]&&r===o[++i]){s=t.strstart+258;do{}while(r===o[++i]&&r===o[++i]&&r===o[++i]&&r===o[++i]&&r===o[++i]&&r===o[++i]&&r===o[++i]&&r===o[++i]&&i<s);t.match_length=258-(s-i),t.match_length>t.lookahead&&(t.match_length=t.lookahead)}if(t.match_length>=3?(n=a._tr_tally(t,1,t.match_length-3),t.lookahead-=t.match_length,t.strstart+=t.match_length,t.match_length=0):(n=a._tr_tally(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++),n&&(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):r[i.level].func(i,e);if(3!==w&&4!==w||(i.status=666),1===w||3===w)return 0===t.avail_out&&(i.last_flush=-1),0;if(2===w&&(1===e?a._tr_align(i):5!==e&&(a._tr_stored_block(i,0,0,!1),3===e&&(c(i.head),0===i.lookahead&&(i.strstart=0,i.block_start=0,i.insert=0))),f(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)),f(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?l(t,-2):(t.state=null,113===e?l(t,-3):0):-2},e.deflateSetDictionary=function(t,e){var n,r,a,o,h,l,u,f,d=e.length;if(!t||!t.state)return-2;if(2===(o=(n=t.state).wrap)||1===o&&42!==n.status||n.lookahead)return-2;for(1===o&&(t.adler=s(t.adler,e,d,0)),n.wrap=0,d>=n.w_size&&(0===o&&(c(n.head),n.strstart=0,n.block_start=0,n.insert=0),f=new i.Buf8(n.w_size),i.arraySet(f,e,d-n.w_size,n.w_size,0),e=f,d=n.w_size),h=t.avail_in,l=t.next_in,u=t.input,t.avail_in=d,t.next_in=0,t.input=e,v(n);n.lookahead>=3;){r=n.strstart,a=n.lookahead-2;do{n.ins_h=(n.ins_h<<n.hash_shift^n.window[r+3-1])&n.hash_mask,n.prev[r&n.w_mask]=n.head[n.ins_h],n.head[n.ins_h]=r,r++}while(--a);n.strstart=r,n.lookahead=2,v(n)}return n.strstart+=n.lookahead,n.block_start=n.strstart,n.insert=n.lookahead,n.lookahead=0,n.match_length=n.prev_length=2,n.match_available=0,t.next_in=l,t.input=u,t.avail_in=h,n.wrap=o,0},e.deflateInfo="pako deflate (from Nodeca project)"},function(t,e,n){"use strict";var r=n(2);function i(t){for(var e=t.length;--e>=0;)t[e]=0}var a=[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],s=[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],o=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7],h=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],l=new Array(576);i(l);var u=new Array(60);i(u);var c=new Array(512);i(c);var f=new Array(256);i(f);var d=new Array(29);i(d);var p,g,m,v=new Array(30);function w(t,e,n,r,i){this.static_tree=t,this.extra_bits=e,this.extra_base=n,this.elems=r,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?c[t]:c[256+(t>>>7)]}function y(t,e){t.pending_buf[t.pending++]=255&e,t.pending_buf[t.pending++]=e>>>8&255}function k(t,e,n){t.bi_valid>16-n?(t.bi_buf|=e<<t.bi_valid&65535,y(t,t.bi_buf),t.bi_buf=e>>16-t.bi_valid,t.bi_valid+=n-16):(t.bi_buf|=e<<t.bi_valid&65535,t.bi_valid+=n)}function x(t,e,n){k(t,n[2*e],n[2*e+1])}function A(t,e){var n=0;do{n|=1&t,t>>>=1,n<<=1}while(--e>0);return n>>>1}function T(t,e,n){var r,i,a=new Array(16),s=0;for(r=1;r<=15;r++)a[r]=s=s+n[r-1]<<1;for(i=0;i<=e;i++){var o=t[2*i+1];0!==o&&(t[2*i]=A(a[o]++,o))}}function S(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 E(t){t.bi_valid>8?y(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 C(t,e,n,r){var i=2*e,a=2*n;return t[i]<t[a]||t[i]===t[a]&&r[e]<=r[n]}function I(t,e,n){for(var r=t.heap[n],i=n<<1;i<=t.heap_len&&(i<t.heap_len&&C(e,t.heap[i+1],t.heap[i],t.depth)&&i++,!C(e,r,t.heap[i],t.depth));)t.heap[n]=t.heap[i],n=i,i<<=1;t.heap[n]=r}function B(t,e,n){var r,i,o,h,l=0;if(0!==t.last_lit)do{r=t.pending_buf[t.d_buf+2*l]<<8|t.pending_buf[t.d_buf+2*l+1],i=t.pending_buf[t.l_buf+l],l++,0===r?x(t,i,e):(x(t,(o=f[i])+256+1,e),0!==(h=a[o])&&k(t,i-=d[o],h),x(t,o=_(--r),n),0!==(h=s[o])&&k(t,r-=v[o],h))}while(l<t.last_lit);x(t,256,e)}function M(t,e){var n,r,i,a=e.dyn_tree,s=e.stat_desc.static_tree,o=e.stat_desc.has_stree,h=e.stat_desc.elems,l=-1;for(t.heap_len=0,t.heap_max=573,n=0;n<h;n++)0!==a[2*n]?(t.heap[++t.heap_len]=l=n,t.depth[n]=0):a[2*n+1]=0;for(;t.heap_len<2;)a[2*(i=t.heap[++t.heap_len]=l<2?++l:0)]=1,t.depth[i]=0,t.opt_len--,o&&(t.static_len-=s[2*i+1]);for(e.max_code=l,n=t.heap_len>>1;n>=1;n--)I(t,a,n);i=h;do{n=t.heap[1],t.heap[1]=t.heap[t.heap_len--],I(t,a,1),r=t.heap[1],t.heap[--t.heap_max]=n,t.heap[--t.heap_max]=r,a[2*i]=a[2*n]+a[2*r],t.depth[i]=(t.depth[n]>=t.depth[r]?t.depth[n]:t.depth[r])+1,a[2*n+1]=a[2*r+1]=i,t.heap[1]=i++,I(t,a,1)}while(t.heap_len>=2);t.heap[--t.heap_max]=t.heap[1],function(t,e){var n,r,i,a,s,o,h=e.dyn_tree,l=e.max_code,u=e.stat_desc.static_tree,c=e.stat_desc.has_stree,f=e.stat_desc.extra_bits,d=e.stat_desc.extra_base,p=e.stat_desc.max_length,g=0;for(a=0;a<=15;a++)t.bl_count[a]=0;for(h[2*t.heap[t.heap_max]+1]=0,n=t.heap_max+1;n<573;n++)(a=h[2*h[2*(r=t.heap[n])+1]+1]+1)>p&&(a=p,g++),h[2*r+1]=a,r>l||(t.bl_count[a]++,s=0,r>=d&&(s=f[r-d]),o=h[2*r],t.opt_len+=o*(a+s),c&&(t.static_len+=o*(u[2*r+1]+s)));if(0!==g){do{for(a=p-1;0===t.bl_count[a];)a--;t.bl_count[a]--,t.bl_count[a+1]+=2,t.bl_count[p]--,g-=2}while(g>0);for(a=p;0!==a;a--)for(r=t.bl_count[a];0!==r;)(i=t.heap[--n])>l||(h[2*i+1]!==a&&(t.opt_len+=(a-h[2*i+1])*h[2*i],h[2*i+1]=a),r--)}}(t,e),T(a,l,t.bl_count)}function z(t,e,n){var r,i,a=-1,s=e[1],o=0,h=7,l=4;for(0===s&&(h=138,l=3),e[2*(n+1)+1]=65535,r=0;r<=n;r++)i=s,s=e[2*(r+1)+1],++o<h&&i===s||(o<l?t.bl_tree[2*i]+=o:0!==i?(i!==a&&t.bl_tree[2*i]++,t.bl_tree[32]++):o<=10?t.bl_tree[34]++:t.bl_tree[36]++,o=0,a=i,0===s?(h=138,l=3):i===s?(h=6,l=3):(h=7,l=4))}function P(t,e,n){var r,i,a=-1,s=e[1],o=0,h=7,l=4;for(0===s&&(h=138,l=3),r=0;r<=n;r++)if(i=s,s=e[2*(r+1)+1],!(++o<h&&i===s)){if(o<l)do{x(t,i,t.bl_tree)}while(0!=--o);else 0!==i?(i!==a&&(x(t,i,t.bl_tree),o--),x(t,16,t.bl_tree),k(t,o-3,2)):o<=10?(x(t,17,t.bl_tree),k(t,o-3,3)):(x(t,18,t.bl_tree),k(t,o-11,7));o=0,a=i,0===s?(h=138,l=3):i===s?(h=6,l=3):(h=7,l=4)}}i(v);var R=!1;function O(t,e,n,i){k(t,0+(i?1:0),3),function(t,e,n,i){E(t),i&&(y(t,n),y(t,~n)),r.arraySet(t.pending_buf,t.window,e,n,t.pending),t.pending+=n}(t,e,n,!0)}e._tr_init=function(t){R||(!function(){var t,e,n,r,i,h=new Array(16);for(n=0,r=0;r<28;r++)for(d[r]=n,t=0;t<1<<a[r];t++)f[n++]=r;for(f[n-1]=r,i=0,r=0;r<16;r++)for(v[r]=i,t=0;t<1<<s[r];t++)c[i++]=r;for(i>>=7;r<30;r++)for(v[r]=i<<7,t=0;t<1<<s[r]-7;t++)c[256+i++]=r;for(e=0;e<=15;e++)h[e]=0;for(t=0;t<=143;)l[2*t+1]=8,t++,h[8]++;for(;t<=255;)l[2*t+1]=9,t++,h[9]++;for(;t<=279;)l[2*t+1]=7,t++,h[7]++;for(;t<=287;)l[2*t+1]=8,t++,h[8]++;for(T(l,287,h),t=0;t<30;t++)u[2*t+1]=5,u[2*t]=A(t,5);p=new w(l,a,257,286,15),g=new w(u,s,0,30,15),m=new w(new Array(0),o,0,19,7)}(),R=!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,m),t.bi_buf=0,t.bi_valid=0,S(t)},e._tr_stored_block=O,e._tr_flush_block=function(t,e,n,r){var i,a,s=0;t.level>0?(2===t.strm.data_type&&(t.strm.data_type=function(t){var e,n=4093624447;for(e=0;e<=31;e++,n>>>=1)if(1&n&&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)),M(t,t.l_desc),M(t,t.d_desc),s=function(t){var e;for(z(t,t.dyn_ltree,t.l_desc.max_code),z(t,t.dyn_dtree,t.d_desc.max_code),M(t,t.bl_desc),e=18;e>=3&&0===t.bl_tree[2*h[e]+1];e--);return t.opt_len+=3*(e+1)+5+5+4,e}(t),i=t.opt_len+3+7>>>3,(a=t.static_len+3+7>>>3)<=i&&(i=a)):i=a=n+5,n+4<=i&&-1!==e?O(t,e,n,r):4===t.strategy||a===i?(k(t,2+(r?1:0),3),B(t,l,u)):(k(t,4+(r?1:0),3),function(t,e,n,r){var i;for(k(t,e-257,5),k(t,n-1,5),k(t,r-4,4),i=0;i<r;i++)k(t,t.bl_tree[2*h[i]+1],3);P(t,t.dyn_ltree,e-1),P(t,t.dyn_dtree,n-1)}(t,t.l_desc.max_code+1,t.d_desc.max_code+1,s+1),B(t,t.dyn_ltree,t.dyn_dtree)),S(t),r&&E(t)},e._tr_tally=function(t,e,n){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&n,t.last_lit++,0===e?t.dyn_ltree[2*n]++:(t.matches++,e--,t.dyn_ltree[2*(f[n]+256+1)]++,t.dyn_dtree[2*_(e)]++),t.last_lit===t.lit_bufsize-1},e._tr_align=function(t){k(t,2,3),x(t,256,l),function(t){16===t.bi_valid?(y(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,n){"use strict";var r=n(30),i=n(2),a=n(13),s=n(15),o=n(6),h=n(14),l=n(33),u=Object.prototype.toString;function c(t){if(!(this instanceof c))return new c(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 h,this.strm.avail_out=0;var n=r.inflateInit2(this.strm,e.windowBits);if(n!==s.Z_OK)throw new Error(o[n]);if(this.header=new l,r.inflateGetHeader(this.strm,this.header),e.dictionary&&("string"==typeof e.dictionary?e.dictionary=a.string2buf(e.dictionary):"[object ArrayBuffer]"===u.call(e.dictionary)&&(e.dictionary=new Uint8Array(e.dictionary)),e.raw&&(n=r.inflateSetDictionary(this.strm,e.dictionary))!==s.Z_OK))throw new Error(o[n])}function f(t,e){var n=new c(e);if(n.push(t,!0),n.err)throw n.msg||o[n.err];return n.result}c.prototype.push=function(t,e){var n,o,h,l,c,f=this.strm,d=this.options.chunkSize,p=this.options.dictionary,g=!1;if(this.ended)return!1;o=e===~~e?e:!0===e?s.Z_FINISH:s.Z_NO_FLUSH,"string"==typeof t?f.input=a.binstring2buf(t):"[object ArrayBuffer]"===u.call(t)?f.input=new Uint8Array(t):f.input=t,f.next_in=0,f.avail_in=f.input.length;do{if(0===f.avail_out&&(f.output=new i.Buf8(d),f.next_out=0,f.avail_out=d),(n=r.inflate(f,s.Z_NO_FLUSH))===s.Z_NEED_DICT&&p&&(n=r.inflateSetDictionary(this.strm,p)),n===s.Z_BUF_ERROR&&!0===g&&(n=s.Z_OK,g=!1),n!==s.Z_STREAM_END&&n!==s.Z_OK)return this.onEnd(n),this.ended=!0,!1;f.next_out&&(0!==f.avail_out&&n!==s.Z_STREAM_END&&(0!==f.avail_in||o!==s.Z_FINISH&&o!==s.Z_SYNC_FLUSH)||("string"===this.options.to?(h=a.utf8border(f.output,f.next_out),l=f.next_out-h,c=a.buf2string(f.output,h),f.next_out=l,f.avail_out=d-l,l&&i.arraySet(f.output,f.output,h,l,0),this.onData(c)):this.onData(i.shrinkBuf(f.output,f.next_out)))),0===f.avail_in&&0===f.avail_out&&(g=!0)}while((f.avail_in>0||0===f.avail_out)&&n!==s.Z_STREAM_END);return n===s.Z_STREAM_END&&(o=s.Z_FINISH),o===s.Z_FINISH?(n=r.inflateEnd(this.strm),this.onEnd(n),this.ended=!0,n===s.Z_OK):o!==s.Z_SYNC_FLUSH||(this.onEnd(s.Z_OK),f.avail_out=0,!0)},c.prototype.onData=function(t){this.chunks.push(t)},c.prototype.onEnd=function(t){t===s.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=c,e.inflate=f,e.inflateRaw=function(t,e){return(e=e||{}).raw=!0,f(t,e)},e.ungzip=f},function(t,e,n){"use strict";var r=n(2),i=n(11),a=n(12),s=n(31),o=n(32);function h(t){return(t>>>24&255)+(t>>>8&65280)+((65280&t)<<8)+((255&t)<<24)}function l(){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 r.Buf16(320),this.work=new r.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function u(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 r.Buf32(852),e.distcode=e.distdyn=new r.Buf32(592),e.sane=1,e.back=-1,0):-2}function c(t){var e;return t&&t.state?((e=t.state).wsize=0,e.whave=0,e.wnext=0,u(t)):-2}function f(t,e){var n,r;return t&&t.state?(r=t.state,e<0?(n=0,e=-e):(n=1+(e>>4),e<48&&(e&=15)),e&&(e<8||e>15)?-2:(null!==r.window&&r.wbits!==e&&(r.window=null),r.wrap=n,r.wbits=e,c(t))):-2}function d(t,e){var n,r;return t?(r=new l,t.state=r,r.window=null,0!==(n=f(t,e))&&(t.state=null),n):-2}var p,g,m=!0;function v(t){if(m){var e;for(p=new r.Buf32(512),g=new r.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(o(1,t.lens,0,288,p,0,t.work,{bits:9}),e=0;e<32;)t.lens[e++]=5;o(2,t.lens,0,32,g,0,t.work,{bits:5}),m=!1}t.lencode=p,t.lenbits=9,t.distcode=g,t.distbits=5}function w(t,e,n,i){var a,s=t.state;return null===s.window&&(s.wsize=1<<s.wbits,s.wnext=0,s.whave=0,s.window=new r.Buf8(s.wsize)),i>=s.wsize?(r.arraySet(s.window,e,n-s.wsize,s.wsize,0),s.wnext=0,s.whave=s.wsize):((a=s.wsize-s.wnext)>i&&(a=i),r.arraySet(s.window,e,n-i,a,s.wnext),(i-=a)?(r.arraySet(s.window,e,n-i,i,0),s.wnext=i,s.whave=s.wsize):(s.wnext+=a,s.wnext===s.wsize&&(s.wnext=0),s.whave<s.wsize&&(s.whave+=a))),0}e.inflateReset=c,e.inflateReset2=f,e.inflateResetKeep=u,e.inflateInit=function(t){return d(t,15)},e.inflateInit2=d,e.inflate=function(t,e){var n,l,u,c,f,d,p,g,m,b,_,y,k,x,A,T,S,E,C,I,B,M,z,P,R=0,O=new r.Buf8(4),N=[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===(n=t.state).mode&&(n.mode=13),f=t.next_out,u=t.output,p=t.avail_out,c=t.next_in,l=t.input,d=t.avail_in,g=n.hold,m=n.bits,b=d,_=p,M=0;t:for(;;)switch(n.mode){case 1:if(0===n.wrap){n.mode=13;break}for(;m<16;){if(0===d)break t;d--,g+=l[c++]<<m,m+=8}if(2&n.wrap&&35615===g){n.check=0,O[0]=255&g,O[1]=g>>>8&255,n.check=a(n.check,O,2,0),g=0,m=0,n.mode=2;break}if(n.flags=0,n.head&&(n.head.done=!1),!(1&n.wrap)||(((255&g)<<8)+(g>>8))%31){t.msg="incorrect header check",n.mode=30;break}if(8!=(15&g)){t.msg="unknown compression method",n.mode=30;break}if(m-=4,B=8+(15&(g>>>=4)),0===n.wbits)n.wbits=B;else if(B>n.wbits){t.msg="invalid window size",n.mode=30;break}n.dmax=1<<B,t.adler=n.check=1,n.mode=512&g?10:12,g=0,m=0;break;case 2:for(;m<16;){if(0===d)break t;d--,g+=l[c++]<<m,m+=8}if(n.flags=g,8!=(255&n.flags)){t.msg="unknown compression method",n.mode=30;break}if(57344&n.flags){t.msg="unknown header flags set",n.mode=30;break}n.head&&(n.head.text=g>>8&1),512&n.flags&&(O[0]=255&g,O[1]=g>>>8&255,n.check=a(n.check,O,2,0)),g=0,m=0,n.mode=3;case 3:for(;m<32;){if(0===d)break t;d--,g+=l[c++]<<m,m+=8}n.head&&(n.head.time=g),512&n.flags&&(O[0]=255&g,O[1]=g>>>8&255,O[2]=g>>>16&255,O[3]=g>>>24&255,n.check=a(n.check,O,4,0)),g=0,m=0,n.mode=4;case 4:for(;m<16;){if(0===d)break t;d--,g+=l[c++]<<m,m+=8}n.head&&(n.head.xflags=255&g,n.head.os=g>>8),512&n.flags&&(O[0]=255&g,O[1]=g>>>8&255,n.check=a(n.check,O,2,0)),g=0,m=0,n.mode=5;case 5:if(1024&n.flags){for(;m<16;){if(0===d)break t;d--,g+=l[c++]<<m,m+=8}n.length=g,n.head&&(n.head.extra_len=g),512&n.flags&&(O[0]=255&g,O[1]=g>>>8&255,n.check=a(n.check,O,2,0)),g=0,m=0}else n.head&&(n.head.extra=null);n.mode=6;case 6:if(1024&n.flags&&((y=n.length)>d&&(y=d),y&&(n.head&&(B=n.head.extra_len-n.length,n.head.extra||(n.head.extra=new Array(n.head.extra_len)),r.arraySet(n.head.extra,l,c,y,B)),512&n.flags&&(n.check=a(n.check,l,y,c)),d-=y,c+=y,n.length-=y),n.length))break t;n.length=0,n.mode=7;case 7:if(2048&n.flags){if(0===d)break t;y=0;do{B=l[c+y++],n.head&&B&&n.length<65536&&(n.head.name+=String.fromCharCode(B))}while(B&&y<d);if(512&n.flags&&(n.check=a(n.check,l,y,c)),d-=y,c+=y,B)break t}else n.head&&(n.head.name=null);n.length=0,n.mode=8;case 8:if(4096&n.flags){if(0===d)break t;y=0;do{B=l[c+y++],n.head&&B&&n.length<65536&&(n.head.comment+=String.fromCharCode(B))}while(B&&y<d);if(512&n.flags&&(n.check=a(n.check,l,y,c)),d-=y,c+=y,B)break t}else n.head&&(n.head.comment=null);n.mode=9;case 9:if(512&n.flags){for(;m<16;){if(0===d)break t;d--,g+=l[c++]<<m,m+=8}if(g!==(65535&n.check)){t.msg="header crc mismatch",n.mode=30;break}g=0,m=0}n.head&&(n.head.hcrc=n.flags>>9&1,n.head.done=!0),t.adler=n.check=0,n.mode=12;break;case 10:for(;m<32;){if(0===d)break t;d--,g+=l[c++]<<m,m+=8}t.adler=n.check=h(g),g=0,m=0,n.mode=11;case 11:if(0===n.havedict)return t.next_out=f,t.avail_out=p,t.next_in=c,t.avail_in=d,n.hold=g,n.bits=m,2;t.adler=n.check=1,n.mode=12;case 12:if(5===e||6===e)break t;case 13:if(n.last){g>>>=7&m,m-=7&m,n.mode=27;break}for(;m<3;){if(0===d)break t;d--,g+=l[c++]<<m,m+=8}switch(n.last=1&g,m-=1,3&(g>>>=1)){case 0:n.mode=14;break;case 1:if(v(n),n.mode=20,6===e){g>>>=2,m-=2;break t}break;case 2:n.mode=17;break;case 3:t.msg="invalid block type",n.mode=30}g>>>=2,m-=2;break;case 14:for(g>>>=7&m,m-=7&m;m<32;){if(0===d)break t;d--,g+=l[c++]<<m,m+=8}if((65535&g)!=(g>>>16^65535)){t.msg="invalid stored block lengths",n.mode=30;break}if(n.length=65535&g,g=0,m=0,n.mode=15,6===e)break t;case 15:n.mode=16;case 16:if(y=n.length){if(y>d&&(y=d),y>p&&(y=p),0===y)break t;r.arraySet(u,l,c,y,f),d-=y,c+=y,p-=y,f+=y,n.length-=y;break}n.mode=12;break;case 17:for(;m<14;){if(0===d)break t;d--,g+=l[c++]<<m,m+=8}if(n.nlen=257+(31&g),g>>>=5,m-=5,n.ndist=1+(31&g),g>>>=5,m-=5,n.ncode=4+(15&g),g>>>=4,m-=4,n.nlen>286||n.ndist>30){t.msg="too many length or distance symbols",n.mode=30;break}n.have=0,n.mode=18;case 18:for(;n.have<n.ncode;){for(;m<3;){if(0===d)break t;d--,g+=l[c++]<<m,m+=8}n.lens[N[n.have++]]=7&g,g>>>=3,m-=3}for(;n.have<19;)n.lens[N[n.have++]]=0;if(n.lencode=n.lendyn,n.lenbits=7,z={bits:n.lenbits},M=o(0,n.lens,0,19,n.lencode,0,n.work,z),n.lenbits=z.bits,M){t.msg="invalid code lengths set",n.mode=30;break}n.have=0,n.mode=19;case 19:for(;n.have<n.nlen+n.ndist;){for(;T=(R=n.lencode[g&(1<<n.lenbits)-1])>>>16&255,S=65535&R,!((A=R>>>24)<=m);){if(0===d)break t;d--,g+=l[c++]<<m,m+=8}if(S<16)g>>>=A,m-=A,n.lens[n.have++]=S;else{if(16===S){for(P=A+2;m<P;){if(0===d)break t;d--,g+=l[c++]<<m,m+=8}if(g>>>=A,m-=A,0===n.have){t.msg="invalid bit length repeat",n.mode=30;break}B=n.lens[n.have-1],y=3+(3&g),g>>>=2,m-=2}else if(17===S){for(P=A+3;m<P;){if(0===d)break t;d--,g+=l[c++]<<m,m+=8}m-=A,B=0,y=3+(7&(g>>>=A)),g>>>=3,m-=3}else{for(P=A+7;m<P;){if(0===d)break t;d--,g+=l[c++]<<m,m+=8}m-=A,B=0,y=11+(127&(g>>>=A)),g>>>=7,m-=7}if(n.have+y>n.nlen+n.ndist){t.msg="invalid bit length repeat",n.mode=30;break}for(;y--;)n.lens[n.have++]=B}}if(30===n.mode)break;if(0===n.lens[256]){t.msg="invalid code -- missing end-of-block",n.mode=30;break}if(n.lenbits=9,z={bits:n.lenbits},M=o(1,n.lens,0,n.nlen,n.lencode,0,n.work,z),n.lenbits=z.bits,M){t.msg="invalid literal/lengths set",n.mode=30;break}if(n.distbits=6,n.distcode=n.distdyn,z={bits:n.distbits},M=o(2,n.lens,n.nlen,n.ndist,n.distcode,0,n.work,z),n.distbits=z.bits,M){t.msg="invalid distances set",n.mode=30;break}if(n.mode=20,6===e)break t;case 20:n.mode=21;case 21:if(d>=6&&p>=258){t.next_out=f,t.avail_out=p,t.next_in=c,t.avail_in=d,n.hold=g,n.bits=m,s(t,_),f=t.next_out,u=t.output,p=t.avail_out,c=t.next_in,l=t.input,d=t.avail_in,g=n.hold,m=n.bits,12===n.mode&&(n.back=-1);break}for(n.back=0;T=(R=n.lencode[g&(1<<n.lenbits)-1])>>>16&255,S=65535&R,!((A=R>>>24)<=m);){if(0===d)break t;d--,g+=l[c++]<<m,m+=8}if(T&&0==(240&T)){for(E=A,C=T,I=S;T=(R=n.lencode[I+((g&(1<<E+C)-1)>>E)])>>>16&255,S=65535&R,!(E+(A=R>>>24)<=m);){if(0===d)break t;d--,g+=l[c++]<<m,m+=8}g>>>=E,m-=E,n.back+=E}if(g>>>=A,m-=A,n.back+=A,n.length=S,0===T){n.mode=26;break}if(32&T){n.back=-1,n.mode=12;break}if(64&T){t.msg="invalid literal/length code",n.mode=30;break}n.extra=15&T,n.mode=22;case 22:if(n.extra){for(P=n.extra;m<P;){if(0===d)break t;d--,g+=l[c++]<<m,m+=8}n.length+=g&(1<<n.extra)-1,g>>>=n.extra,m-=n.extra,n.back+=n.extra}n.was=n.length,n.mode=23;case 23:for(;T=(R=n.distcode[g&(1<<n.distbits)-1])>>>16&255,S=65535&R,!((A=R>>>24)<=m);){if(0===d)break t;d--,g+=l[c++]<<m,m+=8}if(0==(240&T)){for(E=A,C=T,I=S;T=(R=n.distcode[I+((g&(1<<E+C)-1)>>E)])>>>16&255,S=65535&R,!(E+(A=R>>>24)<=m);){if(0===d)break t;d--,g+=l[c++]<<m,m+=8}g>>>=E,m-=E,n.back+=E}if(g>>>=A,m-=A,n.back+=A,64&T){t.msg="invalid distance code",n.mode=30;break}n.offset=S,n.extra=15&T,n.mode=24;case 24:if(n.extra){for(P=n.extra;m<P;){if(0===d)break t;d--,g+=l[c++]<<m,m+=8}n.offset+=g&(1<<n.extra)-1,g>>>=n.extra,m-=n.extra,n.back+=n.extra}if(n.offset>n.dmax){t.msg="invalid distance too far back",n.mode=30;break}n.mode=25;case 25:if(0===p)break t;if(y=_-p,n.offset>y){if((y=n.offset-y)>n.whave&&n.sane){t.msg="invalid distance too far back",n.mode=30;break}y>n.wnext?(y-=n.wnext,k=n.wsize-y):k=n.wnext-y,y>n.length&&(y=n.length),x=n.window}else x=u,k=f-n.offset,y=n.length;y>p&&(y=p),p-=y,n.length-=y;do{u[f++]=x[k++]}while(--y);0===n.length&&(n.mode=21);break;case 26:if(0===p)break t;u[f++]=n.length,p--,n.mode=21;break;case 27:if(n.wrap){for(;m<32;){if(0===d)break t;d--,g|=l[c++]<<m,m+=8}if(_-=p,t.total_out+=_,n.total+=_,_&&(t.adler=n.check=n.flags?a(n.check,u,_,f-_):i(n.check,u,_,f-_)),_=p,(n.flags?g:h(g))!==n.check){t.msg="incorrect data check",n.mode=30;break}g=0,m=0}n.mode=28;case 28:if(n.wrap&&n.flags){for(;m<32;){if(0===d)break t;d--,g+=l[c++]<<m,m+=8}if(g!==(4294967295&n.total)){t.msg="incorrect length check",n.mode=30;break}g=0,m=0}n.mode=29;case 29:M=1;break t;case 30:M=-3;break t;case 31:return-4;case 32:default:return-2}return t.next_out=f,t.avail_out=p,t.next_in=c,t.avail_in=d,n.hold=g,n.bits=m,(n.wsize||_!==t.avail_out&&n.mode<30&&(n.mode<27||4!==e))&&w(t,t.output,t.next_out,_-t.avail_out)?(n.mode=31,-4):(b-=t.avail_in,_-=t.avail_out,t.total_in+=b,t.total_out+=_,n.total+=_,n.wrap&&_&&(t.adler=n.check=n.flags?a(n.check,u,_,t.next_out-_):i(n.check,u,_,t.next_out-_)),t.data_type=n.bits+(n.last?64:0)+(12===n.mode?128:0)+(20===n.mode||15===n.mode?256:0),(0===b&&0===_||4===e)&&0===M&&(M=-5),M)},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 n;return t&&t.state?0==(2&(n=t.state).wrap)?-2:(n.head=e,e.done=!1,0):-2},e.inflateSetDictionary=function(t,e){var n,r=e.length;return t&&t.state?0!==(n=t.state).wrap&&11!==n.mode?-2:11===n.mode&&i(1,e,r,0)!==n.check?-3:w(t,e,r,r)?(n.mode=31,-4):(n.havedict=1,0):-2},e.inflateInfo="pako inflate (from Nodeca project)"},function(t,e,n){"use strict";t.exports=function(t,e){var n,r,i,a,s,o,h,l,u,c,f,d,p,g,m,v,w,b,_,y,k,x,A,T,S;n=t.state,r=t.next_in,T=t.input,i=r+(t.avail_in-5),a=t.next_out,S=t.output,s=a-(e-t.avail_out),o=a+(t.avail_out-257),h=n.dmax,l=n.wsize,u=n.whave,c=n.wnext,f=n.window,d=n.hold,p=n.bits,g=n.lencode,m=n.distcode,v=(1<<n.lenbits)-1,w=(1<<n.distbits)-1;t:do{p<15&&(d+=T[r++]<<p,p+=8,d+=T[r++]<<p,p+=8),b=g[d&v];e:for(;;){if(d>>>=_=b>>>24,p-=_,0===(_=b>>>16&255))S[a++]=65535&b;else{if(!(16&_)){if(0==(64&_)){b=g[(65535&b)+(d&(1<<_)-1)];continue e}if(32&_){n.mode=12;break t}t.msg="invalid literal/length code",n.mode=30;break t}y=65535&b,(_&=15)&&(p<_&&(d+=T[r++]<<p,p+=8),y+=d&(1<<_)-1,d>>>=_,p-=_),p<15&&(d+=T[r++]<<p,p+=8,d+=T[r++]<<p,p+=8),b=m[d&w];n:for(;;){if(d>>>=_=b>>>24,p-=_,!(16&(_=b>>>16&255))){if(0==(64&_)){b=m[(65535&b)+(d&(1<<_)-1)];continue n}t.msg="invalid distance code",n.mode=30;break t}if(k=65535&b,p<(_&=15)&&(d+=T[r++]<<p,(p+=8)<_&&(d+=T[r++]<<p,p+=8)),(k+=d&(1<<_)-1)>h){t.msg="invalid distance too far back",n.mode=30;break t}if(d>>>=_,p-=_,k>(_=a-s)){if((_=k-_)>u&&n.sane){t.msg="invalid distance too far back",n.mode=30;break t}if(x=0,A=f,0===c){if(x+=l-_,_<y){y-=_;do{S[a++]=f[x++]}while(--_);x=a-k,A=S}}else if(c<_){if(x+=l+c-_,(_-=c)<y){y-=_;do{S[a++]=f[x++]}while(--_);if(x=0,c<y){y-=_=c;do{S[a++]=f[x++]}while(--_);x=a-k,A=S}}}else if(x+=c-_,_<y){y-=_;do{S[a++]=f[x++]}while(--_);x=a-k,A=S}for(;y>2;)S[a++]=A[x++],S[a++]=A[x++],S[a++]=A[x++],y-=3;y&&(S[a++]=A[x++],y>1&&(S[a++]=A[x++]))}else{x=a-k;do{S[a++]=S[x++],S[a++]=S[x++],S[a++]=S[x++],y-=3}while(y>2);y&&(S[a++]=S[x++],y>1&&(S[a++]=S[x++]))}break}}break}}while(r<i&&a<o);r-=y=p>>3,d&=(1<<(p-=y<<3))-1,t.next_in=r,t.next_out=a,t.avail_in=r<i?i-r+5:5-(r-i),t.avail_out=a<o?o-a+257:257-(a-o),n.hold=d,n.bits=p}},function(t,e,n){"use strict";var r=n(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],a=[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],s=[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],o=[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,n,h,l,u,c,f){var d,p,g,m,v,w,b,_,y,k=f.bits,x=0,A=0,T=0,S=0,E=0,C=0,I=0,B=0,M=0,z=0,P=null,R=0,O=new r.Buf16(16),N=new r.Buf16(16),G=null,F=0;for(x=0;x<=15;x++)O[x]=0;for(A=0;A<h;A++)O[e[n+A]]++;for(E=k,S=15;S>=1&&0===O[S];S--);if(E>S&&(E=S),0===S)return l[u++]=20971520,l[u++]=20971520,f.bits=1,0;for(T=1;T<S&&0===O[T];T++);for(E<T&&(E=T),B=1,x=1;x<=15;x++)if(B<<=1,(B-=O[x])<0)return-1;if(B>0&&(0===t||1!==S))return-1;for(N[1]=0,x=1;x<15;x++)N[x+1]=N[x]+O[x];for(A=0;A<h;A++)0!==e[n+A]&&(c[N[e[n+A]]++]=A);if(0===t?(P=G=c,w=19):1===t?(P=i,R-=257,G=a,F-=257,w=256):(P=s,G=o,w=-1),z=0,A=0,x=T,v=u,C=E,I=0,g=-1,m=(M=1<<E)-1,1===t&&M>852||2===t&&M>592)return 1;for(;;){b=x-I,c[A]<w?(_=0,y=c[A]):c[A]>w?(_=G[F+c[A]],y=P[R+c[A]]):(_=96,y=0),d=1<<x-I,T=p=1<<C;do{l[v+(z>>I)+(p-=d)]=b<<24|_<<16|y|0}while(0!==p);for(d=1<<x-1;z&d;)d>>=1;if(0!==d?(z&=d-1,z+=d):z=0,A++,0==--O[x]){if(x===S)break;x=e[n+c[A]]}if(x>E&&(z&m)!==g){for(0===I&&(I=E),v+=T,B=1<<(C=x-I);C+I<S&&!((B-=O[C+I])<=0);)C++,B<<=1;if(M+=1<<C,1===t&&M>852||2===t&&M>592)return 1;l[g=z&m]=E<<24|C<<16|v-u|0}}return 0!==z&&(l[v+z]=x-I<<24|64<<16|0),f.bits=E,0}},function(t,e,n){"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,n){"use strict";n.r(e),window.higlassTracks=window.higlassTracks||{},window.higlassTracksByType=window.higlassTracksByType||{},window.higlassDataFetchersByType=window.higlassDataFetchersByType||{};const r=()=>Math.random().toString(36).substring(2,8);var i=(t,e={})=>{const{pluginType:n="track"}=e;"track"===n?((t,{force:e=!1}={})=>{let n=r();for(;window.higlassTracks[n];)n=r();t.name=n,window.higlassTracks[t.name]=t,window.higlassTracksByType[t.config.type]&&!e?console.warn(`A track with the same type (${t.config.type}) was already registered. To override it, set force to true.`):window.higlassTracksByType[t.config.type]=t})(t,e):"dataFetcher"===n&&((t,{force:e=!1}={})=>{window.higlassDataFetchersByType[t.config.type]&&!e?console.warn(`A data fetcher with the same type (${t.config.type}) was already registered. To override it, set force to true.`):window.higlassDataFetchersByType[t.config.type]=t})(t,e)},a=Math.sqrt(50),s=Math.sqrt(10),o=Math.sqrt(2);function h(t,e,n){var r=(e-t)/Math.max(0,n),i=Math.floor(Math.log(r)/Math.LN10),h=r/Math.pow(10,i);return i>=0?(h>=a?10:h>=s?5:h>=o?2:1)*Math.pow(10,i):-Math.pow(10,-i)/(h>=a?10:h>=s?5:h>=o?2:1)}function l(t,e){return null==t||null==e?NaN:t<e?-1:t>e?1:t>=e?0:NaN}function u(t,e){return null==t||null==e?NaN:e<t?-1:e>t?1:e>=t?0:NaN}function c(t){let e,n,r;function i(t,r,i=0,a=t.length){if(i<a){if(0!==e(r,r))return a;do{const e=i+a>>>1;n(t[e],r)<0?i=e+1:a=e}while(i<a)}return i}return 2!==t.length?(e=l,n=(e,n)=>l(t(e),n),r=(e,n)=>t(e)-n):(e=t===l||t===u?t:f,n=t,r=t),{left:i,center:function(t,e,n=0,a=t.length){const s=i(t,e,n,a-1);return s>n&&r(t[s-1],e)>-r(t[s],e)?s-1:s},right:function(t,r,i=0,a=t.length){if(i<a){if(0!==e(r,r))return a;do{const e=i+a>>>1;n(t[e],r)<=0?i=e+1:a=e}while(i<a)}return i}}}function f(){return 0}const d=c(l),p=d.right;d.left,c((function(t){return null===t?NaN:+t})).center;var g=p,m=function(t,e,n){t.prototype=e.prototype=n,n.constructor=t};function v(t,e){var n=Object.create(t.prototype);for(var r in e)n[r]=e[r];return n}function w(){}var b="\\s*([+-]?\\d+)\\s*",_="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",y="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",k=/^#([0-9a-f]{3,8})$/,x=new RegExp(`^rgb\\(${b},${b},${b}\\)$`),A=new RegExp(`^rgb\\(${y},${y},${y}\\)$`),T=new RegExp(`^rgba\\(${b},${b},${b},${_}\\)$`),S=new RegExp(`^rgba\\(${y},${y},${y},${_}\\)$`),E=new RegExp(`^hsl\\(${_},${y},${y}\\)$`),C=new RegExp(`^hsla\\(${_},${y},${y},${_}\\)$`),I={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};function B(){return this.rgb().formatHex()}function M(){return this.rgb().formatRgb()}function z(t){var e,n;return t=(t+"").trim().toLowerCase(),(e=k.exec(t))?(n=e[1].length,e=parseInt(e[1],16),6===n?P(e):3===n?new G(e>>8&15|e>>4&240,e>>4&15|240&e,(15&e)<<4|15&e,1):8===n?R(e>>24&255,e>>16&255,e>>8&255,(255&e)/255):4===n?R(e>>12&15|e>>8&240,e>>8&15|e>>4&240,e>>4&15|240&e,((15&e)<<4|15&e)/255):null):(e=x.exec(t))?new G(e[1],e[2],e[3],1):(e=A.exec(t))?new G(255*e[1]/100,255*e[2]/100,255*e[3]/100,1):(e=T.exec(t))?R(e[1],e[2],e[3],e[4]):(e=S.exec(t))?R(255*e[1]/100,255*e[2]/100,255*e[3]/100,e[4]):(e=E.exec(t))?j(e[1],e[2]/100,e[3]/100,1):(e=C.exec(t))?j(e[1],e[2]/100,e[3]/100,e[4]):I.hasOwnProperty(t)?P(I[t]):"transparent"===t?new G(NaN,NaN,NaN,0):null}function P(t){return new G(t>>16&255,t>>8&255,255&t,1)}function R(t,e,n,r){return r<=0&&(t=e=n=NaN),new G(t,e,n,r)}function O(t){return t instanceof w||(t=z(t)),t?new G((t=t.rgb()).r,t.g,t.b,t.opacity):new G}function N(t,e,n,r){return 1===arguments.length?O(t):new G(t,e,n,null==r?1:r)}function G(t,e,n,r){this.r=+t,this.g=+e,this.b=+n,this.opacity=+r}function F(){return`#${D(this.r)}${D(this.g)}${D(this.b)}`}function L(){const t=U(this.opacity);return`${1===t?"rgb(":"rgba("}${H(this.r)}, ${H(this.g)}, ${H(this.b)}${1===t?")":`, ${t})`}`}function U(t){return isNaN(t)?1:Math.max(0,Math.min(1,t))}function H(t){return Math.max(0,Math.min(255,Math.round(t)||0))}function D(t){return((t=H(t))<16?"0":"")+t.toString(16)}function j(t,e,n,r){return r<=0?t=e=n=NaN:n<=0||n>=1?t=e=NaN:e<=0&&(t=NaN),new $(t,e,n,r)}function q(t){if(t instanceof $)return new $(t.h,t.s,t.l,t.opacity);if(t instanceof w||(t=z(t)),!t)return new $;if(t instanceof $)return t;var e=(t=t.rgb()).r/255,n=t.g/255,r=t.b/255,i=Math.min(e,n,r),a=Math.max(e,n,r),s=NaN,o=a-i,h=(a+i)/2;return o?(s=e===a?(n-r)/o+6*(n<r):n===a?(r-e)/o+2:(e-n)/o+4,o/=h<.5?a+i:2-a-i,s*=60):o=h>0&&h<1?0:s,new $(s,o,h,t.opacity)}function $(t,e,n,r){this.h=+t,this.s=+e,this.l=+n,this.opacity=+r}function Z(t){return(t=(t||0)%360)<0?t+360:t}function Y(t){return Math.max(0,Math.min(1,t||0))}function X(t,e,n){return 255*(t<60?e+(n-e)*t/60:t<180?n:t<240?e+(n-e)*(240-t)/60:e)}function W(t,e,n,r,i){var a=t*t,s=a*t;return((1-3*t+3*a-s)*e+(4-6*a+3*s)*n+(1+3*t+3*a-3*s)*r+s*i)/6}m(w,z,{copy(t){return Object.assign(new this.constructor,this,t)},displayable(){return this.rgb().displayable()},hex:B,formatHex:B,formatHex8:function(){return this.rgb().formatHex8()},formatHsl:function(){return q(this).formatHsl()},formatRgb:M,toString:M}),m(G,N,v(w,{brighter(t){return t=null==t?1/.7:Math.pow(1/.7,t),new G(this.r*t,this.g*t,this.b*t,this.opacity)},darker(t){return t=null==t?.7:Math.pow(.7,t),new G(this.r*t,this.g*t,this.b*t,this.opacity)},rgb(){return this},clamp(){return new G(H(this.r),H(this.g),H(this.b),U(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:F,formatHex:F,formatHex8:function(){return`#${D(this.r)}${D(this.g)}${D(this.b)}${D(255*(isNaN(this.opacity)?1:this.opacity))}`},formatRgb:L,toString:L})),m($,(function(t,e,n,r){return 1===arguments.length?q(t):new $(t,e,n,null==r?1:r)}),v(w,{brighter(t){return t=null==t?1/.7:Math.pow(1/.7,t),new $(this.h,this.s,this.l*t,this.opacity)},darker(t){return t=null==t?.7:Math.pow(.7,t),new $(this.h,this.s,this.l*t,this.opacity)},rgb(){var t=this.h%360+360*(this.h<0),e=isNaN(t)||isNaN(this.s)?0:this.s,n=this.l,r=n+(n<.5?n:1-n)*e,i=2*n-r;return new G(X(t>=240?t-240:t+120,i,r),X(t,i,r),X(t<120?t+240:t-120,i,r),this.opacity)},clamp(){return new $(Z(this.h),Y(this.s),Y(this.l),U(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const t=U(this.opacity);return`${1===t?"hsl(":"hsla("}${Z(this.h)}, ${100*Y(this.s)}%, ${100*Y(this.l)}%${1===t?")":`, ${t})`}`}}));var V=t=>()=>t;function K(t,e){return function(n){return t+n*e}}function Q(t){return 1==(t=+t)?J:function(e,n){return n-e?function(t,e,n){return t=Math.pow(t,n),e=Math.pow(e,n)-t,n=1/n,function(r){return Math.pow(t+r*e,n)}}(e,n,t):V(isNaN(e)?n:e)}}function J(t,e){var n=e-t;return n?K(t,n):V(isNaN(t)?e:t)}var tt=function t(e){var n=Q(e);function r(t,e){var r=n((t=N(t)).r,(e=N(e)).r),i=n(t.g,e.g),a=n(t.b,e.b),s=J(t.opacity,e.opacity);return function(e){return t.r=r(e),t.g=i(e),t.b=a(e),t.opacity=s(e),t+""}}return r.gamma=t,r}(1);function et(t){return function(e){var n,r,i=e.length,a=new Array(i),s=new Array(i),o=new Array(i);for(n=0;n<i;++n)r=N(e[n]),a[n]=r.r||0,s[n]=r.g||0,o[n]=r.b||0;return a=t(a),s=t(s),o=t(o),r.opacity=1,function(t){return r.r=a(t),r.g=s(t),r.b=o(t),r+""}}}et((function(t){var e=t.length-1;return function(n){var r=n<=0?n=0:n>=1?(n=1,e-1):Math.floor(n*e),i=t[r],a=t[r+1],s=r>0?t[r-1]:2*i-a,o=r<e-1?t[r+2]:2*a-i;return W((n-r/e)*e,s,i,a,o)}})),et((function(t){var e=t.length;return function(n){var r=Math.floor(((n%=1)<0?++n:n)*e),i=t[(r+e-1)%e],a=t[r%e],s=t[(r+1)%e],o=t[(r+2)%e];return W((n-r/e)*e,i,a,s,o)}}));var nt=function(t,e){e||(e=[]);var n,r=t?Math.min(e.length,t.length):0,i=e.slice();return function(a){for(n=0;n<r;++n)i[n]=t[n]*(1-a)+e[n]*a;return i}};function rt(t){return ArrayBuffer.isView(t)&&!(t instanceof DataView)}function it(t,e){var n,r=e?e.length:0,i=t?Math.min(r,t.length):0,a=new Array(i),s=new Array(r);for(n=0;n<i;++n)a[n]=ct(t[n],e[n]);for(;n<r;++n)s[n]=e[n];return function(t){for(n=0;n<i;++n)s[n]=a[n](t);return s}}var at=function(t,e){var n=new Date;return t=+t,e=+e,function(r){return n.setTime(t*(1-r)+e*r),n}},st=function(t,e){return t=+t,e=+e,function(n){return t*(1-n)+e*n}},ot=function(t,e){var n,r={},i={};for(n in null!==t&&"object"==typeof t||(t={}),null!==e&&"object"==typeof e||(e={}),e)n in t?r[n]=ct(t[n],e[n]):i[n]=e[n];return function(t){for(n in r)i[n]=r[n](t);return i}},ht=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,lt=new RegExp(ht.source,"g");var ut=function(t,e){var n,r,i,a=ht.lastIndex=lt.lastIndex=0,s=-1,o=[],h=[];for(t+="",e+="";(n=ht.exec(t))&&(r=lt.exec(e));)(i=r.index)>a&&(i=e.slice(a,i),o[s]?o[s]+=i:o[++s]=i),(n=n[0])===(r=r[0])?o[s]?o[s]+=r:o[++s]=r:(o[++s]=null,h.push({i:s,x:st(n,r)})),a=lt.lastIndex;return a<e.length&&(i=e.slice(a),o[s]?o[s]+=i:o[++s]=i),o.length<2?h[0]?function(t){return function(e){return t(e)+""}}(h[0].x):function(t){return function(){return t}}(e):(e=h.length,function(t){for(var n,r=0;r<e;++r)o[(n=h[r]).i]=n.x(t);return o.join("")})},ct=function(t,e){var n,r=typeof e;return null==e||"boolean"===r?V(e):("number"===r?st:"string"===r?(n=z(e))?(e=n,tt):ut:e instanceof z?tt:e instanceof Date?at:rt(e)?nt:Array.isArray(e)?it:"function"!=typeof e.valueOf&&"function"!=typeof e.toString||isNaN(e)?ot:st)(t,e)},ft=function(t,e){return t=+t,e=+e,function(n){return Math.round(t*(1-n)+e*n)}};function dt(t){return+t}var pt=[0,1];function gt(t){return t}function mt(t,e){return(e-=t=+t)?function(n){return(n-t)/e}:(n=isNaN(e)?NaN:.5,function(){return n});var n}function vt(t,e,n){var r=t[0],i=t[1],a=e[0],s=e[1];return i<r?(r=mt(i,r),a=n(s,a)):(r=mt(r,i),a=n(a,s)),function(t){return a(r(t))}}function wt(t,e,n){var r=Math.min(t.length,e.length)-1,i=new Array(r),a=new Array(r),s=-1;for(t[r]<t[0]&&(t=t.slice().reverse(),e=e.slice().reverse());++s<r;)i[s]=mt(t[s],t[s+1]),a[s]=n(e[s],e[s+1]);return function(e){var n=g(t,e,1,r)-1;return a[n](i[n](e))}}function bt(t,e){return e.domain(t.domain()).range(t.range()).interpolate(t.interpolate()).clamp(t.clamp()).unknown(t.unknown())}function _t(){var t,e,n,r,i,a,s=pt,o=pt,h=ct,l=gt;function u(){var t,e,n,h=Math.min(s.length,o.length);return l!==gt&&(t=s[0],e=s[h-1],t>e&&(n=t,t=e,e=n),l=function(n){return Math.max(t,Math.min(e,n))}),r=h>2?wt:vt,i=a=null,c}function c(e){return null==e||isNaN(e=+e)?n:(i||(i=r(s.map(t),o,h)))(t(l(e)))}return c.invert=function(n){return l(e((a||(a=r(o,s.map(t),st)))(n)))},c.domain=function(t){return arguments.length?(s=Array.from(t,dt),u()):s.slice()},c.range=function(t){return arguments.length?(o=Array.from(t),u()):o.slice()},c.rangeRound=function(t){return o=Array.from(t),h=ft,u()},c.clamp=function(t){return arguments.length?(l=!!t||gt,u()):l!==gt},c.interpolate=function(t){return arguments.length?(h=t,u()):h},c.unknown=function(t){return arguments.length?(n=t,c):n},function(n,r){return t=n,e=r,u()}}function yt(){return _t()(gt,gt)}function kt(t,e){switch(arguments.length){case 0:break;case 1:this.range(t);break;default:this.range(e).domain(t)}return this}var xt=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function At(t){if(!(e=xt.exec(t)))throw new Error("invalid format: "+t);var e;return new Tt({fill:e[1],align:e[2],sign:e[3],symbol:e[4],zero:e[5],width:e[6],comma:e[7],precision:e[8]&&e[8].slice(1),trim:e[9],type:e[10]})}function Tt(t){this.fill=void 0===t.fill?" ":t.fill+"",this.align=void 0===t.align?">":t.align+"",this.sign=void 0===t.sign?"-":t.sign+"",this.symbol=void 0===t.symbol?"":t.symbol+"",this.zero=!!t.zero,this.width=void 0===t.width?void 0:+t.width,this.comma=!!t.comma,this.precision=void 0===t.precision?void 0:+t.precision,this.trim=!!t.trim,this.type=void 0===t.type?"":t.type+""}At.prototype=Tt.prototype,Tt.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(void 0===this.width?"":Math.max(1,0|this.width))+(this.comma?",":"")+(void 0===this.precision?"":"."+Math.max(0,0|this.precision))+(this.trim?"~":"")+this.type};function St(t,e){if((n=(t=e?t.toExponential(e-1):t.toExponential()).indexOf("e"))<0)return null;var n,r=t.slice(0,n);return[r.length>1?r[0]+r.slice(2):r,+t.slice(n+1)]}var Et,Ct,It,Bt,Mt=function(t){return(t=St(Math.abs(t)))?t[1]:NaN},zt=function(t,e){var n=St(t,e);if(!n)return t+"";var r=n[0],i=n[1];return i<0?"0."+new Array(-i).join("0")+r:r.length>i+1?r.slice(0,i+1)+"."+r.slice(i+1):r+new Array(i-r.length+2).join("0")},Pt={"%":(t,e)=>(100*t).toFixed(e),b:t=>Math.round(t).toString(2),c:t=>t+"",d:function(t){return Math.abs(t=Math.round(t))>=1e21?t.toLocaleString("en").replace(/,/g,""):t.toString(10)},e:(t,e)=>t.toExponential(e),f:(t,e)=>t.toFixed(e),g:(t,e)=>t.toPrecision(e),o:t=>Math.round(t).toString(8),p:(t,e)=>zt(100*t,e),r:zt,s:function(t,e){var n=St(t,e);if(!n)return t+"";var r=n[0],i=n[1],a=i-(Et=3*Math.max(-8,Math.min(8,Math.floor(i/3))))+1,s=r.length;return a===s?r:a>s?r+new Array(a-s+1).join("0"):a>0?r.slice(0,a)+"."+r.slice(a):"0."+new Array(1-a).join("0")+St(t,Math.max(0,e+a-1))[0]},X:t=>Math.round(t).toString(16).toUpperCase(),x:t=>Math.round(t).toString(16)},Rt=function(t){return t},Ot=Array.prototype.map,Nt=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];Ct=function(t){var e,n,r=void 0===t.grouping||void 0===t.thousands?Rt:(e=Ot.call(t.grouping,Number),n=t.thousands+"",function(t,r){for(var i=t.length,a=[],s=0,o=e[0],h=0;i>0&&o>0&&(h+o+1>r&&(o=Math.max(1,r-h)),a.push(t.substring(i-=o,i+o)),!((h+=o+1)>r));)o=e[s=(s+1)%e.length];return a.reverse().join(n)}),i=void 0===t.currency?"":t.currency[0]+"",a=void 0===t.currency?"":t.currency[1]+"",s=void 0===t.decimal?".":t.decimal+"",o=void 0===t.numerals?Rt:function(t){return function(e){return e.replace(/[0-9]/g,(function(e){return t[+e]}))}}(Ot.call(t.numerals,String)),h=void 0===t.percent?"%":t.percent+"",l=void 0===t.minus?"−":t.minus+"",u=void 0===t.nan?"NaN":t.nan+"";function c(t){var e=(t=At(t)).fill,n=t.align,c=t.sign,f=t.symbol,d=t.zero,p=t.width,g=t.comma,m=t.precision,v=t.trim,w=t.type;"n"===w?(g=!0,w="g"):Pt[w]||(void 0===m&&(m=12),v=!0,w="g"),(d||"0"===e&&"="===n)&&(d=!0,e="0",n="=");var b="$"===f?i:"#"===f&&/[boxX]/.test(w)?"0"+w.toLowerCase():"",_="$"===f?a:/[%p]/.test(w)?h:"",y=Pt[w],k=/[defgprs%]/.test(w);function x(t){var i,a,h,f=b,x=_;if("c"===w)x=y(t)+x,t="";else{var A=(t=+t)<0||1/t<0;if(t=isNaN(t)?u:y(Math.abs(t),m),v&&(t=function(t){t:for(var e,n=t.length,r=1,i=-1;r<n;++r)switch(t[r]){case".":i=e=r;break;case"0":0===i&&(i=r),e=r;break;default:if(!+t[r])break t;i>0&&(i=0)}return i>0?t.slice(0,i)+t.slice(e+1):t}(t)),A&&0==+t&&"+"!==c&&(A=!1),f=(A?"("===c?c:l:"-"===c||"("===c?"":c)+f,x=("s"===w?Nt[8+Et/3]:"")+x+(A&&"("===c?")":""),k)for(i=-1,a=t.length;++i<a;)if(48>(h=t.charCodeAt(i))||h>57){x=(46===h?s+t.slice(i+1):t.slice(i))+x,t=t.slice(0,i);break}}g&&!d&&(t=r(t,1/0));var T=f.length+t.length+x.length,S=T<p?new Array(p-T+1).join(e):"";switch(g&&d&&(t=r(S+t,S.length?p-x.length:1/0),S=""),n){case"<":t=f+t+x+S;break;case"=":t=f+S+t+x;break;case"^":t=S.slice(0,T=S.length>>1)+f+t+x+S.slice(T);break;default:t=S+f+t+x}return o(t)}return m=void 0===m?6:/[gprs]/.test(w)?Math.max(1,Math.min(21,m)):Math.max(0,Math.min(20,m)),x.toString=function(){return t+""},x}return{format:c,formatPrefix:function(t,e){var n=c(((t=At(t)).type="f",t)),r=3*Math.max(-8,Math.min(8,Math.floor(Mt(e)/3))),i=Math.pow(10,-r),a=Nt[8+r/3];return function(t){return n(i*t)+a}}}}({thousands:",",grouping:[3],currency:["$",""]}),It=Ct.format,Bt=Ct.formatPrefix;function Gt(t,e,n,r){var i,h=function(t,e,n){var r=Math.abs(e-t)/Math.max(0,n),i=Math.pow(10,Math.floor(Math.log(r)/Math.LN10)),h=r/i;return h>=a?i*=10:h>=s?i*=5:h>=o&&(i*=2),e<t?-i:i}(t,e,n);switch((r=At(null==r?",f":r)).type){case"s":var l=Math.max(Math.abs(t),Math.abs(e));return null!=r.precision||isNaN(i=function(t,e){return Math.max(0,3*Math.max(-8,Math.min(8,Math.floor(Mt(e)/3)))-Mt(Math.abs(t)))}(h,l))||(r.precision=i),Bt(r,l);case"":case"e":case"g":case"p":case"r":null!=r.precision||isNaN(i=function(t,e){return t=Math.abs(t),e=Math.abs(e)-t,Math.max(0,Mt(e)-Mt(t))+1}(h,Math.max(Math.abs(t),Math.abs(e))))||(r.precision=i-("e"===r.type));break;case"f":case"%":null!=r.precision||isNaN(i=function(t){return Math.max(0,-Mt(Math.abs(t)))}(h))||(r.precision=i-2*("%"===r.type))}return It(r)}function Ft(t){var e=t.domain;return t.ticks=function(t){var n=e();return function(t,e,n){var r,i,a,s,o=-1;if(n=+n,(t=+t)===(e=+e)&&n>0)return[t];if((r=e<t)&&(i=t,t=e,e=i),0===(s=h(t,e,n))||!isFinite(s))return[];if(s>0){let n=Math.round(t/s),r=Math.round(e/s);for(n*s<t&&++n,r*s>e&&--r,a=new Array(i=r-n+1);++o<i;)a[o]=(n+o)*s}else{s=-s;let n=Math.round(t*s),r=Math.round(e*s);for(n/s<t&&++n,r/s>e&&--r,a=new Array(i=r-n+1);++o<i;)a[o]=(n+o)/s}return r&&a.reverse(),a}(n[0],n[n.length-1],null==t?10:t)},t.tickFormat=function(t,n){var r=e();return Gt(r[0],r[r.length-1],null==t?10:t,n)},t.nice=function(n){null==n&&(n=10);var r,i,a=e(),s=0,o=a.length-1,l=a[s],u=a[o],c=10;for(u<l&&(i=l,l=u,u=i,i=s,s=o,o=i);c-- >0;){if((i=h(l,u,n))===r)return a[s]=l,a[o]=u,e(a);if(i>0)l=Math.floor(l/i)*i,u=Math.ceil(u/i)*i;else{if(!(i<0))break;l=Math.ceil(l*i)/i,u=Math.floor(u*i)/i}r=i}return t},t}function Lt(){var t=yt();return t.copy=function(){return bt(t,Lt())},kt.apply(t,arguments),Ft(t)}var Ut=n(16),Ht=n.n(Ut),Dt={X:{key:"X",name:"Stop codon",nameAbbrev:"Ter",codons:["TAA","TAG","TGA"],color:"#333333"},W:{key:"W",name:"Tryptophan",nameAbbrev:"Trp",essential:!0,codons:["TGG"],property:"aromatic",color:"#abc745",image:"https://aveit.s3.amazonaws.com/higlass/static/amino-acids/trp.png"},C:{key:"C",name:"Cystine",nameAbbrev:"Cys",essential:!1,codons:["TGT","TGC"],property:"sulfur-containing",color:"#e9ae02",image:"https://aveit.s3.amazonaws.com/higlass/static/amino-acids/cys.png"},G:{key:"G",name:"Glycine",nameAbbrev:"Gly",essential:!1,codons:["GGT","GGC","GGA","GGG"],property:"aliphatic",color:"#d81c24",image:"https://aveit.s3.amazonaws.com/higlass/static/amino-acids/gly.png"},R:{key:"R",name:"Arginine",nameAbbrev:"Arg",essential:!1,codons:["CGT","CGC","CGA","CGG","AGA","AGG"],property:"basic",color:"#739ed4",image:"https://aveit.s3.amazonaws.com/higlass/static/amino-acids/arg.png"},S:{key:"S",name:"Serine",nameAbbrev:"Ser",essential:!1,codons:["TCT","TCC","TCA","TCG","AGT","AGC"],property:"hydroxylic",color:"#f39bbf",image:"https://aveit.s3.amazonaws.com/higlass/static/amino-acids/ser.png"},T:{key:"T",name:"Threonine",nameAbbrev:"Thr",essential:!0,codons:["ACT","ACC","ACA","ACG"],property:"hydroxylic",color:"#f39bbf",image:"https://aveit.s3.amazonaws.com/higlass/static/amino-acids/thr.png"},A:{key:"A",name:"Alanine",nameAbbrev:"Ala",essential:!1,codons:["GCT","GCC","GCA","GCG"],property:"aliphatic",color:"#d81c24",image:"https://aveit.s3.amazonaws.com/higlass/static/amino-acids/ala.png"},P:{key:"P",name:"Proline",nameAbbrev:"Pro",essential:!1,codons:["CCT","CCC","CCA","CCG"],property:"aliphatic",color:"#d81c24",image:"https://aveit.s3.amazonaws.com/higlass/static/amino-acids/pro.png"},F:{key:"F",name:"Phenylalanine",nameAbbrev:"Phe",essential:!0,codons:["TTT","TTC"],property:"aromatic",color:"#abc745",image:"https://aveit.s3.amazonaws.com/higlass/static/amino-acids/phe.png"},L:{key:"L",name:"Leucine",nameAbbrev:"Leu",essential:!0,codons:["CTT","CTC","CTA","CTG","TTA","TTG"],property:"aliphatic",color:"#d81c24",image:"https://aveit.s3.amazonaws.com/higlass/static/amino-acids/leu.png"},V:{key:"V",name:"Valine",nameAbbrev:"Val",essential:!0,codons:["GTT","GTC","GTA","GTG"],property:"aliphatic",color:"#d81c24",image:"https://aveit.s3.amazonaws.com/higlass/static/amino-acids/val.png"},I:{key:"I",name:"Isoleucine",nameAbbrev:"Ile",essential:!0,codons:["ATT","ATC","ATA"],property:"aliphatic",color:"#d81c24",image:"https://aveit.s3.amazonaws.com/higlass/static/amino-acids/ile.png"},M:{key:"M",name:"Methionine",nameAbbrev:"Met",essential:!0,codons:["ATG"],property:"sulfur-containing",color:"#e9ae02",image:"https://aveit.s3.amazonaws.com/higlass/static/amino-acids/met.png"},Q:{key:"Q",name:"Glutamine",nameAbbrev:"Gln",essential:!1,codons:["CAA","CAG"],property:"amidic",color:"#2c3385",image:"https://aveit.s3.amazonaws.com/higlass/static/amino-acids/gln.png"},H:{key:"H",name:"Histidine",nameAbbrev:"His",essential:!0,codons:["CAT","CAC"],property:"basic",color:"#739ed4",image:"https://aveit.s3.amazonaws.com/higlass/static/amino-acids/his.png"},D:{key:"D",name:"Aspartic acid",nameAbbrev:"Asp",essential:!1,codons:["GAT","GAC"],property:"acidic",color:"#e96b17",image:"https://aveit.s3.amazonaws.com/higlass/static/amino-acids/asp.png"},E:{key:"E",name:"Glutamic acid",nameAbbrev:"Glu",essential:!1,codons:["GAA","GAG"],property:"acidic",color:"#e96b17",image:"https://aveit.s3.amazonaws.com/higlass/static/amino-acids/glu.png"},K:{key:"K",name:"Lysine",nameAbbrev:"Lys",essential:!0,codons:["AAA","AAG"],property:"basic",color:"#739ed4",image:"https://aveit.s3.amazonaws.com/higlass/static/amino-acids/lys.png"},N:{key:"N",name:"Asparagine",nameAbbrev:"Asn",essential:!1,codons:["AAT","AAC"],property:"amidic",color:"#2c3385",image:"https://aveit.s3.amazonaws.com/higlass/static/amino-acids/asn.png"},Y:{key:"Y",name:"Tyrosine",nameAbbrev:"Tyr",essential:!1,codons:["TAT","TAC"],property:"aromatic",color:"#abc745",image:"https://aveit.s3.amazonaws.com/higlass/static/amino-acids/tyr.png"}},jt={TTT:Dt.F,TTC:Dt.F,TTA:Dt.L,TTG:Dt.L,TCT:Dt.S,TCC:Dt.S,TCA:Dt.S,TCG:Dt.S,TAT:Dt.Y,TAC:Dt.Y,TAA:Dt.X,TAG:Dt.X,TGT:Dt.C,TGC:Dt.C,TGA:Dt.X,TGG:Dt.W,CTT:Dt.L,CTC:Dt.L,CTA:Dt.L,CTG:Dt.L,CCT:Dt.P,CCC:Dt.P,CCA:Dt.P,CCG:Dt.P,CAT:Dt.H,CAC:Dt.H,CAA:Dt.Q,CAG:Dt.Q,CGT:Dt.R,CGC:Dt.R,CGA:Dt.R,CGG:Dt.R,ATT:Dt.I,ATC:Dt.I,ATA:Dt.I,ATG:Dt.M,ACT:Dt.T,ACC:Dt.T,ACA:Dt.T,ACG:Dt.T,AAT:Dt.N,AAC:Dt.N,AAA:Dt.K,AAG:Dt.K,AGT:Dt.S,AGC:Dt.S,AGA:Dt.R,AGG:Dt.R,GTT:Dt.V,GTC:Dt.V,GTA:Dt.V,GTG:Dt.V,GCT:Dt.A,GCC:Dt.A,GCA:Dt.A,GCG:Dt.A,GAT:Dt.D,GAC:Dt.D,GAA:Dt.E,GAG:Dt.E,GGT:Dt.G,GGC:Dt.G,GGA:Dt.G,GGG:Dt.G};function qt(t,e){var n={};return Object.keys(jt).forEach((function(r){var i={};i.sequence=r;var a=new e.libraries.PIXI.Text(jt[r].nameAbbrev,t);a.updateText(),i.width=a.getBounds().width/2,i.height=a.getBounds().height/2,i.texture=a.texture;var s=new e.libraries.PIXI.Text(jt[r].key,t);s.updateText(),i.widthAbbrev=s.getBounds().width/2,i.heightAbbrev=s.getBounds().height/2,i.textureAbbrev=s.texture,n[r]=i})),n}function $t(t,e,n){for(var r=0;r<t.length;r++){if(n>=t[r]&&n<e[r])return{exon:r,start:t[r],end:e[r]}}return null}function Zt(t,e,n){return(3-(n-(t+e))%3)%3}function Yt(t,e,n,r,i,a){for(var s=[].concat(function(t){if(Array.isArray(t)){for(var e=0,n=Array(t.length);e<t.length;e++)n[e]=t[e];return n}return Array.from(t)}(a)),o=0;o<s.length;o++){for(var h=!1,l=0;l<t.length;l++){var u=o+i;u>=n&&u>=t[l]&&u<e[l]&&u<r&&(h=!0)}h||(s[o]=".")}return s}function Xt(t,e,n){for(var r=0;r<t.length;r++){if(n<t[r])return{exon:r,start:t[r],end:e[r]}}return null}function Wt(t,e){if(Array.isArray(t)){for(var n=[],r=0;r<t.length;r++)n.push(e-t[r]);return n.sort()}return e-t}function Vt(t){for(var e=t.split(""),n=[],r=e.length-1;r>=0;r--)"A"===e[r].toUpperCase()?n.push("T"):"T"===e[r].toUpperCase()?n.push("A"):"C"===e[r].toUpperCase()?n.push("G"):"G"===e[r].toUpperCase()?n.push("C"):console.warn("Couldn't convert "+e[r]+" in minus strand conversion");return n.join("")}function Kt(t,e,n,r,i,a,s,o,h,l,u){for(var c=e.filter((function(t){return"."!==t})),f=0,d=0;d<e.length;d++)if("."!==e[d]){f=d;break}for(var p=0,g=e.length-1;g>0;g--)if("."!==e[g]){p=g;break}var m=null,v=null;if(n>0)if(f>0){var w=o[$t(s,o,h+f).exon-1];m=w-(3-n),v=w}else m=h-(3-n),v=h;var b=null,_=null;if((c.length+3-n)%3!=0){var y=3-(c.length-n)%3;if(p===e.length-1)b=h+e.length,_=h+e.length+y;else{var k=s[$t(s,o,h+p).exon+1];b=k,_=k+y}}return u.getExcessNucleotides(r,i,a,m,v,b,_).then((function(n){for(var r=[],s=[],o=0;o<n.length;o++)if("left"===n[o].leftOrRight)for(var u=n[o].value.split(""),c=0;c<u.length;c++)r.push({pos:m-h+c,letter:u[c]});else if("right"===n[o].leftOrRight)for(var d=n[o].value.split(""),p=0;p<d.length;p++)s.push({pos:b-h+p,letter:d[p]});return function(t,e,n,r,i,a,s,o,h){for(var l=[],u=t,c=n;c<r.length;c++)"."!==r[c]&&(u.push({pos:c,letter:r[c]}),3===u.length&&(l=l.concat(Qt(u,h,i,a,s,o)),u=[]));e.length>0&&u.length>0&&3===(u=u.concat(e)).length&&(l=l.concat(Qt(u,h,i,a,s,o)));return l}(r,s,f,e,l,a,i,t,h)}))}function Qt(t,e,n,r,i,a){var s=[],o=t[0].letter.toUpperCase()+t[1].letter.toUpperCase()+t[2].letter.toUpperCase(),h=jt[o];if(!h)return console.warn("Codon "+o+" does not exist. Position: "+t[0].pos),s;if(t[2].pos-t[1].pos==1&&t[1].pos-t[0].pos==1){var l=new a.libraries.PIXI.Sprite(n[o].texture);l.width=n[o].width,l.height=n[o].height;var u=new a.libraries.PIXI.Sprite(n[o].textureAbbrev);u.width=n[o].widthAbbrev,u.height=n[o].heightAbbrev;var c={posStart:"+"===r?e+t[0].pos:Wt(e+t[2].pos+1,i),posEnd:"+"===r?e+t[2].pos:Wt(e+t[0].pos+1,i),aminoAcid:h,width:l.width,height:l.height,sprite:l,widthAbbrev:u.width,heightAbbrev:u.height,spriteAbbrev:u};s.push(c)}else if(t[1].pos-t[0].pos>1){var f=new a.libraries.PIXI.Sprite(n[o].texture);f.width=n[o].width,f.height=n[o].height;var d=new a.libraries.PIXI.Sprite(n[o].textureAbbrev);d.width=n[o].widthAbbrev,d.height=n[o].heightAbbrev;var p={posStart:"+"===r?e+t[0].pos:Wt(e+t[0].pos+1,i),posEnd:"+"===r?e+t[0].pos:Wt(e+t[0].pos+1,i),aminoAcid:h,width:d.width,height:d.height,sprite:d,widthAbbrev:d.width,heightAbbrev:d.height,spriteAbbrev:d};s.push(p);var g=new a.libraries.PIXI.Sprite(n[o].texture);g.width=n[o].width,g.height=n[o].height;var m=new a.libraries.PIXI.Sprite(n[o].textureAbbrev);m.width=n[o].widthAbbrev,m.height=n[o].heightAbbrev;var v={posStart:"+"===r?e+t[1].pos:Wt(e+t[2].pos+1,i),posEnd:"+"===r?e+t[2].pos:Wt(e+t[1].pos+1,i),aminoAcid:h,width:g.width,height:g.height,sprite:g,widthAbbrev:m.width,heightAbbrev:m.height,spriteAbbrev:m};s.push(v)}else if(t[2].pos-t[1].pos>1){var w=new a.libraries.PIXI.Sprite(n[o].texture);w.width=n[o].width,w.height=n[o].height;var b=new a.libraries.PIXI.Sprite(n[o].textureAbbrev);b.width=n[o].widthAbbrev,b.height=n[o].heightAbbrev;var _={posStart:"+"===r?e+t[0].pos:Wt(e+t[1].pos+1,i),posEnd:"+"===r?e+t[1].pos:Wt(e+t[0].pos+1,i),aminoAcid:h,width:w.width,height:w.height,sprite:w,widthAbbrev:b.width,heightAbbrev:b.height,spriteAbbrev:b};s.push(_);var y=new a.libraries.PIXI.Sprite(n[o].texture);y.width=n[o].width,y.height=n[o].height;var k=new a.libraries.PIXI.Sprite(n[o].textureAbbrev);k.width=n[o].widthAbbrev,k.height=n[o].heightAbbrev;var x={posStart:"+"===r?e+t[2].pos:Wt(e+t[2].pos+1,i),posEnd:"+"===r?e+t[2].pos:Wt(e+t[2].pos+1,i),aminoAcid:h,width:k.width,height:k.height,sprite:k,widthAbbrev:k.width,heightAbbrev:k.height,spriteAbbrev:k};s.push(x)}return s}var Jt=n(0),te=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}();var ee=function(){function t(e,r){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t);var i=n(35).IndexedFasta,a=new Jt.b(e),s=new Jt.b(r);this.sequenceFile=new i({fasta:a,fai:s})}return te(t,[{key:"getSubSequence",value:function(t,e,n,r,i){for(var a=[],s=0;s<e.length;s++){var o=Math.min(Math.max(e[s],r),n[s]),h=Math.max(Math.min(n[s],i),e[s]);o>=h||a.push(this.sequenceFile.getSequence(t,o,h).then((function(t){return t})))}return Promise.all(a).then((function(t){return t.join("")}))}},{key:"getExcessNucleotides",value:function(t,e,n,r,i,a,s){var o=r,h=i,l=a,u=s;"-"===n&&(o=Wt(i,e),h=Wt(r,e),l=Wt(s,e),u=Wt(a,e));var c=[];return o&&h&&c.push(this.sequenceFile.getSequence(t,o,h).then((function(t){return{leftOrRight:"left",value:"+"===n?t:Vt(t)}}))),l&&u&&c.push(this.sequenceFile.getSequence(t,l,u).then((function(t){return{leftOrRight:"right",value:"+"===n?t:Vt(t)}}))),Promise.all(c).then((function(t){return t}))}},{key:"getSequence",value:function(t,e,n){var r=[];return r.push(this.sequenceFile.getSequence(t,e,n).then((function(t){return t}))),Promise.all(r).then((function(t){return t}))}},{key:"getTile",value:function(t,e,n){var r=+n.max_width/Math.pow(2,+t),i=n.min_pos[0]+e*r,a=n.min_pos[0]+(e+1)*r,s=n.chrom_sizes.split("\t").map((function(t){return+t})),o=n.chrom_names.split("\t"),h=[];this.chromInfo=this.parseChromsizes(o,s);for(var l=this.chromInfo,u=l.chromLengths,c=l.cumPositions,f=0;f<c.length;f++){var d=c[f].chr,p=c[f].pos,g=c[f].pos+u[d];if(p<=i&&i<g){if(!(a>g)){var m=Math.ceil(a-p),v=Math.floor(i-p);h.push(this.sequenceFile.getSequence(d,v,m).then((function(t){return t})));break}h.push(this.sequenceFile.getSequence(d,i-p,g-p).then((function(t){return t}))),i=g}}return Promise.all(h).then((function(t){return t}))}},{key:"parseChromsizes",value:function(t,e){for(var n=[],r={},i={},a=0,s=0;s<e.length;s++){var o=Number(e[s]);a+=o;var h={id:s,chr:t[s],pos:a-o};n.push(h),i[h.chr]=h,r[t[s]]=o}return{cumPositions:n,chrPositions:i,totalLength:a,chromLengths:r}}}]),t}(),ne=function(t,e){if(Array.isArray(t))return t;if(Symbol.iterator in Object(t))return function(t,e){var n=[],r=!0,i=!1,a=void 0;try{for(var s,o=t[Symbol.iterator]();!(r=(s=o.next()).done)&&(n.push(s.value),!e||n.length!==e);r=!0);}catch(t){i=!0,a=t}finally{try{!r&&o.return&&o.return()}finally{if(i)throw a}}return n}(t,e);throw new TypeError("Invalid attempt to destructure non-iterable instance")},re=("function"==typeof Symbol&&Symbol.iterator,function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}()),ie=function t(e,n,r){null===e&&(e=Function.prototype);var i=Object.getOwnPropertyDescriptor(e,n);if(void 0===i){var a=Object.getPrototypeOf(e);return null===a?void 0:t(a,n,r)}if("value"in i)return i.value;var s=i.get;return void 0!==s?s.call(r):void 0};function ae(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function se(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function oe(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}var he=function t(e){for(var n=arguments.length,r=Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];if(!new.target)throw new Error('Uncaught TypeError: Class constructor cannot be invoked without "new"');var a=e.services.tileProxy,s=e.utils,o=s.colorToHex,h=s.trackUtils,l=s.absToChr,u=o("#ffffff");o("#999999");function c(t,n,r){var i=r.flipText,a=r.fontSize,s=r.fontFamily,o=r.maxTexts;n.texts={},n.textWidths={},n.textHeights={},n.rectGraphics=new e.libraries.PIXI.Graphics,n.rectMaskGraphics=new e.libraries.PIXI.Graphics,n.codonSeparatorGraphics=new e.libraries.PIXI.Graphics,n.codonTextGraphics=new e.libraries.PIXI.Graphics,n.labelBgGraphics=new e.libraries.PIXI.Graphics,n.labelGraphics=new e.libraries.PIXI.Graphics,n.graphics.addChild(n.rectGraphics),n.graphics.addChild(n.rectMaskGraphics),n.graphics.addChild(n.codonSeparatorGraphics),n.graphics.addChild(n.codonTextGraphics),n.graphics.addChild(n.labelBgGraphics),n.graphics.addChild(n.labelGraphics),n.rectGraphics.mask=n.rectMaskGraphics,n.tileData.sort&&(n.tileData.sort((function(t,e){return e.importance-t.importance})),n.tileData.forEach((function(r,h){var l=r.fields,u=t.formatTranscriptData(l),c=u.transcriptName,f=u.transcriptId,d=u.strand;if(r.transcriptId=f,!(h>=o)){var p=new e.libraries.PIXI.Text(c,{fontSize:a+"px",fontFamily:s,fill:t.colors.labelFont});p.interactive=!0,i&&(p.scale.x=-1),p.anchor.x=0,p.anchor.y=.5,p.visible=!1,n.texts[f]=p,n.texts[f].strand=d,n.labelGraphics.addChild(p)}})),f(t,n),n.initialized=!0)}function f(t,n){if(t.zoomLevel===t.tilesetInfo.max_zoom&&void 0!==t.sequenceLoader){n.aaInfo={},n.aaInfo.exonOffsets={},n.aaInfo.nucSequences={},n.aaInfo.aminoAcids={},n.aaInfo.tileOffset=0;var r=t.tilesetInfo.chrom_sizes.split("\t").map((function(t){return+t})),i=t.tilesetInfo.chrom_names.split("\t"),a=t.sequenceLoader.parseChromsizes(i,r),s=+n.tileId.split(".")[1],o=+n.tileId.split(".")[0],h=t.sequenceLoader.getTile(o,s,t.tilesetInfo),u=+t.tilesetInfo.max_width/Math.pow(2,o),c=t.tilesetInfo.min_pos[0]+s*u,f=t.tilesetInfo.min_pos[0]+(s+1)*u,d=+l(c,a)[1],p=+l(f,a)[1];n.tileData.forEach((function(r){var i=r.fields,s=t.formatTranscriptData(i),o=s.transcriptId,l=a.chromLengths[s.chromName],u=d,c=p;if("."!==s.startCodonPos&&"."!==s.stopCodonPos){var f=s.strand;n.aaInfo.exonOffsets[o]=[],n.aaInfo.nucSequences[o]=[],n.aaInfo.aminoAcids[o]=[];var g=s.exonStarts,m=s.exonEnds,v=g,w=m,b=s.startCodonPos,_=s.stopCodonPos;"-"===f&&(u=Wt(c,l),c=Wt(u,l),v=Wt(m,l),w=Wt(g,l),b=Wt(b,l),_=Wt(_,l));for(var y=0,k=0;k<v.length;k++)if(v[k]<=b)n.aaInfo.exonOffsets[o].push(0);else{var x=(y+=(3-(w[k-1]-Math.max(v[k-1],b))%3)%3)%3;n.aaInfo.exonOffsets[o].push(x)}h.then((function(r){var i=r[0];"-"===f&&(i=Vt(i));var a=Yt(v,w,b,_,u,i);if(0!==a.filter((function(t){return"."!==t})).length){n.aaInfo.nucSequences[o].push(a);var h=null;if("."!==a[0]){h=$t(v,w,u).exon;var c=Math.max(b,v[h]),d=n.aaInfo.exonOffsets[o][h];n.aaInfo.tileOffset=Zt(c,d,u)}else if(u<b)n.aaInfo.tileOffset=0;else{var p=Xt(v,w,u);n.aaInfo.tileOffset=null!==p&&u>b?n.aaInfo.exonOffsets[o][p.exon]:0}Kt(e,a,n.aaInfo.tileOffset,s.chromName,l,f,v,w,u,t.pixiTexts,t.sequenceLoader).then((function(e){n.aaInfo.aminoAcids[o]=e,t.draw()}))}}))}}))}}function d(t,e,n,r,i,a,s,o){var h=a-s/2,l=+e.tileId.split(".")[1],u=+e.tileId.split(".")[0],c=+t.tilesetInfo.max_width/Math.pow(2,u),f=t.tilesetInfo.min_pos[0]+l*c,d=t.tilesetInfo.min_pos[0]+(l+1)*c,p=t.transcriptInfo[n].exonStarts,g=t.transcriptInfo[n].exonEnds,m="."!==t.transcriptInfo[n].startCodonPos&&"."!==t.transcriptInfo[n].stopCodonPos,v=m?t.transcriptInfo[n].startCodonPos+i:-1,w=m?t.transcriptInfo[n].stopCodonPos+i:-1,b=t.transcriptInfo[n].txStart+i,_=t.transcriptInfo[n].txEnd+i,y=p.map((function(t){return+t+i})),k=g.map((function(t){return+t+i}));m&&(y.push(v,w),k.push(v,w),y.sort(),k.sort());var x=t._xScale(b+1),A=t._xScale(_+1),T=A-x,S=a,E=[],C=[];r.beginFill(t.colors.intron);var I=[x,S-1,x+T,S-1,x+T,S+1,x,S+1];r.drawPolygon(I),E.push([x,x+T,h,h+s]),C.push({rect:I,color:t.colors.intronHEX,paintOrder:0});for(var B=0;B<y.length;B++){var M=y[B],z=k[B];if(!(z<f||M>d)){var P=!m||"+"===o&&(z<=v||M>=w)||"-"===o&&(M>=v||z<=w),R=P?t.colors.utr:t.colors[o],O=P?t.options.utrColor:t.colors[o+"HEX"];r.beginFill(R);var N=t._xScale(M+1),G=Math.max(2,t._xScale(z+1)-t._xScale(M+1)),F=x,L=A,U=null,H=null;if("+"===o){var D=Math.min(N,L),j=Math.max(D-5,x),q=Math.min(N+G,L),$=Math.max(q-5,x);U=[D,h,$,h,q,h+s/2,$,h+s,j,h+s,D,h+s/2,j,h],H=[D,q,h,h+s]}else{var Z=Math.max(N,F),Y=Math.min(Z+5,A),X=Math.min(Math.max(N+G,F),A),W=Math.min(X+5,A);U=[Z,h+s/2,Y,h,W,h,X,h+s/2,W,h+s,Y,h+s,Z,h+s/2],H=[Z,X,h,h+s]}r.drawPolygon(U),E.push(H),C.push({rect:U,color:O,paintOrder:1})}}var V=E.map((function(e){return[e,t.transcriptInfo[n]]}));e.allExonsForMouseOver=e.allExonsForMouseOver.concat(V),e.allExonsForSVG=e.allExonsForSVG.concat(C)}function p(t,e,n,r,i,a){t.forEach((function(t){var s=t.fields,o=+t.chrOffset,h=e.transcriptId(s);if((!e.areTranscriptsHidden||0===e.transcriptInfo[h].displayOrder)&&e.transcriptInfo[h]){var l=e.transcriptInfo[h].displayOrder*(i+a);e.options.showToggleTranscriptsButton&&(l+=e.toggleButtonHeight),d(e,n,h,n.rectGraphics,o,r+l,i,t.strand||t.fields[5])}}))}function g(t,e){var n=h.getTilePosAndDimensions(t.tilesetInfo,e.tileId),r=n.tileX,i=n.tileWidth;e.rectMaskGraphics.clear();var a=Math.floor(Math.random()*Math.pow(16,6));e.rectMaskGraphics.beginFill(a,.3);var s=t._xScale(r),o=t._xScale(r+i)-t._xScale(r),l=t.dimensions[1];e.rectMaskGraphics.drawRect(s,0,o,l)}var m=function(t,e,n){"over"===n?(e.buttons.pToggleButton.children[0].alpha=.8,document.body.style.cursor="pointer"):"out"===n&&(e.buttons.pToggleButton.children[0].alpha=.5,document.body.style.cursor="default"),requestAnimationFrame(e.animate)},v=function(t,e){if(e.areTranscriptsHidden)e.buttons.pToggleButton.children[0].text="SHOW FEWER TRANSCRIPTS...",e.areTranscriptsHidden=!1;else{var n=Object.keys(e.transcriptInfo).length-e.transcriptPositionInfo[0].length,r=Math.max(0,n);e.buttons.pToggleButton.children[0].text="SHOW "+r+" MORE TRANSCRIPTS...",e.areTranscriptsHidden=!0}e.pubSub.publish("trackDimensionsModified",{height:e.computeTrackHeight(),resizeParentDiv:!0,trackId:e.trackId,viewId:e.viewId})};function w(t){if(t.options.showToggleTranscriptsButton&&!t.hasToggleBtnBeenRendered){var n=t.buttons.pToggleButton;t.pForeground.removeChildren(),t.pForeground.addChild(n),n.clear(),n.removeChildren();var r=new e.libraries.PIXI.Text("SHOW FEWER TRANSCRIPTS...",{fontSize:"10px",fontFamily:t.options.fontFamily,fontWeight:"500",fill:t.colors.black});r.interactive=!0,r.buttonMode=!0,r.mouseover=function(e){return m(e,t,"over")},r.mouseout=function(e){return m(e,t,"out")},r.pointerup=function(e){return v(e,t)},r.alpha=.5,r.anchor.x=.5,r.anchor.y=.5,r.position.x=t.dimensions[0]/2,r.position.y=t.toggleButtonHeight/2,n.addChild(r),t.hasToggleBtnBeenRendered=!0}}var b=function(n){function r(t,n){ae(this,r);var i=se(this,(r.__proto__||Object.getPrototypeOf(r)).call(this,t,n)),a=t.animate,s=t.viewUid;i.trackId=i.id,i.viewId=s,i.animate=a,i.options=n,i.initOptions(),i.numTranscriptRows=0,i.trackHeight=0,i.trackHeightOld=0,i.areTranscriptsHidden=i.options.startCollapsed,i.areCodonsShown=!1,i.transcriptInfo={},i.transcriptSequences={},i.buttons={};var o=new e.libraries.PIXI.Graphics;return o.interactive=!0,o.buttonMode=!0,i.buttons.pToggleButton=o,i}return oe(r,n),re(r,[{key:"initOptions",value:function(){this.fontSize=+this.options.fontSize,this.transcriptHeight=+this.options.transcriptHeight,this.transcriptSpacing=+this.options.transcriptSpacing,this.geneStrandHSpacing=this.transcriptSpacing/2,this.transcriptHHeight=this.transcriptHeight/2,this.trackHeightAdjustment="automatic"===this.options.trackHeightAdjustment,this.toggleButtonHeight=26,this.minCodonDistance=15,this.codonTextOptions={fontSize:2*this.fontSize+"px",fontFamily:this.options.fontFamily,fill:u,fontWeight:"bold"},void 0!==this.options.sequenceData&&(this.sequenceLoader=new ee(this.options.sequenceData.fastaUrl,this.options.sequenceData.faiUrl),this.pixiTexts||(this.pixiTexts=qt(this.codonTextOptions,e))),this.colors={},this.colors["+"]=o(this.options.plusStrandColor),this.colors["-"]=o(this.options.minusStrandColor),this.colors["+HEX"]=this.options.plusStrandColor,this.colors["-HEX"]=this.options.minusStrandColor,this.colors.utr=o(this.options.utrColor),this.colors.labelFont=o(this.options.labelFontColor),this.colors.black=o("#000000"),this.colors.intron=o("#CFCFCF"),this.colors.intronHEX="#CFCFCF",this.colors.labelBackgroundPlus=o(this.options.labelBackgroundPlusStrandColor),this.colors.labelBackgroundMinus=o(this.options.labelBackgroundMinusStrandColor),this.colors.labelStrokePlus=o(this.options.labelStrokePlusStrandColor),this.colors.labelStrokeMinus=o(this.options.labelStrokeMinusStrandColor),this.colors.background=o(this.options.backgroundColor)}},{key:"initTile",value:function(t){t.initialized||(c(this,t,{flipText:this.flipText,fontSize:this.fontSize,fontFamily:this.options.fontFamily,maxTexts:this.options.maxTexts}),this.rerender(this.options,!0))}},{key:"destroyTile",value:function(t){for(var e in t.rectGraphics.destroy(),t.rectMaskGraphics.destroy(),t.labelGraphics.removeChildren(),t.texts)t.texts[e].destroy();t.texts=[],t.labelGraphics.destroy(),t.labelBgGraphics.destroy(),t.codonSeparatorGraphics.destroy(),t.codonTextGraphics.removeChildren(),t.codonTextGraphics.destroy(),t.graphics.destroy(),t.tileData.length=0,t=null}},{key:"computeTrackHeight",value:function(){var t=0;if(this.areTranscriptsHidden)t=this.toggleButtonHeight+Math.min(1,this.numTranscriptRows)*(this.transcriptHeight+this.transcriptSpacing)+10;else{var e=this.options.showToggleTranscriptsButton?this.toggleButtonHeight:0;t=this.numTranscriptRows*(this.transcriptHeight+this.transcriptSpacing)+e+10}return this.trackHeightOld=this.trackHeight,this.trackHeight=t,t}},{key:"adjustTrackHeight",value:function(){return this.computeTrackHeight(),this.trackHeightOld!==this.trackHeight&&(this.pubSub.publish("trackDimensionsModified",{height:this.trackHeight,resizeParentDiv:!0,trackId:this.trackId,viewId:this.viewId}),!0)}},{key:"formatTranscriptData",value:function(t){var e=t[5],n="."===t[12]?".":"+"===e?+t[12]+2:+t[12]-1,r="."===t[11]?".":"+"===e?+t[11]-1:+t[11]+2,i=t[9].split(",").map((function(t){return+t-1})),a=t[10].split(",").map((function(t){return+t})),s=+t[1]-1,o=+t[2]-1;return{transcriptId:this.transcriptId(t),transcriptName:t[3],txStart:s,txEnd:o,strand:e,chromName:t[0],codingType:t[8],exonStarts:i,exonEnds:a,startCodonPos:r,stopCodonPos:n,importance:+t[4]}}},{key:"updateTranscriptInfo",value:function(){var t=this,e={};this.visibleAndFetchedTiles().forEach((function(t){t.tileData.forEach((function(t){e[t.transcriptId]=t.fields}))}));var n=[];for(var r in e)n.push(e[r]);if(this.transcriptInfo={},this.transcriptPositionInfo={},this.numTranscriptRows=0,n.sort((function(t,e){return+t[1]-e[1]})).forEach((function(e){var n=t.calculateTranscriptRowNumber(t.transcriptPositionInfo,+e[1],+e[2]);void 0===t.transcriptPositionInfo[n]&&(t.transcriptPositionInfo[n]=[]),t.transcriptPositionInfo[n].push([+e[1],+e[2],e[3]]);var r=t.formatTranscriptData(e),i={transcriptId:r.transcriptId,transcriptName:r.transcriptName,txStart:r.txStart,txEnd:r.txEnd,strand:r.strand,chromName:r.chromName,codingType:r.codingType,exonStarts:r.exonStarts,exonEnds:r.exonEnds,startCodonPos:r.startCodonPos,stopCodonPos:r.stopCodonPos,displayOrder:n,importance:r.importance};t.transcriptInfo[i.transcriptId]=i})),this.numTranscriptRows=Object.keys(this.transcriptPositionInfo).length,this.areTranscriptsHidden&&this.buttons.pToggleButton.children[0]&&this.transcriptPositionInfo[0]){var i=Object.keys(this.transcriptInfo).length-this.transcriptPositionInfo[0].length,a=Math.max(0,i);this.buttons.pToggleButton.children[0].text="SHOW "+a+" MORE TRANSCRIPTS..."}}},{key:"calculateTranscriptRowNumber",value:function(t,e,n){for(var r=Object.keys(t).length,i=0;i<r;i++){var a=!0;if(t[i].forEach((function(t){var r=t[0],i=t[1];(r<=e&&e<=i||r<=n&&n<=i)&&(a=!1)})),a)return i}return r}},{key:"rerender",value:function(t,e){var n=this,r=JSON.stringify(t);(e||r!==this.prevOptions)&&(this.options=t,this.initOptions(),this.prevOptions=r,w(this),this.updateTranscriptInfo(),this.trackHeightAdjustment&&this.adjustTrackHeight()||this.visibleAndFetchedTiles().forEach((function(t){n.renderTile(t)})))}},{key:"drawTile",value:function(){}},{key:"transcriptId",value:function(t){return t[7]+"_"+t[0]+"_"+t[1]+"_"+t[2]}},{key:"exonId",value:function(t,e,n){return t[7]+"_"+t[0]+"_"+t[1]+"_"+t[2]+"_"+e+"_"+n}},{key:"renderTile",value:function(t){if(t.initialized){t.allExonsForMouseOver=[],t.allExonsForSVG=[],t.drawnAtScale=this._xScale.copy(),t.rectGraphics.removeChildren(),t.rectGraphics.clear(),t.labelBgGraphics.clear();var e=t.tileData.filter((function(t){return"filler"!==t.type&&("+"===t.strand||"+"===t.fields[5])})),n=t.tileData.filter((function(t){return"filler"!==t.type&&("-"===t.strand||"-"===t.fields[5])})),r=[this,t,this.transcriptHeight/2+this.transcriptSpacing/2,this.transcriptHeight,this.transcriptSpacing];p.apply(void 0,[e].concat(r)),p.apply(void 0,[n].concat(r)),g(this,t),h.stretchRects(this,[function(t){return t.rectGraphics},function(t){return t.rectMaskGraphics}])}}},{key:"calculateZoomLevel",value:function(){var t=a.calculateZoomLevel(this._xScale,this.tilesetInfo.min_pos[0],this.tilesetInfo.max_pos[0]),e=Math.min(t,this.maxZoom);return e=Math.max(e,0)}},{key:"draw",value:function(){h.stretchRects(this,[function(t){return t.rectGraphics},function(t){return t.rectMaskGraphics}]),this.areCodonsShown=!1,this.drawLabels(),this.drawCodonSeparators(),this.drawCodonTexts(),requestAnimationFrame(this.animate)}},{key:"drawCodonTexts",value:function(){var t=this;Object.values(this.fetchedTiles).filter((function(t){return t.drawnAtScale})).forEach((function(e){if(e.initialized&&e.aaInfo&&e.aaInfo.aminoAcids){e.codonTextGraphics.clear(),e.codonTextGraphics.removeChildren();var n=1,r=t._xScale(3)-t._xScale(0);if(!(r<t.minCodonDistance)){r<t.minCodonDistance+3&&r>=t.minCodonDistance&&(n=Lt().domain([t.minCodonDistance,t.minCodonDistance+3]).range([0,1]).clamp(!0)(r));var i=e.codonTextGraphics;i.beginFill(u),i.alpha=n,e.tileData.forEach((function(n){var a=n.transcriptId;if(t.transcriptInfo[a]&&e.aaInfo.aminoAcids[a]){var s=t.transcriptInfo[a];if(!t.areTranscriptsHidden||0===s.displayOrder){var o=+n.chrOffset,h=e.aaInfo.aminoAcids[a],l=s.displayOrder*(t.transcriptHeight+t.transcriptSpacing)+t.transcriptHeight/2+t.transcriptSpacing/2-t.fontSize/2-1;t.options.showToggleTranscriptsButton&&(l+=t.toggleButtonHeight);for(var u=0,c=h.length;u<c;++u){var f=h[u],d=t._xScale(f.posStart+o+1);if(!(t._xScale(f.posEnd+o+1)<0||d>t.dimensions[0]))if(r<t.minCodonDistance+10){var p=t._xScale((f.posStart+f.posEnd+1)/2+o+1)-f.widthAbbrev/2;f.spriteAbbrev.position.x=p,f.spriteAbbrev.position.y=l,i.addChild(f.spriteAbbrev)}else{var g=t._xScale((f.posStart+f.posEnd+1)/2+o+1)-f.width/2;f.sprite.position.x=g,f.sprite.position.y=l,i.addChild(f.sprite)}}}}}))}}}))}},{key:"drawCodonSeparators",value:function(){var t=this;Object.values(this.fetchedTiles).filter((function(t){return t.drawnAtScale})).forEach((function(e){if(e.initialized&&e.aaInfo&&e.aaInfo.aminoAcids){e.allCodonsForMouseOver=[],e.codonSeparatorGraphics.clear();var n=1,r=t._xScale(3)-t._xScale(0);if(!(r<t.minCodonDistance)){r<t.minCodonDistance+3&&r>=t.minCodonDistance&&(n=Lt().domain([t.minCodonDistance,t.minCodonDistance+3]).range([0,1]).clamp(!0)(r)),t.areCodonsShown=!0;var i=e.codonSeparatorGraphics;i.beginFill(u),i.alpha=n,e.tileData.forEach((function(n){var r=n.transcriptId;if(t.transcriptInfo[r]&&e.aaInfo.aminoAcids[r]){var a=t.transcriptInfo[r];if(!t.areTranscriptsHidden||0===a.displayOrder){var s=+n.chrOffset,o=e.aaInfo.aminoAcids[r],h=a.displayOrder*(t.transcriptHeight+t.transcriptSpacing)+t.transcriptHeight/2+t.transcriptSpacing/2;t.options.showToggleTranscriptsButton&&(h+=t.toggleButtonHeight);for(var l=h-t.transcriptHeight/2,u=h+t.transcriptHeight/2,c=0,f=o.length;c<f;++c){var d=o[c],p=t._xScale(d.posStart+s+1),g=t._xScale(d.posEnd+s+2);if(!(g<0||p>t.dimensions[0])){var m=[[p,g,l,u],d.aminoAcid];if(e.allCodonsForMouseOver.push(m),!("+"===a.strand&&d.posStart===a.startCodonPos||"+"===a.strand&&a.exonStarts.includes(d.posStart)||"-"===a.strand&&d.posEnd+1===a.startCodonPos||"-"===a.strand&&a.exonEnds.includes(d.posEnd+1))){var v="+"===a.strand?p:g,w=v,b=v,_=v;"+"===a.strand?(w-=5,b+=2,_-=3):(w+=5,b-=2,_+=3);var y=[v,l,_,l,b,h,_,u,w,u,v,h,w,l];i.drawPolygon(y)}}}}}}))}}}))}},{key:"drawLabels",value:function(){var t=this;this.allTexts=[],this.allBoxes=[];var e=[];Object.values(this.fetchedTiles).filter((function(t){return t.drawnAtScale})).forEach((function(n){try{if(n.labelBgGraphics.clear(),!n.initialized)return;n.tileData.forEach((function(r){if(n.texts){var i=r.transcriptId;if(void 0!==t.transcriptInfo[i]){var a=t.transcriptInfo[i],s=n.texts[i];if(s)if(t.areTranscriptsHidden&&0!==a.displayOrder)s.visible=!1;else{try{if(!n.textWidths[i]){var o=s.getBounds().width,h=s.getBounds().height;n.textHeights[i]=h,n.textWidths[i]=o}}catch(t){return}var l=+r.chrOffset,u=a.txStart+l,c=a.txEnd+l,f=a.displayOrder*(t.transcriptHeight+t.transcriptSpacing);t.options.showToggleTranscriptsButton&&(f+=t.toggleButtonHeight);var d=t.transcriptHeight/2+t.transcriptSpacing/2+f;"+"===a.strand?s.position.x=Math.max(t._xScale(t.xScale().domain()[0])+3,t._xScale(u+1)-n.textWidths[i]-6-3):s.position.x=Math.max(t._xScale(t.xScale().domain()[0])+3+5,t._xScale(u+1)-n.textWidths[i]-6);var p="+"===a.strand?n.textWidths[i]+t.transcriptHeight/2+6-3:n.textWidths[i]+3;s.position.x=Math.min(s.position.x,t._xScale(c+1)-p),s.position.y=d;var g=!0,m=a.displayOrder;t.transcriptPositionInfo[m].filter((function(t){return t[1]<a.txStart})).forEach((function(e){t._xScale(e[1]+l+1)>s.position.x-12&&(g=!1)})),g?(s.visible=!0,t.allBoxes.push([s.position.x-3,d,n.textWidths[i]+6,t.transcriptHeight,a.transcriptName]),t.allTexts.push({importance:a.importance,text:s,caption:a.transcriptName,strand:a.strand}),e.push(n.labelBgGraphics)):s.visible=!1}}}}))}catch(t){return}})),this.renderTextBg(this.allBoxes,this.allTexts,e)}},{key:"renderTextBg",value:function(t,e,n){var r=this;e.forEach((function(e,i){if(e.text.visible&&t[i]&&n[i]){var a=ne(t[i],4),s=a[0],o=a[1],h=a[2],l=a[3],u=s,c=u+1,f=s+h,d=f-1,p=o-l/2,g=p+1,m=o+l/2,v=m-1;if("+"===e.strand){n[i].beginFill(r.colors.labelStrokePlus);var w=[u,p,f,p,f+5,o,f,m,u,m];n[i].drawPolygon(w),n[i].beginFill(r.colors.labelBackgroundPlus);var b=[c,g,f,g,d+3,o,f,v,c,v];n[i].drawPolygon(b)}else{n[i].beginFill(r.colors.background);var _=[u-5,p,f,p,f,m,u-5,m];n[i].drawPolygon(_),n[i].beginFill(r.colors.labelStrokeMinus);var y=[u-5,o,u,p,f,p,f,m,s,m];n[i].drawPolygon(y),n[i].beginFill(r.colors.labelBackgroundMinus);var k=[c-3,o,s,g,d,g,d,v,s,v];n[i].drawPolygon(k)}}}))}},{key:"hideTexts",value:function(t){t.forEach((function(t,e){t.visible=!1}))}},{key:"setPosition",value:function(t){ie(r.prototype.__proto__||Object.getPrototypeOf(r.prototype),"setPosition",this).call(this,t);var e=ne(this.position,2);this.pMain.position.x=e[0],this.pMain.position.y=e[1]}},{key:"setDimensions",value:function(t){this.updateTranscriptInfo(),ie(r.prototype.__proto__||Object.getPrototypeOf(r.prototype),"setDimensions",this).call(this,t),this.rerender(this.options,!0)}},{key:"zoomed",value:function(t,e){this.xScale(t),this.yScale(e),this.refreshTiles(),this.draw()}},{key:"isPointInRectangle",value:function(t,e){return t[0]<e[0]&&t[1]>e[0]&&t[2]<e[1]&&t[3]>e[1]}},{key:"getMouseOverHtml",value:function(t,e,n){if(!this.tilesetInfo||!this.options||!this.options.showTooltip&&!n)return"";var r=[t,e],i=!0,a=!1,s=void 0;try{for(var o,h=this.visibleAndFetchedTiles()[Symbol.iterator]();!(i=(o=h.next()).done);i=!0){var l=o.value;if(!l.allExonsForMouseOver)return;for(var u=0;u<l.allExonsForMouseOver.length;u++){var c=l.allExonsForMouseOver[u][0];if(this.isPointInRectangle(c,r)){var f=l.allExonsForMouseOver[u][1];if(!this.areCodonsShown){var d='<div class="track-mouseover-menu-table">';return d+='\n <div class="track-mouseover-menu-table-item">\n <label for="name" class="track-mouseover-menu-table-item-label">Transcript</label>\n <div name="name" class="track-mouseover-menu-table-item-value">'+f.transcriptName+"</div>\n </div>\n ",d+='\n <div class="track-mouseover-menu-table-item">\n <label for="position" class="track-mouseover-menu-table-item-label">Interval</label>\n <div name="position" class="track-mouseover-menu-table-item-value">'+f.chromName+":"+f.txStart+"-"+f.txEnd+" ("+f.strand+")</div>\n </div>\n ",d+="</div>"}for(var p=0;p<l.allCodonsForMouseOver.length;p++){var g=l.allCodonsForMouseOver[p][0];if(this.isPointInRectangle(g,r)){var m=l.allCodonsForMouseOver[p][1];if("X"===m.key)return'\n <div style="text-align: center; padding:10px;">\n <div style="text-transform: uppercase;">\n <b>'+m.name+'</b>\n </div>\n <div style="font-size: 10px;">\n '+m.codons.join(", ")+"\n </div>\n </div>\n ";var v=m.essential?"essential":"non-essential";return'\n <div style="text-align: center; padding:10px;">\n <div>\n <img class="fit-picture" \n src="'+m.image+'" \n style="width:125px;height:125px"\n alt="'+m.name+'">\n </div>\n <div style="text-transform: uppercase; padding-top:6px;">\n <b>'+m.name+'</b>\n </div>\n <div style="padding-top:0px;">\n <i>'+m.property+", "+v+'</i>\n </div>\n <div style="font-size: 10px;">\n '+m.codons.join(", ")+"\n </div>\n </div>\n "}}}}}}catch(t){a=!0,s=t}finally{try{!i&&h.return&&h.return()}finally{if(a)throw s}}return""}},{key:"exportSVG",value:function(){var e,n=this,r=null;r=e=document.createElement("g");var i=Ht.a.nice(),a=document.createElement("g");a.setAttribute("style","clip-path:url(#"+i+");"),r.appendChild(a);var s=document.createElementNS("http://www.w3.org/2000/svg","clipPath");s.setAttribute("id",i),r.appendChild(s);var o=document.createElementNS("http://www.w3.org/2000/svg","polygon");s.appendChild(o),o.setAttribute("points",this.position[0]+","+this.position[1]+" "+(this.position[0]+this.dimensions[0])+","+this.position[1]+" "+(this.position[0]+this.dimensions[0])+","+(this.position[1]+this.dimensions[1])+" "+this.position[0]+","+(this.position[1]+this.dimensions[1])+" ");var h=document.createElement("g");h.setAttribute("transform","translate("+this.position[0]+","+this.position[1]+")"),a.appendChild(h);var l=document.createElement("rect");l.setAttribute("fill",this.options.backgroundColor),l.setAttribute("fill-opacity","1"),l.setAttribute("stroke-opacity","0"),l.setAttribute("width",this.dimensions[0]),l.setAttribute("height",this.dimensions[1]),l.setAttribute("x","0"),l.setAttribute("y","0"),h.appendChild(l);[0,1].forEach((function(t){n.visibleAndFetchedTiles().filter((function(t){return t.allExonsForSVG})).forEach((function(e){var n=document.createElement("g");n.setAttribute("transform","translate("+e.rectGraphics.position.x+",\n "+e.rectGraphics.position.y+")\n scale("+e.rectGraphics.scale.x+",\n "+e.rectGraphics.scale.y+")"),e.allExonsForSVG.filter((function(e){return e.paintOrder===t})).forEach((function(t){for(var e=document.createElement("path"),r=t.rect,i="M "+r[0]+" "+r[1],a=2;a<r.length;a+=2)i+=" L "+r[a]+" "+r[a+1];e.setAttribute("d",i),e.setAttribute("fill",t.color),e.setAttribute("opacity","1"),n.appendChild(e)})),h.appendChild(n)}))}));var u=[],c=2,f=2,d=1,p=1;return this.allTexts.filter((function(t){return t.text.visible})).forEach((function(e){if(!u.includes(e.text.text)){var r=document.createElement("polygon");r.setAttribute("stroke-width","1"),r.setAttribute("stroke-opacity","1");var i=-c+","+d,a=e.text.width+f+","+d,s=e.text.width+f+","+(.75*-n.transcriptHeight-p),o=-c+","+(.75*-n.transcriptHeight-p);switch(e.strand){case"-":var l=void 0!==n.options.labelStrokeMinusStrandColor?n.options.labelStrokeMinusStrandColor:t.config.defaultOptions.labelStrokeMinusStrandColor;r.setAttribute("stroke",l);var g=void 0!==n.options.labelBackgroundMinusStrandColor?n.options.labelBackgroundMinusStrandColor:t.config.defaultOptions.labelBackgroundMinusStrandColor;r.setAttribute("fill",g);var m=-c-5+","+.75*-n.transcriptHeight/2;r.setAttribute("points",m+" "+i+" "+a+" "+s+" "+o);break;case"+":default:var v=void 0!==n.options.labelStrokeMinusStrandColor?n.options.labelStrokeMinusStrandColor:t.config.defaultOptions.labelStrokeMinusStrandColor;r.setAttribute("stroke",v);var w=void 0!==n.options.labelBackgroundPlusStrandColor?n.options.labelBackgroundPlusStrandColor:t.config.defaultOptions.labelBackgroundPlusStrandColor;r.setAttribute("fill",w);var b=e.text.width+f+5+","+.75*-n.transcriptHeight/2;r.setAttribute("points",i+" "+a+" "+b+" "+s+" "+o)}var _=document.createElement("text");_.setAttribute("text-anchor","start"),_.setAttribute("font-family",n.options.fontFamily),_.setAttribute("font-size",n.fontSize+"px"),_.setAttribute("fill",n.options.labelFontColor),_.innerHTML=e.text.text,u.push(e.text.text);var y=document.createElement("g");y.setAttribute("transform","scale("+e.text.scale.x+",1)"),y.appendChild(r),y.appendChild(_),y.setAttribute("transform","translate("+e.text.x+","+(e.text.y+n.transcriptHeight/4+1)+")scale("+e.text.scale.x+",1)"),h.appendChild(y)}})),[e,e]}}]),r}(e.tracks.HorizontalGeneAnnotationsTrack);return new(Function.prototype.bind.apply(b,[null].concat(r)))};he.config={type:"horizontal-transcripts",datatype:["gene-annotation"],local:!1,orientation:"1d-horizontal",thumbnail:(new DOMParser).parseFromString('<svg width="20" height="20" xmlns="http://www.w3.org/2000/svg"> <g> <title>background</title> <rect fill="#fff" id="canvas_background" height="3.24996" width="3.24996" y="-1" x="-1"/> <g display="none" id="canvasGrid"> <rect fill="url(#gridpattern)" stroke-width="0" y="0" x="0" height="100%" width="100%" id="svg_2"/> </g> </g> <g> <title>Layer 1</title> <rect id="svg_1" height="20" width="20" stroke-width="0" stroke="#000" fill="#C0EAAF"/> <path stroke="#bdbfff" id="svg_4" d="m11.42795,10.0119l-4.10746,-6.99997l2.70509,0l4.10746,6.99997l-4.10746,6.99997l-2.70509,0l4.10746,-6.99997z" stroke-width="6" fill="#bdbfff"/> </g> </svg>',"text/xml").documentElement,availableOptions:["fontSize","fontFamily","transcriptSpacing","transcriptHeight","maxTexts","plusStrandColor","minusStrandColor","utrColor","labelBackgroundPlusStrandColor","labelBackgroundMinusStrandColor","labelFontColor","labelStrokePlusStrandColor","labelStrokeMinusStrandColor","startCollapsed","showToggleTranscriptsButton","trackHeightAdjustment","sequenceData","backgroundColor","showTooltip"],defaultOptions:{fontSize:9,fontFamily:"Helvetica",transcriptSpacing:2,transcriptHeight:11,maxTexts:20,plusStrandColor:"#bdbfff",minusStrandColor:"#fabec2",utrColor:"#C0EAAF",labelBackgroundPlusStrandColor:"#ffffff",labelBackgroundMinusStrandColor:"#ffffff",labelFontColor:"#333333",labelStrokePlusStrandColor:"#999999",labelStrokeMinusStrandColor:"#999999",startCollapsed:!1,trackHeightAdjustment:"automatic",showToggleTranscriptsButton:!0,backgroundColor:"#ffffff",showTooltip:!0}};var le=he;i({name:"TranscriptsTrack",track:le,config:le.config});e.default=le},function(t,e,n){"use strict";n.r(e),n.d(e,"parseSmallFasta",(function(){return o})),n.d(e,"FetchableSmallFasta",(function(){return h})),n.d(e,"IndexedFasta",(function(){return a.a})),n.d(e,"BgzipIndexedFasta",(function(){return s}));var r=n(0),i=n(10),a=(n(4),n(5));class s extends a.a{constructor({fasta:t,path:e,fai:n,faiPath:r,gzi:a,gziPath:s,chunkSizeLimit:o}){super({fasta:t,path:e,fai:n,faiPath:r,chunkSizeLimit:o}),t&&a?this.fasta=new i.a({filehandle:t,gziFilehandle:a}):e&&s&&(this.fasta=new i.a({path:e,gziPath:s}))}}function o(t){return t.split(">").filter(t=>/\S/.test(t)).map(t=>{const[e,...n]=t.split("\n"),[r,...i]=e.split(" "),a=n.join("").replace(/\s/g,"");return{id:r,description:i.join(" "),sequence:a}})}class h{constructor({fasta:t,path:e}){if(t)this.fasta=t;else{if(!e)throw new Error("Need to pass fasta or path");this.fasta=new r.a(e)}this.data=this.fasta.readFile().then(t=>o(t.toString("utf8")))}async fetch(t,e,n){const r=(await this.data).find(e=>e.id===t),i=n-e;if(!r)throw new Error(`no sequence with id ${t} exists`);return r.sequence.substr(e,i)}async getSequenceNames(){return(await this.data).map(t=>t.id)}}}])}));