UNPKG

higlass-labelled-points-track

Version:
10 lines 55.4 kB
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports["higlass-labelled-points-track"]=e():t["higlass-labelled-points-track"]=e()}(window,function(){return function(t){var e={};function r(n){if(e[n])return e[n].exports;var i=e[n]={i:n,l:!1,exports:{}};return t[n].call(i.exports,i,i.exports,r),i.l=!0,i.exports}return r.m=t,r.c=e,r.d=function(t,e,n){r.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},r.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},r.t=function(t,e){if(1&e&&(t=r(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var i in t)r.d(n,i,function(e){return t[e]}.bind(null,i));return n},r.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return r.d(e,"a",e),e},r.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},r.p="",r(r.s=15)}([function(t,e,r){"use strict";(function(t){var n=r(1),i=r(6),o=r(7).Buffer;t.__TYPEDARRAY_POOL||(t.__TYPEDARRAY_POOL={UINT8:i([32,0]),UINT16:i([32,0]),UINT32:i([32,0]),BIGUINT64:i([32,0]),INT8:i([32,0]),INT16:i([32,0]),INT32:i([32,0]),BIGINT64:i([32,0]),FLOAT:i([32,0]),DOUBLE:i([32,0]),DATA:i([32,0]),UINT8C:i([32,0]),BUFFER:i([32,0])});var a="undefined"!=typeof Uint8ClampedArray,u="undefined"!=typeof BigUint64Array,f="undefined"!=typeof BigInt64Array,s=t.__TYPEDARRAY_POOL;s.UINT8C||(s.UINT8C=i([32,0])),s.BIGUINT64||(s.BIGUINT64=i([32,0])),s.BIGINT64||(s.BIGINT64=i([32,0])),s.BUFFER||(s.BUFFER=i([32,0]));var l=s.DATA,c=s.BUFFER;function h(t){if(t){var e=t.length||t.byteLength,r=n.log2(e);l[r].push(t)}}function p(t){t=n.nextPow2(t);var e=n.log2(t),r=l[e];return r.length>0?r.pop():new ArrayBuffer(t)}function v(t){return new Uint8Array(p(t),0,t)}function d(t){return new Uint16Array(p(2*t),0,t)}function y(t){return new Uint32Array(p(4*t),0,t)}function g(t){return new Int8Array(p(t),0,t)}function b(t){return new Int16Array(p(2*t),0,t)}function w(t){return new Int32Array(p(4*t),0,t)}function m(t){return new Float32Array(p(4*t),0,t)}function A(t){return new Float64Array(p(8*t),0,t)}function x(t){return a?new Uint8ClampedArray(p(t),0,t):v(t)}function T(t){return u?new BigUint64Array(p(8*t),0,t):null}function _(t){return f?new BigInt64Array(p(8*t),0,t):null}function P(t){return new DataView(p(t),0,t)}function E(t){t=n.nextPow2(t);var e=n.log2(t),r=c[e];return r.length>0?r.pop():new o(t)}e.free=function(t){if(o.isBuffer(t))c[n.log2(t.length)].push(t);else{if("[object ArrayBuffer]"!==Object.prototype.toString.call(t)&&(t=t.buffer),!t)return;var e=t.length||t.byteLength,r=0|n.log2(e);l[r].push(t)}},e.freeUint8=e.freeUint16=e.freeUint32=e.freeBigUint64=e.freeInt8=e.freeInt16=e.freeInt32=e.freeBigInt64=e.freeFloat32=e.freeFloat=e.freeFloat64=e.freeDouble=e.freeUint8Clamped=e.freeDataView=function(t){h(t.buffer)},e.freeArrayBuffer=h,e.freeBuffer=function(t){c[n.log2(t.length)].push(t)},e.malloc=function(t,e){if(void 0===e||"arraybuffer"===e)return p(t);switch(e){case"uint8":return v(t);case"uint16":return d(t);case"uint32":return y(t);case"int8":return g(t);case"int16":return b(t);case"int32":return w(t);case"float":case"float32":return m(t);case"double":case"float64":return A(t);case"uint8_clamped":return x(t);case"bigint64":return _(t);case"biguint64":return T(t);case"buffer":return E(t);case"data":case"dataview":return P(t);default:return null}return null},e.mallocArrayBuffer=p,e.mallocUint8=v,e.mallocUint16=d,e.mallocUint32=y,e.mallocInt8=g,e.mallocInt16=b,e.mallocInt32=w,e.mallocFloat32=e.mallocFloat=m,e.mallocFloat64=e.mallocDouble=A,e.mallocUint8Clamped=x,e.mallocBigUint64=T,e.mallocBigInt64=_,e.mallocDataView=P,e.mallocBuffer=E,e.clearCache=function(){for(var t=0;t<32;++t)s.UINT8[t].length=0,s.UINT16[t].length=0,s.UINT32[t].length=0,s.INT8[t].length=0,s.INT16[t].length=0,s.INT32[t].length=0,s.FLOAT[t].length=0,s.DOUBLE[t].length=0,s.BIGUINT64[t].length=0,s.BIGINT64[t].length=0,s.UINT8C[t].length=0,l[t].length=0,c[t].length=0}}).call(this,r(2))},function(t,e,r){"use strict";"use restrict";function n(t){var e=32;return(t&=-t)&&e--,65535&t&&(e-=16),16711935&t&&(e-=8),252645135&t&&(e-=4),858993459&t&&(e-=2),1431655765&t&&(e-=1),e}e.INT_BITS=32,e.INT_MAX=2147483647,e.INT_MIN=-1<<31,e.sign=function(t){return(t>0)-(t<0)},e.abs=function(t){var e=t>>31;return(t^e)-e},e.min=function(t,e){return e^(t^e)&-(t<e)},e.max=function(t,e){return t^(t^e)&-(t<e)},e.isPow2=function(t){return!(t&t-1||!t)},e.log2=function(t){var e,r;return e=(t>65535)<<4,e|=r=((t>>>=e)>255)<<3,e|=r=((t>>>=r)>15)<<2,(e|=r=((t>>>=r)>3)<<1)|(t>>>=r)>>1},e.log10=function(t){return t>=1e9?9:t>=1e8?8:t>=1e7?7:t>=1e6?6:t>=1e5?5:t>=1e4?4:t>=1e3?3:t>=100?2:t>=10?1:0},e.popCount=function(t){return 16843009*((t=(858993459&(t-=t>>>1&1431655765))+(t>>>2&858993459))+(t>>>4)&252645135)>>>24},e.countTrailingZeros=n,e.nextPow2=function(t){return t+=0===t,--t,t|=t>>>1,t|=t>>>2,t|=t>>>4,t|=t>>>8,(t|=t>>>16)+1},e.prevPow2=function(t){return t|=t>>>1,t|=t>>>2,t|=t>>>4,t|=t>>>8,(t|=t>>>16)-(t>>>1)},e.parity=function(t){return t^=t>>>16,t^=t>>>8,t^=t>>>4,27030>>>(t&=15)&1};var i=new Array(256);!function(t){for(var e=0;e<256;++e){var r=e,n=e,i=7;for(r>>>=1;r;r>>>=1)n<<=1,n|=1&r,--i;t[e]=n<<i&255}}(i),e.reverse=function(t){return i[255&t]<<24|i[t>>>8&255]<<16|i[t>>>16&255]<<8|i[t>>>24&255]},e.interleave2=function(t,e){return(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t&=65535)|t<<8))|t<<4))|t<<2))|t<<1))|(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e&=65535)|e<<8))|e<<4))|e<<2))|e<<1))<<1},e.deinterleave2=function(t,e){return(t=65535&((t=16711935&((t=252645135&((t=858993459&((t=t>>>e&1431655765)|t>>>1))|t>>>2))|t>>>4))|t>>>16))<<16>>16},e.interleave3=function(t,e,r){return t=1227133513&((t=3272356035&((t=251719695&((t=4278190335&((t&=1023)|t<<16))|t<<8))|t<<4))|t<<2),(t|=(e=1227133513&((e=3272356035&((e=251719695&((e=4278190335&((e&=1023)|e<<16))|e<<8))|e<<4))|e<<2))<<1)|(r=1227133513&((r=3272356035&((r=251719695&((r=4278190335&((r&=1023)|r<<16))|r<<8))|r<<4))|r<<2))<<2},e.deinterleave3=function(t,e){return(t=1023&((t=4278190335&((t=251719695&((t=3272356035&((t=t>>>e&1227133513)|t>>>2))|t>>>4))|t>>>8))|t>>>16))<<22>>22},e.nextCombination=function(t){var e=t|t-1;return e+1|(~e&-~e)-1>>>n(t)+1}},function(t,e){var r;r=function(){return this}();try{r=r||new Function("return this")()}catch(t){"object"==typeof window&&(r=window)}t.exports=r},function(t,e,r){"use strict";t.exports={init:function(t){var e=i.nextPow2(t);u.length<e&&(n.free(u),u=n.mallocInt32(e));f.length<e&&(n.free(f),f=n.mallocInt32(e));s.length<e&&(n.free(s),s=n.mallocInt32(e));l.length<e&&(n.free(l),l=n.mallocInt32(e));c.length<e&&(n.free(c),c=n.mallocInt32(e));h.length<e&&(n.free(h),h=n.mallocInt32(e));var r=8*e;p.length<r&&(n.free(p),p=n.mallocDouble(r))},sweepBipartite:function(t,e,r,n,i,c,h,y,g,b){for(var w=0,m=2*t,A=t-1,x=m-1,T=r;T<n;++T){var _=c[T],P=m*T;p[w++]=i[P+A],p[w++]=-(_+1),p[w++]=i[P+x],p[w++]=_}for(var T=h;T<y;++T){var _=b[T]+a,E=m*T;p[w++]=g[E+A],p[w++]=-_,p[w++]=g[E+x],p[w++]=_}var I=w>>>1;o(p,I);for(var B=0,S=0,T=0;T<I;++T){var R=0|p[2*T+1];if(R>=a)v(s,l,S--,R=R-a|0);else if(R>=0)v(u,f,B--,R);else if(R<=-a){R=-R-a|0;for(var U=0;U<B;++U){var k=e(u[U],R);if(void 0!==k)return k}d(s,l,S++,R)}else{R=-R-1|0;for(var U=0;U<S;++U){var k=e(R,s[U]);if(void 0!==k)return k}d(u,f,B++,R)}}},sweepComplete:function(t,e,r,n,i,a,y,g,b,w){for(var m=0,A=2*t,x=t-1,T=A-1,_=r;_<n;++_){var P=a[_]+1<<1,E=A*_;p[m++]=i[E+x],p[m++]=-P,p[m++]=i[E+T],p[m++]=P}for(var _=y;_<g;++_){var P=w[_]+1<<1,I=A*_;p[m++]=b[I+x],p[m++]=1|-P,p[m++]=b[I+T],p[m++]=1|P}var B=m>>>1;o(p,B);for(var S=0,R=0,U=0,_=0;_<B;++_){var k=0|p[2*_+1],O=1&k;if(_<B-1&&k>>1==p[2*_+3]>>1&&(O=2,_+=1),k<0){for(var C=-(k>>1)-1,M=0;M<U;++M){var D=e(c[M],C);if(void 0!==D)return D}if(0!==O)for(var M=0;M<S;++M){var D=e(u[M],C);if(void 0!==D)return D}if(1!==O)for(var M=0;M<R;++M){var D=e(s[M],C);if(void 0!==D)return D}0===O?d(u,f,S++,C):1===O?d(s,l,R++,C):2===O&&d(c,h,U++,C)}else{var C=(k>>1)-1;0===O?v(u,f,S--,C):1===O?v(s,l,R--,C):2===O&&v(c,h,U--,C)}}},scanBipartite:function(t,e,r,n,i,s,l,c,h,y,g,b){var w=0,m=2*t,A=e,x=e+t,T=1,_=1;n?_=a:T=a;for(var P=i;P<s;++P){var E=P+T,I=m*P;p[w++]=l[I+A],p[w++]=-E,p[w++]=l[I+x],p[w++]=E}for(var P=h;P<y;++P){var E=P+_,B=m*P;p[w++]=g[B+A],p[w++]=-E}var S=w>>>1;o(p,S);for(var R=0,P=0;P<S;++P){var U=0|p[2*P+1];if(U<0){var E=-U,k=!1;if(E>=a?(k=!n,E-=a):(k=!!n,E-=1),k)d(u,f,R++,E);else{var O=b[E],C=m*E,M=g[C+e+1],D=g[C+e+1+t];t:for(var j=0;j<R;++j){var L=u[j],Y=m*L;if(!(D<l[Y+e+1]||l[Y+e+1+t]<M)){for(var F=e+2;F<t;++F)if(g[C+F+t]<l[Y+F]||l[Y+F+t]<g[C+F])continue t;var N,z=c[L];if(void 0!==(N=n?r(O,z):r(z,O)))return N}}}}else v(u,f,R--,U-T)}},scanComplete:function(t,e,r,n,i,f,s,l,c,h,v){for(var d=0,y=2*t,g=e,b=e+t,w=n;w<i;++w){var m=w+a,A=y*w;p[d++]=f[A+g],p[d++]=-m,p[d++]=f[A+b],p[d++]=m}for(var w=l;w<c;++w){var m=w+1,x=y*w;p[d++]=h[x+g],p[d++]=-m}var T=d>>>1;o(p,T);for(var _=0,w=0;w<T;++w){var P=0|p[2*w+1];if(P<0){var m=-P;if(m>=a)u[_++]=m-a;else{var E=v[m-=1],I=y*m,B=h[I+e+1],S=h[I+e+1+t];t:for(var R=0;R<_;++R){var U=u[R],k=s[U];if(k===E)break;var O=y*U;if(!(S<f[O+e+1]||f[O+e+1+t]<B)){for(var C=e+2;C<t;++C)if(h[I+C+t]<f[O+C]||f[O+C+t]<h[I+C])continue t;var M=r(k,E);if(void 0!==M)return M}}}}else{for(var m=P-a,R=_-1;R>=0;--R)if(u[R]===m){for(var C=R+1;C<_;++C)u[C-1]=u[C];break}--_}}}};var n=r(0),i=r(1),o=r(11),a=1<<28,u=n.mallocInt32(1024),f=n.mallocInt32(1024),s=n.mallocInt32(1024),l=n.mallocInt32(1024),c=n.mallocInt32(1024),h=n.mallocInt32(1024),p=n.mallocDouble(8192);function v(t,e,r,n){var i=e[n],o=t[r-1];t[i]=o,e[o]=i}function d(t,e,r,n){t[r]=n,e[n]=r}},function(t,e,r){"use strict";t.exports=function(t,e){var r="abcdef".split("").concat(e),i=[];t.indexOf("lo")>=0&&i.push("lo=e[k+n]");t.indexOf("hi")>=0&&i.push("hi=e[k+o]");return r.push(n.replace("_",i.join()).replace("$",t)),Function.apply(void 0,r)};var n="for(var j=2*a,k=j*c,l=k,m=c,n=b,o=a+b,p=c;d>p;++p,k+=j){var _;if($)if(m===p)m+=1,l+=j;else{for(var s=0;j>s;++s){var t=e[k+s];e[k+s]=e[l],e[l++]=t}var u=f[p];f[p]=f[m],f[m++]=u}}return m"},function(t,e,r){"use strict";t.exports=function(t,e,r){switch(arguments.length){case 1:return function(t){return n=[],s(t,t,l,!0),n}(t);case 2:return"function"==typeof e?s(t,t,e,!0):function(t,e){return n=[],s(t,e,l,!1),n}(t,e);case 3:return s(t,e,r,!1);default:throw new Error("box-intersect: Invalid arguments")}};var n,i=r(0),o=r(3),a=r(12);function u(t,e){for(var r=0;r<t;++r)if(!(e[r]<=e[r+t]))return!0;return!1}function f(t,e,r,n){for(var i=0,o=0,a=0,f=t.length;a<f;++a){var s=t[a];if(!u(e,s)){for(var l=0;l<2*e;++l)r[i++]=s[l];n[o++]=a}}return o}function s(t,e,r,n){var u=t.length,s=e.length;if(!(u<=0||s<=0)){var l=t[0].length>>>1;if(!(l<=0)){var c,h=i.mallocDouble(2*l*u),p=i.mallocInt32(u);if((u=f(t,l,h,p))>0){if(1===l&&n)o.init(u),c=o.sweepComplete(l,r,0,u,h,p,0,u,h,p);else{var v=i.mallocDouble(2*l*s),d=i.mallocInt32(s);(s=f(e,l,v,d))>0&&(o.init(u+s),c=1===l?o.sweepBipartite(l,r,0,u,h,p,0,s,v,d):a(l,r,n,u,h,p,s,v,d),i.free(v),i.free(d))}i.free(h),i.free(p)}return c}}}function l(t,e){n.push([t,e])}},function(t,e,r){"use strict";t.exports=function(t,e){switch(void 0===e&&(e=0),typeof t){case"number":if(t>0)return function(t,e){var r,n;for(r=new Array(t),n=0;n<t;++n)r[n]=e;return r}(0|t,e);break;case"object":if("number"==typeof t.length)return function t(e,r,n){var i=0|e[n];if(i<=0)return[];var o,a=new Array(i);if(n===e.length-1)for(o=0;o<i;++o)a[o]=r;else for(o=0;o<i;++o)a[o]=t(e,r,n+1);return a}(t,e,0)}return[]}},function(t,e,r){"use strict";(function(t){
/*!
 * The buffer module from node.js, for the browser.
 *
 * @author   Feross Aboukhadijeh <http://feross.org>
 * @license  MIT
 */
var n=r(8),i=r(9),o=r(10);function a(){return f.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function u(t,e){if(a()<e)throw new RangeError("Invalid typed array length");return f.TYPED_ARRAY_SUPPORT?(t=new Uint8Array(e)).__proto__=f.prototype:(null===t&&(t=new f(e)),t.length=e),t}function f(t,e,r){if(!(f.TYPED_ARRAY_SUPPORT||this instanceof f))return new f(t,e,r);if("number"==typeof t){if("string"==typeof e)throw new Error("If encoding is specified then the first argument must be a string");return c(this,t)}return s(this,t,e,r)}function s(t,e,r,n){if("number"==typeof e)throw new TypeError('"value" argument must not be a number');return"undefined"!=typeof ArrayBuffer&&e instanceof ArrayBuffer?function(t,e,r,n){if(e.byteLength,r<0||e.byteLength<r)throw new RangeError("'offset' is out of bounds");if(e.byteLength<r+(n||0))throw new RangeError("'length' is out of bounds");e=void 0===r&&void 0===n?new Uint8Array(e):void 0===n?new Uint8Array(e,r):new Uint8Array(e,r,n);f.TYPED_ARRAY_SUPPORT?(t=e).__proto__=f.prototype:t=h(t,e);return t}(t,e,r,n):"string"==typeof e?function(t,e,r){"string"==typeof r&&""!==r||(r="utf8");if(!f.isEncoding(r))throw new TypeError('"encoding" must be a valid string encoding');var n=0|v(e,r),i=(t=u(t,n)).write(e,r);i!==n&&(t=t.slice(0,i));return t}(t,e,r):function(t,e){if(f.isBuffer(e)){var r=0|p(e.length);return 0===(t=u(t,r)).length?t:(e.copy(t,0,0,r),t)}if(e){if("undefined"!=typeof ArrayBuffer&&e.buffer instanceof ArrayBuffer||"length"in e)return"number"!=typeof e.length||function(t){return t!=t}(e.length)?u(t,0):h(t,e);if("Buffer"===e.type&&o(e.data))return h(t,e.data)}throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}(t,e)}function l(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(l(e),t=u(t,e<0?0:0|p(e)),!f.TYPED_ARRAY_SUPPORT)for(var r=0;r<e;++r)t[r]=0;return t}function h(t,e){var r=e.length<0?0:0|p(e.length);t=u(t,r);for(var n=0;n<r;n+=1)t[n]=255&e[n];return t}function p(t){if(t>=a())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+a().toString(16)+" bytes");return 0|t}function v(t,e){if(f.isBuffer(t))return t.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(t)||t instanceof ArrayBuffer))return t.byteLength;"string"!=typeof t&&(t=""+t);var r=t.length;if(0===r)return 0;for(var n=!1;;)switch(e){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":case void 0:return F(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return N(t).length;default:if(n)return F(t).length;e=(""+e).toLowerCase(),n=!0}}function d(t,e,r){var n=t[e];t[e]=t[r],t[r]=n}function y(t,e,r,n,i){if(0===t.length)return-1;if("string"==typeof r?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),r=+r,isNaN(r)&&(r=i?0:t.length-1),r<0&&(r=t.length+r),r>=t.length){if(i)return-1;r=t.length-1}else if(r<0){if(!i)return-1;r=0}if("string"==typeof e&&(e=f.from(e,n)),f.isBuffer(e))return 0===e.length?-1:g(t,e,r,n,i);if("number"==typeof e)return e&=255,f.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(t,e,r):Uint8Array.prototype.lastIndexOf.call(t,e,r):g(t,[e],r,n,i);throw new TypeError("val must be string, number or Buffer")}function g(t,e,r,n,i){var o,a=1,u=t.length,f=e.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(t.length<2||e.length<2)return-1;a=2,u/=2,f/=2,r/=2}function s(t,e){return 1===a?t[e]:t.readUInt16BE(e*a)}if(i){var l=-1;for(o=r;o<u;o++)if(s(t,o)===s(e,-1===l?0:o-l)){if(-1===l&&(l=o),o-l+1===f)return l*a}else-1!==l&&(o-=o-l),l=-1}else for(r+f>u&&(r=u-f),o=r;o>=0;o--){for(var c=!0,h=0;h<f;h++)if(s(t,o+h)!==s(e,h)){c=!1;break}if(c)return o}return-1}function b(t,e,r,n){r=Number(r)||0;var i=t.length-r;n?(n=Number(n))>i&&(n=i):n=i;var o=e.length;if(o%2!=0)throw new TypeError("Invalid hex string");n>o/2&&(n=o/2);for(var a=0;a<n;++a){var u=parseInt(e.substr(2*a,2),16);if(isNaN(u))return a;t[r+a]=u}return a}function w(t,e,r,n){return z(F(e,t.length-r),t,r,n)}function m(t,e,r,n){return z(function(t){for(var e=[],r=0;r<t.length;++r)e.push(255&t.charCodeAt(r));return e}(e),t,r,n)}function A(t,e,r,n){return m(t,e,r,n)}function x(t,e,r,n){return z(N(e),t,r,n)}function T(t,e,r,n){return z(function(t,e){for(var r,n,i,o=[],a=0;a<t.length&&!((e-=2)<0);++a)r=t.charCodeAt(a),n=r>>8,i=r%256,o.push(i),o.push(n);return o}(e,t.length-r),t,r,n)}function _(t,e,r){return 0===e&&r===t.length?n.fromByteArray(t):n.fromByteArray(t.slice(e,r))}function P(t,e,r){r=Math.min(t.length,r);for(var n=[],i=e;i<r;){var o,a,u,f,s=t[i],l=null,c=s>239?4:s>223?3:s>191?2:1;if(i+c<=r)switch(c){case 1:s<128&&(l=s);break;case 2:128==(192&(o=t[i+1]))&&(f=(31&s)<<6|63&o)>127&&(l=f);break;case 3:o=t[i+1],a=t[i+2],128==(192&o)&&128==(192&a)&&(f=(15&s)<<12|(63&o)<<6|63&a)>2047&&(f<55296||f>57343)&&(l=f);break;case 4:o=t[i+1],a=t[i+2],u=t[i+3],128==(192&o)&&128==(192&a)&&128==(192&u)&&(f=(15&s)<<18|(63&o)<<12|(63&a)<<6|63&u)>65535&&f<1114112&&(l=f)}null===l?(l=65533,c=1):l>65535&&(l-=65536,n.push(l>>>10&1023|55296),l=56320|1023&l),n.push(l),i+=c}return function(t){var e=t.length;if(e<=E)return String.fromCharCode.apply(String,t);var r="",n=0;for(;n<e;)r+=String.fromCharCode.apply(String,t.slice(n,n+=E));return r}(n)}e.Buffer=f,e.SlowBuffer=function(t){+t!=t&&(t=0);return f.alloc(+t)},e.INSPECT_MAX_BYTES=50,f.TYPED_ARRAY_SUPPORT=void 0!==t.TYPED_ARRAY_SUPPORT?t.TYPED_ARRAY_SUPPORT:function(){try{var t=new Uint8Array(1);return t.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},42===t.foo()&&"function"==typeof t.subarray&&0===t.subarray(1,1).byteLength}catch(t){return!1}}(),e.kMaxLength=a(),f.poolSize=8192,f._augment=function(t){return t.__proto__=f.prototype,t},f.from=function(t,e,r){return s(null,t,e,r)},f.TYPED_ARRAY_SUPPORT&&(f.prototype.__proto__=Uint8Array.prototype,f.__proto__=Uint8Array,"undefined"!=typeof Symbol&&Symbol.species&&f[Symbol.species]===f&&Object.defineProperty(f,Symbol.species,{value:null,configurable:!0})),f.alloc=function(t,e,r){return function(t,e,r,n){return l(e),e<=0?u(t,e):void 0!==r?"string"==typeof n?u(t,e).fill(r,n):u(t,e).fill(r):u(t,e)}(null,t,e,r)},f.allocUnsafe=function(t){return c(null,t)},f.allocUnsafeSlow=function(t){return c(null,t)},f.isBuffer=function(t){return!(null==t||!t._isBuffer)},f.compare=function(t,e){if(!f.isBuffer(t)||!f.isBuffer(e))throw new TypeError("Arguments must be Buffers");if(t===e)return 0;for(var r=t.length,n=e.length,i=0,o=Math.min(r,n);i<o;++i)if(t[i]!==e[i]){r=t[i],n=e[i];break}return r<n?-1:n<r?1:0},f.isEncoding=function(t){switch(String(t).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},f.concat=function(t,e){if(!o(t))throw new TypeError('"list" argument must be an Array of Buffers');if(0===t.length)return f.alloc(0);var r;if(void 0===e)for(e=0,r=0;r<t.length;++r)e+=t[r].length;var n=f.allocUnsafe(e),i=0;for(r=0;r<t.length;++r){var a=t[r];if(!f.isBuffer(a))throw new TypeError('"list" argument must be an Array of Buffers');a.copy(n,i),i+=a.length}return n},f.byteLength=v,f.prototype._isBuffer=!0,f.prototype.swap16=function(){var t=this.length;if(t%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var e=0;e<t;e+=2)d(this,e,e+1);return this},f.prototype.swap32=function(){var t=this.length;if(t%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var e=0;e<t;e+=4)d(this,e,e+3),d(this,e+1,e+2);return this},f.prototype.swap64=function(){var t=this.length;if(t%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var e=0;e<t;e+=8)d(this,e,e+7),d(this,e+1,e+6),d(this,e+2,e+5),d(this,e+3,e+4);return this},f.prototype.toString=function(){var t=0|this.length;return 0===t?"":0===arguments.length?P(this,0,t):function(t,e,r){var n=!1;if((void 0===e||e<0)&&(e=0),e>this.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if((r>>>=0)<=(e>>>=0))return"";for(t||(t="utf8");;)switch(t){case"hex":return S(this,e,r);case"utf8":case"utf-8":return P(this,e,r);case"ascii":return I(this,e,r);case"latin1":case"binary":return B(this,e,r);case"base64":return _(this,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return R(this,e,r);default:if(n)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),n=!0}}.apply(this,arguments)},f.prototype.equals=function(t){if(!f.isBuffer(t))throw new TypeError("Argument must be a Buffer");return this===t||0===f.compare(this,t)},f.prototype.inspect=function(){var t="",r=e.INSPECT_MAX_BYTES;return this.length>0&&(t=this.toString("hex",0,r).match(/.{2}/g).join(" "),this.length>r&&(t+=" ... ")),"<Buffer "+t+">"},f.prototype.compare=function(t,e,r,n,i){if(!f.isBuffer(t))throw new TypeError("Argument must be a Buffer");if(void 0===e&&(e=0),void 0===r&&(r=t?t.length:0),void 0===n&&(n=0),void 0===i&&(i=this.length),e<0||r>t.length||n<0||i>this.length)throw new RangeError("out of range index");if(n>=i&&e>=r)return 0;if(n>=i)return-1;if(e>=r)return 1;if(this===t)return 0;for(var o=(i>>>=0)-(n>>>=0),a=(r>>>=0)-(e>>>=0),u=Math.min(o,a),s=this.slice(n,i),l=t.slice(e,r),c=0;c<u;++c)if(s[c]!==l[c]){o=s[c],a=l[c];break}return o<a?-1:a<o?1:0},f.prototype.includes=function(t,e,r){return-1!==this.indexOf(t,e,r)},f.prototype.indexOf=function(t,e,r){return y(this,t,e,r,!0)},f.prototype.lastIndexOf=function(t,e,r){return y(this,t,e,r,!1)},f.prototype.write=function(t,e,r,n){if(void 0===e)n="utf8",r=this.length,e=0;else if(void 0===r&&"string"==typeof e)n=e,r=this.length,e=0;else{if(!isFinite(e))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");e|=0,isFinite(r)?(r|=0,void 0===n&&(n="utf8")):(n=r,r=void 0)}var i=this.length-e;if((void 0===r||r>i)&&(r=i),t.length>0&&(r<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");for(var o=!1;;)switch(n){case"hex":return b(this,t,e,r);case"utf8":case"utf-8":return w(this,t,e,r);case"ascii":return m(this,t,e,r);case"latin1":case"binary":return A(this,t,e,r);case"base64":return x(this,t,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return T(this,t,e,r);default:if(o)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),o=!0}},f.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var E=4096;function I(t,e,r){var n="";r=Math.min(t.length,r);for(var i=e;i<r;++i)n+=String.fromCharCode(127&t[i]);return n}function B(t,e,r){var n="";r=Math.min(t.length,r);for(var i=e;i<r;++i)n+=String.fromCharCode(t[i]);return n}function S(t,e,r){var n=t.length;(!e||e<0)&&(e=0),(!r||r<0||r>n)&&(r=n);for(var i="",o=e;o<r;++o)i+=Y(t[o]);return i}function R(t,e,r){for(var n=t.slice(e,r),i="",o=0;o<n.length;o+=2)i+=String.fromCharCode(n[o]+256*n[o+1]);return i}function U(t,e,r){if(t%1!=0||t<0)throw new RangeError("offset is not uint");if(t+e>r)throw new RangeError("Trying to access beyond buffer length")}function k(t,e,r,n,i,o){if(!f.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>i||e<o)throw new RangeError('"value" argument is out of bounds');if(r+n>t.length)throw new RangeError("Index out of range")}function O(t,e,r,n){e<0&&(e=65535+e+1);for(var i=0,o=Math.min(t.length-r,2);i<o;++i)t[r+i]=(e&255<<8*(n?i:1-i))>>>8*(n?i:1-i)}function C(t,e,r,n){e<0&&(e=4294967295+e+1);for(var i=0,o=Math.min(t.length-r,4);i<o;++i)t[r+i]=e>>>8*(n?i:3-i)&255}function M(t,e,r,n,i,o){if(r+n>t.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function D(t,e,r,n,o){return o||M(t,0,r,4),i.write(t,e,r,n,23,4),r+4}function j(t,e,r,n,o){return o||M(t,0,r,8),i.write(t,e,r,n,52,8),r+8}f.prototype.slice=function(t,e){var r,n=this.length;if((t=~~t)<0?(t+=n)<0&&(t=0):t>n&&(t=n),(e=void 0===e?n:~~e)<0?(e+=n)<0&&(e=0):e>n&&(e=n),e<t&&(e=t),f.TYPED_ARRAY_SUPPORT)(r=this.subarray(t,e)).__proto__=f.prototype;else{var i=e-t;r=new f(i,void 0);for(var o=0;o<i;++o)r[o]=this[o+t]}return r},f.prototype.readUIntLE=function(t,e,r){t|=0,e|=0,r||U(t,e,this.length);for(var n=this[t],i=1,o=0;++o<e&&(i*=256);)n+=this[t+o]*i;return n},f.prototype.readUIntBE=function(t,e,r){t|=0,e|=0,r||U(t,e,this.length);for(var n=this[t+--e],i=1;e>0&&(i*=256);)n+=this[t+--e]*i;return n},f.prototype.readUInt8=function(t,e){return e||U(t,1,this.length),this[t]},f.prototype.readUInt16LE=function(t,e){return e||U(t,2,this.length),this[t]|this[t+1]<<8},f.prototype.readUInt16BE=function(t,e){return e||U(t,2,this.length),this[t]<<8|this[t+1]},f.prototype.readUInt32LE=function(t,e){return e||U(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},f.prototype.readUInt32BE=function(t,e){return e||U(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},f.prototype.readIntLE=function(t,e,r){t|=0,e|=0,r||U(t,e,this.length);for(var n=this[t],i=1,o=0;++o<e&&(i*=256);)n+=this[t+o]*i;return n>=(i*=128)&&(n-=Math.pow(2,8*e)),n},f.prototype.readIntBE=function(t,e,r){t|=0,e|=0,r||U(t,e,this.length);for(var n=e,i=1,o=this[t+--n];n>0&&(i*=256);)o+=this[t+--n]*i;return o>=(i*=128)&&(o-=Math.pow(2,8*e)),o},f.prototype.readInt8=function(t,e){return e||U(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},f.prototype.readInt16LE=function(t,e){e||U(t,2,this.length);var r=this[t]|this[t+1]<<8;return 32768&r?4294901760|r:r},f.prototype.readInt16BE=function(t,e){e||U(t,2,this.length);var r=this[t+1]|this[t]<<8;return 32768&r?4294901760|r:r},f.prototype.readInt32LE=function(t,e){return e||U(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},f.prototype.readInt32BE=function(t,e){return e||U(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},f.prototype.readFloatLE=function(t,e){return e||U(t,4,this.length),i.read(this,t,!0,23,4)},f.prototype.readFloatBE=function(t,e){return e||U(t,4,this.length),i.read(this,t,!1,23,4)},f.prototype.readDoubleLE=function(t,e){return e||U(t,8,this.length),i.read(this,t,!0,52,8)},f.prototype.readDoubleBE=function(t,e){return e||U(t,8,this.length),i.read(this,t,!1,52,8)},f.prototype.writeUIntLE=function(t,e,r,n){(t=+t,e|=0,r|=0,n)||k(this,t,e,r,Math.pow(2,8*r)-1,0);var i=1,o=0;for(this[e]=255&t;++o<r&&(i*=256);)this[e+o]=t/i&255;return e+r},f.prototype.writeUIntBE=function(t,e,r,n){(t=+t,e|=0,r|=0,n)||k(this,t,e,r,Math.pow(2,8*r)-1,0);var i=r-1,o=1;for(this[e+i]=255&t;--i>=0&&(o*=256);)this[e+i]=t/o&255;return e+r},f.prototype.writeUInt8=function(t,e,r){return t=+t,e|=0,r||k(this,t,e,1,255,0),f.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),this[e]=255&t,e+1},f.prototype.writeUInt16LE=function(t,e,r){return t=+t,e|=0,r||k(this,t,e,2,65535,0),f.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8):O(this,t,e,!0),e+2},f.prototype.writeUInt16BE=function(t,e,r){return t=+t,e|=0,r||k(this,t,e,2,65535,0),f.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=255&t):O(this,t,e,!1),e+2},f.prototype.writeUInt32LE=function(t,e,r){return t=+t,e|=0,r||k(this,t,e,4,4294967295,0),f.TYPED_ARRAY_SUPPORT?(this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=255&t):C(this,t,e,!0),e+4},f.prototype.writeUInt32BE=function(t,e,r){return t=+t,e|=0,r||k(this,t,e,4,4294967295,0),f.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t):C(this,t,e,!1),e+4},f.prototype.writeIntLE=function(t,e,r,n){if(t=+t,e|=0,!n){var i=Math.pow(2,8*r-1);k(this,t,e,r,i-1,-i)}var o=0,a=1,u=0;for(this[e]=255&t;++o<r&&(a*=256);)t<0&&0===u&&0!==this[e+o-1]&&(u=1),this[e+o]=(t/a>>0)-u&255;return e+r},f.prototype.writeIntBE=function(t,e,r,n){if(t=+t,e|=0,!n){var i=Math.pow(2,8*r-1);k(this,t,e,r,i-1,-i)}var o=r-1,a=1,u=0;for(this[e+o]=255&t;--o>=0&&(a*=256);)t<0&&0===u&&0!==this[e+o+1]&&(u=1),this[e+o]=(t/a>>0)-u&255;return e+r},f.prototype.writeInt8=function(t,e,r){return t=+t,e|=0,r||k(this,t,e,1,127,-128),f.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),t<0&&(t=255+t+1),this[e]=255&t,e+1},f.prototype.writeInt16LE=function(t,e,r){return t=+t,e|=0,r||k(this,t,e,2,32767,-32768),f.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8):O(this,t,e,!0),e+2},f.prototype.writeInt16BE=function(t,e,r){return t=+t,e|=0,r||k(this,t,e,2,32767,-32768),f.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=255&t):O(this,t,e,!1),e+2},f.prototype.writeInt32LE=function(t,e,r){return t=+t,e|=0,r||k(this,t,e,4,2147483647,-2147483648),f.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24):C(this,t,e,!0),e+4},f.prototype.writeInt32BE=function(t,e,r){return t=+t,e|=0,r||k(this,t,e,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),f.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t):C(this,t,e,!1),e+4},f.prototype.writeFloatLE=function(t,e,r){return D(this,t,e,!0,r)},f.prototype.writeFloatBE=function(t,e,r){return D(this,t,e,!1,r)},f.prototype.writeDoubleLE=function(t,e,r){return j(this,t,e,!0,r)},f.prototype.writeDoubleBE=function(t,e,r){return j(this,t,e,!1,r)},f.prototype.copy=function(t,e,r,n){if(r||(r=0),n||0===n||(n=this.length),e>=t.length&&(e=t.length),e||(e=0),n>0&&n<r&&(n=r),n===r)return 0;if(0===t.length||0===this.length)return 0;if(e<0)throw new RangeError("targetStart out of bounds");if(r<0||r>=this.length)throw new RangeError("sourceStart out of bounds");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),t.length-e<n-r&&(n=t.length-e+r);var i,o=n-r;if(this===t&&r<e&&e<n)for(i=o-1;i>=0;--i)t[i+e]=this[i+r];else if(o<1e3||!f.TYPED_ARRAY_SUPPORT)for(i=0;i<o;++i)t[i+e]=this[i+r];else Uint8Array.prototype.set.call(t,this.subarray(r,r+o),e);return o},f.prototype.fill=function(t,e,r,n){if("string"==typeof t){if("string"==typeof e?(n=e,e=0,r=this.length):"string"==typeof r&&(n=r,r=this.length),1===t.length){var i=t.charCodeAt(0);i<256&&(t=i)}if(void 0!==n&&"string"!=typeof n)throw new TypeError("encoding must be a string");if("string"==typeof n&&!f.isEncoding(n))throw new TypeError("Unknown encoding: "+n)}else"number"==typeof t&&(t&=255);if(e<0||this.length<e||this.length<r)throw new RangeError("Out of range index");if(r<=e)return this;var o;if(e>>>=0,r=void 0===r?this.length:r>>>0,t||(t=0),"number"==typeof t)for(o=e;o<r;++o)this[o]=t;else{var a=f.isBuffer(t)?t:F(new f(t,n).toString()),u=a.length;for(o=0;o<r-e;++o)this[o+e]=a[o%u]}return this};var L=/[^+\/0-9A-Za-z-_]/g;function Y(t){return t<16?"0"+t.toString(16):t.toString(16)}function F(t,e){var r;e=e||1/0;for(var n=t.length,i=null,o=[],a=0;a<n;++a){if((r=t.charCodeAt(a))>55295&&r<57344){if(!i){if(r>56319){(e-=3)>-1&&o.push(239,191,189);continue}if(a+1===n){(e-=3)>-1&&o.push(239,191,189);continue}i=r;continue}if(r<56320){(e-=3)>-1&&o.push(239,191,189),i=r;continue}r=65536+(i-55296<<10|r-56320)}else i&&(e-=3)>-1&&o.push(239,191,189);if(i=null,r<128){if((e-=1)<0)break;o.push(r)}else if(r<2048){if((e-=2)<0)break;o.push(r>>6|192,63&r|128)}else if(r<65536){if((e-=3)<0)break;o.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((e-=4)<0)break;o.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return o}function N(t){return n.toByteArray(function(t){if((t=function(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")}(t).replace(L,"")).length<2)return"";for(;t.length%4!=0;)t+="=";return t}(t))}function z(t,e,r,n){for(var i=0;i<n&&!(i+r>=e.length||i>=t.length);++i)e[i+r]=t[i];return i}}).call(this,r(2))},function(t,e,r){"use strict";e.byteLength=function(t){var e=s(t),r=e[0],n=e[1];return 3*(r+n)/4-n},e.toByteArray=function(t){var e,r,n=s(t),a=n[0],u=n[1],f=new o(function(t,e,r){return 3*(e+r)/4-r}(0,a,u)),l=0,c=u>0?a-4:a;for(r=0;r<c;r+=4)e=i[t.charCodeAt(r)]<<18|i[t.charCodeAt(r+1)]<<12|i[t.charCodeAt(r+2)]<<6|i[t.charCodeAt(r+3)],f[l++]=e>>16&255,f[l++]=e>>8&255,f[l++]=255&e;2===u&&(e=i[t.charCodeAt(r)]<<2|i[t.charCodeAt(r+1)]>>4,f[l++]=255&e);1===u&&(e=i[t.charCodeAt(r)]<<10|i[t.charCodeAt(r+1)]<<4|i[t.charCodeAt(r+2)]>>2,f[l++]=e>>8&255,f[l++]=255&e);return f},e.fromByteArray=function(t){for(var e,r=t.length,i=r%3,o=[],a=0,u=r-i;a<u;a+=16383)o.push(c(t,a,a+16383>u?u:a+16383));1===i?(e=t[r-1],o.push(n[e>>2]+n[e<<4&63]+"==")):2===i&&(e=(t[r-2]<<8)+t[r-1],o.push(n[e>>10]+n[e>>4&63]+n[e<<2&63]+"="));return o.join("")};for(var n=[],i=[],o="undefined"!=typeof Uint8Array?Uint8Array:Array,a="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",u=0,f=a.length;u<f;++u)n[u]=a[u],i[a.charCodeAt(u)]=u;function s(t){var e=t.length;if(e%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var r=t.indexOf("=");return-1===r&&(r=e),[r,r===e?0:4-r%4]}function l(t){return n[t>>18&63]+n[t>>12&63]+n[t>>6&63]+n[63&t]}function c(t,e,r){for(var n,i=[],o=e;o<r;o+=3)n=(t[o]<<16&16711680)+(t[o+1]<<8&65280)+(255&t[o+2]),i.push(l(n));return i.join("")}i["-".charCodeAt(0)]=62,i["_".charCodeAt(0)]=63},function(t,e){
/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */
e.read=function(t,e,r,n,i){var o,a,u=8*i-n-1,f=(1<<u)-1,s=f>>1,l=-7,c=r?i-1:0,h=r?-1:1,p=t[e+c];for(c+=h,o=p&(1<<-l)-1,p>>=-l,l+=u;l>0;o=256*o+t[e+c],c+=h,l-=8);for(a=o&(1<<-l)-1,o>>=-l,l+=n;l>0;a=256*a+t[e+c],c+=h,l-=8);if(0===o)o=1-s;else{if(o===f)return a?NaN:1/0*(p?-1:1);a+=Math.pow(2,n),o-=s}return(p?-1:1)*a*Math.pow(2,o-n)},e.write=function(t,e,r,n,i,o){var a,u,f,s=8*o-i-1,l=(1<<s)-1,c=l>>1,h=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,p=n?0:o-1,v=n?1:-1,d=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(u=isNaN(e)?1:0,a=l):(a=Math.floor(Math.log(e)/Math.LN2),e*(f=Math.pow(2,-a))<1&&(a--,f*=2),(e+=a+c>=1?h/f:h*Math.pow(2,1-c))*f>=2&&(a++,f/=2),a+c>=l?(u=0,a=l):a+c>=1?(u=(e*f-1)*Math.pow(2,i),a+=c):(u=e*Math.pow(2,c-1)*Math.pow(2,i),a=0));i>=8;t[r+p]=255&u,p+=v,u/=256,i-=8);for(a=a<<i|u,s+=i;s>0;t[r+p]=255&a,p+=v,a/=256,s-=8);t[r+p-v]|=128*d}},function(t,e){var r={}.toString;t.exports=Array.isArray||function(t){return"[object Array]"==r.call(t)}},function(t,e,r){"use strict";t.exports=function(t,e){e<=4*n?i(0,e-1,t):function t(e,r,c){var h=(r-e+1)/6|0,p=e+h,v=r-h,d=e+r>>1,y=d-h,g=d+h,b=p,w=y,m=d,A=g,x=v,T=e+1,_=r-1,P=0;s(b,w,c)&&(P=b,b=w,w=P);s(A,x,c)&&(P=A,A=x,x=P);s(b,m,c)&&(P=b,b=m,m=P);s(w,m,c)&&(P=w,w=m,m=P);s(b,A,c)&&(P=b,b=A,A=P);s(m,A,c)&&(P=m,m=A,A=P);s(w,x,c)&&(P=w,w=x,x=P);s(w,m,c)&&(P=w,w=m,m=P);s(A,x,c)&&(P=A,A=x,x=P);var E=c[2*w];var I=c[2*w+1];var B=c[2*A];var S=c[2*A+1];var R=2*b;var U=2*m;var k=2*x;var O=2*p;var C=2*d;var M=2*v;for(var D=0;D<2;++D){var j=c[R+D],L=c[U+D],Y=c[k+D];c[O+D]=j,c[C+D]=L,c[M+D]=Y}a(y,e,c);a(g,r,c);for(var F=T;F<=_;++F)if(l(F,E,I,c))F!==T&&o(F,T,c),++T;else if(!l(F,B,S,c))for(;;){if(l(_,B,S,c)){l(_,E,I,c)?(u(F,T,_,c),++T,--_):(o(F,_,c),--_);break}if(--_<F)break}f(e,T-1,E,I,c);f(r,_+1,B,S,c);T-2-e<=n?i(e,T-2,c):t(e,T-2,c);r-(_+2)<=n?i(_+2,r,c):t(_+2,r,c);_-T<=n?i(T,_,c):t(T,_,c)}(0,e-1,t)};var n=32;function i(t,e,r){for(var n=2*(t+1),i=t+1;i<=e;++i){for(var o=r[n++],a=r[n++],u=i,f=n-2;u-- >t;){var s=r[f-2],l=r[f-1];if(s<o)break;if(s===o&&l<a)break;r[f]=s,r[f+1]=l,f-=2}r[f]=o,r[f+1]=a}}function o(t,e,r){e*=2;var n=r[t*=2],i=r[t+1];r[t]=r[e],r[t+1]=r[e+1],r[e]=n,r[e+1]=i}function a(t,e,r){e*=2,r[t*=2]=r[e],r[t+1]=r[e+1]}function u(t,e,r,n){e*=2,r*=2;var i=n[t*=2],o=n[t+1];n[t]=n[e],n[t+1]=n[e+1],n[e]=n[r],n[e+1]=n[r+1],n[r]=i,n[r+1]=o}function f(t,e,r,n,i){e*=2,i[t*=2]=i[e],i[e]=r,i[t+1]=i[e+1],i[e+1]=n}function s(t,e,r){e*=2;var n=r[t*=2],i=r[e];return!(n<i)&&(n!==i||r[t+1]>r[e+1])}function l(t,e,r,n){var i=n[t*=2];return i<e||i===e&&n[t+1]<r}},function(t,e,r){"use strict";t.exports=function(t,e,r,o,l,I,B,S,R){!function(t,e){var r=8*i.log2(e+1)*(t+1)|0,o=i.nextPow2(m*r);x.length<o&&(n.free(x),x=n.mallocInt32(o));var a=i.nextPow2(A*r);T.length<a&&(n.free(T),T=n.mallocDouble(a))}(t,o+B);var U,k=0,O=2*t;_(k++,0,0,o,0,B,r?16:0,-1/0,1/0),r||_(k++,0,0,B,0,o,1,-1/0,1/0);for(;k>0;){var C=(k-=1)*m,M=x[C],D=x[C+1],j=x[C+2],L=x[C+3],Y=x[C+4],F=x[C+5],N=k*A,z=T[N],G=T[N+1],V=1&F,H=!!(16&F),q=l,X=I,$=S,Z=R;if(V&&(q=S,X=R,$=l,Z=I),!(2&F&&(j=y(t,M,D,j,q,X,G),D>=j)||4&F&&(D=g(t,M,D,j,q,X,z))>=j)){var J=j-D,Q=Y-L;if(H){if(t*J*(J+Q)<p){if(void 0!==(U=f.scanComplete(t,M,e,D,j,q,X,L,Y,$,Z)))return U;continue}}else{if(t*Math.min(J,Q)<c){if(void 0!==(U=a(t,M,e,V,D,j,q,X,L,Y,$,Z)))return U;continue}if(t*J*Q<h){if(void 0!==(U=f.scanBipartite(t,M,e,V,D,j,q,X,L,Y,$,Z)))return U;continue}}var K=v(t,M,D,j,q,X,z,G);if(D<K)if(t*(K-D)<c){if(void 0!==(U=u(t,M+1,e,D,K,q,X,L,Y,$,Z)))return U}else if(M===t-2){if(void 0!==(U=V?f.sweepBipartite(t,e,L,Y,$,Z,D,K,q,X):f.sweepBipartite(t,e,D,K,q,X,L,Y,$,Z)))return U}else _(k++,M+1,D,K,L,Y,V,-1/0,1/0),_(k++,M+1,L,Y,D,K,1^V,-1/0,1/0);if(K<j){var W=s(t,M,L,Y,$,Z),tt=$[O*W+M],et=d(t,M,W,Y,$,Z,tt);if(et<Y&&_(k++,M,K,j,et,Y,(4|V)+(H?16:0),tt,G),L<W&&_(k++,M,K,j,L,W,(2|V)+(H?16:0),z,tt),W+1===et){if(void 0!==(U=H?E(t,M,e,K,j,q,X,W,$,Z[W]):P(t,M,e,V,K,j,q,X,W,$,Z[W])))return U}else if(W<et){var rt;if(H){if(rt=b(t,M,K,j,q,X,tt),K<rt){var nt=d(t,M,K,rt,q,X,tt);if(M===t-2){if(K<nt&&void 0!==(U=f.sweepComplete(t,e,K,nt,q,X,W,et,$,Z)))return U;if(nt<rt&&void 0!==(U=f.sweepBipartite(t,e,nt,rt,q,X,W,et,$,Z)))return U}else K<nt&&_(k++,M+1,K,nt,W,et,16,-1/0,1/0),nt<rt&&(_(k++,M+1,nt,rt,W,et,0,-1/0,1/0),_(k++,M+1,W,et,nt,rt,1,-1/0,1/0))}}else rt=V?w(t,M,K,j,q,X,tt):b(t,M,K,j,q,X,tt),K<rt&&(M===t-2?U=V?f.sweepBipartite(t,e,W,et,$,Z,K,rt,q,X):f.sweepBipartite(t,e,K,rt,q,X,W,et,$,Z):(_(k++,M+1,K,rt,W,et,V,-1/0,1/0),_(k++,M+1,W,et,K,rt,1^V,-1/0,1/0)))}}}}};var n=r(0),i=r(1),o=r(13),a=o.partial,u=o.full,f=r(3),s=r(14),l=r(4),c=128,h=1<<22,p=1<<22,v=l("!(lo>=p0)&&!(p1>=hi)",["p0","p1"]),d=l("lo===p0",["p0"]),y=l("lo<p0",["p0"]),g=l("hi<=p0",["p0"]),b=l("lo<=p0&&p0<=hi",["p0"]),w=l("lo<p0&&p0<=hi",["p0"]),m=6,A=2,x=n.mallocInt32(1024),T=n.mallocDouble(1024);function _(t,e,r,n,i,o,a,u,f){var s=m*t;x[s]=e,x[s+1]=r,x[s+2]=n,x[s+3]=i,x[s+4]=o,x[s+5]=a;var l=A*t;T[l]=u,T[l+1]=f}function P(t,e,r,n,i,o,a,u,f,s,l){var c=2*t,h=f*c,p=s[h+e];t:for(var v=i,d=i*c;v<o;++v,d+=c){var y=a[d+e],g=a[d+e+t];if(!(p<y||g<p)&&(!n||p!==y)){for(var b,w=u[v],m=e+1;m<t;++m){y=a[d+m],g=a[d+m+t];var A=s[h+m],x=s[h+m+t];if(g<A||x<y)continue t}if(void 0!==(b=n?r(l,w):r(w,l)))return b}}}function E(t,e,r,n,i,o,a,u,f,s){var l=2*t,c=u*l,h=f[c+e];t:for(var p=n,v=n*l;p<i;++p,v+=l){var d=a[p];if(d!==s){var y=o[v+e],g=o[v+e+t];if(!(h<y||g<h)){for(var b=e+1;b<t;++b){y=o[v+b],g=o[v+b+t];var w=f[c+b],m=f[c+b+t];if(g<w||m<y)continue t}var A=r(d,s);if(void 0!==A)return A}}}}},function(t,e,r){"use strict";var n="d",i="ax",o="vv",a="fp",u="es",f="rs",s="re",l="rb",c="ri",h="rp",p="bs",v="be",d="bb",y="bi",g="bp",b="rv",w="Q",m=[n,i,o,f,s,l,c,p,v,d,y];function A(t){var e="bruteForce"+(t?"Full":"Partial"),r=[],A=m.slice();t||A.splice(3,0,a);var x=["function "+e+"("+A.join()+"){"];function T(e,a){var A=function(t,e,r){var a="bruteForce"+(t?"Red":"Blue")+(e?"Flip":"")+(r?"Full":""),A=["function ",a,"(",m.join(),"){","var ",u,"=2*",n,";"],x="for(var i="+f+","+h+"="+u+"*"+f+";i<"+s+";++i,"+h+"+="+u+"){var x0="+l+"["+i+"+"+h+"],x1="+l+"["+i+"+"+h+"+"+n+"],xi="+c+"[i];",T="for(var j="+p+","+g+"="+u+"*"+p+";j<"+v+";++j,"+g+"+="+u+"){var y0="+d+"["+i+"+"+g+"],"+(r?"y1="+d+"["+i+"+"+g+"+"+n+"],":"")+"yi="+y+"[j];";return t?A.push(x,w,":",T):A.push(T,w,":",x),r?A.push("if(y1<x0||x1<y0)continue;"):e?A.push("if(y0<=x0||x1<y0)continue;"):A.push("if(y0<x0||x1<y0)continue;"),A.push("for(var k="+i+"+1;k<"+n+";++k){var r0="+l+"[k+"+h+"],r1="+l+"[k+"+n+"+"+h+"],b0="+d+"[k+"+g+"],b1="+d+"[k+"+n+"+"+g+"];if(r1<b0||b1<r0)continue "+w+";}var "+b+"="+o+"("),e?A.push("yi,xi"):A.push("xi,yi"),A.push(");if("+b+"!==void 0)return "+b+";}}}"),{name:a,code:A.join("")}}(e,a,t);r.push(A.code),x.push("return "+A.name+"("+m.join()+");")}x.push("if("+s+"-"+f+">"+v+"-"+p+"){"),t?(T(!0,!1),x.push("}else{"),T(!1,!1)):(x.push("if("+a+"){"),T(!0,!0),x.push("}else{"),T(!0,!1),x.push("}}else{if("+a+"){"),T(!1,!0),x.push("}else{"),T(!1,!1),x.push("}")),x.push("}}return "+e);var _=r.join("")+x.join("");return new Function(_)()}e.partial=A(!1),e.full=A(!0)},function(t,e,r){"use strict";t.exports=function(t,e,r,a,u,f){if(a<=r+1)return r;var s=r,l=a,c=a+r>>>1,h=2*t,p=c,v=u[h*c+e];for(;s<l;){if(l-s<i){o(t,e,s,l,u,f),v=u[h*c+e];break}var d=l-s,y=Math.random()*d+s|0,g=u[h*y+e],b=Math.random()*d+s|0,w=u[h*b+e],m=Math.random()*d+s|0,A=u[h*m+e];g<=w?A>=w?(p=b,v=w):g>=A?(p=y,v=g):(p=m,v=A):w>=A?(p=b,v=w):A>=g?(p=y,v=g):(p=m,v=A);for(var x=h*(l-1),T=h*p,_=0;_<h;++_,++x,++T){var P=u[x];u[x]=u[T],u[T]=P}var E=f[l-1];f[l-1]=f[p],f[p]=E,p=n(t,e,s,l-1,u,f,v);for(var x=h*(l-1),T=h*p,_=0;_<h;++_,++x,++T){var P=u[x];u[x]=u[T],u[T]=P}var E=f[l-1];if(f[l-1]=f[p],f[p]=E,c<p){for(l=p-1;s<l&&u[h*(l-1)+e]===v;)l-=1;l+=1}else{if(!(p<c))break;for(s=p+1;s<l&&u[h*s+e]===v;)s+=1}}return n(t,e,r,c,u,f,u[h*c+e])};var n=r(4)("lo<p0",["p0"]),i=8;function o(t,e,r,n,i,o){for(var a=2*t,u=a*(r+1)+e,f=r+1;f<n;++f,u+=a)for(var s=i[u],l=f,c=a*(f-1);l>r&&i[c+e]>s;--l,c-=a){for(var h=c,p=c+a,v=0;v<a;++v,++h,++p){var d=i[h];i[h]=i[p],i[p]=d}var y=o[l];o[l]=o[l-1],o[l-1]=y}}},function(t,e,r){"use strict";r.r(e),window.higlassTracks=window.higlassTracks||{},window.higlassTracksByType=window.higlassTracksByType||{};const n=()=>Math.random().toString(36).substring(2,8);var i=(t,{force:e=!1}={})=>{let r=n();for(;window.higlassTracks[r];)r=n();t.name=r,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},o=r(5),a=r.n(o),u=function(){return function(t,e){if(Array.isArray(t))return t;if(Symbol.iterator in Object(t))return function(t,e){var r=[],n=!0,i=!1,o=void 0;try{for(var a,u=t[Symbol.iterator]();!(n=(a=u.next()).done)&&(r.push(a.value),!e||r.length!==e);n=!0);}catch(t){i=!0,o=t}finally{try{!n&&u.return&&u.return()}finally{if(i)throw o}}return r}(t,e);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),f=function(){function t(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}return function(e,r,n){return r&&t(e.prototype,r),n&&t(e,n),e}}(),s=function t(e,r,n){null===e&&(e=Function.prototype);var i=Object.getOwnPropertyDescriptor(e,r);if(void 0===i){var o=Object.getPrototypeOf(e);return null===o?void 0:t(o,r,n)}if("value"in i)return i.value;var a=i.get;return void 0!==a?a.call(n):void 0};function l(t){if(Array.isArray(t)){for(var e=0,r=Array(t.length);e<t.length;e++)r[e]=t[e];return r}return Array.from(t)}var c=function(t){for(var e=arguments.length,r=Array(e>1?e-1:0),n=1;n<e;n++)r[n-1]=arguments[n];if(!new.target)throw new Error('Uncaught TypeError: Class constructor cannot be invoked without "new"');var i=t.libraries,o=i.PIXI,c=i.slugid,h=i.d3Color,p=i.d3Scale,v=function(e){function r(t,e){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,r);var n=function(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}(this,(r.__proto__||Object.getPrototypeOf(r)).call(this,t,e));return n.texts={},n.boxes={},n.colors={},n.pointData={},n.labelPositions={},n.pointPositions={},n.hoverGraphics=new o.Graphics,n.pMain.addChild(n.hoverGraphics),n.hoverGraphics.setParent(n.pMain),n}return function(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)}(r,t.tracks.Annotations2dTrack),f(r,[{key:"initTile",value:function(t){try{var e=!0,r=!1,n=void 0;try{for(var i,o=t.tileData[Symbol.iterator]();!(e=(i=o.next()).done);e=!0){var a=i.value;"uid"in a||(a.uid=c.nice()),this.pointData[a.uid]=a}}catch(t){r=!0,n=t}finally{try{!e&&o.return&&o.return()}finally{if(r)throw n}}}catch(e){console.warn("tile.tileData is not iterable:",t.tileData)}this.options.colorField&&this.options.colorScale&&this.buildColorScale(t.tileData)}},{key:"buildColorScale",value:function(t){this.colors||(this.colors={});var e=this.options.colorField,r=this.options.colorScale;if("categorical"===r.type){var n=r.map;if(!n){var i=[].concat(l(new Set(t.map(function(t){return t[e]}).filter(function(t){return null!=t})))),o=["#1f77b4","#ff7f0e","#2ca02c","#d62728","#9467bd","#8c564b","#e377c2","#7f7f7f","#bcbd22","#17becf"];n={},i.forEach(function(t,e){n[t]=o[e%o.length]})}var a=!0,u=!1,f=void 0;try{for(var s,c=t[Symbol.iterator]();!(a=(s=c.next()).done);a=!0){var h=s.value,v=h[e],d=n[v]||"black";this.colors[h.uid]=this.colorToHex(d)}}catch(t){u=!0,f=t}finally{try{!a&&c.return&&c.return()}finally{if(u)throw f}}}else if("quantitative"===r.type){var y=t.map(function(t){return t[e]}).filter(function(t){return null!=t}),g=void 0!==r.min?r.min:Math.min.apply(Math,l(y)),b=void 0!==r.max?r.max:Math.max.apply(Math,l(y)),w=r.colors||["white","black"],m=p.scaleLinear().domain(w.map(function(t,e){return g+(b-g)*e/(w.length-1)})).range(w),A=!0,x=!1,T=void 0;try{for(var _,P=t[Symbol.iterator]();!(A=(_=P.next()).done);A=!0){var E=_.value,I=E[e];null!=I?this.colors[E.uid]=this.colorToHex(m(I)):this.colors[E.uid]=0}}catch(t){x=!0,T=t}finally{try{!A&&P.return&&P.return()}finally{if(x)throw T}}}}},{key:"colorToHex",value:function(t){var e=h.color(t).rgb();return e.r<<16|e.g<<8|e.b}},{key:"getPointColor",value:function(t){return this.colors[t.uid]||0}},{key:"getPointSize",value:function(t){var e=this.options.sizeField,r=this.options.defaultSize||6;return e&&null!=t[e]?t[e]:r}},{key:"getMouseOverHtml",value:function(t,e){var r=this.getMouseOverUids(t,e);if(!r||!r[0]||!this.pointData[r[0]])return"";var n=this.pointData[r[0]];return'<table style="font-size: 12px;">'+Object.entries(n).filter(function(t){return"uid"!==u(t,1)[0]}).map(function(t){var e=u(t,2);return'<tr><td style="padding: 2px 8px 2px 0; font-weight: bold;">'+e[0]+':</td><td style="padding: 2px 0;">'+e[1]+"</td></tr>"}).join("")+"</table>"}},{key:"getMouseOverUids",value:function(t,e){if(!this.tilesetInfo)return null;var r=null,n=5;for(var i in this.pointPositions){var o=u(this.pointPositions[i],2),a=o[0],f=o[1],s=Math.sqrt(Math.pow(t-a,2)+Math.pow(e-f,2));s<n&&(n=s,r=i)}return[r]}},{key:"itemsHovered",value:function(t){if(this.hoverGraphics.clear(),t&&t.length){this.pMain.setChildIndex(this.hoverGraphics,this.pMain.children.length-1),this.hoverGraphics.lineStyle(2,16711680);var e=!0,r=!1,n=void 0;try{for(var i,o=t[Symbol.iterator]();!(e=(i=o.next()).done);e=!0){var a=i.value;if(a&&this.pointPositions[a]&&this.pointData[a]){var f=u(this.pointPositions[a],2),s=f[0],l=f[1],c=this.getPointSize(this.pointData[a]);"circle"===this.options.pointShape?this.hoverGraphics.drawCircle(s,l,c/2+2):this.hoverGraphics.drawRect(s-c/2-2,l-c/2-2,c+4,c+4)}}}catch(t){r=!0,n=t}finally{try{!e&&o.return&&o.return()}finally{if(r)throw n}}this.animate()}}},{key:"getLabelOffset",value:function(t,e,r){var n=this.options.labelPosition||"top-right",i=n;if("random"===n){if(!this.labelPositions[r]){this.labelPositions[r]=["top-right","top-left","bottom-left","bottom-right"][Math.floor(4*Math.random())]}i=this.labelPositions[r]}var o={"top-right":[0,-e],"top-left":[-t,-e],"bottom-left":[-t,0],"bottom-right":[0,0]};return o[i]||o["top-right"]}},{key:"getText",value:function(t,e){if(this.texts||(this.texts={}),this.boxes||(this.boxes={}),e.uid in this.texts)return this.texts[e.uid].text;var r=this.options.labelField||"data",n=new o.Text(""+e[r],{fontSize:"13px",fontFamily:"Arial",fill:0,stroke:16777215,strokeThickness:3});this.texts[e.uid]={text:n,importance:e.importance},t.graphics.addChild(n),n.updateTransform();var i=n.getBounds(),a=[i.x,i.y,i.x+i.width,i.y+i.height];return this.boxes[e.uid]=a,this.allTexts=Object.values(this.texts),this.allBoxes=Object.values(this.boxes),n}},{key:"destroyTile",value:function(t){try{var e=!0,r=!1,n=void 0;try{for(var i,o=t.tileData[Symbol.iterator]();!(e=(i=o.next()).done);e=!0){var a=i.value;a.uid in this.texts&&(t.graphics.removeChild(this.texts[a.uid]),delete this.texts[a.uid],delete this.boxes[a.uid],delete this.colors[a.uid],delete this.pointData[a.uid],delete this.labelPositions[a.uid],delete this.pointPositions[a.uid])}}catch(t){r=!0,n=t}finally{try{!e&&o.return&&o.return()}finally{if(r)throw n}}}catch(t){}}},{key:"calculateVisibleTiles",value:function(){return s(r.prototype.__proto__||Object.getPrototypeOf(r.prototype),"calculateVisibleTiles",this).call(this)}},{key:"draw",value:function(){s(r.prototype.__proto__||Object.getPrototypeOf(r.prototype),"draw",this).call(this),this.allBoxes=Object.values(this.boxes),this.allTexts=Object.values(this.texts),this.hideOverlaps(this.allBoxes,this.allTexts)}},{key:"drawTile",value:function(t){if(t.graphics.clear(),t.tileData.length){var e=!0,r=!1,n=void 0;try{for(var i,o=t.tileData[Symbol.iterator]();!(e=(i=o.next()).done);e=!0){var a=i.value,f=this.options.xPosField||"x",s=this.options.yPosField||"y",l=this._xScale(a[f]),c=this._yScale(a[s]),h=this.getPointColor(a),p=this.getPointSize(a);t.graphics.beginFill(h),"circle"===this.options.pointShape?t.graphics.drawCircle(l,c,p/2):t.graphics.drawRect(l-p/2,c-p/2,p,p),t.graphics.endFill();var v=this.getText(t,a),d=this.boxes[a.uid],y=d[2]-d[0],g=d[3]-d[1],b=this.getLabelOffset(y,g,a.uid),w=u(b,2),m=w[0],A=w[1];v.x=l+m,v.y=c+A,d[0]=l+m,d[1]=c+A,d[2]=l+m+y,d[3]=c+A+g,this.pointPositions[a.uid]=[l,c]}}catch(t){r=!0,n=t}finally{try{!e&&o.return&&o.return()}finally{if(r)throw n}}}}},{key:"zoomed",value:function(t,e){this.xScale(t),this.yScale(e),this.refreshTiles(),this.draw()}},{key:"hideOverlaps",value:function(t,e){if(t&&e&&t.length!==e.length&&console.warn("uneven lengths:",t.length,e.length),e)for(var r=0;r<e.length;r++)e[r].text.visible=!0;a()(t,function(t,r){e[t].importance>e[r].importance?e[r].text.visible=!1:e[t].text.visible=!1})}},{key:"click",value:function(t,e,r){var n=this.getMouseOverUids(t,e),i=n&&n[0];return{type:"labelled-points",event:r,payload:i?this.pointData[i]:null}}},{key:"clickOutside",value:function(){}},{key:"exportSVG",value:function(){var t=null,e=null;if(s(r.prototype.__proto__||Object.getPrototypeOf(r.prototype),"exportSVG",this)){var n=s(r.prototype.__proto__||Object.getPrototypeOf(r.prototype),"exportSVG",this).call(this),i=u(n,2);e=i[0],t=i[1]}else t=e=document.createElement("g");var o=document.createElement("g");o.setAttribute("transform","translate("+this.position[0]+","+this.position[1]+")"),t.appendChild(o);var a=document.createElement("g"),f=document.createElement("g");o.appendChild(a),o.appendChild(f);var l=!0,c=!1,h=void 0;try{for(var p,v=this.allTexts[Symbol.iterator]();!(l=(p=v.next()).done);l=!0){var d=p.value.text;if(d.visible){var y=document.createElement("g"),g=document.createElement("text");a.appendChild(y),y.appendChild(g),y.setAttribute("transform","translate("+d.x+","+d.y+")"),g.setAttribute("text-anchor","start"),g.setAttribute("dy","16px"),g.setAttribute("dx","4px"),g.setAttribute("font-family","Arial"),g.setAttribute("font-size",12),g.innerHTML=d.text}}}catch(t){c=!0,h=t}finally{try{!l&&v.return&&v.return()}finally{if(c)throw h}}for(var b in this.boxes){var w=this.boxes[b],m=this.colors[b]||0,A=this.pointData[b]?this.getPointSize(this.pointData[b]):this.options.defaultSize||6;if("circle"===this.options.pointShape){var x=document.createElement("circle");x.setAttribute("cx",w[0]),x.setAttribute("cy",w[1]),x.setAttribute("r",A/2),x.setAttribute("fill","#"+m.toString(16).padStart(6,"0")),f.appendChild(x)}else{var T=document.createElement("rect");T.setAttribute("x",w[0]),T.setAttribute("y",w[1]),T.setAttribute("width",A),T.setAttribute("height",A),T.setAttribute("fill","#"+m.toString(16).padStart(6,"0")),f.appendChild(T)}}return[e,e]}},{key:"minY",get:function(){return this.tilesetInfo&&this.tilesetInfo.min_pos?this.tilesetInfo.min_pos[1]:0}},{key:"maxY",get:function(){return this.tilesetInfo&&this.tilesetInfo.max_pos?this.tilesetInfo.max_pos[1]:this.tilesetInfo.max_width||this.tilesetInfo.max_size}}]),r}();return new(Function.prototype.bind.apply(v,[null].concat(r)))};c.config={type:"labelled-points-track",datatype:["scatter-point"],orientation:"2d",name:"LabelledPointsTrack",thumbnail:(new DOMParser).parseFromString('<svg viewBox="0 0 16 16" xmlns="http://www.w3.org/2000/svg" fill-rule="evenodd" clip-rule="evenodd" stroke-linecap="round" stroke-linejoin="round" stroke-miterlimit="1.5"><path d="M4 2.1L.5 3.5v12l5-2 5 2 5-2v-12l-5 2-3.17-1.268" fill="none" stroke="currentColor"/><path d="M10.5 3.5v12" fill="none" stroke="currentColor" stroke-opacity=".33" stroke-dasharray="1,2,0,0"/><path d="M5.5 13.5V6" fill="none" stroke="currentColor" stroke-opacity=".33" stroke-width=".9969299999999999" stroke-dasharray="1.71,3.43,0,0"/><path d="M9.03 5l.053.003.054.006.054.008.054.012.052.015.052.017.05.02.05.024 4 2 .048.026.048.03.046.03.044.034.042.037.04.04.037.04.036.042.032.045.03.047.028.048.025.05.022.05.02.053.016.053.014.055.01.055.007.055.005.055v.056l-.002.056-.005.055-.008.055-.01.055-.015.054-.017.054-.02.052-.023.05-.026.05-.028.048-.03.046-.035.044-.035.043-.038.04-4 4-.04.037-.04.036-.044.032-.045.03-.046.03-.048.024-.05.023-.05.02-.052.016-.052.015-.053.012-.054.01-.054.005-.055.003H8.97l-.053-.003-.054-.006-.054-.008-.054-.012-.052-.015-.052-.017-.05-.02-.05-.024-4-2-.048-.026-.048-.03-.046-.03-.044-.034-.042-.037-.04-.04-.037-.04-.036-.042-.032-.045-.03-.047-.028-.048-.025-.05-.022-.05-.02-.053-.016-.053-.014-.055-.01-.055-.007-.055L4 10.05v-.056l.002-.056.005-.055.008-.055.01-.055.015-.054.017-.054.02-.052.023-.05.026-.05.028-.048.03-.046.035-.044.035-.043.038-.04 4-4 .04-.037.04-.036.044-.032.045-.03.046-.03.048-.024.05-.023.05-.02.052-.016.052-.015.053-.012.054-.01.054-.005L8.976 5h.054zM5 10l4 2 4-4-4-2-4 4z" fill="currentColor"/><path d="M7.124 0C7.884 0 8.5.616 8.5 1.376v3.748c0 .76-.616 1.376-1.376 1.376H3.876c-.76 0-1.376-.616-1.376-1.376V1.376C2.5.616 3.116 0 3.876 0h3.248zm.56 5.295L5.965 1H5.05L3.375 5.295h.92l.354-.976h1.716l.375.975h.945zm-1.596-1.7l-.592-1.593-.58 1.594h1.172z" fill="currentColor"/></svg>',"text/xml").documentElement,availableOptions:["labelField","xPosField","yPosField","colorField","colorScale","pointShape","sizeField","defaultSize","labelPosition"],defaultOptions:{pointShape:"circle",sizeField:null,defaultSize:6,labelPosition:"top-right"},optionsInfo:{pointShape:{name:"Point Shape",inlineOptions:{circle:{value:"circle",name:"Circle"},square:{value:"square",name:"Square"}}},defaultSize:{name:"Default Point Size",inlineOptions:{1:{value:1,name:"1"},2:{value:2,name:"2"},3:{value:3,name:"3"},5:{value:5,name:"5"},8:{value:8,name:"8"},13:{value:13,name:"13"},21:{value:21,name:"21"}}},labelPosition:{name:"Label Position",inlineOptions:{"top-right":{value:"top-right",name:"Top Right"},"top-left":{value:"top-left",name:"Top Left"},"bottom-left":{value:"bottom-left",name:"Bottom Left"},"bottom-right":{value:"bottom-right",name:"Bottom Right"},random:{value:"random",name:"Random"}}}}};var h=c;i({name:"LabelledPointTrack",track:h,config:h.config});e.default=h}])});